convert lib page to .ui

Change-Id: Idd9e3c1ab1c63baa11f503c20d46f3d13e6f78a3
This commit is contained in:
Caolán McNamara
2014-01-06 09:49:34 +00:00
parent ab05bba2fb
commit 6fd47306eb
7 changed files with 328 additions and 191 deletions

View File

@@ -34,6 +34,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/BasicIDE,\
basctl/uiconfig/basicide/ui/exportdialog \ basctl/uiconfig/basicide/ui/exportdialog \
basctl/uiconfig/basicide/ui/gotolinedialog \ basctl/uiconfig/basicide/ui/gotolinedialog \
basctl/uiconfig/basicide/ui/importlibdialog \ basctl/uiconfig/basicide/ui/importlibdialog \
basctl/uiconfig/basicide/ui/libpage \
basctl/uiconfig/basicide/ui/managebreakpoints \ basctl/uiconfig/basicide/ui/managebreakpoints \
basctl/uiconfig/basicide/ui/newlibdialog \ basctl/uiconfig/basicide/ui/newlibdialog \
basctl/uiconfig/basicide/ui/organizedialog \ basctl/uiconfig/basicide/ui/organizedialog \

View File

@@ -31,7 +31,6 @@
#define RID_POPUP_BRKPROPS ( RID_BASICIDE_START + 11 ) #define RID_POPUP_BRKPROPS ( RID_BASICIDE_START + 11 )
#define RID_POPUP_TABBAR ( RID_BASICIDE_START + 12 ) #define RID_POPUP_TABBAR ( RID_BASICIDE_START + 12 )
#define RID_TP_MODULS ( RID_BASICIDE_START + 37 ) #define RID_TP_MODULS ( RID_BASICIDE_START + 37 )
#define RID_TP_LIBS ( RID_BASICIDE_START + 38 )
#define RID_TP_DLGS ( RID_BASICIDE_START + 39 ) #define RID_TP_DLGS ( RID_BASICIDE_START + 39 )
#define RID_POPUP_DLGED ( RID_BASICIDE_START + 62 ) #define RID_POPUP_DLGED ( RID_BASICIDE_START + 62 )
#define RID_PRINTDLG_STRLIST ( RID_BASICIDE_START + 78 ) #define RID_PRINTDLG_STRLIST ( RID_BASICIDE_START + 78 )

View File

@@ -25,7 +25,6 @@
#define HID_BASICIDE_LIBS "BASCTL_HID_BASICIDE_LIBS" #define HID_BASICIDE_LIBS "BASCTL_HID_BASICIDE_LIBS"
#define HID_BASICIDE_MODULES_TREE "BASCTL_HID_BASICIDE_MODULES_TREE" #define HID_BASICIDE_MODULES_TREE "BASCTL_HID_BASICIDE_MODULES_TREE"
#define HID_BASICIDE_LIBS_TREE "BASCTL_HID_BASICIDE_LIBS_TREE"
#define HID_BASICIDE_OBJECTCAT "BASCTL_HID_BASICIDE_OBJECTCAT" #define HID_BASICIDE_OBJECTCAT "BASCTL_HID_BASICIDE_OBJECTCAT"
#define HID_BASICIDE_OBJCAT_SHOW "BASCTL_HID_BASICIDE_OBJCAT_SHOW" #define HID_BASICIDE_OBJCAT_SHOW "BASCTL_HID_BASICIDE_OBJCAT_SHOW"

View File

