diff options
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/button.cxx | 76 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 8 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 12 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 10 | ||||
-rw-r--r-- | vcl/source/control/scrbar.cxx | 74 | ||||
-rw-r--r-- | vcl/source/control/slider.cxx | 8 | ||||
-rw-r--r-- | vcl/source/control/spinfld.cxx | 38 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 20 |
9 files changed, 124 insertions, 124 deletions
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 ); |