diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-13 20:41:07 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-13 20:48:49 +0000 |
commit | 534425bfcd4c1ac08c780f417b1dd99baeac99b0 (patch) | |
tree | 1bd69a5f4912afef2096cf8a5760e5a966ab2842 /extensions/source | |
parent | 0a508c70745a9c8074878015a0300763f7265399 (diff) |
convert new data type dialog to .ui
Change-Id: Ia354e003903c20435947e82afa293a34a367773a
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/propctrlr/formresid.hrc | 1 | ||||
-rw-r--r-- | extensions/source/propctrlr/newdatatype.cxx | 21 | ||||
-rw-r--r-- | extensions/source/propctrlr/newdatatype.hrc | 32 | ||||
-rw-r--r-- | extensions/source/propctrlr/newdatatype.hxx | 18 | ||||
-rw-r--r-- | extensions/source/propctrlr/newdatatype.src | 69 |
5 files changed, 14 insertions, 127 deletions
diff --git a/extensions/source/propctrlr/formresid.hrc b/extensions/source/propctrlr/formresid.hrc index e5260bf9746e..befc4fc3911e 100644 --- a/extensions/source/propctrlr/formresid.hrc +++ b/extensions/source/propctrlr/formresid.hrc @@ -281,7 +281,6 @@ #define RID_DLG_TABORDER ( RID_PROPCONTROLLER_START + 1 ) #define RID_DLG_FORMLINKS ( RID_PROPCONTROLLER_START + 2 ) #define RID_DLG_SELECTION ( RID_PROPCONTROLLER_START + 3 ) -#define RID_DLG_NEW_DATA_TYPE ( RID_PROPCONTROLLER_START + 4 ) // - ImageLists diff --git a/extensions/source/propctrlr/newdatatype.cxx b/extensions/source/propctrlr/newdatatype.cxx index 28c95cbb4036..43638d7f103c 100644 --- a/extensions/source/propctrlr/newdatatype.cxx +++ b/extensions/source/propctrlr/newdatatype.cxx @@ -18,12 +18,9 @@ */ #include "newdatatype.hxx" -#include "newdatatype.hrc" - #include "modulepcr.hxx" #include "formresid.hrc" - namespace pcr { @@ -33,16 +30,14 @@ namespace pcr NewDataTypeDialog::NewDataTypeDialog( Window* _pParent, const OUString& _rNameBase, const ::std::vector< OUString >& _rProhibitedNames ) - :ModalDialog( _pParent, PcrRes( RID_DLG_NEW_DATA_TYPE ) ) - ,m_aLabel ( this, PcrRes( FT_LABEL ) ) - ,m_aName ( this, PcrRes( ED_NAME ) ) - ,m_aOK ( this, PcrRes( PB_OK ) ) - ,m_aCancel ( this, PcrRes( PB_CANCEL ) ) - ,m_aProhibitedNames( _rProhibitedNames.begin(), _rProhibitedNames.end() ) + : ModalDialog( _pParent, "DataTypeDialog", + "modules/spropctrlr/ui/datatypedialog.ui" ) + , m_aProhibitedNames( _rProhibitedNames.begin(), _rProhibitedNames.end() ) { - FreeResource(); + get(m_pName, "entry"); + get(m_pOK, "ok"); - m_aName.SetModifyHdl( LINK( this, NewDataTypeDialog, OnNameModified ) ); + m_pName->SetModifyHdl( LINK( this, NewDataTypeDialog, OnNameModified ) ); // find an initial name // for this, first remove trailing digits @@ -68,7 +63,7 @@ namespace pcr } while ( m_aProhibitedNames.find( sInitialName ) != m_aProhibitedNames.end() ); - m_aName.SetText( sInitialName ); + m_pName->SetText( sInitialName ); OnNameModified( NULL ); } @@ -79,7 +74,7 @@ namespace pcr bool bNameIsOK = ( !sCurrentName.isEmpty() ) && ( m_aProhibitedNames.find( sCurrentName ) == m_aProhibitedNames.end() ); - m_aOK.Enable( bNameIsOK ); + m_pOK->Enable( bNameIsOK ); return 0L; } diff --git a/extensions/source/propctrlr/newdatatype.hrc b/extensions/source/propctrlr/newdatatype.hrc deleted file mode 100644 index d79582286b8a..000000000000 --- a/extensions/source/propctrlr/newdatatype.hrc +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef EXTENSIONS_SOURCE_PROPCTRLR_NEWDATATYPE_HRC -#define EXTENSIONS_SOURCE_PROPCTRLR_NEWDATATYPE_HRC - -#define FT_LABEL 1 - -#define ED_NAME 2 - -#define PB_OK 1 -#define PB_CANCEL 2 - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/propctrlr/newdatatype.hxx b/extensions/source/propctrlr/newdatatype.hxx index 3d895ca9edef..5c83d6989ea7 100644 --- a/extensions/source/propctrlr/newdatatype.hxx +++ b/extensions/source/propctrlr/newdatatype.hxx @@ -31,26 +31,20 @@ namespace pcr { - - - //= NewDataTypeDialog - class NewDataTypeDialog : public ModalDialog { private: - FixedText m_aLabel; - Edit m_aName; - OKButton m_aOK; - CancelButton m_aCancel; + Edit* m_pName; + OKButton* m_pOK; - ::std::set< OUString > - m_aProhibitedNames; + ::std::set< OUString > m_aProhibitedNames; public: - NewDataTypeDialog( Window* _pParent, const OUString& _rNameBase, const ::std::vector< OUString >& _rProhibitedNames ); + NewDataTypeDialog(Window* _pParent, const OUString& _rNameBase, + const ::std::vector< OUString >& _rProhibitedNames ); - inline OUString GetName() const { return m_aName.GetText(); } + OUString GetName() const { return m_pName->GetText(); } private: DECL_LINK( OnNameModified, void* ); diff --git a/extensions/source/propctrlr/newdatatype.src b/extensions/source/propctrlr/newdatatype.src deleted file mode 100644 index 1aaaa0be44e4..000000000000 --- a/extensions/source/propctrlr/newdatatype.src +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "formresid.hrc" -#include "newdatatype.hrc" - -#define DIALOG_WIDTH 150 -#define DIALOG_HEIGHT 55 -#define BUTTON_WIDTH 50 -#define BUTTON_HEIGHT 14 - -ModalDialog RID_DLG_NEW_DATA_TYPE -{ - HelpID = "extensions:ModalDialog:RID_DLG_NEW_DATA_TYPE"; - OutputSize = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( DIALOG_WIDTH, DIALOG_HEIGHT ) ; - - Text [ en-US ] = "New Data Type"; - - FixedText FT_LABEL - { - Pos = MAP_APPFONT( 6, 6 ); - Size = MAP_APPFONT( DIALOG_WIDTH - 2 * 6, 8 ); - - Text [ en-US ] = "Type a name for the new data type:"; - }; - - Edit ED_NAME - { - HelpID = "extensions:Edit:RID_DLG_NEW_DATA_TYPE:ED_NAME"; - Pos = MAP_APPFONT( 6, 17 ); - Size = MAP_APPFONT( DIALOG_WIDTH - 2 * 6, 12 ); - Border = TRUE; - }; - - OKButton PB_OK - { - Pos = MAP_APPFONT( DIALOG_WIDTH - 6 - BUTTON_WIDTH - 3 - BUTTON_WIDTH, 35 ); - Size = MAP_APPFONT( BUTTON_WIDTH, BUTTON_HEIGHT ); - DefButton = TRUE; - }; - - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT( DIALOG_WIDTH - 6 - BUTTON_WIDTH, 35 ); - Size = MAP_APPFONT( BUTTON_WIDTH, BUTTON_HEIGHT ); - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |