summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-26 15:22:10 +0200
committerNoel Grandin <noel@peralex.com>2015-05-27 11:14:26 +0200
commit9e3b1236b68069016d646b5682ce541335b5340c (patch)
tree5554d6d0baba0cc3c55ab5e1a9fba04104b0ae74 /vcl
parentedc69a55c30ac6cc12de0bf18bddb7dc3f210be4 (diff)
convert WINDOW_DLGCTRL flags to scoped enum
Change-Id: I6c3a95cdcb15e5b1d4adb13908a751b06a302e20
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/window.h3
-rw-r--r--vcl/source/edit/vclmedit.cxx4
-rw-r--r--vcl/source/window/dlgctrl.cxx10
-rw-r--r--vcl/source/window/event.cxx2
-rw-r--r--vcl/source/window/floatwin.cxx2
-rw-r--r--vcl/source/window/mouse.cxx6
-rw-r--r--vcl/source/window/window.cxx4
-rw-r--r--vcl/source/window/window2.cxx4
8 files changed, 18 insertions, 17 deletions
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index b5216e07f952..bcb6f062d42c 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -59,6 +59,7 @@ class SalObject;
enum class MouseEventModifiers;
enum class MouseNotifyEvent;
enum class ActivateModeFlags;
+enum class DialogControlFlags;
namespace com { namespace sun { namespace star {
@@ -276,7 +277,7 @@ public:
sal_uInt16 mnGetFocusFlags;
sal_uInt16 mnParentClipMode;
ActivateModeFlags mnActivateMode;
- sal_uInt16 mnDlgCtrlFlags;
+ DialogControlFlags mnDlgCtrlFlags;
sal_uInt16 mnLockCount;
AlwaysInputMode meAlwaysInputMode;
VclAlign meHalign;
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 00a721fd1335..a21c360799cd 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -250,7 +250,7 @@ void ImpVclMEdit::InitFromStyle( WinBits nWinStyle )
mpTextWindow->SetIgnoreTab( false );
// #103667# VclMultiLineEdit has the flag, but focusable window also needs this flag
WinBits nStyle = mpTextWindow->GetStyle();
- nStyle |= WINDOW_DLGCTRL_MOD1TAB;
+ nStyle |= WB_NODIALOGCONTROL;
mpTextWindow->SetStyle( nStyle );
}
}
@@ -971,7 +971,7 @@ WinBits VclMultiLineEdit::ImplInitStyle( WinBits nStyle )
nStyle |= WB_GROUP;
if ( !(nStyle & WB_IGNORETAB ))
- nStyle |= WINDOW_DLGCTRL_MOD1TAB;
+ nStyle |= WB_NODIALOGCONTROL;
return nStyle;
}
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 243be072e018..ece10d9c145f 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -596,7 +596,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
sal_uInt16 nIndex;
sal_uInt16 nFormStart;
sal_uInt16 nFormEnd;
- sal_uInt16 nDlgCtrlFlags;
+ DialogControlFlags nDlgCtrlFlags;
// we cannot take over control without Focus-window
vcl::Window* pFocusWindow = Application::GetFocusWindow();
@@ -610,7 +610,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
return false;
i = nIndex;
- nDlgCtrlFlags = 0;
+ nDlgCtrlFlags = DialogControlFlags::NONE;
pTempWindow = pSWindow;
do
{
@@ -639,7 +639,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
pButtonWindow = NULL;
}
- if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & WINDOW_DLGCTRL_RETURN) )
+ if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & DialogControlFlags::Return) )
{
GetDlgWindowType nType;
sal_uInt16 nGetFocusFlags = GETFOCUS_TAB;
@@ -801,8 +801,8 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
{
// Only use Ctrl-TAB if it was allowed for the whole
// dialog or for the current control (#103667#)
- if ( !aKeyCode.IsMod1() || (nDlgCtrlFlags & WINDOW_DLGCTRL_MOD1TAB) ||
- ( pSWindow->GetStyle() & WINDOW_DLGCTRL_MOD1TAB) )
+ if ( !aKeyCode.IsMod1() || (nDlgCtrlFlags & DialogControlFlags::Mod1Tab) ||
+ ( pSWindow->GetStyle() & WB_NODIALOGCONTROL) )
{
if ( aKeyCode.IsShift() )
{
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 3cc2c7c19c43..eda79c040bbd 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -180,7 +180,7 @@ bool Window::Notify( NotifyEvent& rNEvt )
{
ImplDlgCtrlFocusChanged( rNEvt.GetWindow(), rNEvt.GetType() == MouseNotifyEvent::GETFOCUS );
if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) &&
- !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) )
+ !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
{
sal_uInt16 n = 0;
vcl::Window* pFirstChild = ImplGetDlgWindow( n, GetDlgWindowType::First );
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 468d8ccc0536..78dcefdd3a93 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -216,7 +216,7 @@ void FloatingWindow::dispose()
if( mbPopupModeCanceled )
// indicates that ESC key was pressed
// will be handled in Window::ImplGrabFocus()
- SetDialogControlFlags( GetDialogControlFlags() | WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL );
+ SetDialogControlFlags( GetDialogControlFlags() | DialogControlFlags::FloatWinPopupModeEndCancel );
if ( IsInPopupMode() )
EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll | FloatWinPopupEndFlags::DontCallHdl );
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index e250c6b38f3e..1167ac4ef2d7 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -216,7 +216,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
// ensure that dialogs on close pass the focus back to
// the correct window
if ( mpWindowImpl->mpLastFocusWindow && (mpWindowImpl->mpLastFocusWindow.get() != this) &&
- !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) &&
+ !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) &&
mpWindowImpl->mpLastFocusWindow->IsEnabled() &&
mpWindowImpl->mpLastFocusWindow->IsInputEnabled() &&
! mpWindowImpl->mpLastFocusWindow->IsInModalMode()
@@ -232,7 +232,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
// ensure that dialogs on close pass the focus back to
// the correct window
if ( mpWindowImpl->mpLastFocusWindow && (mpWindowImpl->mpLastFocusWindow.get() != this) &&
- !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) &&
+ !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) &&
mpWindowImpl->mpLastFocusWindow->IsEnabled() &&
mpWindowImpl->mpLastFocusWindow->IsInputEnabled() &&
! mpWindowImpl->mpLastFocusWindow->IsInModalMode()
@@ -380,7 +380,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
// eg, toolboxes can select their recent active item
if( pOldFocusWindow &&
! aOldFocusDel.IsDead() &&
- ( pOldFocusWindow->GetDialogControlFlags() & WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ) )
+ ( pOldFocusWindow->GetDialogControlFlags() & DialogControlFlags::FloatWinPopupModeEndCancel ) )
mpWindowImpl->mnGetFocusFlags |= GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL;
NotifyEvent aNEvt( MouseNotifyEvent::GETFOCUS, this );
if ( !ImplCallPreNotify( aNEvt ) && !aDogTag.IsDead() )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index c2d8bd9f4c7f..6bb652f51129 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -648,7 +648,7 @@ WindowImpl::WindowImpl( WindowType nType )
mnPaintFlags = 0; // Flags for ImplCallPaint
mnParentClipMode = 0; // Flags for Parent-ClipChildren-Mode
mnActivateMode = ActivateModeFlags::NONE; // Will be converted in System/Overlap-Windows
- mnDlgCtrlFlags = 0; // DialogControl-Flags
+ mnDlgCtrlFlags = DialogControlFlags::NONE; // DialogControl-Flags
mnLockCount = 0; // LockCount
meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called
meHalign = VCL_ALIGN_FILL;
@@ -1927,7 +1927,7 @@ void Window::Deactivate() {}
void Window::GetFocus()
{
- if ( HasFocus() && mpWindowImpl->mpLastFocusWindow && !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) )
+ if ( HasFocus() && mpWindowImpl->mpLastFocusWindow && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
{
ImplDelData aDogtag( this );
mpWindowImpl->mpLastFocusWindow->GrabFocus();
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 17cc082cac1d..99fd9ce19e09 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1199,12 +1199,12 @@ bool Window::IsDialogControlStart() const
return mpWindowImpl && mpWindowImpl->mbDlgCtrlStart;
}
-void Window::SetDialogControlFlags( sal_uInt16 nFlags )
+void Window::SetDialogControlFlags( DialogControlFlags nFlags )
{
mpWindowImpl->mnDlgCtrlFlags = nFlags;
}
-sal_uInt16 Window::GetDialogControlFlags() const
+DialogControlFlags Window::GetDialogControlFlags() const
{
return mpWindowImpl->mnDlgCtrlFlags;
}