summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/window.hxx14
-rw-r--r--vcl/inc/window.h3
-rw-r--r--vcl/source/window/brdwin.cxx2
-rw-r--r--vcl/source/window/dialog.cxx2
-rw-r--r--vcl/source/window/event.cxx6
-rw-r--r--vcl/source/window/floatwin.cxx2
-rw-r--r--vcl/source/window/stacking.cxx4
-rw-r--r--vcl/source/window/syswin.cxx2
-rw-r--r--vcl/source/window/window.cxx6
-rw-r--r--vcl/source/window/window2.cxx2
-rw-r--r--vcl/source/window/winproc.cxx2
-rw-r--r--vcl/source/window/wrkwin.cxx2
12 files changed, 28 insertions, 19 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index cc5c695a90d6..eb2d6a864169 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -196,7 +196,15 @@ namespace o3tl
}
// Activate-Flags
-#define ACTIVATE_MODE_GRABFOCUS ((sal_uInt16)0x0001)
+enum class ActivateModeFlags
+{
+ NONE = 0,
+ GrabFocus = 0x0001,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ActivateModeFlags> : is_typed_flags<ActivateModeFlags, 0x0001> {};
+}
// ToTop-Flags
#define TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001)
@@ -1009,8 +1017,8 @@ public:
*/
bool IsInModalMode() const;
- void SetActivateMode( sal_uInt16 nMode );
- sal_uInt16 GetActivateMode() const;
+ void SetActivateMode( ActivateModeFlags nMode );
+ ActivateModeFlags GetActivateMode() const;
void ToTop( sal_uInt16 nFlags = 0 );
void SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags );
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 48fea9eb74d8..b5216e07f952 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -58,6 +58,7 @@ class SalFrame;
class SalObject;
enum class MouseEventModifiers;
enum class MouseNotifyEvent;
+enum class ActivateModeFlags;
namespace com { namespace sun { namespace star {
@@ -274,7 +275,7 @@ public:
sal_uInt16 mnPaintFlags;
sal_uInt16 mnGetFocusFlags;
sal_uInt16 mnParentClipMode;
- sal_uInt16 mnActivateMode;
+ ActivateModeFlags mnActivateMode;
sal_uInt16 mnDlgCtrlFlags;
sal_uInt16 mnLockCount;
AlwaysInputMode meAlwaysInputMode;
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 0d6ab4edab21..a614b3a7300a 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1884,7 +1884,7 @@ void ImplBorderWindow::Deactivate()
{
// remove active windows from the ruler, also ignore the Deactivate
// if a menu becomes active
- if ( GetActivateMode() && !ImplGetSVData()->maWinData.mbNoDeactivate )
+ if ( GetActivateMode() != ActivateModeFlags::NONE && !ImplGetSVData()->maWinData.mbNoDeactivate )
SetDisplayActive( false );
Window::Deactivate();
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index c73308903b47..063e96f0c8a9 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -427,7 +427,7 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag )
mpWindowImpl->mpRealParent = pParent;
}
- SetActivateMode( ACTIVATE_MODE_GRABFOCUS );
+ SetActivateMode( ActivateModeFlags::GrabFocus );
ImplInitSettings();
}
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 61c11ab20bdd..0c201b9b0c37 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -515,17 +515,17 @@ void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow,
pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
if ( (pOldRealWindow->GetType() != WINDOW_FLOATINGWINDOW) ||
- pOldRealWindow->GetActivateMode() )
+ pOldRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
{
if ( (pNewRealWindow->GetType() == WINDOW_FLOATINGWINDOW) &&
- !pNewRealWindow->GetActivateMode() )
+ pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE)
{
pSVData->maWinData.mpLastDeacWin = pOldOverlapWindow;
bCallDeactivate = false;
}
}
else if ( (pNewRealWindow->GetType() != WINDOW_FLOATINGWINDOW) ||
- pNewRealWindow->GetActivateMode() )
+ pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
{
if ( pSVData->maWinData.mpLastDeacWin )
{
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 28a40d09c062..f9abdf6cfc01 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -119,7 +119,7 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle )
mpWindowImpl->mpRealParent = pParent;
}
}
- SetActivateMode( 0 );
+ SetActivateMode( ActivateModeFlags::NONE );
mpNextFloat = NULL;
mpFirstPopupModeWin = NULL;
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index 596f49ae00b2..8c6c97be2c7e 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -392,12 +392,12 @@ void Window::ImplFocusToTop( sal_uInt16 nFlags, bool bReallyVisible )
// should always find the belonging BorderWindow
if ( !pFocusWindow->mpWindowImpl->mpBorderWindow )
{
- if ( pFocusWindow->mpWindowImpl->mnActivateMode & ACTIVATE_MODE_GRABFOCUS )
+ if ( pFocusWindow->mpWindowImpl->mnActivateMode & ActivateModeFlags::GrabFocus )
break;
}
pFocusWindow = pFocusWindow->ImplGetParent();
}
- if ( (pFocusWindow->mpWindowImpl->mnActivateMode & ACTIVATE_MODE_GRABFOCUS) &&
+ if ( (pFocusWindow->mpWindowImpl->mnActivateMode & ActivateModeFlags::GrabFocus) &&
!pFocusWindow->HasChildPathFocus( true ) )
pFocusWindow->GrabFocus();
}
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index d348e2b15e84..4e46c8acb74c 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -69,7 +69,7 @@ void SystemWindow::Init()
{
mpImplData = new ImplData;
mpWindowImpl->mbSysWin = true;
- mpWindowImpl->mnActivateMode = ACTIVATE_MODE_GRABFOCUS;
+ mpWindowImpl->mnActivateMode = ActivateModeFlags::GrabFocus;
mpMenuBar = NULL;
mbPinned = false;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index a916bc66c4d1..8a5d7d8f0844 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -655,7 +655,7 @@ WindowImpl::WindowImpl( WindowType nType )
mnWaitCount = 0; // Wait-Count (>1 == Warte-MousePointer)
mnPaintFlags = 0; // Flags for ImplCallPaint
mnParentClipMode = 0; // Flags for Parent-ClipChildren-Mode
- mnActivateMode = 0; // Will be converted in System/Overlap-Windows
+ mnActivateMode = ActivateModeFlags::NONE; // Will be converted in System/Overlap-Windows
mnDlgCtrlFlags = 0; // DialogControl-Flags
mnLockCount = 0; // LockCount
meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called
@@ -2798,7 +2798,7 @@ void Window::AlwaysDisableInput( bool bAlways, bool bChild )
}
}
-void Window::SetActivateMode( sal_uInt16 nMode )
+void Window::SetActivateMode( ActivateModeFlags nMode )
{
if ( mpWindowImpl->mpBorderWindow )
@@ -2809,7 +2809,7 @@ void Window::SetActivateMode( sal_uInt16 nMode )
mpWindowImpl->mnActivateMode = nMode;
// possibly trigger Decativate/Activate
- if ( mpWindowImpl->mnActivateMode )
+ if ( mpWindowImpl->mnActivateMode != ActivateModeFlags::NONE )
{
if ( (mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW)) &&
!HasChildPathFocus( true ) )
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 5e8c8f859d82..17cc082cac1d 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1284,7 +1284,7 @@ bool Window::IsAlwaysEnableInput() const
return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled;
}
-sal_uInt16 Window::GetActivateMode() const
+ActivateModeFlags Window::GetActivateMode() const
{
return mpWindowImpl->mnActivateMode;
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index d3c43b03eb3d..4331a4037905 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1760,7 +1760,7 @@ static void ImplActivateFloatingWindows( vcl::Window* pWindow, bool bActive )
vcl::Window* pTempWindow = pWindow->ImplGetWindowImpl()->mpFirstOverlap;
while ( pTempWindow )
{
- if ( !pTempWindow->GetActivateMode() )
+ if ( pTempWindow->GetActivateMode() == ActivateModeFlags::NONE )
{
if ( (pTempWindow->GetType() == WINDOW_BORDERWINDOW) &&
(pTempWindow->ImplGetWindow()->GetType() == WINDOW_FLOATINGWINDOW) )
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index 136adc859d84..78d0b24951dd 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -64,7 +64,7 @@ void WorkWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentDat
pSVData->maWinData.mpAppWin = this;
}
- SetActivateMode( ACTIVATE_MODE_GRABFOCUS );
+ SetActivateMode( ActivateModeFlags::GrabFocus );
}
void WorkWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, const ::com::sun::star::uno::Any& aSystemWorkWindowToken )