@@ -482,7 +482,8 @@ IMPL_LINK_NOARG(ExportDialog, OkButtonHandler)
} }
ExportDialog::ExportDialog(Window * pParent) ExportDialog::ExportDialog(Window * pParent)
: ModalDialog(pParent, "ExportDialog", "modules/BasicIDE/ui/exportdialog.ui") : ModalDialog(pParent, "ExportDialog",
"modules/BasicIDE/ui/exportdialog.ui")
, mbExportAsPackage(false) , mbExportAsPackage(false)
{ {
get(m_pExportAsPackageButton, "extension"); get(m_pExportAsPackageButton, "extension");
@@ -496,43 +497,45 @@ ExportDialog::ExportDialog(Window * pParent)
// LibPage // LibPage
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
LibPage::LibPage( Window * pParent ) LibPage::LibPage(Window * pParent)
:TabPage( pParent, IDEResId( RID_TP_LIBS ) ) : TabPage(pParent, "LibPage",
,aBasicsText( this, IDEResId( RID_STR_BASICS ) ) "modules/BasicIDE/ui/libpage.ui")
,aBasicsBox( this, IDEResId( RID_LB_BASICS ) ) , m_aCurDocument(ScriptDocument::getApplicationScriptDocument())
,aLibText( this, IDEResId( RID_STR_LIB ) ) , m_eCurLocation(LIBRARY_LOCATION_UNKNOWN)
,aLibBox( this, IDEResId( RID_TRLBOX ) )
,aEditButton( this, IDEResId( RID_PB_EDIT ) )
,aPasswordButton( this, IDEResId( RID_PB_PASSWORD ) )
,aNewLibButton( this, IDEResId( RID_PB_NEWLIB ) )
,aInsertLibButton( this, IDEResId( RID_PB_APPEND ) )
,aExportButton( this, IDEResId( RID_PB_EXPORT ) )
,aDelButton( this, IDEResId( RID_PB_DELETE ) )
,m_aCurDocument( ScriptDocument::getApplicationScriptDocument() )
,m_eCurLocation( LIBRARY_LOCATION_UNKNOWN )
{ {
FreeResource(); get(m_pBasicsBox, "location");
get(m_pLibBox, "library");
Size aSize(m_pLibBox->LogicToPixel(Size(130, 87), MAP_APPFONT));
m_pLibBox->set_height_request(aSize.Height());
m_pLibBox->set_width_request(aSize.Width());
get(m_pEditButton, "edit");
get(m_pPasswordButton, "password");
get(m_pNewLibButton, "new");
get(m_pInsertLibButton, "import");
get(m_pExportButton, "export");
get(m_pDelButton, "delete");
pTabDlg = 0; pTabDlg = 0;
aEditButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); m_pEditButton->SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
aNewLibButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); m_pNewLibButton->SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
aPasswordButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); m_pPasswordButton->SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
aExportButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); m_pExportButton->SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
aInsertLibButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); m_pInsertLibButton->SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
aDelButton.SetClickHdl( LINK( this, LibPage, ButtonHdl ) ); m_pDelButton->SetClickHdl( LINK( this, LibPage, ButtonHdl ) );
aLibBox.SetSelectHdl( LINK( this, LibPage, TreeListHighlightHdl ) ); m_pLibBox->SetSelectHdl( LINK( this, LibPage, TreeListHighlightHdl ) );
aBasicsBox.SetSelectHdl( LINK( this, LibPage, BasicSelectHdl ) ); m_pBasicsBox->SetSelectHdl( LINK( this, LibPage, BasicSelectHdl ) );
aLibBox.SetMode(ObjectMode::Module); m_pLibBox->SetMode(ObjectMode::Module);
aLibBox.EnableInplaceEditing(true); m_pLibBox->EnableInplaceEditing(true);
aLibBox.SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP ); m_pLibBox->SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP );
long aTabs[] = { 2, 30, 120 }; long aTabs[] = { 2, 30, 120 };
aLibBox.SetTabs( aTabs, MAP_PIXEL ); m_pLibBox->SetTabs( aTabs, MAP_PIXEL );
FillListBox(); FillListBox();
aBasicsBox.SelectEntryPos( 0 ); m_pBasicsBox->SelectEntryPos( 0 );
SetCurLib(); SetCurLib();
CheckButtons(); CheckButtons();
@@ -542,10 +545,10 @@ LibPage::LibPage( Window * pParent )
LibPage::~LibPage() LibPage::~LibPage()
{ {
sal_uInt16 nCount = aBasicsBox.GetEntryCount(); sal_uInt16 nCount = m_pBasicsBox->GetEntryCount();
for ( sal_uInt16 i = 0; i < nCount; ++i ) for ( sal_uInt16 i = 0; i < nCount; ++i )
{ {
DocumentEntry* pEntry = (DocumentEntry*)aBasicsBox.GetEntryData( i ); DocumentEntry* pEntry = (DocumentEntry*)m_pBasicsBox->GetEntryData( i );
delete pEntry; delete pEntry;
} }
} }
@@ -554,51 +557,51 @@ LibPage::~LibPage()
void LibPage::CheckButtons() void LibPage::CheckButtons()
{ {
SvTreeListEntry* pCur = aLibBox.GetCurEntry(); SvTreeListEntry* pCur = m_pLibBox->GetCurEntry();
if ( pCur ) if ( pCur )
{ {
OUString aLibName = aLibBox.GetEntryText( pCur, 0 ); OUString aLibName = m_pLibBox->GetEntryText( pCur, 0 );
Reference< script::XLibraryContainer2 > xModLibContainer( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); Reference< script::XLibraryContainer2 > xModLibContainer( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
Reference< script::XLibraryContainer2 > xDlgLibContainer( m_aCurDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY ); Reference< script::XLibraryContainer2 > xDlgLibContainer( m_aCurDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
if ( m_eCurLocation == LIBRARY_LOCATION_SHARE ) if ( m_eCurLocation == LIBRARY_LOCATION_SHARE )
{ {
aPasswordButton.Disable(); m_pPasswordButton->Disable();
aNewLibButton.Disable(); m_pNewLibButton->Disable();
aInsertLibButton.Disable(); m_pInsertLibButton->Disable();
aDelButton.Disable(); m_pDelButton->Disable();
} }
else if ( aLibName.equalsIgnoreAsciiCase( "Standard" ) ) else if ( aLibName.equalsIgnoreAsciiCase( "Standard" ) )
{ {
aPasswordButton.Disable(); m_pPasswordButton->Disable();
aNewLibButton.Enable(); m_pNewLibButton->Enable();
aInsertLibButton.Enable(); m_pInsertLibButton->Enable();
aExportButton.Disable(); m_pExportButton->Disable();
aDelButton.Disable(); m_pDelButton->Disable();
} }
else if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) ) || else if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) ) ||
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) ) ) ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) ) )
{ {
aPasswordButton.Disable(); m_pPasswordButton->Disable();
aNewLibButton.Enable(); m_pNewLibButton->Enable();
aInsertLibButton.Enable(); m_pInsertLibButton->Enable();
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) && !xModLibContainer->isLibraryLink( aLibName ) ) || if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) && !xModLibContainer->isLibraryLink( aLibName ) ) ||
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) ) ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) )
aDelButton.Disable(); m_pDelButton->Disable();
else else
aDelButton.Enable(); m_pDelButton->Enable();
} }
else else
{ {
if ( xModLibContainer.is() && !xModLibContainer->hasByName( aLibName ) ) if ( xModLibContainer.is() && !xModLibContainer->hasByName( aLibName ) )
aPasswordButton.Disable(); m_pPasswordButton->Disable();
else else
aPasswordButton.Enable(); m_pPasswordButton->Enable();
aNewLibButton.Enable(); m_pNewLibButton->Enable();
aInsertLibButton.Enable(); m_pInsertLibButton->Enable();
aExportButton.Enable(); m_pExportButton->Enable();
aDelButton.Enable(); m_pDelButton->Enable();
} }
} }
} }
@@ -643,16 +646,16 @@ IMPL_LINK_INLINE_END( LibPage, BasicSelectHdl, ListBox *, pBox )
IMPL_LINK( LibPage, ButtonHdl, Button *, pButton ) IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
{ {
if ( pButton == &aEditButton ) if (pButton == m_pEditButton)
{ {
SfxAllItemSet aArgs( SFX_APP()->GetPool() ); SfxAllItemSet aArgs( SFX_APP()->GetPool() );
SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs ); SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
SFX_APP()->ExecuteSlot( aRequest ); SFX_APP()->ExecuteSlot( aRequest );
SfxUsrAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( m_aCurDocument.getDocumentOrNull() ) ); SfxUsrAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( m_aCurDocument.getDocumentOrNull() ) );
SvTreeListEntry* pCurEntry = aLibBox.GetCurEntry(); SvTreeListEntry* pCurEntry = m_pLibBox->GetCurEntry();
DBG_ASSERT( pCurEntry, "Entry?!" ); DBG_ASSERT( pCurEntry, "Entry?!" );
OUString aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) ); OUString aLibName( m_pLibBox->GetEntryText( pCurEntry, 0 ) );
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName ); SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
if (SfxDispatcher* pDispatcher = GetDispatcher()) if (SfxDispatcher* pDispatcher = GetDispatcher())
pDispatcher->Execute( SID_BASICIDE_LIBSELECTED, pDispatcher->Execute( SID_BASICIDE_LIBSELECTED,
@@ -660,18 +663,18 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
EndTabDialog( 1 ); EndTabDialog( 1 );
return 0; return 0;
} }
else if ( pButton == &aNewLibButton ) else if (pButton == m_pNewLibButton)
NewLib(); NewLib();
else if ( pButton == &aInsertLibButton ) else if (pButton == m_pInsertLibButton)
InsertLib(); InsertLib();
else if ( pButton == &aExportButton ) else if (pButton == m_pExportButton)
Export(); Export();
else if ( pButton == &aDelButton ) else if (pButton == m_pDelButton)
DeleteCurrent(); DeleteCurrent();
else if ( pButton == &aPasswordButton ) else if (pButton == m_pPasswordButton)
{ {
SvTreeListEntry* pCurEntry = aLibBox.GetCurEntry(); SvTreeListEntry* pCurEntry = m_pLibBox->GetCurEntry();
OUString aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) ); OUString aLibName( m_pLibBox->GetEntryText( pCurEntry, 0 ) );
// load module library (if not loaded) // load module library (if not loaded)
Reference< script::XLibraryContainer > xModLibContainer = m_aCurDocument.getLibraryContainer( E_SCRIPTS ); Reference< script::XLibraryContainer > xModLibContainer = m_aCurDocument.getLibraryContainer( E_SCRIPTS );
@@ -715,10 +718,10 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
if ( bNewProtected != bProtected ) if ( bNewProtected != bProtected )
{ {
sal_uLong nPos = (sal_uLong)aLibBox.GetModel()->GetAbsPos( pCurEntry ); sal_uLong nPos = (sal_uLong)m_pLibBox->GetModel()->GetAbsPos( pCurEntry );
aLibBox.GetModel()->Remove( pCurEntry ); m_pLibBox->GetModel()->Remove( pCurEntry );
ImpInsertLibEntry( aLibName, nPos ); ImpInsertLibEntry( aLibName, nPos );
aLibBox.SetCurEntry( aLibBox.GetEntry( nPos ) ); m_pLibBox->SetCurEntry( m_pLibBox->GetEntry( nPos ) );
} }
MarkDocumentModified( m_aCurDocument ); MarkDocumentModified( m_aCurDocument );
@@ -737,8 +740,8 @@ IMPL_LINK_INLINE_START( LibPage, CheckPasswordHdl, SvxPasswordDialog *, pDlg )
{ {
long nRet = 0; long nRet = 0;
SvTreeListEntry* pCurEntry = aLibBox.GetCurEntry(); SvTreeListEntry* pCurEntry = m_pLibBox->GetCurEntry();
OUString aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) ); OUString aLibName( m_pLibBox->GetEntryText( pCurEntry, 0 ) );
Reference< script::XLibraryContainerPassword > xPasswd( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); Reference< script::XLibraryContainerPassword > xPasswd( m_aCurDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
if ( xPasswd.is() ) if ( xPasswd.is() )
@@ -763,7 +766,7 @@ IMPL_LINK_INLINE_END( LibPage, CheckPasswordHdl, SvxPasswordDialog *, pDlg )
void LibPage::NewLib() void LibPage::NewLib()
{ {
createLibImpl( static_cast<Window*>( this ), m_aCurDocument, &aLibBox, NULL); createLibImpl( static_cast<Window*>( this ), m_aCurDocument, m_pLibBox, NULL);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@@ -894,7 +897,7 @@ void LibPage::InsertLib()
if ( pLibDlg->Execute() ) if ( pLibDlg->Execute() )
{ {
sal_uLong nNewPos = aLibBox.GetEntryCount(); sal_uLong nNewPos = m_pLibBox->GetEntryCount();
bool bRemove = false; bool bRemove = false;
bool bReplace = pLibDlg->IsReplace(); bool bReplace = pLibDlg->IsReplace();
bool bReference = pLibDlg->IsReference(); bool bReference = pLibDlg->IsReference();
@@ -975,9 +978,9 @@ void LibPage::InsertLib()
if ( bRemove ) if ( bRemove )
{ {
// remove listbox entry // remove listbox entry
SvTreeListEntry* pEntry_ = aLibBox.FindEntry( aLibName ); SvTreeListEntry* pEntry_ = m_pLibBox->FindEntry( aLibName );
if ( pEntry_ ) if ( pEntry_ )
aLibBox.SvTreeListBox::GetModel()->Remove( pEntry_ ); m_pLibBox->SvTreeListBox::GetModel()->Remove( pEntry_ );
// remove module library // remove module library
if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) ) if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) )
@@ -1110,14 +1113,14 @@ void LibPage::InsertLib()
} }
// insert listbox entry // insert listbox entry
ImpInsertLibEntry( aLibName, aLibBox.GetEntryCount() ); ImpInsertLibEntry( aLibName, m_pLibBox->GetEntryCount() );
bChanges = true; bChanges = true;
} }
} }
SvTreeListEntry* pFirstNew = aLibBox.GetEntry( nNewPos ); SvTreeListEntry* pFirstNew = m_pLibBox->GetEntry( nNewPos );
if ( pFirstNew ) if ( pFirstNew )
aLibBox.SetCurEntry( pFirstNew ); m_pLibBox->SetCurEntry( pFirstNew );
} }
delete pLibDlg; delete pLibDlg;
@@ -1132,8 +1135,8 @@ void LibPage::InsertLib()
void LibPage::Export( void ) void LibPage::Export( void )
{ {
SvTreeListEntry* pCurEntry = aLibBox.GetCurEntry(); SvTreeListEntry* pCurEntry = m_pLibBox->GetCurEntry();
OUString aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) ); OUString aLibName( m_pLibBox->GetEntryText( pCurEntry, 0 ) );
// Password verification // Password verification
OUString aOULibName( aLibName ); OUString aOULibName( aLibName );
@@ -1377,8 +1380,8 @@ void LibPage::ExportAsBasic( const OUString& aLibName )
void LibPage::DeleteCurrent() void LibPage::DeleteCurrent()
{ {
SvTreeListEntry* pCurEntry = aLibBox.GetCurEntry(); SvTreeListEntry* pCurEntry = m_pLibBox->GetCurEntry();
OUString aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) ); OUString aLibName( m_pLibBox->GetEntryText( pCurEntry, 0 ) );
// check, if library is link // check, if library is link
bool bIsLibraryLink = false; bool bIsLibraryLink = false;
@@ -1406,7 +1409,7 @@ void LibPage::DeleteCurrent()
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) ) if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) )
xDlgLibContainer->removeLibrary( aOULibName ); xDlgLibContainer->removeLibrary( aOULibName );
static_cast<SvTreeListBox&>(aLibBox).GetModel()->Remove( pCurEntry ); static_cast<SvTreeListBox&>(*m_pLibBox).GetModel()->Remove( pCurEntry );
MarkDocumentModified( m_aCurDocument ); MarkDocumentModified( m_aCurDocument );
} }
} }
@@ -1442,16 +1445,16 @@ void LibPage::FillListBox()
void LibPage::InsertListBoxEntry( const ScriptDocument& rDocument, LibraryLocation eLocation ) void LibPage::InsertListBoxEntry( const ScriptDocument& rDocument, LibraryLocation eLocation )
{ {
OUString aEntryText( rDocument.getTitle( eLocation ) ); OUString aEntryText( rDocument.getTitle( eLocation ) );
sal_uInt16 nPos = aBasicsBox.InsertEntry( aEntryText, LISTBOX_APPEND ); sal_uInt16 nPos = m_pBasicsBox->InsertEntry( aEntryText, LISTBOX_APPEND );
aBasicsBox.SetEntryData( nPos, new DocumentEntry(rDocument, eLocation) ); m_pBasicsBox->SetEntryData( nPos, new DocumentEntry(rDocument, eLocation) );
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void LibPage::SetCurLib() void LibPage::SetCurLib()
{ {
sal_uInt16 nSelPos = aBasicsBox.GetSelectEntryPos(); sal_uInt16 nSelPos = m_pBasicsBox->GetSelectEntryPos();
DocumentEntry* pEntry = (DocumentEntry*)aBasicsBox.GetEntryData( nSelPos ); DocumentEntry* pEntry = (DocumentEntry*)m_pBasicsBox->GetEntryData( nSelPos );
if ( pEntry ) if ( pEntry )
{ {
ScriptDocument aDocument( pEntry->GetDocument() ); ScriptDocument aDocument( pEntry->GetDocument() );
@@ -1463,8 +1466,8 @@ void LibPage::SetCurLib()
{ {
m_aCurDocument = aDocument; m_aCurDocument = aDocument;
m_eCurLocation = eLocation; m_eCurLocation = eLocation;
aLibBox.SetDocument( aDocument ); m_pLibBox->SetDocument( aDocument );
aLibBox.Clear(); m_pLibBox->Clear();
// get a sorted list of library names // get a sorted list of library names
Sequence< OUString > aLibNames = aDocument.getLibraryNames(); Sequence< OUString > aLibNames = aDocument.getLibraryNames();
@@ -1478,10 +1481,10 @@ void LibPage::SetCurLib()
ImpInsertLibEntry( aLibName, i ); ImpInsertLibEntry( aLibName, i );
} }
SvTreeListEntry* pEntry_ = aLibBox.FindEntry( OUString( "Standard" ) ); SvTreeListEntry* pEntry_ = m_pLibBox->FindEntry( OUString( "Standard" ) );
if ( !pEntry_ ) if ( !pEntry_ )
pEntry_ = aLibBox.GetEntry( 0 ); pEntry_ = m_pLibBox->GetEntry( 0 );
aLibBox.SetCurEntry( pEntry_ ); m_pLibBox->SetCurEntry( pEntry_ );
} }
} }
} }
@@ -1503,21 +1506,21 @@ SvTreeListEntry* LibPage::ImpInsertLibEntry( const OUString& rLibName, sal_uLong
} }
} }
SvTreeListEntry* pNewEntry = aLibBox.DoInsertEntry( rLibName, nPos ); SvTreeListEntry* pNewEntry = m_pLibBox->DoInsertEntry( rLibName, nPos );
pNewEntry->SetUserData( new LibUserData(m_aCurDocument) ); pNewEntry->SetUserData( new LibUserData(m_aCurDocument) );
if (bProtected) if (bProtected)
{ {
Image aImage(IDEResId(RID_IMG_LOCKED)); Image aImage(IDEResId(RID_IMG_LOCKED));
aLibBox.SetExpandedEntryBmp(pNewEntry, aImage); m_pLibBox->SetExpandedEntryBmp(pNewEntry, aImage);
aLibBox.SetCollapsedEntryBmp(pNewEntry, aImage); m_pLibBox->SetCollapsedEntryBmp(pNewEntry, aImage);
} }
// check, if library is link // check, if library is link
if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryLink( aOULibName ) ) if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryLink( aOULibName ) )
{ {
OUString aLinkURL = xModLibContainer->getLibraryLinkURL( aOULibName ); OUString aLinkURL = xModLibContainer->getLibraryLinkURL( aOULibName );
aLibBox.SetEntryText( aLinkURL, pNewEntry, 1 ); m_pLibBox->SetEntryText( aLinkURL, pNewEntry, 1 );
} }
return pNewEntry; return pNewEntry;

