diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-24 09:41:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-24 09:49:40 +0000 |
commit | 2544a2a810bc9182d5f062cafb41b5be96111982 (patch) | |
tree | fa1a1305e075c2ad09aca807eef48c1a9b2f993c /basctl/source | |
parent | 692c724f5e71f685c269085983828e7539274ecb (diff) |
convert organize macros dialog to .ui
Change-Id: I210ab0bb294ddfefc3f60cffe64b72e5d8fa4650
Diffstat (limited to 'basctl/source')
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 10 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.cxx | 79 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.hrc | 6 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.hxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.src | 56 |
5 files changed, 42 insertions, 113 deletions
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index b52eea9e0013..6ad6b4f8253d 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -506,7 +506,6 @@ LibPage::LibPage( Window * pParent ) ,aLibText( this, IDEResId( RID_STR_LIB ) ) ,aLibBox( this, IDEResId( RID_TRLBOX ) ) ,aEditButton( this, IDEResId( RID_PB_EDIT ) ) - ,aCloseButton( this, IDEResId( RID_PB_CLOSE ) ) ,aPasswordButton( this, IDEResId( RID_PB_PASSWORD ) ) ,aNewLibButton( this, IDEResId( RID_PB_NEWLIB ) ) ,aInsertLibButton( this, IDEResId( RID_PB_APPEND ) ) @@ -524,7 +523,6 @@ LibPage::LibPage( Window * pParent ) aExportButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); aInsertLibButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); aDelButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); - aCloseButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); aLibBox.SetSelectHdl( LINK( this, LibPage, TreeListHighlightHdl ) ); aBasicsBox.SetSelectHdl( LINK( this, LibPage, BasicSelectHdl ) ); @@ -532,7 +530,6 @@ LibPage::LibPage( Window * pParent ) aLibBox.SetMode(ObjectMode::Module); aLibBox.EnableInplaceEditing(true); aLibBox.SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP ); - aCloseButton.GrabFocus(); long aTabs[] = { 2, 30, 120 }; aLibBox.SetTabs( aTabs, MAP_PIXEL ); @@ -581,8 +578,6 @@ void LibPage::CheckButtons() aInsertLibButton.Enable(); aExportButton.Disable(); aDelButton.Disable(); - if ( !aLibBox.HasFocus() ) - aCloseButton.GrabFocus(); } else if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) ) || ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) ) ) @@ -676,11 +671,6 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton ) Export(); else if ( pButton == &aDelButton ) DeleteCurrent(); - else if ( pButton == &aCloseButton ) - { - EndTabDialog( 0 ); - return 0; - } else if ( pButton == &aPasswordButton ) { SvTreeListEntry* pCurEntry = aLibBox.GetCurEntry(); diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 5cc8c5d38d72..c6808c50a884 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -459,27 +459,30 @@ sal_Bool ExtTreeListBox::NotifyCopyingMoving( SvTreeListEntry* pTarget, SvTreeLi // ============== // -OrganizeDialog::OrganizeDialog( Window* pParent, sal_Int16 tabId, EntryDescriptor& rDesc ) - :TabDialog( pParent, IDEResId( RID_TD_ORGANIZE ) ) - ,aTabCtrl( this, IDEResId( RID_TC_ORGANIZE ) ) - ,m_aCurEntry( rDesc ) +OrganizeDialog::OrganizeDialog(Window* pParent, sal_Int16 tabId, + EntryDescriptor& rDesc ) + : TabDialog( pParent, "OrganizeDialog", + "modules/BasicIDE/ui/organizedialog.ui" ) + , m_aCurEntry( rDesc ) { - FreeResource(); - aTabCtrl.SetActivatePageHdl( LINK( this, OrganizeDialog, ActivatePageHdl ) ); + get(m_pTabCtrl, "tabcontrol"); + + m_pTabCtrl->SetActivatePageHdl(LINK(this, OrganizeDialog, ActivatePageHdl)); + if( tabId == 0 ) { - aTabCtrl.SetCurPageId( RID_TP_MOD ); + m_pTabCtrl->SetCurPageId(m_pTabCtrl->GetPageId("modules")); } else if ( tabId == 1 ) { - aTabCtrl.SetCurPageId( RID_TP_DLG ); + m_pTabCtrl->SetCurPageId(m_pTabCtrl->GetPageId("dialogs")); } else { - aTabCtrl.SetCurPageId( RID_TP_LIB ); + m_pTabCtrl->SetCurPageId(m_pTabCtrl->GetPageId("libraries")); } - ActivatePageHdl( &aTabCtrl ); + ActivatePageHdl(m_pTabCtrl); if (SfxDispatcher* pDispatcher = GetDispatcher()) pDispatcher->Execute( SID_BASICIDE_STOREALLMODULESOURCES ); @@ -487,8 +490,8 @@ OrganizeDialog::OrganizeDialog( Window* pParent, sal_Int16 tabId, EntryDescripto OrganizeDialog::~OrganizeDialog() { - for ( sal_uInt16 i = 0; i < aTabCtrl.GetPageCount(); i++ ) - delete aTabCtrl.GetTabPage( aTabCtrl.GetPageId( i ) ); + for ( sal_uInt16 i = 0; i < m_pTabCtrl->GetPageCount(); i++ ) + delete m_pTabCtrl->GetTabPage( m_pTabCtrl->GetPageId( i ) ); }; short OrganizeDialog::Execute() @@ -507,33 +510,31 @@ IMPL_LINK( OrganizeDialog, ActivatePageHdl, TabControl *, pTabCtrl ) if ( !pTabCtrl->GetTabPage( nId ) ) { + OString sPageName(pTabCtrl->GetPageName(nId)); TabPage* pNewTabPage = 0; - switch ( nId ) + if (sPageName == "modules") { - case RID_TP_MOD: - { - ObjectPage* pObjectPage = new ObjectPage(pTabCtrl, IDEResId(RID_TP_MODULS), BROWSEMODE_MODULES); - pNewTabPage = pObjectPage; - pObjectPage->SetTabDlg(this); - pObjectPage->SetCurrentEntry(m_aCurEntry); - } - break; - case RID_TP_DLG: - { - ObjectPage* pObjectPage = new ObjectPage( pTabCtrl, IDEResId( RID_TP_DLGS ), BROWSEMODE_DIALOGS ); - pNewTabPage = pObjectPage; - pObjectPage->SetTabDlg(this); - pObjectPage->SetCurrentEntry(m_aCurEntry); - } - break; - case RID_TP_LIB: - { - LibPage* pLibPage = new LibPage( pTabCtrl ); - pNewTabPage = pLibPage; - pLibPage->SetTabDlg( this ); - } - break; - default: OSL_FAIL( "PageHdl: Unbekannte ID!" ); + ObjectPage* pObjectPage = new ObjectPage(pTabCtrl, IDEResId(RID_TP_MODULS), BROWSEMODE_MODULES); + pNewTabPage = pObjectPage; + pObjectPage->SetTabDlg(this); + pObjectPage->SetCurrentEntry(m_aCurEntry); + } + else if (sPageName == "dialogs") + { + ObjectPage* pObjectPage = new ObjectPage( pTabCtrl, IDEResId( RID_TP_DLGS ), BROWSEMODE_DIALOGS ); + pNewTabPage = pObjectPage; + pObjectPage->SetTabDlg(this); + pObjectPage->SetCurrentEntry(m_aCurEntry); + } + else if (sPageName == "libraries") + { + LibPage* pLibPage = new LibPage( pTabCtrl ); + pNewTabPage = pLibPage; + pLibPage->SetTabDlg( this ); + } + else + { + OSL_FAIL( "PageHdl: Unbekannte ID!" ); } DBG_ASSERT( pNewTabPage, "Keine Page!" ); pTabCtrl->SetTabPage( nId, pNewTabPage ); @@ -551,7 +552,6 @@ ObjectPage::ObjectPage( Window * pParent, const ResId& rResId, sal_uInt16 nMode aLibText( this, IDEResId( RID_STR_LIB ) ), aBasicBox( this, IDEResId( RID_TRLBOX ) ), aEditButton( this, IDEResId( RID_PB_EDIT ) ), - aCloseButton( this, IDEResId( RID_PB_CLOSE ) ), aNewModButton( this, IDEResId( RID_PB_NEWMOD ) ), aNewDlgButton( this, IDEResId( RID_PB_NEWDLG ) ), aDelButton( this, IDEResId( RID_PB_DELETE ) ) @@ -561,7 +561,6 @@ ObjectPage::ObjectPage( Window * pParent, const ResId& rResId, sal_uInt16 nMode aEditButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) ); aDelButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) ); - aCloseButton.SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) ); aBasicBox.SetSelectHdl( LINK( this, ObjectPage, BasicBoxHighlightHdl ) ); if( nMode & BROWSEMODE_MODULES ) @@ -724,8 +723,6 @@ IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton ) NewDialog(); else if ( pButton == &aDelButton ) DeleteCurrent(); - else if ( pButton == &aCloseButton ) - EndTabDialog( 0 ); return 0; } diff --git a/basctl/source/basicide/moduldlg.hrc b/basctl/source/basicide/moduldlg.hrc index 64ff5033c31c..acbc5422f24b 100644 --- a/basctl/source/basicide/moduldlg.hrc +++ b/basctl/source/basicide/moduldlg.hrc @@ -26,7 +26,7 @@ #define RID_TRLBOX 2 // free #define RID_PB_EDIT 4 -#define RID_PB_CLOSE 5 + #define RID_PB_NEWMOD 6 #define RID_PB_NEWDLG 7 #define RID_PB_DELETE 8 @@ -38,10 +38,6 @@ #define RID_PB_EXPORT 14 -#define RID_TP_MOD 20 -#define RID_TP_LIB 21 -#define RID_TP_DLG 22 - #define RID_TC_ORGANIZE 30 #define RID_PB_OK 31 diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx index 7ddb2d47b434..0ea6a2dac6e1 100644 --- a/basctl/source/basicide/moduldlg.hxx +++ b/basctl/source/basicide/moduldlg.hxx @@ -179,7 +179,7 @@ public: class OrganizeDialog : public TabDialog { private: - TabControl aTabCtrl; + TabControl* m_pTabCtrl; EntryDescriptor m_aCurEntry; public: @@ -197,7 +197,6 @@ protected: FixedText aLibText; ExtTreeListBox aBasicBox; PushButton aEditButton; - CancelButton aCloseButton; PushButton aNewModButton; PushButton aNewDlgButton; PushButton aDelButton; @@ -232,7 +231,6 @@ protected: FixedText aLibText; CheckBox aLibBox; PushButton aEditButton; - CancelButton aCloseButton; PushButton aPasswordButton; PushButton aNewLibButton; PushButton aInsertLibButton; diff --git a/basctl/source/basicide/moduldlg.src b/basctl/source/basicide/moduldlg.src index f5f8adee2e00..febc9b5fd658 100644 --- a/basctl/source/basicide/moduldlg.src +++ b/basctl/source/basicide/moduldlg.src @@ -20,38 +20,7 @@ #include "helpid.hrc" #include <moduldlg.hrc> #include <basidesh.hrc> -TabDialog RID_TD_ORGANIZE -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Text[ en-US ] = "%PRODUCTNAME Basic Macro Organizer"; - Moveable = TRUE ; - Closeable = TRUE ; - // Da Cancel-Button auf TabPage, nicht auf Dialog! - TabControl RID_TC_ORGANIZE - { - // HelpID = HID_BASICIDE_ORG_TC; - OutputSize = TRUE ; - PageList = - { - PageItem - { - Identifier = RID_TP_MOD ; - Text [ en-US ] = "Modules" ; - }; - PageItem - { - Identifier = RID_TP_DLG ; - Text [ en-US ] = "Dialogs" ; - }; - PageItem - { - Identifier = RID_TP_LIB ; - Text [ en-US ] = "Libraries" ; - }; - }; - }; -}; + TabPage RID_TP_MODULS { HelpId = "basctl:TabPage:RID_TP_MODULS" ; @@ -81,13 +50,6 @@ TabPage RID_TP_MODULS TabStop = TRUE ; DefButton = TRUE ; }; - CancelButton RID_PB_CLOSE - { - Text [ en-US ] = "Close"; - Pos = MAP_APPFONT ( 144 , 23 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - TabStop = TRUE ; - }; PushButton RID_PB_NEWMOD { HelpID = "basctl:PushButton:RID_TP_MODULS:RID_PB_NEWMOD"; @@ -142,13 +104,6 @@ TabPage RID_TP_DLGS TabStop = TRUE ; DefButton = TRUE ; }; - CancelButton RID_PB_CLOSE - { - Text[ en-US ] = "Close"; - Pos = MAP_APPFONT ( 144 , 23 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - TabStop = TRUE ; - }; PushButton RID_PB_NEWMOD { HelpID = "basctl:PushButton:RID_TP_DLGS:RID_PB_NEWMOD"; @@ -219,17 +174,10 @@ TabPage RID_TP_LIBS TabStop = TRUE ; DefButton = TRUE ; }; - CancelButton RID_PB_CLOSE - { - Text [ en-US ] = "Close"; - Pos = MAP_APPFONT ( 144 , 23 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - TabStop = TRUE ; - }; PushButton RID_PB_PASSWORD { HelpID = "basctl:PushButton:RID_TP_LIBS:RID_PB_PASSWORD"; - Pos = MAP_APPFONT ( 144 , 43 ) ; + Pos = MAP_APPFONT ( 144 , 23 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Password..." ; TabStop = TRUE ; |