From 7d5911e40855ac6234590e008927c9b819084ad0 Mon Sep 17 00:00:00 2001 From: "Uray M. János" Date: Fri, 31 Aug 2012 12:44:47 +0200 Subject: 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 Tested-by: Noel Power --- basctl/source/dlged/dlged.cxx | 20 ++++++------------ basctl/source/dlged/propbrw.cxx | 47 ++++++++--------------------------------- 2 files changed, 16 insertions(+), 51 deletions(-) (limited to 'basctl/source/dlged') diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index 857ac1df8230..67e6d6569023 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -174,7 +174,10 @@ bool DlgEditor::RemarkDialog() } -DlgEditor::DlgEditor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ) +DlgEditor::DlgEditor ( + com::sun::star::uno::Reference const& xModel, + PropBrw& rPropertyBrowser_ +) :pHScroll(NULL) ,pVScroll(NULL) ,pDlgEdModel(NULL) @@ -187,6 +190,7 @@ DlgEditor::DlgEditor( const ::com::sun::star::uno::Reference< ::com::sun::star:: ,pObjFac(NULL) ,pWindow(NULL) ,pFunc(NULL) + ,rPropertyBrowser(rPropertyBrowser_) ,eMode( DlgEditor::SELECT ) ,eActObj( OBJ_DLG_PUSHBUTTON ) ,bFirstDraw(false) @@ -608,14 +612,7 @@ IMPL_LINK_NOARG(DlgEditor, PaintTimeout) IMPL_LINK_NOARG(DlgEditor, MarkTimeout) { - Shell* pShell = GetShell(); - SfxViewFrame* pViewFrame = pShell ? pShell->GetViewFrame() : NULL; - SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow( SID_SHOW_PROPERTYBROWSER ) : NULL; - if ( !pChildWin ) - return 0L; - - ((PropBrw*)(pChildWin->GetWindow()))->Update(pShell); - + rPropertyBrowser.Update(GetShell()); return 1; } @@ -1128,10 +1125,7 @@ bool DlgEditor::IsPasteAllowed() void DlgEditor::ShowProperties() { - Shell* pShell = GetShell(); - SfxViewFrame* pViewFrame = pShell ? pShell->GetViewFrame() : NULL; - if ( pViewFrame && !pViewFrame->HasChildWindow( SID_SHOW_PROPERTYBROWSER ) ) - pViewFrame->ToggleChildWindow( SID_SHOW_PROPERTYBROWSER ); + rPropertyBrowser.Show(!rPropertyBrowser.IsVisible()); } diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx index 40695f3a09ba..c3bd5d2783f0 100644 --- a/basctl/source/dlged/propbrw.cxx +++ b/basctl/source/dlged/propbrw.cxx @@ -18,10 +18,10 @@ */ +#include "propbrw.hxx" #include "basidesh.hxx" #include "dlgedobj.hxx" #include "iderid.hxx" -#include "propbrw.hxx" #include "dlgresid.hrc" #include @@ -48,28 +48,6 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::comphelper; -SFX_IMPL_FLOATINGWINDOW(PropBrwMgr, SID_SHOW_PROPERTYBROWSER) - -PropBrwMgr::PropBrwMgr( Window* _pParent, sal_uInt16 nId, - SfxBindings *pBindings, SfxChildWinInfo* pInfo) - :SfxChildWindow( _pParent, nId ) -{ - // set current selection - SfxViewShell* pShell = SfxViewShell::Current(); - pWindow = new PropBrw( - ::comphelper::getProcessServiceFactory(), - pBindings, - this, - _pParent, - pShell ? pShell->GetCurrentDocument() : Reference< XModel >() - ); - - eChildAlignment = SFX_ALIGN_NOALIGNMENT; - ((SfxDockingWindow*)pWindow)->Initialize( pInfo ); - - ((PropBrw*)pWindow)->Update( pShell ); -} - void PropBrw::Update( const SfxViewShell* pShell ) { @@ -101,13 +79,12 @@ const long WIN_BORDER = 2; DBG_NAME(PropBrw) -PropBrw::PropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBindings* _pBindings, PropBrwMgr* _pMgr, Window* _pParent, - const Reference< XModel >& _rxContextDocument ) - :SfxDockingWindow( _pBindings, _pMgr, _pParent, WinBits( WB_DOCKABLE | WB_STDMODELESS | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE ) ) - ,m_bInitialStateChange(true) - ,m_xORB(_xORB) - ,m_xContextDocument( _rxContextDocument ) - ,pView( NULL ) +PropBrw::PropBrw (Layout& rLayout): + DockingWindow(&rLayout), + m_bInitialStateChange(true), + m_xORB(comphelper::getProcessServiceFactory()), + m_xContextDocument(SfxViewShell::Current() ? SfxViewShell::Current()->GetCurrentDocument() : Reference()), + pView(0) { DBG_CTOR(PropBrw,NULL); @@ -260,7 +237,7 @@ sal_Bool PropBrw::Close() if( IsRollUp() ) RollDown(); - return SfxDockingWindow::Close(); + return DockingWindow::Close(); } @@ -450,15 +427,9 @@ void PropBrw::implSetNewObject( const Reference< XPropertySet >& _rxObject ) } -void PropBrw::FillInfo( SfxChildWinInfo& rInfo ) const -{ - rInfo.bVisible = false; -} - - void PropBrw::Resize() { - SfxDockingWindow::Resize(); + DockingWindow::Resize(); // adjust size Size aSize_ = GetOutputSizePixel(); -- cgit