diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-22 12:49:04 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-25 10:31:35 +0200 |
commit | b419da0f53cf7f65b1d0c58351176ece23fbfe1f (patch) | |
tree | b29c038348d6aae8e5ec9c0c97ed8eeb41f5cd67 | |
parent | use VclPtr for linked numeric field in slider (diff) | |
download | core-b419da0f53cf7f65b1d0c58351176ece23fbfe1f.tar.gz core-b419da0f53cf7f65b1d0c58351176ece23fbfe1f.zip |
convert SHOW constants to scoped enum
Change-Id: I2712a0901049885502cade31f9757f712048bb33
25 files changed, 69 insertions, 61 deletions
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 6211bcc9b935..54c944db99a8 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -196,7 +196,7 @@ void MacroEventListBox::ConnectElements() maListBox->InitHeaderBar( maHeaderBar.get() ); } -void MacroEventListBox::Show( bool bVisible, sal_uInt16 nFlags ) +void MacroEventListBox::Show( bool bVisible, ShowFlags nFlags ) { maListBox->Show( bVisible, nFlags ); maHeaderBar->Show( bVisible, nFlags ); diff --git a/cui/source/inc/headertablistbox.hxx b/cui/source/inc/headertablistbox.hxx index f63eba3c73c1..59037ed1b870 100644 --- a/cui/source/inc/headertablistbox.hxx +++ b/cui/source/inc/headertablistbox.hxx @@ -52,7 +52,7 @@ public: void ConnectElements();/**< should be called after all manipulations on elements are done calcs real sizes depending on sizes of this */ - void Show( bool bVisible = true, sal_uInt16 nFlags = 0 ); ///< same meaning as Windows::Show() + void Show( bool bVisible = true, ShowFlags nFlags = ShowFlags::NONE ); ///< same meaning as Windows::Show() void Enable( bool bEnable = true, bool bChild = true ); ///< same meaning as Windows::Enable() }; diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index 10ef520420ca..389c39d541a5 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -112,7 +112,7 @@ public: virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE; void Resize() SAL_OVERRIDE; - void Show( bool bVisible = true, sal_uInt16 nFlags = SHOW_NOACTIVATE ); + void Show( bool bVisible = true, ShowFlags nFlags = ShowFlags::NoActivate ); void SetTipPosPixel( const Point& rTipPos ) { maTipPos = rTipPos; } void SetTitleAndText( const OUString& rTitle, const OUString& rText, const Image& rImage ); @@ -862,7 +862,7 @@ void BubbleWindow::MouseButtonDown( const MouseEvent& ) } -void BubbleWindow::Show( bool bVisible, sal_uInt16 nFlags ) +void BubbleWindow::Show( bool bVisible, ShowFlags nFlags ) { SolarMutexGuard aGuard; diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index 3b4001a28fdf..8c640a81b503 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -377,7 +377,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() if ( pWindow ) { bool bForceFrontAndFocus(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext)); - pWindow->Show(true, bForceFrontAndFocus ? SHOW_FOREGROUNDTASK : 0 ); + pWindow->Show(true, bForceFrontAndFocus ? ShowFlags::ForegroundTask : ShowFlags::NONE ); } } diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index cd6932451f11..76dfc71ad7e2 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -1660,7 +1660,7 @@ throw (uno::RuntimeException, std::exception) vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow ) { - pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); bResult = true; bNotify = true; } diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 1b1b9fc41948..40a62d94c767 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -675,7 +675,7 @@ bool ToolbarLayoutManager::showToolbar( const OUString& rResourceURL ) if ( !aUIElement.m_bFloating ) implts_setLayoutDirty(); else - pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); aUIElement.m_bVisible = true; implts_writeWindowStateData( aUIElement ); @@ -755,7 +755,7 @@ void ToolbarLayoutManager::setFloatingToolbarsVisibility( bool bVisible ) if ( bVisible ) { if ( pIter->m_bVisible && !pIter->m_bMasterHide ) - pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } else pWindow->Show( false ); @@ -789,7 +789,7 @@ void ToolbarLayoutManager::setVisible( bool bVisible ) else { if ( pIter->m_bFloating ) - pWindow->Show(true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pWindow->Show(true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } } } @@ -1479,7 +1479,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno if ( bShowElement && pWindow ) { SolarMutexGuard aGuard; - pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } } else @@ -2542,7 +2542,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( if ( aWinRect.X < nCurrPos ) aWinRect.X = nCurrPos; pWindow->SetPosSizePixel( ::Point( aWinRect.X, nOffset ), ::Size( aWinRect.Width, rRowColumnWindowData.nStaticSize )); - pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); nCurrPos += ( aWinRect.X - nCurrPos ) + aWinRect.Width; } else @@ -2550,7 +2550,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( if ( aWinRect.Y < nCurrPos ) aWinRect.Y = nCurrPos; pWindow->SetPosSizePixel( ::Point( nOffset, aWinRect.Y ), ::Size( rRowColumnWindowData.nStaticSize, aWinRect.Height )); - pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); nCurrPos += ( aWinRect.Y - nCurrPos ) + aWinRect.Height; } } diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 42619711ad5a..f349ea6d9684 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1667,7 +1667,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X if( pWindow->IsVisible() && (bForceFrontAndFocus || bForceToFront) ) pWindow->ToTop(); else - pWindow->Show(true, (bForceFrontAndFocus || bForceToFront) ? SHOW_FOREGROUNDTASK : 0 ); + pWindow->Show(true, (bForceFrontAndFocus || bForceToFront) ? ShowFlags::ForegroundTask : ShowFlags::NONE ); } } diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx index 44c87bb48300..8e8d81427116 100644 --- a/framework/source/tabwin/tabwindow.cxx +++ b/framework/source/tabwin/tabwindow.cxx @@ -393,12 +393,12 @@ throw (css::uno::Exception, css::uno::RuntimeException, std::exception) pWindow = VCLUnoHelper::GetWindow( xContainerWindow ); if ( pWindow ) - pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); pWindow = VCLUnoHelper::GetWindow( xTabControl ); if ( pWindow ) { - pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); TabControl* pTabControl = static_cast<TabControl *>(pWindow); pTabControl->SetActivatePageHdl( LINK( this, TabWindow, Activate )); pTabControl->SetDeactivatePageHdl( LINK( this, TabWindow, Deactivate )); diff --git a/framework/source/uielement/progressbarwrapper.cxx b/framework/source/uielement/progressbarwrapper.cxx index b441d83ed6b7..d753b9e72ec4 100644 --- a/framework/source/uielement/progressbarwrapper.cxx +++ b/framework/source/uielement/progressbarwrapper.cxx @@ -118,7 +118,7 @@ void ProgressBarWrapper::start( const OUString& Text, ::sal_Int32 Range ) pStatusBar->SetProgressValue( sal_uInt16( nValue )); pStatusBar->SetUpdateMode( true ); } - pStatusBar->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pStatusBar->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } } } diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx index eb43f8e38343..cffb5b634ed9 100644 --- a/include/sfx2/childwin.hxx +++ b/include/sfx2/childwin.hxx @@ -183,7 +183,7 @@ public: Point GetPosPixel() { return pWindow->GetPosPixel(); } virtual void Hide(); - virtual void Show( sal_uInt16 nFlags ); + virtual void Show( ShowFlags nFlags ); SfxChildWindowFlags GetFlags() const { return GetInfo().nFlags; } bool CanGetFocus() const; diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 138a283f602d..fef38e5f06b1 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -168,10 +168,18 @@ namespace o3tl } // Flags for Show() -#define SHOW_NOPARENTUPDATE ((sal_uInt16)0x0001) -#define SHOW_NOFOCUSCHANGE ((sal_uInt16)0x0002) -#define SHOW_NOACTIVATE ((sal_uInt16)0x0004) -#define SHOW_FOREGROUNDTASK ((sal_uInt16)0x0008) +enum class ShowFlags +{ + NONE = 0x0000, + NoParentUpdate = 0x0001, + NoFocusChange = 0x0002, + NoActivate = 0x0004, + ForegroundTask = 0x0008, +}; +namespace o3tl +{ + template<> struct typed_flags<ShowFlags> : is_typed_flags<ShowFlags, 0x000f> {}; +} // Flags for SetZOrder() #define WINDOW_ZORDER_BEFOR ((sal_uInt16)0x0001) @@ -912,7 +920,7 @@ public: // return the dialog we are contained in or NULL if un-contained Dialog* GetParentDialog() const; - void Show( bool bVisible = true, sal_uInt16 nFlags = 0 ); + void Show( bool bVisible = true, ShowFlags nFlags = ShowFlags::NONE ); void Hide() { Show( false ); } bool IsVisible() const; bool IsReallyVisible() const; diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index 4dee934aa8fc..83a29f6e58ea 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -182,7 +182,7 @@ public: bool LockVisible( bool bLock ){ bool bVis = m_bVisibleLock; m_bVisibleLock = bLock; return bVis; } bool LockFreeWindow( bool bLock ){ bool bFreeWindow = m_bFreeWindowLock; m_bFreeWindowLock = bLock; return bFreeWindow; } void Hide() SAL_OVERRIDE { if( !m_bVisibleLock) SfxChildWindow::Hide(); } - void Show( sal_uInt16 nFlags ) SAL_OVERRIDE { if( !m_bVisibleLock ) SfxChildWindow::Show( nFlags ); } + void Show( ShowFlags nFlags ) SAL_OVERRIDE { if( !m_bVisibleLock ) SfxChildWindow::Show( nFlags ); } }; #endif // INCLUDED_SC_SOURCE_UI_INC_REFFACT_HXX diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index a735b7297d29..125a69bd06f8 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -665,7 +665,7 @@ void SfxChildWindow::Hide() } } -void SfxChildWindow::Show( sal_uInt16 nFlags ) +void SfxChildWindow::Show( ShowFlags nFlags ) { switch ( pWindow->GetType() ) { diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index b9999cb8b698..8766b25d2a83 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1065,7 +1065,7 @@ void SfxWorkWindow::ShowChildren_Impl() if ( SfxChildVisibility::VISIBLE == (pCli->nVisible & SfxChildVisibility::VISIBLE) && bVisible ) { - sal_uInt16 nFlags = pCli->bSetFocus ? 0 : SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE; + ShowFlags nFlags = pCli->bSetFocus ? ShowFlags::NONE : ShowFlags::NoFocusChange | ShowFlags::NoActivate; switch ( pCli->pWin->GetType() ) { case RSC_DOCKINGWINDOW : @@ -1672,7 +1672,7 @@ void SfxWorkWindow::HidePopups_Impl(bool bHide, bool bParent, sal_uInt16 nId ) { pChild->nVisible |= SfxChildVisibility::ACTIVE; if ( SfxChildVisibility::VISIBLE == (pChild->nVisible & SfxChildVisibility::VISIBLE) ) - pCW->Show( SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pCW->Show( ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } } } @@ -1741,7 +1741,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, pWin = pSplitWin->GetSplitWindow(); if ( pSplitWin->GetWindowCount() == 1 ) - static_cast<SplitWindow*>(pWin)->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + static_cast<SplitWindow*>(pWin)->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } } @@ -2265,7 +2265,7 @@ void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, bool bVisible, bool bSe { pCW->pCli->bSetFocus = bSetFocus; pCW->pCli->nVisible = SfxChildVisibility::VISIBLE; - pChildWin->Show( bSetFocus && pChildWin->WantsFocus() ? 0 : SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + pChildWin->Show( bSetFocus && pChildWin->WantsFocus() ? ShowFlags::NONE : ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } else static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Reappear_Impl(); diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 83c68dc1368c..2d6a8a41a50a 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -765,7 +765,7 @@ void SfxDockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode ) // before Show() is called must the reassignment have been made, // therefore the base class can not be called if ( IsFloatingMode() || !pImp->bSplitable ) - Show( false, SHOW_NOFOCUSCHANGE ); + Show( false, ShowFlags::NoFocusChange ); // Set the size for toggling. pImp->aSplitSize = rRect.GetSize(); @@ -773,7 +773,7 @@ void SfxDockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode ) { SetFloatingMode( bFloatMode ); if ( IsFloatingMode() || !pImp->bSplitable ) - Show( true, SHOW_NOFOCUSCHANGE ); + Show( true, ShowFlags::NoFocusChange ); } else { diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 5119f608b4e4..02830201f7cf 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -1365,7 +1365,7 @@ void SfxPopupWindow::StateChanged( } else if ( m_bFloating ) { - Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } } diff --git a/vcl/README.lifecycle b/vcl/README.lifecycle index 55ec1606ea84..6b5cbd6e8df4 100644 --- a/vcl/README.lifecycle +++ b/vcl/README.lifecycle @@ -25,7 +25,7 @@ various means such as DogTags to try to detect destruction of a window between calls: ImplDelData aDogTag( this ); // 'orrible old code - Show( true, SHOW_NOACTIVATE ); + Show( true, ShowFlags::NoActivate ); if( !aDogTag.IsDead() ) // did 'this' go invalid yet ? Update(); diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 7014a790f789..0ad533a2272e 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -352,7 +352,7 @@ void HelpTextWindow::SetHelpText( const OUString& rHelpText ) void HelpTextWindow::ImplShow() { ImplDelData aDogTag( this ); - Show( true, SHOW_NOACTIVATE ); + Show( true, ShowFlags::NoActivate ); if( !aDogTag.IsDead() ) Update(); } diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 52708dd7e865..84a083436445 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -833,7 +833,7 @@ ImplDockingWindowWrapper::~ImplDockingWindowWrapper() { if ( IsFloatingMode() ) { - GetWindow()->Show( false, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( false, ShowFlags::NoFocusChange ); SetFloatingMode( false ); } } @@ -1009,7 +1009,7 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, bool bFloatMo bool bShow = false; if ( bFloatMode != IsFloatingMode() ) { - GetWindow()->Show( false, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( false, ShowFlags::NoFocusChange ); SetFloatingMode( bFloatMode ); bShow = true; if ( bFloatMode ) @@ -1027,7 +1027,7 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, bool bFloatMo } if ( bShow ) - GetWindow()->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + GetWindow()->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } EndDockingData data( aRect, IsFloatingMode(), IsDockingCanceled() ); @@ -1104,7 +1104,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin if( IsFloatingMode() ) return; - GetWindow()->Show( false, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( false, ShowFlags::NoFocusChange ); // prepare reparenting vcl::Window* pRealParent = GetWindow()->GetWindow( GetWindowType::Parent ); @@ -1161,7 +1161,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd) { - GetWindow()->Show( false, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( false, ShowFlags::NoFocusChange ); // set parameter for handler before destroying floating window ImplPopupFloatWin *pPopupFloatWin = static_cast<ImplPopupFloatWin*>(mpFloatWin.get()); @@ -1212,7 +1212,7 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode ) if ( bFloatMode ) { - GetWindow()->Show( false, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( false, ShowFlags::NoFocusChange ); maDockPos = GetWindow()->GetPosPixel(); @@ -1265,13 +1265,13 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode ) mpFloatWin = pWin; if ( bVisible ) - GetWindow()->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + GetWindow()->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); ToggleFloatingMode(); } else { - GetWindow()->Show( false, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( false, ShowFlags::NoFocusChange ); // store FloatingData in FloatingWindow maFloatPos = mpFloatWin->GetPosPixel(); diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index e76b1c629809..348af892b773 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -476,7 +476,7 @@ void DockingWindow::dispose() { if ( IsFloatingMode() ) { - Show( false, SHOW_NOFOCUSCHANGE ); + Show( false, ShowFlags::NoFocusChange ); SetFloatingMode( false ); } delete mpImplData; @@ -675,7 +675,7 @@ void DockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode ) bool bShow = false; if ( bool(bFloatMode) != IsFloatingMode() ) { - Show( false, SHOW_NOFOCUSCHANGE ); + Show( false, ShowFlags::NoFocusChange ); SetFloatingMode( bFloatMode ); bShow = true; if ( bFloatMode && mpFloatWin ) @@ -711,7 +711,7 @@ bool DockingWindow::Close() if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() ) return false; - Show( false, SHOW_NOFOCUSCHANGE ); + Show( false, ShowFlags::NoFocusChange ); return true; } @@ -790,7 +790,7 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) if ( bFloatMode ) { - Show( false, SHOW_NOFOCUSCHANGE ); + Show( false, ShowFlags::NoFocusChange ); sal_Int32 nBorderWidth = get_border_width(); @@ -852,7 +852,7 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) } else { - Show( false, SHOW_NOFOCUSCHANGE ); + Show( false, ShowFlags::NoFocusChange ); sal_Int32 nBorderWidth = get_border_width(); diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 6e4f2a56592f..28a40d09c062 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -639,7 +639,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags { // avoid flickering if ( IsVisible() ) - Show( false, SHOW_NOFOCUSCHANGE ); + Show( false, ShowFlags::NoFocusChange ); if ( IsRollUp() ) RollDown(); @@ -713,7 +713,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags // force key input even without focus (useful for menus) mbGrabFocus = true; } - Show( true, SHOW_NOACTIVATE ); + Show( true, ShowFlags::NoActivate ); } void FloatingWindow::StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags ) @@ -784,7 +784,7 @@ void FloatingWindow::ImplEndPopupMode( FloatWinPopupEndFlags nFlags, sal_uLong n if ( !(nFlags & FloatWinPopupEndFlags::TearOff) || !(nPopupModeFlags & FloatWinPopupFlags::AllowTearOff) ) { - Show( false, SHOW_NOFOCUSCHANGE ); + Show( false, ShowFlags::NoFocusChange ); // maybe pass focus on to a suitable FloatingWindow if ( nFocusId ) diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index dc0f78e78d72..3d4fabb3e60f 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -413,7 +413,7 @@ void Window::ImplShowAllOverlaps() { if ( pOverlapWindow->mpWindowImpl->mbOverlapVisible ) { - pOverlapWindow->Show( true, SHOW_NOACTIVATE ); + pOverlapWindow->Show( true, ShowFlags::NoActivate ); pOverlapWindow->mpWindowImpl->mbOverlapVisible = false; } @@ -901,7 +901,7 @@ void Window::SetParent( vcl::Window* pNewParent ) mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame ); bool bVisible = IsVisible(); - Show( false, SHOW_NOFOCUSCHANGE ); + Show( false, ShowFlags::NoFocusChange ); // check if the overlap window changes vcl::Window* pOldOverlapWindow; @@ -1017,7 +1017,7 @@ void Window::SetParent( vcl::Window* pNewParent ) ImplGetOwnerDrawList().push_back( this ); if ( bVisible ) - Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate ); } sal_uInt16 Window::GetChildCount() const diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 8a5e8c737fb9..a916bc66c4d1 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2272,7 +2272,7 @@ vcl::Font Window::GetPointFont(vcl::RenderContext& rRenderContext) const return aFont; } -void Window::Show(bool bVisible, sal_uInt16 nFlags) +void Window::Show(bool bVisible, ShowFlags nFlags) { if ( IsDisposed() || mpWindowImpl->mbVisible == bVisible ) return; @@ -2332,7 +2332,7 @@ void Window::Show(bool bVisible, sal_uInt16 nFlags) if ( ImplIsOverlapWindow() && !mpWindowImpl->mbFrame ) { // convert focus - if ( !(nFlags & SHOW_NOFOCUSCHANGE) && HasChildPathFocus() ) + if ( !(nFlags & ShowFlags::NoFocusChange) && HasChildPathFocus() ) { if ( mpWindowImpl->mpOverlapWindow->IsEnabled() && mpWindowImpl->mpOverlapWindow->IsInputEnabled() && @@ -2361,7 +2361,7 @@ void Window::Show(bool bVisible, sal_uInt16 nFlags) aBounds.Bottom() += workaround_border; aInvRegion = aBounds; } - if ( !mpWindowImpl->mbNoParentUpdate && !(nFlags & SHOW_NOPARENTUPDATE) ) + if ( !mpWindowImpl->mbNoParentUpdate && !(nFlags & ShowFlags::NoParentUpdate) ) { if ( !aInvRegion.IsEmpty() ) ImplInvalidateParentFrameRegion( aInvRegion ); @@ -2405,9 +2405,9 @@ void Window::Show(bool bVisible, sal_uInt16 nFlags) // If it is a SystemWindow it automatically pops up on top of // all other windows if needed. - if ( ImplIsOverlapWindow() && !(nFlags & SHOW_NOACTIVATE) ) + if ( ImplIsOverlapWindow() && !(nFlags & ShowFlags::NoActivate) ) { - ImplStartToTop(( nFlags & SHOW_FOREGROUNDTASK ) ? TOTOP_FOREGROUNDTASK : 0 ); + ImplStartToTop(( nFlags & ShowFlags::ForegroundTask ) ? TOTOP_FOREGROUNDTASK : 0 ); ImplFocusToTop( 0, false ); } @@ -2455,7 +2455,7 @@ void Window::Show(bool bVisible, sal_uInt16 nFlags) mpWindowImpl->mbPaintFrame = true; if (!Application::GetSettings().GetMiscSettings().GetPseudoHeadless()) { - bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) != 0; + bool bNoActivate(nFlags & (ShowFlags::NoActivate|ShowFlags::NoFocusChange)); mpWindowImpl->mpFrame->Show( true, bNoActivate ); } if( aDogTag.IsDead() ) diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx index 896d345b45c3..f7070e55445b 100644 --- a/vcl/unx/generic/app/i18n_status.cxx +++ b/vcl/unx/generic/app/i18n_status.cxx @@ -246,7 +246,7 @@ void XIMStatusWindow::setPosition( SalFrame* pParent ) { setText( OUString() ); m_pLastParent = pParent; - Show( false, SHOW_NOACTIVATE ); + Show( false, ShowFlags::NoActivate ); } if( IsVisible() ) { @@ -270,7 +270,7 @@ IMPL_LINK_NOARG(XIMStatusWindow, DelayedShowHdl) Point aPoint = updatePosition(); pStatusFrame->SetPosSize( aPoint.X(), aPoint.Y(), m_aWindowSize.Width(), m_aWindowSize.Height(), SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y | SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT ); } - Show( m_bDelayedShow && m_bOn, SHOW_NOACTIVATE ); + Show( m_bDelayedShow && m_bOn, ShowFlags::NoActivate ); if( m_bDelayedShow ) { XRaiseWindow( static_cast<Display*>(pData->pDisplay), diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index a80409a3cbcd..7bc6270f8c2f 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1531,7 +1531,7 @@ class DemoPopup : public FloatingWindow SetOutputSizePixel( Size( 300, 30 ) ); SetBackground(Wallpaper(COL_YELLOW)); - Show( true, SHOW_NOACTIVATE ); + Show( true, ShowFlags::NoActivate ); Update(); } |