View File

@@ -215,16 +215,14 @@ public:
class LibPage: public TabPage class LibPage: public TabPage
{ {
protected: protected:
FixedText aBasicsText; ListBox* m_pBasicsBox;
ListBox aBasicsBox; CheckBox* m_pLibBox;
FixedText aLibText; PushButton* m_pEditButton;
CheckBox aLibBox; PushButton* m_pPasswordButton;
PushButton aEditButton; PushButton* m_pNewLibButton;
PushButton aPasswordButton; PushButton* m_pInsertLibButton;
PushButton aNewLibButton; PushButton* m_pExportButton;
PushButton aInsertLibButton; PushButton* m_pDelButton;
PushButton aExportButton;
PushButton aDelButton;
ScriptDocument m_aCurDocument; ScriptDocument m_aCurDocument;
LibraryLocation m_eCurLocation; LibraryLocation m_eCurLocation;

View File

@@ -129,92 +129,6 @@ TabPage RID_TP_DLGS
TabStop = TRUE ; TabStop = TRUE ;
}; };
}; };
TabPage RID_TP_LIBS
{
HelpId = "basctl:TabPage:RID_TP_LIBS" ;
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 210 , 140 ) ;
FixedText RID_STR_BASICS
{
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 130 , 10 ) ;
Text [ en-US ] = "L~ocation";
};
ListBox RID_LB_BASICS
{
HelpID = "basctl:ListBox:RID_TP_LIBS:RID_LB_BASICS";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 17 ) ;
Size = MAP_APPFONT ( 130 , 80 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText RID_STR_LIB
{
Pos = MAP_APPFONT ( 6 , 36 ) ;
Size = MAP_APPFONT ( 130 , 10 ) ;
Text [ en-US ] = "~Library" ;
};
Control RID_TRLBOX
{
HelpID = HID_BASICIDE_LIBS_TREE ;
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 47 ) ;
Size = MAP_APPFONT ( 130 , 87 ) ;
TabStop = TRUE ;
};
PushButton RID_PB_EDIT
{
HelpID = "basctl:PushButton:RID_TP_LIBS:RID_PB_EDIT";
Text [ en-US ] = "~Edit";
Pos = MAP_APPFONT ( 144 , 6 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
PushButton RID_PB_PASSWORD
{
HelpID = "basctl:PushButton:RID_TP_LIBS:RID_PB_PASSWORD";
Pos = MAP_APPFONT ( 144 , 23 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Password..." ;
TabStop = TRUE ;
};
PushButton RID_PB_NEWLIB
{
HelpID = "basctl:PushButton:RID_TP_LIBS:RID_PB_NEWLIB";
Pos = MAP_APPFONT ( 144 , 69 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~New..." ;
TabStop = TRUE ;
};
PushButton RID_PB_APPEND
{
HelpID = "basctl:PushButton:RID_TP_LIBS:RID_PB_APPEND";
Pos = MAP_APPFONT ( 144 , 86 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Import..." ;
};
PushButton RID_PB_EXPORT
{
HelpID = "basctl:PushButton:RID_TP_LIBS:RID_PB_EXPORT";
Pos = MAP_APPFONT ( 144 , 103 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "E~xport..." ;
TabStop = TRUE ;
};
PushButton RID_PB_DELETE
{
HelpID = "basctl:PushButton:RID_TP_LIBS:RID_PB_DELETE";
Pos = MAP_APPFONT ( 144 , 120 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Delete" ;
TabStop = TRUE ;
};
};
String RID_STR_EXPORTPACKAGE String RID_STR_EXPORTPACKAGE
{ {

View File

@@ -0,0 +1,223 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.0 on Mon Jan 6 09:41:38 2014 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkGrid" id="LibPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">L_ocation</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">location</property>
</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>
<object class="GtkComboBox" id="location">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
</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>
</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>
<object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="lingudictsft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Library</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">library:border</property>
</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>
<object class="basctllo-CheckBox" id="library:border">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</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>
</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="GtkButtonBox" id="buttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="edit">
<property name="label">gtk-edit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</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="password">
<property name="label" translatable="yes">_Password...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="new">
<property name="label" translatable="yes">_New...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</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="import">
<property name="label" translatable="yes">_Import...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">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="export">
<property name="label" translatable="yes">_Export...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</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="delete">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</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>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</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>
</object>
</interface>