diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-27 15:09:52 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-28 12:47:07 +0200 |
commit | 79db3fc0ee41a6284eb2175a4780f4157cb708f6 (patch) | |
tree | 5a9fd718cd188bc3491f2f80758bbcd83fa2b342 /vcl/source | |
parent | a086ca18987a91543a65a3965b2bbc4c022400f8 (diff) |
convert STARTTRACK constants to scoped enum
Change-Id: I9b441688eb59ffd3540b014716a9abe7969c9be4
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/button.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/scrbar.cxx | 10 | ||||
-rw-r--r-- | vcl/source/control/slider.cxx | 9 | ||||
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dockwin.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/mouse.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 10 | ||||
-rw-r--r-- | vcl/source/window/winproc.cxx | 8 |
11 files changed, 31 insertions, 32 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 9998c2292e03..b13ac6fd669f 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1200,17 +1200,17 @@ void PushButton::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.IsLeft() && ImplHitTestPushButton( this, rMEvt.GetPosPixel() ) ) { - sal_uInt16 nTrackFlags = 0; + StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE; if ( ( GetStyle() & WB_REPEAT ) && ! ( GetStyle() & WB_TOGGLE ) ) - nTrackFlags |= STARTTRACK_BUTTONREPEAT; + nTrackFlags |= StartTrackingFlags::ButtonRepeat; ImplGetButtonState() |= DrawButtonFlags::Pressed; Invalidate(); StartTracking( nTrackFlags ); - if ( nTrackFlags & STARTTRACK_BUTTONREPEAT ) + if ( nTrackFlags & StartTrackingFlags::ButtonRepeat ) Click(); } } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index e83ae507aa7d..9ff20ba8b47e 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1375,7 +1375,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt ) ImplSetCursorPos( nCharPos, rMEvt.IsShift() ); if ( !mbClickedInSelection && rMEvt.IsLeft() && ( rMEvt.GetClicks() == 1 ) ) - StartTracking( STARTTRACK_SCROLLREPEAT ); + StartTracking( StartTrackingFlags::ScrollRepeat ); } mbInMBDown = true; // then do not select all in GetFocus diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index f7d4592b7d4b..2cf7dfb9407a 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -859,7 +859,7 @@ void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt ) if ( mbGrabFocus ) GrabFocus(); - StartTracking( STARTTRACK_SCROLLREPEAT ); + StartTracking( StartTrackingFlags::ScrollRepeat ); } } if( rMEvt.GetClicks() == 2 ) @@ -946,7 +946,7 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt ) if ( mbStackMode && ( mpEntryList->GetSelectionAnchor() == LISTBOX_ENTRY_NOTFOUND ) ) mpEntryList->SetSelectionAnchor( 0 ); - StartTracking( STARTTRACK_SCROLLREPEAT ); + StartTracking( StartTrackingFlags::ScrollRepeat ); } } } diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 2d7fdc3adb3e..699f8e87fc2c 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -898,7 +898,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) if (rMEvt.IsLeft() || rMEvt.IsMiddle() || rMEvt.IsRight()) { const Point& rMousePos = rMEvt.GetPosPixel(); - sal_uInt16 nTrackFlags = 0; + StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE; bool bHorizontal = ( GetStyle() & WB_HORZ ) != 0; bool bIsInside = false; bool bDragToMouse = false; @@ -913,7 +913,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) { if (rMEvt.IsLeft() && !(mnStateFlags & SCRBAR_STATE_BTN1_DISABLE) ) { - nTrackFlags = STARTTRACK_BUTTONREPEAT; + nTrackFlags = StartTrackingFlags::ButtonRepeat; meScrollType = SCROLL_LINEUP; mnDragDraw = SCRBAR_DRAW_BTN1; } @@ -925,7 +925,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) { if (rMEvt.IsLeft() && !(mnStateFlags & SCRBAR_STATE_BTN2_DISABLE) ) { - nTrackFlags = STARTTRACK_BUTTONREPEAT; + nTrackFlags = StartTrackingFlags::ButtonRepeat; meScrollType = SCROLL_LINEDOWN; mnDragDraw = SCRBAR_DRAW_BTN2; } @@ -953,7 +953,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) if ( mnVisibleSize < mnMaxRange-mnMinRange ) { - nTrackFlags = 0; + nTrackFlags = StartTrackingFlags::NONE; meScrollType = SCROLL_DRAG; mnDragDraw = SCRBAR_DRAW_THUMB; @@ -982,7 +982,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) aControlRegion, rMousePos, bIsInside ) || bIsInside) ) { - nTrackFlags = STARTTRACK_BUTTONREPEAT; + nTrackFlags = StartTrackingFlags::ButtonRepeat; // HitTestNativeControl, see remark at top of file if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER, diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index f30e0c030244..db264ee6b703 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -658,12 +658,11 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeft() ) { - const Point& rMousePos = rMEvt.GetPosPixel(); - sal_uInt16 nTrackFlags = 0; + const Point& rMousePos = rMEvt.GetPosPixel(); + StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE; if ( maThumbRect.IsInside( rMousePos ) ) { - nTrackFlags = 0; meScrollType = SCROLL_DRAG; mnDragDraw = SLIDER_DRAW_THUMB; @@ -680,7 +679,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) meScrollType = SCROLL_SET; else { - nTrackFlags = STARTTRACK_BUTTONREPEAT; + nTrackFlags = StartTrackingFlags::ButtonRepeat; meScrollType = SCROLL_PAGEUP; } @@ -692,7 +691,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) meScrollType = SCROLL_SET; else { - nTrackFlags = STARTTRACK_BUTTONREPEAT; + nTrackFlags = StartTrackingFlags::ButtonRepeat; meScrollType = SCROLL_PAGEDOWN; } diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 84a083436445..a1cd73420418 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -730,7 +730,7 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt ) { // start window move mbMoving = true; - StartTracking( STARTTRACK_NOKEYCANCEL ); + StartTracking( StartTrackingFlags::NoKeyCancel ); return; } if( !mbHighlight && GetDragRect().IsInside( aMousePos ) ) @@ -891,7 +891,7 @@ bool ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos ) GetWindow()->ImplUpdateAll(); GetWindow()->ImplGetFrameWindow()->ImplUpdateAll(); - GetWindow()->StartTracking( STARTTRACK_KEYMOD ); + GetWindow()->StartTracking( StartTrackingFlags::KeyMod ); return true; } diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 348af892b773..658e8dbc4fcb 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -299,7 +299,7 @@ bool DockingWindow::ImplStartDocking( const Point& rPos ) ImplGetFrameWindow()->ImplUpdateAll(); } - StartTracking( STARTTRACK_KEYMOD ); + StartTracking( StartTrackingFlags::KeyMod ); return true; } diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index 9114ac093ab1..3582ed62a3cd 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -352,7 +352,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags ) if ( pOldFocusWindow && ! aOldFocusDel.IsDead() ) { if ( pOldFocusWindow->IsTracking() && - (pSVData->maWinData.mnTrackFlags & STARTTRACK_FOCUSCANCEL) ) + (pSVData->maWinData.mnTrackFlags & StartTrackingFlags::FocusCancel) ) pOldFocusWindow->EndTracking( TrackingEventFlags::Cancel | TrackingEventFlags::Focus ); NotifyEvent aNEvt( MouseNotifyEvent::LOSEFOCUS, pOldFocusWindow ); if ( !ImplCallPreNotify( aNEvt ) ) diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 53ef7fa7494f..a98380008563 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -3871,14 +3871,14 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) } // update actual data - sal_uInt16 nTrackFlags = 0; + StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE; mnCurPos = i; mnCurItemId = it->mnId; mnDownItemId = mnCurItemId; mnMouseClicks = rMEvt.GetClicks(); mnMouseModifier = rMEvt.GetModifier(); if ( it->mnBits & ToolBoxItemBits::REPEAT ) - nTrackFlags |= STARTTRACK_BUTTONREPEAT; + nTrackFlags |= StartTrackingFlags::ButtonRepeat; if ( mbSelection ) { @@ -3939,7 +3939,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) Click(); // also call Select handler at repeat - if ( nTrackFlags & STARTTRACK_BUTTONREPEAT ) + if ( nTrackFlags & StartTrackingFlags::ButtonRepeat ) Select(); // if the actions was not aborted in Click handler diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index a177383fa782..bed0306a541f 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -350,7 +350,7 @@ IMPL_LINK_TYPED( Window, ImplTrackTimerHdl, Timer*, pTimer, void ) ImplSVData* pSVData = ImplGetSVData(); // Bei Button-Repeat muessen wir den Timeout umsetzen - if ( pSVData->maWinData.mnTrackFlags & STARTTRACK_BUTTONREPEAT ) + if ( pSVData->maWinData.mnTrackFlags & StartTrackingFlags::ButtonRepeat ) pTimer->SetTimeout( GetSettings().GetMouseSettings().GetButtonRepeat() ); // Tracking-Event erzeugen @@ -369,7 +369,7 @@ IMPL_LINK_TYPED( Window, ImplTrackTimerHdl, Timer*, pTimer, void ) Tracking( aTEvt ); } -void Window::StartTracking( sal_uInt16 nFlags ) +void Window::StartTracking( StartTrackingFlags nFlags ) { ImplSVData* pSVData = ImplGetSVData(); @@ -379,11 +379,11 @@ void Window::StartTracking( sal_uInt16 nFlags ) pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel ); } - if ( nFlags & (STARTTRACK_SCROLLREPEAT | STARTTRACK_BUTTONREPEAT) ) + if ( nFlags & (StartTrackingFlags::ScrollRepeat | StartTrackingFlags::ButtonRepeat) ) { pSVData->maWinData.mpTrackTimer = new AutoTimer; - if ( nFlags & STARTTRACK_SCROLLREPEAT ) + if ( nFlags & StartTrackingFlags::ScrollRepeat ) pSVData->maWinData.mpTrackTimer->SetTimeout( GetSettings().GetMouseSettings().GetScrollRepeat() ); else pSVData->maWinData.mpTrackTimer->SetTimeout( GetSettings().GetMouseSettings().GetButtonStartRepeat() ); @@ -413,7 +413,7 @@ void Window::EndTracking( TrackingEventFlags nFlags ) } pSVData->maWinData.mpTrackWin = NULL; - pSVData->maWinData.mnTrackFlags = 0; + pSVData->maWinData.mnTrackFlags = StartTrackingFlags::NONE; ReleaseMouse(); } diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index a56f94df7164..9278c2b53d0f 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -687,7 +687,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool { // When ScrollRepeat, we restart the timer if ( pSVData->maWinData.mpTrackTimer && - (pSVData->maWinData.mnTrackFlags & STARTTRACK_SCROLLREPEAT) ) + (pSVData->maWinData.mnTrackFlags & StartTrackingFlags::ScrollRepeat) ) pSVData->maWinData.mpTrackTimer->Start(); } bCallHelpRequest = false; @@ -717,7 +717,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool else if ( nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN ) { if ( pSVData->maWinData.mpTrackWin && - !(pSVData->maWinData.mnTrackFlags & STARTTRACK_MOUSEBUTTONDOWN) ) + !(pSVData->maWinData.mnTrackFlags & StartTrackingFlags::MouseButtonDown) ) bRet = true; else { @@ -947,7 +947,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, { sal_uInt16 nOrigCode = aKeyCode.GetCode(); - if ( (nOrigCode == KEY_ESCAPE) && !(pSVData->maWinData.mnTrackFlags & STARTTRACK_NOKEYCANCEL) ) + if ( (nOrigCode == KEY_ESCAPE) && !(pSVData->maWinData.mnTrackFlags & StartTrackingFlags::NoKeyCancel) ) { pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel | TrackingEventFlags::Key ); if ( pSVData->maWinData.mpFirstFloat ) @@ -968,7 +968,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Key ); return true; } - else if ( !(pSVData->maWinData.mnTrackFlags & STARTTRACK_KEYINPUT) ) + else if ( !(pSVData->maWinData.mnTrackFlags & StartTrackingFlags::KeyInput) ) return true; } |