diff options
-rw-r--r-- | include/vcl/dockwin.hxx | 3 | ||||
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 33 |
2 files changed, 31 insertions, 5 deletions
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx index 723aef49d4a6..00e8f58d87fa 100644 --- a/include/vcl/dockwin.hxx +++ b/include/vcl/dockwin.hxx @@ -111,6 +111,7 @@ private: DECL_LINK( PopupModeEnd, FloatingWindow*, void ); void ImplEnableStartDocking() { mbStartDockingEnabled = true; } bool ImplStartDockingEnabled() { return mbStartDockingEnabled; } + void ImplPreparePopupMode( FloatWinPopupFlags nFlags ); public: ImplDockingWindowWrapper( const vcl::Window *pWindow ); @@ -133,6 +134,7 @@ public: void Unlock(); bool IsLocked() const { return mbLocked;} + void StartPopupMode( const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags ); void StartPopupMode( ToolBox* pParentToolBox, FloatWinPopupFlags nPopupModeFlags ); bool IsInPopupMode() const; @@ -187,6 +189,7 @@ public: void Unlock( const vcl::Window *pWin ); bool IsLocked( const vcl::Window *pWin ); + void StartPopupMode( const vcl::Window *pWin, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags ); void StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWin ); void StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWin, FloatWinPopupFlags nPopupModeFlags ); diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index bc3eb2cc5b42..67569f773ee4 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -332,6 +332,13 @@ void DockingManager::SetFloatingMode( const vcl::Window *pWindow, bool bFloating pWrapper->SetFloatingMode( bFloating ); } +void DockingManager::StartPopupMode( const vcl::Window *pWindow, const tools::Rectangle& rRect, FloatWinPopupFlags nFlags ) +{ + ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); + if( pWrapper ) + pWrapper->StartPopupMode( rRect, nFlags ); +} + void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const vcl::Window *pWindow, FloatWinPopupFlags nFlags ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); @@ -915,12 +922,8 @@ void ImplDockingWindowWrapper::ShowTitleButton( TitleButton nButton, bool bVisib } } -void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWinPopupFlags nFlags ) +void ImplDockingWindowWrapper::ImplPreparePopupMode( FloatWinPopupFlags nFlags ) { - // do nothing if window is floating - if( IsFloatingMode() ) - return; - GetWindow()->Show( false, ShowFlags::NoFocusChange ); // prepare reparenting @@ -966,6 +969,15 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin // set mpFloatWin not until all window positioning is done !!! // (SetPosPixel etc. check for valid mpFloatWin pointer) mpFloatWin = pWin; +} + +void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWinPopupFlags nFlags ) +{ + // do nothing if window is floating + if( IsFloatingMode() ) + return; + + ImplPreparePopupMode( nFlags ); // if the subtoolbar was opened via keyboard make sure that key events // will go into subtoolbar @@ -983,6 +995,17 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin } } +void ImplDockingWindowWrapper::StartPopupMode( const tools::Rectangle& rRect, FloatWinPopupFlags nFlags ) +{ + // do nothing if window is floating + if( IsFloatingMode() ) + return; + + ImplPreparePopupMode( nFlags ); + mpFloatWin->StartPopupMode( rRect, nFlags ); + GetWindow()->Show(); +} + IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd, FloatingWindow*, void) { GetWindow()->Show( false, ShowFlags::NoFocusChange ); |