diff options
43 files changed, 792 insertions, 811 deletions
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 9f95e0311ca8..d5980604b319 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -620,7 +620,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang //native drawing // in case of native controls we need to draw directly to the window - if (pSpl->_bNativeProgress && rRenderContext.IsNativeControlSupported(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL)) + if (pSpl->_bNativeProgress && rRenderContext.IsNativeControlSupported(ControlType::IntroProgress, PART_ENTIRE_CONTROL)) { rRenderContext.DrawBitmapEx(Point(), pSpl->_aIntroBmp); @@ -628,7 +628,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang Rectangle aDrawRect( Point(pSpl->_tlx, pSpl->_tly), Size( pSpl->_barwidth, pSpl->_barheight)); Rectangle aNativeControlRegion, aNativeContentRegion; - if (rRenderContext.GetNativeControlRegion(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect, + if (rRenderContext.GetNativeControlRegion(ControlType::IntroProgress, PART_ENTIRE_CONTROL, aDrawRect, ControlState::ENABLED, aValue, OUString(), aNativeControlRegion, aNativeContentRegion)) { @@ -637,7 +637,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang aDrawRect.Bottom() += (nProgressHeight - pSpl->_barheight)/2; } - if ((rRenderContext.DrawNativeControl(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect, + if ((rRenderContext.DrawNativeControl(ControlType::IntroProgress, PART_ENTIRE_CONTROL, aDrawRect, ControlState::ENABLED, aValue, pSpl->_sProgressText))) { return; diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index d203bf731f11..722a25855e20 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -137,7 +137,7 @@ protected: SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle ); SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, bool bPaint = true ); - SAL_DLLPRIVATE int ImplGetNativeControlType() const; + SAL_DLLPRIVATE ControlType ImplGetNativeControlType() const; SAL_DLLPRIVATE long ImplGetExtraXOffset() const; SAL_DLLPRIVATE long ImplGetExtraYOffset() const; static SAL_DLLPRIVATE void ImplInvalidateOutermostBorder( vcl::Window* pWin ); diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx index 88f1ae0cb89b..7c2ce42cde22 100644 --- a/include/vcl/salnativewidgets.hxx +++ b/include/vcl/salnativewidgets.hxx @@ -32,111 +32,86 @@ * control if it were composite). */ -typedef sal_uInt32 ControlType; - +enum class ControlType { // for use in general purpose ImplControlValue -#define CTRL_GENERIC 0 - + Generic = 0, // Normal PushButton/Command Button -#define CTRL_PUSHBUTTON 1 - + Pushbutton = 1, // Normal single radio button -#define CTRL_RADIOBUTTON 2 - + Radiobutton = 2, // Normal single checkbox -#define CTRL_CHECKBOX 10 - + Checkbox = 10, // Combobox, i.e. a ListBox // that allows data entry by user -#define CTRL_COMBOBOX 20 - + Combobox = 20, // Control that allows text entry -#define CTRL_EDITBOX 30 - + Editbox = 30, // Control that allows text entry, but without the usual border // Has to be handled separately, because this one cannot handle // HAS_BACKGROUND_TEXTURE, which is drawn in the edit box'es // border window. -#define CTRL_EDITBOX_NOBORDER 31 - + EditboxNoBorder = 31, // Control that allows text entry // ( some systems distinguish between single and multi line edit boxes ) -#define CTRL_MULTILINE_EDITBOX 32 - + MultilineEditbox = 32, // Control that pops up a menu, // but does NOT allow data entry -#define CTRL_LISTBOX 35 - + Listbox = 35, // An edit field together with two little // buttons on the side (aka spin field) -#define CTRL_SPINBOX 40 - + Spinbox = 40, // Two standalone spin buttons // without an edit field -#define CTRL_SPINBUTTONS 45 - + SpinButtons = 45, // A single tab -#define CTRL_TAB_ITEM 50 - + TabItem = 50, // The border around a tab area, // but without the tabs themselves. // May have a gap at the top for // the active tab -#define CTRL_TAB_PANE 55 - + TabPane = 55, // The background to the tab area -#define CTRL_TAB_HEADER 56 - + TabHeader = 56, // Background of a Tab Pane -#define CTRL_TAB_BODY 57 - + TabBody = 57, // Normal scrollbar, including // all parts like slider, buttons -#define CTRL_SCROLLBAR 60 - -#define CTRL_SLIDER 65 - + Scrollbar = 60, + Slider = 65, // Border around a group of related // items, perhaps also displaying // a label of identification -#define CTRL_GROUPBOX 70 - + Groupbox = 70, // A separator line -#define CTRL_FIXEDLINE 80 - + Fixedline = 80, // A toolbar control with buttons and a grip -#define CTRL_TOOLBAR 100 - + Toolbar = 100, // The menubar -#define CTRL_MENUBAR 120 + Menubar = 120, // popup menu -#define CTRL_MENU_POPUP 121 - -#define CTRL_PROGRESS 131 + MenuPopup = 121, + Progress = 131, // Progress bar for the intro window // (aka splash screen), in case some // wants native progress bar in the // application but not for the splash // screen (used in desktop/) -#define CTRL_INTROPROGRESS 132 - + IntroProgress = 132, // tool tips -#define CTRL_TOOLTIP 140 - + Tooltip = 140, // to draw the implemented theme -#define CTRL_WINDOW_BACKGROUND 150 - + WindowBackground = 150, //to draw border of frames natively -#define CTRL_FRAME 160 - + Frame = 160, // for nodes in listviews // used in svtools/source/contnr/svtreebx.cxx -#define CTRL_LISTNODE 170 + ListNode = 170, // nets between elements of listviews // with nodes -#define CTRL_LISTNET 171 + ListNet = 171, // for list headers -#define CTRL_LISTHEADER 172 + ListHeader = 172, +}; /* Control Parts: @@ -282,20 +257,20 @@ public: { switch(mnType) { - case CTRL_CHECKBOX: - case CTRL_RADIOBUTTON: - case CTRL_LISTNODE: - case CTRL_SLIDER: - case CTRL_PROGRESS: + case ControlType::Checkbox: + case ControlType::Radiobutton: + case ControlType::ListNode: + case ControlType::Slider: + case ControlType::Progress: // FIXME: these guys have complex state hidden in ImplControlValue // structs which affects rendering, needs to be a and needs to be // part of the key to our cache. - case CTRL_SPINBOX: - case CTRL_SPINBUTTONS: - case CTRL_TAB_ITEM: + case ControlType::Spinbox: + case ControlType::SpinButtons: + case ControlType::TabItem: return false; - case CTRL_MENUBAR: + case ControlType::Menubar: if (mnPart == PART_ENTIRE_CONTROL) return false; break; @@ -342,11 +317,11 @@ class VCL_DLLPUBLIC ImplControlValue public: explicit ImplControlValue( ButtonValue nTristate ) - : mType( CTRL_GENERIC ), mTristate(nTristate), mNumber(0) {} + : mType( ControlType::Generic ), mTristate(nTristate), mNumber(0) {} explicit ImplControlValue( long nNumeric ) - : mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric) {} + : mType( ControlType::Generic ), mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric) {} inline ImplControlValue() - : mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber(0) {} + : mType( ControlType::Generic ), mTristate(BUTTONVALUE_DONTKNOW), mNumber(0) {} virtual ~ImplControlValue(); @@ -382,7 +357,7 @@ class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue ControlState mnPage2State; inline ScrollbarValue() - : ImplControlValue( CTRL_SCROLLBAR, 0 ) + : ImplControlValue( ControlType::Scrollbar, 0 ) { mnMin = 0; mnMax = 0; mnCur = 0; mnVisibleSize = 0; mnButton1State = ControlState::NONE; mnButton2State = ControlState::NONE; @@ -402,7 +377,7 @@ class VCL_DLLPUBLIC SliderValue : public ImplControlValue ControlState mnThumbState; SliderValue() - : ImplControlValue( CTRL_SLIDER, 0 ) + : ImplControlValue( ControlType::Slider, 0 ) , mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( ControlState::NONE ) {} virtual ~SliderValue(); @@ -435,7 +410,7 @@ class VCL_DLLPUBLIC TabitemValue : public ImplControlValue Rectangle maContentRect; TabitemValue(const Rectangle &rContentRect) - : ImplControlValue( CTRL_TAB_ITEM, 0 ) + : ImplControlValue( ControlType::TabItem, 0 ) , mnAlignment(TabitemFlags::NONE) , maContentRect(rContentRect) { @@ -469,7 +444,7 @@ class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue int mnLowerPart; SpinbuttonValue() - : ImplControlValue( CTRL_SPINBUTTONS, 0 ) + : ImplControlValue( ControlType::SpinButtons, 0 ) , mnUpperState(ControlState::NONE) , mnLowerState(ControlState::NONE) , mnUpperPart(0) @@ -488,7 +463,7 @@ class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue class VCL_DLLPUBLIC ToolbarValue : public ImplControlValue { public: - ToolbarValue() : ImplControlValue( CTRL_TOOLBAR, 0 ) + ToolbarValue() : ImplControlValue( ControlType::Toolbar, 0 ) { mbIsTopDockingArea = false; } virtual ~ToolbarValue(); virtual ToolbarValue* clone() const override; @@ -504,7 +479,7 @@ public: class VCL_DLLPUBLIC MenubarValue : public ImplControlValue { public: - MenubarValue() : ImplControlValue( CTRL_MENUBAR, 0 ) + MenubarValue() : ImplControlValue( ControlType::Menubar, 0 ) { maTopDockingAreaHeight=0; } virtual ~MenubarValue(); virtual MenubarValue* clone() const override; @@ -520,7 +495,7 @@ class VCL_DLLPUBLIC MenupopupValue : public ImplControlValue { public: MenupopupValue( long i_nGutterWidth, const Rectangle& i_rItemRect ) - : ImplControlValue( CTRL_MENU_POPUP, i_nGutterWidth ) + : ImplControlValue( ControlType::MenuPopup, i_nGutterWidth ) , maItemRect( i_rItemRect ) {} virtual ~MenupopupValue(); @@ -536,7 +511,7 @@ class VCL_DLLPUBLIC PushButtonValue : public ImplControlValue { public: PushButtonValue() - : ImplControlValue( CTRL_PUSHBUTTON, 0 ) + : ImplControlValue( ControlType::Pushbutton, 0 ) , mbBevelButton( false ), mbSingleLine( true ) {} virtual ~PushButtonValue(); virtual PushButtonValue* clone() const override; diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index dc46535a8ee9..904c4651af9a 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -102,7 +102,7 @@ enum ScNameInputType ScTextWndBase::ScTextWndBase( vcl::Window* pParent, WinBits nStyle ) : Window ( pParent, nStyle ) { - if ( IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) ) + if ( IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) ) { SetType( WINDOW_CALCINPUTLINE ); SetBorderStyle( WindowBorderStyle::NWF ); diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 2bf014a9ff09..ec519677f6b5 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -251,10 +251,10 @@ void ScMenuFloatingWindow::Paint(vcl::RenderContext& rRenderContext, const Recta // Window background bool bNativeDrawn = true; - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL)) { rRenderContext.SetClipRegion(); - bNativeDrawn = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, + bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, ImplControlValue(), OUString()); } else @@ -384,26 +384,26 @@ void ScMenuFloatingWindow::drawSeparator(vcl::RenderContext& rRenderContext, siz getMenuItemPosSize(nPos, aPos, aSize); Rectangle aRegion(aPos,aSize); - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL)) { rRenderContext.Push(PushFlags::CLIPREGION); rRenderContext.IntersectClipRegion(aRegion); Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel()); - rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, + rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, ImplControlValue(), OUString()); rRenderContext.Pop(); } bool bNativeDrawn = false; - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SEPARATOR)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_SEPARATOR)) { ControlState nState = ControlState::NONE; const MenuItemData& rData = maMenuItems[nPos]; if (rData.mbEnabled) nState |= ControlState::ENABLED; - bNativeDrawn = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_SEPARATOR, + bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_SEPARATOR, aRegion, nState, ImplControlValue(), OUString()); } @@ -677,23 +677,23 @@ void ScMenuFloatingWindow::highlightMenuItem(vcl::RenderContext& rRenderContext, getMenuItemPosSize(nPos, aPos, aSize); Rectangle aRegion(aPos,aSize); - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL)) { rRenderContext.Push(PushFlags::CLIPREGION); rRenderContext.IntersectClipRegion(Rectangle(aPos, aSize)); Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel()); - rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, + rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, ImplControlValue(), OUString()); rRenderContext.Pop(); } bool bNativeDrawn = true; - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM)) { ControlState nState = bSelected ? ControlState::SELECTED : ControlState::NONE; if (maMenuItems[nPos].mbEnabled) nState |= ControlState::ENABLED; - bNativeDrawn = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_ITEM, + bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_ITEM, aRegion, nState, ImplControlValue(), OUString()); } else diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index fd412c930640..10e0cd7b468f 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1026,11 +1026,11 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext) // for platforms that don't have nets, DrawNativeControl does nothing and returns true // so that SvImpLBox::DrawNet() doesn't draw anything either - if (rRenderContext.IsNativeControlSupported(CTRL_LISTNET, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::ListNet, PART_ENTIRE_CONTROL)) { ImplControlValue aControlValue; ControlState nState = ControlState::ENABLED; - if (rRenderContext.DrawNativeControl(CTRL_LISTNET, PART_ENTIRE_CONTROL, + if (rRenderContext.DrawNativeControl(ControlType::ListNet, PART_ENTIRE_CONTROL, Rectangle(), nState, aControlValue, OUString())) { return; diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 353ff604882d..341827fd2615 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -337,7 +337,7 @@ void SvLBoxButton::Paint( //Native drawing bool bNativeOK = false; - ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX; + ControlType eCtrlType = (pData->IsRadio())? ControlType::Radiobutton : ControlType::Checkbox; if ( nIndex != SvBmp::STATICIMAGE && rRenderContext.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) ) { @@ -415,7 +415,7 @@ void SvLBoxButton::InitViewData(SvTreeListBox* pView,SvTreeListEntry* pEntry, Sv pViewData = pView->GetViewDataItem( pEntry, this ); Size aSize( pData->Width(), pData->Height() ); - ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX; + ControlType eCtrlType = (pData->IsRadio())? ControlType::Radiobutton : ControlType::Checkbox; if ( eKind != SvLBoxButtonKind::StaticImage && pView ) ImplAdjustBoxSize(aSize, eCtrlType, *pView); pViewData->maSize = aSize; diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index fc7225292953..7a931b840b7c 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -3034,7 +3034,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render //native bool bNativeOK = false; - if (rRenderContext.IsNativeControlSupported(CTRL_LISTNODE, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::ListNode, PART_ENTIRE_CONTROL)) { ImplControlValue aControlValue; Rectangle aCtrlRegion(aPos, pImg->GetSizePixel()); @@ -3059,7 +3059,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render } } - bNativeOK = rRenderContext.DrawNativeControl(CTRL_LISTNODE, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString()); + bNativeOK = rRenderContext.DrawNativeControl(ControlType::ListNode, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString()); } if (!bNativeOK) diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index c7ffa20a97d0..cd35991e4179 100644 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -310,10 +310,10 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos HeaderBarItemBits nBits = pItem->mnBits; const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); - if (rRenderContext.IsNativeControlSupported(CTRL_WINDOW_BACKGROUND, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, PART_ENTIRE_CONTROL)) { aCtrlRegion = aRect; - rRenderContext.DrawNativeControl(CTRL_WINDOW_BACKGROUND, PART_ENTIRE_CONTROL, + rRenderContext.DrawNativeControl(ControlType::WindowBackground, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString()); } @@ -332,14 +332,14 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos Color aSelectionTextColor(COL_TRANSPARENT); - if (rRenderContext.IsNativeControlSupported(CTRL_LISTHEADER, PART_BUTTON)) + if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, PART_BUTTON)) { aCtrlRegion = aRect; aControlValue.setTristateVal(BUTTONVALUE_ON); nState |= ControlState::ENABLED; if (bHigh) nState |= ControlState::PRESSED; - rRenderContext.DrawNativeControl(CTRL_LISTHEADER, PART_BUTTON, + rRenderContext.DrawNativeControl(ControlType::ListHeader, PART_BUTTON, aCtrlRegion, nState, aControlValue, OUString()); } else @@ -553,7 +553,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos if (bDraw) { - if (rRenderContext.IsNativeControlSupported(CTRL_LISTHEADER, PART_ARROW)) + if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, PART_ARROW)) { aCtrlRegion = Rectangle(Point(nArrowX, aRect.Top()), Size(nArrowWidth, aRect.GetHeight())); // control value passes 1 if arrow points down, 0 otherwise @@ -561,7 +561,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos nState |= ControlState::ENABLED; if (bHigh) nState |= ControlState::PRESSED; - rRenderContext.DrawNativeControl(CTRL_LISTHEADER, PART_ARROW, aCtrlRegion, + rRenderContext.DrawNativeControl(ControlType::ListHeader, PART_ARROW, aCtrlRegion, nState, aControlValue, OUString()); } else diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index faa4ebf935f1..c9859e7b93d5 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -1187,9 +1187,9 @@ void TabBar::MouseButtonUp(const MouseEvent& rMEvt) void TabBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rect) { - if (rRenderContext.IsNativeControlSupported(CTRL_WINDOW_BACKGROUND,PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground,PART_ENTIRE_CONTROL)) { - rRenderContext.DrawNativeControl(CTRL_WINDOW_BACKGROUND,PART_ENTIRE_CONTROL,rect, + rRenderContext.DrawNativeControl(ControlType::WindowBackground,PART_ENTIRE_CONTROL,rect, ControlState::ENABLED,ImplControlValue(0),OUString()); } // calculate items and emit diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 4da09d79fa61..c846ef0a99eb 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -545,9 +545,9 @@ static long ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, l Rectangle aNativeContent; Point tmp( 0, 0 ); Rectangle aCtrlRegion( tmp, Size( 100, 15 ) ); - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_CHECK_MARK)) { - if (rRenderContext.GetNativeControlRegion(ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_CHECK_MARK), + if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_CHECK_MARK), aCtrlRegion, ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, aNativeContent) ) @@ -556,9 +556,9 @@ static long ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, l rMaxWidth = aNativeContent.GetWidth(); } } - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_RADIO_MARK)) { - if (rRenderContext.GetNativeControlRegion(ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_RADIO_MARK), + if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_RADIO_MARK), aCtrlRegion, ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, aNativeContent) ) @@ -633,7 +633,7 @@ Size ToolbarMenu::implCalcSize() if( pEntry->HasCheck() && !pEntry->mbHasImage ) { - if (IsNativeControlSupported(CTRL_MENU_POPUP, (pEntry->mnBits & MenuItemBits::RADIOCHECK) + if (IsNativeControlSupported(ControlType::MenuPopup, (pEntry->mnBits & MenuItemBits::RADIOCHECK) ? PART_MENU_ITEM_CHECK_MARK : PART_MENU_ITEM_RADIO_MARK ) ) { @@ -811,19 +811,19 @@ void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHi aItemRect.Right() -= nFontHeight + nFontHeight / 4; } - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL)) { Size aPxSize(GetOutputSizePixel()); rRenderContext.Push(PushFlags::CLIPREGION); rRenderContext.IntersectClipRegion(Rectangle(Point(nX, nY), Size(aSz.Width(), pEntry->maSize.Height()))); Rectangle aCtrlRect(Point(nX, 0), Size(aPxSize.Width() - nX, aPxSize.Height())); - rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, + rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, ImplControlValue(), OUString()); - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM)) { bDrawItemRect = false; ControlState eState = ControlState::SELECTED | (pEntry->mbEnabled ? ControlState::ENABLED : ControlState::NONE); - if (!rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect, + if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_ITEM, aItemRect, eState, ImplControlValue(), OUString())) { bDrawItemRect = true; @@ -1168,14 +1168,14 @@ void ToolbarMenu::KeyInput( const KeyEvent& rKEvent ) static void ImplPaintCheckBackground(vcl::RenderContext& rRenderContext, vcl::Window& rWindow, const Rectangle& i_rRect, bool i_bHighlight ) { bool bNativeOk = false; - if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_BUTTON)) + if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, PART_BUTTON)) { ImplControlValue aControlValue; ControlState nState = ControlState::PRESSED | ControlState::ENABLED; aControlValue.setTristateVal(BUTTONVALUE_ON); - bNativeOk = rRenderContext.DrawNativeControl(CTRL_TOOLBAR, PART_BUTTON, + bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, PART_BUTTON, i_rRect, nState, aControlValue, OUString()); } @@ -1275,7 +1275,7 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry if (!pEntry->mbHasImage) { - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, (pEntry->mnBits & MenuItemBits::RADIOCHECK) ? PART_MENU_ITEM_CHECK_MARK : PART_MENU_ITEM_RADIO_MARK)) @@ -1300,7 +1300,7 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight) / 2; Rectangle aCheckRect(aTmpPos, Size(nCtrlHeight, nCtrlHeight)); - rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, nPart, aCheckRect, + rRenderContext.DrawNativeControl(ControlType::MenuPopup, nPart, aCheckRect, nState, ImplControlValue(), OUString()); aPos.setX(aPos.getX() + nCtrlHeight + gfxExtra); } diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index 757ac2cfe85c..901fbf250d96 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -175,15 +175,15 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n switch( nType ) { - case CTRL_PUSHBUTTON: - case CTRL_RADIOBUTTON: - case CTRL_CHECKBOX: - case CTRL_LISTNODE: + case ControlType::Pushbutton: + case ControlType::Radiobutton: + case ControlType::Checkbox: + case ControlType::ListNode: if( nPart == PART_ENTIRE_CONTROL ) return true; break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT || nPart == PART_ENTIRE_CONTROL || @@ -191,41 +191,41 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n return true; break; - case CTRL_SLIDER: + case ControlType::Slider: if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA ) return true; break; - case CTRL_EDITBOX: + case ControlType::Editbox: if( nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE ) return true; break; - case CTRL_MULTILINE_EDITBOX: + case ControlType::MultilineEditbox: if( nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE ) return true; break; - case CTRL_SPINBOX: + case ControlType::Spinbox: if( nPart == PART_ENTIRE_CONTROL || nPart == PART_ALL_BUTTONS || nPart == HAS_BACKGROUND_TEXTURE ) return true; break; - case CTRL_SPINBUTTONS: + case ControlType::SpinButtons: return false; break; - case CTRL_COMBOBOX: + case ControlType::Combobox: if( nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE ) return true; break; - case CTRL_LISTBOX: + case ControlType::Listbox: if( nPart == PART_ENTIRE_CONTROL || nPart == PART_WINDOW || nPart == HAS_BACKGROUND_TEXTURE || @@ -234,9 +234,9 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n return true; break; - case CTRL_TAB_ITEM: - case CTRL_TAB_PANE: - case CTRL_TAB_BODY: // see vcl/source/window/tabpage.cxx + case ControlType::TabItem: + case ControlType::TabPane: + case ControlType::TabBody: // see vcl/source/window/tabpage.cxx if( nPart == PART_ENTIRE_CONTROL || nPart == PART_TABS_DRAW_RTL || nPart == HAS_BACKGROUND_TEXTURE ) @@ -245,47 +245,48 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n // when PART_BUTTON is used, toolbar icons are not highlighted when mouse rolls over. // More Aqua compliant - case CTRL_TOOLBAR: + case ControlType::Toolbar: if( nPart == PART_ENTIRE_CONTROL || nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT) return true; break; - case CTRL_WINDOW_BACKGROUND: + case ControlType::WindowBackground: if ( nPart == PART_BACKGROUND_WINDOW || nPart == PART_BACKGROUND_DIALOG ) return true; break; - case CTRL_MENUBAR: + case ControlType::Menubar: if( nPart == PART_ENTIRE_CONTROL ) return true; break; - case CTRL_TOOLTIP: // ** TO DO + case ControlType::Tooltip: // ** TO DO break; - case CTRL_MENU_POPUP: + case ControlType::MenuPopup: if( nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM || nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK) return true; break; - case CTRL_PROGRESS: - case CTRL_INTROPROGRESS: + case ControlType::Progress: + case ControlType::IntroProgress: if( nPart == PART_ENTIRE_CONTROL ) return true; break; - case CTRL_FRAME: + case ControlType::Frame: if( nPart == PART_BORDER ) return true; break; - case CTRL_LISTNET: + case ControlType::ListNet: if( nPart == PART_ENTIRE_CONTROL ) return true; break; + default: break; } return bOk; @@ -301,13 +302,13 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, const Point& rPos, bool& rIsInside ) { - if ( nType == CTRL_SCROLLBAR ) + if ( nType == ControlType::Scrollbar ) { Rectangle aRect; bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect ); rIsInside = bValid && aRect.IsInside( rPos ); return bValid; - } // CTRL_SCROLLBAR + } // ControlType::Scrollbar return false; } @@ -380,7 +381,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, switch( nType ) { - case CTRL_COMBOBOX: + case ControlType::Combobox: if ( nPart == HAS_BACKGROUND_TEXTURE || nPart == PART_ENTIRE_CONTROL ) { @@ -399,7 +400,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_TOOLBAR: + case ControlType::Toolbar: { #if HAVE_FEATURE_MACOSX_SANDBOX HIThemeMenuItemDrawInfo aMenuItemDrawInfo; @@ -437,7 +438,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_WINDOW_BACKGROUND: + case ControlType::WindowBackground: { HIThemeBackgroundDrawInfo aThemeBackgroundInfo; aThemeBackgroundInfo.version = 0; @@ -453,8 +454,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_MENUBAR: - case CTRL_MENU_POPUP: + case ControlType::Menubar: + case ControlType::MenuPopup: { if ((nPart == PART_ENTIRE_CONTROL) || (nPart == PART_MENU_ITEM )|| (nPart == HAS_BACKGROUND_TEXTURE )) { @@ -514,7 +515,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_PUSHBUTTON: + case ControlType::Pushbutton: { // [ FIXME] : instead of use a value, vcl can retrieve correct values on the fly (to be implemented) const int PB_Mini_Height = 15; @@ -526,7 +527,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, // no animation aPushInfo.animation.time.start = 0; aPushInfo.animation.time.current = 0; - PushButtonValue const * pPBVal = aValue.getType() == CTRL_PUSHBUTTON ? static_cast<PushButtonValue const *>(&aValue) : nullptr; + PushButtonValue const * pPBVal = aValue.getType() == ControlType::Pushbutton ? static_cast<PushButtonValue const *>(&aValue) : nullptr; int nPaintHeight = static_cast<int>(rc.size.height); if( pPBVal && pPBVal->mbBevelButton ) @@ -576,19 +577,20 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_RADIOBUTTON: - case CTRL_CHECKBOX: + case ControlType::Radiobutton: + case ControlType::Checkbox: { HIThemeButtonDrawInfo aInfo; aInfo.version = 0; switch( nType ) { - case CTRL_RADIOBUTTON: if(rc.size.width >= BUTTON_HEIGHT) aInfo.kind = kThemeRadioButton; + case ControlType::Radiobutton: if(rc.size.width >= BUTTON_HEIGHT) aInfo.kind = kThemeRadioButton; else aInfo.kind = kThemeSmallRadioButton; break; - case CTRL_CHECKBOX: if(rc.size.width >= BUTTON_HEIGHT) aInfo.kind = kThemeCheckBox; + case ControlType::Checkbox: if(rc.size.width >= BUTTON_HEIGHT) aInfo.kind = kThemeCheckBox; else aInfo.kind = kThemeSmallCheckBox; break; + default: break; } aInfo.state = getState( nState ); @@ -606,7 +608,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_LISTNODE: + case ControlType::ListNode: { ButtonValue aButtonValue = aValue.getTristateVal(); @@ -664,8 +666,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_PROGRESS: - case CTRL_INTROPROGRESS: + case ControlType::Progress: + case ControlType::IntroProgress: { long nProgressWidth = aValue.getNumericVal(); HIThemeTrackDrawInfo aTrackInfo; @@ -683,7 +685,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, aTrackInfo.attributes |= kThemeTrackRightToLeft; aTrackInfo.enableState = getTrackState( nState ); // the intro bitmap never gets key anyway; we want to draw that enabled - if( nType == CTRL_INTROPROGRESS ) + if( nType == ControlType::IntroProgress ) aTrackInfo.enableState = kThemeTrackActive; aTrackInfo.filler1 = 0; aTrackInfo.trackInfo.progress.phase = static_cast<UInt8>(CFAbsoluteTimeGetCurrent()*10.0); @@ -693,7 +695,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_SLIDER: + case ControlType::Slider: { SliderValue const * pSLVal = static_cast<SliderValue const *>(&aValue); @@ -723,9 +725,9 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: { - const ScrollbarValue* pScrollbarVal = (aValue.getType() == CTRL_SCROLLBAR) ? static_cast<const ScrollbarValue*>(&aValue) : nullptr; + const ScrollbarValue* pScrollbarVal = (aValue.getType() == ControlType::Scrollbar) ? static_cast<const ScrollbarValue*>(&aValue) : nullptr; if( nPart == PART_DRAW_BACKGROUND_VERT || nPart == PART_DRAW_BACKGROUND_HORZ ) @@ -778,7 +780,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_TAB_PANE: + case ControlType::TabPane: { HIThemeTabPaneDrawInfo aTabPaneDrawInfo; aTabPaneDrawInfo.version = 1; @@ -800,7 +802,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_TAB_ITEM: + case ControlType::TabItem: { HIThemeTabDrawInfo aTabItemDrawInfo; aTabItemDrawInfo.version=1; @@ -852,7 +854,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_LISTBOX: + case ControlType::Listbox: switch( nPart) { case PART_ENTIRE_CONTROL: @@ -892,8 +894,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_EDITBOX: - case CTRL_MULTILINE_EDITBOX: + case ControlType::Editbox: + case ControlType::MultilineEditbox: { HIThemeFrameDrawInfo aTextDrawInfo; aTextDrawInfo.version=0; @@ -919,7 +921,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_SPINBOX: + case ControlType::Spinbox: { if(nPart == PART_ENTIRE_CONTROL) { @@ -945,7 +947,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, if(nState & ControlState::FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); //buttons: - const SpinbuttonValue* pSpinButtonVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue*>(&aValue) : nullptr; + const SpinbuttonValue* pSpinButtonVal = (aValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue*>(&aValue) : nullptr; ControlState nUpperState = ControlState::ENABLED;//state of the upper button ControlState nLowerState = ControlState::ENABLED;//and of the lower button if(pSpinButtonVal) {//pSpinButtonVal is sometimes null @@ -1002,7 +1004,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_FRAME: + case ControlType::Frame: { DrawFrameFlags nStyle = static_cast<DrawFrameFlags>(aValue.getNumericVal()); if( nPart == PART_BORDER ) { @@ -1036,13 +1038,13 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, } break; - case CTRL_LISTNET: + case ControlType::ListNet: { //do nothing as there isn't net for listviews on macos bOK=true; } break; - + default: break; } CGContextRestoreGState( mrContext ); @@ -1054,7 +1056,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, (the background is always drawn as a whole since we don't know anything about its possible contents) */ - if( nType == CTRL_WINDOW_BACKGROUND ) + if( nType == ControlType::WindowBackground ) { CGRect aRect = { { 0, 0 }, { 0, 0 } }; if( mxClipPath ) @@ -1100,7 +1102,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa switch (nType) { - case CTRL_SLIDER: + case ControlType::Slider: { if( nPart == PART_THUMB_HORZ ) { @@ -1119,7 +1121,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa } break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: { Rectangle aRect; if( AquaGetScrollRect( /* m_nScreen */ nPart, aCtrlBoundRect, aRect ) ) @@ -1131,11 +1133,11 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa } break; - case CTRL_PUSHBUTTON: - case CTRL_RADIOBUTTON: - case CTRL_CHECKBOX: + case ControlType::Pushbutton: + case ControlType::Radiobutton: + case ControlType::Checkbox: { - if ( nType == CTRL_PUSHBUTTON ) + if ( nType == ControlType::Pushbutton ) { w = aCtrlBoundRect.GetWidth(); h = aCtrlBoundRect.GetHeight(); @@ -1157,7 +1159,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa toReturn = true; } break; - case CTRL_PROGRESS: + case ControlType::Progress: { Rectangle aRect( aCtrlBoundRect ); if( aRect.GetHeight() < 16 ) @@ -1170,7 +1172,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa } break; - case CTRL_INTROPROGRESS: + case ControlType::IntroProgress: { Rectangle aRect( aCtrlBoundRect ); aRect.Bottom() = aRect.Top() + INTRO_PROGRESS_HEIGHT; // values taken from HIG for medium progress @@ -1180,7 +1182,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa } break; - case CTRL_TAB_ITEM: + case ControlType::TabItem: w = aCtrlBoundRect.GetWidth() + 2*TAB_TEXT_OFFSET - 2*VCL_TAB_TEXT_OFFSET; h = TAB_HEIGHT_NORMAL+2; @@ -1192,7 +1194,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa break; - case CTRL_EDITBOX: + case ControlType::Editbox: { w = aCtrlBoundRect.GetWidth(); if( w < 3+2*FOCUS_RING_WIDTH ) @@ -1207,8 +1209,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa toReturn = true; } break; - case CTRL_LISTBOX: - case CTRL_COMBOBOX: + case ControlType::Listbox: + case ControlType::Combobox: { if( nPart == PART_ENTIRE_CONTROL ) { @@ -1246,7 +1248,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa y += 2; // don't draw into upper border y += FOCUS_RING_WIDTH; w -= 3 + DROPDOWN_BUTTON_WIDTH + 2*FOCUS_RING_WIDTH; - if( nType == CTRL_LISTBOX ) + if( nType == ControlType::Listbox ) w -= 9; // HIG specifies 9 units distance between dropdown button area and content h -= 4; // don't draw into lower border @@ -1257,7 +1259,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa } } break; - case CTRL_SPINBOX: + case ControlType::Spinbox: if( nPart == PART_ENTIRE_CONTROL ) { w = aCtrlBoundRect.GetWidth(); if( w < 3+2*FOCUS_RING_WIDTH+SPIN_BUTTON_SPACE+SPIN_BUTTON_WIDTH ) @@ -1308,7 +1310,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa toReturn = true; } break; - case CTRL_FRAME: + case ControlType::Frame: { DrawFrameStyle nStyle = static_cast<DrawFrameStyle>(aValue.getNumericVal() & 0x000f); DrawFrameFlags nFlags = static_cast<DrawFrameFlags>(aValue.getNumericVal() & 0xfff0); @@ -1339,8 +1341,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa } break; - case CTRL_MENUBAR: - case CTRL_MENU_POPUP: + case ControlType::Menubar: + case ControlType::MenuPopup: { if(( nPart == PART_MENU_ITEM_CHECK_MARK )||( nPart == PART_MENU_ITEM_RADIO_MARK )) { @@ -1354,6 +1356,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa } } break; + default: break; } diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 9b72256e07fc..f9791551bf9a 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -284,7 +284,7 @@ void HelpTextWindow::ApplySettings(vcl::RenderContext& rRenderContext) rRenderContext.SetTextColor(rStyleSettings.GetHelpTextColor()); rRenderContext.SetTextAlign(ALIGN_TOP); - if (rRenderContext.IsNativeControlSupported(CTRL_TOOLTIP, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::Tooltip, PART_ENTIRE_CONTROL)) { EnableChildTransparentMode(); SetParentClipMode(ParentClipMode::NoClip); @@ -369,12 +369,12 @@ void HelpTextWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle& { // paint native background bool bNativeOK = false; - if (rRenderContext.IsNativeControlSupported(CTRL_TOOLTIP, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::Tooltip, PART_ENTIRE_CONTROL)) { // #i46472# workaround gcc3.3 temporary problem Rectangle aCtrlRegion(Point(0, 0), GetOutputSizePixel()); ImplControlValue aControlValue; - bNativeOK = rRenderContext.DrawNativeControl(CTRL_TOOLTIP, PART_ENTIRE_CONTROL, aCtrlRegion, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Tooltip, PART_ENTIRE_CONTROL, aCtrlRegion, ControlState::NONE, aControlValue, OUString()); } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 75e92e58dc27..cef59a47a28e 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -701,7 +701,7 @@ void PushButton::ImplInitSettings( bool bFont, // #i38498#: do not check for GetParent()->IsChildTransparentModeEnabled() // otherwise the formcontrol button will be overdrawn due to ParentClipMode::NoClip // for radio and checkbox this is ok as they should appear transparent in documents - if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) || + if ( IsNativeControlSupported( ControlType::Pushbutton, PART_ENTIRE_CONTROL ) || (GetStyle() & WB_FLATBUTTON) != 0 ) { EnableChildTransparentMode(); @@ -840,7 +840,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl if ( nDrawFlags & DrawFlags::Mono ) aColor = Color( COL_BLACK ); - else if( (nDrawFlags & DrawFlags::NoRollover) && IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL) ) + else if( (nDrawFlags & DrawFlags::NoRollover) && IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL) ) aColor = rStyleSettings.GetButtonRolloverTextColor(); else if ( IsControlForeground() ) aColor = GetControlForeground(); @@ -949,13 +949,13 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) nButtonStyle |= DrawButtonFlags::Pressed; // TODO: move this to Window class or make it a member !!! - ControlType aCtrlType = 0; + ControlType aCtrlType = ControlType::Generic; switch(GetParent()->GetType()) { case WINDOW_LISTBOX: case WINDOW_MULTILISTBOX: case WINDOW_TREELISTBOX: - aCtrlType = CTRL_LISTBOX; + aCtrlType = ControlType::Listbox; break; case WINDOW_COMBOBOX: @@ -966,7 +966,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) case WINDOW_DATEBOX: case WINDOW_TIMEBOX: case WINDOW_LONGCURRENCYBOX: - aCtrlType = CTRL_COMBOBOX; + aCtrlType = ControlType::Combobox; break; default: break; @@ -974,12 +974,12 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) bool bDropDown = (IsSymbol() && (GetSymbol() == SymbolType::SPIN_DOWN) && GetText().isEmpty()); - if( bDropDown && (aCtrlType == CTRL_COMBOBOX || aCtrlType == CTRL_LISTBOX)) + if( bDropDown && (aCtrlType == ControlType::Combobox || aCtrlType == ControlType::Listbox)) { if (GetParent()->IsNativeControlSupported(aCtrlType, PART_ENTIRE_CONTROL)) { // skip painting if the button was already drawn by the theme - if (aCtrlType == CTRL_COMBOBOX) + if (aCtrlType == ControlType::Combobox) { Edit* pEdit = static_cast<Edit*>(GetParent()); if (pEdit->ImplUseNativeBorder(rRenderContext, pEdit->GetStyle())) @@ -993,7 +993,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) if (!bNativeOK && GetParent()->IsNativeControlSupported(aCtrlType, PART_BUTTON_DOWN)) { // let the theme draw it, note we then need support - // for CTRL_LISTBOX/PART_BUTTON_DOWN and CTRL_COMBOBOX/PART_BUTTON_DOWN + // for ControlType::Listbox/PART_BUTTON_DOWN and ControlType::Combobox/PART_BUTTON_DOWN ImplControlValue aControlValue; ControlState nState = ControlState::NONE; @@ -1028,7 +1028,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) if (!bRollOver && !HasFocus()) bDrawMenuSep = false; } - if ((bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL))) + if ((bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL))) { PushButtonValue aControlValue; Rectangle aCtrlRegion(aInRect); @@ -1072,7 +1072,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) if (((nState & ControlState::ROLLOVER)) || !(GetStyle() & WB_FLATBUTTON)) { - bNativeOK = rRenderContext.DrawNativeControl(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, nState, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Pushbutton, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString() /*PushButton::GetText()*/); } else @@ -1123,7 +1123,7 @@ void PushButton::ImplSetDefButton( bool bSet ) int dLeft(0), dRight(0), dTop(0), dBottom(0); bool bSetPos = false; - if ( IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL) ) + if ( IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL) ) { Rectangle aBound, aCont; Rectangle aCtrlRect( 0, 0, 80, 20 ); // use a constant size to avoid accumulating @@ -1134,7 +1134,7 @@ void PushButton::ImplSetDefButton( bool bSet ) // get native size of a 'default' button // and adjust the VCL button if more space for adornment is required - if( GetNativeControlRegion( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, + if( GetNativeControlRegion( ControlType::Pushbutton, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString(), aBound, aCont ) ) { @@ -1494,13 +1494,13 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt ) // trigger redraw as mouse over state has changed // TODO: move this to Window class or make it a member !!! - ControlType aCtrlType = 0; + ControlType aCtrlType = ControlType::Generic; switch( GetParent()->GetType() ) { case WINDOW_LISTBOX: case WINDOW_MULTILISTBOX: case WINDOW_TREELISTBOX: - aCtrlType = CTRL_LISTBOX; + aCtrlType = ControlType::Listbox; break; case WINDOW_COMBOBOX: @@ -1511,7 +1511,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt ) case WINDOW_DATEBOX: case WINDOW_TIMEBOX: case WINDOW_LONGCURRENCYBOX: - aCtrlType = CTRL_COMBOBOX; + aCtrlType = ControlType::Combobox; break; default: break; @@ -1523,7 +1523,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt ) !GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN) ) { vcl::Window *pBorder = GetParent()->GetWindow( GetWindowType::Border ); - if(aCtrlType == CTRL_COMBOBOX) + if(aCtrlType == ControlType::Combobox) { // only paint the button part to avoid flickering of the combobox text Point aPt; @@ -1538,7 +1538,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt ) } } else if( (GetStyle() & WB_FLATBUTTON) || - IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL) ) + IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL) ) { Invalidate(); } @@ -1685,11 +1685,11 @@ bool PushButton::set_property(const OString &rKey, const OString &rValue) void PushButton::ShowFocus(const Rectangle& rRect) { - if (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_FOCUS)) + if (IsNativeControlSupported(ControlType::Pushbutton, PART_FOCUS)) { ImplControlValue aControlValue; Rectangle aInRect(Point(), GetOutputSizePixel()); - GetOutDev()->DrawNativeControl(CTRL_PUSHBUTTON, PART_FOCUS, aInRect, + GetOutDev()->DrawNativeControl(ControlType::Pushbutton, PART_FOCUS, aInRect, ControlState::FOCUSED, aControlValue, OUString()); } Button::ShowFocus(rRect); @@ -1869,13 +1869,13 @@ void RadioButton::ImplInitSettings( bool bFont, { vcl::Window* pParent = GetParent(); if ( !IsControlBackground() && - (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) ) ) + (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( ControlType::Radiobutton, PART_ENTIRE_CONTROL ) ) ) { EnableChildTransparentMode(); SetParentClipMode( ParentClipMode::NoClip ); SetPaintTransparent( true ); SetBackground(); - if( IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) ) + if( IsNativeControlSupported( ControlType::Radiobutton, PART_ENTIRE_CONTROL ) ) mpWindowImpl->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects; } else @@ -1902,7 +1902,7 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext) bool bNativeOK = false; // no native drawing for image radio buttons - if (!maImage && (bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL))) + if (!maImage && (bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Radiobutton, PART_ENTIRE_CONTROL))) { ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF ); Rectangle aCtrlRect(maStateRect.TopLeft(), maStateRect.GetSize()); @@ -1920,7 +1920,7 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext) if (IsMouseOver() && maMouseRect.IsInside(GetPointerPosPixel())) nState |= ControlState::ROLLOVER; - bNativeOK = rRenderContext.DrawNativeControl(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRect, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Radiobutton, PART_ENTIRE_CONTROL, aCtrlRect, nState, aControlValue, OUString()); } @@ -2618,7 +2618,7 @@ bool RadioButton::PreNotify( NotifyEvent& rNEvt ) if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() ) { // trigger redraw if mouse over state has changed - if( IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL) ) + if( IsNativeControlSupported(ControlType::Radiobutton, PART_ENTIRE_CONTROL) ) { if( ( maMouseRect.IsInside( GetPointerPosPixel()) && !maMouseRect.IsInside( GetLastPointerPosPixel()) ) || @@ -2741,7 +2741,7 @@ Size RadioButton::ImplGetRadioImageSize() const { Size aSize; bool bDefaultSize = true; - if( IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) ) + if( IsNativeControlSupported( ControlType::Radiobutton, PART_ENTIRE_CONTROL ) ) { ImplControlValue aControlValue; // #i45896# workaround gcc3.3 temporary problem @@ -2750,7 +2750,7 @@ Size RadioButton::ImplGetRadioImageSize() const Rectangle aBoundingRgn, aContentRgn; // get native size of a radio button - if( GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, + if( GetNativeControlRegion( ControlType::Radiobutton, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { @@ -2857,7 +2857,7 @@ void RadioButton::ImplSetMinimumNWFSize() Rectangle aBoundingRgn, aContentRgn; // get native size of a radiobutton - if( GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, + if( GetNativeControlRegion( ControlType::Radiobutton, PART_ENTIRE_CONTROL, aCtrlRegion, ControlState::DEFAULT|ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { @@ -2921,7 +2921,7 @@ Size RadioButton::GetOptimalSize() const void RadioButton::ShowFocus(const Rectangle& rRect) { - if (IsNativeControlSupported(CTRL_RADIOBUTTON, PART_FOCUS)) + if (IsNativeControlSupported(ControlType::Radiobutton, PART_FOCUS)) { ImplControlValue aControlValue; Rectangle aInRect(Point(0, 0), GetSizePixel()); @@ -2934,7 +2934,7 @@ void RadioButton::ShowFocus(const Rectangle& rRect) aInRect.Top()-=2; aInRect.Bottom()+=2; - DrawNativeControl(CTRL_RADIOBUTTON, PART_FOCUS, aInRect, + DrawNativeControl(ControlType::Radiobutton, PART_FOCUS, aInRect, ControlState::FOCUSED, aControlValue, OUString()); } Button::ShowFocus(rRect); @@ -2984,13 +2984,13 @@ void CheckBox::ImplInitSettings( bool bFont, { vcl::Window* pParent = GetParent(); if ( !IsControlBackground() && - (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) ) ) + (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( ControlType::Checkbox, PART_ENTIRE_CONTROL ) ) ) { EnableChildTransparentMode(); SetParentClipMode( ParentClipMode::NoClip ); SetPaintTransparent( true ); SetBackground(); - if( IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) ) + if( IsNativeControlSupported( ControlType::Checkbox, PART_ENTIRE_CONTROL ) ) ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects; } else @@ -3021,7 +3021,7 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) { bool bNativeOK = true; - if ((bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL))) + if ((bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Checkbox, PART_ENTIRE_CONTROL))) { ImplControlValue aControlValue(meState == TRISTATE_TRUE ? BUTTONVALUE_ON : BUTTONVALUE_OFF); Rectangle aCtrlRegion(maStateRect); @@ -3044,7 +3044,7 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) if (IsMouseOver() && maMouseRect.IsInside(GetPointerPosPixel())) nState |= ControlState::ROLLOVER; - bNativeOK = rRenderContext.DrawNativeControl(CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Checkbox, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString()); } @@ -3555,7 +3555,7 @@ bool CheckBox::PreNotify( NotifyEvent& rNEvt ) if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() ) { // trigger redraw if mouse over state has changed - if( IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL) ) + if( IsNativeControlSupported(ControlType::Checkbox, PART_ENTIRE_CONTROL) ) { if( ( maMouseRect.IsInside( GetPointerPosPixel()) && !maMouseRect.IsInside( GetLastPointerPosPixel()) ) || @@ -3621,7 +3621,7 @@ Size CheckBox::ImplGetCheckImageSize() const { Size aSize; bool bDefaultSize = true; - if( IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) ) + if( IsNativeControlSupported( ControlType::Checkbox, PART_ENTIRE_CONTROL ) ) { ImplControlValue aControlValue; // #i45896# workaround gcc3.3 temporary problem @@ -3630,7 +3630,7 @@ Size CheckBox::ImplGetCheckImageSize() const Rectangle aBoundingRgn, aContentRgn; // get native size of a check box - if( GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion, + if( GetNativeControlRegion( ControlType::Checkbox, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { @@ -3716,7 +3716,7 @@ void CheckBox::ImplSetMinimumNWFSize() Rectangle aBoundingRgn, aContentRgn; // get native size of a radiobutton - if( GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion, + if( GetNativeControlRegion( ControlType::Checkbox, PART_ENTIRE_CONTROL, aCtrlRegion, ControlState::DEFAULT|ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { @@ -3772,7 +3772,7 @@ Size CheckBox::GetOptimalSize() const void CheckBox::ShowFocus(const Rectangle& rRect) { - if (IsNativeControlSupported(CTRL_CHECKBOX, PART_FOCUS)) + if (IsNativeControlSupported(ControlType::Checkbox, PART_FOCUS)) { ImplControlValue aControlValue; Rectangle aInRect(Point(0, 0), GetSizePixel()); @@ -3785,7 +3785,7 @@ void CheckBox::ShowFocus(const Rectangle& rRect) aInRect.Top()-=2; aInRect.Bottom()+=2; - DrawNativeControl(CTRL_CHECKBOX, PART_FOCUS, aInRect, + DrawNativeControl(ControlType::Checkbox, PART_FOCUS, aInRect, ControlState::FOCUSED, aControlValue, OUString()); } Button::ShowFocus(rRect); @@ -3852,7 +3852,7 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) will fit into the rectangle occupied by a normal checkbox on all themes. If this does not hold true for some theme, ImplGetCheckImageSize would have to be overridden for DisclosureButton; also GetNativeControlRegion - for CTRL_LISTNODE would have to be implemented and taken into account + for ControlType::ListNode would have to be implemented and taken into account */ Rectangle aStateRect(GetStateRect()); @@ -3870,7 +3870,7 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) if (IsMouseOver() && GetMouseRect().IsInside(GetPointerPosPixel())) nState |= ControlState::ROLLOVER; - if (!rRenderContext.DrawNativeControl(CTRL_LISTNODE, PART_ENTIRE_CONTROL, aCtrlRegion, + if (!rRenderContext.DrawNativeControl(ControlType::ListNode, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString())) { ImplSVCtrlData& rCtrlData(ImplGetSVData()->maCtrlData); diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 3bd8197d13e0..c9f24b0eebfd 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -168,7 +168,7 @@ void ComboBox::ImplCalcEditHeight() Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) ); Rectangle aBoundRegion, aContentRegion; ImplControlValue aControlValue; - ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX; + ControlType aType = IsDropDownBox() ? ControlType::Combobox : ControlType::Editbox; if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL, aCtrlRegion, ControlState::ENABLED, @@ -1069,7 +1069,7 @@ long ComboBox::getMaxWidthScrollBarAndDownButton() const // use the full extent of the control Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); - if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_BUTTON_DOWN, + if ( GetNativeControlRegion(ControlType::Combobox, PART_BUTTON_DOWN, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { nButtonDownWidth = aContent.getWidth(); @@ -1507,7 +1507,7 @@ ComboBoxBounds ComboBox::Impl::calcComboBoxDropDownComponentBounds( // use the full extent of the control Rectangle aArea( aPoint, rBorderOutSz ); - if (m_rThis.GetNativeControlRegion(CTRL_COMBOBOX, PART_BUTTON_DOWN, + if (m_rThis.GetNativeControlRegion(ControlType::Combobox, PART_BUTTON_DOWN, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // convert back from border space to local coordinates @@ -1518,7 +1518,7 @@ ComboBoxBounds ComboBox::Impl::calcComboBoxDropDownComponentBounds( aBounds.aButtonSize = Size(aContent.getWidth(), (nBottom-nTop)); // adjust the size of the edit field - if (m_rThis.GetNativeControlRegion(CTRL_COMBOBOX, PART_SUB_EDIT, + if (m_rThis.GetNativeControlRegion(ControlType::Combobox, PART_SUB_EDIT, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // convert back from border space to local coordinates diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index aab72e8a3af2..7174c758758c 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -443,8 +443,8 @@ long Edit::ImplGetExtraXOffset() const long Edit::ImplGetExtraYOffset() const { long nExtraOffset = 0; - int eCtrlType = ImplGetNativeControlType(); - if (eCtrlType != CTRL_EDITBOX_NOBORDER) + ControlType eCtrlType = ImplGetNativeControlType(); + if (eCtrlType != ControlType::EditboxNoBorder) { // add some space between text entry and border nExtraOffset = 2; @@ -951,9 +951,9 @@ void Edit::ImplSetText( const OUString& rText, const Selection* pNewSelection ) } } -int Edit::ImplGetNativeControlType() const +ControlType Edit::ImplGetNativeControlType() const { - int nCtrl = 0; + ControlType nCtrl = ControlType::Generic; const vcl::Window* pControl = mbIsSubEdit ? GetParent() : this; switch (pControl->GetType()) @@ -966,14 +966,14 @@ int Edit::ImplGetNativeControlType() const case WINDOW_DATEBOX: case WINDOW_TIMEBOX: case WINDOW_LONGCURRENCYBOX: - nCtrl = CTRL_COMBOBOX; + nCtrl = ControlType::Combobox; break; case WINDOW_MULTILINEEDIT: if ( GetWindow( GetWindowType::Border ) != this ) - nCtrl = CTRL_MULTILINE_EDITBOX; + nCtrl = ControlType::MultilineEditbox; else - nCtrl = CTRL_EDITBOX_NOBORDER; + nCtrl = ControlType::EditboxNoBorder; break; case WINDOW_EDIT: @@ -986,18 +986,18 @@ int Edit::ImplGetNativeControlType() const case WINDOW_NUMERICFIELD: case WINDOW_SPINFIELD: if (pControl->GetStyle() & WB_SPIN) - nCtrl = CTRL_SPINBOX; + nCtrl = ControlType::Spinbox; else { if (GetWindow(GetWindowType::Border) != this) - nCtrl = CTRL_EDITBOX; + nCtrl = ControlType::Editbox; else - nCtrl = CTRL_EDITBOX_NOBORDER; + nCtrl = ControlType::EditboxNoBorder; } break; default: - nCtrl = CTRL_EDITBOX; + nCtrl = ControlType::Editbox; } return nCtrl; } @@ -1925,7 +1925,7 @@ void Edit::GetFocus() // check for other platforms that need similar handling if( ImplGetSVData()->maNWFData.mbNoFocusRects && IsNativeWidgetEnabled() && - IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) ) + IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) ) { ImplInvalidateOutermostBorder( mbIsSubEdit ? GetParent() : this ); } @@ -1959,7 +1959,7 @@ void Edit::LoseFocus() // check for other platforms that need similar handling if( ImplGetSVData()->maNWFData.mbNoFocusRects && IsNativeWidgetEnabled() && - IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) ) + IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) ) { ImplInvalidateOutermostBorder( mbIsSubEdit ? GetParent() : this ); } @@ -2400,7 +2400,7 @@ void Edit::Modify() // check for other platforms that need similar handling if( ImplGetSVData()->maNWFData.mbNoFocusRects && IsNativeWidgetEnabled() && - IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) ) + IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) ) { ImplInvalidateOutermostBorder( this ); } @@ -2726,7 +2726,7 @@ void Edit::SetSubEdit(Edit* pEdit) Size Edit::CalcMinimumSizeForText(const OUString &rString) const { - int eCtrlType = ImplGetNativeControlType(); + ControlType eCtrlType = ImplGetNativeControlType(); Size aSize; if (mnWidthInChars != -1) diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index d81e5b56ab5b..669078b185b9 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -51,8 +51,8 @@ void ImplInitDropDownButton( PushButton* pButton ) { pButton->SetSymbol( SymbolType::SPIN_DOWN ); - if ( pButton->IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) - && ! pButton->IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) ) + if ( pButton->IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL) + && ! pButton->IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) ) pButton->SetBackground(); } @@ -2572,8 +2572,8 @@ void ImplListBox::SetEdgeBlending(bool bNew) ImplWin::ImplWin( vcl::Window* pParent, WinBits nWinStyle ) : Control ( pParent, nWinStyle ) { - if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) - && ! IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) ) + if ( IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL) + && ! IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) ) SetBackground(); else SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) ); @@ -2616,8 +2616,8 @@ bool ImplWin::PreNotify( NotifyEvent& rNEvt ) if( pMouseEvt->IsEnterWindow() || pMouseEvt->IsLeaveWindow() ) { // trigger redraw as mouse over state has changed - if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) - && ! IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) ) + if ( IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL) + && ! IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) ) { GetParent()->GetWindow( GetWindowType::Border )->Invalidate( InvalidateFlags::NoErase ); GetParent()->GetWindow( GetWindowType::Border )->Update(); @@ -2637,8 +2637,8 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout) bool bNativeOK = false; ControlState nState = ControlState::ENABLED; - if (rRenderContext.IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) - && rRenderContext.IsNativeControlSupported(CTRL_LISTBOX, HAS_BACKGROUND_TEXTURE) ) + if (rRenderContext.IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL) + && rRenderContext.IsNativeControlSupported(ControlType::Listbox, HAS_BACKGROUND_TEXTURE) ) { // Repaint the (focused) area similarly to // ImplSmallBorderWindowView::DrawWindow() in @@ -2676,11 +2676,11 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout) if( ! (nParentStyle & WB_BORDER) || (nParentStyle & WB_NOBORDER) ) { Rectangle aParentRect( Point( 0, 0 ), pWin->GetSizePixel() ); - pWin->DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aParentRect, + pWin->DrawNativeControl( ControlType::Listbox, PART_ENTIRE_CONTROL, aParentRect, nState, aControlValue, OUString() ); } - bNativeOK = rRenderContext.DrawNativeControl(CTRL_LISTBOX, PART_ENTIRE_CONTROL, aCtrlRegion, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Listbox, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString()); } @@ -2847,7 +2847,7 @@ void ImplWin::GetFocus() ShowFocus( maFocusRect ); if( ImplGetSVData()->maNWFData.mbNoFocusRects && IsNativeWidgetEnabled() && - IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) ) + IsNativeControlSupported( ControlType::Listbox, PART_ENTIRE_CONTROL ) ) { vcl::Window* pWin = GetParent()->GetWindow( GetWindowType::Border ); if( ! pWin ) @@ -2864,7 +2864,7 @@ void ImplWin::LoseFocus() HideFocus(); if( ImplGetSVData()->maNWFData.mbNoFocusRects && IsNativeWidgetEnabled() && - IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) ) + IsNativeControlSupported( ControlType::Listbox, PART_ENTIRE_CONTROL ) ) { vcl::Window* pWin = GetParent()->GetWindow( GetWindowType::Border ); if( ! pWin ) @@ -2878,13 +2878,13 @@ void ImplWin::LoseFocus() void ImplWin::ShowFocus(const Rectangle& rRect) { - if (IsNativeControlSupported(CTRL_LISTBOX, PART_FOCUS)) + if (IsNativeControlSupported(ControlType::Listbox, PART_FOCUS)) { ImplControlValue aControlValue; vcl::Window *pWin = GetParent(); Rectangle aParentRect(Point(0, 0), pWin->GetSizePixel()); - pWin->DrawNativeControl(CTRL_LISTBOX, PART_FOCUS, aParentRect, + pWin->DrawNativeControl(ControlType::Listbox, PART_FOCUS, aParentRect, ControlState::FOCUSED, aControlValue, OUString()); } Control::ShowFocus(rRect); diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index f5d0dad283cd..3492881871a8 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -115,13 +115,13 @@ void ListBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) mnDDHeight = (sal_uInt16)(GetTextHeight() + nTop + nBottom + 4); if( IsNativeWidgetEnabled() && - IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) ) + IsNativeControlSupported( ControlType::Listbox, PART_ENTIRE_CONTROL ) ) { ImplControlValue aControlValue; Rectangle aCtrlRegion( Point( 0, 0 ), Size( 20, mnDDHeight ) ); Rectangle aBoundingRgn( aCtrlRegion ); Rectangle aContentRgn( aCtrlRegion ); - if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aCtrlRegion, + if( GetNativeControlRegion( ControlType::Listbox, PART_ENTIRE_CONTROL, aCtrlRegion, ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { @@ -619,7 +619,7 @@ void ListBox::Resize() // Use the full extent of the control Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); - if ( GetNativeControlRegion( CTRL_LISTBOX, PART_BUTTON_DOWN, + if ( GetNativeControlRegion( ControlType::Listbox, PART_BUTTON_DOWN, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { long nTop = 0; @@ -632,7 +632,7 @@ void ListBox::Resize() mpBtn->setPosSizePixel( aContent.Left(), nTop, aContent.Right(), (nBottom-nTop) ); // Adjust the size of the edit field - if ( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT, + if ( GetNativeControlRegion( ControlType::Listbox, PART_SUB_EDIT, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // Convert back from border space to local coordinates @@ -768,8 +768,8 @@ void ListBox::StateChanged( StateChangedType nType ) if( mpImplWin ) { mpImplWin->Enable( IsEnabled() ); - if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) - && ! IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) ) + if ( IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL) + && ! IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) ) { GetWindow( GetWindowType::Border )->Invalidate( InvalidateFlags::NoErase ); } @@ -821,7 +821,7 @@ void ListBox::StateChanged( StateChangedType nType ) mpImplLB->SetControlBackground( GetControlBackground() ); if ( mpImplWin ) { - if ( mpImplWin->IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) ) + if ( mpImplWin->IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL) ) { // Transparent background mpImplWin->SetBackground(); @@ -1221,7 +1221,7 @@ Size ListBox::CalcMinimumSize() const Rectangle aContent, aBound; Size aTestSize( 100, 20 ); Rectangle aArea( aPoint, aTestSize ); - if( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT, aArea, ControlState::NONE, + if( GetNativeControlRegion( ControlType::Listbox, PART_SUB_EDIT, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { // use the themes drop down size @@ -1238,7 +1238,7 @@ Size ListBox::CalcMinimumSize() const ImplControlValue aControlValue; Rectangle aRect( Point( 0, 0 ), aSz ); Rectangle aContent, aBound; - if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aRect, ControlState::NONE, + if( GetNativeControlRegion( ControlType::Listbox, PART_ENTIRE_CONTROL, aRect, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { if( aBound.GetHeight() > aSz.Height() ) diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx index 9f8f303f854c..a2963e440b93 100644 --- a/vcl/source/control/prgsbar.cxx +++ b/vcl/source/control/prgsbar.cxx @@ -39,7 +39,7 @@ static WinBits clearProgressBarBorder( vcl::Window* pParent, WinBits nOrgStyle ) WinBits nOutStyle = nOrgStyle; if( pParent && (nOrgStyle & WB_BORDER) != 0 ) { - if( pParent->IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) ) + if( pParent->IsNativeControlSupported( ControlType::Progress, PART_ENTIRE_CONTROL ) ) nOutStyle &= WB_BORDER; } return nOutStyle; @@ -76,7 +76,7 @@ void ProgressBar::ImplInitSettings( bool bFont, if ( bBackground ) { if( !IsControlBackground() && - IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) ) + IsNativeControlSupported( ControlType::Progress, PART_ENTIRE_CONTROL ) ) { if( (GetStyle() & WB_BORDER) ) SetBorderStyle( WindowBorderStyle::REMOVEBORDER ); diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index fa68c4271c8d..eee34fcd1083 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -200,7 +200,7 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) } } - if( !IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL) ) + if( !IsNativeControlSupported(ControlType::Scrollbar, PART_ENTIRE_CONTROL) ) { // disable scrollbar buttons only in VCL's own 'theme' // as it is uncommon on other platforms @@ -260,9 +260,9 @@ void ScrollBar::ImplCalc( bool bUpdate ) if ( GetStyle() & WB_HORZ ) { - if ( GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT, + if ( GetNativeControlRegion( ControlType::Scrollbar, IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) && - GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT, + GetNativeControlRegion( ControlType::Scrollbar, IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) ) { maBtn1Rect = aBtn1Region; @@ -277,7 +277,7 @@ void ScrollBar::ImplCalc( bool bUpdate ) maBtn2Rect.SetSize( aBtnSize ); } - if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_HORZ_AREA, + if ( GetNativeControlRegion( ControlType::Scrollbar, PART_TRACK_HORZ_AREA, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) aTrackRect = aTrackRegion; else @@ -301,9 +301,9 @@ void ScrollBar::ImplCalc( bool bUpdate ) } else { - if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_UP, + if ( GetNativeControlRegion( ControlType::Scrollbar, PART_BUTTON_UP, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) && - GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_DOWN, + GetNativeControlRegion( ControlType::Scrollbar, PART_BUTTON_DOWN, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) ) { maBtn1Rect = aBtn1Region; @@ -318,7 +318,7 @@ void ScrollBar::ImplCalc( bool bUpdate ) maBtn2Rect.SetSize( aBtnSize ); } - if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_VERT_AREA, + if ( GetNativeControlRegion( ControlType::Scrollbar, PART_TRACK_VERT_AREA, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) aTrackRect = aTrackRegion; else @@ -439,14 +439,14 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD { ScrollbarValue scrValue; - bool bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL); + bool bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, PART_ENTIRE_CONTROL); if (!bNativeOK) return false; bool bHorz = (GetStyle() & WB_HORZ) != 0; // Draw the entire background if the control supports it - if (rRenderContext.IsNativeControlSupported(CTRL_SCROLLBAR, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT)) + if (rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT)) { ControlState nState = (IsEnabled() ? ControlState::ENABLED : ControlState::NONE) | (HasFocus() ? ControlState::FOCUSED : ControlState::NONE); @@ -504,7 +504,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD rRenderContext.DrawRect(aRequestedRegion); } - bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT), + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT), aCtrlRegion, nState, scrValue, OUString()); } else @@ -535,10 +535,10 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD } if (nDrawFlags & SCRBAR_DRAW_PAGE1) - bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1, scrValue, OUString()); + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part1, aCtrlRegion1, nState1, scrValue, OUString()); if (nDrawFlags & SCRBAR_DRAW_PAGE2) - bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2, scrValue, OUString()); + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part2, aCtrlRegion2, nState2, scrValue, OUString()); } if ((nDrawFlags & SCRBAR_DRAW_BTN1) || (nDrawFlags & SCRBAR_DRAW_BTN2)) { @@ -575,10 +575,10 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD } if (nDrawFlags & SCRBAR_DRAW_BTN1) - bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1, scrValue, OUString()); + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part1, aCtrlRegion1, nState1, scrValue, OUString()); if (nDrawFlags & SCRBAR_DRAW_BTN2) - bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2, scrValue, OUString()); + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part2, aCtrlRegion2, nState2, scrValue, OUString()); } if ((nDrawFlags & SCRBAR_DRAW_THUMB) && !maThumbRect.IsEmpty()) { @@ -601,7 +601,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD } } - bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, (bHorz ? PART_THUMB_HORZ : PART_THUMB_VERT), + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, (bHorz ? PART_THUMB_HORZ : PART_THUMB_VERT), aCtrlRegion, nState, scrValue, OUString()); } } @@ -626,7 +626,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla // pWin = static_cast<vcl::Window*>(&rRenderContext); // Draw the entire control if the native theme engine needs it - if (nDrawFlags && rRenderContext.IsNativeControlSupported(CTRL_SCROLLBAR, PART_DRAW_BACKGROUND_HORZ)) + if (nDrawFlags && rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, PART_DRAW_BACKGROUND_HORZ)) { ImplDrawNative(rRenderContext, SCRBAR_DRAW_BACKGROUND); return; @@ -760,7 +760,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) switch ( meScrollType ) { case SCROLL_LINEUP: - if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP, + if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP, aControlRegion, rMousePos, bIsInside )? bIsInside: maBtn1Rect.IsInside( rMousePos ) ) @@ -773,7 +773,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) break; case SCROLL_LINEDOWN: - if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN, + if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN, aControlRegion, rMousePos, bIsInside )? bIsInside: maBtn2Rect.IsInside( rMousePos ) ) @@ -787,7 +787,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) case SCROLL_PAGEUP: // HitTestNativeControl, see remark at top of file - if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT: PART_TRACK_VERT_UPPER, + if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_LEFT: PART_TRACK_VERT_UPPER, maPage1Rect, rMousePos, bIsInside )? bIsInside: maPage1Rect.IsInside( rMousePos ) ) @@ -801,7 +801,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) case SCROLL_PAGEDOWN: // HitTestNativeControl, see remark at top of file - if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_RIGHT: PART_TRACK_VERT_LOWER, + if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_RIGHT: PART_TRACK_VERT_LOWER, maPage2Rect, rMousePos, bIsInside )? bIsInside: maPage2Rect.IsInside( rMousePos ) ) @@ -885,7 +885,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) Point aPoint( 0, 0 ); Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); - if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP, + if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP, aControlRegion, rMousePos, bIsInside )? bIsInside: maBtn1Rect.IsInside( rMousePos ) ) @@ -897,7 +897,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) mnDragDraw = SCRBAR_DRAW_BTN1; } } - else if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN, + else if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN, aControlRegion, rMousePos, bIsInside )? bIsInside: maBtn2Rect.IsInside( rMousePos ) ) @@ -911,7 +911,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) } else { - bool bThumbHit = HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_THUMB_HORZ : PART_THUMB_VERT, + bool bThumbHit = HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_THUMB_HORZ : PART_THUMB_VERT, maThumbRect, rMousePos, bIsInside ) ? bIsInside : maThumbRect.IsInside( rMousePos ); @@ -957,14 +957,14 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) Invalidate(); } } - else if(bPage && (!HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA, + else if(bPage && (!HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA, aControlRegion, rMousePos, bIsInside ) || bIsInside) ) { nTrackFlags = StartTrackingFlags::ButtonRepeat; // HitTestNativeControl, see remark at top of file - if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER, + if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER, maPage1Rect, rMousePos, bIsInside )? bIsInside: maPage1Rect.IsInside( rMousePos ) ) @@ -1238,30 +1238,30 @@ Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt ) Point aPoint( 0, 0 ); Rectangle aControlRegion( aPoint, GetOutputSizePixel() ); - if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP, + if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP, aControlRegion, rPt, bIsInside )? bIsInside: maBtn1Rect.IsInside( rPt ) ) return &maBtn1Rect; - else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN, + else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN, aControlRegion, rPt, bIsInside )? bIsInside: maBtn2Rect.IsInside( rPt ) ) return &maBtn2Rect; // HitTestNativeControl, see remark at top of file - else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER, + else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER, maPage1Rect, rPt, bIsInside)? bIsInside: maPage1Rect.IsInside( rPt ) ) return &maPage1Rect; // HitTestNativeControl, see remark at top of file - else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER, + else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER, maPage2Rect, rPt, bIsInside)? bIsInside: maPage2Rect.IsInside( rPt ) ) return &maPage2Rect; // HitTestNativeControl, see remark at top of file - else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal ? PART_THUMB_HORZ : PART_THUMB_VERT, + else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal ? PART_THUMB_HORZ : PART_THUMB_VERT, maThumbRect, rPt, bIsInside)? bIsInside: maThumbRect.IsInside( rPt ) ) @@ -1279,7 +1279,7 @@ bool ScrollBar::PreNotify( NotifyEvent& rNEvt ) if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() ) { // Trigger a redraw if mouse over state has changed - if( IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL) ) + if( IsNativeControlSupported(ControlType::Scrollbar, PART_ENTIRE_CONTROL) ) { Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); @@ -1294,7 +1294,7 @@ bool ScrollBar::PreNotify( NotifyEvent& rNEvt ) aClipRegion.Union( *pLastRect ); // Support for 3-button scroll bars - bool bHas3Buttons = IsNativeControlSupported( CTRL_SCROLLBAR, HAS_THREE_BUTTONS ); + bool bHas3Buttons = IsNativeControlSupported( ControlType::Scrollbar, HAS_THREE_BUTTONS ); if ( bHas3Buttons && ( pRect == &maBtn1Rect || pLastRect == &maBtn1Rect ) ) { aClipRegion.Union( maBtn2Rect ); diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 5c4f80ed2f59..40ffdb69fe4f 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -141,7 +141,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, + if ( GetNativeControlRegion( ControlType::Slider, PART_THUMB_HORZ, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aThumbBounds, aThumbContent ) ) { @@ -175,7 +175,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, + if ( GetNativeControlRegion( ControlType::Slider, PART_THUMB_VERT, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aThumbBounds, aThumbContent ) ) { @@ -343,7 +343,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) } const Rectangle aCtrlRegion(Point(0,0), GetOutputSizePixel()); - bool bNativeOK = rRenderContext.DrawNativeControl(CTRL_SLIDER, nPart, aCtrlRegion, nState, sldValue, OUString()); + bool bNativeOK = rRenderContext.DrawNativeControl(ControlType::Slider, nPart, aCtrlRegion, nState, sldValue, OUString()); if (bNativeOK) return; diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx index 3af10f0b4cd9..3299477e89c6 100644 --- a/vcl/source/control/spinbtn.cxx +++ b/vcl/source/control/spinbtn.cxx @@ -446,8 +446,8 @@ bool SpinButton::PreNotify( NotifyEvent& rNEvt ) if (!pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged()) { // trigger redraw if mouse over state has changed - if (IsNativeControlSupported(CTRL_SPINBOX, PART_ENTIRE_CONTROL) || - IsNativeControlSupported(CTRL_SPINBOX, PART_ALL_BUTTONS) ) + if (IsNativeControlSupported(ControlType::Spinbox, PART_ENTIRE_CONTROL) || + IsNativeControlSupported(ControlType::Spinbox, PART_ALL_BUTTONS) ) { Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index c8a601dc61de..1fade35ae144 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -73,16 +73,16 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW { bool bNativeOK = false; - if (rRenderContext.IsNativeControlSupported(CTRL_SPINBOX, PART_ENTIRE_CONTROL) && + if (rRenderContext.IsNativeControlSupported(ControlType::Spinbox, PART_ENTIRE_CONTROL) && // there is just no useful native support for spinfields with dropdown !(pWin->GetStyle() & WB_DROPDOWN)) { - if (rRenderContext.IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnUpperPart) && - rRenderContext.IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnLowerPart)) + if (rRenderContext.IsNativeControlSupported(ControlType::Spinbox, rSpinbuttonValue.mnUpperPart) && + rRenderContext.IsNativeControlSupported(ControlType::Spinbox, rSpinbuttonValue.mnLowerPart)) { // only paint the embedded spin buttons, all buttons are painted at once Rectangle aUpperAndLowerButtons( rSpinbuttonValue.maUpperRect.GetUnion( rSpinbuttonValue.maLowerRect ) ); - bNativeOK = rRenderContext.DrawNativeControl(CTRL_SPINBOX, PART_ALL_BUTTONS, aUpperAndLowerButtons, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::Spinbox, PART_ALL_BUTTONS, aUpperAndLowerButtons, ControlState::ENABLED, rSpinbuttonValue, OUString()); } else @@ -113,7 +113,7 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW Rectangle aBound, aContent; if (!ImplGetSVData()->maNWFData.mbCanDrawWidgetAnySize && - pContext->GetNativeControlRegion(CTRL_SPINBOX, PART_ENTIRE_CONTROL, + pContext->GetNativeControlRegion(ControlType::Spinbox, PART_ENTIRE_CONTROL, aNatRgn, ControlState::NONE, rSpinbuttonValue, OUString(), aBound, aContent)) { @@ -127,7 +127,7 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW aRgn.SetPos(pWin->ScreenToOutputPixel(pBorder->OutputToScreenPixel(aRgn.TopLeft()))); } - bNativeOK = pContext->DrawNativeControl(CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, + bNativeOK = pContext->DrawNativeControl(ControlType::Spinbox, PART_ENTIRE_CONTROL, aRgn, ControlState::ENABLED, rSpinbuttonValue, OUString()); if (!pWin->SupportsDoubleBuffering()) @@ -141,11 +141,11 @@ bool ImplDrawNativeSpinbuttons(vcl::RenderContext& rRenderContext, const Spinbut { bool bNativeOK = false; - if (rRenderContext.IsNativeControlSupported(CTRL_SPINBUTTONS, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::SpinButtons, PART_ENTIRE_CONTROL)) { Rectangle aArea = rSpinbuttonValue.maUpperRect.GetUnion(rSpinbuttonValue.maLowerRect); // only paint the standalone spin buttons, all buttons are painted at once - bNativeOK = rRenderContext.DrawNativeControl(CTRL_SPINBUTTONS, PART_ALL_BUTTONS, aArea, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::SpinButtons, PART_ALL_BUTTONS, aArea, ControlState::ENABLED, rSpinbuttonValue, OUString()); } return bNativeOK; @@ -163,7 +163,7 @@ void ImplDrawSpinButton(vcl::RenderContext& rRenderContext, vcl::Window* pWindow if (pWindow) { // are we drawing standalone spin buttons or members of a spinfield ? - ControlType aControl = CTRL_SPINBUTTONS; + ControlType aControl = ControlType::SpinButtons; switch (pWindow->GetType()) { case WINDOW_EDIT: @@ -176,10 +176,10 @@ void ImplDrawSpinButton(vcl::RenderContext& rRenderContext, vcl::Window* pWindow case WINDOW_LONGCURRENCYFIELD: case WINDOW_NUMERICFIELD: case WINDOW_SPINFIELD: - aControl = CTRL_SPINBOX; + aControl = ControlType::Spinbox; break; default: - aControl = CTRL_SPINBUTTONS; + aControl = ControlType::SpinButtons; break; } @@ -188,9 +188,9 @@ void ImplDrawSpinButton(vcl::RenderContext& rRenderContext, vcl::Window* pWindow bUpperIn, bLowerIn, bUpperEnabled, bLowerEnabled, bHorz, aValue); - if( aControl == CTRL_SPINBOX ) + if( aControl == ControlType::Spinbox ) bNativeOK = ImplDrawNativeSpinfield(rRenderContext, pWindow, aValue); - else if( aControl == CTRL_SPINBUTTONS ) + else if( aControl == ControlType::SpinButtons ) bNativeOK = ImplDrawNativeSpinbuttons(rRenderContext, aValue); } @@ -668,7 +668,7 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rect if ((pDev->GetOutDevType() == OUTDEV_WINDOW) && // there is just no useful native support for spinfields with dropdown ! (GetStyle() & WB_DROPDOWN) && - IsNativeControlSupported(CTRL_SPINBOX, PART_ENTIRE_CONTROL)) + IsNativeControlSupported(ControlType::Spinbox, PART_ENTIRE_CONTROL)) { vcl::Window *pWin = static_cast<vcl::Window*>(pDev); vcl::Window *pBorder = pWin->GetWindow( GetWindowType::Border ); @@ -682,9 +682,9 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rect Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); bNativeRegionOK = - pWin->GetNativeControlRegion(CTRL_SPINBOX, PART_BUTTON_UP, + pWin->GetNativeControlRegion(ControlType::Spinbox, PART_BUTTON_UP, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContentUp) && - pWin->GetNativeControlRegion(CTRL_SPINBOX, PART_BUTTON_DOWN, + pWin->GetNativeControlRegion(ControlType::Spinbox, PART_BUTTON_DOWN, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContentDown); if (bNativeRegionOK) @@ -737,7 +737,7 @@ void SpinField::Resize() Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() ); // adjust position and size of the edit field - if (GetNativeControlRegion(CTRL_SPINBOX, PART_SUB_EDIT, aArea, ControlState::NONE, + if (GetNativeControlRegion(ControlType::Spinbox, PART_SUB_EDIT, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent)) { // convert back from border space to local coordinates @@ -865,8 +865,8 @@ bool SpinField::PreNotify(NotifyEvent& rNEvt) if (!pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged()) { // trigger redraw if mouse over state has changed - if( IsNativeControlSupported(CTRL_SPINBOX, PART_ENTIRE_CONTROL) || - IsNativeControlSupported(CTRL_SPINBOX, PART_ALL_BUTTONS) ) + if( IsNativeControlSupported(ControlType::Spinbox, PART_ENTIRE_CONTROL) || + IsNativeControlSupported(ControlType::Spinbox, PART_ALL_BUTTONS) ) { Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); @@ -875,7 +875,7 @@ bool SpinField::PreNotify(NotifyEvent& rNEvt) // FIXME: this is currently only on OS X // check for other platforms that need similar handling if (ImplGetSVData()->maNWFData.mbNoFocusRects && IsNativeWidgetEnabled() && - IsNativeControlSupported(CTRL_EDITBOX, PART_ENTIRE_CONTROL)) + IsNativeControlSupported(ControlType::Editbox, PART_ENTIRE_CONTROL)) { ImplInvalidateOutermostBorder(this); } @@ -927,9 +927,9 @@ Size SpinField::CalcMinimumSizeForText(const OUString &rString) const Rectangle aArea( Point(), Size(100, aSz.Height())); Rectangle aEntireBound, aEntireContent, aEditBound, aEditContent; if ( - GetNativeControlRegion(CTRL_SPINBOX, PART_ENTIRE_CONTROL, + GetNativeControlRegion(ControlType::Spinbox, PART_ENTIRE_CONTROL, aArea, ControlState::NONE, aControlValue, OUString(), aEntireBound, aEntireContent) && - GetNativeControlRegion(CTRL_SPINBOX, PART_SUB_EDIT, + GetNativeControlRegion(ControlType::Spinbox, PART_SUB_EDIT, aArea, ControlState::NONE, aControlValue, OUString(), aEditBound, aEditContent) ) { diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 14a53ec42f66..ac6b69ca2ca9 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -110,7 +110,7 @@ void TabControl::ImplInit( vcl::Window* pParent, WinBits nStyle ) // if the tabcontrol is drawn (ie filled) by a native widget, make sure all controls will have transparent background // otherwise they will paint with a wrong background - if( IsNativeControlSupported(CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) + if( IsNativeControlSupported(ControlType::TabPane, PART_ENTIRE_CONTROL) ) EnableChildTransparentMode(); if (pParent && pParent->IsDialog()) @@ -137,8 +137,8 @@ void TabControl::ImplInitSettings( bool bFont, vcl::Window* pParent = GetParent(); if ( !IsControlBackground() && (pParent->IsChildTransparentModeEnabled() - || IsNativeControlSupported(CTRL_TAB_PANE, PART_ENTIRE_CONTROL) - || IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL) ) ) + || IsNativeControlSupported(ControlType::TabPane, PART_ENTIRE_CONTROL) + || IsNativeControlSupported(ControlType::TabItem, PART_ENTIRE_CONTROL) ) ) { // set transparent mode for NWF tabcontrols to have @@ -236,7 +236,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) const TabitemValue aControlValue(Rectangle(TAB_TABOFFSET_X, TAB_TABOFFSET_Y, aSize.Width() - TAB_TABOFFSET_X * 2, aSize.Height() - TAB_TABOFFSET_Y * 2)); - if(GetNativeControlRegion( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, aCtrlRegion, + if(GetNativeControlRegion( ControlType::TabItem, PART_ENTIRE_CONTROL, aCtrlRegion, ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { @@ -665,7 +665,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) // Invalidate the same region that will be send to NWF // to always allow for bitmap caching // see Window::DrawNativeControl() - if( IsNativeControlSupported( CTRL_TAB_PANE, PART_ENTIRE_CONTROL ) ) + if( IsNativeControlSupported( ControlType::TabPane, PART_ENTIRE_CONTROL ) ) { aRect.Left() -= TAB_OFFSET; aRect.Top() -= TAB_OFFSET; @@ -840,7 +840,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p } } - if ( (bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) ) + if ( (bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::TabItem, PART_ENTIRE_CONTROL)) ) { TabitemValue tiValue(Rectangle(pItem->maRect.Left() + TAB_TABOFFSET_X, pItem->maRect.Top() + TAB_TABOFFSET_Y, @@ -856,7 +856,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p tiValue.mnAlignment |= TabitemFlags::LastInGroup; Rectangle aCtrlRegion( pItem->maRect ); - bNativeOK = rRenderContext.DrawNativeControl(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::TabItem, PART_ENTIRE_CONTROL, aCtrlRegion, nState, tiValue, OUString() ); } @@ -1085,7 +1085,7 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& aRect.Right() += 10; } - if (rRenderContext.IsNativeControlSupported(CTRL_TAB_PANE, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::TabPane, PART_ENTIRE_CONTROL)) { const ImplControlValue aControlValue; @@ -1102,11 +1102,11 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& if (!aClipRgn.IsEmpty()) { - rRenderContext.DrawNativeControl(CTRL_TAB_PANE, PART_ENTIRE_CONTROL, + rRenderContext.DrawNativeControl(ControlType::TabPane, PART_ENTIRE_CONTROL, aRect, nState, aControlValue, OUString()); } - if (rRenderContext.IsNativeControlSupported(CTRL_TAB_HEADER, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::TabHeader, PART_ENTIRE_CONTROL)) { Rectangle aHeaderRect(aRect.Left(), 0, aRect.Right(), aRect.Top()); @@ -1117,7 +1117,7 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& if (!aClipRgn.IsEmpty()) { - rRenderContext.DrawNativeControl(CTRL_TAB_HEADER, PART_ENTIRE_CONTROL, + rRenderContext.DrawNativeControl(ControlType::TabHeader, PART_ENTIRE_CONTROL, aHeaderRect, nState, aControlValue, OUString()); } } @@ -1175,7 +1175,7 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& { // Some native toolkits (GTK+) draw tabs right-to-left, with an // overlap between adjacent tabs - bool bDrawTabsRTL = rRenderContext.IsNativeControlSupported(CTRL_TAB_ITEM, PART_TABS_DRAW_RTL); + bool bDrawTabsRTL = rRenderContext.IsNativeControlSupported(ControlType::TabItem, PART_TABS_DRAW_RTL); ImplTabItem* pFirstTab = nullptr; ImplTabItem* pLastTab = nullptr; size_t idx; @@ -1545,7 +1545,7 @@ bool TabControl::PreNotify( NotifyEvent& rNEvt ) if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() ) { // trigger redraw if mouse over state has changed - if( IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL) ) + if( IsNativeControlSupported(ControlType::TabItem, PART_ENTIRE_CONTROL) ) { Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() ); Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() ); diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 450e1b0d6ebe..7c13637fcbe3 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -631,13 +631,13 @@ void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev ) { switch( rVal.getType() ) { - case CTRL_SLIDER: + case ControlType::Slider: { SliderValue* pSlVal = static_cast<SliderValue*>(&rVal); mirror(pSlVal->maThumbRect,pOutDev); } break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: { ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(&rVal); mirror(pScVal->maThumbRect,pOutDev); @@ -645,20 +645,21 @@ void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev ) mirror(pScVal->maButton2Rect,pOutDev); } break; - case CTRL_SPINBOX: - case CTRL_SPINBUTTONS: + case ControlType::Spinbox: + case ControlType::SpinButtons: { SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(&rVal); mirror(pSpVal->maUpperRect,pOutDev); mirror(pSpVal->maLowerRect,pOutDev); } break; - case CTRL_TOOLBAR: + case ControlType::Toolbar: { ToolbarValue* pTVal = static_cast<ToolbarValue*>(&rVal); mirror(pTVal->maGripRect,pOutDev); } break; + default: break; } } diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx index 650d08af2cc5..947e5cc177f2 100644 --- a/vcl/source/outdev/nativecontrols.cxx +++ b/vcl/source/outdev/nativecontrols.cxx @@ -194,7 +194,7 @@ static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplCont std::shared_ptr< ImplControlValue > aResult; switch( rVal.getType() ) { - case CTRL_SLIDER: + case ControlType::Slider: { const SliderValue* pSlVal = static_cast<const SliderValue*>(&rVal); SliderValue* pNew = new SliderValue( *pSlVal ); @@ -202,7 +202,7 @@ static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplCont pNew->maThumbRect = rDev.ImplLogicToDevicePixel( pSlVal->maThumbRect ); } break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: { const ScrollbarValue* pScVal = static_cast<const ScrollbarValue*>(&rVal); ScrollbarValue* pNew = new ScrollbarValue( *pScVal ); @@ -212,7 +212,7 @@ static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplCont pNew->maButton2Rect = rDev.ImplLogicToDevicePixel( pScVal->maButton2Rect ); } break; - case CTRL_SPINBUTTONS: + case ControlType::SpinButtons: { const SpinbuttonValue* pSpVal = static_cast<const SpinbuttonValue*>(&rVal); SpinbuttonValue* pNew = new SpinbuttonValue( *pSpVal ); @@ -221,7 +221,7 @@ static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplCont pNew->maLowerRect = rDev.ImplLogicToDevicePixel( pSpVal->maLowerRect ); } break; - case CTRL_TOOLBAR: + case ControlType::Toolbar: { const ToolbarValue* pTVal = static_cast<const ToolbarValue*>(&rVal); ToolbarValue* pNew = new ToolbarValue( *pTVal ); @@ -229,7 +229,7 @@ static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplCont pNew->maGripRect = rDev.ImplLogicToDevicePixel( pTVal->maGripRect ); } break; - case CTRL_TAB_ITEM: + case ControlType::TabItem: { const TabitemValue* pTIVal = static_cast<const TabitemValue*>(&rVal); TabitemValue* pNew = new TabitemValue( *pTIVal ); @@ -237,24 +237,24 @@ static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplCont aResult.reset( pNew ); } break; - case CTRL_MENUBAR: + case ControlType::Menubar: { const MenubarValue* pMVal = static_cast<const MenubarValue*>(&rVal); MenubarValue* pNew = new MenubarValue( *pMVal ); aResult.reset( pNew ); } break; - case CTRL_PUSHBUTTON: + case ControlType::Pushbutton: { const PushButtonValue* pBVal = static_cast<const PushButtonValue*>(&rVal); PushButtonValue* pNew = new PushButtonValue( *pBVal ); aResult.reset( pNew ); } break; - case CTRL_GENERIC: + case ControlType::Generic: aResult.reset( new ImplControlValue( rVal ) ); break; - case CTRL_MENU_POPUP: + case ControlType::MenuPopup: { const MenupopupValue* pMVal = static_cast<const MenupopupValue*>(&rVal); MenupopupValue* pNew = new MenupopupValue( *pMVal ); diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index bc58e47d011e..28583f53275c 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -484,7 +484,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei { // for native widget drawing we must find out what // control this border belongs to - ControlType aCtrlType = 0; + ControlType aCtrlType = ControlType::Generic; if (pCtrl) { switch( pCtrl->GetType() ) @@ -492,19 +492,19 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei case WINDOW_LISTBOX: if( pCtrl->GetStyle() & WB_DROPDOWN ) { - aCtrlType = CTRL_LISTBOX; + aCtrlType = ControlType::Listbox; mbNWFBorder = true; } break; case WINDOW_COMBOBOX: if( pCtrl->GetStyle() & WB_DROPDOWN ) { - aCtrlType = CTRL_COMBOBOX; + aCtrlType = ControlType::Combobox; mbNWFBorder = true; } break; case WINDOW_MULTILINEEDIT: - aCtrlType = CTRL_MULTILINE_EDITBOX; + aCtrlType = ControlType::MultilineEditbox; mbNWFBorder = true; break; case WINDOW_EDIT: @@ -519,9 +519,9 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei case WINDOW_CALCINPUTLINE: mbNWFBorder = true; if (pCtrl->GetStyle() & WB_SPIN) - aCtrlType = CTRL_SPINBOX; + aCtrlType = ControlType::Spinbox; else - aCtrlType = CTRL_EDITBOX; + aCtrlType = ControlType::Editbox; break; default: break; @@ -637,14 +637,14 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B // control this border belongs to vcl::Window* pCtrl = mpBorderWindow->GetWindow(GetWindowType::Client); - ControlType aCtrlType = 0; + ControlType aCtrlType = ControlType::Generic; ControlPart aCtrlPart = PART_ENTIRE_CONTROL; if (pCtrl) { switch (pCtrl->GetType()) { case WINDOW_MULTILINEEDIT: - aCtrlType = CTRL_MULTILINE_EDITBOX; + aCtrlType = ControlType::MultilineEditbox; break; case WINDOW_EDIT: case WINDOW_PATTERNFIELD: @@ -657,15 +657,15 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B case WINDOW_SPINFIELD: case WINDOW_CALCINPUTLINE: if (pCtrl->GetStyle() & WB_SPIN) - aCtrlType = CTRL_SPINBOX; + aCtrlType = ControlType::Spinbox; else - aCtrlType = CTRL_EDITBOX; + aCtrlType = ControlType::Editbox; break; case WINDOW_LISTBOX: case WINDOW_MULTILISTBOX: case WINDOW_TREELISTBOX: - aCtrlType = CTRL_LISTBOX; + aCtrlType = ControlType::Listbox; if (pCtrl->GetStyle() & WB_DROPDOWN) aCtrlPart = PART_ENTIRE_CONTROL; else @@ -673,7 +673,7 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B break; case WINDOW_LISTBOXWINDOW: - aCtrlType = CTRL_LISTBOX; + aCtrlType = ControlType::Listbox; aCtrlPart = PART_WINDOW; break; @@ -687,12 +687,12 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B case WINDOW_LONGCURRENCYBOX: if (pCtrl->GetStyle() & WB_DROPDOWN) { - aCtrlType = CTRL_COMBOBOX; + aCtrlType = ControlType::Combobox; aCtrlPart = PART_ENTIRE_CONTROL; } else { - aCtrlType = CTRL_LISTBOX; + aCtrlType = ControlType::Listbox; aCtrlPart = PART_WINDOW; } break; @@ -702,7 +702,7 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B } } - if (aCtrlType && pCtrl->IsNativeControlSupported(aCtrlType, aCtrlPart)) + if (aCtrlType != ControlType::Generic && pCtrl->IsNativeControlSupported(aCtrlType, aCtrlPart)) { ImplControlValue aControlValue; ControlState nState = ControlState::ENABLED; @@ -748,7 +748,7 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B // if the native theme draws the spinbuttons in one call, make sure the proper settings // are passed, this might force a redraw though.... (TODO: improve) - if ((aCtrlType == CTRL_SPINBOX) && !pCtrl->IsNativeControlSupported(CTRL_SPINBOX, PART_BUTTON_UP)) + if ((aCtrlType == ControlType::Spinbox) && !pCtrl->IsNativeControlSupported(ControlType::Spinbox, PART_BUTTON_UP)) { Edit* pEdit = static_cast<Edit*>(pCtrl)->GetSubEdit(); if (pEdit && !pEdit->SupportsDoubleBuffering()) diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 717b899b9ad2..01b86fa406c1 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -651,7 +651,7 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, nFlags |= DrawFrameFlags::Mono; if( nStyle != DrawFrameStyle::NWF && - pWin && pWin->IsNativeControlSupported(CTRL_FRAME, PART_BORDER) ) + pWin && pWin->IsNativeControlSupported(ControlType::Frame, PART_BORDER) ) { long nControlFlags = static_cast<long>(nStyle); nControlFlags |= static_cast<long>(nFlags); @@ -661,13 +661,13 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, Rectangle aBound, aContent; Rectangle aNatRgn( rRect ); - if( pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER, + if( pWin->GetNativeControlRegion(ControlType::Frame, PART_BORDER, 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, ControlState::ENABLED, + pWin->DrawNativeControl( ControlType::Frame, PART_BORDER, aContent, ControlState::ENABLED, aControlValue, OUString()) ) { rRect = aContent; @@ -1059,11 +1059,11 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo if(pWin) { ControlPart nPart = ( bVertical ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ ); - bool nativeSupported = pWin->IsNativeControlSupported( CTRL_FIXEDLINE, nPart ); + bool nativeSupported = pWin->IsNativeControlSupported( ControlType::Fixedline, nPart ); ImplControlValue aValue; ControlState nState = ControlState::NONE; Rectangle aRect(rStart,rStop); - if(nativeSupported && pWin->DrawNativeControl(CTRL_FIXEDLINE,nPart,aRect,nState,aValue,OUString())) + if(nativeSupported && pWin->DrawNativeControl(ControlType::Fixedline,nPart,aRect,nState,aValue,OUString())) return; } diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index d26c58429ecc..b3b39ae9a29a 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -451,7 +451,7 @@ void Dialog::ApplySettings(vcl::RenderContext& rRenderContext) // user override SetBackground(GetControlBackground()); } - else if (rRenderContext.IsNativeControlSupported(CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_DIALOG)) + else if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, PART_BACKGROUND_DIALOG)) { // NWF background mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG; @@ -470,7 +470,7 @@ void Dialog::ImplInitSettings() if (IsControlBackground()) SetBackground(GetControlBackground()); // NWF background - else if( IsNativeControlSupported(CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_DIALOG)) + else if( IsNativeControlSupported(ControlType::WindowBackground, PART_BACKGROUND_DIALOG)) { mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG; EnableChildTransparentMode(); diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index 6ea846de11f3..d2993e1e38e4 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -79,8 +79,8 @@ static void ImplInvalidateMenubar( DockingAreaWindow* pThis ) // the menubar must be repainted if the top dockingarea changes size or visibility if( ImplGetSVData()->maNWFData.mbMenuBarDockingAreaCommonBG && (pThis->GetAlign() == WindowAlign::Top) - && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) - && pThis->IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) ) + && pThis->IsNativeControlSupported( ControlType::Toolbar, PART_ENTIRE_CONTROL ) + && pThis->IsNativeControlSupported( ControlType::Menubar, PART_ENTIRE_CONTROL ) ) { SystemWindow *pSysWin = pThis->GetSystemWindow(); if( pSysWin && pSysWin->GetMenuBar() ) @@ -149,7 +149,7 @@ void DockingAreaWindow::ApplySettings(vcl::RenderContext& rRenderContext) rRenderContext.SetBackground(aWallpaper); } - else if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_ENTIRE_CONTROL)) + else if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, PART_ENTIRE_CONTROL)) { Wallpaper aWallpaper; aWallpaper.SetStyle(WallpaperStyle::ApplicationGradient); @@ -165,7 +165,7 @@ void DockingAreaWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl const StyleSettings rSetting = rRenderContext.GetSettings().GetStyleSettings(); EnableNativeWidget(); // only required because the toolkit currently switches this flag off - if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, PART_ENTIRE_CONTROL)) { ToolbarValue aControlValue; @@ -186,7 +186,7 @@ void DockingAreaWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl // draw a single toolbar background covering the whole docking area Rectangle aCtrlRegion(Point(), GetOutputSizePixel()); - rRenderContext.DrawNativeControl(CTRL_TOOLBAR, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT, + rRenderContext.DrawNativeControl(ControlType::Toolbar, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT, aCtrlRegion, nState, aControlValue, OUString() ); if (!ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames) @@ -249,7 +249,7 @@ void DockingAreaWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl aTBRect.Top() = 0; aTBRect.Bottom() = aOutSz.Height() - 1; } - rRenderContext.DrawNativeControl(CTRL_TOOLBAR, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT, + rRenderContext.DrawNativeControl(ControlType::Toolbar, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT, aTBRect, nState, aControlValue, OUString()); } } @@ -259,7 +259,7 @@ void DockingAreaWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl void DockingAreaWindow::Resize() { ImplInvalidateMenubar( this ); - if (IsNativeControlSupported(CTRL_TOOLBAR, PART_ENTIRE_CONTROL)) + if (IsNativeControlSupported(ControlType::Toolbar, PART_ENTIRE_CONTROL)) Invalidate(); } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 1506724c881e..38a627022d2a 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1366,9 +1366,9 @@ Size Menu::ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, lo Rectangle aNativeContent; Rectangle aCtrlRegion(Rectangle(Point(), Size(100, 15))); - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_CHECK_MARK)) { - if (rRenderContext.GetNativeControlRegion(ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_CHECK_MARK), + if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_CHECK_MARK), aCtrlRegion, ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, aNativeContent)) { @@ -1376,9 +1376,9 @@ Size Menu::ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, lo nCheckWidth = aNativeContent.GetWidth(); } } - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_RADIO_MARK)) { - if (rRenderContext.GetNativeControlRegion(ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_RADIO_MARK), + if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_RADIO_MARK), aCtrlRegion, ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, aNativeContent)) { @@ -1396,9 +1396,9 @@ bool Menu::ImplGetNativeSubmenuArrowSize(vcl::RenderContext& rRenderContext, Siz Rectangle aNativeBounds; Rectangle aNativeContent; Rectangle aCtrlRegion(Rectangle(Point(), Size(100, 15))); - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SUBMENU_ARROW)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_SUBMENU_ARROW)) { - if (rRenderContext.GetNativeControlRegion(ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_SUBMENU_ARROW), + if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_SUBMENU_ARROW), aCtrlRegion, ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, aNativeContent)) { @@ -1638,14 +1638,14 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) aSz.Height() = nFontHeight+6; // get menubar height from native methods if supported - if( pWindow->IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) ) + if( pWindow->IsNativeControlSupported( ControlType::Menubar, PART_ENTIRE_CONTROL ) ) { ImplControlValue aVal; Rectangle aNativeBounds; Rectangle aNativeContent; Point tmp( 0, 0 ); Rectangle aCtrlRegion( tmp, Size( 100, 15 ) ); - if( pWindow->GetNativeControlRegion( ControlType(CTRL_MENUBAR), + if( pWindow->GetNativeControlRegion( ControlType::Menubar, ControlPart(PART_ENTIRE_CONTROL), aCtrlRegion, ControlState(ControlState::ENABLED), @@ -1677,7 +1677,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) static void ImplPaintCheckBackground(vcl::RenderContext& rRenderContext, vcl::Window& rWindow, const Rectangle& i_rRect, bool i_bHighlight) { bool bNativeOk = false; - if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_BUTTON)) + if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, PART_BUTTON)) { ImplControlValue aControlValue; Rectangle aCtrlRegion( i_rRect ); @@ -1685,7 +1685,7 @@ static void ImplPaintCheckBackground(vcl::RenderContext& rRenderContext, vcl::Wi aControlValue.setTristateVal(BUTTONVALUE_ON); - bNativeOk = rRenderContext.DrawNativeControl(CTRL_TOOLBAR, PART_BUTTON, + bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, PART_BUTTON, aCtrlRegion, nState, aControlValue, OUString()); } @@ -1840,7 +1840,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, if (!bLayout && !IsMenuBar() && (pData->eType == MenuItemType::SEPARATOR)) { bool bNativeOk = false; - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SEPARATOR)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_SEPARATOR)) { ControlState nState = ControlState::NONE; if (pData->bEnabled && pWindow->IsEnabled()) @@ -1854,7 +1854,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, aSz.Width() = aOutSz.Width() - 2*nOuterSpaceX - 2 * nSepPad; Rectangle aItemRect(aMpos, aSz); MenupopupValue aVal(nTextPos - GUTTERBORDER, aItemRect); - bNativeOk = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_SEPARATOR, + bNativeOk = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_SEPARATOR, aItemRect, nState, aVal, OUString()); } if (!bNativeOk) @@ -1888,7 +1888,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, if( !((pData->eType == MenuItemType::IMAGE) || (pData->eType == MenuItemType::STRINGIMAGE))) { - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, (pData->nBits & MenuItemBits::RADIOCHECK) ? PART_MENU_ITEM_CHECK_MARK : PART_MENU_ITEM_RADIO_MARK)) @@ -1917,7 +1917,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, aSz.Width() = aOutSz.Width() - 2 * nOuterSpaceX; Rectangle aItemRect(aPos, aSz); MenupopupValue aVal(nTextPos - GUTTERBORDER, aItemRect); - rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, nPart, aCheckRect, + rRenderContext.DrawNativeControl(ControlType::MenuPopup, nPart, aCheckRect, nState, aVal, OUString()); } else if (pData->bChecked) // by default do nothing for unchecked items @@ -1996,7 +1996,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, // hopefully matches the NWF background since it is read // from the system style settings bool bSetTmpBackground = !rRenderContext.IsBackground() - && rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL); + && rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL); if (bSetTmpBackground) { Color aBg = IsMenuBar() ? rRenderContext.GetSettings().GetStyleSettings().GetMenuBarColor() @@ -2037,7 +2037,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, if (!bLayout && !IsMenuBar() && pData->pSubMenu) { bool bNativeOk = false; - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SUBMENU_ARROW)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_SUBMENU_ARROW)) { ControlState nState = ControlState::NONE; Size aTmpSz(0, 0); @@ -2060,7 +2060,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Rectangle aItemRect(aTmpPos, aTmpSz); MenupopupValue aVal(nTextPos - GUTTERBORDER, aItemRect); - bNativeOk = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_SUBMENU_ARROW, + bNativeOk = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_SUBMENU_ARROW, aItemRect, nState, aVal, OUString()); } if (!bNativeOk) diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 16d3af5ac397..7b6c3d08de70 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -602,8 +602,8 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16 rRenderContext.Push(PushFlags::CLIPREGION); rRenderContext.IntersectClipRegion(aRect); bool bRollover = nPos != nHighlightedItem; - if (rRenderContext.IsNativeControlSupported(CTRL_MENUBAR, PART_MENU_ITEM) && - rRenderContext.IsNativeControlSupported(CTRL_MENUBAR, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, PART_MENU_ITEM) && + rRenderContext.IsNativeControlSupported(ControlType::Menubar, PART_ENTIRE_CONTROL)) { // draw background (transparency) MenubarValue aControlValue; @@ -614,7 +614,7 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16 else { Rectangle aBgRegion(Point(), GetOutputSizePixel()); - rRenderContext.DrawNativeControl(CTRL_MENUBAR, PART_ENTIRE_CONTROL, aBgRegion, + rRenderContext.DrawNativeControl(ControlType::Menubar, PART_ENTIRE_CONTROL, aBgRegion, ControlState::ENABLED, aControlValue, OUString()); } @@ -626,7 +626,7 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16 nState |= ControlState::ROLLOVER; else nState |= ControlState::SELECTED; - rRenderContext.DrawNativeControl(CTRL_MENUBAR, PART_MENU_ITEM, + rRenderContext.DrawNativeControl(ControlType::Menubar, PART_MENU_ITEM, aRect, nState, aControlValue, OUString() ); } else @@ -852,7 +852,7 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) return; } - if (rRenderContext.IsNativeControlSupported(CTRL_MENUBAR, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, PART_ENTIRE_CONTROL)) { MenubarValue aMenubarValue; aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight(this); @@ -864,7 +864,7 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) Point aPt; Rectangle aCtrlRegion( aPt, GetOutputSizePixel() ); - rRenderContext.DrawNativeControl(CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRegion, + rRenderContext.DrawNativeControl(ControlType::Menubar, PART_ENTIRE_CONTROL, aCtrlRegion, ControlState::ENABLED, aMenubarValue, OUString()); } @@ -877,7 +877,7 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) HighlightItem(rRenderContext, nHighlightedItem); // in high contrast mode draw a separating line on the lower edge - if (!rRenderContext.IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) && + if (!rRenderContext.IsNativeControlSupported( ControlType::Menubar, PART_ENTIRE_CONTROL) && rStyleSettings.GetHighContrastMode()) { rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::MAPMODE); @@ -1019,7 +1019,7 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext) SetPaintTransparent(false); SetParentClipMode(); } - else if (rRenderContext.IsNativeControlSupported(CTRL_MENUBAR, PART_ENTIRE_CONTROL)) + else if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, PART_ENTIRE_CONTROL)) { rRenderContext.SetBackground(); // background will be drawn by NWF } @@ -1039,8 +1039,8 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext) void MenuBarWindow::ImplInitStyleSettings() { - if (IsNativeControlSupported(CTRL_MENUBAR, PART_MENU_ITEM) && - IsNativeControlSupported(CTRL_MENUBAR, PART_ENTIRE_CONTROL)) + if (IsNativeControlSupported(ControlType::Menubar, PART_MENU_ITEM) && + IsNativeControlSupported(ControlType::Menubar, PART_ENTIRE_CONTROL)) { AllSettings aSettings(GetSettings()); ImplGetFrame()->UpdateSettings(aSettings); // to update persona diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 50c8f23db69d..16f7cc9e77f1 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -126,7 +126,7 @@ void MenuFloatingWindow::ApplySettings(vcl::RenderContext& rRenderContext) SetPointFont(rRenderContext, rStyleSettings.GetMenuFont()); - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL)) { rRenderContext.SetBackground(); // background will be drawn by NWF } @@ -794,19 +794,19 @@ void MenuFloatingWindow::RenderHighlightItem(vcl::RenderContext& rRenderContext, aItemRect.Right() -= nFontHeight + nFontHeight / 4; } - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL)) { Size aPxSize(GetOutputSizePixel()); rRenderContext.Push(PushFlags::CLIPREGION); rRenderContext.IntersectClipRegion(Rectangle(Point(nX, nY), Size(aSz.Width(), pData->aSz.Height()))); Rectangle aCtrlRect(Point(nX, 0), Size(aPxSize.Width()-nX, aPxSize.Height())); MenupopupValue aVal(pMenu->nTextPos-GUTTERBORDER, aItemRect); - rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, + rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED, aVal, OUString()); - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM)) { bDrawItemRect = false; - if (!rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect, + if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_ITEM, aItemRect, ControlState::SELECTED | (pData->bEnabled ? ControlState::ENABLED : ControlState::NONE), @@ -1138,14 +1138,14 @@ void MenuFloatingWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang rRenderContext.Push( PushFlags::CLIPREGION ); rRenderContext.SetClipRegion(vcl::Region(rPaintRect)); - if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL)) { rRenderContext.SetClipRegion(); long nX = pMenu->pLogo ? pMenu->pLogo->aBitmap.GetSizePixel().Width() : 0; Size aPxSize(GetOutputSizePixel()); aPxSize.Width() -= nX; ImplControlValue aVal(pMenu->nTextPos - GUTTERBORDER); - rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, + rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, Rectangle(Point(nX, 0), aPxSize), ControlState::ENABLED, aVal, OUString()); InitMenuClipRegion(rRenderContext); diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 789dac60e858..df2a543e250e 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1499,7 +1499,7 @@ void Window::Erase(vcl::RenderContext& rRenderContext) if (IsEnabled()) nState |= ControlState::ENABLED; - bNativeOK = rRenderContext.DrawNativeControl(CTRL_WINDOW_BACKGROUND, aCtrlPart, aCtrlRegion, + bNativeOK = rRenderContext.DrawNativeControl(ControlType::WindowBackground, aCtrlPart, aCtrlRegion, nState, ImplControlValue(), OUString()); } diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 86441cdca764..e02f427ee5e9 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -206,7 +206,7 @@ void StatusBar::ApplySettings(vcl::RenderContext& rRenderContext) // NWF background if (!IsControlBackground() && - rRenderContext.IsNativeControlSupported(CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_WINDOW)) + rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, PART_BACKGROUND_WINDOW)) { ImplGetWindowImpl()->mnNativeBackground = PART_BACKGROUND_WINDOW; EnableChildTransparentMode(); @@ -458,7 +458,7 @@ void DrawProgress(vcl::Window* pWindow, vcl::RenderContext& rRenderContext, cons sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount, const Rectangle& rFramePosSize) { - if (rRenderContext.IsNativeControlSupported(CTRL_PROGRESS, PART_ENTIRE_CONTROL)) + if (rRenderContext.IsNativeControlSupported(ControlType::Progress, PART_ENTIRE_CONTROL)) { bool bNeedErase = ImplGetSVData()->maNWFData.mbProgressNeedsErase; @@ -496,7 +496,7 @@ void DrawProgress(vcl::Window* pWindow, vcl::RenderContext& rRenderContext, cons rRenderContext.IntersectClipRegion(rFramePosSize); } - bool bNativeOK = rRenderContext.DrawNativeControl(CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion, + bool bNativeOK = rRenderContext.DrawNativeControl(ControlType::Progress, PART_ENTIRE_CONTROL, aControlRegion, ControlState::ENABLED, aValue, OUString()); if (bNeedErase) rRenderContext.Pop(); @@ -567,7 +567,7 @@ void DrawProgress(vcl::Window* pWindow, vcl::RenderContext& rRenderContext, cons void StatusBar::ImplDrawProgress(vcl::RenderContext& rRenderContext, sal_uInt16 nPercent2) { - bool bNative = rRenderContext.IsNativeControlSupported(CTRL_PROGRESS, PART_ENTIRE_CONTROL); + bool bNative = rRenderContext.IsNativeControlSupported(ControlType::Progress, PART_ENTIRE_CONTROL); // bPaint: draw text also, else only update progress rRenderContext.DrawText(maPrgsTxtPos, maPrgsTxt); if (!bNative) @@ -617,12 +617,12 @@ void StatusBar::ImplCalcProgressRect() // save the divisor for later mnPercentCount = 10000 / nMaxPercent; bool bNativeOK = false; - if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) ) + if( IsNativeControlSupported( ControlType::Progress, PART_ENTIRE_CONTROL ) ) { ImplControlValue aValue; Rectangle aControlRegion( Rectangle( (const Point&)Point(), maPrgsFrameRect.GetSize() ) ); Rectangle aNativeControlRegion, aNativeContentRegion; - if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion, + if( (bNativeOK = GetNativeControlRegion( ControlType::Progress, PART_ENTIRE_CONTROL, aControlRegion, ControlState::ENABLED, aValue, OUString(), aNativeControlRegion, aNativeContentRegion ) ) ) { @@ -1436,12 +1436,12 @@ Size StatusBar::CalcWindowSizePixel() const const long nBarTextOffset = STATUSBAR_OFFSET_TEXTY*2; long nProgressHeight = nMinHeight + nBarTextOffset; - if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) ) + if( IsNativeControlSupported( ControlType::Progress, PART_ENTIRE_CONTROL ) ) { ImplControlValue aValue; Rectangle aControlRegion( (const Point&)Point(), Size( nCalcWidth, nMinHeight ) ); Rectangle aNativeControlRegion, aNativeContentRegion; - if( GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, + if( GetNativeControlRegion( ControlType::Progress, PART_ENTIRE_CONTROL, aControlRegion, ControlState::ENABLED, aValue, OUString(), aNativeControlRegion, aNativeContentRegion ) ) { @@ -1450,12 +1450,12 @@ Size StatusBar::CalcWindowSizePixel() const } if( mpImplData->mbDrawItemFrames && - IsNativeControlSupported( CTRL_FRAME, PART_BORDER ) ) + IsNativeControlSupported( ControlType::Frame, PART_BORDER ) ) { ImplControlValue aControlValue( static_cast<long>(DrawFrameFlags::NoDraw) ); Rectangle aBound, aContent; Rectangle aNatRgn( Point( 0, 0 ), Size( 150, 50 ) ); - if( GetNativeControlRegion(CTRL_FRAME, PART_BORDER, + if( GetNativeControlRegion(ControlType::Frame, PART_BORDER, aNatRgn, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { mpImplData->mnItemBorderWidth = diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index 5bd0b8301c9f..2a317f1debe6 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -42,7 +42,7 @@ void TabPage::ImplInit( vcl::Window* pParent, WinBits nStyle ) // if the tabpage is drawn (ie filled) by a native widget, make sure all controls will have transparent background // otherwise they will paint with a wrong background - if( IsNativeControlSupported(CTRL_TAB_BODY, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) ) + if( IsNativeControlSupported(ControlType::TabBody, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) ) EnableChildTransparentMode(); } @@ -129,7 +129,7 @@ void TabPage::DataChanged( const DataChangedEvent& rDCEvt ) void TabPage::Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) { // draw native tabpage only inside tabcontrols, standalone tabpages look ugly (due to bad dialog design) - if( IsNativeControlSupported(CTRL_TAB_BODY, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) ) + if( IsNativeControlSupported(ControlType::TabBody, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) ) { const ImplControlValue aControlValue; @@ -143,7 +143,7 @@ void TabPage::Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) // 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 Rectangle aCtrlRegion( aPoint, GetOutputSizePixel() ); - rRenderContext.DrawNativeControl( CTRL_TAB_BODY, part, aCtrlRegion, nState, + rRenderContext.DrawNativeControl( ControlType::TabBody, part, aCtrlRegion, nState, aControlValue, OUString() ); } } diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index f75a03a43852..d725275e3fc9 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -147,7 +147,7 @@ static ImplTBDragMgr* ImplGetTBDragMgr() int ToolBox::ImplGetDragWidth( ToolBox* pThis ) { int nWidth = TB_DRAGWIDTH; - if( pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) ) + if( pThis->IsNativeControlSupported( ControlType::Toolbar, PART_ENTIRE_CONTROL ) ) { ImplControlValue aControlValue; @@ -155,7 +155,7 @@ int ToolBox::ImplGetDragWidth( ToolBox* pThis ) Rectangle aContent, aBound; Rectangle aArea( aPoint, pThis->GetOutputSizePixel() ); - if ( pThis->GetNativeControlRegion(CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ, + if ( pThis->GetNativeControlRegion(ControlType::Toolbar, pThis->mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ, aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) ) { nWidth = pThis->mbHorz ? aContent.GetWidth() : aContent.GetHeight(); @@ -268,7 +268,7 @@ void ToolBox::ImplDrawGrip(vcl::RenderContext& rRenderContext) ImplCheckUpdate(this); bool bNativeOk = false; - if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, mbHorz ? PART_THUMB_HORZ : PART_THUMB_VERT)) + if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, mbHorz ? PART_THUMB_HORZ : PART_THUMB_VERT)) { ToolbarValue aToolbarValue; aToolbarValue.maGripRect = pWrapper->GetDragArea(); @@ -277,7 +277,7 @@ void ToolBox::ImplDrawGrip(vcl::RenderContext& rRenderContext) Rectangle aCtrlRegion(aPt, GetOutputSizePixel()); ControlState nState = ControlState::ENABLED; - bNativeOk = rRenderContext.DrawNativeControl( CTRL_TOOLBAR, mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ, + bNativeOk = rRenderContext.DrawNativeControl( ControlType::Toolbar, mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ, aCtrlRegion, nState, aToolbarValue, OUString() ); } @@ -450,7 +450,7 @@ bool ToolBox::ImplDrawNativeBackground(vcl::RenderContext& rRenderContext, const Rectangle aCtrlRegion(aPt, GetOutputSizePixel()); ControlState nState = ControlState::ENABLED; - return rRenderContext.DrawNativeControl( CTRL_TOOLBAR, mbHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT, + return rRenderContext.DrawNativeControl( ControlType::Toolbar, mbHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT, aCtrlRegion, nState, ImplControlValue(), OUString() ); } @@ -514,7 +514,7 @@ void ToolBox::ImplDrawBackground(vcl::RenderContext& rRenderContext, const Recta // docked toolbars are transparent and NWF is already used in the docking area which is their common background // so NWF is used here for floating toolbars only bool bNativeOk = false; - if( ImplIsFloatingMode() && rRenderContext.IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL) ) + if( ImplIsFloatingMode() && rRenderContext.IsNativeControlSupported( ControlType::Toolbar, PART_ENTIRE_CONTROL) ) bNativeOk = ImplDrawNativeBackground(rRenderContext, aPaintRegion); const StyleSettings rSetting = Application::GetSettings().GetStyleSettings(); if (!bNativeOk) @@ -1415,7 +1415,7 @@ void ToolBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) void ToolBox::ApplySettings(vcl::RenderContext& rRenderContext) { - mpData->mbNativeButtons = rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_BUTTON); + mpData->mbNativeButtons = rRenderContext.IsNativeControlSupported(ControlType::Toolbar, PART_BUTTON); const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); @@ -1445,7 +1445,7 @@ void ToolBox::ApplySettings(vcl::RenderContext& rRenderContext) } else { - if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_ENTIRE_CONTROL) + if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, PART_ENTIRE_CONTROL) || (GetAlign() == WindowAlign::Top && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty()) || (GetAlign() == WindowAlign::Bottom && !Application::GetSettings().GetStyleSettings().GetPersonaFooter().IsEmpty())) { @@ -1471,7 +1471,7 @@ void ToolBox::ApplySettings(vcl::RenderContext& rRenderContext) void ToolBox::ImplInitSettings(bool bFont, bool bForeground, bool bBackground) { - mpData->mbNativeButtons = IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ); + mpData->mbNativeButtons = IsNativeControlSupported( ControlType::Toolbar, PART_BUTTON ); const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -1508,7 +1508,7 @@ void ToolBox::ImplInitSettings(bool bFont, bool bForeground, bool bBackground) } else { - if (IsNativeControlSupported(CTRL_TOOLBAR, PART_ENTIRE_CONTROL) + if (IsNativeControlSupported(ControlType::Toolbar, PART_ENTIRE_CONTROL) || (GetAlign() == WindowAlign::Top && !Application::GetSettings().GetStyleSettings().GetPersonaHeader().IsEmpty()) || (GetAlign() == WindowAlign::Bottom && !Application::GetSettings().GetStyleSettings().GetPersonaFooter().IsEmpty())) { @@ -1730,9 +1730,9 @@ bool ToolBox::ImplCalcItem() Rectangle aReg( aRect ); ImplControlValue aVal; Rectangle aNativeBounds, aNativeContent; - if( IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) + if( IsNativeControlSupported( ControlType::Toolbar, PART_BUTTON ) ) { - if( GetNativeControlRegion( CTRL_TOOLBAR, PART_BUTTON, + if( GetNativeControlRegion( ControlType::Toolbar, PART_BUTTON, aReg, ControlState::ENABLED | ControlState::ROLLOVER, aVal, OUString(), @@ -1757,7 +1757,7 @@ bool ToolBox::ImplCalcItem() // greater of those values to prevent toolbar flickering (#i103385#) aRect = Rectangle( Point( 0, 0 ), Size( nMinWidth, nMinHeight ) ); aReg = aRect; - if( GetNativeControlRegion( CTRL_COMBOBOX, PART_ENTIRE_CONTROL, + if( GetNativeControlRegion( ControlType::Combobox, PART_ENTIRE_CONTROL, aReg, ControlState::ENABLED | ControlState::ROLLOVER, aVal, OUString(), @@ -1769,7 +1769,7 @@ bool ToolBox::ImplCalcItem() } aRect = Rectangle( Point( 0, 0 ), Size( nMinWidth, nMinHeight ) ); aReg = aRect; - if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, + if( GetNativeControlRegion( ControlType::Listbox, PART_ENTIRE_CONTROL, aReg, ControlState::ENABLED | ControlState::ROLLOVER, aVal, OUString(), @@ -1781,7 +1781,7 @@ bool ToolBox::ImplCalcItem() } aRect = Rectangle( Point( 0, 0 ), Size( nMinWidth, nMinHeight ) ); aReg = aRect; - if( GetNativeControlRegion( CTRL_SPINBOX, PART_ENTIRE_CONTROL, + if( GetNativeControlRegion( ControlType::Spinbox, PART_ENTIRE_CONTROL, aReg, ControlState::ENABLED | ControlState::ROLLOVER, aVal, OUString(), @@ -2926,11 +2926,11 @@ void ToolBox::ImplDrawSeparator(vcl::RenderContext& rRenderContext, sal_uInt16 n bool bNativeOk = false; ControlPart nPart = IsHorizontal() ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ; - if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, nPart)) + if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, nPart)) { ImplControlValue aControlValue; ControlState nState = ControlState::NONE; - bNativeOk = rRenderContext.DrawNativeControl(CTRL_TOOLBAR, nPart, rRect, nState, aControlValue, OUString()); + bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, nPart, rRect, nState, aControlValue, OUString()); } /* Draw the widget only if it can't be drawn natively. */ @@ -2963,7 +2963,7 @@ void ToolBox::ImplDrawButton(vcl::RenderContext& rRenderContext, const Rectangle // if bIsWindow is true, the corresponding item is a control and only a selection border will be drawn bool bNativeOk = false; - if( !bIsWindow && rRenderContext.IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) + if( !bIsWindow && rRenderContext.IsNativeControlSupported( ControlType::Toolbar, PART_BUTTON ) ) { ImplControlValue aControlValue; ControlState nState = ControlState::NONE; @@ -2974,7 +2974,7 @@ void ToolBox::ImplDrawButton(vcl::RenderContext& rRenderContext, const Rectangle aControlValue.setTristateVal( bChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF ); - bNativeOk = rRenderContext.DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON, + bNativeOk = rRenderContext.DrawNativeControl( ControlType::Toolbar, PART_BUTTON, rRect, nState, aControlValue, OUString() ); } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 140ad6029f0c..e37a0520b444 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1201,7 +1201,7 @@ void Window::ImplInitAppFontData( vcl::Window* pWindow ) Rectangle aCtrlRegion( Point(), Size( nTextWidth < 10 ? 10 : nTextWidth, nTextHeight < 10 ? 10 : nTextHeight ) ); Rectangle aBoundingRgn( aCtrlRegion ); Rectangle aContentRgn( aCtrlRegion ); - if( pWindow->GetNativeControlRegion( CTRL_EDITBOX, PART_ENTIRE_CONTROL, aCtrlRegion, + if( pWindow->GetNativeControlRegion( ControlType::Editbox, PART_ENTIRE_CONTROL, aCtrlRegion, ControlState::ENABLED, aControlValue, OUString(), aBoundingRgn, aContentRgn ) ) { diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx index d6ecd335060e..62ab80da5de0 100644 --- a/vcl/unx/gtk/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx @@ -346,13 +346,13 @@ GdkDrawable* GdkX11Pixmap::GetGdkDrawable() const class NWPixmapCacheData { public: - ControlType m_nType; - ControlState m_nState; + ControlType m_nType; + ControlState m_nState; Rectangle m_pixmapRect; GdkX11Pixmap* m_pixmap; GdkX11Pixmap* m_mask; - NWPixmapCacheData() : m_nType(0), m_nState(ControlState::NONE), m_pixmap(nullptr), m_mask(nullptr) {} + NWPixmapCacheData() : m_nType(ControlType::Generic), m_nState(ControlState::NONE), m_pixmap(nullptr), m_mask(nullptr) {} ~NWPixmapCacheData() { SetPixmap( nullptr, nullptr ); }; void SetPixmap( GdkX11Pixmap* pPixmap, GdkX11Pixmap* pMask ); @@ -656,57 +656,57 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP { switch(nType) { - case CTRL_PUSHBUTTON: - case CTRL_RADIOBUTTON: - case CTRL_CHECKBOX: - case CTRL_TOOLTIP: - case CTRL_PROGRESS: - case CTRL_LISTNODE: - case CTRL_LISTNET: + case ControlType::Pushbutton: + case ControlType::Radiobutton: + case ControlType::Checkbox: + case ControlType::Tooltip: + case ControlType::Progress: + case ControlType::ListNode: + case ControlType::ListNet: if(nPart==PART_ENTIRE_CONTROL) return true; break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: if(nPart==PART_DRAW_BACKGROUND_HORZ || nPart==PART_DRAW_BACKGROUND_VERT || nPart==PART_ENTIRE_CONTROL || nPart==HAS_THREE_BUTTONS) return true; break; - case CTRL_EDITBOX: - case CTRL_MULTILINE_EDITBOX: - case CTRL_COMBOBOX: + case ControlType::Editbox: + case ControlType::MultilineEditbox: + case ControlType::Combobox: if(nPart==PART_ENTIRE_CONTROL || nPart==HAS_BACKGROUND_TEXTURE) return true; break; - case CTRL_SPINBOX: + case ControlType::Spinbox: if(nPart==PART_ENTIRE_CONTROL || nPart==PART_ALL_BUTTONS || nPart==HAS_BACKGROUND_TEXTURE) return true; break; - case CTRL_SPINBUTTONS: + case ControlType::SpinButtons: if(nPart==PART_ENTIRE_CONTROL || nPart==PART_ALL_BUTTONS) return true; break; - case CTRL_FRAME: - case CTRL_WINDOW_BACKGROUND: + case ControlType::Frame: + case ControlType::WindowBackground: return true; - case CTRL_TAB_ITEM: - case CTRL_TAB_PANE: - case CTRL_TAB_BODY: + case ControlType::TabItem: + case ControlType::TabPane: + case ControlType::TabBody: if(nPart==PART_ENTIRE_CONTROL || nPart==PART_TABS_DRAW_RTL) return true; break; - case CTRL_LISTBOX: + case ControlType::Listbox: if(nPart==PART_ENTIRE_CONTROL || nPart==PART_WINDOW || nPart==HAS_BACKGROUND_TEXTURE) return true; break; - case CTRL_TOOLBAR: + case ControlType::Toolbar: if( nPart==PART_ENTIRE_CONTROL || nPart==PART_DRAW_BACKGROUND_HORZ || nPart==PART_DRAW_BACKGROUND_VERT @@ -719,12 +719,12 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP return true; break; - case CTRL_MENUBAR: + case ControlType::Menubar: if(nPart==PART_ENTIRE_CONTROL || nPart==PART_MENU_ITEM) return true; break; - case CTRL_MENU_POPUP: + case ControlType::MenuPopup: if (nPart==PART_ENTIRE_CONTROL || nPart==PART_MENU_ITEM || nPart==PART_MENU_ITEM_CHECK_MARK @@ -735,20 +735,21 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP return true; break; - case CTRL_SLIDER: + case ControlType::Slider: if(nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA) return true; break; - case CTRL_FIXEDLINE: + case ControlType::Fixedline: if(nPart == PART_SEPARATOR_VERT || nPart == PART_SEPARATOR_HORZ) return true; break; - case CTRL_LISTHEADER: + case ControlType::ListHeader: if(nPart == PART_BUTTON || nPart == PART_ARROW) return true; break; + default: break; } return false; @@ -769,7 +770,7 @@ bool GtkSalGraphics::hitTestNativeControl( ControlType nType, const Point& aPos, bool& rIsInside ) { - if ( ( nType == CTRL_SCROLLBAR ) && + if ( ( nType == ControlType::Scrollbar ) && ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_DOWN ) || ( nPart == PART_BUTTON_LEFT ) || @@ -917,12 +918,12 @@ bool GtkSalGraphics::drawNativeControl(ControlType nType, ControlPart nPart, std::unique_ptr<GdkX11Pixmap> xMask; if ((bNeedPixmapPaint || (nState & ControlState::DOUBLEBUFFERING)) - && nType != CTRL_SCROLLBAR - && nType != CTRL_SPINBOX - && nType != CTRL_TAB_ITEM - && nType != CTRL_TAB_PANE - && nType != CTRL_PROGRESS - && ! (nType == CTRL_TOOLBAR && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) ) + && nType != ControlType::Scrollbar + && nType != ControlType::Spinbox + && nType != ControlType::TabItem + && nType != ControlType::TabPane + && nType != ControlType::Progress + && ! (nType == ControlType::Toolbar && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) ) ) { if( bNeedTwoPasses ) @@ -997,65 +998,65 @@ bool GtkSalGraphics::DoDrawNativeControl( const OUString& rCaption, ControlCacheKey& rControlCacheKey) { - if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL) ) + if ( (nType==ControlType::Pushbutton) && (nPart==PART_ENTIRE_CONTROL) ) { return NWPaintGTKButton( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if ( (nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL) ) + else if ( (nType==ControlType::Radiobutton) && (nPart==PART_ENTIRE_CONTROL) ) { return NWPaintGTKRadio( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if ( (nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL) ) + else if ( (nType==ControlType::Checkbox) && (nPart==PART_ENTIRE_CONTROL) ) { return NWPaintGTKCheck( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_DRAW_BACKGROUND_HORZ) || (nPart==PART_DRAW_BACKGROUND_VERT)) ) + else if ( (nType==ControlType::Scrollbar) && ((nPart==PART_DRAW_BACKGROUND_HORZ) || (nPart==PART_DRAW_BACKGROUND_VERT)) ) { return NWPaintGTKScrollbar( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if ( ((nType==CTRL_EDITBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==HAS_BACKGROUND_TEXTURE)) ) - || ((nType==CTRL_SPINBOX) && (nPart==HAS_BACKGROUND_TEXTURE)) - || ((nType==CTRL_COMBOBOX) && (nPart==HAS_BACKGROUND_TEXTURE)) - || ((nType==CTRL_LISTBOX) && (nPart==HAS_BACKGROUND_TEXTURE)) ) + else if ( ((nType==ControlType::Editbox) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==HAS_BACKGROUND_TEXTURE)) ) + || ((nType==ControlType::Spinbox) && (nPart==HAS_BACKGROUND_TEXTURE)) + || ((nType==ControlType::Combobox) && (nPart==HAS_BACKGROUND_TEXTURE)) + || ((nType==ControlType::Listbox) && (nPart==HAS_BACKGROUND_TEXTURE)) ) { return NWPaintGTKEditBox( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if ( ((nType==CTRL_MULTILINE_EDITBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==HAS_BACKGROUND_TEXTURE)) ) ) + else if ( ((nType==ControlType::MultilineEditbox) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==HAS_BACKGROUND_TEXTURE)) ) ) { return NWPaintGTKEditBox( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if ( ((nType==CTRL_SPINBOX) || (nType==CTRL_SPINBUTTONS)) + else if ( ((nType==ControlType::Spinbox) || (nType==ControlType::SpinButtons)) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_ALL_BUTTONS)) ) { return NWPaintGTKSpinBox(nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption, rControlCacheKey); } - else if ( (nType == CTRL_COMBOBOX) && + else if ( (nType == ControlType::Combobox) && ( (nPart==PART_ENTIRE_CONTROL) ||(nPart==PART_BUTTON_DOWN) ) ) { return NWPaintGTKComboBox( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if ( (nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) || (nType==CTRL_TAB_BODY) ) + else if ( (nType==ControlType::TabItem) || (nType==ControlType::TabPane) || (nType==ControlType::TabBody) ) { - if ( nType == CTRL_TAB_BODY ) + if ( nType == ControlType::TabBody ) return true; else return NWPaintGTKTabItem( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption); } - else if ( (nType==CTRL_LISTBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_WINDOW)) ) + else if ( (nType==ControlType::Listbox) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_WINDOW)) ) { return NWPaintGTKListBox( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if ( nType== CTRL_TOOLBAR ) + else if ( nType== ControlType::Toolbar ) { return NWPaintGTKToolbar( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if ( nType== CTRL_MENUBAR ) + else if ( nType== ControlType::Menubar ) { return NWPaintGTKMenubar( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if( (nType == CTRL_MENU_POPUP) + else if( (nType == ControlType::MenuPopup) && ( (nPart == PART_ENTIRE_CONTROL) || (nPart == PART_MENU_ITEM) || (nPart == PART_MENU_ITEM_CHECK_MARK) @@ -1067,40 +1068,40 @@ bool GtkSalGraphics::DoDrawNativeControl( { return NWPaintGTKPopupMenu( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if( (nType == CTRL_TOOLTIP) && (nPart == PART_ENTIRE_CONTROL) ) + else if( (nType == ControlType::Tooltip) && (nPart == PART_ENTIRE_CONTROL) ) { return NWPaintGTKTooltip( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if( (nType == CTRL_PROGRESS) && (nPart == PART_ENTIRE_CONTROL) ) + else if( (nType == ControlType::Progress) && (nPart == PART_ENTIRE_CONTROL) ) { return NWPaintGTKProgress( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if( (nType == CTRL_LISTNODE) && (nPart == PART_ENTIRE_CONTROL) ) + else if( (nType == ControlType::ListNode) && (nPart == PART_ENTIRE_CONTROL) ) { return NWPaintGTKListNode( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if( (nType == CTRL_LISTNET) && (nPart == PART_ENTIRE_CONTROL) ) + else if( (nType == ControlType::ListNet) && (nPart == PART_ENTIRE_CONTROL) ) { // don't actually draw anything; gtk treeviews do not draw lines return TRUE; } - else if( nType == CTRL_SLIDER ) + else if( nType == ControlType::Slider ) { return NWPaintGTKSlider( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if( nType == CTRL_WINDOW_BACKGROUND ) + else if( nType == ControlType::WindowBackground ) { return NWPaintGTKWindowBackground( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if( nType == CTRL_FIXEDLINE ) + else if( nType == ControlType::Fixedline ) { return NWPaintGTKFixedLine( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } - else if(nType==CTRL_FRAME) + else if(nType==ControlType::Frame) { return NWPaintGTKFrame( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption); } - else if(nType==CTRL_LISTHEADER) + else if(nType==ControlType::ListHeader) { if(nPart == PART_BUTTON) return NWPaintGTKListHeader( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); @@ -1135,7 +1136,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, { bool returnVal = false; - if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL) + if ( (nType==ControlType::Pushbutton) && (nPart==PART_ENTIRE_CONTROL) && (rControlRegion.GetWidth() > 16) && (rControlRegion.GetHeight() > 16) ) { @@ -1145,13 +1146,13 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, returnVal = true; } - if (nType == CTRL_TAB_ITEM && nPart == PART_ENTIRE_CONTROL) + if (nType == ControlType::TabItem && nPart == PART_ENTIRE_CONTROL) { rNativeBoundingRegion = NWGetTabItemRect(m_nXScreen, rControlRegion); rNativeContentRegion = rNativeBoundingRegion; returnVal = true; } - if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) + if ( (nType==ControlType::Combobox) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); @@ -1159,7 +1160,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, returnVal = true; } - if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) + if ( (nType==ControlType::Spinbox) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { rNativeBoundingRegion = NWGetSpinButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState, @@ -1168,7 +1169,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, returnVal = true; } - if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) + if ( (nType==ControlType::Listbox) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { rNativeBoundingRegion = NWGetListBoxButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState, aValue, rCaption ); @@ -1176,7 +1177,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, returnVal = true; } - if ( (nType==CTRL_TOOLBAR) && + if ( (nType==ControlType::Toolbar) && ((nPart==PART_DRAW_BACKGROUND_HORZ) || (nPart==PART_DRAW_BACKGROUND_VERT) || (nPart==PART_THUMB_HORZ) || @@ -1188,7 +1189,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, rNativeContentRegion = rNativeBoundingRegion; returnVal = true; } - if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) || + if ( (nType==ControlType::Scrollbar) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) || (nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ) ) { rNativeBoundingRegion = NWGetScrollButtonRect( m_nXScreen, nPart, rControlRegion ); @@ -1201,7 +1202,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1; returnVal = true; } - if( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL) ) + if( (nType == ControlType::Menubar) && (nPart == PART_ENTIRE_CONTROL) ) { NWEnsureGTKMenubar( m_nXScreen ); GtkRequisition aReq; @@ -1213,7 +1214,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, rNativeContentRegion = rNativeBoundingRegion; returnVal = true; } - if( nType == CTRL_MENU_POPUP ) + if( nType == ControlType::MenuPopup ) { if( (nPart == PART_MENU_ITEM_CHECK_MARK) || (nPart == PART_MENU_ITEM_RADIO_MARK) ) @@ -1278,11 +1279,11 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, returnVal = true; } } - if( (nType == CTRL_RADIOBUTTON || nType == CTRL_CHECKBOX) ) + if( (nType == ControlType::Radiobutton || nType == ControlType::Checkbox) ) { NWEnsureGTKRadio( m_nXScreen ); NWEnsureGTKCheck( m_nXScreen ); - GtkWidget* widget = (nType == CTRL_RADIOBUTTON) ? gWidgetData[m_nXScreen].gRadioWidget : gWidgetData[m_nXScreen].gCheckWidget; + GtkWidget* widget = (nType == ControlType::Radiobutton) ? gWidgetData[m_nXScreen].gRadioWidget : gWidgetData[m_nXScreen].gCheckWidget; gint indicator_size, indicator_spacing, focusPad, focusWidth; gtk_widget_style_get( widget, "indicator_size", &indicator_size, @@ -1298,7 +1299,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, rNativeContentRegion = aIndicatorRect; returnVal = true; } - if( (nType == CTRL_EDITBOX || nType == CTRL_SPINBOX || nType == CTRL_COMBOBOX) && nPart == PART_ENTIRE_CONTROL ) + if( (nType == ControlType::Editbox || nType == ControlType::Spinbox || nType == ControlType::Combobox) && nPart == PART_ENTIRE_CONTROL ) { NWEnsureGTKEditBox( m_nXScreen ); GtkWidget* widget = gWidgetData[m_nXScreen].gEditBoxWidget; @@ -1312,7 +1313,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, rNativeContentRegion = rNativeBoundingRegion; returnVal = true; } - if( (nType == CTRL_SLIDER) && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) ) + if( (nType == ControlType::Slider) && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) ) { NWEnsureGTKSlider( m_nXScreen ); GtkWidget* widget = (nPart == PART_THUMB_HORZ) ? gWidgetData[m_nXScreen].gHScale : gWidgetData[m_nXScreen].gVScale; @@ -1336,7 +1337,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, rNativeBoundingRegion = rNativeContentRegion = aRect; returnVal = true; } - if( nType == CTRL_FRAME && nPart == PART_BORDER ) + if( nType == ControlType::Frame && nPart == PART_BORDER ) { int frameWidth = getFrameWidth(gWidgetData[m_nXScreen].gFrame); rNativeBoundingRegion = rControlRegion; @@ -1953,7 +1954,7 @@ bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart, const ImplControlValue& aValue, const OUString& ) { - assert(aValue.getType() == CTRL_SCROLLBAR); + assert(aValue.getType() == ControlType::Scrollbar); const ScrollbarValue& rScrollbarVal = static_cast<const ScrollbarValue&>(aValue); GdkX11Pixmap* pixmap = nullptr; Rectangle pixmapRect, scrollbarRect; @@ -2435,14 +2436,14 @@ static void NWPaintOneEditBox( SalX11Screen nScreen, switch ( nType ) { - case CTRL_SPINBOX: + case ControlType::Spinbox: widget = gWidgetData[nScreen].gSpinButtonWidget; break; - case CTRL_MULTILINE_EDITBOX: + case ControlType::MultilineEditbox: widget = gWidgetData[nScreen].gScrolledWindowWidget; break; - case CTRL_COMBOBOX: + case ControlType::Combobox: widget = GTK_COMBO(gWidgetData[nScreen].gComboWidget)->entry; break; @@ -2491,7 +2492,7 @@ bool GtkSalGraphics::NWPaintGTKSpinBox(ControlType nType, ControlPart nPart, Rectangle pixmapRect; GtkStateType stateType; GtkShadowType shadowType; - const SpinbuttonValue * pSpinVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&aValue) : nullptr; + const SpinbuttonValue * pSpinVal = (aValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue *>(&aValue) : nullptr; Rectangle upBtnRect; ControlPart upBtnPart = PART_BUTTON_UP; ControlState upBtnState = ControlState::ENABLED; @@ -2528,7 +2529,7 @@ bool GtkSalGraphics::NWPaintGTKSpinBox(ControlType nType, ControlPart nPart, upBtnRect = NWGetSpinButtonRect( m_nXScreen, nType, upBtnPart, pixmapRect, upBtnState, aValue, rCaption ); downBtnRect = NWGetSpinButtonRect( m_nXScreen, nType, downBtnPart, pixmapRect, downBtnState, aValue, rCaption ); - if ( (nType==CTRL_SPINBOX) && (nPart!=PART_ALL_BUTTONS) ) + if ( (nType==ControlType::Spinbox) && (nPart!=PART_ALL_BUTTONS) ) { // Draw an edit field for SpinBoxes and ComboBoxes Rectangle aEditBoxRect( pixmapRect ); @@ -2794,7 +2795,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, const ImplControlValue& aValue, const OUString& ) { - OSL_ASSERT( nType != CTRL_TAB_ITEM || aValue.getType() == CTRL_TAB_ITEM ); + OSL_ASSERT( nType != ControlType::TabItem || aValue.getType() == ControlType::TabItem ); GdkX11Pixmap * pixmap; GdkX11Pixmap * mask; Rectangle pixmapRect; @@ -2814,7 +2815,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, if( !aCachePage.GetSize() ) aCachePage.SetSize( 1 ); - if ( (nType == CTRL_TAB_ITEM) && (aValue.getType() != CTRL_TAB_ITEM) ) + if ( (nType == ControlType::TabItem) && (aValue.getType() != ControlType::TabItem) ) { return false; } @@ -2826,7 +2827,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, // Find the overall bounding rect of the buttons's drawing area, // plus its actual draw rect excluding adornment pixmapRect = rControlRectangle; - if ( nType == CTRL_TAB_ITEM ) + if ( nType == ControlType::TabItem ) { const TabitemValue * pTabitemValue = static_cast<const TabitemValue *>(&aValue); if ( !pTabitemValue->isFirst() ) @@ -2857,7 +2858,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, return false; } - if( nType == CTRL_TAB_ITEM ) + if( nType == ControlType::TabItem ) { if( aCacheItems.Find( nType, nState, pixmapRect, &pixmap, &mask ) ) return NWRenderPixmapToScreen( pixmap, mask, pixmapRect ); @@ -2886,15 +2887,15 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, switch( nType ) { - case CTRL_TAB_BODY: + case ControlType::TabBody: break; - case CTRL_TAB_PANE: + case ControlType::TabPane: gtk_paint_box_gap( gWidgetData[m_nXScreen].gNotebookWidget->style, gdkPixmap, GTK_STATE_NORMAL, GTK_SHADOW_OUT, nullptr, gWidgetData[m_nXScreen].gNotebookWidget, "notebook", 0, 0, pixmapRect.GetWidth(), pixmapRect.GetHeight(), GTK_POS_TOP, 0, 0 ); break; - case CTRL_TAB_ITEM: + case ControlType::TabItem: { stateType = ( nState & ControlState::SELECTED ) ? GTK_STATE_NORMAL : GTK_STATE_ACTIVE; @@ -2931,7 +2932,7 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, END_CACHE_PIXMAP_RENDER( pixmapRect, pixmap, mask ) // cache data - if( nType == CTRL_TAB_ITEM ) + if( nType == ControlType::TabItem ) aCacheItems.Fill( nType, nState, pixmapRect, pixmap, mask ); else aCachePage.Fill( nType, nState, pixmapRect, pixmap, mask ); @@ -3066,7 +3067,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar( gtk_handle_box_set_shadow_type( GTK_HANDLE_BOX(gWidgetData[m_nXScreen].gHandleBoxWidget), shadowType ); // evaluate grip rect - if( aValue.getType() == CTRL_TOOLBAR ) + if( aValue.getType() == ControlType::Toolbar ) { const ToolbarValue* pVal = static_cast<const ToolbarValue*>(&aValue); g_x = pVal->maGripRect.Left(); @@ -3091,7 +3092,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar( NWSetWidgetState( pButtonWidget, nState, stateType ); gtk_widget_ensure_style( pButtonWidget ); if(bPaintButton) - NWPaintGTKButtonReal(pButtonWidget, gdkDrawable, 0, 0, rControlRectangle, rClipList, nState, aValue, string); + NWPaintGTKButtonReal(pButtonWidget, gdkDrawable, ControlType::Generic, 0, rControlRectangle, rClipList, nState, aValue, string); } if( nPart != PART_BUTTON ) @@ -3608,7 +3609,7 @@ bool GtkSalGraphics::NWPaintGTKSlider( ControlState nState, const ImplControlValue& rValue, const OUString& ) { - OSL_ASSERT( rValue.getType() == CTRL_SLIDER ); + OSL_ASSERT( rValue.getType() == ControlType::Slider ); NWEnsureGTKSlider( m_nXScreen ); gint w, h; diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index b5fb915c1e30..8f8ee83fdd26 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -298,7 +298,7 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, const ImplControlValue& rValue ) { (void)nType; - OSL_ASSERT( rValue.getType() == CTRL_SCROLLBAR ); + OSL_ASSERT( rValue.getType() == ControlType::Scrollbar ); const ScrollbarValue& rScrollbarVal = static_cast<const ScrollbarValue&>(rValue); Rectangle scrollbarRect; GtkStateFlags stateFlags; @@ -642,7 +642,7 @@ void GtkSalGraphics::PaintSpinButton(GtkStyleContext *context, ControlPart nPart, const ImplControlValue& rValue ) { - const SpinbuttonValue *pSpinVal = (rValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&rValue) : nullptr; + const SpinbuttonValue *pSpinVal = (rValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue *>(&rValue) : nullptr; ControlPart upBtnPart = PART_BUTTON_UP; ControlState upBtnState = ControlState::NONE; ControlPart downBtnPart = PART_BUTTON_DOWN; @@ -745,7 +745,7 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr, buttonRect.Top() + (gint)((buttonRect.GetHeight() - arrowRect.GetHeight()) / 2) ) ); - if ( nType == CTRL_COMBOBOX ) + if ( nType == ControlType::Combobox ) { gtk_style_context_save(mpComboboxButtonStyle); gtk_style_context_set_state(mpComboboxButtonStyle, flags); @@ -792,7 +792,7 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr, gtk_style_context_restore(mpComboboxButtonStyle); } - else if (nType == CTRL_LISTBOX) + else if (nType == ControlType::Listbox) { if( nPart == PART_WINDOW ) { @@ -1208,26 +1208,26 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co switch(nType) { - case CTRL_SPINBOX: - case CTRL_SPINBUTTONS: + case ControlType::Spinbox: + case ControlType::SpinButtons: context = mpEntryStyle; renderType = RENDER_SPINBUTTON; break; - case CTRL_EDITBOX: + case ControlType::Editbox: context = mpEntryStyle; break; - case CTRL_MULTILINE_EDITBOX: + case ControlType::MultilineEditbox: context = mpTextViewStyle; break; - case CTRL_COMBOBOX: + case ControlType::Combobox: context = mpComboboxStyle; renderType = RENDER_COMBOBOX; break; - case CTRL_LISTBOX: + case ControlType::Listbox: context = mpListboxStyle; renderType = nPart == PART_FOCUS ? RENDER_FOCUS : RENDER_COMBOBOX; break; - case CTRL_MENU_POPUP: + case ControlType::MenuPopup: bInMenu = true; // map selected menu entries in vcl parlance to gtk prelight @@ -1248,7 +1248,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co styleClass = GTK_STYLE_CLASS_CHECK; #endif renderType = RENDER_CHECK; - nType = CTRL_CHECKBOX; + nType = ControlType::Checkbox; if (nState & ControlState::PRESSED) { flags = (GtkStateFlags)(flags | CHECKED); @@ -1262,7 +1262,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co styleClass = GTK_STYLE_CLASS_RADIO; #endif renderType = RENDER_RADIO; - nType = CTRL_RADIOBUTTON; + nType = ControlType::Radiobutton; if (nState & ControlState::PRESSED) { flags = (GtkStateFlags)(flags | CHECKED); @@ -1288,7 +1288,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co break; } break; - case CTRL_TOOLBAR: + case ControlType::Toolbar: switch(nPart) { case PART_DRAW_BACKGROUND_HORZ: @@ -1309,13 +1309,13 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co return false; } break; - case CTRL_RADIOBUTTON: + case ControlType::Radiobutton: flags = (GtkStateFlags)(flags | ( (rValue.getTristateVal() == BUTTONVALUE_ON) ? CHECKED : GTK_STATE_FLAG_NORMAL)); context = mpRadioButtonStyle; renderType = nPart == PART_FOCUS ? RENDER_FOCUS : RENDER_RADIO; break; - case CTRL_CHECKBOX: + case ControlType::Checkbox: flags = (GtkStateFlags)(flags | ( (rValue.getTristateVal() == BUTTONVALUE_ON) ? CHECKED : (rValue.getTristateVal() == BUTTONVALUE_MIXED) ? GTK_STATE_FLAG_INCONSISTENT : @@ -1323,10 +1323,10 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co context = mpCheckButtonStyle; renderType = nPart == PART_FOCUS ? RENDER_FOCUS : RENDER_CHECK; break; - case CTRL_PUSHBUTTON: + case ControlType::Pushbutton: context = mpButtonStyle; break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: switch(nPart) { case PART_DRAW_BACKGROUND_VERT: @@ -1337,27 +1337,27 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co break; } break; - case CTRL_LISTNET: + case ControlType::ListNet: return true; break; - case CTRL_TAB_PANE: + case ControlType::TabPane: context = mpNotebookStyle; break; - case CTRL_TAB_BODY: + case ControlType::TabBody: context = mpNotebookStackStyle; break; - case CTRL_TAB_HEADER: + case ControlType::TabHeader: context = mpNotebookHeaderStyle; break; - case CTRL_TAB_ITEM: + case ControlType::TabItem: context = mpNotebookHeaderTabsTabStyle; if (nState & ControlState::SELECTED) flags = (GtkStateFlags) (flags | ACTIVE_TAB); break; - case CTRL_WINDOW_BACKGROUND: + case ControlType::WindowBackground: context = gtk_widget_get_style_context(mpWindow); break; - case CTRL_FRAME: + case ControlType::Frame: { DrawFrameStyle nStyle = static_cast<DrawFrameStyle>(rValue.getNumericVal() & 0x0f); if (nStyle == DrawFrameStyle::In) @@ -1366,7 +1366,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co context = mpFrameInStyle; break; } - case CTRL_MENUBAR: + case ControlType::Menubar: if (nPart == PART_MENU_ITEM) { context = mpMenuBarItemStyle; @@ -1381,11 +1381,11 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co context = gtk_widget_get_style_context(mpWindow); } break; - case CTRL_FIXEDLINE: + case ControlType::Fixedline: context = nPart == PART_SEPARATOR_HORZ ? mpFixedHoriLineStyle : mpFixedVertLineStyle; renderType = RENDER_SEPERATOR; break; - case CTRL_LISTNODE: + case ControlType::ListNode: { context = mpTreeHeaderButtonStyle; ButtonValue aButtonValue = rValue.getTristateVal(); @@ -1394,7 +1394,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co renderType = RENDER_EXPANDER; break; } - case CTRL_LISTHEADER: + case ControlType::ListHeader: context = mpTreeHeaderButtonStyle; if (nPart == PART_ARROW) { @@ -1407,7 +1407,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co renderType = RENDER_ICON; } break; - case CTRL_PROGRESS: + case ControlType::Progress: context = mpProgressBarProgressStyle; renderType = RENDER_PROGRESS; break; @@ -1428,7 +1428,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co gtk_style_context_set_state(context, flags); parent_styles_context_set_state(context, flags); - if (nType == CTRL_TAB_ITEM) + if (nType == ControlType::TabItem) { GtkBorder margin; #if GTK_CHECK_VERSION(3,19,2) @@ -1511,7 +1511,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co break; case RENDER_FOCUS: { - if (nType != CTRL_CHECKBOX) + if (nType != ControlType::Checkbox) { GtkBorder border; @@ -1601,12 +1601,12 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar Rectangle aEditRect = rControlRegion; gint indicator_size, indicator_spacing, point; - if(((nType == CTRL_CHECKBOX) || (nType == CTRL_RADIOBUTTON)) && + if(((nType == ControlType::Checkbox) || (nType == ControlType::Radiobutton)) && nPart == PART_ENTIRE_CONTROL) { rNativeBoundingRegion = rControlRegion; - GtkStyleContext *pButtonStyle = (nType == CTRL_CHECKBOX) ? mpCheckButtonStyle : mpRadioButtonStyle; + GtkStyleContext *pButtonStyle = (nType == ControlType::Checkbox) ? mpCheckButtonStyle : mpRadioButtonStyle; gtk_style_context_get_style( pButtonStyle, @@ -1629,7 +1629,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar return true; } - else if( nType == CTRL_MENU_POPUP) + else if( nType == ControlType::MenuPopup) { if (((nPart == PART_MENU_ITEM_CHECK_MARK) || (nPart == PART_MENU_ITEM_RADIO_MARK) )) @@ -1666,7 +1666,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar Size( arrow_size, arrow_size ) ); } } - else if ( (nType==CTRL_SCROLLBAR) && + else if ( (nType==ControlType::Scrollbar) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) || (nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ) ) { @@ -1680,44 +1680,44 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar return true; } - if( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL) ) + if( (nType == ControlType::Menubar) && (nPart == PART_ENTIRE_CONTROL) ) { aEditRect = GetWidgetSize(rControlRegion, gMenuBarWidget); } - else if ( (nType==CTRL_SPINBOX) && + else if ( (nType==ControlType::Spinbox) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { Rectangle aControlRegion(GetWidgetSize(rControlRegion, gSpinBox)); aEditRect = NWGetSpinButtonRect(nPart, aControlRegion); } - else if ( (nType==CTRL_COMBOBOX) && + else if ( (nType==ControlType::Combobox) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { aEditRect = NWGetComboBoxButtonRect( nType, nPart, rControlRegion ); } - else if ( (nType==CTRL_LISTBOX) && + else if ( (nType==ControlType::Listbox) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { aEditRect = NWGetComboBoxButtonRect( nType, nPart, rControlRegion ); } - else if (nType == CTRL_EDITBOX && nPart == PART_ENTIRE_CONTROL) + else if (nType == ControlType::Editbox && nPart == PART_ENTIRE_CONTROL) { aEditRect = GetWidgetSize(rControlRegion, gEntryBox); } - else if (nType == CTRL_LISTBOX && nPart == PART_ENTIRE_CONTROL) + else if (nType == ControlType::Listbox && nPart == PART_ENTIRE_CONTROL) { aEditRect = GetWidgetSize(rControlRegion, gListBox); } - else if (nType == CTRL_COMBOBOX && nPart == PART_ENTIRE_CONTROL) + else if (nType == ControlType::Combobox && nPart == PART_ENTIRE_CONTROL) { aEditRect = GetWidgetSize(rControlRegion, gComboBox); } - else if (nType == CTRL_SPINBOX && nPart == PART_ENTIRE_CONTROL) + else if (nType == ControlType::Spinbox && nPart == PART_ENTIRE_CONTROL) { aEditRect = GetWidgetSize(rControlRegion, gSpinBox); } - else if (nType == CTRL_TAB_ITEM && nPart == PART_ENTIRE_CONTROL) + else if (nType == ControlType::TabItem && nPart == PART_ENTIRE_CONTROL) { const TabitemValue& rTabitemValue = static_cast<const TabitemValue&>(rValue); const Rectangle& rTabitemRect = rTabitemValue.getContentRect(); @@ -1725,7 +1725,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar aEditRect = AdjustRectForTextBordersPadding(mpNotebookHeaderTabsTabStyle, rTabitemRect.GetWidth(), rTabitemRect.GetHeight(), rControlRegion); } - else if (nType == CTRL_FRAME && nPart == PART_BORDER) + else if (nType == ControlType::Frame && nPart == PART_BORDER) { aEditRect = rControlRegion; DrawFrameFlags nStyle = static_cast<DrawFrameFlags>(rValue.getNumericVal() & 0xfff0); @@ -2170,61 +2170,61 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP { switch(nType) { - case CTRL_PUSHBUTTON: - case CTRL_RADIOBUTTON: - case CTRL_CHECKBOX: - case CTRL_PROGRESS: - case CTRL_LISTNODE: - case CTRL_LISTNET: + case ControlType::Pushbutton: + case ControlType::Radiobutton: + case ControlType::Checkbox: + case ControlType::Progress: + case ControlType::ListNode: + case ControlType::ListNet: if (nPart==PART_ENTIRE_CONTROL || nPart == PART_FOCUS) return true; break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: if(nPart==PART_DRAW_BACKGROUND_HORZ || nPart==PART_DRAW_BACKGROUND_VERT || nPart==PART_ENTIRE_CONTROL || nPart==HAS_THREE_BUTTONS) return true; break; - case CTRL_EDITBOX: - case CTRL_MULTILINE_EDITBOX: + case ControlType::Editbox: + case ControlType::MultilineEditbox: if (nPart==PART_ENTIRE_CONTROL || nPart==HAS_BACKGROUND_TEXTURE) return true; break; - case CTRL_COMBOBOX: + case ControlType::Combobox: if (nPart==PART_ENTIRE_CONTROL || nPart==HAS_BACKGROUND_TEXTURE || nPart == PART_ALL_BUTTONS) return true; break; - case CTRL_SPINBOX: + case ControlType::Spinbox: if (nPart==PART_ENTIRE_CONTROL || nPart==HAS_BACKGROUND_TEXTURE || nPart == PART_ALL_BUTTONS || nPart == PART_BUTTON_UP || nPart == PART_BUTTON_DOWN) return true; break; - case CTRL_SPINBUTTONS: + case ControlType::SpinButtons: if (nPart==PART_ENTIRE_CONTROL || nPart==PART_ALL_BUTTONS) return true; break; - case CTRL_FRAME: - case CTRL_WINDOW_BACKGROUND: + case ControlType::Frame: + case ControlType::WindowBackground: return true; - case CTRL_TAB_ITEM: - case CTRL_TAB_HEADER: - case CTRL_TAB_PANE: - case CTRL_TAB_BODY: + case ControlType::TabItem: + case ControlType::TabHeader: + case ControlType::TabPane: + case ControlType::TabBody: if(nPart==PART_ENTIRE_CONTROL || nPart==PART_TABS_DRAW_RTL) return true; break; - case CTRL_LISTBOX: + case ControlType::Listbox: if (nPart==PART_ENTIRE_CONTROL || nPart==PART_WINDOW || nPart==HAS_BACKGROUND_TEXTURE || nPart == PART_FOCUS) return true; break; - case CTRL_TOOLBAR: + case ControlType::Toolbar: if( nPart==PART_ENTIRE_CONTROL // || nPart==PART_DRAW_BACKGROUND_HORZ // || nPart==PART_DRAW_BACKGROUND_VERT @@ -2237,12 +2237,12 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP return true; break; - case CTRL_MENUBAR: + case ControlType::Menubar: if (nPart==PART_ENTIRE_CONTROL || nPart==PART_MENU_ITEM) return true; break; - case CTRL_MENU_POPUP: + case ControlType::MenuPopup: if (nPart==PART_ENTIRE_CONTROL || nPart==PART_MENU_ITEM || nPart==PART_MENU_ITEM_CHECK_MARK @@ -2253,23 +2253,24 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP return true; break; -// case CTRL_SLIDER: +// case ControlType::Slider: // if(nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA) // return true; // break; - case CTRL_FIXEDLINE: + case ControlType::Fixedline: if (nPart == PART_SEPARATOR_VERT || nPart == PART_SEPARATOR_HORZ) return true; break; - case CTRL_LISTHEADER: + case ControlType::ListHeader: if (nPart == PART_BUTTON || nPart == PART_ARROW) return true; break; + default: break; } - SAL_INFO("vcl.gtk", "Unhandled is native supported for Type:" << nType << ", Part" << nPart); + SAL_INFO("vcl.gtk", "Unhandled is native supported for Type:" << (int)nType << ", Part" << nPart); return false; } diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 0f1b8bdcff0c..512a5d1fda60 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -617,7 +617,7 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, } else if ( strcmp( QSpinWidget_String, pClassName ) == 0 ) { - const SpinbuttonValue* pValue = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue*>(&aValue) : NULL; + const SpinbuttonValue* pValue = (aValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue*>(&aValue) : NULL; // Is any of the buttons pressed? QStyle::SCFlags eActive = QStyle::SC_None; @@ -706,7 +706,7 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, } else if ( strcmp( QScrollBar_String, pClassName ) == 0 ) { - const ScrollbarValue* pValue = (aValue.getType() == CTRL_SCROLLBAR) ? static_cast<const ScrollbarValue*>(&aValue) : NULL; + const ScrollbarValue* pValue = (aValue.getType() == ControlType::Scrollbar) ? static_cast<const ScrollbarValue*>(&aValue) : NULL; QStyle::SCFlags eActive = QStyle::SC_None; if ( pValue ) @@ -1109,7 +1109,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion, m_pScrollBar->resize( qRect.size() ); m_pScrollBar->setOrientation( bHorizontal? Qt::Horizontal: Qt::Vertical ); - const ScrollbarValue* pValue = (aValue.getType() == CTRL_SCROLLBAR) ? static_cast<const ScrollbarValue*>(&aValue) : NULL; + const ScrollbarValue* pValue = (aValue.getType() == ControlType::Scrollbar) ? static_cast<const ScrollbarValue*>(&aValue) : NULL; if ( pValue ) { m_pScrollBar->setMinValue( pValue->mnMin ); @@ -1268,28 +1268,28 @@ class KDESalGraphics : public X11SalGraphics bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart ) { return - ( (nType == CTRL_PUSHBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) || - ( (nType == CTRL_RADIOBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) || - ( (nType == CTRL_CHECKBOX) && (nPart == PART_ENTIRE_CONTROL) ) || - ( (nType == CTRL_COMBOBOX) && (nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE) ) || - ( (nType == CTRL_EDITBOX) && (nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE) ) || - ( (nType == CTRL_LISTBOX) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_WINDOW || nPart == HAS_BACKGROUND_TEXTURE ) ) || - ( (nType == CTRL_SPINBOX) && (nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE) ) || - // no CTRL_SPINBUTTONS for KDE - ( (nType == CTRL_TAB_ITEM) && (nPart == PART_ENTIRE_CONTROL) ) || - ( (nType == CTRL_TAB_PANE) && (nPart == PART_ENTIRE_CONTROL) ) || - // no CTRL_TAB_BODY for KDE - ( (nType == CTRL_SCROLLBAR) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT) ) || - ( (nType == CTRL_SCROLLBAR) && (nPart == HAS_THREE_BUTTONS) ) || // TODO small optimization is possible here: return this only if the style really has 3 buttons - // CTRL_GROUPBOX not supported - // CTRL_FIXEDLINE not supported - ( (nType == CTRL_TOOLBAR) && (nPart == PART_ENTIRE_CONTROL || + ( (nType == ControlType::Pushbutton) && (nPart == PART_ENTIRE_CONTROL) ) || + ( (nType == ControlType::Radiobutton) && (nPart == PART_ENTIRE_CONTROL) ) || + ( (nType == ControlType::Checkbox) && (nPart == PART_ENTIRE_CONTROL) ) || + ( (nType == ControlType::Combobox) && (nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE) ) || + ( (nType == ControlType::Editbox) && (nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE) ) || + ( (nType == ControlType::Listbox) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_WINDOW || nPart == HAS_BACKGROUND_TEXTURE ) ) || + ( (nType == ControlType::Spinbox) && (nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE) ) || + // no ControlType::SpinButtons for KDE + ( (nType == ControlType::TabItem) && (nPart == PART_ENTIRE_CONTROL) ) || + ( (nType == ControlType::TabPane) && (nPart == PART_ENTIRE_CONTROL) ) || + // no ControlType::TabBody for KDE + ( (nType == ControlType::Scrollbar) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT) ) || + ( (nType == ControlType::Scrollbar) && (nPart == HAS_THREE_BUTTONS) ) || // TODO small optimization is possible here: return this only if the style really has 3 buttons + // ControlType::Groupbox not supported + // ControlType::Fixedline not supported + ( (nType == ControlType::Toolbar) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT || nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT || nPart == PART_BUTTON) ) || - ( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) ) || - ( (nType == CTRL_MENU_POPUP) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) ) || - ( (nType == CTRL_PROGRESS) && (nPart == PART_ENTIRE_CONTROL) ) + ( (nType == ControlType::Menubar) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) ) || + ( (nType == ControlType::MenuPopup) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) ) || + ( (nType == ControlType::Progress) && (nPart == PART_ENTIRE_CONTROL) ) ; } @@ -1303,7 +1303,7 @@ bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, const Point& rPos, bool& rIsInside ) { - if ( nType == CTRL_SCROLLBAR ) + if ( nType == ControlType::Scrollbar ) { // make position relative to rControlRegion Point aPos = rPos - rControlRegion.TopLeft(); @@ -1412,97 +1412,97 @@ bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, { bool bReturn = false; - if ( (nType == CTRL_PUSHBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) + if ( (nType == ControlType::Pushbutton) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->pushButton( rControlRegion, bool(nState & ControlState::DEFAULT) ), nState, aValue, this ); } - else if ( (nType == CTRL_RADIOBUTTON) && (nPart == PART_ENTIRE_CONTROL) ) + else if ( (nType == ControlType::Radiobutton) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->radioButton( rControlRegion ), nState, aValue, this ); } - else if ( (nType == CTRL_CHECKBOX) && (nPart == PART_ENTIRE_CONTROL) ) + else if ( (nType == ControlType::Checkbox) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->checkBox( rControlRegion ), nState, aValue, this ); } - else if ( (nType == CTRL_COMBOBOX) && (nPart == PART_ENTIRE_CONTROL) ) + else if ( (nType == ControlType::Combobox) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->comboBox( rControlRegion, true ), nState, aValue, this ); } - else if ( (nType == CTRL_EDITBOX) && (nPart == PART_ENTIRE_CONTROL) ) + else if ( (nType == ControlType::Editbox) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->lineEdit( rControlRegion ), nState, aValue, this ); } - else if ( (nType == CTRL_LISTBOX) && (nPart == PART_ENTIRE_CONTROL) ) + else if ( (nType == ControlType::Listbox) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->comboBox( rControlRegion, false ), nState, aValue, this ); } - else if ( (nType == CTRL_LISTBOX) && (nPart == PART_WINDOW) ) + else if ( (nType == ControlType::Listbox) && (nPart == PART_WINDOW) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->listView( rControlRegion ), nState, aValue, this ); } - else if ( (nType == CTRL_SPINBOX) && (nPart == PART_ENTIRE_CONTROL) ) + else if ( (nType == ControlType::Spinbox) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->spinWidget( rControlRegion ), nState, aValue, this ); } - else if ( (nType==CTRL_TAB_ITEM) && (nPart == PART_ENTIRE_CONTROL) ) + else if ( (nType==ControlType::TabItem) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->tabBar( rControlRegion ), nState, aValue, this ); } - else if ( (nType==CTRL_TAB_PANE) && (nPart == PART_ENTIRE_CONTROL) ) + else if ( (nType==ControlType::TabPane) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->tabWidget( rControlRegion ), nState, aValue, this ); } - else if ( (nType == CTRL_SCROLLBAR) && (nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT) ) + else if ( (nType == ControlType::Scrollbar) && (nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->scrollBar( rControlRegion, nPart == PART_DRAW_BACKGROUND_HORZ, aValue ), nState, aValue, this ); } - else if ( (nType == CTRL_TOOLBAR) && (nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT || nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) ) + else if ( (nType == ControlType::Toolbar) && (nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT || nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->toolBar( rControlRegion, nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_THUMB_VERT ), nState, aValue, this, nPart ); } - else if ( (nType == CTRL_TOOLBAR) && (nPart == PART_BUTTON) ) + else if ( (nType == ControlType::Toolbar) && (nPart == PART_BUTTON) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->toolButton( rControlRegion ), nState, aValue, this, nPart ); } - else if ( (nType == CTRL_MENUBAR) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) ) + else if ( (nType == ControlType::Menubar) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->menuBar( rControlRegion ), nState, aValue, this, nPart ); } - else if ( (nType == CTRL_MENU_POPUP) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) ) + else if ( (nType == ControlType::MenuPopup) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->popupMenu( rControlRegion ), nState, aValue, this ); } - else if ( (nType == CTRL_PROGRESS) && (nPart == PART_ENTIRE_CONTROL) ) + else if ( (nType == ControlType::Progress) && (nPart == PART_ENTIRE_CONTROL) ) { bReturn = pWidgetPainter->drawStyledWidget( pWidgetPainter->progressBar( rControlRegion ), @@ -1543,7 +1543,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar switch ( nType ) { // Metrics of the push button - case CTRL_PUSHBUTTON: + case ControlType::Pushbutton: pWidget = pWidgetPainter->pushButton( rControlRegion, bool( nState & ControlState::DEFAULT ) ); switch ( nPart ) @@ -1564,7 +1564,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar break; // Metrics of the radio button - case CTRL_RADIOBUTTON: + case ControlType::Radiobutton: pWidget = pWidgetPainter->radioButton( rControlRegion ); if ( nPart == PART_ENTIRE_CONTROL ) @@ -1577,7 +1577,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar break; // Metrics of the check box - case CTRL_CHECKBOX: + case ControlType::Checkbox: pWidget = pWidgetPainter->checkBox( rControlRegion ); if ( nPart == PART_ENTIRE_CONTROL ) @@ -1590,9 +1590,9 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar break; // Metrics of the combo box - case CTRL_COMBOBOX: - case CTRL_LISTBOX: - pWidget = pWidgetPainter->comboBox( rControlRegion, ( nType == CTRL_COMBOBOX ) ); + case ControlType::Combobox: + case ControlType::Listbox: + pWidget = pWidgetPainter->comboBox( rControlRegion, ( nType == ControlType::Combobox ) ); switch ( nPart ) { case PART_BUTTON_DOWN: @@ -1615,7 +1615,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar break; // Metrics of the spin box - case CTRL_SPINBOX: + case ControlType::Spinbox: pWidget = pWidgetPainter->spinWidget( rControlRegion ); switch ( nPart ) { @@ -1643,7 +1643,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar break; // Metrics of the scroll bar - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: pWidget = pWidgetPainter->scrollBar( rControlRegion, ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT ), ImplControlValue() ); diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index 70fafa58b51e..434b259fa7e3 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -77,33 +77,33 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par { switch (type) { - case CTRL_PUSHBUTTON: - case CTRL_RADIOBUTTON: - case CTRL_CHECKBOX: - case CTRL_TOOLTIP: - case CTRL_PROGRESS: - case CTRL_LISTNODE: + case ControlType::Pushbutton: + case ControlType::Radiobutton: + case ControlType::Checkbox: + case ControlType::Tooltip: + case ControlType::Progress: + case ControlType::ListNode: return (part == PART_ENTIRE_CONTROL); - case CTRL_MENUBAR: - case CTRL_MENU_POPUP: - case CTRL_EDITBOX: - case CTRL_COMBOBOX: - case CTRL_TOOLBAR: - case CTRL_FRAME: - case CTRL_SCROLLBAR: - case CTRL_WINDOW_BACKGROUND: - case CTRL_GROUPBOX: - case CTRL_FIXEDLINE: + case ControlType::Menubar: + case ControlType::MenuPopup: + case ControlType::Editbox: + case ControlType::Combobox: + case ControlType::Toolbar: + case ControlType::Frame: + case ControlType::Scrollbar: + case ControlType::WindowBackground: + case ControlType::Groupbox: + case ControlType::Fixedline: return true; - case CTRL_LISTBOX: + case ControlType::Listbox: return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE); - case CTRL_SPINBOX: + case ControlType::Spinbox: return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE); - case CTRL_SLIDER: + case ControlType::Slider: return (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA); default: @@ -210,7 +210,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, return false; } - if( lastPopupRect.isValid() && ( type != CTRL_MENU_POPUP || part != PART_MENU_ITEM )) + if( lastPopupRect.isValid() && ( type != ControlType::MenuPopup || part != PART_MENU_ITEM )) lastPopupRect = QRect(); bool returnVal = true; @@ -226,14 +226,14 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, QRegion* clipRegion = nullptr; - if (type == CTRL_PUSHBUTTON) + if (type == ControlType::Pushbutton) { m_image->fill( Qt::transparent ); QStyleOptionButton option; draw( QStyle::CE_PushButton, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if (type == CTRL_MENUBAR) + else if (type == ControlType::Menubar) { if (part == PART_MENU_ITEM) { @@ -259,7 +259,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, returnVal = false; } } - else if (type == CTRL_MENU_POPUP) + else if (type == ControlType::MenuPopup) { OSL_ASSERT( part == PART_MENU_ITEM ? lastPopupRect.isValid() : !lastPopupRect.isValid()); if( part == PART_MENU_ITEM ) @@ -306,7 +306,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, // 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 // is painted after menuitem highlight, otherwise there would be a grey area - assert( value.getType() == CTRL_MENU_POPUP ); + assert( value.getType() == ControlType::MenuPopup ); const MenupopupValue* menuVal = static_cast<const MenupopupValue*>(&value); QRect menuItemRect( region2QRect( menuVal->maItemRect )); QRect rect( menuItemRect.topLeft() - widgetRect.topLeft(), @@ -328,7 +328,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, else returnVal = false; } - else if ( (type == CTRL_TOOLBAR) && (part == PART_BUTTON) ) + else if ( (type == ControlType::Toolbar) && (part == PART_BUTTON) ) { m_image->fill( Qt::transparent ); QStyleOptionToolButton option; @@ -342,7 +342,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CC_ToolButton, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if ( (type == CTRL_TOOLBAR) && (part == PART_ENTIRE_CONTROL) ) + else if ( (type == ControlType::Toolbar) && (part == PART_ENTIRE_CONTROL) ) { QStyleOptionToolBar option; @@ -352,7 +352,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CE_ToolBar, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if ( (type == CTRL_TOOLBAR) && (part == PART_THUMB_VERT) ) + else if ( (type == ControlType::Toolbar) && (part == PART_THUMB_VERT) ) { // reduce paint area only to the handle area const int width = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent); QRect rect( 0, 0, width, widgetRect.height()); @@ -364,7 +364,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value), rect ); } - else if (type == CTRL_EDITBOX) + else if (type == ControlType::Editbox) { QStyleOptionFrameV2 option; draw( QStyle::PE_PanelLineEdit, &option, m_image.get(), @@ -373,7 +373,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::PE_FrameLineEdit, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value)); } - else if (type == CTRL_COMBOBOX) + else if (type == ControlType::Combobox) { QStyleOptionComboBox option; option.editable = true; @@ -381,7 +381,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CC_ComboBox, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if (type == CTRL_LISTBOX) + else if (type == ControlType::Listbox) { QStyleOptionComboBox option; switch (part) { @@ -405,7 +405,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, break; } } - else if (type == CTRL_LISTNODE) + else if (type == ControlType::ListNode) { m_image->fill( Qt::transparent ); QStyleOption option; @@ -417,19 +417,19 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::PE_IndicatorBranch, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if (type == CTRL_CHECKBOX) + else if (type == ControlType::Checkbox) { m_image->fill( Qt::transparent ); QStyleOptionButton option; draw( QStyle::CE_CheckBox, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if (type == CTRL_SCROLLBAR) + else if (type == ControlType::Scrollbar) { if ((part == PART_DRAW_BACKGROUND_VERT) || (part == PART_DRAW_BACKGROUND_HORZ)) { QStyleOptionSlider option; - OSL_ASSERT( value.getType() == CTRL_SCROLLBAR ); + OSL_ASSERT( value.getType() == ControlType::Scrollbar ); const ScrollbarValue* sbVal = static_cast<const ScrollbarValue *>(&value); //if the scroll bar is active (aka not degenrate...allow for hover events @@ -463,12 +463,12 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, returnVal = false; } } - else if (type == CTRL_SPINBOX) + else if (type == ControlType::Spinbox) { QStyleOptionSpinBox option; // determine active control - if( value.getType() == CTRL_SPINBUTTONS ) + if( value.getType() == ControlType::SpinButtons ) { const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue *>(&value); if( (pSpinVal->mnUpperState & ControlState::PRESSED) ) @@ -480,26 +480,26 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CC_SpinBox, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if (type == CTRL_GROUPBOX) + else if (type == ControlType::Groupbox) { QStyleOptionGroupBox option; draw( QStyle::CC_GroupBox, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if (type == CTRL_RADIOBUTTON) + else if (type == ControlType::Radiobutton) { m_image->fill( Qt::transparent ); QStyleOptionButton option; draw( QStyle::CE_RadioButton, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if (type == CTRL_TOOLTIP) + else if (type == ControlType::Tooltip) { QStyleOption option; draw( QStyle::PE_PanelTipLabel, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if (type == CTRL_FRAME) + else if (type == ControlType::Frame) { lcl_drawFrame( QStyle::PE_Frame, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); @@ -508,11 +508,11 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, int fw = static_cast< KDESalInstance* >(GetSalData()->m_pInstance)->getFrameWidth(); clipRegion = new QRegion( QRegion( widgetRect ).subtracted( widgetRect.adjusted( fw, fw, -fw, -fw ))); } - else if (type == CTRL_WINDOW_BACKGROUND) + else if (type == ControlType::WindowBackground) { m_image->fill(KApplication::palette().color(QPalette::Window).rgb()); } - else if (type == CTRL_FIXEDLINE) + else if (type == ControlType::Fixedline) { QStyleOptionMenuItem option; option.menuItemType = QStyleOptionMenuItem::Separator; @@ -521,9 +521,9 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CE_MenuItem, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if (type == CTRL_SLIDER && (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA)) + else if (type == ControlType::Slider && (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA)) { - OSL_ASSERT( value.getType() == CTRL_SLIDER ); + OSL_ASSERT( value.getType() == ControlType::Slider ); const SliderValue* slVal = static_cast<const SliderValue *>(&value); QStyleOptionSlider option; @@ -539,7 +539,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CC_Slider, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - else if( type == CTRL_PROGRESS && part == PART_ENTIRE_CONTROL ) + else if( type == ControlType::Progress && part == PART_ENTIRE_CONTROL ) { QStyleOptionProgressBarV2 option; option.minimum = 0; @@ -634,7 +634,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, switch ( type ) { // Metrics of the push button - case CTRL_PUSHBUTTON: + case ControlType::Pushbutton: if (part == PART_ENTIRE_CONTROL) { styleOption.state = vclStateValue2StateFlag(controlState, val); @@ -650,7 +650,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, } } break; - case CTRL_EDITBOX: + case ControlType::Editbox: { int nFontHeight = QApplication::fontMetrics().height(); //int nFrameSize = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth); @@ -671,7 +671,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, break; } - case CTRL_CHECKBOX: + case ControlType::Checkbox: if (part == PART_ENTIRE_CONTROL) { styleOption.state = vclStateValue2StateFlag(controlState, val); @@ -695,8 +695,8 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, break; } SAL_FALLTHROUGH; - case CTRL_COMBOBOX: - case CTRL_LISTBOX: + case ControlType::Combobox: + case ControlType::Listbox: { QStyleOptionComboBox cbo; @@ -719,7 +719,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, // FIXME: why this difference between comboboxes and listboxes ? // because a combobox has a sub edit and that is positioned // inside the outer bordered control ? - if( type == CTRL_COMBOBOX ) { + if( type == ControlType::Combobox ) { int size = QApplication::style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2; contentRect.adjust(-size,-size,size,size); } @@ -764,7 +764,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, } break; } - case CTRL_SPINBOX: + case ControlType::Spinbox: { QStyleOptionSpinBox sbo; @@ -800,7 +800,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, } break; } - case CTRL_MENU_POPUP: + case ControlType::MenuPopup: { int h, w; switch ( part ) { @@ -821,7 +821,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, } break; } - case CTRL_FRAME: + case ControlType::Frame: { if( part == PART_BORDER ) { @@ -839,7 +839,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, } break; } - case CTRL_RADIOBUTTON: + case ControlType::Radiobutton: { const int h = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight); const int w = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth); @@ -856,7 +856,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, retVal = true; break; } - case CTRL_SLIDER: + case ControlType::Slider: { const int w = QApplication::style()->pixelMetric(QStyle::PM_SliderLength); if( part == PART_THUMB_HORZ ) @@ -873,7 +873,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, } break; } - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: { // core can't handle 3-button scrollbars well, so we fix that in hitTestNativeControl(), // for the rest also provide the track area (i.e. area not taken by buttons) @@ -934,7 +934,7 @@ bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, const Point& rPos, bool& rIsInside ) { - if ( nType == CTRL_SCROLLBAR ) + if ( nType == ControlType::Scrollbar ) { if( nPart != PART_BUTTON_UP && nPart != PART_BUTTON_DOWN && nPart != PART_BUTTON_LEFT && nPart != PART_BUTTON_RIGHT ) diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index e65974794c08..ce41c62e960a 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -239,19 +239,19 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP switch( nType ) { - case CTRL_PUSHBUTTON: - case CTRL_RADIOBUTTON: - case CTRL_CHECKBOX: + case ControlType::Pushbutton: + case ControlType::Radiobutton: + case ControlType::Checkbox: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Button"); break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT ) return FALSE; // no background painting needed if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Scrollbar"); break; - case CTRL_COMBOBOX: + case ControlType::Combobox: if( nPart == HAS_BACKGROUND_TEXTURE ) return FALSE; // we do not paint the inner part (ie the selection background/focus indication) if( nPart == PART_ENTIRE_CONTROL ) @@ -259,7 +259,7 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP else if( nPart == PART_BUTTON_DOWN ) hTheme = getThemeHandle( mhWnd, L"Combobox"); break; - case CTRL_SPINBOX: + case ControlType::Spinbox: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Edit"); else if( nPart == PART_ALL_BUTTONS || @@ -267,19 +267,19 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP nPart == PART_BUTTON_LEFT|| nPart == PART_BUTTON_RIGHT ) hTheme = getThemeHandle( mhWnd, L"Spin"); break; - case CTRL_SPINBUTTONS: + case ControlType::SpinButtons: if( nPart == PART_ENTIRE_CONTROL || nPart == PART_ALL_BUTTONS ) hTheme = getThemeHandle( mhWnd, L"Spin"); break; - case CTRL_EDITBOX: - case CTRL_MULTILINE_EDITBOX: + case ControlType::Editbox: + case ControlType::MultilineEditbox: if( nPart == HAS_BACKGROUND_TEXTURE ) return FALSE; // we do not paint the inner part (ie the selection background/focus indication) //return TRUE; if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Edit"); break; - case CTRL_LISTBOX: + case ControlType::Listbox: if( nPart == HAS_BACKGROUND_TEXTURE ) return FALSE; // we do not paint the inner part (ie the selection background/focus indication) if( nPart == PART_ENTIRE_CONTROL || nPart == PART_WINDOW ) @@ -287,20 +287,20 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP else if( nPart == PART_BUTTON_DOWN ) hTheme = getThemeHandle( mhWnd, L"Combobox"); break; - case CTRL_TAB_PANE: - case CTRL_TAB_BODY: - case CTRL_TAB_ITEM: + case ControlType::TabPane: + case ControlType::TabBody: + case ControlType::TabItem: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Tab"); break; - case CTRL_TOOLBAR: + case ControlType::Toolbar: if( nPart == PART_ENTIRE_CONTROL || nPart == PART_BUTTON ) hTheme = getThemeHandle( mhWnd, L"Toolbar"); else // use rebar theme for grip and background hTheme = getThemeHandle( mhWnd, L"Rebar"); break; - case CTRL_MENUBAR: + case ControlType::Menubar: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Rebar"); else if( GetSalData()->mbThemeMenuSupport ) @@ -309,7 +309,7 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP hTheme = getThemeHandle( mhWnd, L"Menu" ); } break; - case CTRL_MENU_POPUP: + case ControlType::MenuPopup: if( GetSalData()->mbThemeMenuSupport ) { if( nPart == PART_ENTIRE_CONTROL || @@ -320,15 +320,15 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP hTheme = getThemeHandle( mhWnd, L"Menu" ); } break; - case CTRL_PROGRESS: + case ControlType::Progress: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Progress"); break; - case CTRL_SLIDER: + case ControlType::Slider: if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA ) hTheme = getThemeHandle( mhWnd, L"Trackbar" ); break; - case CTRL_LISTNODE: + case ControlType::ListNode: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"TreeView" ); break; @@ -519,22 +519,22 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, OUString aCaption ) { // a listbox dropdown is actually a combobox dropdown - if( nType == CTRL_LISTBOX ) + if( nType == ControlType::Listbox ) if( nPart == PART_BUTTON_DOWN ) - nType = CTRL_COMBOBOX; + nType = ControlType::Combobox; // draw entire combobox as a large edit box - if( nType == CTRL_COMBOBOX ) + if( nType == ControlType::Combobox ) if( nPart == PART_ENTIRE_CONTROL ) - nType = CTRL_EDITBOX; + nType = ControlType::Editbox; // draw entire spinbox as a large edit box - if( nType == CTRL_SPINBOX ) + if( nType == ControlType::Spinbox ) if( nPart == PART_ENTIRE_CONTROL ) - nType = CTRL_EDITBOX; + nType = ControlType::Editbox; int iPart(0), iState(0); - if( nType == CTRL_SCROLLBAR ) + if( nType == ControlType::Scrollbar ) { HRESULT hr; if( nPart == PART_BUTTON_UP ) @@ -643,11 +643,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return (hr == S_OK); } } - if( nType == CTRL_SPINBUTTONS && nPart == PART_ALL_BUTTONS ) + if( nType == ControlType::SpinButtons && nPart == PART_ALL_BUTTONS ) { - if( aValue.getType() == CTRL_SPINBUTTONS ) + if( aValue.getType() == ControlType::SpinButtons ) { - const SpinbuttonValue* pValue = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue*>(&aValue) : NULL; + const SpinbuttonValue* pValue = (aValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue*>(&aValue) : NULL; RECT rect; ImplConvertSpinbuttonValues( pValue->mnUpperPart, pValue->mnUpperState, pValue->maUpperRect, &iPart, &iState, &rect ); @@ -662,11 +662,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return bOk; } } - if( nType == CTRL_SPINBOX ) + if( nType == ControlType::Spinbox ) { if( nPart == PART_ALL_BUTTONS ) { - if( aValue.getType() == CTRL_SPINBUTTONS ) + if( aValue.getType() == ControlType::SpinButtons ) { const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue*>(&aValue); @@ -735,7 +735,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT || nPart == PART_BUTTON_UP || nPart == PART_BUTTON_DOWN ) return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } - if( nType == CTRL_COMBOBOX ) + if( nType == ControlType::Combobox ) { if( nPart == PART_BUTTON_DOWN ) { @@ -751,7 +751,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } } - if( nType == CTRL_PUSHBUTTON ) + if( nType == ControlType::Pushbutton ) { iPart = BP_PUSHBUTTON; if( nState & ControlState::PRESSED ) @@ -770,7 +770,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } - if( nType == CTRL_RADIOBUTTON ) + if( nType == ControlType::Radiobutton ) { iPart = BP_RADIOBUTTON; bool bChecked = ( aValue.getTristateVal() == BUTTONVALUE_ON ); @@ -790,7 +790,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } - if( nType == CTRL_CHECKBOX ) + if( nType == ControlType::Checkbox ) { iPart = BP_CHECKBOX; ButtonValue v = aValue.getTristateVal(); @@ -818,7 +818,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } - if( ( nType == CTRL_EDITBOX ) || ( nType == CTRL_MULTILINE_EDITBOX ) ) + if( ( nType == ControlType::Editbox ) || ( nType == ControlType::MultilineEditbox ) ) { iPart = EP_EDITTEXT; if( !(nState & ControlState::ENABLED) ) @@ -833,7 +833,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } - if( nType == CTRL_LISTBOX ) + if( nType == ControlType::Listbox ) { if( nPart == PART_ENTIRE_CONTROL || nPart == PART_WINDOW ) { @@ -842,24 +842,24 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, } } - if( nType == CTRL_TAB_PANE ) + if( nType == ControlType::TabPane ) { iPart = TABP_PANE; return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } - if( nType == CTRL_TAB_BODY ) + if( nType == ControlType::TabBody ) { iPart = TABP_BODY; return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } - if( nType == CTRL_TAB_ITEM ) + if( nType == ControlType::TabItem ) { iPart = TABP_TABITEMLEFTEDGE; rc.bottom--; - OSL_ASSERT( aValue.getType() == CTRL_TAB_ITEM ); + OSL_ASSERT( aValue.getType() == ControlType::TabItem ); const TabitemValue *pValue = static_cast<const TabitemValue*>(&aValue); if( pValue->isBothAligned() ) @@ -899,7 +899,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption); } - if( nType == CTRL_TOOLBAR ) + if( nType == ControlType::Toolbar ) { if( nPart == PART_BUTTON ) { @@ -927,7 +927,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, } else if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT ) { - if( aValue.getType() == CTRL_TOOLBAR ) + if( aValue.getType() == ControlType::Toolbar ) { const ToolbarValue *pValue = static_cast<const ToolbarValue*>(&aValue); if( pValue->mbIsTopDockingArea ) @@ -945,11 +945,11 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, } } - if( nType == CTRL_MENUBAR ) + if( nType == ControlType::Menubar ) { if( nPart == PART_ENTIRE_CONTROL ) { - if( aValue.getType() == CTRL_MENUBAR ) + if( aValue.getType() == ControlType::Menubar ) { const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue); rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well @@ -987,7 +987,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, } } - if( nType == CTRL_PROGRESS ) + if( nType == ControlType::Progress ) { if( nPart != PART_ENTIRE_CONTROL ) return FALSE; @@ -1009,7 +1009,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return ImplDrawTheme( hTheme, hDC, PP_CHUNK, iState, aProgressRect, aCaption ); } - if( nType == CTRL_SLIDER ) + if( nType == ControlType::Slider ) { iPart = (nPart == PART_TRACK_HORZ_AREA) ? TKP_TRACK : TKP_TRACKVERT; iState = (nPart == PART_TRACK_HORZ_AREA) ? static_cast<int>(TRS_NORMAL) : static_cast<int>(TRVS_NORMAL); @@ -1031,7 +1031,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, ImplDrawTheme( hTheme, hDC, iPart, iState, aTRect, aCaption ); RECT aThumbRect; - OSL_ASSERT( aValue.getType() == CTRL_SLIDER ); + OSL_ASSERT( aValue.getType() == ControlType::Slider ); const SliderValue* pVal = static_cast<const SliderValue*>(&aValue); aThumbRect.left = pVal->maThumbRect.Left(); aThumbRect.top = pVal->maThumbRect.Top(); @@ -1042,7 +1042,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, return ImplDrawTheme( hTheme, hDC, iPart, iState, aThumbRect, aCaption ); } - if( nType == CTRL_LISTNODE ) + if( nType == ControlType::ListNode ) { if( nPart != PART_ENTIRE_CONTROL ) return FALSE; @@ -1065,7 +1065,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( GetSalData()->mbThemeMenuSupport ) { - if( nType == CTRL_MENU_POPUP ) + if( nType == ControlType::MenuPopup ) { if( nPart == PART_ENTIRE_CONTROL ) { @@ -1098,7 +1098,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, if( (nState & ControlState::PRESSED) ) { RECT aBGRect = rc; - if( aValue.getType() == CTRL_MENU_POPUP ) + if( aValue.getType() == ControlType::MenuPopup ) { const MenupopupValue& rMVal( static_cast<const MenupopupValue&>(aValue) ); aBGRect.top = rMVal.maItemRect.Top(); @@ -1173,7 +1173,7 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, WinOpenGLSalGraphicsImpl* pImpl = dynamic_cast<WinOpenGLSalGraphicsImpl*>(mpImpl.get()); // tdf#95618 - A few controls render outside the region they're given. - if (pImpl && nType == CTRL_TAB_ITEM) + if (pImpl && nType == ControlType::TabItem) { Rectangle rNativeBoundingRegion; Rectangle rNativeContentRegion; @@ -1193,52 +1193,52 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, switch( nType ) { - case CTRL_PUSHBUTTON: - case CTRL_RADIOBUTTON: - case CTRL_CHECKBOX: + case ControlType::Pushbutton: + case ControlType::Radiobutton: + case ControlType::Checkbox: hTheme = getThemeHandle( mhWnd, L"Button"); break; - case CTRL_SCROLLBAR: + case ControlType::Scrollbar: hTheme = getThemeHandle( mhWnd, L"Scrollbar"); break; - case CTRL_COMBOBOX: + case ControlType::Combobox: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Edit"); else if( nPart == PART_BUTTON_DOWN ) hTheme = getThemeHandle( mhWnd, L"Combobox"); break; - case CTRL_SPINBOX: + case ControlType::Spinbox: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Edit"); else hTheme = getThemeHandle( mhWnd, L"Spin"); break; - case CTRL_SPINBUTTONS: + case ControlType::SpinButtons: hTheme = getThemeHandle( mhWnd, L"Spin"); break; - case CTRL_EDITBOX: - case CTRL_MULTILINE_EDITBOX: + case ControlType::Editbox: + case ControlType::MultilineEditbox: hTheme = getThemeHandle( mhWnd, L"Edit"); break; - case CTRL_LISTBOX: + case ControlType::Listbox: if( nPart == PART_ENTIRE_CONTROL || nPart == PART_WINDOW ) hTheme = getThemeHandle( mhWnd, L"Listview"); else if( nPart == PART_BUTTON_DOWN ) hTheme = getThemeHandle( mhWnd, L"Combobox"); break; - case CTRL_TAB_PANE: - case CTRL_TAB_BODY: - case CTRL_TAB_ITEM: + case ControlType::TabPane: + case ControlType::TabBody: + case ControlType::TabItem: hTheme = getThemeHandle( mhWnd, L"Tab"); break; - case CTRL_TOOLBAR: + case ControlType::Toolbar: if( nPart == PART_ENTIRE_CONTROL || nPart == PART_BUTTON ) hTheme = getThemeHandle( mhWnd, L"Toolbar"); else // use rebar for grip and background hTheme = getThemeHandle( mhWnd, L"Rebar"); break; - case CTRL_MENUBAR: + case ControlType::Menubar: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Rebar"); else if( GetSalData()->mbThemeMenuSupport ) @@ -1247,19 +1247,19 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, hTheme = getThemeHandle( mhWnd, L"Menu" ); } break; - case CTRL_PROGRESS: + case ControlType::Progress: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"Progress"); break; - case CTRL_LISTNODE: + case ControlType::ListNode: if( nPart == PART_ENTIRE_CONTROL ) hTheme = getThemeHandle( mhWnd, L"TreeView"); break; - case CTRL_SLIDER: + case ControlType::Slider: if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA ) hTheme = getThemeHandle( mhWnd, L"Trackbar" ); break; - case CTRL_MENU_POPUP: + case ControlType::MenuPopup: if( GetSalData()->mbThemeMenuSupport ) { if( nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM || @@ -1344,7 +1344,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, // depending on which part is used; horrors. HDC hDC = GetDC( mhWnd ); - if( nType == CTRL_TOOLBAR ) + if( nType == ControlType::Toolbar ) { if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT ) { @@ -1384,7 +1384,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, } } } - if( nType == CTRL_PROGRESS && nPart == PART_ENTIRE_CONTROL ) + if( nType == ControlType::Progress && nPart == PART_ENTIRE_CONTROL ) { HTHEME hTheme = getThemeHandle( mhWnd, L"Progress"); if( hTheme ) @@ -1397,7 +1397,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, bRet = TRUE; } } - if( (nType == CTRL_LISTBOX || nType == CTRL_COMBOBOX ) && nPart == PART_ENTIRE_CONTROL ) + if( (nType == ControlType::Listbox || nType == ControlType::Combobox ) && nPart == PART_ENTIRE_CONTROL ) { HTHEME hTheme = getThemeHandle( mhWnd, L"Combobox"); if( hTheme ) @@ -1416,7 +1416,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, } } - if( (nType == CTRL_EDITBOX || nType == CTRL_SPINBOX) && nPart == PART_ENTIRE_CONTROL ) + if( (nType == ControlType::Editbox || nType == ControlType::Spinbox) && nPart == PART_ENTIRE_CONTROL ) { HTHEME hTheme = getThemeHandle( mhWnd, L"Edit"); if( hTheme ) @@ -1452,7 +1452,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, if( GetSalData()->mbThemeMenuSupport ) { - if( nType == CTRL_MENU_POPUP ) + if( nType == ControlType::MenuPopup ) { if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK ) @@ -1473,7 +1473,7 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, } } - if( nType == CTRL_SLIDER && ( (nPart == PART_THUMB_HORZ) || (nPart == PART_THUMB_VERT) ) ) + if( nType == ControlType::Slider && ( (nPart == PART_THUMB_HORZ) || (nPart == PART_THUMB_VERT) ) ) { HTHEME hTheme = getThemeHandle( mhWnd, L"Trackbar"); if( hTheme ) @@ -1501,14 +1501,14 @@ bool WinSalGraphics::getNativeControlRegion( ControlType nType, } } - if ( ( nType == CTRL_TAB_ITEM ) && ( nPart == PART_ENTIRE_CONTROL ) ) + if ( ( nType == ControlType::TabItem ) && ( nPart == PART_ENTIRE_CONTROL ) ) { Rectangle aControlRect( rControlRegion ); rNativeContentRegion = aControlRect; --aControlRect.Bottom(); - if( rControlValue.getType() == CTRL_TAB_ITEM ) + if( rControlValue.getType() == ControlType::TabItem ) { const TabitemValue *pValue = static_cast<const TabitemValue*>(&rControlValue); if ( pValue->isBothAligned() ) |