diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-30 16:26:11 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-06 10:59:43 +0200 |
commit | abe670157b69aa7fe4b478f1fd13757d7b7fcc4b (patch) | |
tree | aa3fbd80e0fbc9ac3d1674d37c0fcb01ffa595f5 | |
parent | a48d8465c3f9f36a02fb3c6a79f5dbb5851174f7 (diff) |
fdo#84938: convert CTRL_STATE_ #defines to 'enum class'
Change-Id: I1451180d258315a310a048b27510b4b58fa9145c
38 files changed, 464 insertions, 459 deletions
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index c406da931d08..f3163a2a2a52 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -593,7 +593,7 @@ void SplashScreen::Paint( const Rectangle&) Rectangle aNativeControlRegion, aNativeContentRegion; if( GetNativeControlRegion( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect, - CTRL_STATE_ENABLED, aValue, OUString(), + ControlState::ENABLED, aValue, OUString(), aNativeControlRegion, aNativeContentRegion ) ) { long nProgressHeight = aNativeControlRegion.GetHeight(); @@ -602,7 +602,7 @@ void SplashScreen::Paint( const Rectangle&) } if( (DrawNativeControl( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect, - CTRL_STATE_ENABLED, aValue, _sProgressText )) ) + ControlState::ENABLED, aValue, _sProgressText )) ) { return; } diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx index 081b0fd9aa37..ced84247eacd 100644 --- a/include/vcl/salnativewidgets.hxx +++ b/include/vcl/salnativewidgets.hxx @@ -23,6 +23,7 @@ #include <rtl/ustring.hxx> #include <vcl/dllapi.h> #include <tools/gen.hxx> +#include <o3tl/typed_flags_set.hxx> /* Control Types: * @@ -232,17 +233,21 @@ typedef sal_uInt32 ControlPart; * functions until an ENABLED or HIDDEN is passed * in the ControlState. */ - -typedef sal_uInt32 ControlState; - -#define CTRL_STATE_ENABLED 0x0001 -#define CTRL_STATE_FOCUSED 0x0002 -#define CTRL_STATE_PRESSED 0x0004 -#define CTRL_STATE_ROLLOVER 0x0008 -#define CTRL_STATE_HIDDEN 0x0010 -#define CTRL_STATE_DEFAULT 0x0020 -#define CTRL_STATE_SELECTED 0x0040 -#define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped) +enum class ControlState { + NONE = 0, + ENABLED = 0x0001, + FOCUSED = 0x0002, + PRESSED = 0x0004, + ROLLOVER = 0x0008, + HIDDEN = 0x0010, + DEFAULT = 0x0020, + SELECTED = 0x0040, + CACHING_ALLOWED = 0x8000, // set when the control is completely visible (i.e. not clipped) +}; +namespace o3tl +{ + template<> struct typed_flags<ControlState> : is_typed_flags<ControlState, 0x8007f> {}; +} /* ButtonValue: * @@ -322,8 +327,8 @@ class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue : ImplControlValue( CTRL_SCROLLBAR, BUTTONVALUE_DONTKNOW, 0 ) { mnMin = 0; mnMax = 0; mnCur = 0; mnVisibleSize = 0; - mnButton1State = 0; mnButton2State = 0; - mnThumbState = 0; mnPage1State = 0; mnPage2State = 0; + mnButton1State = ControlState::NONE; mnButton2State = ControlState::NONE; + mnThumbState = ControlState::NONE; mnPage1State = ControlState::NONE; mnPage2State = ControlState::NONE; }; virtual ~ScrollbarValue(); virtual ScrollbarValue* clone() const SAL_OVERRIDE; @@ -340,7 +345,7 @@ class VCL_DLLPUBLIC SliderValue : public ImplControlValue SliderValue() : ImplControlValue( CTRL_SLIDER, BUTTONVALUE_DONTKNOW, 0 ) - , mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( 0 ) + , mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( ControlState::NONE ) {} virtual ~SliderValue(); virtual SliderValue* clone() const SAL_OVERRIDE; @@ -397,8 +402,8 @@ class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue SpinbuttonValue() : ImplControlValue( CTRL_SPINBUTTONS, BUTTONVALUE_DONTKNOW, 0 ) - , mnUpperState(0) - , mnLowerState(0) + , mnUpperState(ControlState::NONE) + , mnLowerState(ControlState::NONE) , mnUpperPart(0) , mnLowerPart(0) { diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 3c932256cf33..811f80481533 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -243,7 +243,7 @@ void ScMenuFloatingWindow::Paint(const Rectangle& /*rRect*/) { SetClipRegion(); bNativeDrawn = DrawNativeControl( - CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, + CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, ImplControlValue(), OUString()); } else @@ -380,7 +380,7 @@ void ScMenuFloatingWindow::drawSeparator(size_t nPos) IntersectClipRegion(aRegion); Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel()); DrawNativeControl( - CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, + CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, ImplControlValue(), OUString()); Pop(); @@ -389,10 +389,10 @@ void ScMenuFloatingWindow::drawSeparator(size_t nPos) bool bNativeDrawn = false; if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SEPARATOR)) { - ControlState nState = 0; + ControlState nState = ControlState::NONE; const MenuItemData& rData = maMenuItems[nPos]; if (rData.mbEnabled) - nState |= CTRL_STATE_ENABLED; + nState |= ControlState::ENABLED; bNativeDrawn = DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_SEPARATOR, @@ -670,7 +670,7 @@ void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected) IntersectClipRegion(Rectangle(aPos, aSize)); Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel()); DrawNativeControl( - CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, + CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, ImplControlValue(), OUString()); Pop(); @@ -679,9 +679,9 @@ void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected) bool bNativeDrawn = true; if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM)) { - ControlState nState = bSelected ? CTRL_STATE_SELECTED : 0; + ControlState nState = bSelected ? ControlState::SELECTED : ControlState::NONE; if (maMenuItems[nPos].mbEnabled) - nState |= CTRL_STATE_ENABLED; + nState |= ControlState::ENABLED; bNativeDrawn = DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, aRegion, nState, ImplControlValue(), OUString()); } diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 0162b97c739a..f014b6fb1c29 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1055,7 +1055,7 @@ void SvImpLBox::DrawNet() ImplControlValue aControlValue; Point aTemp(0,0); // temporary needed for g++ 3.3.5 Rectangle aCtrlRegion( aTemp, Size( 0, 0 ) ); - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString() ) ) { diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 014a36a448ef..2e88f578d4de 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -362,11 +362,11 @@ void SvLBoxButton::Paint( ImplAdjustBoxSize( aSize, eCtrlType, &rDev ); ImplControlValue aControlValue; Rectangle aCtrlRegion( rPos, aSize ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; - //states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented - if ( IsStateHilighted() ) nState |= CTRL_STATE_FOCUSED; - if ( nStyle != IMAGE_DRAW_DISABLE ) nState |= CTRL_STATE_ENABLED; + //states ControlState::DEFAULT, ControlState::PRESSED and ControlState::ROLLOVER are not implemented + if ( IsStateHilighted() ) nState |= ControlState::FOCUSED; + if ( nStyle != IMAGE_DRAW_DISABLE ) nState |= ControlState::ENABLED; if ( IsStateChecked() ) aControlValue.setTristateVal( BUTTONVALUE_ON ); @@ -400,7 +400,7 @@ void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, vcl:: { ImplControlValue aControlValue; Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize ); - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; aControlValue.setTristateVal( BUTTONVALUE_ON ); diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 5591635bda0c..e9c00302fb32 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -3156,9 +3156,9 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT { ImplControlValue aControlValue; Rectangle aCtrlRegion( aPos, pImg->GetSizePixel() ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; - if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED; + if ( IsEnabled() ) nState |= ControlState::ENABLED; if ( IsExpanded(pEntry) ) aControlValue.setTristateVal( BUTTONVALUE_ON );//expanded node diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index 8f3c2626287b..e3d455413e55 100644 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -306,7 +306,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, vcl::Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(pDev) : NULL; ImplControlValue aControlValue(0); Rectangle aCtrlRegion; - ControlState nState(0); + ControlState nState(ControlState::NONE); Rectangle aRect = rItemRect; @@ -368,9 +368,9 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, { aCtrlRegion=aRect; aControlValue.setTristateVal(BUTTONVALUE_ON); - nState|=CTRL_STATE_ENABLED; + nState|=ControlState::ENABLED; if(bHigh) - nState|=CTRL_STATE_PRESSED; + nState|=ControlState::PRESSED; pWin->DrawNativeControl( CTRL_LISTHEADER, PART_BUTTON, aCtrlRegion, nState, aControlValue, OUString() ); @@ -593,9 +593,9 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, aCtrlRegion=Rectangle(Point(nArrowX,aRect.Top()),Size(nArrowWidth,aRect.GetHeight())); // control value passes 1 if arrow points down, 0 otherwise aControlValue.setNumericVal((nBits&HIB_DOWNARROW)?1:0); - nState|=CTRL_STATE_ENABLED; + nState|=ControlState::ENABLED; if(bHigh) - nState|=CTRL_STATE_PRESSED; + nState|=ControlState::PRESSED; pWin->DrawNativeControl( CTRL_LISTHEADER, PART_ARROW, aCtrlRegion, nState, aControlValue, OUString() ); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index d55a3cbbee66..27614954a535 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -1282,7 +1282,7 @@ void TabBar::Paint( const Rectangle& rect ) { if(IsNativeControlSupported(CTRL_WINDOW_BACKGROUND,PART_ENTIRE_CONTROL)) DrawNativeControl(CTRL_WINDOW_BACKGROUND,PART_ENTIRE_CONTROL,rect, - CTRL_STATE_ENABLED,ImplControlValue(0),OUString()); + ControlState::ENABLED,ImplControlValue(0),OUString()); // calculate items and emit sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size(); diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 85e73bbbc381..825221de53be 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -586,7 +586,7 @@ static long ImplGetNativeCheckAndRadioSize( vcl::Window* pWin, long& rCheckHeigh if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_CHECK_MARK), aCtrlRegion, - ControlState(CTRL_STATE_ENABLED), + ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, @@ -602,7 +602,7 @@ static long ImplGetNativeCheckAndRadioSize( vcl::Window* pWin, long& rCheckHeigh if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_RADIO_MARK), aCtrlRegion, - ControlState(CTRL_STATE_ENABLED), + ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, @@ -896,7 +896,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, - CTRL_STATE_ENABLED, + ControlState::ENABLED, ImplControlValue(), OUString() ); if( bHighlight && IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) ) @@ -904,7 +904,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) bDrawItemRect = false; if( !DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect, - CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ), + ControlState::SELECTED | ( pEntry->mbEnabled ? ControlState::ENABLED : ControlState::NONE ), ImplControlValue(), OUString() ) ) { @@ -1277,7 +1277,7 @@ static void ImplPaintCheckBackground( vcl::Window* i_pWindow, const Rectangle& i if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { ImplControlValue aControlValue; - ControlState nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED; + ControlState nState = ControlState::PRESSED | ControlState::ENABLED; aControlValue.setTristateVal( BUTTONVALUE_ON ); @@ -1396,16 +1396,16 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) ? PART_MENU_ITEM_RADIO_MARK : PART_MENU_ITEM_CHECK_MARK); - ControlState nState = 0; + ControlState nState = ControlState::NONE; if ( pEntry->mbChecked ) - nState |= CTRL_STATE_PRESSED; + nState |= ControlState::PRESSED; if ( pEntry->mbEnabled ) - nState |= CTRL_STATE_ENABLED; + nState |= ControlState::ENABLED; if ( bHighlighted ) - nState |= CTRL_STATE_SELECTED; + nState |= ControlState::SELECTED; long nCtrlHeight = (pEntry->mnBits & MenuItemBits::RADIOCHECK) ? nCheckHeight : nRadioHeight; aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight)/2; diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 302d58e4c22b..d8813475f84d 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -67,10 +67,10 @@ namespace svt { ControlState lcl_ItemToControlState( const ItemFlags i_nItemFlags ) { - ControlState nState = CTRL_STATE_ENABLED; - if ( i_nItemFlags & ITEM_STATE_FOCUSED ) nState |= CTRL_STATE_FOCUSED | CTRL_STATE_PRESSED; - if ( i_nItemFlags & ITEM_STATE_HOVERED ) nState |= CTRL_STATE_ROLLOVER; - if ( i_nItemFlags & ITEM_STATE_ACTIVE ) nState |= CTRL_STATE_SELECTED; + ControlState nState = ControlState::ENABLED; + if ( i_nItemFlags & ITEM_STATE_FOCUSED ) nState |= ControlState::FOCUSED | ControlState::PRESSED; + if ( i_nItemFlags & ITEM_STATE_HOVERED ) nState |= ControlState::ROLLOVER; + if ( i_nItemFlags & ITEM_STATE_ACTIVE ) nState |= ControlState::SELECTED; return nState; } } @@ -288,7 +288,7 @@ namespace svt aBackground.Top() = aBackground.Bottom(); getTargetDevice().DrawNativeControl( CTRL_TAB_PANE, PART_ENTIRE_CONTROL, aBackground, - CTRL_STATE_ENABLED, ImplControlValue(), OUString() ); + ControlState::ENABLED, ImplControlValue(), OUString() ); } diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index cb8175ec124f..41b749a3964f 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -449,30 +449,30 @@ bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart kThemeStatePressedUp = 2, kThemeStatePressedDown = 3 -#define CTRL_STATE_ENABLED 0x0001 -#define CTRL_STATE_FOCUSED 0x0002 -#define CTRL_STATE_PRESSED 0x0004 -#define CTRL_STATE_ROLLOVER 0x0008 -#define CTRL_STATE_HIDDEN 0x0010 -#define CTRL_STATE_DEFAULT 0x0020 -#define CTRL_STATE_SELECTED 0x0040 +#define ControlState::ENABLED 0x0001 +#define ControlState::FOCUSED 0x0002 +#define ControlState::PRESSED 0x0004 +#define ControlState::ROLLOVER 0x0008 +#define ControlState::HIDDEN 0x0010 +#define ControlState::DEFAULT 0x0020 +#define ControlState::SELECTED 0x0040 #define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped) */ UInt32 AquaSalGraphics::getState( ControlState nState ) { const bool bDrawActive = mpFrame ? ([mpFrame->getNSWindow() isKeyWindow] ? true : false) : true; - if( (nState & CTRL_STATE_ENABLED) == 0 || ! bDrawActive ) + if( !(nState & ControlState::ENABLED) || ! bDrawActive ) { - if( (nState & CTRL_STATE_HIDDEN) == 0 ) + if( ! (nState & ControlState::HIDDEN) ) return kThemeStateInactive; else return kThemeStateUnavailableInactive; } - if( (nState & CTRL_STATE_HIDDEN) != 0 ) + if( nState & ControlState::HIDDEN ) return kThemeStateUnavailable; - if( (nState & CTRL_STATE_PRESSED) != 0 ) + if( nState & ControlState::PRESSED ) return kThemeStatePressed; return kThemeStateActive; @@ -481,7 +481,7 @@ UInt32 AquaSalGraphics::getState( ControlState nState ) UInt32 AquaSalGraphics::getTrackState( ControlState nState ) { const bool bDrawActive = mpFrame ? ([mpFrame->getNSWindow() isKeyWindow] ? true : false) : true; - if( (nState & CTRL_STATE_ENABLED) == 0 || ! bDrawActive ) + if( ! (nState & ControlState::ENABLED) || ! bDrawActive ) return kThemeTrackInactive; return kThemeTrackActive; @@ -527,7 +527,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aComboInfo.value = kThemeButtonOn; aComboInfo.adornment = kThemeAdornmentNone; - if( (nState & CTRL_STATE_FOCUSED) != 0 ) + if( nState & ControlState::FOCUSED ) aComboInfo.adornment |= kThemeAdornmentFocus; HIThemeDrawButton(&rc, &aComboInfo, mrContext, kHIThemeOrientationNormal,&rc); @@ -605,7 +605,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, // the Aqua grey theme when the item is selected is drawn here. aMenuItemDrawInfo.itemType = kThemeMenuItemPlain; - if ((nPart == PART_MENU_ITEM ) && (nState & CTRL_STATE_SELECTED)) + if ((nPart == PART_MENU_ITEM ) && (nState & ControlState::SELECTED)) { // the blue theme when the item is selected is drawn here. aMenuItemDrawInfo.state = kThemeMenuSelected; @@ -625,10 +625,10 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, bOK = true; } else if(( nPart == PART_MENU_ITEM_CHECK_MARK )||( nPart == PART_MENU_ITEM_RADIO_MARK )) { - if( nState & CTRL_STATE_PRESSED ) {//checked, else it is not displayed (see vcl/source/window/menu.cxx) + if( nState & ControlState::PRESSED ) {//checked, else it is not displayed (see vcl/source/window/menu.cxx) HIThemeTextInfo aTextInfo; aTextInfo.version = 0; - aTextInfo.state = ((nState & CTRL_STATE_ENABLED)==0) ? kThemeStateInactive: kThemeStateActive; + aTextInfo.state = (nState & ControlState::ENABLED) ? kThemeStateInactive: kThemeStateActive; aTextInfo.fontID = kThemeMenuItemMarkFont; aTextInfo.horizontalFlushness=kHIThemeTextHorizontalFlushCenter; aTextInfo.verticalFlushness=kHIThemeTextVerticalFlushTop; @@ -636,7 +636,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aTextInfo.truncationPosition=kHIThemeTextTruncationNone; //aTextInfo.truncationMaxLines unused because of kHIThemeTextTruncationNone - if( nState & CTRL_STATE_SELECTED) aTextInfo.state = kThemeStatePressed; //item highlighted + if( nState & ControlState::SELECTED) aTextInfo.state = kThemeStatePressed; //item highlighted UniChar mark=( nPart == PART_MENU_ITEM_CHECK_MARK ) ? kCheckUnicode: kBulletUnicode;//0x2713; CFStringRef cfString = CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, &mark, 1, kCFAllocatorNull); @@ -683,7 +683,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, rc.origin.x += FOCUS_RING_WIDTH/2; rc.size.width -= FOCUS_RING_WIDTH; - if( (nState & CTRL_STATE_DEFAULT) != 0 ) + if( nState & ControlState::DEFAULT ) { AquaBlinker::Blink( mpFrame, buttonRect ); // show correct animation phase @@ -701,10 +701,10 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aPushInfo.state = getState( nState ); aPushInfo.value = ImplGetButtonValue( aValue.getTristateVal() ); - aPushInfo.adornment = (( nState & CTRL_STATE_DEFAULT ) != 0) ? - kThemeAdornmentDefault : - kThemeAdornmentNone; - if( (nState & CTRL_STATE_FOCUSED) != 0 ) + aPushInfo.adornment = ( nState & ControlState::DEFAULT ) ? + kThemeAdornmentDefault : + kThemeAdornmentNone; + if( nState & ControlState::FOCUSED ) aPushInfo.adornment |= kThemeAdornmentFocus; HIThemeDrawButton( &rc, &aPushInfo, mrContext, kHIThemeOrientationNormal, NULL ); @@ -732,10 +732,10 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, ButtonValue aButtonValue = aValue.getTristateVal(); aInfo.value = ImplGetButtonValue( aButtonValue ); - aInfo.adornment = (( nState & CTRL_STATE_DEFAULT ) != 0) ? - kThemeAdornmentDefault : - kThemeAdornmentNone; - if( (nState & CTRL_STATE_FOCUSED) != 0 ) + aInfo.adornment = ( nState & ControlState::DEFAULT ) ? + kThemeAdornmentDefault : + kThemeAdornmentNone; + if( nState & ControlState::FOCUSED ) aInfo.adornment |= kThemeAdornmentFocus; HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, NULL ); bOK = true; @@ -845,7 +845,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aTrackDraw.attributes = kThemeTrackShowThumb; if( nPart == PART_TRACK_HORZ_AREA ) aTrackDraw.attributes |= kThemeTrackHorizontal; - aTrackDraw.enableState = (nState & CTRL_STATE_ENABLED) + aTrackDraw.enableState = (nState & ControlState::ENABLED) ? kThemeTrackActive : kThemeTrackInactive; SliderTrackInfo aSlideInfo; @@ -888,21 +888,21 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aScrollInfo.viewsize = pScrollbarVal->mnVisibleSize; aScrollInfo.pressState = 0; - if ( pScrollbarVal->mnButton1State & CTRL_STATE_ENABLED ) + if ( pScrollbarVal->mnButton1State & ControlState::ENABLED ) { - if ( pScrollbarVal->mnButton1State & CTRL_STATE_PRESSED ) + if ( pScrollbarVal->mnButton1State & ControlState::PRESSED ) aScrollInfo.pressState = kThemeTopOutsideArrowPressed; } - if ( pScrollbarVal->mnButton2State & CTRL_STATE_ENABLED ) + if ( pScrollbarVal->mnButton2State & ControlState::ENABLED ) { - if ( pScrollbarVal->mnButton2State & CTRL_STATE_PRESSED ) + if ( pScrollbarVal->mnButton2State & ControlState::PRESSED ) aScrollInfo.pressState = kThemeBottomOutsideArrowPressed; } - if ( pScrollbarVal->mnThumbState & CTRL_STATE_ENABLED ) + if ( pScrollbarVal->mnThumbState & ControlState::ENABLED ) { - if ( pScrollbarVal->mnThumbState & CTRL_STATE_PRESSED ) + if ( pScrollbarVal->mnThumbState & ControlState::PRESSED ) aScrollInfo.pressState = kThemeThumbPressed; } @@ -945,10 +945,10 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aTabItemDrawInfo.size=kHIThemeTabSizeNormal; aTabItemDrawInfo.adornment=kHIThemeTabAdornmentTrailingSeparator; //State - if(nState & CTRL_STATE_SELECTED) { + if(nState & ControlState::SELECTED) { aTabItemDrawInfo.style=kThemeTabFront; } - if(nState & CTRL_STATE_FOCUSED) { + if(nState & ControlState::FOCUSED) { aTabItemDrawInfo.adornment|=kHIThemeTabAdornmentFocus; } @@ -1001,7 +1001,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aListInfo.value = kThemeButtonOn; aListInfo.adornment = kThemeAdornmentDefault; - if( (nState & CTRL_STATE_FOCUSED) != 0 ) + if( nState & ControlState::FOCUSED ) aListInfo.adornment |= kThemeAdornmentFocus; HIThemeDrawButton(&rc, &aListInfo, mrContext, kHIThemeOrientationNormal,&rc); @@ -1020,7 +1020,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, rc.size.height+=1; HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal); - if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); + if(nState & ControlState::FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); bOK=true; break; @@ -1049,7 +1049,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal); - if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); + if(nState & ControlState::FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); bOK=true; } @@ -1078,12 +1078,12 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal); - if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); + if(nState & ControlState::FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); //buttons: const SpinbuttonValue* pSpinButtonVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue*>(&aValue) : NULL; - ControlState nUpperState = CTRL_STATE_ENABLED;//state of the upper button - ControlState nLowerState = CTRL_STATE_ENABLED;//and of the lower button + ControlState nUpperState = ControlState::ENABLED;//state of the upper button + ControlState nLowerState = ControlState::ENABLED;//and of the lower button if(pSpinButtonVal) {//pSpinButtonVal is sometimes null nUpperState = (ControlState) pSpinButtonVal->mnUpperState; nLowerState = (ControlState) pSpinButtonVal->mnLowerState; @@ -1091,13 +1091,13 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, HIThemeButtonDrawInfo aSpinInfo; aSpinInfo.kind = kThemeIncDecButton; aSpinInfo.state = kThemeStateActive; - if(nUpperState & CTRL_STATE_PRESSED) + if(nUpperState & ControlState::PRESSED) aSpinInfo.state = kThemeStatePressedUp; - else if(nLowerState & CTRL_STATE_PRESSED) + else if(nLowerState & ControlState::PRESSED) aSpinInfo.state = kThemeStatePressedDown; - else if((nUpperState & ~CTRL_STATE_ENABLED)||(nLowerState & ~CTRL_STATE_ENABLED)) + else if((nUpperState & ~ControlState::ENABLED)||(nLowerState & ~ControlState::ENABLED)) aSpinInfo.state = kThemeStateInactive; - else if((nUpperState & CTRL_STATE_ROLLOVER)||(nLowerState & CTRL_STATE_ROLLOVER)) + else if((nUpperState & ControlState::ROLLOVER)||(nLowerState & ControlState::ROLLOVER)) aSpinInfo.state = kThemeStateRollover; Rectangle aSpinRect( pSpinButtonVal->maUpperRect ); @@ -1122,11 +1122,11 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, break; } - aSpinInfo.adornment = ( ((nUpperState & CTRL_STATE_DEFAULT) != 0 ) || - ((nLowerState & CTRL_STATE_DEFAULT) != 0 )) ? + aSpinInfo.adornment = ( (nUpperState & ControlState::DEFAULT) || + (nLowerState & ControlState::DEFAULT) ) ? kThemeAdornmentDefault : kThemeAdornmentNone; - if( ((nUpperState & CTRL_STATE_FOCUSED) != 0 ) || ((nLowerState & CTRL_STATE_FOCUSED) != 0 )) + if( (nUpperState & ControlState::FOCUSED) || (nLowerState & ControlState::FOCUSED)) aSpinInfo.adornment |= kThemeAdornmentFocus; HIThemeDrawButton( &buttonRc, &aSpinInfo, mrContext, kHIThemeOrientationNormal, NULL ); diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 1e44c4522b99..8a3a1f800c5a 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -356,7 +356,7 @@ void HelpTextWindow::Paint( const Rectangle& ) Rectangle aCtrlRegion( Point( 0, 0 ), GetOutputSizePixel() ); ImplControlValue aControlValue; bNativeOK = DrawNativeControl( CTRL_TOOLTIP, PART_ENTIRE_CONTROL, aCtrlRegion, - 0, aControlValue, OUString() ); + ControlState::NONE, aControlValue, OUString() ); } // paint text diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index f8f3da8cb48f..78936b84b4af 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1009,16 +1009,16 @@ void PushButton::ImplDrawPushButton( bool bLayout ) // for CTRL_LISTBOX/PART_BUTTON_DOWN and CTRL_COMBOBOX/PART_BUTTON_DOWN ImplControlValue aControlValue; - ControlState nState = 0; + ControlState nState = ControlState::NONE; - if ( mbPressed ) nState |= CTRL_STATE_PRESSED; - if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED; - if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED; - if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT; - if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED; + if ( mbPressed ) nState |= ControlState::PRESSED; + if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= ControlState::PRESSED; + if ( HasFocus() ) nState |= ControlState::FOCUSED; + if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= ControlState::DEFAULT; + if ( Window::IsEnabled() ) nState |= ControlState::ENABLED; if ( IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ) ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; bNativeOK = DrawNativeControl( aCtrlType, PART_BUTTON_DOWN, aInRect, nState, aControlValue, OUString() ); @@ -1040,16 +1040,16 @@ void PushButton::ImplDrawPushButton( bool bLayout ) { PushButtonValue aControlValue; Rectangle aCtrlRegion( aInRect ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; - if ( mbPressed || IsChecked() ) nState |= CTRL_STATE_PRESSED; - if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED; - if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED; - if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT; - if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED; + if ( mbPressed || IsChecked() ) nState |= ControlState::PRESSED; + if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= ControlState::PRESSED; + if ( HasFocus() ) nState |= ControlState::FOCUSED; + if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= ControlState::DEFAULT; + if ( Window::IsEnabled() ) nState |= ControlState::ENABLED; if ( bRollOver ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; if( GetStyle() & WB_BEVELBUTTON ) aControlValue.mbBevelButton = true; @@ -1073,7 +1073,7 @@ void PushButton::ImplDrawPushButton( bool bLayout ) Size aInRectSize( LogicToPixel( Size( aInRect.GetWidth(), aInRect.GetHeight() ) ) ); aControlValue.mbSingleLine = (aInRectSize.Height() < 2 * aFontSize.Height() ); - if( ((nState & CTRL_STATE_ROLLOVER)) || ! (GetStyle() & WB_FLATBUTTON) ) + if( ((nState & ControlState::ROLLOVER)) || ! (GetStyle() & WB_FLATBUTTON) ) { bNativeOK = DrawNativeControl( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString()/*PushButton::GetText()*/ ); @@ -1085,7 +1085,7 @@ void PushButton::ImplDrawPushButton( bool bLayout ) // draw content using the same aInRect as non-native VCL would do ImplDrawPushButtonContent( this, - (nState&CTRL_STATE_ROLLOVER) ? WINDOW_DRAW_ROLLOVER : 0, + (nState&ControlState::ROLLOVER) ? WINDOW_DRAW_ROLLOVER : 0, aInRect, bLayout, bDrawMenuSep ); if ( HasFocus() ) @@ -1135,7 +1135,7 @@ void PushButton::ImplSetDefButton( bool bSet ) // will not work if the theme has dynamic adornment sizes ImplControlValue aControlValue; Rectangle aCtrlRegion( aCtrlRect ); - ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED; + ControlState nState = ControlState::DEFAULT|ControlState::ENABLED; // get native size of a 'default' button // and adjust the VCL button if more space for adornment is required @@ -1910,15 +1910,15 @@ void RadioButton::ImplDrawRadioButtonState() { ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF ); Rectangle aCtrlRect( maStateRect.TopLeft(), maStateRect.GetSize() ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; - if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED; - if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED; - if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT; - if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED; + if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= ControlState::PRESSED; + if ( HasFocus() ) nState |= ControlState::FOCUSED; + if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= ControlState::DEFAULT; + if ( IsEnabled() ) nState |= ControlState::ENABLED; if ( IsMouseOver() && maMouseRect.IsInside( GetPointerPosPixel() ) ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; bNativeOK = DrawNativeControl( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRect, nState, aControlValue,OUString() ); @@ -2746,7 +2746,7 @@ Size RadioButton::ImplGetRadioImageSize() const ImplControlValue aControlValue; // #i45896# workaround gcc3.3 temporary problem Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() ); - ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED; + ControlState nState = ControlState::DEFAULT|ControlState::ENABLED; Rectangle aBoundingRgn, aContentRgn; // get native size of a radio button @@ -2858,7 +2858,7 @@ void RadioButton::ImplSetMinimumNWFSize() // get native size of a radiobutton if( GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, - CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED, aControlValue, OUString(), + ControlState::DEFAULT|ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { Size aSize = aContentRgn.GetSize(); @@ -3027,12 +3027,12 @@ void CheckBox::ImplDrawCheckBoxState() { ImplControlValue aControlValue( meState == TRISTATE_TRUE ? BUTTONVALUE_ON : BUTTONVALUE_OFF ); Rectangle aCtrlRegion( maStateRect ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; - if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED; - if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT; - if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED; - if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED; + if ( HasFocus() ) nState |= ControlState::FOCUSED; + if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= ControlState::DEFAULT; + if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= ControlState::PRESSED; + if ( IsEnabled() ) nState |= ControlState::ENABLED; if ( meState == TRISTATE_TRUE ) aControlValue.setTristateVal( BUTTONVALUE_ON ); @@ -3040,7 +3040,7 @@ void CheckBox::ImplDrawCheckBoxState() aControlValue.setTristateVal( BUTTONVALUE_MIXED ); if ( IsMouseOver() && maMouseRect.IsInside( GetPointerPosPixel() ) ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; bNativeOK = DrawNativeControl( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString() ); @@ -3621,7 +3621,7 @@ Size CheckBox::ImplGetCheckImageSize() const ImplControlValue aControlValue; // #i45896# workaround gcc3.3 temporary problem Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() ); - ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED; + ControlState nState = ControlState::DEFAULT|ControlState::ENABLED; Rectangle aBoundingRgn, aContentRgn; // get native size of a check box @@ -3712,7 +3712,7 @@ void CheckBox::ImplSetMinimumNWFSize() // get native size of a radiobutton if( GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion, - CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED, aControlValue, OUString(), + ControlState::DEFAULT|ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { Size aSize = aContentRgn.GetSize(); @@ -3845,13 +3845,13 @@ void DisclosureButton::ImplDrawCheckBoxState() ImplControlValue aControlValue( GetState() == TRISTATE_TRUE ? BUTTONVALUE_ON : BUTTONVALUE_OFF ); Rectangle aCtrlRegion( aStateRect ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; - if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED; - if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT; - if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED; + if ( HasFocus() ) nState |= ControlState::FOCUSED; + if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= ControlState::DEFAULT; + if ( Window::IsEnabled() ) nState |= ControlState::ENABLED; if ( IsMouseOver() && GetMouseRect().IsInside( GetPointerPosPixel() ) ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; if( ! DrawNativeControl( CTRL_LISTNODE, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString() ) ) diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 5edee223e753..fe7ba1c7636a 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -108,7 +108,7 @@ void ComboBox::ImplCalcEditHeight() ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX; if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL, aCtrlRegion, - CTRL_STATE_ENABLED, + ControlState::ENABLED, aControlValue, OUString(), aBoundRegion, aContentRegion ) ) { @@ -989,7 +989,7 @@ long ComboBox::getMaxWidthScrollBarAndDownButton() const Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_BUTTON_DOWN, - aArea, 0, aControlValue, OUString(), aBound, aContent) ) + aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { nButtonDownWidth = aContent.getWidth(); } @@ -1422,7 +1422,7 @@ ComboBox::ComboBoxBounds ComboBox::calcComboBoxDropDownComponentBounds(const Siz Rectangle aArea( aPoint, rBorderOutSz ); if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_BUTTON_DOWN, - aArea, 0, aControlValue, OUString(), aBound, aContent) ) + aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // convert back from border space to local coordinates aPoint = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aPoint ) ); @@ -1433,7 +1433,7 @@ ComboBox::ComboBoxBounds ComboBox::calcComboBoxDropDownComponentBounds(const Siz // adjust the size of the edit field if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_SUB_EDIT, - aArea, 0, aControlValue, OUString(), aBound, aContent) ) + aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // convert back from border space to local coordinates aContent.Move(-aPoint.X(), -aPoint.Y()); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 821d535ad397..a0212e7eb07c 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2754,7 +2754,7 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const Rectangle aContent, aBound; if( GetNativeControlRegion( eCtrlType, PART_ENTIRE_CONTROL, - aRect, 0, aControlValue, OUString(), aBound, aContent) ) + aRect, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { if( aBound.GetHeight() > aSize.Height() ) aSize.Height() = aBound.GetHeight(); diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index d4a427643387..fbdd66245867 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -2647,7 +2647,7 @@ void ImplWin::ImplDraw( bool bLayout ) if( ! bLayout ) { - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) && IsNativeControlSupported(CTRL_LISTBOX, HAS_BACKGROUND_TEXTURE) ) { @@ -2658,9 +2658,9 @@ void ImplWin::ImplDraw( bool bLayout ) ImplControlValue aControlValue; if ( !pWin->IsEnabled() ) - nState &= ~CTRL_STATE_ENABLED; + nState &= ~ControlState::ENABLED; if ( pWin->HasFocus() ) - nState |= CTRL_STATE_FOCUSED; + nState |= ControlState::FOCUSED; // The listbox is painted over the entire control including the // border, but ImplWin does not contain the border => correction @@ -2679,7 +2679,7 @@ void ImplWin::ImplDraw( bool bLayout ) } if( bMouseOver ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; // if parent has no border, then nobody has drawn the background // since no border window exists. so draw it here. @@ -2708,14 +2708,14 @@ void ImplWin::ImplDraw( bool bLayout ) Color aColor; if( ImplGetSVData()->maNWFData.mbDDListBoxNoTextArea ) { - if( bNativeOK && (nState & CTRL_STATE_ROLLOVER) ) + if( bNativeOK && (nState & ControlState::ROLLOVER) ) aColor = rStyleSettings.GetButtonRolloverTextColor(); else aColor = rStyleSettings.GetButtonTextColor(); } else { - if( bNativeOK && (nState & CTRL_STATE_ROLLOVER) ) + if( bNativeOK && (nState & ControlState::ROLLOVER) ) aColor = rStyleSettings.GetFieldRolloverTextColor(); else aColor = rStyleSettings.GetFieldTextColor(); diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 867cea50e705..96d0951438f8 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -121,7 +121,7 @@ void ListBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) Rectangle aBoundingRgn( aCtrlRegion ); Rectangle aContentRgn( aCtrlRegion ); if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aCtrlRegion, - CTRL_STATE_ENABLED, aControlValue, OUString(), + ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { sal_Int32 nHeight = aBoundingRgn.GetHeight(); @@ -634,7 +634,7 @@ void ListBox::Resize() Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); if ( GetNativeControlRegion( CTRL_LISTBOX, PART_BUTTON_DOWN, - aArea, 0, aControlValue, OUString(), aBound, aContent) ) + aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { long nTop = 0; // Convert back from border space to local coordinates @@ -647,7 +647,7 @@ void ListBox::Resize() // Adjust the size of the edit field if ( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT, - aArea, 0, aControlValue, OUString(), aBound, aContent) ) + aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // Convert back from border space to local coordinates aContent.Move( -aPoint.X(), -aPoint.Y() ); @@ -1217,7 +1217,7 @@ Size ListBox::CalcMinimumSize() const Rectangle aContent, aBound; Size aTestSize( 100, 20 ); Rectangle aArea( aPoint, aTestSize ); - if( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT, aArea, 0, + if( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // use the themes drop down size @@ -1234,7 +1234,7 @@ Size ListBox::CalcMinimumSize() const ImplControlValue aControlValue; Rectangle aRect( Point( 0, 0 ), aSz ); Rectangle aContent, aBound; - if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aRect, 0, + if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aRect, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { if( aBound.GetHeight() > aSz.Height() ) diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index e5a601fc794a..6026e09557d5 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -274,9 +274,9 @@ void ScrollBar::ImplCalc( bool bUpdate ) if ( GetStyle() & WB_HORZ ) { if ( GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT, - aControlRegion, 0, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) && + aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) && GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT, - aControlRegion, 0, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) ) + aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) ) { maBtn1Rect = aBtn1Region; maBtn2Rect = aBtn2Region; @@ -291,7 +291,7 @@ void ScrollBar::ImplCalc( bool bUpdate ) } if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_HORZ_AREA, - aControlRegion, 0, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) + aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) maTrackRect = aTrackRegion; else maTrackRect = Rectangle( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() ); @@ -315,9 +315,9 @@ void ScrollBar::ImplCalc( bool bUpdate ) else { if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_UP, - aControlRegion, 0, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) && + aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) && GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_DOWN, - aControlRegion, 0, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) ) + aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) ) { maBtn1Rect = aBtn1Region; maBtn2Rect = aBtn2Region; @@ -332,7 +332,7 @@ void ScrollBar::ImplCalc( bool bUpdate ) } if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_VERT_AREA, - aControlRegion, 0, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) + aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) maTrackRect = aTrackRegion; else maTrackRect = Rectangle( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() ); @@ -461,7 +461,7 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) // Draw the entire background if the control supports it if( IsNativeControlSupported(CTRL_SCROLLBAR, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT) ) { - ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 ); + ControlState nState = ( IsEnabled() ? ControlState::ENABLED : ControlState::NONE ) | ( HasFocus() ? ControlState::FOCUSED : ControlState::NONE ); scrValue.mnMin = mnMinRange; scrValue.mnMax = mnMaxRange; @@ -470,13 +470,13 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) scrValue.maThumbRect = maThumbRect; scrValue.maButton1Rect = maBtn1Rect; scrValue.maButton2Rect = maBtn2Rect; - scrValue.mnButton1State = ((mnStateFlags & SCRBAR_STATE_BTN1_DOWN) ? CTRL_STATE_PRESSED : 0) | - ((!(mnStateFlags & SCRBAR_STATE_BTN1_DISABLE)) ? CTRL_STATE_ENABLED : 0); - scrValue.mnButton2State = ((mnStateFlags & SCRBAR_STATE_BTN2_DOWN) ? CTRL_STATE_PRESSED : 0) | - ((!(mnStateFlags & SCRBAR_STATE_BTN2_DISABLE)) ? CTRL_STATE_ENABLED : 0); - scrValue.mnThumbState = nState | ((mnStateFlags & SCRBAR_STATE_THUMB_DOWN) ? CTRL_STATE_PRESSED : 0); - scrValue.mnPage1State = nState | ((mnStateFlags & SCRBAR_STATE_PAGE1_DOWN) ? CTRL_STATE_PRESSED : 0); - scrValue.mnPage2State = nState | ((mnStateFlags & SCRBAR_STATE_PAGE2_DOWN) ? CTRL_STATE_PRESSED : 0); + scrValue.mnButton1State = ((mnStateFlags & SCRBAR_STATE_BTN1_DOWN) ? ControlState::PRESSED : ControlState::NONE) | + ((!(mnStateFlags & SCRBAR_STATE_BTN1_DISABLE)) ? ControlState::ENABLED : ControlState::NONE); + scrValue.mnButton2State = ((mnStateFlags & SCRBAR_STATE_BTN2_DOWN) ? ControlState::PRESSED : ControlState::NONE) | + ((!(mnStateFlags & SCRBAR_STATE_BTN2_DISABLE)) ? ControlState::ENABLED : ControlState::NONE); + scrValue.mnThumbState = nState | ((mnStateFlags & SCRBAR_STATE_THUMB_DOWN) ? ControlState::PRESSED : ControlState::NONE); + scrValue.mnPage1State = nState | ((mnStateFlags & SCRBAR_STATE_PAGE1_DOWN) ? ControlState::PRESSED : ControlState::NONE); + scrValue.mnPage2State = nState | ((mnStateFlags & SCRBAR_STATE_PAGE2_DOWN) ? ControlState::PRESSED : ControlState::NONE); if( IsMouseOver() ) { @@ -484,15 +484,15 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) if( pRect ) { if( pRect == &maThumbRect ) - scrValue.mnThumbState |= CTRL_STATE_ROLLOVER; + scrValue.mnThumbState |= ControlState::ROLLOVER; else if( pRect == &maBtn1Rect ) - scrValue.mnButton1State |= CTRL_STATE_ROLLOVER; + scrValue.mnButton1State |= ControlState::ROLLOVER; else if( pRect == &maBtn2Rect ) - scrValue.mnButton2State |= CTRL_STATE_ROLLOVER; + scrValue.mnButton2State |= ControlState::ROLLOVER; else if( pRect == &maPage1Rect ) - scrValue.mnPage1State |= CTRL_STATE_ROLLOVER; + scrValue.mnPage1State |= ControlState::ROLLOVER; else if( pRect == &maPage2Rect ) - scrValue.mnPage2State |= CTRL_STATE_ROLLOVER; + scrValue.mnPage2State |= ControlState::ROLLOVER; } } @@ -527,11 +527,11 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) sal_uInt32 part2 = bHorz ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER; Rectangle aCtrlRegion1( maPage1Rect ); Rectangle aCtrlRegion2( maPage2Rect ); - ControlState nState1 = (IsEnabled() ? CTRL_STATE_ENABLED : 0) | (HasFocus() ? CTRL_STATE_FOCUSED : 0); + ControlState nState1 = (IsEnabled() ? ControlState::ENABLED : ControlState::NONE) | (HasFocus() ? ControlState::FOCUSED : ControlState::NONE); ControlState nState2 = nState1; - nState1 |= ((mnStateFlags & SCRBAR_STATE_PAGE1_DOWN) ? CTRL_STATE_PRESSED : 0); - nState2 |= ((mnStateFlags & SCRBAR_STATE_PAGE2_DOWN) ? CTRL_STATE_PRESSED : 0); + nState1 |= ((mnStateFlags & SCRBAR_STATE_PAGE1_DOWN) ? ControlState::PRESSED : ControlState::NONE); + nState2 |= ((mnStateFlags & SCRBAR_STATE_PAGE2_DOWN) ? ControlState::PRESSED : ControlState::NONE); if( IsMouseOver() ) { @@ -539,9 +539,9 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) if( pRect ) { if( pRect == &maPage1Rect ) - nState1 |= CTRL_STATE_ROLLOVER; + nState1 |= ControlState::ROLLOVER; else if( pRect == &maPage2Rect ) - nState2 |= CTRL_STATE_ROLLOVER; + nState2 |= ControlState::ROLLOVER; } } @@ -559,21 +559,21 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) sal_uInt32 part2 = bHorz ? PART_BUTTON_RIGHT : PART_BUTTON_DOWN; Rectangle aCtrlRegion1( maBtn1Rect ); Rectangle aCtrlRegion2( maBtn2Rect ); - ControlState nState1 = HasFocus() ? CTRL_STATE_FOCUSED : 0; + ControlState nState1 = HasFocus() ? ControlState::FOCUSED : ControlState::NONE; ControlState nState2 = nState1; if ( !Window::IsEnabled() || !IsEnabled() ) - nState1 = (nState2 &= ~CTRL_STATE_ENABLED); + nState1 = (nState2 &= ~ControlState::ENABLED); else - nState1 = (nState2 |= CTRL_STATE_ENABLED); + nState1 = (nState2 |= ControlState::ENABLED); - nState1 |= ((mnStateFlags & SCRBAR_STATE_BTN1_DOWN) ? CTRL_STATE_PRESSED : 0); - nState2 |= ((mnStateFlags & SCRBAR_STATE_BTN2_DOWN) ? CTRL_STATE_PRESSED : 0); + nState1 |= ((mnStateFlags & SCRBAR_STATE_BTN1_DOWN) ? ControlState::PRESSED : ControlState::NONE); + nState2 |= ((mnStateFlags & SCRBAR_STATE_BTN2_DOWN) ? ControlState::PRESSED : ControlState::NONE); if(mnStateFlags & SCRBAR_STATE_BTN1_DISABLE) - nState1 &= ~CTRL_STATE_ENABLED; + nState1 &= ~ControlState::ENABLED; if(mnStateFlags & SCRBAR_STATE_BTN2_DISABLE) - nState2 &= ~CTRL_STATE_ENABLED; + nState2 &= ~ControlState::ENABLED; if( IsMouseOver() ) { @@ -581,9 +581,9 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) if( pRect ) { if( pRect == &maBtn1Rect ) - nState1 |= CTRL_STATE_ROLLOVER; + nState1 |= ControlState::ROLLOVER; else if( pRect == &maBtn2Rect ) - nState2 |= CTRL_STATE_ROLLOVER; + nState2 |= ControlState::ROLLOVER; } } @@ -597,14 +597,14 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) } if ( (nDrawFlags & SCRBAR_DRAW_THUMB) && !maThumbRect.IsEmpty() ) { - ControlState nState = IsEnabled() ? CTRL_STATE_ENABLED : 0; + ControlState nState = IsEnabled() ? ControlState::ENABLED : ControlState::NONE; Rectangle aCtrlRegion( maThumbRect ); if ( mnStateFlags & SCRBAR_STATE_THUMB_DOWN ) - nState |= CTRL_STATE_PRESSED; + nState |= ControlState::PRESSED; if ( HasFocus() ) - nState |= CTRL_STATE_FOCUSED; + nState |= ControlState::FOCUSED; if( IsMouseOver() ) { @@ -612,7 +612,7 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) if( pRect ) { if( pRect == &maThumbRect ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; } } diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 106ca0d7f31f..e0832b509531 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -135,7 +135,7 @@ void Slider::ImplUpdateRects( bool bUpdate ) const Rectangle aControlRegion( Rectangle( Point(0,0), Size( SLIDER_THUMB_SIZE, 10 ) ) ); Rectangle aThumbBounds, aThumbContent; if ( GetNativeControlRegion( CTRL_SLIDER, PART_THUMB_HORZ, - aControlRegion, 0, ImplControlValue(), OUString(), + aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aThumbBounds, aThumbContent ) ) { maThumbRect.Left() = mnThumbPixPos - aThumbBounds.GetWidth()/2; @@ -169,7 +169,7 @@ void Slider::ImplUpdateRects( bool bUpdate ) const Rectangle aControlRegion( Rectangle( Point(0,0), Size( 10, SLIDER_THUMB_SIZE ) ) ); Rectangle aThumbBounds, aThumbContent; if ( GetNativeControlRegion( CTRL_SLIDER, PART_THUMB_VERT, - aControlRegion, 0, ImplControlValue(), OUString(), + aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aThumbBounds, aThumbContent ) ) { maThumbRect.Top() = mnThumbPixPos - aThumbBounds.GetHeight()/2; @@ -314,7 +314,7 @@ void Slider::ImplDraw( sal_uInt16 nDrawFlags ) ImplCalc( false ); ControlPart nPart = (GetStyle() & WB_HORZ) ? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA; - ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 ); + ControlState nState = ( IsEnabled() ? ControlState::ENABLED : ControlState::NONE ) | ( HasFocus() ? ControlState::FOCUSED : ControlState::NONE ); SliderValue sldValue; sldValue.mnMin = mnMinRange; @@ -325,7 +325,7 @@ void Slider::ImplDraw( sal_uInt16 nDrawFlags ) if( IsMouseOver() ) { if( maThumbRect.IsInside( GetPointerPosPixel() ) ) - sldValue.mnThumbState |= CTRL_STATE_ROLLOVER; + sldValue.mnThumbState |= ControlState::ROLLOVER; } const Rectangle aCtrlRegion( Point(0,0), GetOutputSizePixel() ); diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index 0ab79c9f70a7..6c2a059dda13 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -43,28 +43,28 @@ void ImplGetSpinbuttonValue( vcl::Window *pWin, const Rectangle& rUpperRect, Point aPointerPos = pWin->GetPointerPosPixel(); - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; if ( bUpperIn ) - nState |= CTRL_STATE_PRESSED; + nState |= ControlState::PRESSED; if ( !pWin->IsEnabled() || !bUpperEnabled ) - nState &= ~CTRL_STATE_ENABLED; + nState &= ~ControlState::ENABLED; if ( pWin->HasFocus() ) - nState |= CTRL_STATE_FOCUSED; + nState |= ControlState::FOCUSED; if( pWin->IsMouseOver() && rUpperRect.IsInside( aPointerPos ) ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; rValue.mnUpperState = nState; - nState = CTRL_STATE_ENABLED; + nState = ControlState::ENABLED; if ( bLowerIn ) - nState |= CTRL_STATE_PRESSED; + nState |= ControlState::PRESSED; if ( !pWin->IsEnabled() || !bLowerEnabled ) - nState &= ~CTRL_STATE_ENABLED; + nState &= ~ControlState::ENABLED; if ( pWin->HasFocus() ) - nState |= CTRL_STATE_FOCUSED; + nState |= ControlState::FOCUSED; // for overlapping spins: highlight only one if( pWin->IsMouseOver() && rLowerRect.IsInside( aPointerPos ) && !rUpperRect.IsInside( aPointerPos ) ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; rValue.mnLowerState = nState; rValue.mnUpperPart = bHorz ? PART_BUTTON_LEFT : PART_BUTTON_UP; @@ -83,7 +83,7 @@ bool ImplDrawNativeSpinfield( vcl::Window *pWin, const SpinbuttonValue& rSpinbut pWin->IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnLowerPart) ) { // only paint the embedded spin buttons, all buttons are painted at once - bNativeOK = pWin->DrawNativeControl( CTRL_SPINBOX, PART_ALL_BUTTONS, Rectangle(), CTRL_STATE_ENABLED, + bNativeOK = pWin->DrawNativeControl( CTRL_SPINBOX, PART_ALL_BUTTONS, Rectangle(), ControlState::ENABLED, rSpinbuttonValue, OUString() ); } else @@ -107,13 +107,13 @@ bool ImplDrawNativeSpinfield( vcl::Window *pWin, const SpinbuttonValue& rSpinbut Rectangle aNatRgn( aPt, aSize ); if( ! ImplGetSVData()->maNWFData.mbCanDrawWidgetAnySize && pBorder->GetNativeControlRegion( CTRL_SPINBOX, PART_ENTIRE_CONTROL, - aNatRgn, 0, rSpinbuttonValue, OUString(), aBound, aContent) ) + aNatRgn, ControlState::NONE, rSpinbuttonValue, OUString(), aBound, aContent) ) { aSize = aContent.GetSize(); } Rectangle aRgn( aPt, aSize ); - bNativeOK = pBorder->DrawNativeControl( CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, CTRL_STATE_ENABLED, + bNativeOK = pBorder->DrawNativeControl( CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, ControlState::ENABLED, rSpinbuttonValue, OUString() ); pBorder->SetClipRegion(vcl::Region(oldRgn)); @@ -129,7 +129,7 @@ bool ImplDrawNativeSpinbuttons( vcl::Window *pWin, const SpinbuttonValue& rSpinb if( pWin->IsNativeControlSupported(CTRL_SPINBUTTONS, PART_ENTIRE_CONTROL) ) { // only paint the standalone spin buttons, all buttons are painted at once - bNativeOK = pWin->DrawNativeControl( CTRL_SPINBUTTONS, PART_ALL_BUTTONS, Rectangle(), CTRL_STATE_ENABLED, + bNativeOK = pWin->DrawNativeControl( CTRL_SPINBUTTONS, PART_ALL_BUTTONS, Rectangle(), ControlState::ENABLED, rSpinbuttonValue, OUString() ); } return bNativeOK; @@ -676,9 +676,9 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec bNativeRegionOK = pWin->GetNativeControlRegion(CTRL_SPINBOX, PART_BUTTON_UP, - aArea, 0, aControlValue, OUString(), aBound, aContentUp) && + aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContentUp) && pWin->GetNativeControlRegion(CTRL_SPINBOX, PART_BUTTON_DOWN, - aArea, 0, aControlValue, OUString(), aBound, aContentDown); + aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContentDown); if( bNativeRegionOK ) { @@ -731,7 +731,7 @@ void SpinField::Resize() // adjust position and size of the edit field if ( GetNativeControlRegion(CTRL_SPINBOX, PART_SUB_EDIT, - aArea, 0, aControlValue, OUString(), aBound, aContent) ) + aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // convert back from border space to local coordinates aPoint = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aPoint ) ); @@ -925,9 +925,9 @@ Size SpinField::CalcMinimumSizeForText(const OUString &rString) const Rectangle aEntireBound, aEntireContent, aEditBound, aEditContent; if ( GetNativeControlRegion(CTRL_SPINBOX, PART_ENTIRE_CONTROL, - aArea, 0, aControlValue, OUString(), aEntireBound, aEntireContent) && + aArea, ControlState::NONE, aControlValue, OUString(), aEntireBound, aEntireContent) && GetNativeControlRegion(CTRL_SPINBOX, PART_SUB_EDIT, - aArea, 0, aControlValue, OUString(), aEditBound, aEditContent) + aArea, ControlState::NONE, aControlValue, OUString(), aEditBound, aEditContent) ) { aSz.Width() += (aEntireContent.GetWidth() - aEditContent.GetWidth()); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 5bebdbee5a8f..9825bab610be 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -241,7 +241,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) Rectangle aBoundingRgn, aContentRgn; const ImplControlValue aControlValue; if(GetNativeControlRegion( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, aCtrlRegion, - CTRL_STATE_ENABLED, aControlValue, OUString(), + ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { return aContentRgn.GetSize(); @@ -824,26 +824,26 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo if( !bLayout && (bNativeOK = IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) ) { Rectangle aCtrlRegion( pItem->maRect ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; if( pItem->mnId == mnCurPageId ) { - nState |= CTRL_STATE_SELECTED; + nState |= ControlState::SELECTED; // only the selected item can be focussed if ( HasFocus() ) - nState |= CTRL_STATE_FOCUSED; + nState |= ControlState::FOCUSED; } if ( IsEnabled() ) - nState |= CTRL_STATE_ENABLED; + nState |= ControlState::ENABLED; if( IsMouseOver() && pItem->maRect.IsInside( GetPointerPosPixel() ) ) { - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin(); it != mpTabCtrlData->maItemList.end(); ++it ) { if( (&(*it) != pItem) && (it->maRect.IsInside( GetPointerPosPixel() ) ) ) { - nState &= ~CTRL_STATE_ROLLOVER; // avoid multiple highlighted tabs + nState &= ~ControlState::ROLLOVER; // avoid multiple highlighted tabs break; } } @@ -1096,12 +1096,12 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout ) { const ImplControlValue aControlValue; - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; int part = PART_ENTIRE_CONTROL; if ( !IsEnabled() ) - nState &= ~CTRL_STATE_ENABLED; + nState &= ~ControlState::ENABLED; if ( HasFocus() ) - nState |= CTRL_STATE_FOCUSED; + nState |= ControlState::FOCUSED; vcl::Region aClipRgn( GetActiveClipRegion() ); aClipRgn.Intersect( aRect ); diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx index 157769967a56..38ec9ccbe573 100644 --- a/vcl/source/outdev/nativecontrols.cxx +++ b/vcl/source/outdev/nativecontrols.cxx @@ -297,7 +297,7 @@ bool OutputDevice::DrawNativeControl( ControlType nType, vcl::Region aTestRegion( GetActiveClipRegion() ); aTestRegion.Intersect( rControlRegion ); if (aTestRegion == vcl::Region(rControlRegion)) - nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed + nState |= ControlState::CACHING_ALLOWED; // control is not clipped, caching allowed bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this ); diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index e861af551129..0e7f8c586703 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1086,7 +1086,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei Rectangle aBounds( aCtrlRegion ); Rectangle aContent( aCtrlRegion ); if( pWin->GetNativeControlRegion( aCtrlType, PART_ENTIRE_CONTROL, aCtrlRegion, - CTRL_STATE_ENABLED, aControlValue, OUString(), + ControlState::ENABLED, aControlValue, OUString(), aBounds, aContent ) ) { mnLeftBorder = aContent.Left() - aBounds.Left(); @@ -1259,12 +1259,12 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* if ( aCtrlType && pCtrl->IsNativeControlSupported(aCtrlType, aCtrlPart) ) { ImplControlValue aControlValue; - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; if ( !pWin->IsEnabled() ) - nState &= ~CTRL_STATE_ENABLED; + nState &= ~ControlState::ENABLED; if ( pWin->HasFocus() ) - nState |= CTRL_STATE_FOCUSED; + nState |= ControlState::FOCUSED; else if( mbNWFBorder ) { // FIXME: this is curently only on OS X, see if other platforms can profit @@ -1272,7 +1272,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* // FIXME: for OS X focus rings all controls need to support GetNativeControlRegion // for the dropdown style if( pCtrl->HasFocus() || pCtrl->HasChildPathFocus() ) - nState |= CTRL_STATE_FOCUSED; + nState |= ControlState::FOCUSED; } bool bMouseOver = false; @@ -1281,7 +1281,7 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pCtrlChild = pCtrlChild->GetWindow( WINDOW_NEXT ); if( bMouseOver ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; Point aPoint; Rectangle aCtrlRegion( aPoint, Size( mnWidth, mnHeight ) ); diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 979ed5fe8245..6796a0711eb9 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -657,12 +657,12 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, Rectangle aBound, aContent; Rectangle aNatRgn( rRect ); if( pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER, - aNatRgn, 0, aControlValue, OUString(), aBound, aContent) ) + aNatRgn, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // if bNoDraw is true then don't call the drawing routine // but just update the target rectangle if( bNoDraw || - pWin->DrawNativeControl( CTRL_FRAME, PART_BORDER, aContent, CTRL_STATE_ENABLED, + pWin->DrawNativeControl( CTRL_FRAME, PART_BORDER, aContent, ControlState::ENABLED, aControlValue, OUString()) ) { rRect = aContent; @@ -1050,7 +1050,7 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo ControlPart nPart = ( bVertical ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ ); bool nativeSupported = pWin->IsNativeControlSupported( CTRL_FIXEDLINE, nPart ); ImplControlValue aValue; - ControlState nState = 0; + ControlState nState = ControlState::NONE; Rectangle aRect(rStart,rStop); if(nativeSupported && pWin->DrawNativeControl(CTRL_FIXEDLINE,nPart,aRect,nState,aValue,OUString())) return; diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index 8266c642d9cd..a5fa39bd66ab 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -168,7 +168,7 @@ void DockingAreaWindow::Paint( const Rectangle& ) aControlValue.mbIsTopDockingArea = true; } - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; const bool isFooter = GetAlign() == WINDOWALIGN_BOTTOM && !rSetting.GetPersonaFooter().IsEmpty(); if (( GetAlign() == WINDOWALIGN_TOP && !rSetting.GetPersonaHeader().IsEmpty() ) || isFooter ) diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index cc96ce1b1e8b..539c7520b6ef 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1402,7 +1402,7 @@ Size Menu::ImplGetNativeCheckAndRadioSize( const vcl::Window* pWin, long& rCheck if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_CHECK_MARK), aCtrlRegion, - ControlState(CTRL_STATE_ENABLED), + ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, @@ -1418,7 +1418,7 @@ Size Menu::ImplGetNativeCheckAndRadioSize( const vcl::Window* pWin, long& rCheck if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_RADIO_MARK), aCtrlRegion, - ControlState(CTRL_STATE_ENABLED), + ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, @@ -1446,7 +1446,7 @@ bool Menu::ImplGetNativeSubmenuArrowSize( vcl::Window* pWin, Size& rArrowSize, l if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_SUBMENU_ARROW), aCtrlRegion, - ControlState(CTRL_STATE_ENABLED), + ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, @@ -1678,7 +1678,7 @@ Size Menu::ImplCalcSize( const vcl::Window* pWin ) if( pWindow->GetNativeControlRegion( ControlType(CTRL_MENUBAR), ControlPart(PART_ENTIRE_CONTROL), aCtrlRegion, - ControlState(CTRL_STATE_ENABLED), + ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, @@ -1711,7 +1711,7 @@ static void ImplPaintCheckBackground( vcl::Window* i_pWindow, const Rectangle& i { ImplControlValue aControlValue; Rectangle aCtrlRegion( i_rRect ); - ControlState nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED; + ControlState nState = ControlState::PRESSED | ControlState::ENABLED; aControlValue.setTristateVal( BUTTONVALUE_ON ); @@ -1822,11 +1822,11 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_SEPARATOR ) ) { - ControlState nState = 0; + ControlState nState = ControlState::NONE; if ( pData->bEnabled ) - nState |= CTRL_STATE_ENABLED; + nState |= ControlState::ENABLED; if ( bHighlighted ) - nState |= CTRL_STATE_SELECTED; + nState |= ControlState::SELECTED; Size aSz( pData->aSz ); aSz.Width() = aOutSz.Width() - 2*nOuterSpaceX; Rectangle aItemRect( aPos, aSz ); @@ -1876,16 +1876,16 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI ? PART_MENU_ITEM_RADIO_MARK : PART_MENU_ITEM_CHECK_MARK); - ControlState nState = 0; + ControlState nState = ControlState::NONE; if ( pData->bChecked ) - nState |= CTRL_STATE_PRESSED; + nState |= ControlState::PRESSED; if ( pData->bEnabled ) - nState |= CTRL_STATE_ENABLED; + nState |= ControlState::ENABLED; if ( bHighlighted ) - nState |= CTRL_STATE_SELECTED; + nState |= ControlState::SELECTED; long nCtrlHeight = (pData->nBits & MenuItemBits::RADIOCHECK) ? nCheckHeight : nRadioHeight; aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight)/2; @@ -2015,7 +2015,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_SUBMENU_ARROW ) ) { - ControlState nState = 0; + ControlState nState = ControlState::NONE; Size aTmpSz( 0, 0 ); long aSpacing = 0; @@ -2027,9 +2027,9 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI } if ( pData->bEnabled ) - nState |= CTRL_STATE_ENABLED; + nState |= ControlState::ENABLED; if ( bHighlighted ) - nState |= CTRL_STATE_SELECTED; + nState |= ControlState::SELECTED; aTmpPos.X() = aOutSz.Width() - aTmpSz.Width() - aSpacing - nOuterSpaceX; aTmpPos.Y() = aPos.Y() + ( pData->aSz.Height() - aTmpSz.Height() ) / 2; diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index d878ea12758a..1af25afcc9ae 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -606,7 +606,7 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, bool bHighlight ) Rectangle aBgRegion( tmp, GetOutputSizePixel() ); DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aBgRegion, - CTRL_STATE_ENABLED, + ControlState::ENABLED, aControlValue, OUString() ); } @@ -614,11 +614,11 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, bool bHighlight ) ImplAddNWFSeparator( this, aControlValue ); // draw selected item - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; if ( bRollover ) - nState |= CTRL_STATE_ROLLOVER; + nState |= ControlState::ROLLOVER; else - nState |= CTRL_STATE_SELECTED; + nState |= ControlState::SELECTED; DrawNativeControl( CTRL_MENUBAR, PART_MENU_ITEM, aRect, nState, @@ -651,7 +651,7 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, bool bHighlight ) Point aPt; Rectangle aCtrlRect( aPt, GetOutputSizePixel() ); - DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, aMenubarValue, OUString() ); + DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, aMenubarValue, OUString() ); } ImplAddNWFSeparator( this, aMenubarValue ); @@ -885,7 +885,7 @@ void MenuBarWindow::Paint( const Rectangle& ) Point aPt; Rectangle aCtrlRegion( aPt, GetOutputSizePixel() ); - DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRegion, CTRL_STATE_ENABLED, aMenubarValue, OUString() ); + DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRegion, ControlState::ENABLED, aMenubarValue, OUString() ); } ImplAddNWFSeparator( this, aMenubarValue ); diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 3a4904c4a8ff..0d28645229ca 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -753,7 +753,7 @@ void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, bool bHighlight ) MenupopupValue aVal( pMenu->nTextPos-GUTTERBORDER, aItemRect ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, - CTRL_STATE_ENABLED, + ControlState::ENABLED, aVal, OUString() ); if( bHighlight && @@ -762,7 +762,7 @@ void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, bool bHighlight ) bDrawItemRect = false; if( !DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect, - CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ), + ControlState::SELECTED | ( pData->bEnabled? ControlState::ENABLED: ControlState::NONE ), aVal, OUString() ) ) { @@ -1095,7 +1095,7 @@ void MenuFloatingWindow::Paint( const Rectangle& ) ImplControlValue aVal( pMenu->nTextPos-GUTTERBORDER ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Rectangle( Point( nX, 0 ), aPxSize ), - CTRL_STATE_ENABLED, + ControlState::ENABLED, aVal, OUString() ); InitMenuClipRegion(); diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 4cdaf36f805d..c22c5b1548a6 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1168,10 +1168,10 @@ void Window::Erase() if( aCtrlPart != 0 && ! IsControlBackground() ) { Rectangle aCtrlRegion( Point(), GetOutputSizePixel() ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; if( IsEnabled() ) - nState |= CTRL_STATE_ENABLED; + nState |= ControlState::ENABLED; bNativeOK = DrawNativeControl( CTRL_WINDOW_BACKGROUND, aCtrlPart, aCtrlRegion, nState, ImplControlValue(), OUString() ); diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 2b74883b2abd..b3bc67193d57 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -505,7 +505,7 @@ void DrawProgress( vcl::Window* pWindow, const Point& rPos, pWindow->IntersectClipRegion( rFramePosSize ); } bool bNativeOK = pWindow->DrawNativeControl( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion, - CTRL_STATE_ENABLED, aValue, OUString() ); + ControlState::ENABLED, aValue, OUString() ); if( bNeedErase ) pWindow->Pop(); if( bNativeOK ) @@ -642,7 +642,7 @@ void StatusBar::ImplCalcProgressRect() Rectangle aControlRegion( Rectangle( (const Point&)Point(), maPrgsFrameRect.GetSize() ) ); Rectangle aNativeControlRegion, aNativeContentRegion; if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion, - CTRL_STATE_ENABLED, aValue, OUString(), + ControlState::ENABLED, aValue, OUString(), aNativeControlRegion, aNativeContentRegion ) ) ) { long nProgressHeight = aNativeControlRegion.GetHeight(); @@ -1442,7 +1442,7 @@ Size StatusBar::CalcWindowSizePixel() const Rectangle aControlRegion( (const Point&)Point(), Size( nCalcWidth, nMinHeight ) ); Rectangle aNativeControlRegion, aNativeContentRegion; if( GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, - aControlRegion, CTRL_STATE_ENABLED, aValue, OUString(), + aControlRegion, ControlState::ENABLED, aValue, OUString(), aNativeControlRegion, aNativeContentRegion ) ) { nProgressHeight = aNativeControlRegion.GetHeight(); @@ -1456,7 +1456,7 @@ Size StatusBar::CalcWindowSizePixel() const Rectangle aBound, aContent; Rectangle aNatRgn( Point( 0, 0 ), Size( 150, 50 ) ); if( GetNativeControlRegion(CTRL_FRAME, PART_BORDER, - aNatRgn, 0, aControlValue, OUString(), aBound, aContent) ) + aNatRgn, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { mpImplData->mnItemBorderWidth = ( aBound.GetHeight() - aContent.GetHeight() ) / 2; diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index c7648f05692c..e23c91672762 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -122,12 +122,12 @@ void TabPage::Paint( const Rectangle& ) { const ImplControlValue aControlValue; - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; int part = PART_ENTIRE_CONTROL; if ( !IsEnabled() ) - nState &= ~CTRL_STATE_ENABLED; + nState &= ~ControlState::ENABLED; if ( HasFocus() ) - nState |= CTRL_STATE_FOCUSED; + nState |= ControlState::FOCUSED; Point aPoint; // pass the whole window region to NWF as the tab body might be a gradient or bitmap // that has to be scaled properly, clipping makes sure that we do not paint too much diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 5816fe333970..0654bffd906a 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -156,7 +156,7 @@ int ToolBox::ImplGetDragWidth( ToolBox* pThis ) Rectangle aArea( aPoint, pThis->GetOutputSizePixel() ); if ( pThis->GetNativeControlRegion(CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ, - aArea, 0, aControlValue, OUString(), aBound, aContent) ) + aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { width = pThis->mbHorz ? aContent.GetWidth() : aContent.GetHeight(); } @@ -270,7 +270,7 @@ void ToolBox::ImplDrawGrip( ToolBox* pThis ) aToolbarValue.maGripRect = pWrapper->GetDragArea(); Point aPt; Rectangle aCtrlRegion( aPt, pThis->GetOutputSizePixel() ); - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; bNativeOk = pThis->DrawNativeControl( CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ, aCtrlRegion, nState, aToolbarValue, OUString() ); @@ -457,7 +457,7 @@ bool ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const vcl::Region & ) // use NWF Point aPt; Rectangle aCtrlRegion( aPt, pThis->GetOutputSizePixel() ); - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; return pThis->DrawNativeControl( CTRL_TOOLBAR, pThis->mbHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT, aCtrlRegion, nState, ImplControlValue(), OUString() ); @@ -1669,7 +1669,7 @@ bool ToolBox::ImplCalcItem() { if( GetNativeControlRegion( CTRL_TOOLBAR, PART_BUTTON, aReg, - CTRL_STATE_ENABLED | CTRL_STATE_ROLLOVER, + ControlState::ENABLED | ControlState::ROLLOVER, aVal, OUString(), aNativeBounds, aNativeContent ) ) { @@ -1694,7 +1694,7 @@ bool ToolBox::ImplCalcItem() aReg = aRect; if( GetNativeControlRegion( CTRL_COMBOBOX, PART_ENTIRE_CONTROL, aReg, - CTRL_STATE_ENABLED | CTRL_STATE_ROLLOVER, + ControlState::ENABLED | ControlState::ROLLOVER, aVal, OUString(), aNativeBounds, aNativeContent ) ) { @@ -1706,7 +1706,7 @@ bool ToolBox::ImplCalcItem() aReg = aRect; if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aReg, - CTRL_STATE_ENABLED | CTRL_STATE_ROLLOVER, + ControlState::ENABLED | ControlState::ROLLOVER, aVal, OUString(), aNativeBounds, aNativeContent ) ) { @@ -1718,7 +1718,7 @@ bool ToolBox::ImplCalcItem() aReg = aRect; if( GetNativeControlRegion( CTRL_SPINBOX, PART_ENTIRE_CONTROL, aReg, - CTRL_STATE_ENABLED | CTRL_STATE_ROLLOVER, + ControlState::ENABLED | ControlState::ROLLOVER, aVal, OUString(), aNativeBounds, aNativeContent ) ) { @@ -2859,7 +2859,7 @@ void ToolBox::ImplDrawSeparator( sal_uInt16 nPos, Rectangle rRect ) if( IsNativeControlSupported( CTRL_TOOLBAR, nPart ) ) { ImplControlValue aControlValue; - ControlState nState = 0; + ControlState nState = ControlState::NONE; bNativeOk = DrawNativeControl( CTRL_TOOLBAR, nPart, rRect, nState, aControlValue, OUString() ); } @@ -2906,11 +2906,11 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 h if( !bIsWindow && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { ImplControlValue aControlValue; - ControlState nState = 0; + ControlState nState = ControlState::NONE; - if ( highlight == 1 ) nState |= CTRL_STATE_PRESSED; - if ( highlight == 2 ) nState |= CTRL_STATE_ROLLOVER; - if ( bEnabled ) nState |= CTRL_STATE_ENABLED; + if ( highlight == 1 ) nState |= ControlState::PRESSED; + if ( highlight == 2 ) nState |= ControlState::ROLLOVER; + if ( bEnabled ) nState |= ControlState::ENABLED; aControlValue.setTristateVal( bChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF ); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 53291b557040..f3c597026987 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1166,7 +1166,7 @@ void Window::ImplInitAppFontData( vcl::Window* pWindow ) Rectangle aBoundingRgn( aCtrlRegion ); Rectangle aContentRgn( aCtrlRegion ); if( pWindow->GetNativeControlRegion( CTRL_EDITBOX, PART_ENTIRE_CONTROL, aCtrlRegion, - CTRL_STATE_ENABLED, aControlValue, OUString(), + ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { // comment: the magical +6 is for the extra border in bordered diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 0e142aaa7267..5d257633171a 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -350,7 +350,7 @@ public: GdkX11Pixmap* m_pixmap; GdkX11Pixmap* m_mask; - NWPixmapCacheData() : m_nType(0), m_nState(0), m_pixmap(0), m_mask(0) {} + NWPixmapCacheData() : m_nType(0), m_nState(ControlState::NONE), m_pixmap(0), m_mask(0) {} ~NWPixmapCacheData() { SetPixmap( NULL, NULL ); }; void SetPixmap( GdkX11Pixmap* pPixmap, GdkX11Pixmap* pMask ); @@ -424,7 +424,7 @@ void NWPixmapCache::ThemeChanged() bool NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkX11Pixmap** pPixmap, GdkX11Pixmap** pMask ) { - aState &= ~CTRL_CACHING_ALLOWED; // mask clipping flag + aState &= ~ControlState::CACHING_ALLOWED; // mask clipping flag int i; for(i=0; i<m_size; i++) { @@ -444,10 +444,10 @@ bool NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectang void NWPixmapCache::Fill( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkX11Pixmap* pPixmap, GdkX11Pixmap* pMask ) { - if( !(aState & CTRL_CACHING_ALLOWED) ) + if( !(aState & ControlState::CACHING_ALLOWED) ) return; - aState &= ~CTRL_CACHING_ALLOWED; // mask clipping flag + aState &= ~ControlState::CACHING_ALLOWED; // mask clipping flag m_idx = (m_idx+1) % m_size; // just wrap pData[m_idx].m_nType = aType; pData[m_idx].m_nState = aState; @@ -1404,7 +1404,7 @@ bool GtkSalGraphics::NWPaintGTKArrow( const OUString& ) { GtkArrowType arrowType(aValue.getNumericVal()&1?GTK_ARROW_DOWN:GTK_ARROW_UP); - GtkStateType stateType(nState&CTRL_STATE_PRESSED?GTK_STATE_ACTIVE:GTK_STATE_NORMAL); + GtkStateType stateType(nState&ControlState::PRESSED?GTK_STATE_ACTIVE:GTK_STATE_NORMAL); GdkRectangle clipRect; for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) @@ -1606,12 +1606,12 @@ bool GtkSalGraphics::NWPaintGTKButtonReal( else shadowType=GTK_SHADOW_OUT; - if(nState & CTRL_STATE_ROLLOVER) + if(nState & ControlState::ROLLOVER) stateType=GTK_STATE_PRELIGHT; else stateType=GTK_STATE_NORMAL; - if(nState & CTRL_STATE_PRESSED) + if(nState & ControlState::PRESSED) { stateType=GTK_STATE_ACTIVE; shadowType=GTK_SHADOW_IN; @@ -1661,7 +1661,7 @@ bool GtkSalGraphics::NWPaintGTKButtonReal( bDrawFocus = false; gint xi = x, yi = y, wi = w, hi = h; - if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus ) + if ( (nState & ControlState::DEFAULT) && bDrawFocus ) { xi += aDefBorder.left; yi += aDefBorder.top; @@ -1697,7 +1697,7 @@ bool GtkSalGraphics::NWPaintGTKButtonReal( if ( GTK_IS_BUTTON(button) ) { - if ( (nState & CTRL_STATE_DEFAULT) ) + if ( (nState & ControlState::DEFAULT) ) gtk_paint_box( button->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, &clipRect, button, "buttondefault", x, y, w, h ); @@ -1768,7 +1768,7 @@ static Rectangle NWGetButtonArea( SalX11Screen nScreen, if ( (w < 16) || (h < 16) ) bDrawFocus = false; - if ( (nState & CTRL_STATE_DEFAULT) && bDrawFocus ) + if ( (nState & ControlState::DEFAULT) && bDrawFocus ) { x -= aDefBorder.left; y -= aDefBorder.top; @@ -2136,7 +2136,7 @@ bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, x, y, scrollbarRect.GetWidth(), scrollbarRect.GetHeight() ); - if ( nState & CTRL_STATE_FOCUSED ) + if ( nState & ControlState::FOCUSED ) { gtk_paint_focus( style, gdkDrawable, GTK_STATE_ACTIVE, gdkRect, GTK_WIDGET(scrollbarWidget), "trough", @@ -2467,10 +2467,10 @@ bool GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart, const SpinbuttonValue * pSpinVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&aValue) : NULL; Rectangle upBtnRect; ControlPart upBtnPart = PART_BUTTON_UP; - ControlState upBtnState = CTRL_STATE_ENABLED; + ControlState upBtnState = ControlState::ENABLED; Rectangle downBtnRect; ControlPart downBtnPart = PART_BUTTON_DOWN; - ControlState downBtnState = CTRL_STATE_ENABLED; + ControlState downBtnState = ControlState::ENABLED; NWEnsureGTKButton( m_nXScreen ); NWEnsureGTKSpinButton( m_nXScreen ); @@ -2822,7 +2822,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, pixmapRect.Move( -2, 0 ); pixmapRect.SetSize( Size( pixmapRect.GetWidth() + 2, pixmapRect.GetHeight() ) ); } - if ( nState & CTRL_STATE_SELECTED ) + if ( nState & ControlState::SELECTED ) { // In GTK+, the selected tab is 2px taller than all other tabs pixmapRect.Move( 0, -2 ); @@ -2881,7 +2881,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, case CTRL_TAB_ITEM: { - stateType = ( nState & CTRL_STATE_SELECTED ) ? GTK_STATE_NORMAL : GTK_STATE_ACTIVE; + stateType = ( nState & ControlState::SELECTED ) ? GTK_STATE_NORMAL : GTK_STATE_ACTIVE; // First draw the background gtk_paint_flat_box(gWidgetData[m_nXScreen].gNotebookWidget->style, gdkPixmap, @@ -2892,7 +2892,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, pixmapRect.GetHeight()+rControlRectangle.Top()); // Now the tab itself - if( nState & CTRL_STATE_ROLLOVER ) + if( nState & ControlState::ROLLOVER ) g_object_set_data(G_OBJECT(gdkPixmap),tabPrelitDataName,reinterpret_cast<gpointer>(TRUE)); gtk_paint_extension( gWidgetData[m_nXScreen].gNotebookWidget->style, gdkPixmap, stateType, GTK_SHADOW_OUT, NULL, gWidgetData[m_nXScreen].gNotebookWidget, @@ -2901,7 +2901,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, g_object_steal_data(G_OBJECT(gdkPixmap),tabPrelitDataName); - if ( nState & CTRL_STATE_SELECTED ) + if ( nState & ControlState::SELECTED ) { gtk_paint_flat_box( m_pWindow->style, gdkPixmap, stateType, GTK_SHADOW_NONE, NULL, m_pWindow, "base", 0, (pixmapRect.GetHeight() - 1), pixmapRect.GetWidth(), 1 ); @@ -3017,7 +3017,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar( NWEnsureGTKToolbar( m_nXScreen ); if( nPart == PART_BUTTON ) // toolbar buttons cannot focus in gtk - nState &= ~CTRL_STATE_FOCUSED; + nState &= ~ControlState::FOCUSED; NWConvertVCLStateToGTKState( nState, &stateType, &shadowType ); x = rControlRectangle.Left(); @@ -3031,7 +3031,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar( NWSetWidgetState( gWidgetData[m_nXScreen].gToolbarWidget, nState, stateType ); GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nXScreen].gToolbarWidget, GTK_SENSITIVE ); - if ( nState & CTRL_STATE_ENABLED ) + if ( nState & ControlState::ENABLED ) GTK_WIDGET_SET_FLAGS( gWidgetData[m_nXScreen].gToolbarWidget, GTK_SENSITIVE ); if( nPart == PART_DRAW_BACKGROUND_HORZ ) @@ -3045,7 +3045,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar( NWSetWidgetState( gWidgetData[m_nXScreen].gHandleBoxWidget, nState, stateType ); GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nXScreen].gHandleBoxWidget, GTK_SENSITIVE ); - if ( nState & CTRL_STATE_ENABLED ) + if ( nState & ControlState::ENABLED ) GTK_WIDGET_SET_FLAGS( gWidgetData[m_nXScreen].gHandleBoxWidget, GTK_SENSITIVE ); gtk_handle_box_set_shadow_type( GTK_HANDLE_BOX(gWidgetData[m_nXScreen].gHandleBoxWidget), shadowType ); @@ -3063,8 +3063,8 @@ bool GtkSalGraphics::NWPaintGTKToolbar( // handle button else if( nPart == PART_BUTTON ) { - bool bPaintButton = (nState & CTRL_STATE_PRESSED) - || (nState & CTRL_STATE_ROLLOVER); + bool bPaintButton = (nState & ControlState::PRESSED) + || (nState & ControlState::ROLLOVER); if( aValue.getTristateVal() == BUTTONVALUE_ON ) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pButtonWidget),TRUE); @@ -3197,7 +3197,7 @@ bool GtkSalGraphics::NWPaintGTKMenubar( if( nPart == PART_MENU_ITEM ) { - if( nState & CTRL_STATE_SELECTED ) + if( nState & ControlState::SELECTED ) { gtk_widget_style_get( gWidgetData[m_nXScreen].gMenuItemMenubarWidget, "selected_shadow_type", &selected_shadow_type, @@ -3218,7 +3218,7 @@ bool GtkSalGraphics::NWPaintGTKMenubar( NWSetWidgetState( gWidgetData[m_nXScreen].gMenubarWidget, nState, stateType ); GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nXScreen].gMenubarWidget, GTK_SENSITIVE ); - if ( nState & CTRL_STATE_ENABLED ) + if ( nState & ControlState::ENABLED ) GTK_WIDGET_SET_FLAGS( gWidgetData[m_nXScreen].gMenubarWidget, GTK_SENSITIVE ); // for translucent menubar styles paint background first @@ -3242,7 +3242,7 @@ bool GtkSalGraphics::NWPaintGTKMenubar( else if( nPart == PART_MENU_ITEM ) { - if( nState & CTRL_STATE_SELECTED ) + if( nState & ControlState::SELECTED ) { gtk_paint_box( gWidgetData[m_nXScreen].gMenuItemMenubarWidget->style, gdkDrawable, @@ -3270,7 +3270,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu( // #i50745# gtk does not draw disabled menu entries (and crux theme // even crashes) in very old (Fedora Core 4 vintage) gtk's if (gtk_major_version <= 2 && gtk_minor_version <= 8 && - nPart == PART_MENU_ITEM && ! (nState & CTRL_STATE_ENABLED) ) + nPart == PART_MENU_ITEM && ! (nState & ControlState::ENABLED) ) return true; GtkStateType stateType; @@ -3288,7 +3288,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu( h = rControlRectangle.GetHeight(); if( nPart == PART_MENU_ITEM && - ( nState & (CTRL_STATE_SELECTED|CTRL_STATE_ROLLOVER) ) ) + ( nState & (ControlState::SELECTED|ControlState::ROLLOVER) ) ) { gtk_widget_style_get( gWidgetData[m_nXScreen].gMenuItemMenuWidget, "selected_shadow_type", &selected_shadow_type, @@ -3298,7 +3298,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu( NWSetWidgetState( gWidgetData[m_nXScreen].gMenuWidget, nState, stateType ); GTK_WIDGET_UNSET_FLAGS( gWidgetData[m_nXScreen].gMenuWidget, GTK_SENSITIVE ); - if ( nState & CTRL_STATE_ENABLED ) + if ( nState & ControlState::ENABLED ) GTK_WIDGET_SET_FLAGS( gWidgetData[m_nXScreen].gMenuWidget, GTK_SENSITIVE ); for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it ) @@ -3330,9 +3330,9 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu( } else if( nPart == PART_MENU_ITEM ) { - if( nState & (CTRL_STATE_SELECTED|CTRL_STATE_ROLLOVER) ) + if( nState & (ControlState::SELECTED|ControlState::ROLLOVER) ) { - if( nState & CTRL_STATE_ENABLED ) + if( nState & ControlState::ENABLED ) gtk_paint_box( gWidgetData[m_nXScreen].gMenuItemMenuWidget->style, gdkDrawable, GTK_STATE_PRELIGHT, @@ -3353,7 +3353,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu( GtkShadowType nShadowType; NWConvertVCLStateToGTKState( nState, &nStateType, &nShadowType ); - if ( (nState & CTRL_STATE_SELECTED) && (nState & CTRL_STATE_ENABLED) ) + if ( (nState & ControlState::SELECTED) && (nState & ControlState::ENABLED) ) nStateType = GTK_STATE_PRELIGHT; NWSetWidgetState( pWidget, nState, nStateType ); @@ -3397,7 +3397,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu( GtkShadowType nShadowType; NWConvertVCLStateToGTKState( nState, &nStateType, &nShadowType ); - if ( (nState & CTRL_STATE_SELECTED) && (nState & CTRL_STATE_ENABLED) ) + if ( (nState & ControlState::SELECTED) && (nState & ControlState::ENABLED) ) nStateType = GTK_STATE_PRELIGHT; NWSetWidgetState( gWidgetData[m_nXScreen].gMenuItemMenuWidget, @@ -3610,7 +3610,7 @@ bool GtkSalGraphics::NWPaintGTKSlider( "trough-border", &trough_border, NULL); - GtkStateType eState = (nState & CTRL_STATE_ENABLED) ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE; + GtkStateType eState = (nState & ControlState::ENABLED) ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE; if( nPart == PART_TRACK_HORZ_AREA ) { gtk_paint_box( pWidget->style, @@ -4265,14 +4265,14 @@ static void NWConvertVCLStateToGTKState( ControlState nVCLState, *nGTKShadow = GTK_SHADOW_OUT; *nGTKState = GTK_STATE_INSENSITIVE; - if ( nVCLState & CTRL_STATE_ENABLED ) + if ( nVCLState & ControlState::ENABLED ) { - if ( nVCLState & CTRL_STATE_PRESSED ) + if ( nVCLState & ControlState::PRESSED ) { *nGTKState = GTK_STATE_ACTIVE; *nGTKShadow = GTK_SHADOW_IN; } - else if ( nVCLState & CTRL_STATE_ROLLOVER ) + else if ( nVCLState & ControlState::ROLLOVER ) { *nGTKState = GTK_STATE_PRELIGHT; *nGTKShadow = GTK_SHADOW_OUT; @@ -4296,11 +4296,11 @@ static void NWSetWidgetState( GtkWidget* widget, ControlState nState, GtkStateTy GTK_WIDGET_UNSET_FLAGS( widget, GTK_SENSITIVE ); GTK_WIDGET_SET_FLAGS( widget, gWidgetDefaultFlags[reinterpret_cast<long>(widget)] ); - if ( nState & CTRL_STATE_DEFAULT ) + if ( nState & ControlState::DEFAULT ) GTK_WIDGET_SET_FLAGS( widget, GTK_HAS_DEFAULT ); - if ( !GTK_IS_TOGGLE_BUTTON(widget) && (nState & CTRL_STATE_FOCUSED) ) + if ( !GTK_IS_TOGGLE_BUTTON(widget) && (nState & ControlState::FOCUSED) ) GTK_WIDGET_SET_FLAGS( widget, GTK_HAS_FOCUS ); - if ( nState & CTRL_STATE_ENABLED ) + if ( nState & ControlState::ENABLED ) GTK_WIDGET_SET_FLAGS( widget, GTK_SENSITIVE ); gtk_widget_set_state( widget, nGtkState ); } diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 0bb0c34fbf72..53bc1a310453 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -42,22 +42,22 @@ static void NWConvertVCLStateToGTKState( ControlState nVCLState, *nGTKShadow = GTK_SHADOW_OUT; *nGTKState = GTK_STATE_FLAG_NORMAL; - if (!( nVCLState & CTRL_STATE_ENABLED )) + if (!( nVCLState & ControlState::ENABLED )) *nGTKState = GTK_STATE_FLAG_INSENSITIVE; - if ( nVCLState & CTRL_STATE_PRESSED ) + if ( nVCLState & ControlState::PRESSED ) { *nGTKState = (GtkStateFlags) (*nGTKState | GTK_STATE_FLAG_ACTIVE); *nGTKShadow = GTK_SHADOW_IN; } - if ( nVCLState & CTRL_STATE_ROLLOVER ) + if ( nVCLState & ControlState::ROLLOVER ) *nGTKState = (GtkStateFlags) (*nGTKState | GTK_STATE_FLAG_PRELIGHT); - if ( nVCLState & CTRL_STATE_SELECTED ) + if ( nVCLState & ControlState::SELECTED ) *nGTKState = (GtkStateFlags) (*nGTKState | GTK_STATE_FLAG_SELECTED); - if ( nVCLState & CTRL_STATE_FOCUSED ) + if ( nVCLState & ControlState::FOCUSED ) *nGTKState = (GtkStateFlags) (*nGTKState | GTK_STATE_FLAG_FOCUSED); } @@ -412,7 +412,7 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, if ( has_slider ) { NWConvertVCLStateToGTKState( pScrollbarVal->mnThumbState, &stateFlags, &shadowType ); - if ( pScrollbarVal->mnThumbState & CTRL_STATE_PRESSED ) + if ( pScrollbarVal->mnThumbState & ControlState::PRESSED ) stateFlags = (GtkStateFlags) (stateFlags | GTK_STATE_PRELIGHT); gtk_style_context_save(context); @@ -601,9 +601,9 @@ void GtkSalGraphics::PaintSpinButton(GtkStyleContext *context, GtkShadowType shadowType; const SpinbuttonValue * pSpinVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&aValue) : NULL; ControlPart upBtnPart = PART_BUTTON_UP; - ControlState upBtnState = CTRL_STATE_ENABLED; + ControlState upBtnState = ControlState::ENABLED; ControlPart downBtnPart = PART_BUTTON_DOWN; - ControlState downBtnState = CTRL_STATE_ENABLED; + ControlState downBtnState = ControlState::ENABLED; if ( pSpinVal ) { diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index f0e5ebe01f97..e1a7322abfe2 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -516,7 +516,7 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, pWidget->move( 0, 0 ); // Enable/disable the widget - pWidget->setEnabled( nState & CTRL_STATE_ENABLED ); + pWidget->setEnabled( nState & ControlState::ENABLED ); // Create pixmap to paint to KDEX11Pixmap xPixmap( pWidget->width(), pWidget->height() ); @@ -598,15 +598,15 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, QStyle::SCFlags eActive = QStyle::SC_None; if ( pValue ) { - if ( pValue->mnUpperState & CTRL_STATE_PRESSED ) + if ( pValue->mnUpperState & ControlState::PRESSED ) eActive = QStyle::SC_SpinWidgetUp; - else if ( pValue->mnLowerState & CTRL_STATE_PRESSED ) + else if ( pValue->mnLowerState & ControlState::PRESSED ) eActive = QStyle::SC_SpinWidgetDown; // Update the enable/disable state of the widget - if ( ( nState & CTRL_STATE_ENABLED ) || - ( pValue->mnUpperState & CTRL_STATE_ENABLED ) || - ( pValue->mnLowerState & CTRL_STATE_ENABLED ) ) + if ( ( nState & ControlState::ENABLED ) || + ( pValue->mnUpperState & ControlState::ENABLED ) || + ( pValue->mnLowerState & ControlState::ENABLED ) ) { pWidget->setEnabled( true ); nStyle |= QStyle::Style_Enabled; @@ -615,8 +615,8 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, pWidget->setEnabled( false ); // Mouse-over effect - if ( (pValue->mnUpperState & CTRL_STATE_ROLLOVER) || - (pValue->mnLowerState & CTRL_STATE_ROLLOVER) ) + if ( (pValue->mnUpperState & ControlState::ROLLOVER) || + (pValue->mnLowerState & ControlState::ROLLOVER) ) nStyle |= QStyle::Style_MouseOver; } @@ -692,38 +692,38 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, if ( strcmp( QMotifPlusStyle_String, pStyleName ) == 0 ) { nStyle |= QStyle::Style_MouseOver; - if ( pValue->mnThumbState & CTRL_STATE_ROLLOVER ) + if ( pValue->mnThumbState & ControlState::ROLLOVER ) eActive = QStyle::SC_ScrollBarSlider; } else if ( strcmp( QSGIStyle_String, pStyleName ) == 0 ) { nStyle |= QStyle::Style_MouseOver; - if ( pValue->mnButton1State & CTRL_STATE_ROLLOVER ) + if ( pValue->mnButton1State & ControlState::ROLLOVER ) eActive = QStyle::SC_ScrollBarSubLine; - else if ( pValue->mnButton2State & CTRL_STATE_ROLLOVER ) + else if ( pValue->mnButton2State & ControlState::ROLLOVER ) eActive = QStyle::SC_ScrollBarAddLine; - else if ( pValue->mnThumbState & CTRL_STATE_ROLLOVER ) + else if ( pValue->mnThumbState & ControlState::ROLLOVER ) eActive = QStyle::SC_ScrollBarSlider; } - if ( pValue->mnButton1State & CTRL_STATE_PRESSED ) + if ( pValue->mnButton1State & ControlState::PRESSED ) eActive = QStyle::SC_ScrollBarSubLine; - else if ( pValue->mnButton2State & CTRL_STATE_PRESSED ) + else if ( pValue->mnButton2State & ControlState::PRESSED ) eActive = QStyle::SC_ScrollBarAddLine; - else if ( pValue->mnThumbState & CTRL_STATE_PRESSED ) + else if ( pValue->mnThumbState & ControlState::PRESSED ) eActive = QStyle::SC_ScrollBarSlider; - else if ( pValue->mnPage1State & CTRL_STATE_PRESSED ) + else if ( pValue->mnPage1State & ControlState::PRESSED ) eActive = QStyle::SC_ScrollBarSubPage; - else if ( pValue->mnPage2State & CTRL_STATE_PRESSED ) + else if ( pValue->mnPage2State & ControlState::PRESSED ) eActive = QStyle::SC_ScrollBarAddPage; // Update the enable/disable state of the widget - if ( ( nState & CTRL_STATE_ENABLED ) || - ( pValue->mnButton1State & CTRL_STATE_ENABLED ) || - ( pValue->mnButton2State & CTRL_STATE_ENABLED ) || - ( pValue->mnThumbState & CTRL_STATE_ENABLED ) || - ( pValue->mnPage1State & CTRL_STATE_ENABLED ) || - ( pValue->mnPage2State & CTRL_STATE_ENABLED ) ) + if ( ( nState & ControlState::ENABLED ) || + ( pValue->mnButton1State & ControlState::ENABLED ) || + ( pValue->mnButton2State & ControlState::ENABLED ) || + ( pValue->mnThumbState & ControlState::ENABLED ) || + ( pValue->mnPage1State & ControlState::ENABLED ) || + ( pValue->mnPage2State & ControlState::ENABLED ) ) { pWidget->setEnabled( true ); nStyle |= QStyle::Style_Enabled; @@ -1201,13 +1201,13 @@ QStyle::SFlags WidgetPainter::vclStateValue2SFlags( ControlState nState, const ImplControlValue& aValue ) { QStyle::SFlags nStyle = - ( (nState & CTRL_STATE_DEFAULT)? QStyle::Style_ButtonDefault: QStyle::Style_Default ) | - ( (nState & CTRL_STATE_ENABLED)? QStyle::Style_Enabled: QStyle::Style_Default ) | - ( (nState & CTRL_STATE_FOCUSED)? QStyle::Style_HasFocus: QStyle::Style_Default ) | - ( (nState & CTRL_STATE_PRESSED)? QStyle::Style_Down: QStyle::Style_Raised ) | - ( (nState & CTRL_STATE_SELECTED)? QStyle::Style_Selected : QStyle::Style_Default ) | - ( (nState & CTRL_STATE_ROLLOVER)? QStyle::Style_MouseOver: QStyle::Style_Default ); - //TODO ( (nState & CTRL_STATE_HIDDEN)? QStyle::Style_: QStyle::Style_Default ) | + ( (nState & ControlState::DEFAULT)? QStyle::Style_ButtonDefault: QStyle::Style_Default ) | + ( (nState & ControlState::ENABLED)? QStyle::Style_Enabled: QStyle::Style_Default ) | + ( (nState & ControlState::FOCUSED)? QStyle::Style_HasFocus: QStyle::Style_Default ) | + ( (nState & ControlState::PRESSED)? QStyle::Style_Down: QStyle::Style_Raised ) | + ( (nState & ControlState::SELECTED)? QStyle::Style_Selected : QStyle::Style_Default ) | + ( (nState & ControlState::ROLLOVER)? QStyle::Style_MouseOver: QStyle::Style_Default ); + //TODO ( (nState & ControlState::HIDDEN)? QStyle::Style_: QStyle::Style_Default ) | switch ( aValue.getTristateVal() ) { @@ -1413,7 +1413,7 @@ bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, if ( (nType == CTRL_PUSHBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( - pWidgetPainter->pushButton( rControlRegion, (nState & CTRL_STATE_DEFAULT) ), + pWidgetPainter->pushButton( rControlRegion, (nState & ControlState::DEFAULT) ), nState, aValue, this ); } else if ( (nType == CTRL_RADIOBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) @@ -1542,14 +1542,14 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar { // Metrics of the push button case CTRL_PUSHBUTTON: - pWidget = pWidgetPainter->pushButton( rControlRegion, ( nState & CTRL_STATE_DEFAULT ) ); + pWidget = pWidgetPainter->pushButton( rControlRegion, ( nState & ControlState::DEFAULT ) ); switch ( nPart ) { case PART_ENTIRE_CONTROL: qRect = qBoundingRect; - if ( nState & CTRL_STATE_DEFAULT ) + if ( nState & ControlState::DEFAULT ) { int nIndicatorSize = QApplication::style().pixelMetric( QStyle::PM_ButtonDefaultIndicator, pWidget ); diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index bb73d894227f..d0f5e63812ed 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -46,13 +46,13 @@ QStyle::State vclStateValue2StateFlag( ControlState nControlState, const ImplControlValue& aValue ) { QStyle::State nState = - ( (nControlState & CTRL_STATE_DEFAULT)? QStyle::State_None: QStyle::State_None ) | - ( (nControlState & CTRL_STATE_ENABLED)? QStyle::State_Enabled: QStyle::State_None ) | - ( (nControlState & CTRL_STATE_FOCUSED)? QStyle::State_HasFocus: QStyle::State_None ) | - ( (nControlState & CTRL_STATE_PRESSED)? QStyle::State_Sunken: QStyle::State_None ) | - ( (nControlState & CTRL_STATE_SELECTED)? QStyle::State_Selected : QStyle::State_None ) | - ( (nControlState & CTRL_STATE_ROLLOVER)? QStyle::State_MouseOver: QStyle::State_None ); - //TODO ( (nControlState & CTRL_STATE_HIDDEN)? QStyle::State_: QStyle::State_None ) | + ( (nControlState & ControlState::DEFAULT)? QStyle::State_None: QStyle::State_None ) | + ( (nControlState & ControlState::ENABLED)? QStyle::State_Enabled: QStyle::State_None ) | + ( (nControlState & ControlState::FOCUSED)? QStyle::State_HasFocus: QStyle::State_None ) | + ( (nControlState & ControlState::PRESSED)? QStyle::State_Sunken: QStyle::State_None ) | + ( (nControlState & ControlState::SELECTED)? QStyle::State_Selected : QStyle::State_None ) | + ( (nControlState & ControlState::ROLLOVER)? QStyle::State_MouseOver: QStyle::State_None ); + //TODO ( (nControlState & ControlState::HIDDEN)? QStyle::State_: QStyle::State_None ) | switch ( aValue.getTristateVal() ) { @@ -274,11 +274,11 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, if (part == PART_MENU_ITEM) { QStyleOptionMenuItem option; - if ( ( nControlState & CTRL_STATE_ROLLOVER ) + if ( ( nControlState & ControlState::ROLLOVER ) && QApplication::style()->styleHint( QStyle::SH_MenuBar_MouseTracking ) ) option.state |= QStyle::State_Selected; - if ( nControlState & CTRL_STATE_SELECTED ) // Passing State_Sunken is currently not documented. + if ( nControlState & ControlState::SELECTED ) // Passing State_Sunken is currently not documented. option.state |= QStyle::State_Sunken; // But some kinds of QStyle interpret it. draw( QStyle::CE_MenuBarItem, &option, m_image, @@ -337,7 +337,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, QStyleOptionMenuItem option; option.checkType = ( part == PART_MENU_ITEM_CHECK_MARK ) ? QStyleOptionMenuItem::NonExclusive : QStyleOptionMenuItem::Exclusive; - option.checked = ( nControlState & CTRL_STATE_PRESSED ); + option.checked = ( nControlState & ControlState::PRESSED ); // widgetRect is now the rectangle for the checkbox/radiobutton itself, but Qt // paints the whole menu item, so translate position (and it'll be clipped); // it is also necessary to fill the background transparently first, as this @@ -484,7 +484,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, option.pageStep = sbVal->mnVisibleSize; //setup the active control...always the slider - if (sbVal->mnThumbState & CTRL_STATE_ROLLOVER) + if (sbVal->mnThumbState & ControlState::ROLLOVER) option.activeSubControls = QStyle::SC_ScrollBarSlider; draw( QStyle::CC_ScrollBar, &option, m_image, @@ -503,9 +503,9 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, if( value.getType() == CTRL_SPINBUTTONS ) { const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue *>(&value); - if( (pSpinVal->mnUpperState & CTRL_STATE_PRESSED) ) + if( (pSpinVal->mnUpperState & ControlState::PRESSED) ) option.activeSubControls |= QStyle::SC_SpinBoxUp; - if( (pSpinVal->mnLowerState & CTRL_STATE_PRESSED) ) + if( (pSpinVal->mnLowerState & ControlState::PRESSED) ) option.activeSubControls |= QStyle::SC_SpinBoxDown; } @@ -671,7 +671,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, { styleOption.state = vclStateValue2StateFlag(controlState, val); - if ( controlState & CTRL_STATE_DEFAULT ) + if ( controlState & ControlState::DEFAULT ) { int size = QApplication::style()->pixelMetric( QStyle::PM_ButtonDefaultIndicator, &styleOption ); diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx index 67c5a75c14e5..a8d21ff6f1fb 100644 --- a/vcl/win/source/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx @@ -391,11 +391,11 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, if( nControlPart == PART_BUTTON_DOWN ) { *pLunaPart = SPNP_DOWN; - if( rState & CTRL_STATE_PRESSED ) + if( rState & ControlState::PRESSED ) *pLunaState = DNS_PRESSED; - else if( !(rState & CTRL_STATE_ENABLED) ) + else if( !(rState & ControlState::ENABLED) ) *pLunaState = DNS_DISABLED; - else if( rState & CTRL_STATE_ROLLOVER ) + else if( rState & ControlState::ROLLOVER ) *pLunaState = DNS_HOT; else *pLunaState = DNS_NORMAL; @@ -403,11 +403,11 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, if( nControlPart == PART_BUTTON_UP ) { *pLunaPart = SPNP_UP; - if( rState & CTRL_STATE_PRESSED ) + if( rState & ControlState::PRESSED ) *pLunaState = UPS_PRESSED; - else if( !(rState & CTRL_STATE_ENABLED) ) + else if( !(rState & ControlState::ENABLED) ) *pLunaState = UPS_DISABLED; - else if( rState & CTRL_STATE_ROLLOVER ) + else if( rState & ControlState::ROLLOVER ) *pLunaState = UPS_HOT; else *pLunaState = UPS_NORMAL; @@ -415,11 +415,11 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, if( nControlPart == PART_BUTTON_RIGHT ) { *pLunaPart = SPNP_UPHORZ; - if( rState & CTRL_STATE_PRESSED ) + if( rState & ControlState::PRESSED ) *pLunaState = DNHZS_PRESSED; - else if( !(rState & CTRL_STATE_ENABLED) ) + else if( !(rState & ControlState::ENABLED) ) *pLunaState = DNHZS_DISABLED; - else if( rState & CTRL_STATE_ROLLOVER ) + else if( rState & ControlState::ROLLOVER ) *pLunaState = DNHZS_HOT; else *pLunaState = DNHZS_NORMAL; @@ -427,11 +427,11 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, if( nControlPart == PART_BUTTON_LEFT ) { *pLunaPart = SPNP_DOWNHORZ; - if( rState & CTRL_STATE_PRESSED ) + if( rState & ControlState::PRESSED ) *pLunaState = UPHZS_PRESSED; - else if( !(rState & CTRL_STATE_ENABLED) ) + else if( !(rState & ControlState::ENABLED) ) *pLunaState = UPHZS_DISABLED; - else if( rState & CTRL_STATE_ROLLOVER ) + else if( rState & ControlState::ROLLOVER ) *pLunaState = UPHZS_HOT; else *pLunaState = UPHZS_NORMAL; @@ -539,11 +539,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_UP ) { iPart = SBP_ARROWBTN; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = ABS_UPPRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = ABS_UPDISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = ABS_UPHOT; else iState = ABS_UPNORMAL; @@ -553,11 +553,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_DOWN ) { iPart = SBP_ARROWBTN; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = ABS_DOWNPRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = ABS_DOWNDISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = ABS_DOWNHOT; else iState = ABS_DOWNNORMAL; @@ -567,11 +567,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_LEFT ) { iPart = SBP_ARROWBTN; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = ABS_LEFTPRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = ABS_LEFTDISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = ABS_LEFTHOT; else iState = ABS_LEFTNORMAL; @@ -581,11 +581,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_RIGHT ) { iPart = SBP_ARROWBTN; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = ABS_RIGHTPRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = ABS_RIGHTDISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = ABS_RIGHTHOT; else iState = ABS_RIGHTNORMAL; @@ -595,11 +595,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT ) { iPart = (nPart == PART_THUMB_HORZ) ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = SCRBS_PRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = SCRBS_DISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = SCRBS_HOT; else iState = SCRBS_NORMAL; @@ -630,11 +630,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, case PART_TRACK_VERT_LOWER: iPart = SBP_LOWERTRACKVERT; break; } - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = SCRBS_PRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = SCRBS_DISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = SCRBS_HOT; else iState = SCRBS_NORMAL; @@ -689,11 +689,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_DOWN ) { iPart = SPNP_DOWN; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = DNS_PRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = DNS_DISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = DNS_HOT; else iState = DNS_NORMAL; @@ -701,11 +701,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_UP ) { iPart = SPNP_UP; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = UPS_PRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = UPS_DISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = UPS_HOT; else iState = UPS_NORMAL; @@ -713,11 +713,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_RIGHT ) { iPart = SPNP_DOWNHORZ; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = DNHZS_PRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = DNHZS_DISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = DNHZS_HOT; else iState = DNHZS_NORMAL; @@ -725,11 +725,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_LEFT ) { iPart = SPNP_UPHORZ; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = UPHZS_PRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = UPHZS_DISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = UPHZS_HOT; else iState = UPHZS_NORMAL; @@ -742,11 +742,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_DOWN ) { iPart = CP_DROPDOWNBUTTON; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = CBXS_PRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = CBXS_DISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = CBXS_HOT; else iState = CBXS_NORMAL; @@ -756,15 +756,15 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nType == CTRL_PUSHBUTTON ) { iPart = BP_PUSHBUTTON; - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = PBS_PRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = PBS_DISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = PBS_HOT; - else if( nState & CTRL_STATE_DEFAULT ) + else if( nState & ControlState::DEFAULT ) iState = PBS_DEFAULTED; - //else if( nState & CTRL_STATE_FOCUSED ) + //else if( nState & ControlState::FOCUSED ) // iState = PBS_DEFAULTED; // may need to draw focus rect else iState = PBS_NORMAL; @@ -777,16 +777,16 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, iPart = BP_RADIOBUTTON; bool bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON ); - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = bChecked ? RBS_CHECKEDPRESSED : RBS_UNCHECKEDPRESSED; - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = bChecked ? RBS_CHECKEDDISABLED : RBS_UNCHECKEDDISABLED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = bChecked ? RBS_CHECKEDHOT : RBS_UNCHECKEDHOT; else iState = bChecked ? RBS_CHECKEDNORMAL : RBS_UNCHECKEDNORMAL; - //if( nState & CTRL_STATE_FOCUSED ) + //if( nState & ControlState::FOCUSED ) // iState |= PBS_DEFAULTED; // may need to draw focus rect return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); @@ -797,20 +797,20 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, iPart = BP_CHECKBOX; ButtonValue v = aValue.getTristateVal(); - if( nState & CTRL_STATE_PRESSED ) + if( nState & ControlState::PRESSED ) iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDPRESSED : ( (v == BUTTONVALUE_OFF) ? CBS_UNCHECKEDPRESSED : CBS_MIXEDPRESSED ); - else if( !(nState & CTRL_STATE_ENABLED) ) + else if( !(nState & ControlState::ENABLED) ) iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDDISABLED : ( (v == BUTTONVALUE_OFF) ? CBS_UNCHECKEDDISABLED : CBS_MIXEDDISABLED ); - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDHOT : ( (v == BUTTONVALUE_OFF) ? CBS_UNCHECKEDHOT : CBS_MIXEDHOT ); else iState = (v == BUTTONVALUE_ON) ? CBS_CHECKEDNORMAL : ( (v == BUTTONVALUE_OFF) ? CBS_UNCHECKEDNORMAL : CBS_MIXEDNORMAL ); - //if( nState & CTRL_STATE_FOCUSED ) + //if( nState & ControlState::FOCUSED ) // iState |= PBS_DEFAULTED; // may need to draw focus rect //SIZE sz; @@ -823,11 +823,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( ( nType == CTRL_EDITBOX ) || ( nType == CTRL_MULTILINE_EDITBOX ) ) { iPart = EP_EDITTEXT; - if( !(nState & CTRL_STATE_ENABLED) ) + if( !(nState & ControlState::ENABLED) ) iState = ETS_DISABLED; - else if( nState & CTRL_STATE_FOCUSED ) + else if( nState & ControlState::FOCUSED ) iState = ETS_FOCUSED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = ETS_HOT; else iState = ETS_NORMAL; @@ -875,9 +875,9 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, iPart = TABP_TABITEMRIGHTEDGE; else iPart = TABP_TABITEM; - if( !(nState & CTRL_STATE_ENABLED) ) + if( !(nState & ControlState::ENABLED) ) iState = TILES_DISABLED; - else if( nState & CTRL_STATE_SELECTED ) + else if( nState & ControlState::SELECTED ) { iState = TILES_SELECTED; // increase the selected tab @@ -892,9 +892,9 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, rc.top-=2; rc.bottom+=2; } - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = TILES_HOT; - else if( nState & CTRL_STATE_FOCUSED ) + else if( nState & ControlState::FOCUSED ) iState = TILES_FOCUSED; // may need to draw focus rect else iState = TILES_NORMAL; @@ -907,14 +907,14 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, { iPart = TP_BUTTON; bool bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON ); - if( !(nState & CTRL_STATE_ENABLED) ) + if( !(nState & ControlState::ENABLED) ) //iState = TS_DISABLED; // disabled buttons are typically not painted at all but we need visual // feedback when travelling by keyboard over disabled entries iState = TS_HOT; - else if( nState & CTRL_STATE_PRESSED ) + else if( nState & ControlState::PRESSED ) iState = TS_PRESSED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = bChecked ? TS_HOTCHECKED : TS_HOT; else iState = bChecked ? TS_CHECKED : TS_NORMAL; @@ -967,20 +967,20 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, } else if( nPart == PART_MENU_ITEM ) { - if( nState & CTRL_STATE_ENABLED ) + if( nState & ControlState::ENABLED ) { - if( nState & CTRL_STATE_SELECTED ) + if( nState & ControlState::SELECTED ) iState = MBI_PUSHED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = MBI_HOT; else iState = MBI_NORMAL; } else { - if( nState & CTRL_STATE_SELECTED ) + if( nState & ControlState::SELECTED ) iState = MBI_DISABLEDPUSHED; - else if( nState & CTRL_STATE_ROLLOVER ) + else if( nState & ControlState::ROLLOVER ) iState = MBI_DISABLEDHOT; else iState = MBI_DISABLED; @@ -1040,7 +1040,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, aThumbRect.right = pVal->maThumbRect.Right(); aThumbRect.bottom = pVal->maThumbRect.Bottom(); iPart = (nPart == PART_TRACK_HORZ_AREA) ? TKP_THUMB : TKP_THUMBVERT; - iState = (nState & CTRL_STATE_ENABLED) ? TUS_NORMAL : TUS_DISABLED; + iState = (nState & ControlState::ENABLED) ? TUS_NORMAL : TUS_DISABLED; return ImplDrawTheme( hTheme, hDC, iPart, iState, aThumbRect, aCaption ); } @@ -1089,15 +1089,15 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, } else if( nPart == PART_MENU_ITEM ) { - if( (nState & CTRL_STATE_ENABLED) ) - iState = (nState & CTRL_STATE_SELECTED) ? MPI_HOT : MPI_NORMAL; + if( (nState & ControlState::ENABLED) ) + iState = (nState & ControlState::SELECTED) ? MPI_HOT : MPI_NORMAL; else - iState = (nState & CTRL_STATE_SELECTED) ? MPI_DISABLEDHOT : MPI_DISABLED; + iState = (nState & ControlState::SELECTED) ? MPI_DISABLEDHOT : MPI_DISABLED; return ImplDrawTheme( hTheme, hDC, MENU_POPUPITEM, iState, rc, aCaption ); } else if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK ) { - if( (nState & CTRL_STATE_PRESSED) ) + if( (nState & ControlState::PRESSED) ) { RECT aBGRect = rc; if( aValue.getType() == CTRL_MENU_POPUP ) @@ -1117,12 +1117,12 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, } rc = aBGRect; } - iState = (nState & CTRL_STATE_ENABLED) ? MCB_NORMAL : MCB_DISABLED; + iState = (nState & ControlState::ENABLED) ? MCB_NORMAL : MCB_DISABLED; ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECKBACKGROUND, iState, aBGRect, aCaption ); if( nPart == PART_MENU_ITEM_CHECK_MARK ) - iState = (nState & CTRL_STATE_ENABLED) ? MC_CHECKMARKNORMAL : MC_CHECKMARKDISABLED; + iState = (nState & ControlState::ENABLED) ? MC_CHECKMARKNORMAL : MC_CHECKMARKDISABLED; else - iState = (nState & CTRL_STATE_ENABLED) ? MC_BULLETNORMAL : MC_BULLETDISABLED; + iState = (nState & ControlState::ENABLED) ? MC_BULLETNORMAL : MC_BULLETDISABLED; return ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECK, iState, rc, aCaption ); } else @@ -1501,7 +1501,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, if ( pValue->isBothAligned() ) --aControlRect.Right(); - if ( nState & CTRL_STATE_SELECTED ) + if ( nState & ControlState::SELECTED ) { aControlRect.Left() -= 2; if ( pValue && !pValue->isBothAligned() ) |