diff options
-rw-r--r-- | basctl/Module_basctl.mk | 1 | ||||
-rw-r--r-- | basctl/UI_basicide.mk | 16 | ||||
-rw-r--r-- | basctl/inc/basidesh.hrc | 4 | ||||
-rw-r--r-- | basctl/source/basicide/bastype2.cxx | 26 | ||||
-rw-r--r-- | basctl/source/basicide/bastype2.hxx | 5 | ||||
-rw-r--r-- | basctl/source/basicide/macrodlg.cxx | 355 | ||||
-rw-r--r-- | basctl/source/basicide/macrodlg.hrc | 21 | ||||
-rw-r--r-- | basctl/source/basicide/macrodlg.hxx | 34 | ||||
-rw-r--r-- | basctl/source/basicide/macrodlg.src | 155 | ||||
-rw-r--r-- | basctl/uiconfig/basicide/ui/basicmacrodialog.ui | 384 | ||||
-rw-r--r-- | cui/uiconfig/ui/macroselectordialog.ui | 4 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 6 |
13 files changed, 631 insertions, 386 deletions
diff --git a/basctl/Module_basctl.mk b/basctl/Module_basctl.mk index 11cabbbbbde5..3542e2b461aa 100644 --- a/basctl/Module_basctl.mk +++ b/basctl/Module_basctl.mk @@ -39,6 +39,7 @@ endif $(eval $(call gb_Module_add_targets,basctl,\ Package_uiconfig \ + UI_basicide \ )) # vim: set noet sw=4 ts=4: diff --git a/basctl/UI_basicide.mk b/basctl/UI_basicide.mk new file mode 100644 index 000000000000..a808d92155d8 --- /dev/null +++ b/basctl/UI_basicide.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UI_UI,modules/BasicIDE)) + +$(eval $(call gb_UI_add_uifiles,modules/BasicIDE,\ + basctl/uiconfig/basicide/ui/basicmacrodialog \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc index b8fa629b896a..5c551b311083 100644 --- a/basctl/inc/basidesh.hrc +++ b/basctl/inc/basidesh.hrc @@ -69,10 +69,10 @@ #define RID_STR_RUNTIMEERROR ( RID_BASICIDE_START + 22 ) #define RID_STR_COMPILEERROR ( RID_BASICIDE_START + 23 ) #define RID_STR_STDDIALOGNAME ( RID_BASICIDE_START + 24 ) -#define RID_STR_STDMACRONAME ( RID_BASICIDE_START + 25 ) + #define RID_STR_STDMODULENAME ( RID_BASICIDE_START + 27 ) #define RID_STR_ALL ( RID_BASICIDE_START + 28 ) -#define RID_STR_CLOSE ( RID_BASICIDE_START + 29 ) + #define RID_STR_PAGE ( RID_BASICIDE_START + 30 ) #define RID_STR_BADSBXNAME ( RID_BASICIDE_START + 31 ) #define RID_STR_STDLIBNAME ( RID_BASICIDE_START + 32 ) diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index feac68eaaa6d..285aefccdbc1 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -20,7 +20,8 @@ #include <memory> -#include "vcl/bitmap.hxx" +#include <vcl/bitmap.hxx> +#include <vcl/builder.hxx> #include "basidesh.hxx" #include "iderdll.hxx" @@ -184,15 +185,32 @@ bool EntryDescriptor::operator == (EntryDescriptor const& rDesc) const // =========== // -TreeListBox::TreeListBox (Window* pParent, ResId const& rRes) : - SvTreeListBox( pParent, IDEResId( sal::static_int_cast<sal_uInt16>( rRes.GetId() ) ) ), - m_aNotifier( *this ) +TreeListBox::TreeListBox (Window* pParent, ResId const& rRes) + : SvTreeListBox( pParent, IDEResId( sal::static_int_cast<sal_uInt16>( rRes.GetId() ) ) ) + , m_aNotifier( *this ) +{ + Init(); +} + +TreeListBox::TreeListBox (Window* pParent) + : SvTreeListBox(pParent) + , m_aNotifier( *this ) +{ + Init(); +} + +void TreeListBox::Init() { SetNodeDefaultImages(); SetSelectionMode( SINGLE_SELECTION ); nMode = 0xFF; // everything } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeTreeListBox(Window *pParent, VclBuilder::stringmap &) +{ + return new TreeListBox(pParent); +} + TreeListBox::~TreeListBox () { m_aNotifier.dispose(); diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx index 45ce1a3ac64c..4981a569817d 100644 --- a/basctl/source/basicide/bastype2.hxx +++ b/basctl/source/basicide/bastype2.hxx @@ -177,7 +177,7 @@ class TreeListBox : public SvTreeListBox, public DocumentEventListener private: sal_uInt16 nMode; DocumentEventNotifier m_aNotifier; - + void Init(); void SetEntryBitmaps( SvTreeListEntry * pEntry, const Image& rImage ); virtual void MouseButtonDown( const MouseEvent& rMEvt ); @@ -205,7 +205,8 @@ protected: virtual void onDocumentModeChanged( const ScriptDocument& _rDocument ); public: - TreeListBox( Window* pParent, const ResId& rRes ); + TreeListBox(Window* pParent, const ResId& rRes); + TreeListBox(Window* pParent); ~TreeListBox(); void ScanEntry( const ScriptDocument& rDocument, LibraryLocation eLocation ); diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 3e07dfd86ac3..c4d16253a4d1 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -59,61 +59,58 @@ using ::std::pair; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -MacroChooser::MacroChooser( Window* pParnt, bool bCreateEntries ) : - SfxModalDialog( pParnt, IDEResId( RID_MACROCHOOSER ) ), - aMacroNameTxt( this, IDEResId( RID_TXT_MACRONAME ) ), - aMacroNameEdit( this, IDEResId( RID_ED_MACRONAME ) ), - aMacroFromTxT( this, IDEResId( RID_TXT_MACROFROM ) ), - aMacrosSaveInTxt( this, IDEResId( RID_TXT_SAVEMACRO ) ), - aBasicBox( this, IDEResId( RID_CTRL_LIB ) ), - aMacrosInTxt( this, IDEResId( RID_TXT_MACROSIN ) ), - aMacrosInTxtBaseStr(aMacrosInTxt.GetText()), - aMacroBox( this, IDEResId( RID_CTRL_MACRO ) ), - aRunButton( this, IDEResId( RID_PB_RUN ) ), - aCloseButton( this, IDEResId( RID_PB_CLOSE ) ), - aAssignButton( this, IDEResId( RID_PB_ASSIGN ) ), - aEditButton( this, IDEResId( RID_PB_EDIT ) ), - aNewDelButton( this, IDEResId( RID_PB_DEL ) ), - aOrganizeButton( this, IDEResId( RID_PB_ORG ) ), - aHelpButton( this, IDEResId( RID_PB_HELP ) ), - aNewLibButton( this, IDEResId( RID_PB_NEWLIB ) ), - aNewModButton( this, IDEResId( RID_PB_NEWMOD ) ), - bNewDelIsDel(true), +MacroChooser::MacroChooser( Window* pParnt, bool bCreateEntries ) + : SfxModalDialog(pParnt, "BasicMacroDialog", "modules/BasicIDE/ui/basicmacrodialog.ui") + , bNewDelIsDel(true) // the Sfx doesn't aske the BasicManger whether modified or not // => start saving in case of a change without a into the BasicIDE. - bForceStoreBasic(false), - nMode(All) + , bForceStoreBasic(false) + , nMode(All) { - FreeResource(); - - aMacroBox.SetSelectionMode( SINGLE_SELECTION ); - aMacroBox.SetHighlightRange(); // select over the whole width - - aRunButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); - aCloseButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); - aAssignButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); - aEditButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); - aNewDelButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); - aOrganizeButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + get(m_pMacroNameEdit, "macronameedit"); + get(m_pMacroFromTxT, "macrofromft"); + get(m_pMacrosSaveInTxt, "macrotoft"); + get(m_pBasicBox, "libraries"); + get(m_pMacrosInTxt, "existingmacrosft"); + m_aMacrosInTxtBaseStr = m_pMacrosInTxt->GetText(); + get(m_pMacroBox, "macros"); + get(m_pRunButton, "run"); + get(m_pCloseButton, "close"); + get(m_pAssignButton, "assign"); + get(m_pEditButton, "edit"); + get(m_pDelButton, "delete"); + get(m_pOrganizeButton, "organize"); + get(m_pNewLibButton, "newlibrary"); + get(m_pNewModButton, "newmodule"); + + m_pMacroBox->SetSelectionMode( SINGLE_SELECTION ); + m_pMacroBox->SetHighlightRange(); // select over the whole width + + m_pRunButton->SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + m_pCloseButton->SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + m_pAssignButton->SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + m_pEditButton->SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + m_pDelButton->SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + m_pOrganizeButton->SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); // Buttons only for MacroChooser::Recording - aNewLibButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); - aNewModButton.SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); - aNewLibButton.Hide(); // default - aNewModButton.Hide(); // default - aMacrosSaveInTxt.Hide(); // default + m_pNewLibButton->SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + m_pNewModButton->SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); + m_pNewLibButton->Hide(); // default + m_pNewModButton->Hide(); // default + m_pMacrosSaveInTxt->Hide(); // default - aMacrosInTxt.SetStyle( WB_NOMULTILINE | WB_PATHELLIPSIS ); + m_pMacrosInTxt->SetStyle( WB_NOMULTILINE | WB_PATHELLIPSIS ); - aMacroNameEdit.SetModifyHdl( LINK( this, MacroChooser, EditModifyHdl ) ); + m_pMacroNameEdit->SetModifyHdl( LINK( this, MacroChooser, EditModifyHdl ) ); - aBasicBox.SetSelectHdl( LINK( this, MacroChooser, BasicSelectHdl ) ); + m_pBasicBox->SetSelectHdl( LINK( this, MacroChooser, BasicSelectHdl ) ); - aMacroBox.SetDoubleClickHdl( LINK( this, MacroChooser, MacroDoubleClickHdl ) ); - aMacroBox.SetSelectHdl( LINK( this, MacroChooser, MacroSelectHdl ) ); + m_pMacroBox->SetDoubleClickHdl( LINK( this, MacroChooser, MacroDoubleClickHdl ) ); + m_pMacroBox->SetSelectHdl( LINK( this, MacroChooser, MacroSelectHdl ) ); - aBasicBox.SetMode( BROWSEMODE_MODULES ); - aBasicBox.SetStyle( WB_TABSTOP | WB_BORDER | + m_pBasicBox->SetMode( BROWSEMODE_MODULES ); + m_pBasicBox->SetStyle( WB_TABSTOP | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL ); @@ -122,7 +119,7 @@ MacroChooser::MacroChooser( Window* pParnt, bool bCreateEntries ) : pDispatcher->Execute( SID_BASICIDE_STOREALLMODULESOURCES ); if ( bCreateEntries ) - aBasicBox.ScanAllEntries(); + m_pBasicBox->ScanAllEntries(); } MacroChooser::~MacroChooser() @@ -133,13 +130,13 @@ MacroChooser::~MacroChooser() void MacroChooser::StoreMacroDescription() { - EntryDescriptor aDesc = aBasicBox.GetEntryDescriptor(aBasicBox.FirstSelected()); + EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(m_pBasicBox->FirstSelected()); String aMethodName; - SvTreeListEntry* pEntry = aMacroBox.FirstSelected(); + SvTreeListEntry* pEntry = m_pMacroBox->FirstSelected(); if ( pEntry ) - aMethodName = aMacroBox.GetEntryText( pEntry ); + aMethodName = m_pMacroBox->GetEntryText( pEntry ); else - aMethodName = aMacroNameEdit.GetText(); + aMethodName = m_pMacroNameEdit->GetText(); if ( aMethodName.Len() ) { aDesc.SetMethodName( aMethodName ); @@ -164,7 +161,7 @@ void MacroChooser::RestoreMacroDescription() aDesc = pData->GetLastEntryDescriptor(); } - aBasicBox.SetCurrentEntry( aDesc ); + m_pBasicBox->SetCurrentEntry( aDesc ); String aLastMacro( aDesc.GetMethodName() ); if ( aLastMacro.Len() ) @@ -172,23 +169,23 @@ void MacroChooser::RestoreMacroDescription() // find entry in macro box SvTreeListEntry* pEntry = 0; sal_uLong nPos = 0; - SvTreeListEntry* pE = aMacroBox.GetEntry( nPos ); + SvTreeListEntry* pE = m_pMacroBox->GetEntry( nPos ); while ( pE ) { - if ( aMacroBox.GetEntryText( pE ) == aLastMacro ) + if ( m_pMacroBox->GetEntryText( pE ) == aLastMacro ) { pEntry = pE; break; } - pE = aMacroBox.GetEntry( ++nPos ); + pE = m_pMacroBox->GetEntry( ++nPos ); } if ( pEntry ) - aMacroBox.SetCurEntry( pEntry ); + m_pMacroBox->SetCurEntry( pEntry ); else { - aMacroNameEdit.SetText( aLastMacro ); - aMacroNameEdit.SetSelection( Selection( 0, 0 ) ); + m_pMacroNameEdit->SetText( aLastMacro ); + m_pMacroNameEdit->SetSelection( Selection( 0, 0 ) ); } } } @@ -196,11 +193,11 @@ void MacroChooser::RestoreMacroDescription() short MacroChooser::Execute() { RestoreMacroDescription(); - aRunButton.GrabFocus(); + m_pRunButton->GrabFocus(); // #104198 Check if "wrong" document is active - SvTreeListEntry* pSelectedEntry = aBasicBox.GetCurEntry(); - EntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pSelectedEntry ) ); + SvTreeListEntry* pSelectedEntry = m_pBasicBox->GetCurEntry(); + EntryDescriptor aDesc( m_pBasicBox->GetEntryDescriptor( pSelectedEntry ) ); const ScriptDocument& rSelectedDoc( aDesc.GetDocument() ); // App Basic is always ok, so only check if shell was found @@ -208,10 +205,10 @@ short MacroChooser::Execute() { // Search for the right entry sal_uLong nRootPos = 0; - SvTreeListEntry* pRootEntry = aBasicBox.GetEntry( nRootPos ); + SvTreeListEntry* pRootEntry = m_pBasicBox->GetEntry( nRootPos ); while( pRootEntry ) { - EntryDescriptor aCmpDesc( aBasicBox.GetEntryDescriptor( pRootEntry ) ); + EntryDescriptor aCmpDesc( m_pBasicBox->GetEntryDescriptor( pRootEntry ) ); const ScriptDocument& rCmpDoc( aCmpDesc.GetDocument() ); if ( rCmpDoc.isDocument() && rCmpDoc.isActive() ) { @@ -220,12 +217,12 @@ short MacroChooser::Execute() while ( pEntry ) { pLastValid = pEntry; - pEntry = aBasicBox.FirstChild( pEntry ); + pEntry = m_pBasicBox->FirstChild( pEntry ); } if( pLastValid ) - aBasicBox.SetCurEntry( pLastValid ); + m_pBasicBox->SetCurEntry( pLastValid ); } - pRootEntry = aBasicBox.GetEntry( ++nRootPos ); + pRootEntry = m_pBasicBox->GetEntry( ++nRootPos ); } } @@ -233,7 +230,7 @@ short MacroChooser::Execute() UpdateFields(); if ( StarBASIC::IsRunning() ) - aCloseButton.GrabFocus(); + m_pCloseButton->GrabFocus(); Window* pPrevDlgParent = Application::GetDefDialogParent(); Application::SetDefDialogParent( this ); @@ -250,7 +247,7 @@ void MacroChooser::EnableButton( Button& rButton, bool bEnable ) if ( bEnable ) { if (nMode == ChooseOnly || nMode == Recording) - rButton.Enable(&rButton == &aRunButton); + rButton.Enable(&rButton == m_pRunButton); else rButton.Enable(); } @@ -264,13 +261,13 @@ void MacroChooser::EnableButton( Button& rButton, bool bEnable ) SbMethod* MacroChooser::GetMacro() { SbMethod* pMethod = 0; - SbModule* pModule = aBasicBox.FindModule( aBasicBox.GetCurEntry() ); + SbModule* pModule = m_pBasicBox->FindModule( m_pBasicBox->GetCurEntry() ); if ( pModule ) { - SvTreeListEntry* pEntry = aMacroBox.FirstSelected(); + SvTreeListEntry* pEntry = m_pMacroBox->FirstSelected(); if ( pEntry ) { - String aMacroName( aMacroBox.GetEntryText( pEntry ) ); + String aMacroName( m_pMacroBox->GetEntryText( pEntry ) ); pMethod = (SbMethod*)pModule->GetMethods()->Find( aMacroName, SbxCLASS_METHOD ); } } @@ -315,9 +312,9 @@ void MacroChooser::DeleteMacro() String aModName = pModule->GetName(); OSL_VERIFY( aDocument.updateModule( aLibName, aModName, aSource ) ); - SvTreeListEntry* pEntry = aMacroBox.FirstSelected(); + SvTreeListEntry* pEntry = m_pMacroBox->FirstSelected(); DBG_ASSERT( pEntry, "DeleteMacro: Entry ?!" ); - aMacroBox.GetModel()->Remove( pEntry ); + m_pMacroBox->GetModel()->Remove( pEntry ); bForceStoreBasic = true; } } @@ -325,8 +322,8 @@ void MacroChooser::DeleteMacro() SbMethod* MacroChooser::CreateMacro() { SbMethod* pMethod = 0; - SvTreeListEntry* pCurEntry = aBasicBox.GetCurEntry(); - EntryDescriptor aDesc = aBasicBox.GetEntryDescriptor(pCurEntry); + SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); + EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); ScriptDocument aDocument( aDesc.GetDocument() ); OSL_ENSURE( aDocument.isAlive(), "MacroChooser::CreateMacro: no document!" ); if ( !aDocument.isAlive() ) @@ -369,10 +366,10 @@ SbMethod* MacroChooser::CreateMacro() if ( !pModule ) { pModule = createModImpl( static_cast<Window*>( this ), - aDocument, aBasicBox, aLibName, aModName ); + aDocument, *m_pBasicBox, aLibName, aModName ); } - String aSubName = aMacroNameEdit.GetText(); + String aSubName = m_pMacroNameEdit->GetText(); DBG_ASSERT( !pModule || !pModule->GetMethods()->Find( aSubName, SbxCLASS_METHOD ), "Macro existiert schon!" ); pMethod = pModule ? basctl::CreateMacro( pModule, aSubName ) : NULL; } @@ -384,24 +381,24 @@ void MacroChooser::SaveSetCurEntry( SvTreeListBox& rBox, SvTreeListEntry* pEntry { // the edit would be killed by the highlight otherwise: - String aSaveText( aMacroNameEdit.GetText() ); - Selection aCurSel( aMacroNameEdit.GetSelection() ); + String aSaveText( m_pMacroNameEdit->GetText() ); + Selection aCurSel( m_pMacroNameEdit->GetSelection() ); rBox.SetCurEntry( pEntry ); - aMacroNameEdit.SetText( aSaveText ); - aMacroNameEdit.SetSelection( aCurSel ); + m_pMacroNameEdit->SetText( aSaveText ); + m_pMacroNameEdit->SetSelection( aCurSel ); } void MacroChooser::CheckButtons() { - SvTreeListEntry* pCurEntry = aBasicBox.GetCurEntry(); - EntryDescriptor aDesc = aBasicBox.GetEntryDescriptor(pCurEntry); - SvTreeListEntry* pMacroEntry = aMacroBox.FirstSelected(); + SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); + EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); + SvTreeListEntry* pMacroEntry = m_pMacroBox->FirstSelected(); SbMethod* pMethod = GetMacro(); // check, if corresponding libraries are readonly bool bReadOnly = false; - sal_uInt16 nDepth = pCurEntry ? aBasicBox.GetModel()->GetDepth( pCurEntry ) : 0; + sal_uInt16 nDepth = pCurEntry ? m_pBasicBox->GetModel()->GetDepth( pCurEntry ) : 0; if ( nDepth == 1 || nDepth == 2 ) { ScriptDocument aDocument( aDesc.GetDocument() ); @@ -421,40 +418,40 @@ void MacroChooser::CheckButtons() bool bEnable = pMethod ? true : false; if (nMode != ChooseOnly && StarBASIC::IsRunning()) bEnable = false; - EnableButton( aRunButton, bEnable ); + EnableButton(*m_pRunButton, bEnable); } // organising still possible? // Assign... - EnableButton( aAssignButton, pMethod ? true : false ); + EnableButton(*m_pAssignButton, pMethod ? true : false); // Edit... - EnableButton( aEditButton, pMacroEntry ? true : false ); + EnableButton(*m_pEditButton, pMacroEntry ? true : false); - // aOrganizeButton - EnableButton( aOrganizeButton, !StarBASIC::IsRunning() && nMode == All ); + // Organizer... + EnableButton(*m_pOrganizeButton, !StarBASIC::IsRunning() && nMode == All); - // aNewDelButton.... - bool bProtected = aBasicBox.IsEntryProtected( pCurEntry ); + // m_pDelButton->... + bool bProtected = m_pBasicBox->IsEntryProtected( pCurEntry ); bool bShare = ( aDesc.GetLocation() == LIBRARY_LOCATION_SHARE ); - EnableButton(aNewDelButton, !StarBASIC::IsRunning() && nMode == All && !bProtected && !bReadOnly && !bShare); + EnableButton(*m_pDelButton, !StarBASIC::IsRunning() && nMode == All && !bProtected && !bReadOnly && !bShare); bool bPrev = bNewDelIsDel; bNewDelIsDel = pMethod ? true : false; if (bPrev != bNewDelIsDel && nMode == All) { String aBtnText( bNewDelIsDel ? IDEResId( RID_STR_BTNDEL) : IDEResId( RID_STR_BTNNEW ) ); - aNewDelButton.SetText( aBtnText ); + m_pDelButton->SetText( aBtnText ); } if (nMode == Recording) { // save button - aRunButton.Enable(!bProtected && !bReadOnly && !bShare); + m_pRunButton->Enable(!bProtected && !bReadOnly && !bShare); // new library button - aNewLibButton.Enable(!bShare); + m_pNewLibButton->Enable(!bShare); // new module button - aNewModButton.Enable(!bProtected && !bReadOnly && !bShare); + m_pNewModButton->Enable(!bProtected && !bReadOnly && !bShare); } } @@ -498,16 +495,16 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox ) if ( !pBox->IsSelected( pBox->GetHdlEntry() ) ) return 0; - SbModule* pModule = aBasicBox.FindModule( aBasicBox.GetCurEntry() ); + SbModule* pModule = m_pBasicBox->FindModule( m_pBasicBox->GetCurEntry() ); - aMacroBox.Clear(); + m_pMacroBox->Clear(); if ( pModule ) { - String aStr = aMacrosInTxtBaseStr; + String aStr = m_aMacrosInTxtBaseStr; aStr += " " ; aStr += pModule->GetName(); - aMacrosInTxt.SetText( aStr ); + m_pMacrosInTxt->SetText( aStr ); // The macros should be called in the same order that they // are written down in the module. @@ -525,16 +522,16 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox ) aMacros.insert( map< sal_uInt16, SbMethod*>::value_type( nStart, pMethod ) ); } - aMacroBox.SetUpdateMode(false); + m_pMacroBox->SetUpdateMode(false); for ( map< sal_uInt16, SbMethod* >::iterator it = aMacros.begin(); it != aMacros.end(); ++it ) - aMacroBox.InsertEntry( (*it).second->GetName() ); - aMacroBox.SetUpdateMode(true); + m_pMacroBox->InsertEntry( (*it).second->GetName() ); + m_pMacroBox->SetUpdateMode(true); - if ( aMacroBox.GetEntryCount() ) + if ( m_pMacroBox->GetEntryCount() ) { - SvTreeListEntry* pEntry = aMacroBox.GetEntry( 0 ); + SvTreeListEntry* pEntry = m_pMacroBox->GetEntry( 0 ); DBG_ASSERT( pEntry, "Entry ?!" ); - aMacroBox.SetCurEntry( pEntry ); + m_pMacroBox->SetCurEntry( pEntry ); } } @@ -551,51 +548,51 @@ IMPL_LINK( MacroChooser, EditModifyHdl, Edit *, pEdit ) // select the module in which the macro is put at Neu (new), // if BasicManager or Lib is selecting - SvTreeListEntry* pCurEntry = aBasicBox.GetCurEntry(); + SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); if ( pCurEntry ) { - sal_uInt16 nDepth = aBasicBox.GetModel()->GetDepth( pCurEntry ); - if ( ( nDepth == 1 ) && ( aBasicBox.IsEntryProtected( pCurEntry ) ) ) + sal_uInt16 nDepth = m_pBasicBox->GetModel()->GetDepth( pCurEntry ); + if ( ( nDepth == 1 ) && ( m_pBasicBox->IsEntryProtected( pCurEntry ) ) ) { // then put to the respective Std-Lib... - SvTreeListEntry* pManagerEntry = aBasicBox.GetModel()->GetParent( pCurEntry ); - pCurEntry = aBasicBox.GetModel()->FirstChild( pManagerEntry ); + SvTreeListEntry* pManagerEntry = m_pBasicBox->GetModel()->GetParent( pCurEntry ); + pCurEntry = m_pBasicBox->GetModel()->FirstChild( pManagerEntry ); } if ( nDepth < 2 ) { SvTreeListEntry* pNewEntry = pCurEntry; while ( pCurEntry && ( nDepth < 2 ) ) { - pCurEntry = aBasicBox.FirstChild( pCurEntry ); + pCurEntry = m_pBasicBox->FirstChild( pCurEntry ); if ( pCurEntry ) { pNewEntry = pCurEntry; - nDepth = aBasicBox.GetModel()->GetDepth( pCurEntry ); + nDepth = m_pBasicBox->GetModel()->GetDepth( pCurEntry ); } } - SaveSetCurEntry( aBasicBox, pNewEntry ); + SaveSetCurEntry( *m_pBasicBox, pNewEntry ); } - if ( aMacroBox.GetEntryCount() ) + if ( m_pMacroBox->GetEntryCount() ) { - String aEdtText( aMacroNameEdit.GetText() ); + String aEdtText( m_pMacroNameEdit->GetText() ); bool bFound = false; - for ( sal_uInt16 n = 0; n < aMacroBox.GetEntryCount(); n++ ) + for ( sal_uInt16 n = 0; n < m_pMacroBox->GetEntryCount(); n++ ) { - SvTreeListEntry* pEntry = aMacroBox.GetEntry( n ); + SvTreeListEntry* pEntry = m_pMacroBox->GetEntry( n ); DBG_ASSERT( pEntry, "Entry ?!" ); - if ( aMacroBox.GetEntryText( pEntry ).CompareIgnoreCaseToAscii( aEdtText ) == COMPARE_EQUAL ) + if ( m_pMacroBox->GetEntryText( pEntry ).CompareIgnoreCaseToAscii( aEdtText ) == COMPARE_EQUAL ) { - SaveSetCurEntry( aMacroBox, pEntry ); + SaveSetCurEntry(*m_pMacroBox, pEntry); bFound = true; break; } } if ( !bFound ) { - SvTreeListEntry* pEntry = aMacroBox.FirstSelected(); + SvTreeListEntry* pEntry = m_pMacroBox->FirstSelected(); // if the entry exists ->Select ->Desription... if ( pEntry ) - aMacroBox.Select( pEntry, false ); + m_pMacroBox->Select( pEntry, false ); } } } @@ -609,7 +606,7 @@ IMPL_LINK( MacroChooser, EditModifyHdl, Edit *, pEdit ) IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) { // apart from New/Record the Description is done by LoseFocus - if ( pButton == &aRunButton ) + if (pButton == m_pRunButton) { StoreMacroDescription(); @@ -632,11 +629,11 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) } else if (nMode == Recording ) { - if ( !IsValidSbxName(aMacroNameEdit.GetText()) ) + if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) ) { ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); - aMacroNameEdit.SetSelection( Selection( 0, aMacroNameEdit.GetText().Len() ) ); - aMacroNameEdit.GrabFocus(); + m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().Len() ) ); + m_pMacroNameEdit->GrabFocus(); return 0; } @@ -647,15 +644,15 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) EndDialog(Macro_OkRun); } - else if ( pButton == &aCloseButton ) + else if (pButton == m_pCloseButton) { StoreMacroDescription(); EndDialog(Macro_Close); } - else if ( ( pButton == &aEditButton ) || ( pButton == &aNewDelButton ) ) + else if ((pButton == m_pEditButton) || (pButton == m_pDelButton)) { - SvTreeListEntry* pCurEntry = aBasicBox.GetCurEntry(); - EntryDescriptor aDesc = aBasicBox.GetEntryDescriptor(pCurEntry); + SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); + EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); ScriptDocument aDocument( aDesc.GetDocument() ); DBG_ASSERT( aDocument.isAlive(), "MacroChooser::ButtonHdl: no document, or document is dead!" ); if ( !aDocument.isAlive() ) @@ -671,11 +668,11 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) } String aSub( aDesc.GetMethodName() ); SfxMacroInfoItem aInfoItem( SID_BASICIDE_ARG_MACROINFO, pBasMgr, aLib, aMod, aSub, String() ); - if ( pButton == &aEditButton ) + if (pButton == m_pEditButton) { - SvTreeListEntry* pEntry = aMacroBox.FirstSelected(); + SvTreeListEntry* pEntry = m_pMacroBox->FirstSelected(); if ( pEntry ) - aInfoItem.SetMethod( aMacroBox.GetEntryText( pEntry ) ); + aInfoItem.SetMethod( m_pMacroBox->GetEntryText( pEntry ) ); StoreMacroDescription(); SfxAllItemSet aArgs( SFX_APP()->GetPool() ); SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs ); @@ -695,16 +692,16 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) SFX_CALLMODE_SYNCHRON, &aInfoItem, 0L ); CheckButtons(); UpdateFields(); - //if ( aMacroBox.GetCurEntry() ) // OV-Bug ? - // aMacroBox.Select( aMacroBox.GetCurEntry() ); + //if ( m_pMacroBox->GetCurEntry() ) // OV-Bug ? + // m_pMacroBox->Select( m_pMacroBox->GetCurEntry() ); } else { - if ( !IsValidSbxName(aMacroNameEdit.GetText()) ) + if ( !IsValidSbxName(m_pMacroNameEdit->GetText()) ) { ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); - aMacroNameEdit.SetSelection( Selection( 0, aMacroNameEdit.GetText().Len() ) ); - aMacroNameEdit.GrabFocus(); + m_pMacroNameEdit->SetSelection( Selection( 0, m_pMacroNameEdit->GetText().Len() ) ); + m_pMacroNameEdit->GrabFocus(); return 1; } SbMethod* pMethod = CreateMacro(); @@ -725,11 +722,10 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) } } } - - else if ( pButton == &aAssignButton ) + else if (pButton == m_pAssignButton) { - SvTreeListEntry* pCurEntry = aBasicBox.GetCurEntry(); - EntryDescriptor aDesc = aBasicBox.GetEntryDescriptor(pCurEntry); + SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); + EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); ScriptDocument aDocument( aDesc.GetDocument() ); DBG_ASSERT( aDocument.isAlive(), "MacroChooser::ButtonHdl: no document, or document is dead!" ); if ( !aDocument.isAlive() ) @@ -737,7 +733,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) BasicManager* pBasMgr = aDocument.getBasicManager(); String aLib( aDesc.GetLibName() ); String aMod( aDesc.GetName() ); - String aSub( aMacroNameEdit.GetText() ); + String aSub( m_pMacroNameEdit->GetText() ); SbMethod* pMethod = GetMacro(); DBG_ASSERT( pBasMgr, "BasMgr?" ); DBG_ASSERT( pMethod, "Method?" ); @@ -748,28 +744,28 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) aRequest.AppendItem( aItem ); SFX_APP()->ExecuteSlot( aRequest ); } - else if ( pButton == &aNewLibButton ) + else if (pButton == m_pNewLibButton) { - SvTreeListEntry* pCurEntry = aBasicBox.GetCurEntry(); - EntryDescriptor aDesc = aBasicBox.GetEntryDescriptor(pCurEntry); + SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); + EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); ScriptDocument aDocument( aDesc.GetDocument() ); - createLibImpl( static_cast<Window*>( this ), aDocument, NULL, &aBasicBox ); + createLibImpl( static_cast<Window*>( this ), aDocument, NULL, m_pBasicBox ); } - else if ( pButton == &aNewModButton ) + else if (pButton == m_pNewModButton) { - SvTreeListEntry* pCurEntry = aBasicBox.GetCurEntry(); - EntryDescriptor aDesc = aBasicBox.GetEntryDescriptor(pCurEntry); + SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); + EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(pCurEntry); ScriptDocument aDocument( aDesc.GetDocument() ); String aLibName( aDesc.GetLibName() ); String aModName; createModImpl( static_cast<Window*>( this ), aDocument, - aBasicBox, aLibName, aModName, true ); + *m_pBasicBox, aLibName, aModName, true ); } - else if ( pButton == &aOrganizeButton ) + else if (pButton == m_pOrganizeButton) { StoreMacroDescription(); - EntryDescriptor aDesc = aBasicBox.GetEntryDescriptor(aBasicBox.FirstSelected()); + EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(m_pBasicBox->FirstSelected()); OrganizeDialog* pDlg = new OrganizeDialog( this, 0, aDesc ); sal_uInt16 nRet = pDlg->Execute(); delete pDlg; @@ -784,7 +780,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) if ( pShell && pShell->IsAppBasicModified() ) bForceStoreBasic = true; - aBasicBox.UpdateEntries(); + m_pBasicBox->UpdateEntries(); } return 0; } @@ -793,12 +789,12 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) void MacroChooser::UpdateFields() { - SvTreeListEntry* pMacroEntry = aMacroBox.GetCurEntry(); + SvTreeListEntry* pMacroEntry = m_pMacroBox->GetCurEntry(); String aEmptyStr; - aMacroNameEdit.SetText( aEmptyStr ); + m_pMacroNameEdit->SetText( aEmptyStr ); if ( pMacroEntry ) - aMacroNameEdit.SetText( aMacroBox.GetEntryText( pMacroEntry ) ); + m_pMacroNameEdit->SetText( m_pMacroBox->GetEntryText( pMacroEntry ) ); } void MacroChooser::SetMode (Mode nM) @@ -808,41 +804,36 @@ void MacroChooser::SetMode (Mode nM) { case All: { - aRunButton.SetText( String( IDEResId( RID_STR_RUN ) ) ); - EnableButton( aNewDelButton, true ); - EnableButton( aOrganizeButton, true ); + m_pRunButton->SetText( String( IDEResId( RID_STR_RUN ) ) ); + EnableButton(*m_pDelButton, true); + EnableButton(*m_pOrganizeButton, true); break; } case ChooseOnly: { - aRunButton.SetText( String( IDEResId( RID_STR_CHOOSE ) ) ); - EnableButton( aNewDelButton, false ); - EnableButton( aOrganizeButton, false ); + m_pRunButton->SetText( String( IDEResId( RID_STR_CHOOSE ) ) ); + EnableButton(*m_pDelButton, false); + EnableButton(*m_pOrganizeButton, false); break; } case Recording: { - aRunButton.SetText( String( IDEResId( RID_STR_RECORD ) ) ); - EnableButton( aNewDelButton, false ); - EnableButton( aOrganizeButton, false ); - - aAssignButton.Hide(); - aEditButton.Hide(); - aNewDelButton.Hide(); - aOrganizeButton.Hide(); - aMacroFromTxT.Hide(); - - aNewLibButton.Show(); - aNewModButton.Show(); - aMacrosSaveInTxt.Show(); - - Point aHelpPos = aHelpButton.GetPosPixel(); - Point aHelpPosLogic = PixelToLogic( aHelpPos, MapMode(MAP_APPFONT) ); - aHelpPosLogic.Y() -= 34; - aHelpPos = LogicToPixel( aHelpPosLogic, MapMode(MAP_APPFONT) ); - aHelpButton.SetPosPixel( aHelpPos ); + m_pRunButton->SetText( String( IDEResId( RID_STR_RECORD ) ) ); + EnableButton(*m_pDelButton, false); + EnableButton(*m_pOrganizeButton, false); + + m_pAssignButton->Hide(); + m_pEditButton->Hide(); + m_pDelButton->Hide(); + m_pOrganizeButton->Hide(); + m_pMacroFromTxT->Hide(); + + m_pNewLibButton->Show(); + m_pNewModButton->Show(); + m_pMacrosSaveInTxt->Show(); + break; } } diff --git a/basctl/source/basicide/macrodlg.hrc b/basctl/source/basicide/macrodlg.hrc index 6ca7749ae1ff..8c4f2b21f461 100644 --- a/basctl/source/basicide/macrodlg.hrc +++ b/basctl/source/basicide/macrodlg.hrc @@ -20,31 +20,10 @@ #include <svl/solar.hrc> -#define RID_MACROCHOOSER ( RID_BASICIDE_START + 50 ) #define RID_STR_BTNDEL ( RID_BASICIDE_START + 51 ) #define RID_STR_BTNNEW ( RID_BASICIDE_START + 52 ) #define RID_STR_CHOOSE ( RID_BASICIDE_START + 53 ) #define RID_STR_RUN ( RID_BASICIDE_START + 54 ) #define RID_STR_RECORD ( RID_BASICIDE_START + 56 ) -#define RID_CTRL_MACRO 1 -#define RID_CTRL_LIB 2 -#define RID_TXT_MACRONAME 3 -#define RID_TXT_MACROFROM 4 -#define RID_ED_MACRONAME 5 -#define RID_TXT_DESCRIPTION 6 -#define RID_PB_RUN 8 -#define RID_PB_CLOSE 9 -#define RID_PB_EDIT 10 -#define RID_PB_ORG 11 -#define RID_PB_DEL 12 -#define RID_PB_ASSIGN 13 -#define RID_PB_HELP 15 -#define RID_ML_DESCRIPTION 16 -#define RID_TXT_MACROSIN 17 -#define RID_TXT_SAVEMACRO 18 -#define RID_PB_NEWLIB 19 -#define RID_PB_NEWMOD 20 - #endif // BASCTL_MACRODLG_HRC - diff --git a/basctl/source/basicide/macrodlg.hxx b/basctl/source/basicide/macrodlg.hxx index 4262882aecf6..339de6c54a61 100644 --- a/basctl/source/basicide/macrodlg.hxx +++ b/basctl/source/basicide/macrodlg.hxx @@ -49,24 +49,22 @@ public: }; private: - FixedText aMacroNameTxt; - Edit aMacroNameEdit; - FixedText aMacroFromTxT; - FixedText aMacrosSaveInTxt; - TreeListBox aBasicBox; - FixedText aMacrosInTxt; - String aMacrosInTxtBaseStr; - SvTreeListBox aMacroBox; - - PushButton aRunButton; - CancelButton aCloseButton; - PushButton aAssignButton; - PushButton aEditButton; - PushButton aNewDelButton; - PushButton aOrganizeButton; - HelpButton aHelpButton; - PushButton aNewLibButton; - PushButton aNewModButton; + Edit* m_pMacroNameEdit; + FixedText* m_pMacroFromTxT; + FixedText* m_pMacrosSaveInTxt; + TreeListBox* m_pBasicBox; + FixedText* m_pMacrosInTxt; + String m_aMacrosInTxtBaseStr; + SvTreeListBox* m_pMacroBox; + + PushButton* m_pRunButton; + PushButton* m_pCloseButton; + PushButton* m_pAssignButton; + PushButton* m_pEditButton; + PushButton* m_pDelButton; + PushButton* m_pOrganizeButton; + PushButton* m_pNewLibButton; + PushButton* m_pNewModButton; bool bNewDelIsDel; bool bForceStoreBasic; diff --git a/basctl/source/basicide/macrodlg.src b/basctl/source/basicide/macrodlg.src index 7e6860cdb9db..d9dc3f4a214d 100644 --- a/basctl/source/basicide/macrodlg.src +++ b/basctl/source/basicide/macrodlg.src @@ -20,156 +20,6 @@ #include <macrodlg.hrc> #include <basidesh.hrc> #include <helpid.hrc> -ModalDialog RID_MACROCHOOSER -{ - HelpId = "basctl:ModalDialog:RID_MACROCHOOSER" ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 287 , 165 ) ; - Text [ en-US ] = "%PRODUCTNAME Basic Macros" ; - Moveable = TRUE ; - // Closeable = TRUE; - - FixedText RID_TXT_MACROSIN - { - Pos = MAP_APPFONT ( 122 , 30 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - Text [ en-US ] = "Existing macros ~in:"; - }; - Control RID_CTRL_MACRO - { - HelpID = HID_BASICIDE_MACROS ; - Border = TRUE ; - Pos = MAP_APPFONT ( 122 , 41 ) ; - Size = MAP_APPFONT ( 100 , 117 ) ; - // Size = MAP_APPFONT ( 100 , 117 ) ; - TabStop = TRUE ; - }; - Control RID_CTRL_LIB - { - HelpID = HID_BASICIDE_LIBS ; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 41 ) ; - Size = MAP_APPFONT ( 110 , 117 ) ; - TabStop = TRUE ; - }; - FixedText RID_TXT_MACRONAME - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - Text [ en-US ] = "~Macro name" ; - }; - Edit RID_ED_MACRONAME - { - HelpID = "basctl:Edit:RID_MACROCHOOSER:RID_ED_MACRONAME"; - Border = TRUE ; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 6 , 14 ) ; - Size = MAP_APPFONT ( 110 , 12 ) ; - TabStop = TRUE ; - }; - FixedText RID_TXT_MACROFROM - { - Pos = MAP_APPFONT ( 6 , 30 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - Text [ en-US ] = "Macro ~from" ; - }; - FixedText RID_TXT_SAVEMACRO - { - Pos = MAP_APPFONT ( 6 , 30 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - Text [ en-US ] = "Save m~acro in"; - }; - - FixedText RID_TXT_DESCRIPTION - { - Pos = MAP_APPFONT ( 6 , 117 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - Text [ en-US ] = "De~scription" ; - }; - PushButton RID_PB_RUN - { - HelpID = "basctl:PushButton:RID_MACROCHOOSER:RID_PB_RUN"; - Pos = MAP_APPFONT ( 231 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE; - Text [ en-US ] = "R~un" ; - TabStop = TRUE ; - }; - CancelButton RID_PB_CLOSE - { - Pos = MAP_APPFONT ( 231 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Close"; - }; - - PushButton RID_PB_ASSIGN - { - HelpID = "basctl:PushButton:RID_MACROCHOOSER:RID_PB_ASSIGN"; - Pos = MAP_APPFONT ( 231 , 60 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Assign..." ; - TabStop = TRUE ; - }; - PushButton RID_PB_EDIT - { - HelpID = "basctl:PushButton:RID_MACROCHOOSER:RID_PB_EDIT"; - Size = MAP_APPFONT ( 50 , 14 ) ; - Pos = MAP_APPFONT ( 231 , 77 ) ; - Text [ en-US ] = "~Edit" ; - TabStop = TRUE ; - }; - PushButton RID_PB_NEWLIB - { - HelpID = "basctl:PushButton:RID_MACROCHOOSER:RID_PB_NEWLIB"; - Pos = MAP_APPFONT ( 231 , 60 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "New ~Library"; - }; - PushButton RID_PB_NEWMOD - { - HelpID = "basctl:PushButton:RID_MACROCHOOSER:RID_PB_NEWMOD"; - Size = MAP_APPFONT ( 50 , 14 ) ; - Pos = MAP_APPFONT ( 231 , 77 ) ; - Text [ en-US ] = "New M~odule"; - }; - PushButton RID_PB_DEL - { - HelpID = "basctl:PushButton:RID_MACROCHOOSER:RID_PB_DEL"; - Pos = MAP_APPFONT ( 231 , 94 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Delete" ; - TabStop = TRUE ; - }; - PushButton RID_PB_ORG - { - HelpID = "basctl:PushButton:RID_MACROCHOOSER:RID_PB_ORG"; - Pos = MAP_APPFONT ( 231 , 114 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Organizer..." ; - }; - HelpButton RID_PB_HELP - { - Pos = MAP_APPFONT ( 231 , 131 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - MultiLineEdit RID_ML_DESCRIPTION - { - HelpID = "basctl:MultiLineEdit:RID_MACROCHOOSER:RID_ML_DESCRIPTION"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 131 ) ; - Size = MAP_APPFONT ( 216 , 28 ) ; - TabStop = TRUE ; - VScroll = TRUE ; - IgnoreTab = TRUE ; - }; -}; -String RID_STR_STDMACRONAME -{ - Text [ en-US ] = "Macro" ; -}; String RID_STR_BTNDEL { Text [ en-US ] = "~Delete" ; @@ -178,10 +28,6 @@ String RID_STR_BTNNEW { Text [ en-US ] = "~New" ; }; -String RID_STR_CLOSE -{ - Text [ en-US ] = "Close" ; -}; String RID_STR_CHOOSE { Text [ en-US ] = "Choose" ; @@ -190,7 +36,6 @@ String RID_STR_RUN { Text [ en-US ] = "Run" ; }; - String RID_STR_RECORD { Text [ en-US ] = "~Save" ; diff --git a/basctl/uiconfig/basicide/ui/basicmacrodialog.ui b/basctl/uiconfig/basicide/ui/basicmacrodialog.ui new file mode 100644 index 000000000000..e5d5effb226e --- /dev/null +++ b/basctl/uiconfig/basicide/ui/basicmacrodialog.ui @@ -0,0 +1,384 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="BasicMacroDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">%PRODUCTNAME Basic Macros</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="run"> + <property name="label">Run</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="image_position">bottom</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="assign"> + <property name="label">Assign...</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + <property name="secondary">True</property> + </packing> + </child> + <child> + <object class="GtkButton" id="edit"> + <property name="label">Edit</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + <property name="secondary">True</property> + </packing> + </child> + <child> + <object class="GtkButton" id="delete"> + <property name="label">gtk-delete</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + <property name="secondary">True</property> + </packing> + </child> + <child> + <object class="GtkButton" id="organize"> + <property name="label">Organizer...</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + <property name="secondary">True</property> + </packing> + </child> + <child> + <object class="GtkButton" id="newlibrary"> + <property name="label">New Library</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">5</property> + <property name="secondary">True</property> + </packing> + </child> + <child> + <object class="GtkButton" id="newmodule"> + <property name="label">New Module</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">6</property> + <property name="secondary">True</property> + </packing> + </child> + <child> + <object class="GtkButton" id="close"> + <property name="label">gtk-close</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">7</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">8</property> + <property name="secondary">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="column_homogeneous">True</property> + <child> + <object class="GtkFrame" id="frame3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo:SvTreeListBox" id="macros"> + <property name="use_action_appearance">False</property> + <property name="width_request">280</property> + <property name="height_request">300</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="existingmacrosft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Existing macros in:</property> + <property name="track_visited_links">False</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="macronameft1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="track_visited_links">False</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="basctllo:TreeListBox" id="libraries"> + <property name="use_action_appearance">False</property> + <property name="width_request">280</property> + <property name="height_request">300</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkLabel" id="macrofromft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Macro from</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="macrotoft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Save macro in</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkEntry" id="macronameedit"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="libraryft1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Macro name</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">run</action-widget> + <action-widget response="0">assign</action-widget> + <action-widget response="0">edit</action-widget> + <action-widget response="0">delete</action-widget> + <action-widget response="0">organize</action-widget> + <action-widget response="0">newlibrary</action-widget> + <action-widget response="0">newmodule</action-widget> + <action-widget response="0">close</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> +</interface> diff --git a/cui/uiconfig/ui/macroselectordialog.ui b/cui/uiconfig/ui/macroselectordialog.ui index 104b45eac2f6..0448245abe1f 100644 --- a/cui/uiconfig/ui/macroselectordialog.ui +++ b/cui/uiconfig/ui/macroselectordialog.ui @@ -162,7 +162,7 @@ <child> <object class="cuilo:SvxConfigGroupListBox" id="categories"> <property name="height_request">300</property> - <property name="width_request">200</property> + <property name="width_request">280</property> <property name="visible">True</property> <property name="can_focus">True</property> </object> @@ -227,7 +227,7 @@ <child> <object class="cuilo:SvxConfigFunctionListBox" id="commands"> <property name="height_request">300</property> - <property name="width_request">200</property> + <property name="width_request">280</property> <property name="visible">True</property> <property name="can_focus">True</property> </object> diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index f8567523e172..5a2fea7b3fcc 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -38,6 +38,7 @@ #include <vcl/svapp.hxx> #include <vcl/accel.hxx> #include <vcl/i18nhelp.hxx> +#include <vcl/builder.hxx> #include <sot/formats.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <rtl/instance.hxx> @@ -482,6 +483,11 @@ SvTreeListBox::SvTreeListBox(Window* pParent, const ResId& rResId) : SetSublistOpenWithLeftRight(); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvTreeListBox(Window *pParent, VclBuilder::stringmap &) +{ + return new SvTreeListBox(pParent); +} + void SvTreeListBox::Clear() { DBG_CHKTHIS(SvTreeListBox,0); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index c7ee09e31bff..7f25cc5a8c45 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -712,6 +712,12 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri } else if (name == "GtkTreeView") { + //To-Do + //a) move svtools SvTreeViewBox into vcl + //b) make that the default target for GtkTreeView + //c) remove the non-drop down mode of ListBox and convert + // everything over to SvTreeViewBox + //d) remove the users of makeSvTreeViewBox extractModel(id, rMap); pWindow = new ListBox(pParent, WB_LEFT|WB_VCENTER|WB_3DLOOK); } |