diff options
author | Uray M. János <uray.janos@gmail.com> | 2012-08-31 12:44:47 +0200 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-09-07 09:13:03 +0000 |
commit | 7d5911e40855ac6234590e008927c9b819084ad0 (patch) | |
tree | 5c81cc167a05aed8cd70a69e110fd8752e11ac53 /basctl/source/basicide | |
parent | 36bb1a3158a5d5a0ce35507799de794b80dfd080 (diff) |
Basic IDE: Docking property browser under object catalog
Now the property browser can be docked in the same way as all other
dialogs in the Basic IDE and the Dialog Editor.
The property browser (PropBrw, for which PropertyBrowser would be a
better and easier-to-remember name IMO) is derived from
basctl::DockingWindow instead of SfxDockingWindow. PropBrwMgr was
removed (it seemed to be only a wrapper), and PropBrw is now a data
member of DialogWindowLayout (aPropertyBrowser).
Change-Id: I06737a5cbc985888432630714cb919d1bbbcbb49
Reviewed-on: https://gerrit.libreoffice.org/518
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/baside3.cxx | 41 | ||||
-rw-r--r-- | basctl/source/basicide/basides1.cxx | 17 | ||||
-rw-r--r-- | basctl/source/basicide/iderdll.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/layout.hxx | 1 |
5 files changed, 35 insertions, 30 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index d0726d474341..49a88f7b3334 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -1533,6 +1533,10 @@ void ModulWindowLayout::GetState (SfxItemSet &rSet, unsigned nWhich) { switch (nWhich) { + case SID_SHOW_PROPERTYBROWSER: + rSet.Put(SfxVisibilityItem(nWhich, false)); + break; + case SID_BASICIDE_CHOOSEMACRO: rSet.Put(SfxVisibilityItem(nWhich, true)); break; diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 6bfe6e4acc19..3f879673a5da 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -86,7 +86,7 @@ DialogWindow::DialogWindow ( { InitSettings( true, true, true ); - pEditor = new DlgEditor( rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() ); + pEditor = new DlgEditor(rDocument.isDocument() ? rDocument.getDocument() : Reference<frame::XModel>(), rLayout.aPropertyBrowser); pEditor->SetWindow( this ); pEditor->SetDialog( xDialogModel ); @@ -683,20 +683,12 @@ bool DialogWindow::RenameDialog( const ::rtl::OUString& rNewName ) void DialogWindow::DisableBrowser() { - Shell* pShell = GetShell(); - SfxViewFrame* pViewFrame = pShell ? pShell->GetViewFrame() : 0; - SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow(SID_SHOW_PROPERTYBROWSER) : 0; - if( pChildWin ) - ((PropBrw*)(pChildWin->GetWindow()))->Update( NULL ); + rLayout.aPropertyBrowser.Update(0); } void DialogWindow::UpdateBrowser() { - Shell* pShell = GetShell(); - SfxViewFrame* pViewFrame = pShell ? pShell->GetViewFrame() : 0; - SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow(SID_SHOW_PROPERTYBROWSER) : 0; - if( pChildWin ) - ((PropBrw*)(pChildWin->GetWindow()))->Update( pShell ); + rLayout.aPropertyBrowser.Update(GetShell()); } static ::rtl::OUString aResourceResolverPropName( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" )); @@ -1440,7 +1432,8 @@ ItemType DialogWindow::GetType () const DialogWindowLayout::DialogWindowLayout (Window* pParent, ObjectCatalog& rObjectCatalog_) : Layout(pParent), pChild(0), - rObjectCatalog(rObjectCatalog_) + rObjectCatalog(rObjectCatalog_), + aPropertyBrowser(*this) { } void DialogWindowLayout::Activating (BaseWindow& rChild) @@ -1450,6 +1443,7 @@ void DialogWindowLayout::Activating (BaseWindow& rChild) rObjectCatalog.SetLayoutWindow(this); rObjectCatalog.UpdateEntries(); rObjectCatalog.Show(); + aPropertyBrowser.Show(); Layout::Activating(rChild); } @@ -1457,13 +1451,33 @@ void DialogWindowLayout::Deactivating () { Layout::Deactivating(); rObjectCatalog.Hide(); + aPropertyBrowser.Hide(); pChild = 0; } +void DialogWindowLayout::ExecuteGlobal (SfxRequest& rReq) +{ + switch (rReq.GetSlot()) + { + case SID_SHOW_PROPERTYBROWSER: + // toggling property browser + aPropertyBrowser.Show(!aPropertyBrowser.IsVisible()); + ArrangeWindows(); + // refresh the button state + if (SfxBindings* pBindings = GetBindingsPtr()) + pBindings->Invalidate(SID_SHOW_PROPERTYBROWSER); + break; + } +} + void DialogWindowLayout::GetState (SfxItemSet& rSet, unsigned nWhich) { switch (nWhich) { + case SID_SHOW_PROPERTYBROWSER: + rSet.Put(SfxBoolItem(nWhich, aPropertyBrowser.IsVisible())); + break; + case SID_BASICIDE_CHOOSEMACRO: rSet.Put(SfxVisibilityItem(nWhich, false)); break; @@ -1472,7 +1486,8 @@ void DialogWindowLayout::GetState (SfxItemSet& rSet, unsigned nWhich) void DialogWindowLayout::OnFirstSize (int const nWidth, int const nHeight) { - AddToLeft(&rObjectCatalog, Size(nWidth * 0.2, nHeight)); + AddToLeft(&rObjectCatalog, Size(nWidth * 0.25, nHeight * 0.35)); + AddToLeft(&aPropertyBrowser, Size(nWidth * 0.25, nHeight * 0.65)); } diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index e36eaf3cbd64..7244f092098d 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -560,12 +560,6 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) pTabBar->MakeVisible( pTabBar->GetCurPageId() ); } break; - case SID_SHOW_PROPERTYBROWSER: - { - GetViewFrame()->ChildWindowExecute( rReq ); - rReq.Done(); - } - break; case SID_BASICIDE_SHOWWINDOW: { ::std::auto_ptr< ScriptDocument > pDocument; @@ -694,6 +688,8 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) break; default: + if (pLayout) + pLayout->ExecuteGlobal(rReq); if (pCurWin) pCurWin->ExecuteGlobal(rReq); break; @@ -908,15 +904,6 @@ void Shell::GetState(SfxItemSet &rSet) GetViewFrame()->GetSlotState( nWh, NULL, &rSet ); } break; - case SID_SHOW_PROPERTYBROWSER: - { - if ( GetViewFrame()->KnowsChildWindow( nWh ) ) - rSet.Put( SfxBoolItem( nWh, GetViewFrame()->HasChildWindow( nWh ) ) ); - else - rSet.DisableItem( nWh ); - } - break; - case SID_BASICIDE_CURRENT_LANG: { if( (pCurWin && pCurWin->IsReadOnly()) || GetCurLibName().isEmpty() ) diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx index 75b5c31f347c..1923141bd92c 100644 --- a/basctl/source/basicide/iderdll.cxx +++ b/basctl/source/basicide/iderdll.cxx @@ -142,8 +142,6 @@ Dll::Dll () : DocShell::RegisterInterface( pMod ); Shell::RegisterFactory( SVX_INTERFACE_BASIDE_VIEWSH ); Shell::RegisterInterface( pMod ); - - PropBrwMgr::RegisterChildWindow(); } ExtraData* Dll::GetExtraData () diff --git a/basctl/source/basicide/layout.hxx b/basctl/source/basicide/layout.hxx index 6adaeebde151..9f56321aad09 100644 --- a/basctl/source/basicide/layout.hxx +++ b/basctl/source/basicide/layout.hxx @@ -49,6 +49,7 @@ public: virtual void Activating (BaseWindow&); virtual void Deactivating (); + virtual void ExecuteGlobal (SfxRequest&) { } virtual void GetState (SfxItemSet&, unsigned nWhich) = 0; virtual void UpdateDebug (bool bBasicStopped ) = 0; |