Convert PART to scoped enum

Change-Id: If4c2849beb207593d3d450ae3846ed24eaf66ca4
Reviewed-on: https://gerrit.libreoffice.org/26173
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index d5980604..091eeeb 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(ControlType::IntroProgress, PART_ENTIRE_CONTROL))
    if (pSpl->_bNativeProgress && rRenderContext.IsNativeControlSupported(ControlType::IntroProgress, ControlPart::Entire))
    {
        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(ControlType::IntroProgress, PART_ENTIRE_CONTROL, aDrawRect,
        if (rRenderContext.GetNativeControlRegion(ControlType::IntroProgress, ControlPart::Entire, 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(ControlType::IntroProgress, PART_ENTIRE_CONTROL, aDrawRect,
        if ((rRenderContext.DrawNativeControl(ControlType::IntroProgress, ControlPart::Entire, aDrawRect,
                                              ControlState::ENABLED, aValue, pSpl->_sProgressText)))
        {
            return;
diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
index 37487f4..54b4209 100644
--- a/include/vcl/salnativewidgets.hxx
+++ b/include/vcl/salnativewidgets.hxx
@@ -48,7 +48,7 @@ enum class ControlType {
    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
// ControlPart::HasBackgroundTexture, which is drawn in the edit box'es
// border window.
    EditboxNoBorder    =  31,
// Control that allows text entry
@@ -120,32 +120,33 @@ enum class ControlType {
 *   for example the slider of a scroll bar.
 */

typedef sal_uInt32      ControlPart;

#define PART_ENTIRE_CONTROL         1
#define PART_WINDOW                 5       // the static listbox window containing the list
#define PART_BUTTON                 100
#define PART_BUTTON_UP              101
#define PART_BUTTON_DOWN            102 // Also for ComboBoxes/ListBoxes
#define PART_BUTTON_LEFT            103
#define PART_BUTTON_RIGHT           104
#define PART_ALL_BUTTONS            105
#define PART_SEPARATOR_HORZ         106
#define PART_SEPARATOR_VERT         107
#define PART_TRACK_HORZ_LEFT        200
#define PART_TRACK_VERT_UPPER       201
#define PART_TRACK_HORZ_RIGHT       202
#define PART_TRACK_VERT_LOWER       203
#define PART_TRACK_HORZ_AREA        204
#define PART_TRACK_VERT_AREA        205
#define PART_THUMB_HORZ             210 // Also used as toolbar grip
#define PART_THUMB_VERT             211 // Also used as toolbar grip
#define PART_ARROW                  220
#define PART_MENU_ITEM              250
#define PART_MENU_ITEM_CHECK_MARK   251
#define PART_MENU_ITEM_RADIO_MARK   252
#define PART_MENU_SEPARATOR         253
#define PART_MENU_SUBMENU_ARROW     254
enum class ControlPart
{
    NONE               = 0,
    Entire             = 1,
    ListboxWindow      = 5,   // the static listbox window containing the list
    Button             = 100,
    ButtonUp           = 101,
    ButtonDown         = 102, // Also for ComboBoxes/ListBoxes
    ButtonLeft         = 103,
    ButtonRight        = 104,
    AllButtons         = 105,
    SeparatorHorz      = 106,
    SeparatorVert      = 107,
    TrackHorzLeft      = 200,
    TrackVertUpper     = 201,
    TrackHorzRight     = 202,
    TrackVertLower     = 203,
    TrackHorzArea      = 204,
    TrackVertArea      = 205,
    Arrow              = 220,
    ThumbHorz          = 210, // Also used as toolbar grip
    ThumbVert          = 211, // Also used as toolbar grip
    MenuItem           = 250,
    MenuItemCheckMark  = 251,
    MenuItemRadioMark  = 252,
    Separator          = 253,
    SubmenuArrow       = 254,

/*  #i77549#
    HACK: for scrollbars in case of thumb rect, page up and page down rect we
@@ -158,8 +159,8 @@ typedef sal_uInt32      ControlPart;
    However since there is only this one small exception we will deviate a little and
    instead pass the respective rect as control region to allow for a small correction.

    So all places using HitTestNativeControl on PART_THUMB_HORZ, PART_THUMB_VERT,
    PART_TRACK_HORZ_LEFT, PART_TRACK_HORZ_RIGHT, PART_TRACK_VERT_UPPER, PART_TRACK_VERT_LOWER
    So all places using HitTestNativeControl on ControlPart::ThumbHorz, ControlPart::ThumbVert,
    ControlPart::TrackHorzLeft, ControlPart::TrackHorzRight, ControlPart::TrackVertUpper, ControlPart::TrackVertLower
    do not use the control rectangle as region but the actuall part rectangle, making
    only small deviations feasible.
*/
@@ -167,10 +168,10 @@ typedef sal_uInt32      ControlPart;
/** The edit field part of a control, e.g. of the combo box.

    Currently used just for combo boxes and just for GetNativeControlRegion().
    It is valid only if GetNativeControlRegion() supports PART_BUTTON_DOWN as
    It is valid only if GetNativeControlRegion() supports ControlPart::ButtonDown as
    well.
*/
#define PART_SUB_EDIT           300
    SubEdit                 = 300,

// For controls that require the entire background
// to be drawn first, and then other pieces over top.
@@ -178,30 +179,31 @@ typedef sal_uInt32      ControlPart;
// in to draw this part is expected to be the entire
// area of the control.
// A control may respond to one or both.
#define PART_DRAW_BACKGROUND_HORZ       1000
#define PART_DRAW_BACKGROUND_VERT       1001
    DrawBackgroundHorz      = 1000,
    DrawBackgroundVert      = 1001,

// GTK+ also draws tabs right->left since there is a
// hardcoded 2 pixel overlap between adjacent tabs
#define PART_TABS_DRAW_RTL          3000
    TabsDrawRtl             = 3000,

// For themes that do not want to have the focus
// rectangle part drawn by VCL but take care of the
// whole inner control part by themselves
// eg, listboxes or comboboxes or spinbuttons
#define HAS_BACKGROUND_TEXTURE  4000
    HasBackgroundTexture    = 4000,

// For scrollbars that have 3 buttons (most KDE themes)
#define HAS_THREE_BUTTONS       5000
    HasThreeButtons         = 5000,

#define PART_BACKGROUND_WINDOW  6000
#define PART_BACKGROUND_DIALOG  6001
    BackgroundWindow        = 6000,
    BackgroundDialog        = 6001,

//to draw natively the border of frames
#define PART_BORDER             7000
    Border                  = 7000,

//to draw natively the focus rects
#define PART_FOCUS              8000
    Focus                   = 8000
};

/* Control State:
 *
@@ -271,7 +273,7 @@ public:
                return false;

            case ControlType::Menubar:
                if (mnPart == PART_ENTIRE_CONTROL)
                if (mnPart == ControlPart::Entire)
                    return false;
                break;

@@ -440,15 +442,15 @@ class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue
        Rectangle       maLowerRect;
        ControlState    mnUpperState;
        ControlState    mnLowerState;
        int         mnUpperPart;
        int         mnLowerPart;
        ControlPart     mnUpperPart;
        ControlPart     mnLowerPart;

        SpinbuttonValue()
            : ImplControlValue( ControlType::SpinButtons, 0 )
            , mnUpperState(ControlState::NONE)
            , mnLowerState(ControlState::NONE)
            , mnUpperPart(0)
            , mnLowerPart(0)
            , mnUpperPart(ControlPart::NONE)
            , mnLowerPart(ControlPart::NONE)
        {
        }

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index d9e0922..433b7ee 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( ControlType::Editbox, PART_ENTIRE_CONTROL ) )
    if ( IsNativeControlSupported( ControlType::Editbox, ControlPart::Entire ) )
    {
        SetType( WINDOW_CALCINPUTLINE );
        SetBorderStyle( WindowBorderStyle::NWF );
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 7a023e7..b3634b9 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(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire))
    {
        rRenderContext.SetClipRegion();
        bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect,
        bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire, 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(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire))
    {
        rRenderContext.Push(PushFlags::CLIPREGION);
        rRenderContext.IntersectClipRegion(aRegion);
        Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel());
        rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect,
        rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire, aCtrlRect,
                                         ControlState::ENABLED, ImplControlValue(), OUString());

        rRenderContext.Pop();
    }

    bool bNativeDrawn = false;
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_SEPARATOR))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Separator))
    {
        ControlState nState = ControlState::NONE;
        const MenuItemData& rData = maMenuItems[nPos];
        if (rData.mbEnabled)
            nState |= ControlState::ENABLED;

        bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_SEPARATOR,
        bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::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(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire))
    {
        rRenderContext.Push(PushFlags::CLIPREGION);
        rRenderContext.IntersectClipRegion(Rectangle(aPos, aSize));
        Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel());
        rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED,
        rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire, aCtrlRect, ControlState::ENABLED,
                                         ImplControlValue(), OUString());
        rRenderContext.Pop();
    }

    bool bNativeDrawn = true;
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItem))
    {
        ControlState nState = bSelected ? ControlState::SELECTED : ControlState::NONE;
        if (maMenuItems[nPos].mbEnabled)
            nState |= ControlState::ENABLED;
        bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_ITEM,
        bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::MenuItem,
                                                        aRegion, nState, ImplControlValue(), OUString());
    }
    else
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 10e0cd7..20e218b 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(ControlType::ListNet, PART_ENTIRE_CONTROL))
     if (rRenderContext.IsNativeControlSupported(ControlType::ListNet, ControlPart::Entire))
     {
        ImplControlValue aControlValue;
        ControlState nState = ControlState::ENABLED;
        if (rRenderContext.DrawNativeControl(ControlType::ListNet, PART_ENTIRE_CONTROL,
        if (rRenderContext.DrawNativeControl(ControlType::ListNet, ControlPart::Entire,
                                             Rectangle(), nState, aControlValue, OUString()))
        {
            return;
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 9392dce..d12b792 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -338,7 +338,7 @@ void SvLBoxButton::Paint(
    //Native drawing
    bool bNativeOK = false;
    ControlType eCtrlType = (pData->IsRadio())? ControlType::Radiobutton : ControlType::Checkbox;
    if ( nIndex != SvBmp::STATICIMAGE && rRenderContext.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
    if ( nIndex != SvBmp::STATICIMAGE && rRenderContext.IsNativeControlSupported( eCtrlType, ControlPart::Entire) )

    {
        Size aSize(pData->Width(), pData->Height());
@@ -360,7 +360,7 @@ void SvLBoxButton::Paint(
            aControlValue.setTristateVal( ButtonValue::Mixed );

        if (isVis)
            bNativeOK = rRenderContext.DrawNativeControl(eCtrlType, PART_ENTIRE_CONTROL,
            bNativeOK = rRenderContext.DrawNativeControl(eCtrlType, ControlPart::Entire,
                                                         aCtrlRegion, nState, aControlValue, OUString());
    }

@@ -380,7 +380,7 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource )

void SvLBoxButton::ImplAdjustBoxSize(Size& io_rSize, ControlType i_eType, vcl::RenderContext& rRenderContext)
{
    if (rRenderContext.IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) )
    if (rRenderContext.IsNativeControlSupported( i_eType, ControlPart::Entire) )
    {
        ImplControlValue    aControlValue;
        Rectangle           aCtrlRegion( Point( 0, 0 ), io_rSize );
@@ -390,7 +390,7 @@ void SvLBoxButton::ImplAdjustBoxSize(Size& io_rSize, ControlType i_eType, vcl::R

        Rectangle aNativeBounds, aNativeContent;
        bool bNativeOK = rRenderContext.GetNativeControlRegion( i_eType,
                                                            PART_ENTIRE_CONTROL,
                                                            ControlPart::Entire,
                                                            aCtrlRegion,
                                                            nState,
                                                            aControlValue,
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index b0e1333..abc8d35 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(ControlType::ListNode, PART_ENTIRE_CONTROL))
                if (rRenderContext.IsNativeControlSupported(ControlType::ListNode, ControlPart::Entire))
                {
                    ImplControlValue aControlValue;
                    Rectangle aCtrlRegion(aPos,  pImg->GetSizePixel());
@@ -3059,7 +3059,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
                        }
                    }

                    bNativeOK = rRenderContext.DrawNativeControl(ControlType::ListNode, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString());
                    bNativeOK = rRenderContext.DrawNativeControl(ControlType::ListNode, ControlPart::Entire, aCtrlRegion, nState, aControlValue, OUString());
                }

                if (!bNativeOK)
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 3007ab0..2efc557 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(ControlType::WindowBackground, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, ControlPart::Entire))
    {
        aCtrlRegion = aRect;
        rRenderContext.DrawNativeControl(ControlType::WindowBackground, PART_ENTIRE_CONTROL,
        rRenderContext.DrawNativeControl(ControlType::WindowBackground, ControlPart::Entire,
                                         aCtrlRegion, nState, aControlValue, OUString());

    }
@@ -332,14 +332,14 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos

    Color aSelectionTextColor(COL_TRANSPARENT);

    if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, PART_BUTTON))
    if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, ControlPart::Button))
    {
        aCtrlRegion = aRect;
        aControlValue.setTristateVal(ButtonValue::On);
        nState |= ControlState::ENABLED;
        if (bHigh)
            nState |= ControlState::PRESSED;
        rRenderContext.DrawNativeControl(ControlType::ListHeader, PART_BUTTON,
        rRenderContext.DrawNativeControl(ControlType::ListHeader, ControlPart::Button,
                                         aCtrlRegion, nState, aControlValue, OUString());
    }
    else
@@ -553,7 +553,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos

        if (bDraw)
        {
            if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, PART_ARROW))
            if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, ControlPart::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(ControlType::ListHeader, PART_ARROW, aCtrlRegion,
                rRenderContext.DrawNativeControl(ControlType::ListHeader, ControlPart::Arrow, aCtrlRegion,
                                                 nState, aControlValue, OUString());
            }
            else
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index c9859e7..345a8f9 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(ControlType::WindowBackground,PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground,ControlPart::Entire))
    {
        rRenderContext.DrawNativeControl(ControlType::WindowBackground,PART_ENTIRE_CONTROL,rect,
        rRenderContext.DrawNativeControl(ControlType::WindowBackground,ControlPart::Entire,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 51f1e8e..0d15784 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(ControlType::MenuPopup, PART_MENU_ITEM_CHECK_MARK))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItemCheckMark))
    {
        if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_CHECK_MARK),
        if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart::MenuItemCheckMark,
                                                  aCtrlRegion, ControlState::ENABLED, aVal, OUString(),
                                                  aNativeBounds, aNativeContent)
        )
@@ -556,9 +556,9 @@ static long ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, l
            rMaxWidth = aNativeContent.GetWidth();
        }
    }
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_RADIO_MARK))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItemRadioMark))
    {
        if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_RADIO_MARK),
        if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart::MenuItemRadioMark,
                                          aCtrlRegion, ControlState::ENABLED, aVal, OUString(),
                                          aNativeBounds, aNativeContent)
        )
@@ -634,8 +634,8 @@ Size ToolbarMenu::implCalcSize()
            if( pEntry->HasCheck() && !pEntry->mbHasImage )
            {
                if (IsNativeControlSupported(ControlType::MenuPopup, (pEntry->mnBits & MenuItemBits::RADIOCHECK)
                                                     ? PART_MENU_ITEM_CHECK_MARK
                                                     : PART_MENU_ITEM_RADIO_MARK ) )
                                                     ? ControlPart::MenuItemCheckMark
                                                     : ControlPart::MenuItemRadioMark ) )
                {
                    long nCheckHeight = 0, nRadioHeight = 0, nMaxCheckWidth = 0;
                    ImplGetNativeCheckAndRadioSize(*this, nCheckHeight, nRadioHeight, nMaxCheckWidth);
@@ -811,19 +811,19 @@ void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHi
                aItemRect.Right() -= nFontHeight + nFontHeight / 4;
            }

            if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
            if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire))
            {
                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(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect,
                rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire, aCtrlRect,
                                                 ControlState::ENABLED, ImplControlValue(), OUString());
                if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM))
                if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItem))
                {
                    bDrawItemRect = false;
                    ControlState eState = ControlState::SELECTED | (pEntry->mbEnabled ? ControlState::ENABLED : ControlState::NONE);
                    if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_ITEM, aItemRect,
                    if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::MenuItem, 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(ControlType::Toolbar, PART_BUTTON))
    if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, ControlPart::Button))
    {
        ImplControlValue aControlValue;
        ControlState nState = ControlState::PRESSED | ControlState::ENABLED;

        aControlValue.setTristateVal(ButtonValue::On);

        bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, PART_BUTTON,
        bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, ControlPart::Button,
                                                     i_rRect, nState, aControlValue, OUString());
    }

@@ -1277,12 +1277,12 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry
                    {
                        if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup,
                                                             (pEntry->mnBits & MenuItemBits::RADIOCHECK)
                                                             ? PART_MENU_ITEM_CHECK_MARK
                                                             : PART_MENU_ITEM_RADIO_MARK))
                                                             ? ControlPart::MenuItemCheckMark
                                                             : ControlPart::MenuItemRadioMark))
                        {
                            ControlPart nPart = ((pEntry->mnBits & MenuItemBits::RADIOCHECK)
                                                 ? PART_MENU_ITEM_RADIO_MARK
                                                 : PART_MENU_ITEM_CHECK_MARK);
                                                 ? ControlPart::MenuItemRadioMark
                                                 : ControlPart::MenuItemCheckMark);

                            ControlState nState = ControlState::NONE;

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 80b847c..b05860d 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -125,30 +125,30 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */  ControlPart nPart,

    switch( nPart )
    {
        case PART_BUTTON_UP:
        case ControlPart::ButtonUp:
            rResultRect.Bottom() = rResultRect.Top();
            break;

        case PART_BUTTON_DOWN:
        case ControlPart::ButtonDown:
            rResultRect.Top() = rResultRect.Bottom();
            break;

        case PART_BUTTON_LEFT:
        case ControlPart::ButtonLeft:
            rResultRect.Right() = rResultRect.Left();
            break;

        case PART_BUTTON_RIGHT:
        case ControlPart::ButtonRight:
            rResultRect.Left() = rResultRect.Right();
            break;

        case PART_TRACK_HORZ_AREA:
        case PART_TRACK_VERT_AREA:
        case PART_THUMB_HORZ:
        case PART_THUMB_VERT:
        case PART_TRACK_HORZ_LEFT:
        case PART_TRACK_HORZ_RIGHT:
        case PART_TRACK_VERT_UPPER:
        case PART_TRACK_VERT_LOWER:
        case ControlPart::TrackHorzArea:
        case ControlPart::TrackVertArea:
        case ControlPart::ThumbHorz:
        case ControlPart::ThumbVert:
        case ControlPart::TrackHorzLeft:
        case ControlPart::TrackHorzRight:
        case ControlPart::TrackVertUpper:
        case ControlPart::TrackVertLower:
            break;
        default:
            bRetVal = false;
@@ -179,39 +179,39 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
        case ControlType::Radiobutton:
        case ControlType::Checkbox:
        case ControlType::ListNode:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                return true;
            break;

        case ControlType::Scrollbar:
            if( nPart == PART_DRAW_BACKGROUND_HORZ ||
                nPart == PART_DRAW_BACKGROUND_VERT ||
                nPart == PART_ENTIRE_CONTROL       ||
                nPart == HAS_THREE_BUTTONS )
            if( nPart == ControlPart::DrawBackgroundHorz ||
                nPart == ControlPart::DrawBackgroundVert ||
                nPart == ControlPart::Entire       ||
                nPart == ControlPart::HasThreeButtons )
                return true;
            break;

        case ControlType::Slider:
            if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
            if( nPart == ControlPart::TrackHorzArea || nPart == ControlPart::TrackVertArea )
                return true;
            break;

        case ControlType::Editbox:
            if( nPart == PART_ENTIRE_CONTROL ||
                nPart == HAS_BACKGROUND_TEXTURE )
            if( nPart == ControlPart::Entire ||
                nPart == ControlPart::HasBackgroundTexture )
                return true;
            break;

        case ControlType::MultilineEditbox:
            if( nPart == PART_ENTIRE_CONTROL ||
                nPart == HAS_BACKGROUND_TEXTURE )
            if( nPart == ControlPart::Entire ||
                nPart == ControlPart::HasBackgroundTexture )
                return true;
            break;

        case ControlType::Spinbox:
            if( nPart == PART_ENTIRE_CONTROL ||
                nPart == PART_ALL_BUTTONS    ||
                nPart == HAS_BACKGROUND_TEXTURE )
            if( nPart == ControlPart::Entire ||
                nPart == ControlPart::AllButtons    ||
                nPart == ControlPart::HasBackgroundTexture )
                return true;
            break;

@@ -220,16 +220,16 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
            break;

        case ControlType::Combobox:
            if( nPart == PART_ENTIRE_CONTROL ||
                nPart == HAS_BACKGROUND_TEXTURE )
            if( nPart == ControlPart::Entire ||
                nPart == ControlPart::HasBackgroundTexture )
                return true;
            break;

        case ControlType::Listbox:
            if( nPart == PART_ENTIRE_CONTROL    ||
                nPart == PART_WINDOW            ||
                nPart == HAS_BACKGROUND_TEXTURE ||
                nPart == PART_SUB_EDIT
            if( nPart == ControlPart::Entire ||
                nPart == ControlPart::ListboxWindow ||
                nPart == ControlPart::HasBackgroundTexture ||
                nPart == ControlPart::SubEdit
                )
                return true;
            break;
@@ -237,29 +237,29 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
        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 )
            if( nPart == ControlPart::Entire ||
                nPart == ControlPart::TabsDrawRtl ||
                nPart == ControlPart::HasBackgroundTexture )
                return true;
            break;

        // when PART_BUTTON is used, toolbar icons are not highlighted when mouse rolls over.
        // when ControlPart::Button is used, toolbar icons are not highlighted when mouse rolls over.
        // More Aqua compliant
        case ControlType::Toolbar:
            if( nPart == PART_ENTIRE_CONTROL       ||
                nPart == PART_DRAW_BACKGROUND_HORZ ||
                nPart == PART_DRAW_BACKGROUND_VERT)
            if( nPart == ControlPart::Entire       ||
                nPart == ControlPart::DrawBackgroundHorz ||
                nPart == ControlPart::DrawBackgroundVert)
                return true;
            break;

        case  ControlType::WindowBackground:
            if ( nPart == PART_BACKGROUND_WINDOW ||
                 nPart == PART_BACKGROUND_DIALOG )
            if ( nPart == ControlPart::BackgroundWindow ||
                 nPart == ControlPart::BackgroundDialog )
                 return true;
            break;

        case ControlType::Menubar:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                return true;
            break;

@@ -267,23 +267,23 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
            break;

        case ControlType::MenuPopup:
            if( nPart == PART_ENTIRE_CONTROL       ||
                nPart == PART_MENU_ITEM            ||
                nPart == PART_MENU_ITEM_CHECK_MARK ||
                nPart == PART_MENU_ITEM_RADIO_MARK)
            if( nPart == ControlPart::Entire       ||
                nPart == ControlPart::MenuItem            ||
                nPart == ControlPart::MenuItemCheckMark ||
                nPart == ControlPart::MenuItemRadioMark)
                return true;
            break;
        case ControlType::Progress:
        case ControlType::IntroProgress:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                return true;
            break;
        case ControlType::Frame:
            if( nPart == PART_BORDER )
            if( nPart == ControlPart::Border )
                return true;
            break;
        case ControlType::ListNet:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                return true;
            break;
        default: break;
@@ -382,8 +382,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
    {

    case  ControlType::Combobox:
        if ( nPart == HAS_BACKGROUND_TEXTURE ||
             nPart == PART_ENTIRE_CONTROL )
        if ( nPart == ControlPart::HasBackgroundTexture ||
             nPart == ControlPart::Entire )
        {
            HIThemeButtonDrawInfo aComboInfo;
            aComboInfo.version = 0;
@@ -409,7 +409,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
            aMenuItemDrawInfo.itemType = kThemeMenuItemHierBackground;
            HIThemeDrawMenuItem(&rc,&rc,&aMenuItemDrawInfo,mrContext,kHIThemeOrientationNormal,NULL);
#else
            if (rControlRegion.Top() == 0 && nPart == PART_DRAW_BACKGROUND_HORZ)
            if (rControlRegion.Top() == 0 && nPart == ControlPart::DrawBackgroundHorz)
            {
                const bool bDrawActive = mpFrame == nullptr || [mpFrame->getNSWindow() isKeyWindow];
                CGFloat unifiedHeight = rControlRegion.GetHeight();
@@ -457,7 +457,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
    case ControlType::Menubar:
    case ControlType::MenuPopup:
        {
            if ((nPart == PART_ENTIRE_CONTROL) || (nPart == PART_MENU_ITEM )|| (nPart == HAS_BACKGROUND_TEXTURE ))
            if ((nPart == ControlPart::Entire) || (nPart == ControlPart::MenuItem )|| (nPart == ControlPart::HasBackgroundTexture ))
            {
                // FIXME: without this magical offset there is a 2 pixel black border on the right
                rc.size.width += 2;
@@ -470,7 +470,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
                // the Aqua grey theme when the item is selected is drawn here.
                aMenuItemDrawInfo.itemType = kThemeMenuItemPlain;

                if ((nPart == PART_MENU_ITEM ) && (nState & ControlState::SELECTED))
                if ((nPart == ControlPart::MenuItem ) && (nState & ControlState::SELECTED))
                {
                    // the blue theme when the item is selected is drawn here.
                    aMenuItemDrawInfo.state = kThemeMenuSelected;
@@ -489,7 +489,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,

                bOK = true;
            }
            else if(( nPart == PART_MENU_ITEM_CHECK_MARK )||( nPart == PART_MENU_ITEM_RADIO_MARK )) {
            else if(( nPart == ControlPart::MenuItemCheckMark )||( nPart == ControlPart::MenuItemRadioMark )) {
                if( nState & ControlState::PRESSED ) {//checked, else it is not displayed (see vcl/source/window/menu.cxx)
                    HIThemeTextInfo aTextInfo;
                    aTextInfo.version = 0;
@@ -503,7 +503,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,

                    if( nState & ControlState::SELECTED) aTextInfo.state = kThemeStatePressed; //item highlighted

                    UniChar mark=( nPart == PART_MENU_ITEM_CHECK_MARK ) ? kCheckUnicode: kBulletUnicode;//0x2713;
                    UniChar mark=( nPart == ControlPart::MenuItemCheckMark ) ? kCheckUnicode: kBulletUnicode;//0x2713;
                    CFStringRef cfString = CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, &mark, 1, kCFAllocatorNull);
                    HIThemeDrawTextBox(cfString, &rc, &aTextInfo, mrContext, kHIThemeOrientationNormal);
                    if (cfString)
@@ -701,7 +701,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,

            HIThemeTrackDrawInfo aTrackDraw;
            aTrackDraw.kind = kThemeSliderMedium;
            if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
            if( nPart == ControlPart::TrackHorzArea || nPart == ControlPart::TrackVertArea )
            {
                aTrackDraw.bounds = rc;
                aTrackDraw.min   = pSLVal->mnMin;
@@ -709,7 +709,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
                aTrackDraw.value = pSLVal->mnCur;
                aTrackDraw.reserved = 0;
                aTrackDraw.attributes = kThemeTrackShowThumb;
                if( nPart == PART_TRACK_HORZ_AREA )
                if( nPart == ControlPart::TrackHorzArea )
                    aTrackDraw.attributes |= kThemeTrackHorizontal;
                aTrackDraw.enableState = (nState & ControlState::ENABLED)
                                         ? kThemeTrackActive : kThemeTrackInactive;
@@ -729,13 +729,13 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
        {
            const ScrollbarValue* pScrollbarVal = (aValue.getType() == ControlType::Scrollbar) ? static_cast<const ScrollbarValue*>(&aValue) : nullptr;

            if( nPart == PART_DRAW_BACKGROUND_VERT ||
                nPart == PART_DRAW_BACKGROUND_HORZ )
            if( nPart == ControlPart::DrawBackgroundVert ||
                nPart == ControlPart::DrawBackgroundHorz )
            {
                HIThemeTrackDrawInfo aTrackDraw;
                aTrackDraw.kind = kThemeMediumScrollBar;
                // FIXME: the scrollbar length must be adjusted
                if (nPart == PART_DRAW_BACKGROUND_VERT)
                if (nPart == ControlPart::DrawBackgroundVert)
                    rc.size.height += 2;
                else
                    rc.size.width += 2;
@@ -746,7 +746,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
                aTrackDraw.value = pScrollbarVal->mnCur;
                aTrackDraw.reserved = 0;
                aTrackDraw.attributes = kThemeTrackShowThumb;
                if( nPart == PART_DRAW_BACKGROUND_HORZ )
                if( nPart == ControlPart::DrawBackgroundHorz )
                    aTrackDraw.attributes |= kThemeTrackHorizontal;
                aTrackDraw.enableState = getTrackState( nState );

@@ -857,8 +857,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
    case  ControlType::Listbox:
        switch( nPart)
        {
            case PART_ENTIRE_CONTROL:
            case PART_BUTTON_DOWN:
            case ControlPart::Entire:
            case ControlPart::ButtonDown:
            {
                HIThemeButtonDrawInfo aListInfo;
                aListInfo.version = 0;
@@ -874,7 +874,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
                bOK = true;
                break;
            }
            case PART_WINDOW:
            case ControlPart::ListboxWindow:
            {
                HIThemeFrameDrawInfo aTextDrawInfo;
                aTextDrawInfo.version=0;
@@ -891,6 +891,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
                bOK=true;
                break;
            }
            default: break;
        }
        break;

@@ -923,7 +924,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,

    case ControlType::Spinbox:
        {
            if(nPart == PART_ENTIRE_CONTROL)
            if(nPart == ControlPart::Entire)
            {
                //text field:
                HIThemeFrameDrawInfo aTextDrawInfo;
@@ -1007,7 +1008,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
    case ControlType::Frame:
        {
            DrawFrameFlags nStyle = static_cast<DrawFrameFlags>(aValue.getNumericVal());
            if( nPart == PART_BORDER ) {
            if( nPart == ControlPart::Border ) {
                if(!( nStyle & DrawFrameFlags::Menu ) && !(nStyle & DrawFrameFlags::WindowBorder) )
                {
                    // #i84756# strange effects start to happen when HIThemeDrawFrame
@@ -1104,14 +1105,14 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
    {
        case ControlType::Slider:
            {
                if( nPart == PART_THUMB_HORZ )
                if( nPart == ControlPart::ThumbHorz )
                {
                    w = 19; // taken from HIG
                    h = aCtrlBoundRect.GetHeight();
                    rNativeBoundingRegion = rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
                    toReturn = true;
                }
                else if( nPart == PART_THUMB_VERT )
                else if( nPart == ControlPart::ThumbVert )
                {
                    w = aCtrlBoundRect.GetWidth();
                    h = 18; // taken from HIG
@@ -1212,7 +1213,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
        case ControlType::Listbox:
        case ControlType::Combobox:
            {
                if( nPart == PART_ENTIRE_CONTROL )
                if( nPart == ControlPart::Entire )
                {
                    w = aCtrlBoundRect.GetWidth();
                    h = COMBOBOX_HEIGHT_NORMAL;//listboxes and comboxes have the same height
@@ -1222,7 +1223,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa

                    toReturn = true;
                }
                else if( nPart == PART_BUTTON_DOWN )
                else if( nPart == ControlPart::ButtonDown )
                {
                    w = aCtrlBoundRect.GetWidth();
                    if( w < 3+2*FOCUS_RING_WIDTH )
@@ -1238,7 +1239,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa

                    toReturn = true;
                }
                else if( nPart == PART_SUB_EDIT )
                else if( nPart == ControlPart::SubEdit )
                {
                    w = aCtrlBoundRect.GetWidth();
                    h = COMBOBOX_HEIGHT_NORMAL;//listboxes and comboxes have the same height
@@ -1260,7 +1261,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
            }
            break;
        case ControlType::Spinbox:
                if( nPart == PART_ENTIRE_CONTROL ) {
                if( nPart == ControlPart::Entire ) {
                    w = aCtrlBoundRect.GetWidth();
                    if( w < 3+2*FOCUS_RING_WIDTH+SPIN_BUTTON_SPACE+SPIN_BUTTON_WIDTH )
                        w = 3+2*FOCUS_RING_WIDTH+SPIN_BUTTON_SPACE+SPIN_BUTTON_WIDTH;
@@ -1271,7 +1272,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa

                    toReturn = true;
                }
                else if( nPart == PART_SUB_EDIT ) {
                else if( nPart == ControlPart::SubEdit ) {
                    w = aCtrlBoundRect.GetWidth() - SPIN_BUTTON_SPACE - SPIN_BUTTON_WIDTH;
                    h = TEXT_EDIT_HEIGHT_NORMAL;
                    x += 4; // add an offset for rounded borders
@@ -1284,7 +1285,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa

                    toReturn = true;
                }
                else if( nPart == PART_BUTTON_UP ) {
                else if( nPart == ControlPart::ButtonUp ) {
                    //aCtrlBoundRect.GetWidth() contains the width of the full control
                    //ie the width of the textfield + button
                    //x is the position of the left corner of the full control
@@ -1298,7 +1299,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa

                    toReturn = true;
                }
                else if( nPart == PART_BUTTON_DOWN ) {
                else if( nPart == ControlPart::ButtonDown ) {
                    x += aCtrlBoundRect.GetWidth() - SPIN_BUTTON_WIDTH - SPIN_BUTTON_SPACE - CLIP_FUZZ;
                    y += SPIN_UPPER_BUTTON_HEIGHT + FOCUS_RING_WIDTH - CLIP_FUZZ;
                    w = SPIN_BUTTON_WIDTH + 2*CLIP_FUZZ;
@@ -1314,7 +1315,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
            {
                DrawFrameStyle nStyle = static_cast<DrawFrameStyle>(aValue.getNumericVal() & 0x000f);
                DrawFrameFlags nFlags = static_cast<DrawFrameFlags>(aValue.getNumericVal() & 0xfff0);
                if(  ( nPart == PART_BORDER ) &&
                if(  ( nPart == ControlPart::Border ) &&
                    !( nFlags & (DrawFrameFlags::Menu | DrawFrameFlags::WindowBorder | DrawFrameFlags::BorderWindowBorder) ) )
                {
                    Rectangle aRect(aCtrlBoundRect);
@@ -1344,7 +1345,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
        case ControlType::Menubar:
        case ControlType::MenuPopup:
            {
                if(( nPart == PART_MENU_ITEM_CHECK_MARK )||( nPart == PART_MENU_ITEM_RADIO_MARK )) {
                if(( nPart == ControlPart::MenuItemCheckMark )||( nPart == ControlPart::MenuItemRadioMark )) {

                    w=10;
                    h=10;//dimensions of the mark (10px font)
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 1e5da11..877d1b5 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(ControlType::Tooltip, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::Tooltip, ControlPart::Entire))
    {
        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(ControlType::Tooltip, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::Tooltip, ControlPart::Entire))
    {
        // #i46472# workaround gcc3.3 temporary problem
        Rectangle aCtrlRegion(Point(0, 0), GetOutputSizePixel());
        ImplControlValue aControlValue;
        bNativeOK = rRenderContext.DrawNativeControl(ControlType::Tooltip, PART_ENTIRE_CONTROL, aCtrlRegion,
        bNativeOK = rRenderContext.DrawNativeControl(ControlType::Tooltip, ControlPart::Entire, aCtrlRegion,
                                                     ControlState::NONE, aControlValue, OUString());
    }

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index ae8279c..e427370 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -707,7 +707,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( ControlType::Pushbutton, PART_ENTIRE_CONTROL ) ||
        if ( IsNativeControlSupported( ControlType::Pushbutton, ControlPart::Entire ) ||
             (GetStyle() & WB_FLATBUTTON) != 0 )
        {
            EnableChildTransparentMode();
@@ -846,7 +846,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl

    if ( nDrawFlags & DrawFlags::Mono )
        aColor = Color( COL_BLACK );
    else if( (nDrawFlags & DrawFlags::NoRollover) && IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL) )
    else if( (nDrawFlags & DrawFlags::NoRollover) && IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire) )
        aColor = rStyleSettings.GetButtonRolloverTextColor();
    else if ( IsControlForeground() )
        aColor = GetControlForeground();
@@ -982,7 +982,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)

    if( bDropDown && (aCtrlType == ControlType::Combobox || aCtrlType == ControlType::Listbox))
    {
        if (GetParent()->IsNativeControlSupported(aCtrlType, PART_ENTIRE_CONTROL))
        if (GetParent()->IsNativeControlSupported(aCtrlType, ControlPart::Entire))
        {
            // skip painting if the button was already drawn by the theme
            if (aCtrlType == ControlType::Combobox)
@@ -991,15 +991,15 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
                if (pEdit->ImplUseNativeBorder(rRenderContext, pEdit->GetStyle()))
                    bNativeOK = true;
            }
            else if (GetParent()->IsNativeControlSupported(aCtrlType, HAS_BACKGROUND_TEXTURE))
            else if (GetParent()->IsNativeControlSupported(aCtrlType, ControlPart::HasBackgroundTexture))
            {
                bNativeOK = true;
            }

            if (!bNativeOK && GetParent()->IsNativeControlSupported(aCtrlType, PART_BUTTON_DOWN))
            if (!bNativeOK && GetParent()->IsNativeControlSupported(aCtrlType, ControlPart::ButtonDown))
            {
                // let the theme draw it, note we then need support
                // for ControlType::Listbox/PART_BUTTON_DOWN and ControlType::Combobox/PART_BUTTON_DOWN
                // for ControlType::Listbox/ControlPart::ButtonDown and ControlType::Combobox/ControlPart::ButtonDown

                ImplControlValue aControlValue;
                ControlState nState = ControlState::NONE;
@@ -1018,7 +1018,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
                if (IsMouseOver() && aInRect.IsInside(GetPointerPosPixel()))
                    nState |= ControlState::ROLLOVER;

                bNativeOK = rRenderContext.DrawNativeControl(aCtrlType, PART_BUTTON_DOWN, aInRect, nState,
                bNativeOK = rRenderContext.DrawNativeControl(aCtrlType, ControlPart::ButtonDown, aInRect, nState,
                                                             aControlValue, OUString());
            }
        }
@@ -1034,7 +1034,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
        if (!bRollOver && !HasFocus())
            bDrawMenuSep = false;
    }
    if ((bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL)))
    if ((bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire)))
    {
        PushButtonValue aControlValue;
        Rectangle aCtrlRegion(aInRect);
@@ -1078,7 +1078,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)

        if (((nState & ControlState::ROLLOVER)) || !(GetStyle() & WB_FLATBUTTON))
        {
            bNativeOK = rRenderContext.DrawNativeControl(ControlType::Pushbutton, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
            bNativeOK = rRenderContext.DrawNativeControl(ControlType::Pushbutton, ControlPart::Entire, aCtrlRegion, nState,
                                                         aControlValue, OUString() /*PushButton::GetText()*/);
        }
        else
@@ -1129,7 +1129,7 @@ void PushButton::ImplSetDefButton( bool bSet )
    int dLeft(0), dRight(0), dTop(0), dBottom(0);
    bool bSetPos = false;

    if ( IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL) )
    if ( IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire) )
    {
        Rectangle aBound, aCont;
        Rectangle aCtrlRect( 0, 0, 80, 20 ); // use a constant size to avoid accumulating
@@ -1140,7 +1140,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( ControlType::Pushbutton, PART_ENTIRE_CONTROL, aCtrlRegion,
        if( GetNativeControlRegion( ControlType::Pushbutton, ControlPart::Entire, aCtrlRegion,
                                nState, aControlValue, OUString(),
                                aBound, aCont ) )
        {
@@ -1525,8 +1525,8 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt )

            bool bDropDown = ( IsSymbol() && (GetSymbol()==SymbolType::SPIN_DOWN) && GetText().isEmpty() );

            if( bDropDown && GetParent()->IsNativeControlSupported( aCtrlType, PART_ENTIRE_CONTROL) &&
                   !GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN) )
            if( bDropDown && GetParent()->IsNativeControlSupported( aCtrlType, ControlPart::Entire) &&
                   !GetParent()->IsNativeControlSupported( aCtrlType, ControlPart::ButtonDown) )
            {
                vcl::Window *pBorder = GetParent()->GetWindow( GetWindowType::Border );
                if(aCtrlType == ControlType::Combobox)
@@ -1544,7 +1544,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt )
                }
            }
            else if( (GetStyle() & WB_FLATBUTTON) ||
                     IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL) )
                     IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire) )
            {
                Invalidate();
            }
@@ -1691,11 +1691,11 @@ bool PushButton::set_property(const OString &rKey, const OString &rValue)

void PushButton::ShowFocus(const Rectangle& rRect)
{
    if (IsNativeControlSupported(ControlType::Pushbutton, PART_FOCUS))
    if (IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus))
    {
        ImplControlValue aControlValue;
        Rectangle aInRect(Point(), GetOutputSizePixel());
        GetOutDev()->DrawNativeControl(ControlType::Pushbutton, PART_FOCUS, aInRect,
        GetOutDev()->DrawNativeControl(ControlType::Pushbutton, ControlPart::Focus, aInRect,
                                       ControlState::FOCUSED, aControlValue, OUString());
    }
    Button::ShowFocus(rRect);
@@ -1878,13 +1878,13 @@ void RadioButton::ImplInitSettings( bool bFont,
    {
        vcl::Window* pParent = GetParent();
        if ( !IsControlBackground() &&
            (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( ControlType::Radiobutton, PART_ENTIRE_CONTROL ) ) )
            (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( ControlType::Radiobutton, ControlPart::Entire ) ) )
        {
            EnableChildTransparentMode();
            SetParentClipMode( ParentClipMode::NoClip );
            SetPaintTransparent( true );
            SetBackground();
            if( IsNativeControlSupported( ControlType::Radiobutton, PART_ENTIRE_CONTROL ) )
            if( IsNativeControlSupported( ControlType::Radiobutton, ControlPart::Entire ) )
                mpWindowImpl->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
        }
        else
@@ -1911,7 +1911,7 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext)
    bool bNativeOK = false;

    // no native drawing for image radio buttons
    if (!maImage && (bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Radiobutton, PART_ENTIRE_CONTROL)))
    if (!maImage && (bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Radiobutton, ControlPart::Entire)))
    {
        ImplControlValue aControlValue( mbChecked ? ButtonValue::On : ButtonValue::Off );
        Rectangle aCtrlRect(maStateRect.TopLeft(), maStateRect.GetSize());
@@ -1929,7 +1929,7 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext)
        if (IsMouseOver() && maMouseRect.IsInside(GetPointerPosPixel()))
            nState |= ControlState::ROLLOVER;

        bNativeOK = rRenderContext.DrawNativeControl(ControlType::Radiobutton, PART_ENTIRE_CONTROL, aCtrlRect,
        bNativeOK = rRenderContext.DrawNativeControl(ControlType::Radiobutton, ControlPart::Entire, aCtrlRect,
                                                     nState, aControlValue, OUString());
    }

@@ -2627,7 +2627,7 @@ bool RadioButton::PreNotify( NotifyEvent& rNEvt )
        if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() )
        {
            // trigger redraw if mouse over state has changed
            if( IsNativeControlSupported(ControlType::Radiobutton, PART_ENTIRE_CONTROL) )
            if( IsNativeControlSupported(ControlType::Radiobutton, ControlPart::Entire) )
            {
                if( ( maMouseRect.IsInside( GetPointerPosPixel()) &&
                     !maMouseRect.IsInside( GetLastPointerPosPixel()) ) ||
@@ -2750,7 +2750,7 @@ Size RadioButton::ImplGetRadioImageSize() const
{
    Size aSize;
    bool bDefaultSize = true;
    if( IsNativeControlSupported( ControlType::Radiobutton, PART_ENTIRE_CONTROL ) )
    if( IsNativeControlSupported( ControlType::Radiobutton, ControlPart::Entire ) )
    {
        ImplControlValue aControlValue;
        // #i45896# workaround gcc3.3 temporary problem
@@ -2759,7 +2759,7 @@ Size RadioButton::ImplGetRadioImageSize() const
        Rectangle aBoundingRgn, aContentRgn;

        // get native size of a radio button
        if( GetNativeControlRegion( ControlType::Radiobutton, PART_ENTIRE_CONTROL, aCtrlRegion,
        if( GetNativeControlRegion( ControlType::Radiobutton, ControlPart::Entire, aCtrlRegion,
                                           nState, aControlValue, OUString(),
                                           aBoundingRgn, aContentRgn ) )
        {
@@ -2866,7 +2866,7 @@ void RadioButton::ImplSetMinimumNWFSize()
    Rectangle aBoundingRgn, aContentRgn;

    // get native size of a radiobutton
    if( GetNativeControlRegion( ControlType::Radiobutton, PART_ENTIRE_CONTROL, aCtrlRegion,
    if( GetNativeControlRegion( ControlType::Radiobutton, ControlPart::Entire, aCtrlRegion,
                                ControlState::DEFAULT|ControlState::ENABLED, aControlValue, OUString(),
                                aBoundingRgn, aContentRgn ) )
    {
@@ -2930,7 +2930,7 @@ Size RadioButton::GetOptimalSize() const

void RadioButton::ShowFocus(const Rectangle& rRect)
{
    if (IsNativeControlSupported(ControlType::Radiobutton, PART_FOCUS))
    if (IsNativeControlSupported(ControlType::Radiobutton, ControlPart::Focus))
    {
        ImplControlValue aControlValue;
        Rectangle aInRect(Point(0, 0), GetSizePixel());
@@ -2943,7 +2943,7 @@ void RadioButton::ShowFocus(const Rectangle& rRect)
        aInRect.Top()-=2;
        aInRect.Bottom()+=2;

        DrawNativeControl(ControlType::Radiobutton, PART_FOCUS, aInRect,
        DrawNativeControl(ControlType::Radiobutton, ControlPart::Focus, aInRect,
                          ControlState::FOCUSED, aControlValue, OUString());
    }
    Button::ShowFocus(rRect);
@@ -2998,13 +2998,13 @@ void CheckBox::ImplInitSettings( bool bFont,
    {
        vcl::Window* pParent = GetParent();
        if ( !IsControlBackground() &&
            (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( ControlType::Checkbox, PART_ENTIRE_CONTROL ) ) )
            (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( ControlType::Checkbox, ControlPart::Entire ) ) )
        {
            EnableChildTransparentMode();
            SetParentClipMode( ParentClipMode::NoClip );
            SetPaintTransparent( true );
            SetBackground();
            if( IsNativeControlSupported( ControlType::Checkbox, PART_ENTIRE_CONTROL ) )
            if( IsNativeControlSupported( ControlType::Checkbox, ControlPart::Entire ) )
                ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
        }
        else
@@ -3035,7 +3035,7 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
{
    bool bNativeOK = true;

    if ((bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Checkbox, PART_ENTIRE_CONTROL)))
    if ((bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Checkbox, ControlPart::Entire)))
    {
        ImplControlValue aControlValue(meState == TRISTATE_TRUE ? ButtonValue::On : ButtonValue::Off);
        Rectangle aCtrlRegion(maStateRect);
@@ -3058,7 +3058,7 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
        if (IsMouseOver() && maMouseRect.IsInside(GetPointerPosPixel()))
            nState |= ControlState::ROLLOVER;

        bNativeOK = rRenderContext.DrawNativeControl(ControlType::Checkbox, PART_ENTIRE_CONTROL, aCtrlRegion,
        bNativeOK = rRenderContext.DrawNativeControl(ControlType::Checkbox, ControlPart::Entire, aCtrlRegion,
                                                     nState, aControlValue, OUString());
    }

@@ -3569,7 +3569,7 @@ bool CheckBox::PreNotify( NotifyEvent& rNEvt )
        if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() )
        {
            // trigger redraw if mouse over state has changed
            if( IsNativeControlSupported(ControlType::Checkbox, PART_ENTIRE_CONTROL) )
            if( IsNativeControlSupported(ControlType::Checkbox, ControlPart::Entire) )
            {
                if( ( maMouseRect.IsInside( GetPointerPosPixel()) &&
                     !maMouseRect.IsInside( GetLastPointerPosPixel()) ) ||
@@ -3635,7 +3635,7 @@ Size CheckBox::ImplGetCheckImageSize() const
{
    Size aSize;
    bool bDefaultSize = true;
    if( IsNativeControlSupported( ControlType::Checkbox, PART_ENTIRE_CONTROL ) )
    if( IsNativeControlSupported( ControlType::Checkbox, ControlPart::Entire ) )
    {
        ImplControlValue aControlValue;
        // #i45896# workaround gcc3.3 temporary problem
@@ -3644,7 +3644,7 @@ Size CheckBox::ImplGetCheckImageSize() const
        Rectangle aBoundingRgn, aContentRgn;

        // get native size of a check box
        if( GetNativeControlRegion( ControlType::Checkbox, PART_ENTIRE_CONTROL, aCtrlRegion,
        if( GetNativeControlRegion( ControlType::Checkbox, ControlPart::Entire, aCtrlRegion,
                                           nState, aControlValue, OUString(),
                                           aBoundingRgn, aContentRgn ) )
        {
@@ -3730,7 +3730,7 @@ void CheckBox::ImplSetMinimumNWFSize()
    Rectangle aBoundingRgn, aContentRgn;

    // get native size of a radiobutton
    if( GetNativeControlRegion( ControlType::Checkbox, PART_ENTIRE_CONTROL, aCtrlRegion,
    if( GetNativeControlRegion( ControlType::Checkbox, ControlPart::Entire, aCtrlRegion,
                                ControlState::DEFAULT|ControlState::ENABLED, aControlValue, OUString(),
                                aBoundingRgn, aContentRgn ) )
    {
@@ -3786,7 +3786,7 @@ Size CheckBox::GetOptimalSize() const

void CheckBox::ShowFocus(const Rectangle& rRect)
{
    if (IsNativeControlSupported(ControlType::Checkbox, PART_FOCUS))
    if (IsNativeControlSupported(ControlType::Checkbox, ControlPart::Focus))
    {
        ImplControlValue aControlValue;
        Rectangle aInRect(Point(0, 0), GetSizePixel());
@@ -3799,7 +3799,7 @@ void CheckBox::ShowFocus(const Rectangle& rRect)
        aInRect.Top()-=2;
        aInRect.Bottom()+=2;

        DrawNativeControl(ControlType::Checkbox, PART_FOCUS, aInRect,
        DrawNativeControl(ControlType::Checkbox, ControlPart::Focus, aInRect,
                          ControlState::FOCUSED, aControlValue, OUString());
    }
    Button::ShowFocus(rRect);
@@ -3889,7 +3889,7 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
    if (IsMouseOver() && GetMouseRect().IsInside(GetPointerPosPixel()))
        nState |= ControlState::ROLLOVER;

    if (!rRenderContext.DrawNativeControl(ControlType::ListNode, PART_ENTIRE_CONTROL, aCtrlRegion,
    if (!rRenderContext.DrawNativeControl(ControlType::ListNode, ControlPart::Entire, aCtrlRegion,
                                          nState, aControlValue, OUString()))
    {
        ImplSVCtrlData& rCtrlData(ImplGetSVData()->maCtrlData);
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index a2792cf..f8f4b7d 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -170,7 +170,7 @@ void ComboBox::ImplCalcEditHeight()
    Rectangle aBoundRegion, aContentRegion;
    ImplControlValue aControlValue;
    ControlType aType = IsDropDownBox() ? ControlType::Combobox : ControlType::Editbox;
    if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL,
    if( GetNativeControlRegion( aType, ControlPart::Entire,
                                aCtrlRegion,
                                ControlState::ENABLED,
                                aControlValue, OUString(),
@@ -1076,7 +1076,7 @@ long ComboBox::getMaxWidthScrollBarAndDownButton() const
    // use the full extent of the control
    Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );

    if ( GetNativeControlRegion(ControlType::Combobox, PART_BUTTON_DOWN,
    if ( GetNativeControlRegion(ControlType::Combobox, ControlPart::ButtonDown,
        aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
    {
        nButtonDownWidth = aContent.getWidth();
@@ -1514,7 +1514,7 @@ ComboBoxBounds ComboBox::Impl::calcComboBoxDropDownComponentBounds(
    // use the full extent of the control
    Rectangle aArea( aPoint, rBorderOutSz );

    if (m_rThis.GetNativeControlRegion(ControlType::Combobox, PART_BUTTON_DOWN,
    if (m_rThis.GetNativeControlRegion(ControlType::Combobox, ControlPart::ButtonDown,
            aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
    {
        // convert back from border space to local coordinates
@@ -1525,7 +1525,7 @@ ComboBoxBounds ComboBox::Impl::calcComboBoxDropDownComponentBounds(
        aBounds.aButtonSize = Size(aContent.getWidth(), (nBottom-nTop));

        // adjust the size of the edit field
        if (m_rThis.GetNativeControlRegion(ControlType::Combobox, PART_SUB_EDIT,
        if (m_rThis.GetNativeControlRegion(ControlType::Combobox, ControlPart::SubEdit,
                    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 e8f4456..dcadb57 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -320,14 +320,14 @@ void Edit::ImplInitEditData()
bool Edit::ImplUseNativeBorder(vcl::RenderContext& rRenderContext, WinBits nStyle)
{
    bool bRet = rRenderContext.IsNativeControlSupported(ImplGetNativeControlType(),
                                                        HAS_BACKGROUND_TEXTURE)
                                                        ControlPart::HasBackgroundTexture)
                                 && ((nStyle & WB_BORDER) && !(nStyle & WB_NOBORDER));
    if (!bRet && mbIsSubEdit)
    {
        vcl::Window* pWindow = GetParent();
        nStyle = pWindow->GetStyle();
        bRet = pWindow->IsNativeControlSupported(ImplGetNativeControlType(),
                                                 HAS_BACKGROUND_TEXTURE)
                                                 ControlPart::HasBackgroundTexture)
               && ((nStyle & WB_BORDER) && !(nStyle & WB_NOBORDER));
    }
    return bRet;
@@ -1926,7 +1926,7 @@ void Edit::GetFocus()
        // check for other platforms that need similar handling
        if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
            IsNativeWidgetEnabled() &&
            IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) )
            IsNativeControlSupported( ControlType::Editbox, ControlPart::Entire ) )
        {
            ImplInvalidateOutermostBorder( mbIsSubEdit ? GetParent() : this );
        }
@@ -1960,7 +1960,7 @@ void Edit::LoseFocus()
        // check for other platforms that need similar handling
        if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
            IsNativeWidgetEnabled() &&
            IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) )
            IsNativeControlSupported( ControlType::Editbox, ControlPart::Entire ) )
        {
            ImplInvalidateOutermostBorder( mbIsSubEdit ? GetParent() : this );
        }
@@ -2401,7 +2401,7 @@ void Edit::Modify()
        // check for other platforms that need similar handling
        if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
            IsNativeWidgetEnabled() &&
            IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) )
            IsNativeControlSupported( ControlType::Editbox, ControlPart::Entire ) )
        {
            ImplInvalidateOutermostBorder( this );
        }
@@ -2766,7 +2766,7 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const
    ImplControlValue aControlValue;
    Rectangle aRect( Point( 0, 0 ), aSize );
    Rectangle aContent, aBound;
    if (GetNativeControlRegion(eCtrlType, PART_ENTIRE_CONTROL, aRect, ControlState::NONE,
    if (GetNativeControlRegion(eCtrlType, ControlPart::Entire, aRect, ControlState::NONE,
                               aControlValue, OUString(), aBound, aContent))
    {
        if (aBound.GetHeight() > aSize.Height())
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index d38f590..02103dfe 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(ControlType::Listbox, PART_ENTIRE_CONTROL)
            && ! pButton->IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) )
    if ( pButton->IsNativeControlSupported(ControlType::Listbox, ControlPart::Entire)
            && ! pButton->IsNativeControlSupported(ControlType::Listbox, ControlPart::ButtonDown) )
        pButton->SetBackground();
}

@@ -2572,8 +2572,8 @@ void ImplListBox::SetEdgeBlending(bool bNew)
ImplWin::ImplWin( vcl::Window* pParent, WinBits nWinStyle ) :
    Control ( pParent, nWinStyle )
{
    if ( IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL)
            && ! IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) )
    if ( IsNativeControlSupported(ControlType::Listbox, ControlPart::Entire)
            && ! IsNativeControlSupported(ControlType::Listbox, ControlPart::ButtonDown) )
        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(ControlType::Listbox, PART_ENTIRE_CONTROL)
            && ! IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) )
            if ( IsNativeControlSupported(ControlType::Listbox, ControlPart::Entire)
            && ! IsNativeControlSupported(ControlType::Listbox, ControlPart::ButtonDown) )
            {
                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(ControlType::Listbox, PART_ENTIRE_CONTROL)
            && rRenderContext.IsNativeControlSupported(ControlType::Listbox, HAS_BACKGROUND_TEXTURE) )
        if (rRenderContext.IsNativeControlSupported(ControlType::Listbox, ControlPart::Entire)
            && rRenderContext.IsNativeControlSupported(ControlType::Listbox, ControlPart::HasBackgroundTexture) )
        {
            // 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( ControlType::Listbox, PART_ENTIRE_CONTROL, aParentRect,
                pWin->DrawNativeControl( ControlType::Listbox, ControlPart::Entire, aParentRect,
                                         nState, aControlValue, OUString() );
            }

            bNativeOK = rRenderContext.DrawNativeControl(ControlType::Listbox, PART_ENTIRE_CONTROL, aCtrlRegion,
            bNativeOK = rRenderContext.DrawNativeControl(ControlType::Listbox, ControlPart::Entire, aCtrlRegion,
                                                         nState, aControlValue, OUString());
        }

@@ -2847,7 +2847,7 @@ void ImplWin::GetFocus()
    ShowFocus( maFocusRect );
    if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
        IsNativeWidgetEnabled() &&
        IsNativeControlSupported( ControlType::Listbox, PART_ENTIRE_CONTROL ) )
        IsNativeControlSupported( ControlType::Listbox, ControlPart::Entire ) )
    {
        vcl::Window* pWin = GetParent()->GetWindow( GetWindowType::Border );
        if( ! pWin )
@@ -2864,7 +2864,7 @@ void ImplWin::LoseFocus()
    HideFocus();
    if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
        IsNativeWidgetEnabled() &&
        IsNativeControlSupported( ControlType::Listbox, PART_ENTIRE_CONTROL ) )
        IsNativeControlSupported( ControlType::Listbox, ControlPart::Entire ) )
    {
        vcl::Window* pWin = GetParent()->GetWindow( GetWindowType::Border );
        if( ! pWin )
@@ -2878,13 +2878,13 @@ void ImplWin::LoseFocus()

void ImplWin::ShowFocus(const Rectangle& rRect)
{
    if (IsNativeControlSupported(ControlType::Listbox, PART_FOCUS))
    if (IsNativeControlSupported(ControlType::Listbox, ControlPart::Focus))
    {
        ImplControlValue aControlValue;

        vcl::Window *pWin = GetParent();
        Rectangle aParentRect(Point(0, 0), pWin->GetSizePixel());
        pWin->DrawNativeControl(ControlType::Listbox, PART_FOCUS, aParentRect,
        pWin->DrawNativeControl(ControlType::Listbox, ControlPart::Focus, aParentRect,
                                ControlState::FOCUSED, aControlValue, OUString());
    }
    Control::ShowFocus(rRect);
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index 59dca0f..c3764c4 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -116,13 +116,13 @@ void ListBox::ImplInit( vcl::Window* pParent, WinBits nStyle )
        mnDDHeight = (sal_uInt16)(GetTextHeight() + nTop + nBottom + 4);

        if( IsNativeWidgetEnabled() &&
            IsNativeControlSupported( ControlType::Listbox, PART_ENTIRE_CONTROL ) )
            IsNativeControlSupported( ControlType::Listbox, ControlPart::Entire ) )
        {
                ImplControlValue aControlValue;
                Rectangle aCtrlRegion( Point( 0, 0 ), Size( 20, mnDDHeight ) );
                Rectangle aBoundingRgn( aCtrlRegion );
                Rectangle aContentRgn( aCtrlRegion );
                if( GetNativeControlRegion( ControlType::Listbox, PART_ENTIRE_CONTROL, aCtrlRegion,
                if( GetNativeControlRegion( ControlType::Listbox, ControlPart::Entire, aCtrlRegion,
                                            ControlState::ENABLED, aControlValue, OUString(),
                                            aBoundingRgn, aContentRgn ) )
                {
@@ -620,7 +620,7 @@ void ListBox::Resize()
        // Use the full extent of the control
        Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );

        if ( GetNativeControlRegion( ControlType::Listbox, PART_BUTTON_DOWN,
        if ( GetNativeControlRegion( ControlType::Listbox, ControlPart::ButtonDown,
                    aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
        {
            long nTop = 0;
@@ -633,7 +633,7 @@ void ListBox::Resize()
            mpBtn->setPosSizePixel( aContent.Left(), nTop, aContent.Right(), (nBottom-nTop) );

            // Adjust the size of the edit field
            if ( GetNativeControlRegion( ControlType::Listbox, PART_SUB_EDIT,
            if ( GetNativeControlRegion( ControlType::Listbox, ControlPart::SubEdit,
                        aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
            {
                // Convert back from border space to local coordinates
@@ -769,8 +769,8 @@ void ListBox::StateChanged( StateChangedType nType )
        if( mpImplWin )
        {
            mpImplWin->Enable( IsEnabled() );
            if ( IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL)
                    && ! IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) )
            if ( IsNativeControlSupported(ControlType::Listbox, ControlPart::Entire)
                    && ! IsNativeControlSupported(ControlType::Listbox, ControlPart::ButtonDown) )
            {
                GetWindow( GetWindowType::Border )->Invalidate( InvalidateFlags::NoErase );
            }
@@ -822,7 +822,7 @@ void ListBox::StateChanged( StateChangedType nType )
        mpImplLB->SetControlBackground( GetControlBackground() );
        if ( mpImplWin )
        {
            if ( mpImplWin->IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL) )
            if ( mpImplWin->IsNativeControlSupported(ControlType::Listbox, ControlPart::Entire) )
            {
                // Transparent background
                mpImplWin->SetBackground();
@@ -1222,7 +1222,7 @@ Size ListBox::CalcMinimumSize() const
        Rectangle aContent, aBound;
        Size aTestSize( 100, 20 );
        Rectangle aArea( aPoint, aTestSize );
        if( GetNativeControlRegion( ControlType::Listbox, PART_SUB_EDIT, aArea, ControlState::NONE,
        if( GetNativeControlRegion( ControlType::Listbox, ControlPart::SubEdit, aArea, ControlState::NONE,
                    aControlValue, OUString(), aBound, aContent) )
        {
            // use the themes drop down size
@@ -1239,7 +1239,7 @@ Size ListBox::CalcMinimumSize() const
        ImplControlValue aControlValue;
        Rectangle aRect( Point( 0, 0 ), aSz );
        Rectangle aContent, aBound;
        if( GetNativeControlRegion( ControlType::Listbox, PART_ENTIRE_CONTROL, aRect, ControlState::NONE,
        if( GetNativeControlRegion( ControlType::Listbox, ControlPart::Entire, 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 a2963e4..67619d8 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( ControlType::Progress, PART_ENTIRE_CONTROL ) )
        if( pParent->IsNativeControlSupported( ControlType::Progress, ControlPart::Entire ) )
            nOutStyle &= WB_BORDER;
    }
    return nOutStyle;
@@ -76,7 +76,7 @@ void ProgressBar::ImplInitSettings( bool bFont,
    if ( bBackground )
    {
        if( !IsControlBackground() &&
            IsNativeControlSupported( ControlType::Progress, PART_ENTIRE_CONTROL ) )
            IsNativeControlSupported( ControlType::Progress, ControlPart::Entire ) )
        {
            if( (GetStyle() & WB_BORDER) )
                SetBorderStyle( WindowBorderStyle::REMOVEBORDER );
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index eee34fc..f1af390 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -39,8 +39,8 @@
    However since there is only this one small exception we will deviate a little and
    instead pass the respective rect as control region to allow for a small correction.

    So all places using HitTestNativeControl on PART_THUMB_HORZ, PART_THUMB_VERT,
    PART_TRACK_HORZ_LEFT, PART_TRACK_HORZ_RIGHT, PART_TRACK_VERT_UPPER, PART_TRACK_VERT_LOWER
    So all places using HitTestNativeControl on ControlPart::ThumbHorz, ControlPart::ThumbVert,
    ControlPart::TrackHorzLeft, ControlPart::TrackHorzRight, ControlPart::TrackVertUpper, ControlPart::TrackVertLower
    do not use the control rectangle as region but the actuall part rectangle, making
    only small deviations feasible.
*/
@@ -200,7 +200,7 @@ void ScrollBar::ImplUpdateRects( bool bUpdate )
        }
    }

    if( !IsNativeControlSupported(ControlType::Scrollbar, PART_ENTIRE_CONTROL) )
    if( !IsNativeControlSupported(ControlType::Scrollbar, ControlPart::Entire) )
    {
        // 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( ControlType::Scrollbar, IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT,
            if ( GetNativeControlRegion( ControlType::Scrollbar, IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft,
                        aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) &&
                 GetNativeControlRegion( ControlType::Scrollbar, IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT,
                 GetNativeControlRegion( ControlType::Scrollbar, IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight,
                        aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) )
            {
                maBtn1Rect = aBtn1Region;
@@ -277,7 +277,7 @@ void ScrollBar::ImplCalc( bool bUpdate )
                maBtn2Rect.SetSize( aBtnSize );
            }

            if ( GetNativeControlRegion( ControlType::Scrollbar, PART_TRACK_HORZ_AREA,
            if ( GetNativeControlRegion( ControlType::Scrollbar, ControlPart::TrackHorzArea,
                     aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) )
                aTrackRect = aTrackRegion;
            else
@@ -301,9 +301,9 @@ void ScrollBar::ImplCalc( bool bUpdate )
        }
        else
        {
            if ( GetNativeControlRegion( ControlType::Scrollbar, PART_BUTTON_UP,
            if ( GetNativeControlRegion( ControlType::Scrollbar, ControlPart::ButtonUp,
                        aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) &&
                 GetNativeControlRegion( ControlType::Scrollbar, PART_BUTTON_DOWN,
                 GetNativeControlRegion( ControlType::Scrollbar, ControlPart::ButtonDown,
                        aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) )
            {
                maBtn1Rect = aBtn1Region;
@@ -318,7 +318,7 @@ void ScrollBar::ImplCalc( bool bUpdate )
                maBtn2Rect.SetSize( aBtnSize );
            }

            if ( GetNativeControlRegion( ControlType::Scrollbar, PART_TRACK_VERT_AREA,
            if ( GetNativeControlRegion( ControlType::Scrollbar, ControlPart::TrackVertArea,
                     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(ControlType::Scrollbar, PART_ENTIRE_CONTROL);
    bool bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, ControlPart::Entire);
    if (!bNativeOK)
        return false;

    bool bHorz = (GetStyle() & WB_HORZ) != 0;

    // Draw the entire background if the control supports it
    if (rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT))
    if (rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, bHorz ? ControlPart::DrawBackgroundHorz : ControlPart::DrawBackgroundVert))
    {
        ControlState nState = (IsEnabled() ? ControlState::ENABLED : ControlState::NONE)
                            | (HasFocus() ? ControlState::FOCUSED : ControlState::NONE);
@@ -504,15 +504,15 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD
            rRenderContext.DrawRect(aRequestedRegion);
        }

        bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT),
        bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, (bHorz ? ControlPart::DrawBackgroundHorz : ControlPart::DrawBackgroundVert),
                                                    aCtrlRegion, nState, scrValue, OUString());
    }
    else
    {
        if ((nDrawFlags & SCRBAR_DRAW_PAGE1) || (nDrawFlags & SCRBAR_DRAW_PAGE2))
        {
            sal_uInt32 part1 = bHorz ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER;
            sal_uInt32 part2 = bHorz ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER;
            ControlPart part1 = bHorz ? ControlPart::TrackHorzLeft : ControlPart::TrackVertUpper;
            ControlPart part2 = bHorz ? ControlPart::TrackHorzRight : ControlPart::TrackVertLower;
            Rectangle aCtrlRegion1(maPage1Rect);
            Rectangle aCtrlRegion2(maPage2Rect);
            ControlState nState1 = (IsEnabled() ? ControlState::ENABLED : ControlState::NONE)
@@ -542,8 +542,8 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD
        }
        if ((nDrawFlags & SCRBAR_DRAW_BTN1) || (nDrawFlags & SCRBAR_DRAW_BTN2))
        {
            sal_uInt32 part1 = bHorz ? PART_BUTTON_LEFT : PART_BUTTON_UP;
            sal_uInt32 part2 = bHorz ? PART_BUTTON_RIGHT : PART_BUTTON_DOWN;
            ControlPart part1 = bHorz ? ControlPart::ButtonLeft : ControlPart::ButtonUp;
            ControlPart part2 = bHorz ? ControlPart::ButtonRight : ControlPart::ButtonDown;
            Rectangle aCtrlRegion1(maBtn1Rect);
            Rectangle aCtrlRegion2(maBtn2Rect);
            ControlState nState1 = HasFocus() ? ControlState::FOCUSED : ControlState::NONE;
@@ -601,7 +601,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD
                }
            }

            bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, (bHorz ? PART_THUMB_HORZ : PART_THUMB_VERT),
            bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, (bHorz ? ControlPart::ThumbHorz : ControlPart::ThumbVert),
                                                         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(ControlType::Scrollbar, PART_DRAW_BACKGROUND_HORZ))
    if (nDrawFlags && rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, ControlPart::DrawBackgroundHorz))
    {
        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( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP,
            if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp,
                        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( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN,
            if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown,
                        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( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_LEFT: PART_TRACK_VERT_UPPER,
            if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzLeft: ControlPart::TrackVertUpper,
                                       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( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_RIGHT: PART_TRACK_VERT_LOWER,
            if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzRight: ControlPart::TrackVertLower,
                                       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( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP,
        if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp,
                    aControlRegion, rMousePos, bIsInside )?
                bIsInside:
                maBtn1Rect.IsInside( rMousePos ) )
@@ -897,7 +897,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
                mnDragDraw      = SCRBAR_DRAW_BTN1;
            }
        }
        else if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN,
        else if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown,
                    aControlRegion, rMousePos, bIsInside )?
                bIsInside:
                maBtn2Rect.IsInside( rMousePos ) )
@@ -911,7 +911,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
        }
        else
        {
            bool bThumbHit = HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_THUMB_HORZ : PART_THUMB_VERT,
            bool bThumbHit = HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::ThumbHorz : ControlPart::ThumbVert,
                                                   maThumbRect, rMousePos, bIsInside )
                             ? bIsInside : maThumbRect.IsInside( rMousePos );

@@ -957,14 +957,14 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
                    Invalidate();
                }
            }
            else if(bPage && (!HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA,
            else if(bPage && (!HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzArea : ControlPart::TrackVertArea,
                                           aControlRegion, rMousePos, bIsInside ) ||
                bIsInside) )
            {
                nTrackFlags = StartTrackingFlags::ButtonRepeat;

                // HitTestNativeControl, see remark at top of file
                if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
                if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzLeft : ControlPart::TrackVertUpper,
                                           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( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP,
    if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp,
                aControlRegion, rPt, bIsInside )?
            bIsInside:
            maBtn1Rect.IsInside( rPt ) )
        return &maBtn1Rect;
    else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN,
    else if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown,
                aControlRegion, rPt, bIsInside )?
            bIsInside:
            maBtn2Rect.IsInside( rPt ) )
        return &maBtn2Rect;
    // HitTestNativeControl, see remark at top of file
    else if( HitTestNativeControl( ControlType::Scrollbar,  bHorizontal ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
    else if( HitTestNativeControl( ControlType::Scrollbar,  bHorizontal ? ControlPart::TrackHorzLeft : ControlPart::TrackVertUpper,
                maPage1Rect, rPt, bIsInside)?
            bIsInside:
            maPage1Rect.IsInside( rPt ) )
        return &maPage1Rect;
    // HitTestNativeControl, see remark at top of file
    else if( HitTestNativeControl( ControlType::Scrollbar,  bHorizontal ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER,
    else if( HitTestNativeControl( ControlType::Scrollbar,  bHorizontal ? ControlPart::TrackHorzRight : ControlPart::TrackVertLower,
                maPage2Rect, rPt, bIsInside)?
            bIsInside:
            maPage2Rect.IsInside( rPt ) )
        return &maPage2Rect;
    // HitTestNativeControl, see remark at top of file
    else if( HitTestNativeControl( ControlType::Scrollbar,  bHorizontal ? PART_THUMB_HORZ : PART_THUMB_VERT,
    else if( HitTestNativeControl( ControlType::Scrollbar,  bHorizontal ? ControlPart::ThumbHorz : ControlPart::ThumbVert,
                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(ControlType::Scrollbar, PART_ENTIRE_CONTROL) )
            if( IsNativeControlSupported(ControlType::Scrollbar, ControlPart::Entire) )
            {
                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( ControlType::Scrollbar, HAS_THREE_BUTTONS );
                    bool bHas3Buttons = IsNativeControlSupported( ControlType::Scrollbar, ControlPart::HasThreeButtons );
                    if ( bHas3Buttons && ( pRect == &maBtn1Rect || pLastRect == &maBtn1Rect ) )
                    {
                        aClipRegion.Union( maBtn2Rect );
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index 40ffdb6..6048d70 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( ControlType::Slider, PART_THUMB_HORZ,
            if ( GetNativeControlRegion( ControlType::Slider, ControlPart::ThumbHorz,
                                         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( ControlType::Slider, PART_THUMB_VERT,
            if ( GetNativeControlRegion( ControlType::Slider, ControlPart::ThumbVert,
                                         aControlRegion, ControlState::NONE, ImplControlValue(), OUString(),
                                         aThumbBounds, aThumbContent ) )
            {
@@ -326,7 +326,7 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext)
    if (mbCalcSize)
        ImplCalc(false);

    ControlPart nPart = (GetStyle() & WB_HORZ) ? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA;
    ControlPart nPart = (GetStyle() & WB_HORZ) ? ControlPart::TrackHorzArea : ControlPart::TrackVertArea;
    ControlState nState = (IsEnabled() ? ControlState::ENABLED : ControlState::NONE);
    nState |= (HasFocus() ? ControlState::FOCUSED : ControlState::NONE);
    SliderValue sldValue;
diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx
index 3299477..e7d62be 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(ControlType::Spinbox, PART_ENTIRE_CONTROL) ||
                IsNativeControlSupported(ControlType::Spinbox, PART_ALL_BUTTONS) )
            if (IsNativeControlSupported(ControlType::Spinbox, ControlPart::Entire) ||
                IsNativeControlSupported(ControlType::Spinbox, ControlPart::AllButtons) )
            {
                Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() );
                Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() );
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index e1d935b..970180a 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -66,15 +66,15 @@ void ImplGetSpinbuttonValue(vcl::Window* pWin,
        nState |= ControlState::ROLLOVER;
    rValue.mnLowerState = nState;

    rValue.mnUpperPart = bHorz ? PART_BUTTON_LEFT : PART_BUTTON_UP;
    rValue.mnLowerPart = bHorz ? PART_BUTTON_RIGHT : PART_BUTTON_DOWN;
    rValue.mnUpperPart = bHorz ? ControlPart::ButtonLeft : ControlPart::ButtonUp;
    rValue.mnLowerPart = bHorz ? ControlPart::ButtonRight : ControlPart::ButtonDown;
}

bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pWin, const SpinbuttonValue& rSpinbuttonValue)
{
    bool bNativeOK = false;

    if (rRenderContext.IsNativeControlSupported(ControlType::Spinbox, PART_ENTIRE_CONTROL) &&
    if (rRenderContext.IsNativeControlSupported(ControlType::Spinbox, ControlPart::Entire) &&
        // there is just no useful native support for spinfields with dropdown
        !(pWin->GetStyle() & WB_DROPDOWN))
    {
@@ -83,7 +83,7 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW
        {
            // only paint the embedded spin buttons, all buttons are painted at once
            Rectangle aUpperAndLowerButtons( rSpinbuttonValue.maUpperRect.GetUnion( rSpinbuttonValue.maLowerRect ) );
            bNativeOK = rRenderContext.DrawNativeControl(ControlType::Spinbox, PART_ALL_BUTTONS, aUpperAndLowerButtons,
            bNativeOK = rRenderContext.DrawNativeControl(ControlType::Spinbox, ControlPart::AllButtons, aUpperAndLowerButtons,
                                                         ControlState::ENABLED, rSpinbuttonValue, OUString());
        }
        else
@@ -114,7 +114,7 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW

            Rectangle aBound, aContent;
            if (!ImplGetSVData()->maNWFData.mbCanDrawWidgetAnySize &&
                pContext->GetNativeControlRegion(ControlType::Spinbox, PART_ENTIRE_CONTROL,
                pContext->GetNativeControlRegion(ControlType::Spinbox, ControlPart::Entire,
                                                aNatRgn, ControlState::NONE, rSpinbuttonValue,
                                                OUString(), aBound, aContent))
            {
@@ -128,7 +128,7 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW
                aRgn.SetPos(pWin->ScreenToOutputPixel(pBorder->OutputToScreenPixel(aRgn.TopLeft())));
            }

            bNativeOK = pContext->DrawNativeControl(ControlType::Spinbox, PART_ENTIRE_CONTROL, aRgn,
            bNativeOK = pContext->DrawNativeControl(ControlType::Spinbox, ControlPart::Entire, aRgn,
                                                   ControlState::ENABLED, rSpinbuttonValue, OUString());

            if (!pWin->SupportsDoubleBuffering())
@@ -142,11 +142,11 @@ bool ImplDrawNativeSpinbuttons(vcl::RenderContext& rRenderContext, const Spinbut
{
    bool bNativeOK = false;

    if (rRenderContext.IsNativeControlSupported(ControlType::SpinButtons, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::SpinButtons, ControlPart::Entire))
    {
        Rectangle aArea = rSpinbuttonValue.maUpperRect.GetUnion(rSpinbuttonValue.maLowerRect);
        // only paint the standalone spin buttons, all buttons are painted at once
        bNativeOK = rRenderContext.DrawNativeControl(ControlType::SpinButtons, PART_ALL_BUTTONS, aArea,
        bNativeOK = rRenderContext.DrawNativeControl(ControlType::SpinButtons, ControlPart::AllButtons, aArea,
                                                     ControlState::ENABLED, rSpinbuttonValue, OUString());
    }
    return bNativeOK;
@@ -669,7 +669,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(ControlType::Spinbox, PART_ENTIRE_CONTROL))
            IsNativeControlSupported(ControlType::Spinbox, ControlPart::Entire))
        {
            vcl::Window *pWin = static_cast<vcl::Window*>(pDev);
            vcl::Window *pBorder = pWin->GetWindow( GetWindowType::Border );
@@ -683,9 +683,9 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rect
            Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );

            bNativeRegionOK =
                pWin->GetNativeControlRegion(ControlType::Spinbox, PART_BUTTON_UP,
                pWin->GetNativeControlRegion(ControlType::Spinbox, ControlPart::ButtonUp,
                    aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContentUp) &&
                pWin->GetNativeControlRegion(ControlType::Spinbox, PART_BUTTON_DOWN,
                pWin->GetNativeControlRegion(ControlType::Spinbox, ControlPart::ButtonDown,
                    aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContentDown);

            if (bNativeRegionOK)
@@ -738,7 +738,7 @@ void SpinField::Resize()
            Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );

            // adjust position and size of the edit field
            if (GetNativeControlRegion(ControlType::Spinbox, PART_SUB_EDIT, aArea, ControlState::NONE,
            if (GetNativeControlRegion(ControlType::Spinbox, ControlPart::SubEdit, aArea, ControlState::NONE,
                                       aControlValue, OUString(), aBound, aContent))
            {
                // convert back from border space to local coordinates
@@ -866,8 +866,8 @@ bool SpinField::PreNotify(NotifyEvent& rNEvt)
        if (!pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged())
        {
            // trigger redraw if mouse over state has changed
            if( IsNativeControlSupported(ControlType::Spinbox, PART_ENTIRE_CONTROL) ||
                IsNativeControlSupported(ControlType::Spinbox, PART_ALL_BUTTONS) )
            if( IsNativeControlSupported(ControlType::Spinbox, ControlPart::Entire) ||
                IsNativeControlSupported(ControlType::Spinbox, ControlPart::AllButtons) )
            {
                Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() );
                Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() );
@@ -876,7 +876,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(ControlType::Editbox, PART_ENTIRE_CONTROL))
                        IsNativeControlSupported(ControlType::Editbox, ControlPart::Entire))
                    {
                        ImplInvalidateOutermostBorder(this);
                    }
@@ -928,9 +928,9 @@ Size SpinField::CalcMinimumSizeForText(const OUString &rString) const
        Rectangle aArea( Point(), Size(100, aSz.Height()));
        Rectangle aEntireBound, aEntireContent, aEditBound, aEditContent;
        if (
               GetNativeControlRegion(ControlType::Spinbox, PART_ENTIRE_CONTROL,
               GetNativeControlRegion(ControlType::Spinbox, ControlPart::Entire,
                   aArea, ControlState::NONE, aControlValue, OUString(), aEntireBound, aEntireContent) &&
               GetNativeControlRegion(ControlType::Spinbox, PART_SUB_EDIT,
               GetNativeControlRegion(ControlType::Spinbox, ControlPart::SubEdit,
                   aArea, ControlState::NONE, aControlValue, OUString(), aEditBound, aEditContent)
           )
        {
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index d72056f..70869bc 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -109,7 +109,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(ControlType::TabPane, PART_ENTIRE_CONTROL) )
    if( IsNativeControlSupported(ControlType::TabPane, ControlPart::Entire) )
        EnableChildTransparentMode();

    if (pParent && pParent->IsDialog())
@@ -136,8 +136,8 @@ void TabControl::ImplInitSettings( bool bFont,
        vcl::Window* pParent = GetParent();
        if ( !IsControlBackground() &&
            (pParent->IsChildTransparentModeEnabled()
            || IsNativeControlSupported(ControlType::TabPane, PART_ENTIRE_CONTROL)
            || IsNativeControlSupported(ControlType::TabItem, PART_ENTIRE_CONTROL) ) )
            || IsNativeControlSupported(ControlType::TabPane, ControlPart::Entire)
            || IsNativeControlSupported(ControlType::TabItem, ControlPart::Entire) ) )

        {
            // set transparent mode for NWF tabcontrols to have
@@ -235,7 +235,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( ControlType::TabItem, PART_ENTIRE_CONTROL, aCtrlRegion,
    if(GetNativeControlRegion( ControlType::TabItem, ControlPart::Entire, aCtrlRegion,
                                           ControlState::ENABLED, aControlValue, OUString(),
                                           aBoundingRgn, aContentRgn ) )
    {
@@ -664,7 +664,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( ControlType::TabPane, PART_ENTIRE_CONTROL ) )
    if( IsNativeControlSupported( ControlType::TabPane, ControlPart::Entire ) )
    {
        aRect.Left()   -= TAB_OFFSET;
        aRect.Top()    -= TAB_OFFSET;
@@ -839,7 +839,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p
        }
    }

    if ( (bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::TabItem, PART_ENTIRE_CONTROL)) )
    if ( (bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::TabItem, ControlPart::Entire)) )
    {
        TabitemValue tiValue(Rectangle(pItem->maRect.Left() + TAB_TABOFFSET_X,
                                       pItem->maRect.Top() + TAB_TABOFFSET_Y,
@@ -855,7 +855,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p
            tiValue.mnAlignment |= TabitemFlags::LastInGroup;

        Rectangle aCtrlRegion( pItem->maRect );
        bNativeOK = rRenderContext.DrawNativeControl(ControlType::TabItem, PART_ENTIRE_CONTROL,
        bNativeOK = rRenderContext.DrawNativeControl(ControlType::TabItem, ControlPart::Entire,
                                                     aCtrlRegion, nState, tiValue, OUString() );
    }

@@ -1084,7 +1084,7 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& 
        aRect.Right() += 10;
    }

    if (rRenderContext.IsNativeControlSupported(ControlType::TabPane, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::TabPane, ControlPart::Entire))
    {
        const ImplControlValue aControlValue;

@@ -1101,11 +1101,11 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& 

        if (!aClipRgn.IsEmpty())
        {
            rRenderContext.DrawNativeControl(ControlType::TabPane, PART_ENTIRE_CONTROL,
            rRenderContext.DrawNativeControl(ControlType::TabPane, ControlPart::Entire,
                                             aRect, nState, aControlValue, OUString());
        }

        if (rRenderContext.IsNativeControlSupported(ControlType::TabHeader, PART_ENTIRE_CONTROL))
        if (rRenderContext.IsNativeControlSupported(ControlType::TabHeader, ControlPart::Entire))
        {
            Rectangle aHeaderRect(aRect.Left(), 0, aRect.Right(), aRect.Top());

@@ -1116,7 +1116,7 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& 

            if (!aClipRgn.IsEmpty())
            {
                rRenderContext.DrawNativeControl(ControlType::TabHeader, PART_ENTIRE_CONTROL,
                rRenderContext.DrawNativeControl(ControlType::TabHeader, ControlPart::Entire,
                                                 aHeaderRect, nState, aControlValue, OUString());
            }
        }
@@ -1174,7 +1174,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(ControlType::TabItem, PART_TABS_DRAW_RTL);
        bool bDrawTabsRTL = rRenderContext.IsNativeControlSupported(ControlType::TabItem, ControlPart::TabsDrawRtl);
        ImplTabItem* pFirstTab = nullptr;
        ImplTabItem* pLastTab = nullptr;
        size_t idx;
@@ -1544,7 +1544,7 @@ bool TabControl::PreNotify( NotifyEvent& rNEvt )
        if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() )
        {
            // trigger redraw if mouse over state has changed
            if( IsNativeControlSupported(ControlType::TabItem, PART_ENTIRE_CONTROL) )
            if( IsNativeControlSupported(ControlType::TabItem, ControlPart::Entire) )
            {
                Rectangle* pRect = ImplFindPartRect( GetPointerPosPixel() );
                Rectangle* pLastRect = ImplFindPartRect( GetLastPointerPosPixel() );
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 28583f5..bf4270c 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -533,7 +533,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
                Rectangle aCtrlRegion( (const Point&)Point(), Size( mnWidth < 10 ? 10 : mnWidth, mnHeight < 10 ? 10 : mnHeight ) );
                Rectangle aBounds( aCtrlRegion );
                Rectangle aContent( aCtrlRegion );
                if( pWin->GetNativeControlRegion( aCtrlType, PART_ENTIRE_CONTROL, aCtrlRegion,
                if( pWin->GetNativeControlRegion( aCtrlType, ControlPart::Entire, aCtrlRegion,
                                                  ControlState::ENABLED, aControlValue, OUString(),
                                                  aBounds, aContent ) )
                {
@@ -638,7 +638,7 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B
    vcl::Window* pCtrl = mpBorderWindow->GetWindow(GetWindowType::Client);

    ControlType aCtrlType = ControlType::Generic;
    ControlPart aCtrlPart = PART_ENTIRE_CONTROL;
    ControlPart aCtrlPart = ControlPart::Entire;
    if (pCtrl)
    {
        switch (pCtrl->GetType())
@@ -667,14 +667,14 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B
            case WINDOW_TREELISTBOX:
                aCtrlType = ControlType::Listbox;
                if (pCtrl->GetStyle() & WB_DROPDOWN)
                    aCtrlPart = PART_ENTIRE_CONTROL;
                    aCtrlPart = ControlPart::Entire;
                else
                    aCtrlPart = PART_WINDOW;
                    aCtrlPart = ControlPart::ListboxWindow;
                break;

            case WINDOW_LISTBOXWINDOW:
                aCtrlType = ControlType::Listbox;
                aCtrlPart = PART_WINDOW;
                aCtrlPart = ControlPart::ListboxWindow;
                break;

            case WINDOW_COMBOBOX:
@@ -688,12 +688,12 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, B
                if (pCtrl->GetStyle() & WB_DROPDOWN)
                {
                    aCtrlType = ControlType::Combobox;
                    aCtrlPart = PART_ENTIRE_CONTROL;
                    aCtrlPart = ControlPart::Entire;
                }
                else
                {
                    aCtrlType = ControlType::Listbox;
                    aCtrlPart = PART_WINDOW;
                    aCtrlPart = ControlPart::ListboxWindow;
                }
                break;

@@ -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 == ControlType::Spinbox) && !pCtrl->IsNativeControlSupported(ControlType::Spinbox, PART_BUTTON_UP))
        if ((aCtrlType == ControlType::Spinbox) && !pCtrl->IsNativeControlSupported(ControlType::Spinbox, ControlPart::ButtonUp))
        {
            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 01b86fa..9c9c7e4 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(ControlType::Frame, PART_BORDER) )
        pWin && pWin->IsNativeControlSupported(ControlType::Frame, ControlPart::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(ControlType::Frame, PART_BORDER,
        if( pWin->GetNativeControlRegion(ControlType::Frame, ControlPart::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( ControlType::Frame, PART_BORDER, aContent, ControlState::ENABLED,
                pWin->DrawNativeControl( ControlType::Frame, ControlPart::Border, aContent, ControlState::ENABLED,
                                         aControlValue, OUString()) )
            {
                rRect = aContent;
@@ -1058,7 +1058,7 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo
    vcl::Window *const pWin = (mpOutDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(mpOutDev.get()) : nullptr;
    if(pWin)
    {
        ControlPart nPart = ( bVertical ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ );
        ControlPart nPart = ( bVertical ? ControlPart::SeparatorVert : ControlPart::SeparatorHorz );
        bool nativeSupported = pWin->IsNativeControlSupported( ControlType::Fixedline, nPart );
        ImplControlValue    aValue;
        ControlState        nState = ControlState::NONE;
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index af13d50..9a872bd 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -453,10 +453,10 @@ void Dialog::ApplySettings(vcl::RenderContext& rRenderContext)
        // user override
        SetBackground(GetControlBackground());
    }
    else if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, PART_BACKGROUND_DIALOG))
    else if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, ControlPart::BackgroundDialog))
    {
        // NWF background
        mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG;
        mpWindowImpl->mnNativeBackground = ControlPart::BackgroundDialog;
        EnableChildTransparentMode();
    }
    else
@@ -472,9 +472,9 @@ void Dialog::ImplInitSettings()
    if (IsControlBackground())
        SetBackground(GetControlBackground());
    // NWF background
    else if( IsNativeControlSupported(ControlType::WindowBackground, PART_BACKGROUND_DIALOG))
    else if( IsNativeControlSupported(ControlType::WindowBackground, ControlPart::BackgroundDialog))
    {
        mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG;
        mpWindowImpl->mnNativeBackground = ControlPart::BackgroundDialog;
        EnableChildTransparentMode();
    }
    // fallback to settings color
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index d2993e1..1806519 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( ControlType::Toolbar, PART_ENTIRE_CONTROL )
        && pThis->IsNativeControlSupported( ControlType::Menubar, PART_ENTIRE_CONTROL ) )
        && pThis->IsNativeControlSupported( ControlType::Toolbar, ControlPart::Entire )
        && pThis->IsNativeControlSupported( ControlType::Menubar, ControlPart::Entire ) )
    {
        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(ControlType::Toolbar, PART_ENTIRE_CONTROL))
    else if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, ControlPart::Entire))
    {
        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(ControlType::Toolbar, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, ControlPart::Entire))
    {
        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(ControlType::Toolbar, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
            rRenderContext.DrawNativeControl(ControlType::Toolbar, IsHorizontal() ? ControlPart::DrawBackgroundHorz : ControlPart::DrawBackgroundVert,
                                             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(ControlType::Toolbar, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
                rRenderContext.DrawNativeControl(ControlType::Toolbar, IsHorizontal() ? ControlPart::DrawBackgroundHorz : ControlPart::DrawBackgroundVert,
                                                 aTBRect, nState, aControlValue, OUString());
            }
        }
@@ -259,7 +259,7 @@ void DockingAreaWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl
void DockingAreaWindow::Resize()
{
    ImplInvalidateMenubar( this );
    if (IsNativeControlSupported(ControlType::Toolbar, PART_ENTIRE_CONTROL))
    if (IsNativeControlSupported(ControlType::Toolbar, ControlPart::Entire))
        Invalidate();
}

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index f40a5b4..2a69969 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(ControlType::MenuPopup, PART_MENU_ITEM_CHECK_MARK))
        if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItemCheckMark))
        {
            if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_CHECK_MARK),
            if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart::MenuItemCheckMark,
                                              aCtrlRegion, ControlState::ENABLED, aVal, OUString(),
                                              aNativeBounds, aNativeContent))
            {
@@ -1376,9 +1376,9 @@ Size Menu::ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, lo
                nCheckWidth = aNativeContent.GetWidth();
            }
        }
        if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_RADIO_MARK))
        if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItemRadioMark))
        {
            if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_RADIO_MARK),
            if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart::MenuItemRadioMark,
                                                      aCtrlRegion, 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(ControlType::MenuPopup, PART_MENU_SUBMENU_ARROW))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::SubmenuArrow))
    {
        if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_SUBMENU_ARROW),
        if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart::SubmenuArrow,
                                                  aCtrlRegion, ControlState::ENABLED,
                                                  aVal, OUString(), aNativeBounds, aNativeContent))
        {
@@ -1638,7 +1638,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
        aSz.Height() = nFontHeight+6;

        // get menubar height from native methods if supported
        if( pWindow->IsNativeControlSupported( ControlType::Menubar, PART_ENTIRE_CONTROL ) )
        if( pWindow->IsNativeControlSupported( ControlType::Menubar, ControlPart::Entire ) )
        {
            ImplControlValue aVal;
            Rectangle aNativeBounds;
@@ -1646,7 +1646,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
            Point tmp( 0, 0 );
            Rectangle aCtrlRegion( tmp, Size( 100, 15 ) );
            if( pWindow->GetNativeControlRegion( ControlType::Menubar,
                                                 ControlPart(PART_ENTIRE_CONTROL),
                                                 ControlPart::Entire,
                                                 aCtrlRegion,
                                                 ControlState::ENABLED,
                                                 aVal,
@@ -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(ControlType::Toolbar, PART_BUTTON))
    if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, ControlPart::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(ControlType::Toolbar, PART_BUTTON,
        bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, ControlPart::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(ControlType::MenuPopup, PART_MENU_SEPARATOR))
                    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::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(ControlType::MenuPopup, PART_MENU_SEPARATOR,
                        bNativeOk = rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Separator,
                                                                     aItemRect, nState, aVal, OUString());
                    }
                    if (!bNativeOk)
@@ -1890,12 +1890,12 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
                    {
                        if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup,
                                                                    (pData->nBits & MenuItemBits::RADIOCHECK)
                                                                        ? PART_MENU_ITEM_CHECK_MARK
                                                                        : PART_MENU_ITEM_RADIO_MARK))
                                                                        ? ControlPart::MenuItemCheckMark
                                                                        : ControlPart::MenuItemRadioMark))
                        {
                            ControlPart nPart = ((pData->nBits & MenuItemBits::RADIOCHECK)
                                                 ? PART_MENU_ITEM_RADIO_MARK
                                                 : PART_MENU_ITEM_CHECK_MARK);
                                                 ? ControlPart::MenuItemRadioMark
                                                 : ControlPart::MenuItemCheckMark);

                            ControlState nState = ControlState::NONE;

@@ -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(ControlType::MenuPopup, PART_ENTIRE_CONTROL);
                                           && rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire);
                    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(ControlType::MenuPopup, PART_MENU_SUBMENU_ARROW))
                    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::SubmenuArrow))
                    {
                        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(ControlType::MenuPopup, PART_MENU_SUBMENU_ARROW,
                        bNativeOk = rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::SubmenuArrow,
                                                                     aItemRect, nState, aVal, OUString());
                    }
                    if (!bNativeOk)
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index d849a1d..8f2ca5e 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -596,8 +596,8 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16
                rRenderContext.Push(PushFlags::CLIPREGION);
                rRenderContext.IntersectClipRegion(aRect);
                bool bRollover = nPos != nHighlightedItem;
                if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, PART_MENU_ITEM) &&
                    rRenderContext.IsNativeControlSupported(ControlType::Menubar, PART_ENTIRE_CONTROL))
                if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, ControlPart::MenuItem) &&
                    rRenderContext.IsNativeControlSupported(ControlType::Menubar, ControlPart::Entire))
                {
                    // draw background (transparency)
                    MenubarValue aControlValue;
@@ -608,7 +608,7 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16
                    else
                    {
                        Rectangle aBgRegion(Point(), GetOutputSizePixel());
                        rRenderContext.DrawNativeControl(ControlType::Menubar, PART_ENTIRE_CONTROL, aBgRegion,
                        rRenderContext.DrawNativeControl(ControlType::Menubar, ControlPart::Entire, aBgRegion,
                                                         ControlState::ENABLED, aControlValue, OUString());
                    }

@@ -620,7 +620,7 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16
                        nState |= ControlState::ROLLOVER;
                    else
                        nState |= ControlState::SELECTED;
                    rRenderContext.DrawNativeControl(ControlType::Menubar, PART_MENU_ITEM,
                    rRenderContext.DrawNativeControl(ControlType::Menubar, ControlPart::MenuItem,
                                                     aRect, nState, aControlValue, OUString() );
                }
                else
@@ -846,7 +846,7 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
        return;
    }

    if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, ControlPart::Entire))
    {
        MenubarValue aMenubarValue;
        aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight(this);
@@ -858,7 +858,7 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
            Point aPt;
            Rectangle aCtrlRegion( aPt, GetOutputSizePixel() );

            rRenderContext.DrawNativeControl(ControlType::Menubar, PART_ENTIRE_CONTROL, aCtrlRegion,
            rRenderContext.DrawNativeControl(ControlType::Menubar, ControlPart::Entire, aCtrlRegion,
                                             ControlState::ENABLED, aMenubarValue, OUString());
        }

@@ -871,7 +871,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( ControlType::Menubar, PART_ENTIRE_CONTROL) &&
    if (!rRenderContext.IsNativeControlSupported( ControlType::Menubar, ControlPart::Entire) &&
        rStyleSettings.GetHighContrastMode())
    {
        rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::MAPMODE);
@@ -1013,7 +1013,7 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext)
        SetPaintTransparent(false);
        SetParentClipMode();
    }
    else if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, PART_ENTIRE_CONTROL))
    else if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, ControlPart::Entire))
    {
        rRenderContext.SetBackground(); // background will be drawn by NWF
    }
@@ -1033,8 +1033,8 @@ void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext)

void MenuBarWindow::ImplInitStyleSettings()
{
    if (IsNativeControlSupported(ControlType::Menubar, PART_MENU_ITEM) &&
        IsNativeControlSupported(ControlType::Menubar, PART_ENTIRE_CONTROL))
    if (IsNativeControlSupported(ControlType::Menubar, ControlPart::MenuItem) &&
        IsNativeControlSupported(ControlType::Menubar, ControlPart::Entire))
    {
        AllSettings aSettings(GetSettings());
        ImplGetFrame()->UpdateSettings(aSettings); // to update persona
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index 847d1ce..9324051 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -132,7 +132,7 @@ void MenuFloatingWindow::ApplySettings(vcl::RenderContext& rRenderContext)

    SetPointFont(rRenderContext, rStyleSettings.GetMenuFont());

    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire))
    {
        rRenderContext.SetBackground(); // background will be drawn by NWF
    }
@@ -799,19 +799,19 @@ void MenuFloatingWindow::RenderHighlightItem(vcl::RenderContext& rRenderContext,
                    aItemRect.Right() -= nFontHeight + nFontHeight / 4;
                }

                if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
                if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire))
                {
                    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(ControlType::MenuPopup, PART_ENTIRE_CONTROL,
                    rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire,
                                                     aCtrlRect, ControlState::ENABLED, aVal, OUString());
                    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM))
                    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItem))
                    {
                        bDrawItemRect = false;
                        if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_ITEM, aItemRect,
                        if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::MenuItem, aItemRect,
                                                              ControlState::SELECTED | (pData->bEnabled
                                                                                            ? ControlState::ENABLED
                                                                                            : ControlState::NONE),
@@ -1143,14 +1143,14 @@ void MenuFloatingWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang
    rRenderContext.Push( PushFlags::CLIPREGION );
    rRenderContext.SetClipRegion(vcl::Region(rPaintRect));

    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire))
    {
        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(ControlType::MenuPopup, PART_ENTIRE_CONTROL,
        rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire,
                                         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 b8905bb..9a5a1ec 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1490,7 +1490,7 @@ void Window::Erase(vcl::RenderContext& rRenderContext)
    bool bNativeOK = false;

    ControlPart aCtrlPart = ImplGetWindowImpl()->mnNativeBackground;
    if (aCtrlPart != 0 && ! IsControlBackground())
    if (aCtrlPart != ControlPart::NONE && ! IsControlBackground())
    {
        Rectangle aCtrlRegion(Point(), GetOutputSizePixel());
        ControlState nState = ControlState::NONE;
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 6736e1c..46d173b 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -206,9 +206,9 @@ void StatusBar::ApplySettings(vcl::RenderContext& rRenderContext)

    // NWF background
    if (!IsControlBackground() &&
          rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, PART_BACKGROUND_WINDOW))
          rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, ControlPart::BackgroundWindow))
    {
        ImplGetWindowImpl()->mnNativeBackground = PART_BACKGROUND_WINDOW;
        ImplGetWindowImpl()->mnNativeBackground = ControlPart::BackgroundWindow;
        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(ControlType::Progress, PART_ENTIRE_CONTROL))
    if (rRenderContext.IsNativeControlSupported(ControlType::Progress, ControlPart::Entire))
    {
        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(ControlType::Progress, PART_ENTIRE_CONTROL, aControlRegion,
        bool bNativeOK = rRenderContext.DrawNativeControl(ControlType::Progress, ControlPart::Entire, 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(ControlType::Progress, PART_ENTIRE_CONTROL);
    bool bNative = rRenderContext.IsNativeControlSupported(ControlType::Progress, ControlPart::Entire);
    // 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( ControlType::Progress, PART_ENTIRE_CONTROL ) )
    if( IsNativeControlSupported( ControlType::Progress, ControlPart::Entire ) )
    {
        ImplControlValue aValue;
        Rectangle aControlRegion( Rectangle( (const Point&)Point(), maPrgsFrameRect.GetSize() ) );
        Rectangle aNativeControlRegion, aNativeContentRegion;
        if( (bNativeOK = GetNativeControlRegion( ControlType::Progress, PART_ENTIRE_CONTROL, aControlRegion,
        if( (bNativeOK = GetNativeControlRegion( ControlType::Progress, ControlPart::Entire, 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( ControlType::Progress, PART_ENTIRE_CONTROL ) )
    if( IsNativeControlSupported( ControlType::Progress, ControlPart::Entire ) )
    {
        ImplControlValue aValue;
        Rectangle aControlRegion( (const Point&)Point(), Size( nCalcWidth, nMinHeight ) );
        Rectangle aNativeControlRegion, aNativeContentRegion;
        if( GetNativeControlRegion( ControlType::Progress, PART_ENTIRE_CONTROL,
        if( GetNativeControlRegion( ControlType::Progress, ControlPart::Entire,
                    aControlRegion, ControlState::ENABLED, aValue, OUString(),
                    aNativeControlRegion, aNativeContentRegion ) )
        {
@@ -1450,12 +1450,12 @@ Size StatusBar::CalcWindowSizePixel() const
    }

    if( mpImplData->mbDrawItemFrames &&
        IsNativeControlSupported( ControlType::Frame, PART_BORDER ) )
        IsNativeControlSupported( ControlType::Frame, ControlPart::Border ) )
    {
        ImplControlValue aControlValue( static_cast<long>(DrawFrameFlags::NoDraw) );
        Rectangle aBound, aContent;
        Rectangle aNatRgn( Point( 0, 0 ), Size( 150, 50 ) );
        if( GetNativeControlRegion(ControlType::Frame, PART_BORDER,
        if( GetNativeControlRegion(ControlType::Frame, ControlPart::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 2a317f1d..576d645 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(ControlType::TabBody, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
    if( IsNativeControlSupported(ControlType::TabBody, ControlPart::Entire) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
        EnableChildTransparentMode();
}

@@ -129,12 +129,12 @@ 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(ControlType::TabBody, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
    if( IsNativeControlSupported(ControlType::TabBody, ControlPart::Entire) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
    {
        const ImplControlValue aControlValue;

        ControlState nState = ControlState::ENABLED;
        int part = PART_ENTIRE_CONTROL;
        ControlPart part = ControlPart::Entire;
        if ( !IsEnabled() )
            nState &= ~ControlState::ENABLED;
        if ( HasFocus() )
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 7fdc8af..55a0a2f 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( ControlType::Toolbar, PART_ENTIRE_CONTROL ) )
    if( pThis->IsNativeControlSupported( ControlType::Toolbar, ControlPart::Entire ) )
    {

        ImplControlValue aControlValue;
@@ -155,7 +155,7 @@ int ToolBox::ImplGetDragWidth( ToolBox* pThis )
        Rectangle aContent, aBound;
        Rectangle aArea( aPoint, pThis->GetOutputSizePixel() );

        if ( pThis->GetNativeControlRegion(ControlType::Toolbar, pThis->mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ,
        if ( pThis->GetNativeControlRegion(ControlType::Toolbar, pThis->mbHorz ? ControlPart::ThumbVert : ControlPart::ThumbHorz,
                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(ControlType::Toolbar, mbHorz ? PART_THUMB_HORZ : PART_THUMB_VERT))
        if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, mbHorz ? ControlPart::ThumbHorz : ControlPart::ThumbVert))
        {
            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( ControlType::Toolbar, mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ,
            bNativeOk = rRenderContext.DrawNativeControl( ControlType::Toolbar, mbHorz ? ControlPart::ThumbVert : ControlPart::ThumbHorz,
                                            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( ControlType::Toolbar, mbHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
    return rRenderContext.DrawNativeControl( ControlType::Toolbar, mbHorz ? ControlPart::DrawBackgroundHorz : ControlPart::DrawBackgroundVert,
                                    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( ControlType::Toolbar, PART_ENTIRE_CONTROL) )
        if( ImplIsFloatingMode() && rRenderContext.IsNativeControlSupported( ControlType::Toolbar, ControlPart::Entire) )
            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(ControlType::Toolbar, PART_BUTTON);
    mpData->mbNativeButtons = rRenderContext.IsNativeControlSupported(ControlType::Toolbar, ControlPart::Button);

    const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();

@@ -1445,7 +1445,7 @@ void ToolBox::ApplySettings(vcl::RenderContext& rRenderContext)
    }
    else
    {
        if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, PART_ENTIRE_CONTROL)
        if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, ControlPart::Entire)
            || (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( ControlType::Toolbar, PART_BUTTON );
    mpData->mbNativeButtons = IsNativeControlSupported( ControlType::Toolbar, ControlPart::Button );

    const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();

@@ -1508,7 +1508,7 @@ void ToolBox::ImplInitSettings(bool bFont, bool bForeground, bool bBackground)
        }
        else
        {
            if (IsNativeControlSupported(ControlType::Toolbar, PART_ENTIRE_CONTROL)
            if (IsNativeControlSupported(ControlType::Toolbar, ControlPart::Entire)
                || (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( ControlType::Toolbar, PART_BUTTON ) )
        if( IsNativeControlSupported( ControlType::Toolbar, ControlPart::Button ) )
        {
            if( GetNativeControlRegion( ControlType::Toolbar, PART_BUTTON,
            if( GetNativeControlRegion( ControlType::Toolbar, ControlPart::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( ControlType::Combobox, PART_ENTIRE_CONTROL,
        if( GetNativeControlRegion( ControlType::Combobox, ControlPart::Entire,
                                    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( ControlType::Listbox, PART_ENTIRE_CONTROL,
        if( GetNativeControlRegion( ControlType::Listbox, ControlPart::Entire,
                                    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( ControlType::Spinbox, PART_ENTIRE_CONTROL,
        if( GetNativeControlRegion( ControlType::Spinbox, ControlPart::Entire,
                                    aReg,
                                    ControlState::ENABLED | ControlState::ROLLOVER,
                                    aVal, OUString(),
@@ -2925,7 +2925,7 @@ void ToolBox::ImplDrawSeparator(vcl::RenderContext& rRenderContext, sal_uInt16 n
        return;

    bool bNativeOk = false;
    ControlPart nPart = IsHorizontal() ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ;
    ControlPart nPart = IsHorizontal() ? ControlPart::SeparatorVert : ControlPart::SeparatorHorz;
    if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, nPart))
    {
        ImplControlValue aControlValue;
@@ -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( ControlType::Toolbar, PART_BUTTON ) )
    if( !bIsWindow && rRenderContext.IsNativeControlSupported( ControlType::Toolbar, ControlPart::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( ControlType::Toolbar, PART_BUTTON,
        bNativeOk = rRenderContext.DrawNativeControl( ControlType::Toolbar, ControlPart::Button,
                                              rRect, nState, aControlValue, OUString() );
    }

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index ffd3e1a..122f39a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -727,7 +727,7 @@ WindowImpl::WindowImpl( WindowType nType )
    mbSuppressAccessibilityEvents       = false;                     // true: do not send any accessibility events
    mbDrawSelectionBackground           = false;                     // true: draws transparent window background to indicate (toolbox) selection
    mbIsInTaskPaneList                  = false;                     // true: window was added to the taskpanelist in the topmost system window
    mnNativeBackground                  = 0;                         // initialize later, depends on type
    mnNativeBackground                  = ControlPart::NONE;         // initialize later, depends on type
    mbCallHandlersDuringInputDisabled   = false;                     // true: call event handlers even if input is disabled
    mbHelpTextDynamic                   = false;                     // true: append help id in HELP_DEBUG case
    mbFakeFocusSet                      = false;                     // true: pretend as if the window has focus.
@@ -1209,7 +1209,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( ControlType::Editbox, PART_ENTIRE_CONTROL, aCtrlRegion,
        if( pWindow->GetNativeControlRegion( ControlType::Editbox, ControlPart::Entire, aCtrlRegion,
                                             ControlState::ENABLED, aControlValue, OUString(),
                                             aBoundingRgn, aContentRgn ) )
        {
diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx
index c09c996..8ae0d49 100644
--- a/vcl/unx/gtk/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx
@@ -653,30 +653,30 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
        case ControlType::Progress:
        case ControlType::ListNode:
        case ControlType::ListNet:
            if(nPart==PART_ENTIRE_CONTROL)
            if(nPart==ControlPart::Entire)
                return true;
            break;

        case ControlType::Scrollbar:
            if(nPart==PART_DRAW_BACKGROUND_HORZ || nPart==PART_DRAW_BACKGROUND_VERT ||
               nPart==PART_ENTIRE_CONTROL       || nPart==HAS_THREE_BUTTONS)
            if(nPart==ControlPart::DrawBackgroundHorz || nPart==ControlPart::DrawBackgroundVert ||
               nPart==ControlPart::Entire       || nPart==ControlPart::HasThreeButtons)
                return true;
            break;

        case ControlType::Editbox:
        case ControlType::MultilineEditbox:
        case ControlType::Combobox:
            if(nPart==PART_ENTIRE_CONTROL || nPart==HAS_BACKGROUND_TEXTURE)
            if(nPart==ControlPart::Entire || nPart==ControlPart::HasBackgroundTexture)
                return true;
            break;

        case ControlType::Spinbox:
            if(nPart==PART_ENTIRE_CONTROL || nPart==PART_ALL_BUTTONS || nPart==HAS_BACKGROUND_TEXTURE)
            if(nPart==ControlPart::Entire || nPart==ControlPart::AllButtons || nPart==ControlPart::HasBackgroundTexture)
                return true;
            break;

        case ControlType::SpinButtons:
            if(nPart==PART_ENTIRE_CONTROL || nPart==PART_ALL_BUTTONS)
            if(nPart==ControlPart::Entire || nPart==ControlPart::AllButtons)
                return true;
            break;

@@ -687,56 +687,56 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
        case ControlType::TabItem:
        case ControlType::TabPane:
        case ControlType::TabBody:
            if(nPart==PART_ENTIRE_CONTROL || nPart==PART_TABS_DRAW_RTL)
            if(nPart==ControlPart::Entire || nPart==ControlPart::TabsDrawRtl)
                return true;
            break;

        case ControlType::Listbox:
            if(nPart==PART_ENTIRE_CONTROL || nPart==PART_WINDOW || nPart==HAS_BACKGROUND_TEXTURE)
            if(nPart==ControlPart::Entire || nPart==ControlPart::ListboxWindow || nPart==ControlPart::HasBackgroundTexture)
                return true;
            break;

        case ControlType::Toolbar:
            if( 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
                ||  nPart==PART_SEPARATOR_HORZ
                ||  nPart==PART_SEPARATOR_VERT
            if( nPart==ControlPart::Entire
                ||  nPart==ControlPart::DrawBackgroundHorz
                ||  nPart==ControlPart::DrawBackgroundVert
                ||  nPart==ControlPart::ThumbHorz
                ||  nPart==ControlPart::ThumbVert
                ||  nPart==ControlPart::Button
                ||  nPart==ControlPart::SeparatorHorz
                ||  nPart==ControlPart::SeparatorVert
                )
                return true;
            break;

        case ControlType::Menubar:
            if(nPart==PART_ENTIRE_CONTROL || nPart==PART_MENU_ITEM)
            if(nPart==ControlPart::Entire || nPart==ControlPart::MenuItem)
                return true;
            break;

        case ControlType::MenuPopup:
            if (nPart==PART_ENTIRE_CONTROL
                ||  nPart==PART_MENU_ITEM
                ||  nPart==PART_MENU_ITEM_CHECK_MARK
                ||  nPart==PART_MENU_ITEM_RADIO_MARK
                ||  nPart==PART_MENU_SEPARATOR
                ||  nPart==PART_MENU_SUBMENU_ARROW
            if (nPart==ControlPart::Entire
                ||  nPart==ControlPart::MenuItem
                ||  nPart==ControlPart::MenuItemCheckMark
                ||  nPart==ControlPart::MenuItemRadioMark
                ||  nPart==ControlPart::Separator
                ||  nPart==ControlPart::SubmenuArrow
            )
                return true;
            break;

        case ControlType::Slider:
            if(nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA)
            if(nPart == ControlPart::TrackHorzArea || nPart == ControlPart::TrackVertArea)
                return true;
            break;

        case ControlType::Fixedline:
            if(nPart == PART_SEPARATOR_VERT || nPart == PART_SEPARATOR_HORZ)
            if(nPart == ControlPart::SeparatorVert || nPart == ControlPart::SeparatorHorz)
                return true;
            break;

        case ControlType::ListHeader:
            if(nPart == PART_BUTTON || nPart == PART_ARROW)
            if(nPart == ControlPart::Button || nPart == ControlPart::Arrow)
                return true;
            break;
        default: break;
@@ -761,10 +761,10 @@ bool GtkSalGraphics::hitTestNativeControl( ControlType        nType,
                                bool&            rIsInside )
{
    if ( ( nType == ControlType::Scrollbar ) &&
         ( ( nPart == PART_BUTTON_UP ) ||
           ( nPart == PART_BUTTON_DOWN ) ||
           ( nPart == PART_BUTTON_LEFT ) ||
           ( nPart == PART_BUTTON_RIGHT ) ) )
         ( ( nPart == ControlPart::ButtonUp ) ||
           ( nPart == ControlPart::ButtonDown ) ||
           ( nPart == ControlPart::ButtonLeft ) ||
           ( nPart == ControlPart::ButtonRight ) ) )
    {
        NWEnsureGTKScrollbars( m_nXScreen );

@@ -785,15 +785,15 @@ bool GtkSalGraphics::hitTestNativeControl( ControlType        nType,

        rIsInside = false;

        ControlPart nCounterPart = 0;
        if ( nPart == PART_BUTTON_UP )
            nCounterPart = PART_BUTTON_DOWN;
        else if ( nPart == PART_BUTTON_DOWN )
            nCounterPart = PART_BUTTON_UP;
        else if ( nPart == PART_BUTTON_LEFT )
            nCounterPart = PART_BUTTON_RIGHT;
        else if ( nPart == PART_BUTTON_RIGHT )
            nCounterPart = PART_BUTTON_LEFT;
        ControlPart nCounterPart = ControlPart::NONE;
        if ( nPart == ControlPart::ButtonUp )
            nCounterPart = ControlPart::ButtonDown;
        else if ( nPart == ControlPart::ButtonDown )
            nCounterPart = ControlPart::ButtonUp;
        else if ( nPart == ControlPart::ButtonLeft )
            nCounterPart = ControlPart::ButtonRight;
        else if ( nPart == ControlPart::ButtonRight )
            nCounterPart = ControlPart::ButtonLeft;

        aBackward = NWGetScrollButtonRect( m_nXScreen, nPart, rControlRegion );
        aForward = NWGetScrollButtonRect( m_nXScreen, nCounterPart, rControlRegion );
@@ -801,34 +801,34 @@ bool GtkSalGraphics::hitTestNativeControl( ControlType        nType,
        if ( has_backward && has_forward2 )
        {
            Size aSize( aBackward.GetSize() );
            if ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_DOWN ) )
            if ( ( nPart == ControlPart::ButtonUp ) || ( nPart == ControlPart::ButtonDown ) )
                aSize.setHeight( aBackward.GetHeight() / 2 );
            else
                aSize.setWidth( aBackward.GetWidth() / 2 );
            aBackward.SetSize( aSize );

            if ( nPart == PART_BUTTON_DOWN )
            if ( nPart == ControlPart::ButtonDown )
                aBackward.Move( 0, aBackward.GetHeight() / 2 );
            else if ( nPart == PART_BUTTON_RIGHT )
            else if ( nPart == ControlPart::ButtonRight )
                aBackward.Move( aBackward.GetWidth() / 2, 0 );
        }

        if ( has_backward2 && has_forward )
        {
            Size aSize( aForward.GetSize() );
            if ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_DOWN ) )
            if ( ( nPart == ControlPart::ButtonUp ) || ( nPart == ControlPart::ButtonDown ) )
                aSize.setHeight( aForward.GetHeight() / 2 );
            else
                aSize.setWidth( aForward.GetWidth() / 2 );
            aForward.SetSize( aSize );

            if ( nPart == PART_BUTTON_DOWN )
            if ( nPart == ControlPart::ButtonDown )
                aForward.Move( 0, aForward.GetHeight() / 2 );
            else if ( nPart == PART_BUTTON_RIGHT )
            else if ( nPart == ControlPart::ButtonRight )
                aForward.Move( aForward.GetWidth() / 2, 0 );
        }

        if ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_LEFT ) )
        if ( ( nPart == ControlPart::ButtonUp ) || ( nPart == ControlPart::ButtonLeft ) )
        {
            if ( has_backward )
                rIsInside |= aBackward.IsInside( aPos );
@@ -913,7 +913,7 @@ bool GtkSalGraphics::drawNativeControl(ControlType nType, ControlPart nPart,
        && nType != ControlType::TabItem
        && nType != ControlType::TabPane
        && nType != ControlType::Progress
        && ! (nType == ControlType::Toolbar && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) )
        && ! (nType == ControlType::Toolbar && (nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert) )
        )
    {
        if( bNeedTwoPasses )
@@ -988,41 +988,41 @@ bool GtkSalGraphics::DoDrawNativeControl(
                            const OUString& rCaption,
                            ControlCacheKey& rControlCacheKey)
{
    if ( (nType==ControlType::Pushbutton) && (nPart==PART_ENTIRE_CONTROL) )
    if ( (nType==ControlType::Pushbutton) && (nPart==ControlPart::Entire) )
    {
        return NWPaintGTKButton( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if ( (nType==ControlType::Radiobutton) && (nPart==PART_ENTIRE_CONTROL) )
    else if ( (nType==ControlType::Radiobutton) && (nPart==ControlPart::Entire) )
    {
        return NWPaintGTKRadio( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if ( (nType==ControlType::Checkbox) && (nPart==PART_ENTIRE_CONTROL) )
    else if ( (nType==ControlType::Checkbox) && (nPart==ControlPart::Entire) )
    {
        return NWPaintGTKCheck( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if ( (nType==ControlType::Scrollbar) && ((nPart==PART_DRAW_BACKGROUND_HORZ) || (nPart==PART_DRAW_BACKGROUND_VERT)) )
    else if ( (nType==ControlType::Scrollbar) && ((nPart==ControlPart::DrawBackgroundHorz) || (nPart==ControlPart::DrawBackgroundVert)) )
    {
        return NWPaintGTKScrollbar( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    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)) )
    else if ( ((nType==ControlType::Editbox) && ((nPart==ControlPart::Entire) || (nPart==ControlPart::HasBackgroundTexture)) )
        || ((nType==ControlType::Spinbox) && (nPart==ControlPart::HasBackgroundTexture))
    || ((nType==ControlType::Combobox) && (nPart==ControlPart::HasBackgroundTexture))
    || ((nType==ControlType::Listbox) && (nPart==ControlPart::HasBackgroundTexture)) )
    {
        return NWPaintGTKEditBox( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if ( ((nType==ControlType::MultilineEditbox) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==HAS_BACKGROUND_TEXTURE)) ) )
    else if ( ((nType==ControlType::MultilineEditbox) && ((nPart==ControlPart::Entire) || (nPart==ControlPart::HasBackgroundTexture)) ) )
    {
        return NWPaintGTKEditBox( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if ( ((nType==ControlType::Spinbox) || (nType==ControlType::SpinButtons))
        && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_ALL_BUTTONS)) )
        && ((nPart==ControlPart::Entire) || (nPart==ControlPart::AllButtons)) )
    {
        return NWPaintGTKSpinBox(nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption, rControlCacheKey);
    }
    else if ( (nType == ControlType::Combobox) &&
        ( (nPart==PART_ENTIRE_CONTROL)
        ||(nPart==PART_BUTTON_DOWN)
        ( (nPart==ControlPart::Entire)
        ||(nPart==ControlPart::ButtonDown)
        ) )
    {
        return NWPaintGTKComboBox( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
@@ -1034,7 +1034,7 @@ bool GtkSalGraphics::DoDrawNativeControl(
        else
            return NWPaintGTKTabItem( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption);
    }
    else if ( (nType==ControlType::Listbox) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_WINDOW)) )
    else if ( (nType==ControlType::Listbox) && ((nPart==ControlPart::Entire) || (nPart==ControlPart::ListboxWindow)) )
    {
        return NWPaintGTKListBox( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
@@ -1047,30 +1047,30 @@ bool GtkSalGraphics::DoDrawNativeControl(
        return NWPaintGTKMenubar( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if(    (nType == ControlType::MenuPopup)
        && (  (nPart == PART_ENTIRE_CONTROL)
    || (nPart == PART_MENU_ITEM)
    || (nPart == PART_MENU_ITEM_CHECK_MARK)
    || (nPart == PART_MENU_ITEM_RADIO_MARK)
    || (nPart == PART_MENU_SEPARATOR)
    || (nPart == PART_MENU_SUBMENU_ARROW)
        && (  (nPart == ControlPart::Entire)
    || (nPart == ControlPart::MenuItem)
    || (nPart == ControlPart::MenuItemCheckMark)
    || (nPart == ControlPart::MenuItemRadioMark)
    || (nPart == ControlPart::Separator)
    || (nPart == ControlPart::SubmenuArrow)
    )
    )
    {
        return NWPaintGTKPopupMenu( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if( (nType == ControlType::Tooltip) && (nPart == PART_ENTIRE_CONTROL) )
    else if( (nType == ControlType::Tooltip) && (nPart == ControlPart::Entire) )
    {
        return NWPaintGTKTooltip( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if( (nType == ControlType::Progress) && (nPart == PART_ENTIRE_CONTROL) )
    else if( (nType == ControlType::Progress) && (nPart == ControlPart::Entire) )
    {
        return NWPaintGTKProgress( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if( (nType == ControlType::ListNode) && (nPart == PART_ENTIRE_CONTROL) )
    else if( (nType == ControlType::ListNode) && (nPart == ControlPart::Entire) )
    {
        return NWPaintGTKListNode( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }
    else if( (nType == ControlType::ListNet) && (nPart == PART_ENTIRE_CONTROL) )
    else if( (nType == ControlType::ListNet) && (nPart == ControlPart::Entire) )
    {
        // don't actually draw anything; gtk treeviews do not draw lines
        return TRUE;
@@ -1093,9 +1093,9 @@ bool GtkSalGraphics::DoDrawNativeControl(
    }
    else if(nType==ControlType::ListHeader)
    {
        if(nPart == PART_BUTTON)
        if(nPart == ControlPart::Button)
            return NWPaintGTKListHeader( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
        else if(nPart == PART_ARROW)
        else if(nPart == ControlPart::Arrow)
            return NWPaintGTKArrow( pDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
    }

@@ -1126,7 +1126,7 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
{
    bool returnVal = false;

    if ( (nType==ControlType::Pushbutton) && (nPart==PART_ENTIRE_CONTROL)
    if ( (nType==ControlType::Pushbutton) && (nPart==ControlPart::Entire)
        && (rControlRegion.GetWidth() > 16)
    && (rControlRegion.GetHeight() > 16) )
    {
@@ -1136,13 +1136,13 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,

        returnVal = true;
    }
    if (nType == ControlType::TabItem && nPart == PART_ENTIRE_CONTROL)
    if (nType == ControlType::TabItem && nPart == ControlPart::Entire)
    {
        rNativeBoundingRegion = NWGetTabItemRect(m_nXScreen, rControlRegion);
        rNativeContentRegion = rNativeBoundingRegion;
        returnVal = true;
    }
    if ( (nType==ControlType::Combobox) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
    if ( (nType==ControlType::Combobox) && ((nPart==ControlPart::ButtonDown) || (nPart==ControlPart::SubEdit)) )
    {
        rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState,
        aValue, rCaption );
@@ -1150,7 +1150,7 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,

        returnVal = true;
    }
    if ( (nType==ControlType::Spinbox) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
    if ( (nType==ControlType::Spinbox) && ((nPart==ControlPart::ButtonUp) || (nPart==ControlPart::ButtonDown) || (nPart==ControlPart::SubEdit)) )
    {

        rNativeBoundingRegion = NWGetSpinButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState,
@@ -1159,7 +1159,7 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,

        returnVal = true;
    }
    if ( (nType==ControlType::Listbox) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
    if ( (nType==ControlType::Listbox) && ((nPart==ControlPart::ButtonDown) || (nPart==ControlPart::SubEdit)) )
    {
        rNativeBoundingRegion = NWGetListBoxButtonRect( m_nXScreen, nType, nPart, rControlRegion, nState,
        aValue, rCaption );
@@ -1168,19 +1168,19 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
        returnVal = true;
    }
    if ( (nType==ControlType::Toolbar) &&
        ((nPart==PART_DRAW_BACKGROUND_HORZ)    ||
        (nPart==PART_DRAW_BACKGROUND_VERT)    ||
        (nPart==PART_THUMB_HORZ)            ||
        (nPart==PART_THUMB_VERT)            ||
        (nPart==PART_BUTTON)
        ((nPart==ControlPart::DrawBackgroundHorz)    ||
        (nPart==ControlPart::DrawBackgroundVert)    ||
        (nPart==ControlPart::ThumbHorz)            ||
        (nPart==ControlPart::ThumbVert)            ||
        (nPart==ControlPart::Button)
        ))
    {
        rNativeBoundingRegion = NWGetToolbarRect( m_nXScreen, nType, nPart, rControlRegion, nState, aValue, rCaption );
        rNativeContentRegion = rNativeBoundingRegion;
        returnVal = true;
    }
    if ( (nType==ControlType::Scrollbar) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) ||
        (nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN)  ) )
    if ( (nType==ControlType::Scrollbar) && ((nPart==ControlPart::ButtonLeft) || (nPart==ControlPart::ButtonRight) ||
        (nPart==ControlPart::ButtonUp) || (nPart==ControlPart::ButtonDown)  ) )
    {
        rNativeBoundingRegion = NWGetScrollButtonRect( m_nXScreen, nPart, rControlRegion );
        rNativeContentRegion = rNativeBoundingRegion;
@@ -1192,7 +1192,7 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
            rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1;
        returnVal = true;
    }
    if( (nType == ControlType::Menubar) && (nPart == PART_ENTIRE_CONTROL) )
    if( (nType == ControlType::Menubar) && (nPart == ControlPart::Entire) )
    {
        NWEnsureGTKMenubar( m_nXScreen );
        GtkRequisition aReq;
@@ -1206,13 +1206,13 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
    }
    if( nType == ControlType::MenuPopup )
    {
        if( (nPart == PART_MENU_ITEM_CHECK_MARK) ||
            (nPart == PART_MENU_ITEM_RADIO_MARK) )
        if( (nPart == ControlPart::MenuItemCheckMark) ||
            (nPart == ControlPart::MenuItemRadioMark) )
        {
            NWEnsureGTKMenu( m_nXScreen );

            gint indicator_size = 0;
            GtkWidget* pWidget = (nPart == PART_MENU_ITEM_CHECK_MARK) ?
            GtkWidget* pWidget = (nPart == ControlPart::MenuItemCheckMark) ?
                gWidgetData[m_nXScreen].gMenuItemCheckMenuWidget : gWidgetData[m_nXScreen].gMenuItemRadioMenuWidget;
            gtk_widget_style_get( pWidget,
                                  "indicator_size", &indicator_size,
@@ -1224,7 +1224,7 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
            rNativeContentRegion = aIndicatorRect;
            returnVal = true;
        }
        else if( nPart == PART_MENU_SUBMENU_ARROW )
        else if( nPart == ControlPart::SubmenuArrow )
        {
            GtkWidget* widget = gWidgetData[m_nXScreen].gMenuItemMenuWidget;
            GtkWidget* child;
@@ -1289,7 +1289,7 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
        rNativeContentRegion = aIndicatorRect;
        returnVal = true;
    }
    if( (nType == ControlType::Editbox || nType == ControlType::Spinbox || nType == ControlType::Combobox) && nPart == PART_ENTIRE_CONTROL )
    if( (nType == ControlType::Editbox || nType == ControlType::Spinbox || nType == ControlType::Combobox) && nPart == ControlPart::Entire )
    {
        NWEnsureGTKEditBox( m_nXScreen );
        GtkWidget* widget = gWidgetData[m_nXScreen].gEditBoxWidget;
@@ -1303,10 +1303,10 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
        rNativeContentRegion = rNativeBoundingRegion;
        returnVal = true;
    }
    if( (nType == ControlType::Slider) && (nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT) )
    if( (nType == ControlType::Slider) && (nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert) )
    {
        NWEnsureGTKSlider( m_nXScreen );
        GtkWidget* widget = (nPart == PART_THUMB_HORZ) ? gWidgetData[m_nXScreen].gHScale : gWidgetData[m_nXScreen].gVScale;
        GtkWidget* widget = (nPart == ControlPart::ThumbHorz) ? gWidgetData[m_nXScreen].gHScale : gWidgetData[m_nXScreen].gVScale;
        gint slider_length = 10;
        gint slider_width = 10;
        gtk_widget_style_get( widget,
@@ -1314,7 +1314,7 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
                              "slider-length", &slider_length,
                              nullptr);
        Rectangle aRect( rControlRegion );
        if( nPart == PART_THUMB_HORZ )
        if( nPart == ControlPart::ThumbHorz )
        {
            aRect.Right() = aRect.Left() + slider_length - 1;
            aRect.Bottom() = aRect.Top() + slider_width - 1;
@@ -1327,7 +1327,7 @@ bool GtkSalGraphics::getNativeControlRegion(  ControlType nType,
        rNativeBoundingRegion = rNativeContentRegion = aRect;
        returnVal = true;
    }
    if( nType == ControlType::Frame && nPart == PART_BORDER )
    if( nType == ControlType::Frame && nPart == ControlPart::Border )
    {
        int frameWidth = getFrameWidth(gWidgetData[m_nXScreen].gFrame);
        rNativeBoundingRegion = rControlRegion;
@@ -1494,7 +1494,7 @@ bool GtkSalGraphics::NWPaintGTKFixedLine(
            ControlState, const ImplControlValue&,
            const OUString& )
{
    if(nPart == PART_SEPARATOR_HORZ)
    if(nPart == ControlPart::SeparatorHorz)
        gtk_paint_hline(m_pWindow->style,gdkDrawable,GTK_STATE_NORMAL,nullptr,m_pWindow,"hseparator",rControlRectangle.Left(),rControlRectangle.Right(),rControlRectangle.Top());
    else
        gtk_paint_vline(m_pWindow->style,gdkDrawable,GTK_STATE_NORMAL,nullptr,m_pWindow,"vseparator",rControlRectangle.Top(),rControlRectangle.Bottom(),rControlRectangle.Left());
@@ -2010,7 +2010,7 @@ bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
                                         "has-secondary-backward-stepper", &has_backward2, nullptr );
    gint magic = trough_border ? 1 : 0;

    if ( nPart == PART_DRAW_BACKGROUND_HORZ )
    if ( nPart == ControlPart::DrawBackgroundHorz )
    {
        unsigned int sliderHeight = slider_width + (trough_border * 2);
        vShim = (pixmapRect.GetHeight() - sliderHeight) / 2;
@@ -2104,7 +2104,7 @@ bool GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
    scrollbarValues = gtk_range_get_adjustment( GTK_RANGE(scrollbarWidget) );
    if ( scrollbarValues == nullptr )
        scrollbarValues = GTK_ADJUSTMENT( gtk_adjustment_new(0, 0, 0, 0, 0, 0) );
    if ( nPart == PART_DRAW_BACKGROUND_HORZ )
    if ( nPart == ControlPart::DrawBackgroundHorz )
    {
        scrollbarValues->lower = rScrollbarVal.mnMin;
        scrollbarValues->upper = rScrollbarVal.mnMax;
@@ -2295,7 +2295,7 @@ static Rectangle NWGetScrollButtonRect(    SalX11Screen nScreen, ControlPart nPa
    if ( has_backward )  nFirst  += 1;
    if ( has_backward2 ) nSecond += 1;

    if ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_DOWN ) )
    if ( ( nPart == ControlPart::ButtonUp ) || ( nPart == ControlPart::ButtonDown ) )
    {
        buttonWidth = slider_width + 2 * trough_border;
        buttonHeight = stepper_size + trough_border + stepper_spacing;
@@ -2306,27 +2306,27 @@ static Rectangle NWGetScrollButtonRect(    SalX11Screen nScreen, ControlPart nPa
        buttonHeight = slider_width + 2 * trough_border;
    }

    if ( nPart == PART_BUTTON_UP )
    if ( nPart == ControlPart::ButtonUp )
    {
        buttonHeight *= nFirst;
        buttonHeight -= 1;
        buttonRect.setX( aAreaRect.Left() );
        buttonRect.setY( aAreaRect.Top() );
    }
    else if ( nPart == PART_BUTTON_LEFT )
    else if ( nPart == ControlPart::ButtonLeft )
    {
        buttonWidth *= nFirst;
        buttonWidth -= 1;
        buttonRect.setX( aAreaRect.Left() );
        buttonRect.setY( aAreaRect.Top() );
    }
    else if ( nPart == PART_BUTTON_DOWN )
    else if ( nPart == ControlPart::ButtonDown )
    {
        buttonHeight *= nSecond;
        buttonRect.setX( aAreaRect.Left() );
        buttonRect.setY( aAreaRect.Top() + aAreaRect.GetHeight() - buttonHeight );
    }
    else if ( nPart == PART_BUTTON_RIGHT )
    else if ( nPart == ControlPart::ButtonRight )
    {
        buttonWidth *= nSecond;
        buttonRect.setX( aAreaRect.Left() + aAreaRect.GetWidth() - buttonWidth );
@@ -2484,10 +2484,10 @@ bool GtkSalGraphics::NWPaintGTKSpinBox(ControlType nType, ControlPart nPart,
    GtkShadowType        shadowType;
    const SpinbuttonValue *    pSpinVal = (aValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue *>(&aValue) : nullptr;
    Rectangle            upBtnRect;
    ControlPart        upBtnPart = PART_BUTTON_UP;
    ControlPart        upBtnPart = ControlPart::ButtonUp;
    ControlState        upBtnState = ControlState::ENABLED;
    Rectangle            downBtnRect;
    ControlPart        downBtnPart = PART_BUTTON_DOWN;
    ControlPart        downBtnPart = ControlPart::ButtonDown;
    ControlState        downBtnState = ControlState::ENABLED;

    NWEnsureGTKButton( m_nXScreen );
@@ -2519,7 +2519,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==ControlType::Spinbox) && (nPart!=PART_ALL_BUTTONS) )
        if ( (nType==ControlType::Spinbox) && (nPart!=ControlPart::AllButtons) )
        {
            // Draw an edit field for SpinBoxes and ComboBoxes
            Rectangle aEditBoxRect( pixmapRect );
@@ -2577,12 +2577,12 @@ static Rectangle NWGetSpinButtonRect( SalX11Screen nScreen,
        buttonRect.setX( aAreaRect.Left() );
    else
        buttonRect.setX( aAreaRect.Left() + (aAreaRect.GetWidth() - buttonRect.GetWidth()) );
    if ( nPart == PART_BUTTON_UP )
    if ( nPart == ControlPart::ButtonUp )
    {
        buttonRect.setY( aAreaRect.Top() );
        buttonRect.Bottom() = buttonRect.Top() + (aAreaRect.GetHeight() / 2);
    }
    else if( nPart == PART_BUTTON_DOWN )
    else if( nPart == ControlPart::ButtonDown )
    {
        buttonRect.setY( aAreaRect.Top() + (aAreaRect.GetHeight() / 2) );
        buttonRect.Bottom() = aAreaRect.Bottom(); // cover area completely
@@ -2625,7 +2625,7 @@ static void NWPaintOneSpinButton( SalX11Screen nScreen,

    NWSetWidgetState( gWidgetData[nScreen].gSpinButtonWidget, nState, stateType );
    gtk_paint_box( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, shadowType, nullptr, gWidgetData[nScreen].gSpinButtonWidget,
            (nPart == PART_BUTTON_UP) ? "spinbutton_up" : "spinbutton_down",
            (nPart == ControlPart::ButtonUp) ? "spinbutton_up" : "spinbutton_down",
            (buttonRect.Left() - aAreaRect.Left()), (buttonRect.Top() - aAreaRect.Top()),
            buttonRect.GetWidth(), buttonRect.GetHeight() );

@@ -2633,13 +2633,13 @@ static void NWPaintOneSpinButton( SalX11Screen nScreen,
    arrowSize -= arrowSize % 2 - 1; /* force odd */
    arrowRect.SetSize( Size( arrowSize, arrowSize ) );
    arrowRect.setX( buttonRect.Left() + (buttonRect.GetWidth() - arrowRect.GetWidth()) / 2 );
    if ( nPart == PART_BUTTON_UP )
    if ( nPart == ControlPart::ButtonUp )
        arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 + 1);
    else
        arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 - 1);

    gtk_paint_arrow( gWidgetData[nScreen].gSpinButtonWidget->style, pixmap, stateType, GTK_SHADOW_OUT, nullptr, gWidgetData[nScreen].gSpinButtonWidget,
            "spinbutton", (nPart == PART_BUTTON_UP) ? GTK_ARROW_UP : GTK_ARROW_DOWN, true,
            "spinbutton", (nPart == ControlPart::ButtonUp) ? GTK_ARROW_UP : GTK_ARROW_DOWN, true,
            (arrowRect.Left() - aAreaRect.Left()), (arrowRect.Top() - aAreaRect.Top()),
            arrowRect.GetWidth(), arrowRect.GetHeight() );
}
@@ -2675,8 +2675,8 @@ bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
    NWSetWidgetState( gWidgetData[m_nXScreen].gComboWidget, nState, stateType );
    NWSetWidgetState( gWidgetData[m_nXScreen].gArrowWidget, nState, stateType );

    buttonRect = NWGetComboBoxButtonRect( m_nXScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption );
    if( nPart == PART_BUTTON_DOWN )
    buttonRect = NWGetComboBoxButtonRect( m_nXScreen, nType, ControlPart::ButtonDown, pixmapRect, nState, aValue, rCaption );
    if( nPart == ControlPart::ButtonDown )
        buttonRect.Left() += 1;

    Rectangle        aEditBoxRect( pixmapRect );
@@ -2697,7 +2697,7 @@ bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
        clipRect.width = it->GetWidth();
        clipRect.height = it->GetHeight();

        if( nPart == PART_ENTIRE_CONTROL )
        if( nPart == ControlPart::Entire )
            NWPaintOneEditBox( m_nXScreen, gdkDrawable, &clipRect, nType, nPart, aEditBoxRect,
                               nState, aValue, rCaption );

@@ -2747,7 +2747,7 @@ static Rectangle NWGetComboBoxButtonRect( SalX11Screen nScreen,
    nButtonWidth = nArrowWidth +
                   ((BTN_CHILD_SPACING + gWidgetData[nScreen].gDropdownWidget->style->xthickness) * 2)
                   + (2 * (nFocusWidth+nFocusPad));
    if( nPart == PART_BUTTON_DOWN )
    if( nPart == ControlPart::ButtonDown )
    {
        aButtonRect.SetSize( Size( nButtonWidth, aAreaRect.GetHeight() ) );
        if( AllSettings::GetLayoutRTL() )
@@ -2756,7 +2756,7 @@ static Rectangle NWGetComboBoxButtonRect( SalX11Screen nScreen,
            aButtonRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth,
                                       aAreaRect.Top() ) );
    }
    else if( nPart == PART_SUB_EDIT )
    else if( nPart == ControlPart::SubEdit )
    {
        NWEnsureGTKCombo( nScreen );

@@ -2962,7 +2962,7 @@ bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
    w = rControlRectangle.GetWidth();
    h = rControlRectangle.GetHeight();

    if ( nPart != PART_WINDOW )
    if ( nPart != ControlPart::ListboxWindow )
    {
        gtk_widget_style_get( gWidgetData[m_nXScreen].gOptionMenuWidget,
            "interior_focus",    &bInteriorFocus,
@@ -2978,7 +2978,7 @@ bool GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
        clipRect.width = it->GetWidth();
        clipRect.height = it->GetHeight();

        if ( nPart != PART_WINDOW )
        if ( nPart != ControlPart::ListboxWindow )
        {
            // Listboxes must paint opaque since some themes have alpha-channel enabled bodies
            gtk_paint_flat_box( m_pWindow->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
@@ -3022,7 +3022,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
    GdkRectangle    clipRect;

    NWEnsureGTKToolbar( m_nXScreen );
    if( nPart == PART_BUTTON ) // toolbar buttons cannot focus in gtk
    if( nPart == ControlPart::Button ) // toolbar buttons cannot focus in gtk
        nState &= ~ControlState::FOCUSED;
    NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );

@@ -3032,7 +3032,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
    h = rControlRectangle.GetHeight();

    // handle toolbar
    if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT )
    if( nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert )
    {
        NWSetWidgetState( gWidgetData[m_nXScreen].gToolbarWidget, nState, stateType );

@@ -3040,13 +3040,13 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
        if ( nState & ControlState::ENABLED )
            GTK_WIDGET_SET_FLAGS( gWidgetData[m_nXScreen].gToolbarWidget, GTK_SENSITIVE );

        if( nPart == PART_DRAW_BACKGROUND_HORZ )
        if( nPart == ControlPart::DrawBackgroundHorz )
            gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nXScreen].gToolbarWidget), GTK_ORIENTATION_HORIZONTAL );
        else
            gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nXScreen].gToolbarWidget), GTK_ORIENTATION_VERTICAL );
    }
    // handle grip
    else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
    else if( nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert )
    {
        NWSetWidgetState( gWidgetData[m_nXScreen].gHandleBoxWidget, nState, stateType );

@@ -3067,7 +3067,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
        }
    }
    // handle button
    else if( nPart == PART_BUTTON )
    else if( nPart == ControlPart::Button )
    {
        bool bPaintButton = (nState & ControlState::PRESSED)
            || (nState & ControlState::ROLLOVER);
@@ -3082,10 +3082,10 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
        NWSetWidgetState( pButtonWidget, nState, stateType );
        gtk_widget_ensure_style( pButtonWidget );
        if(bPaintButton)
            NWPaintGTKButtonReal(pButtonWidget, gdkDrawable, ControlType::Generic, 0, rControlRectangle, rClipList, nState, aValue, string);
            NWPaintGTKButtonReal(pButtonWidget, gdkDrawable, ControlType::Generic, ControlPart::NONE, rControlRectangle, rClipList, nState, aValue, string);
    }

    if( nPart != PART_BUTTON )
    if( nPart != ControlPart::Button )
    {
        for( std::list< Rectangle >::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
        {
@@ -3095,7 +3095,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
            clipRect.height = it->GetHeight();

            // draw toolbar
            if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT )
            if( nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert )
            {
                gtk_paint_flat_box( gWidgetData[m_nXScreen].gToolbarWidget->style,
                                    gdkDrawable,
@@ -3115,7 +3115,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
                               x, y, w, h );
            }
            // draw grip
            else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
            else if( nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert )
            {
                gtk_paint_handle( gWidgetData[m_nXScreen].gHandleBoxWidget->style,
                                  gdkDrawable,
@@ -3125,12 +3125,12 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
                                  gWidgetData[m_nXScreen].gHandleBoxWidget,
                                  "handlebox",
                                  g_x, g_y, g_w, g_h,
                                  nPart == PART_THUMB_HORZ ?
                                  nPart == ControlPart::ThumbHorz ?
                                  GTK_ORIENTATION_HORIZONTAL :
                                  GTK_ORIENTATION_VERTICAL
                                  );
            }
            else if( nPart == PART_SEPARATOR_HORZ || nPart == PART_SEPARATOR_VERT )
            else if( nPart == ControlPart::SeparatorHorz || nPart == ControlPart::SeparatorVert )
            {
                const double shim = 0.2;

@@ -3144,7 +3144,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar(

                if (wide_separators)
                {
                    if (nPart == PART_SEPARATOR_VERT)
                    if (nPart == ControlPart::SeparatorVert)
                        gtk_paint_box (gWidgetData[m_nXScreen].gSeparator->style, gdkDrawable,
                                       GTK_STATE_NORMAL, GTK_SHADOW_ETCHED_OUT,
                                       &clipRect, gWidgetData[m_nXScreen].gSeparator, "vseparator",
@@ -3159,7 +3159,7 @@ bool GtkSalGraphics::NWPaintGTKToolbar(
                }
                else
                {
                    if (nPart == PART_SEPARATOR_VERT)
                    if (nPart == ControlPart::SeparatorVert)
                        gtk_paint_vline (gWidgetData[m_nXScreen].gSeparator->style, gdkDrawable,
                                         GTK_STATE_NORMAL,
                                         &clipRect, gWidgetData[m_nXScreen].gSeparator, "vseparator",
@@ -3208,7 +3208,7 @@ bool GtkSalGraphics::NWPaintGTKMenubar(
    w = rControlRectangle.GetWidth();
    h = rControlRectangle.GetHeight();

    if( nPart == PART_MENU_ITEM )
    if( nPart == ControlPart::MenuItem )
    {
        if( nState & ControlState::SELECTED )
        {
@@ -3223,7 +3223,7 @@ bool GtkSalGraphics::NWPaintGTKMenubar(
        lcl_rectangleToGdkRectangle(*it, clipRect);

        // handle Menubar
        if( nPart == PART_ENTIRE_CONTROL )
        if( nPart == ControlPart::Entire )
        {
            NWSetWidgetState( gWidgetData[m_nXScreen].gMenubarWidget, nState, stateType );

@@ -3254,7 +3254,7 @@ bool GtkSalGraphics::NWPaintGTKMenubar(
                           x, y, w, h );
        }

        else if( nPart == PART_MENU_ITEM )
        else if( nPart == ControlPart::MenuItem )
        {
            if( nState & ControlState::SELECTED )
            {
@@ -3284,7 +3284,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu(
    // #i50745# gtk does not draw disabled menu entries (and crux theme
    // even crashes) in very old (Fedora Core 4 vintage) gtk's
    if (gtk_major_version <= 2 && gtk_minor_version <= 8 &&
        nPart == PART_MENU_ITEM && ! (nState & ControlState::ENABLED) )
        nPart == ControlPart::MenuItem && ! (nState & ControlState::ENABLED) )
        return true;

    GtkStateType    stateType;
@@ -3301,7 +3301,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu(
    w = rControlRectangle.GetWidth();
    h = rControlRectangle.GetHeight();

    if( nPart == PART_MENU_ITEM &&
    if( nPart == ControlPart::MenuItem &&
        ( nState & (ControlState::SELECTED|ControlState::ROLLOVER) ) )
    {
        gtk_widget_style_get( gWidgetData[m_nXScreen].gMenuItemMenuWidget,
@@ -3322,7 +3322,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu(
        clipRect.width = it->GetWidth();
        clipRect.height = it->GetHeight();

        if( nPart == PART_ENTIRE_CONTROL )
        if( nPart == ControlPart::Entire )
        {
            // for translucent menubar styles paint background first
            gtk_paint_flat_box( gWidgetData[m_nXScreen].gMenuWidget->style,
@@ -3342,7 +3342,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu(
                           "menu",
                           x, y, w, h );
        }
        else if( nPart == PART_MENU_ITEM )
        else if( nPart == ControlPart::MenuItem )
        {
            if( nState & (ControlState::SELECTED|ControlState::ROLLOVER) )
            {
@@ -3357,9 +3357,9 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu(
                               x, y, w, h);
            }
        }
        else if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK )
        else if( nPart == ControlPart::MenuItemCheckMark || nPart == ControlPart::MenuItemRadioMark )
        {
            GtkWidget* pWidget = (nPart == PART_MENU_ITEM_CHECK_MARK) ?
            GtkWidget* pWidget = (nPart == ControlPart::MenuItemCheckMark) ?
                                 gWidgetData[m_nXScreen].gMenuItemCheckMenuWidget :
                                 gWidgetData[m_nXScreen].gMenuItemRadioMenuWidget;

@@ -3372,7 +3372,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu(

            NWSetWidgetState( pWidget, nState, nStateType );

            if ( nPart == PART_MENU_ITEM_CHECK_MARK )
            if ( nPart == ControlPart::MenuItemCheckMark )
            {
                gtk_paint_check( pWidget->style,
                                 gdkDrawable,
@@ -3395,7 +3395,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu(
                                  x, y, w, h );
            }
        }
        else if( nPart == PART_MENU_SEPARATOR )
        else if( nPart == ControlPart::Separator )
        {
            gtk_paint_hline( gWidgetData[m_nXScreen].gMenuItemSeparatorMenuWidget->style,
                             gdkDrawable,
@@ -3405,7 +3405,7 @@ bool GtkSalGraphics::NWPaintGTKPopupMenu(
                             "menuitem",
                             x, x + w, y + h / 2);
        }
        else if( nPart == PART_MENU_SUBMENU_ARROW )
        else if( nPart == ControlPart::SubmenuArrow )
        {
            GtkStateType nStateType;
            GtkShadowType nShadowType;
@@ -3610,11 +3610,11 @@ bool GtkSalGraphics::NWPaintGTKSlider(

    BEGIN_PIXMAP_RENDER( rControlRectangle, pixDrawable )
    {
        GtkWidget* pWidget = (nPart == PART_TRACK_HORZ_AREA)
        GtkWidget* pWidget = (nPart == ControlPart::TrackHorzArea)
                             ? GTK_WIDGET(gWidgetData[m_nXScreen].gHScale)
                             : GTK_WIDGET(gWidgetData[m_nXScreen].gVScale);
        const gchar* pDetail = (nPart == PART_TRACK_HORZ_AREA) ? "hscale" : "vscale";
        GtkOrientation eOri = (nPart == PART_TRACK_HORZ_AREA) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
        const gchar* pDetail = (nPart == ControlPart::TrackHorzArea) ? "hscale" : "vscale";
        GtkOrientation eOri = (nPart == ControlPart::TrackHorzArea) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
        gint slider_width = 10;
        gint slider_length = 10;
        gint trough_border = 0;
@@ -3625,7 +3625,7 @@ bool GtkSalGraphics::NWPaintGTKSlider(
                              nullptr);

        GtkStateType eState = (nState & ControlState::ENABLED) ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE;
        if( nPart == PART_TRACK_HORZ_AREA )
        if( nPart == ControlPart::TrackHorzArea )
        {
            gtk_paint_box( pWidget->style,
                           pixDrawable,
@@ -3715,12 +3715,12 @@ static Rectangle NWGetListBoxButtonRect( SalX11Screen nScreen,
    nButtonAreaWidth = width + right + (xthickness * 2);
    switch( nPart )
    {
        case PART_BUTTON_DOWN:
        case ControlPart::ButtonDown:
            aPartSize.Width() = nButtonAreaWidth;
            aPartPos.X() = aAreaRect.Left() + aAreaRect.GetWidth() - aPartSize.Width();
            break;

        case PART_SUB_EDIT:
        case ControlPart::SubEdit:
            aPartSize.Width() = aAreaRect.GetWidth() - nButtonAreaWidth - xthickness;
            if( AllSettings::GetLayoutRTL() )
                aPartPos.X() = aAreaRect.Left() + nButtonAreaWidth;
@@ -3803,14 +3803,14 @@ static Rectangle NWGetToolbarRect(  SalX11Screen nScreen,
{
    Rectangle aRet;

    if( nPart == PART_DRAW_BACKGROUND_HORZ ||
        nPart == PART_DRAW_BACKGROUND_VERT )
    if( nPart == ControlPart::DrawBackgroundHorz ||
        nPart == ControlPart::DrawBackgroundVert )
        aRet = aAreaRect;
    else if( nPart == PART_THUMB_HORZ )
    else if( nPart == ControlPart::ThumbHorz )
        aRet = Rectangle( Point( 0, 0 ), Size( aAreaRect.GetWidth(), 10 ) );
    else if( nPart == PART_THUMB_VERT )
    else if( nPart == ControlPart::ThumbVert )
        aRet = Rectangle( Point( 0, 0 ), Size( 10, aAreaRect.GetHeight() ) );
    else if( nPart == PART_BUTTON )
    else if( nPart == ControlPart::Button )
    {
        aRet = aAreaRect;

diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index bab5c25..f320359 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -161,14 +161,14 @@ Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, Rectangle aAre
    buttonRect.setY(aAreaRect.Top());
    buttonRect.Bottom() = buttonRect.Top() + aAreaRect.GetHeight();
    Rectangle partRect(buttonRect);
    if ( nPart == PART_BUTTON_UP )
    if ( nPart == ControlPart::ButtonUp )
    {
        if (AllSettings::GetLayoutRTL())
            partRect.setX(aAreaRect.Left());
        else
            partRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - buttonRect.GetWidth()));
    }
    else if( nPart == PART_BUTTON_DOWN )
    else if( nPart == ControlPart::ButtonDown )
    {
        if (AllSettings::GetLayoutRTL())
            partRect.setX(aAreaRect.Left() + buttonRect.GetWidth());
@@ -197,9 +197,9 @@ Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, Rectangle aAre
Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect )
{
    GtkStyleContext* pScrollbarStyle = nullptr;
    if ((nPart == PART_BUTTON_LEFT) || (nPart == PART_BUTTON_RIGHT))
    if ((nPart == ControlPart::ButtonLeft) || (nPart == ControlPart::ButtonRight))
        pScrollbarStyle = mpHScrollbarStyle;
    else // (nPart == PART_BUTTON_UP) || (nPart == PART_BUTTON_DOWN)
    else // (nPart == ControlPart::ButtonUp) || (nPart == ControlPart::ButtonDown)
        pScrollbarStyle = mpVScrollbarStyle;

    gint slider_width;
@@ -236,7 +236,7 @@ Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, Rectangle aA
    if ( has_backward )  nFirst  += 1;
    if ( has_backward2 ) nSecond += 1;

    if ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_DOWN ) )
    if ( ( nPart == ControlPart::ButtonUp ) || ( nPart == ControlPart::ButtonDown ) )
    {
        buttonWidth = slider_width + 2 * trough_border;
        buttonHeight = stepper_size + trough_border + stepper_spacing;
@@ -247,27 +247,27 @@ Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, Rectangle aA
        buttonHeight = slider_width + 2 * trough_border;
    }

    if ( nPart == PART_BUTTON_UP )
    if ( nPart == ControlPart::ButtonUp )
    {
        buttonHeight *= nFirst;
        buttonHeight -= 1;
        buttonRect.setX( aAreaRect.Left() );
        buttonRect.setY( aAreaRect.Top() );
    }
    else if ( nPart == PART_BUTTON_LEFT )
    else if ( nPart == ControlPart::ButtonLeft )
    {
        buttonWidth *= nFirst;
        buttonWidth -= 1;
        buttonRect.setX( aAreaRect.Left() );
        buttonRect.setY( aAreaRect.Top() );
    }
    else if ( nPart == PART_BUTTON_DOWN )
    else if ( nPart == ControlPart::ButtonDown )
    {
        buttonHeight *= nSecond;
        buttonRect.setX( aAreaRect.Left() );
        buttonRect.setY( aAreaRect.Top() + aAreaRect.GetHeight() - buttonHeight );
    }
    else if ( nPart == PART_BUTTON_RIGHT )
    else if ( nPart == ControlPart::ButtonRight )
    {
        buttonWidth *= nSecond;
        buttonRect.setX( aAreaRect.Left() + aAreaRect.GetWidth() - buttonWidth );
@@ -352,7 +352,7 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context,
    gint magic = trough_border ? 1 : 0;
    gint slider_side = slider_width + (trough_border * 2);

    if ( nPart == PART_DRAW_BACKGROUND_HORZ )
    if ( nPart == ControlPart::DrawBackgroundHorz )
    {
        scrollbarRect.Move( 0, (scrollbarRect.GetHeight() - slider_side) / 2 );
        scrollbarRect.SetSize( Size( scrollbarRect.GetWidth(), slider_side ) );
@@ -615,7 +615,7 @@ void GtkSalGraphics::PaintOneSpinButton( GtkStyleContext *context,
    gint iconWidth = (buttonRect.GetWidth() - padding.left - padding.right - border.left - border.right);
    gint iconHeight = (buttonRect.GetHeight() - padding.top - padding.bottom - border.top - border.bottom);

    const char* icon = (nPart == PART_BUTTON_UP) ? "list-add-symbolic" : "list-remove-symbolic";
    const char* icon = (nPart == ControlPart::ButtonUp) ? "list-add-symbolic" : "list-remove-symbolic";
    GtkIconTheme *pIconTheme = gtk_icon_theme_get_for_screen(gtk_widget_get_screen(mpWindow));

    GtkIconInfo *info = gtk_icon_theme_lookup_icon(pIconTheme, icon, std::min(iconWidth, iconHeight),
@@ -643,9 +643,9 @@ void GtkSalGraphics::PaintSpinButton(GtkStyleContext *context,
                                     const ImplControlValue& rValue )
{
    const SpinbuttonValue *pSpinVal = (rValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue *>(&rValue) : nullptr;
    ControlPart upBtnPart = PART_BUTTON_UP;
    ControlPart upBtnPart = ControlPart::ButtonUp;
    ControlState upBtnState = ControlState::NONE;
    ControlPart downBtnPart = PART_BUTTON_DOWN;
    ControlPart downBtnPart = ControlPart::ButtonDown;
    ControlState downBtnState = ControlState::NONE;

    if ( pSpinVal )
@@ -657,7 +657,7 @@ void GtkSalGraphics::PaintSpinButton(GtkStyleContext *context,
        downBtnState = pSpinVal->mnLowerState;
    }

    if (nPart == PART_ENTIRE_CONTROL)
    if (nPart == ControlPart::Entire)
    {
        gtk_render_background(context, cr,
                              0, 0,
@@ -687,7 +687,7 @@ Rectangle GtkSalGraphics::NWGetComboBoxButtonRect( ControlType nType,

    gint nArrowWidth = ARROW_SIZE;
    gint nButtonWidth = nArrowWidth + padding.left + padding.right;
    if( nPart == PART_BUTTON_DOWN )
    if( nPart == ControlPart::ButtonDown )
    {
        Point aPos = Point(aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth, aAreaRect.Top());
        if (AllSettings::GetLayoutRTL())
@@ -695,7 +695,7 @@ Rectangle GtkSalGraphics::NWGetComboBoxButtonRect( ControlType nType,
        aButtonRect.SetSize( Size( nButtonWidth, aAreaRect.GetHeight() ) );
        aButtonRect.SetPos(aPos);
    }
    else if( nPart == PART_SUB_EDIT )
    else if( nPart == ControlPart::SubEdit )
    {
        gint adjust_left = padding.left;
        gint adjust_top = padding.top;
@@ -730,8 +730,8 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr,
    // plus its actual draw rect excluding adornment
    areaRect = rControlRectangle;

    buttonRect = NWGetComboBoxButtonRect( nType, PART_BUTTON_DOWN, areaRect );
    if( nPart == PART_BUTTON_DOWN )
    buttonRect = NWGetComboBoxButtonRect( nType, ControlPart::ButtonDown, areaRect );
    if( nPart == ControlPart::ButtonDown )
        buttonRect.Left() += 1;

    Rectangle        aEditBoxRect( areaRect );
@@ -750,7 +750,7 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr,
        gtk_style_context_save(mpComboboxButtonStyle);
        gtk_style_context_set_state(mpComboboxButtonStyle, flags);

        if( nPart == PART_ENTIRE_CONTROL )
        if( nPart == ControlPart::Entire )
        {
            GtkJunctionSides eJuncSides = gtk_style_context_get_junction_sides(mpEntryStyle);
            gtk_style_context_set_state(mpEntryStyle, flags);
@@ -794,7 +794,7 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr,
    }
    else if (nType == ControlType::Listbox)
    {
        if( nPart == PART_WINDOW )
        if( nPart == ControlPart::ListboxWindow )
        {
            /* render the popup window with the menu style */
            gtk_render_frame(mpMenuStyle, cr,
@@ -1196,7 +1196,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
                                            ControlState nState, const ImplControlValue& rValue,
                                            const OUString& )
{
    RenderType renderType = nPart == PART_FOCUS ? RenderType::Focus : RenderType::BackgroundAndFrame;
    RenderType renderType = nPart == ControlPart::Focus ? RenderType::Focus : RenderType::BackgroundAndFrame;
    GtkStyleContext *context = nullptr;
#if !GTK_CHECK_VERSION(3,19,2)
    const gchar *styleClass = nullptr;
@@ -1225,22 +1225,22 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
        break;
    case ControlType::Listbox:
        context = mpListboxStyle;
        renderType = nPart == PART_FOCUS ? RenderType::Focus : RenderType::Combobox;
        renderType = nPart == ControlPart::Focus ? RenderType::Focus : RenderType::Combobox;
        break;
    case ControlType::MenuPopup:
        bInMenu = true;

        // map selected menu entries in vcl parlance to gtk prelight
        if (nPart >= PART_MENU_ITEM && nPart <= PART_MENU_SUBMENU_ARROW && (nState & ControlState::SELECTED))
        if (nPart >= ControlPart::MenuItem && nPart <= ControlPart::SubmenuArrow && (nState & ControlState::SELECTED))
            flags = (GtkStateFlags) (flags | GTK_STATE_FLAG_PRELIGHT);
        flags = (GtkStateFlags)(flags & ~GTK_STATE_FLAG_ACTIVE);
        switch(nPart)
        {
        case PART_MENU_ITEM:
        case ControlPart::MenuItem:
            context = mpMenuItemStyle;
            renderType = RenderType::BackgroundAndFrame;
            break;
        case PART_MENU_ITEM_CHECK_MARK:
        case ControlPart::MenuItemCheckMark:
#if GTK_CHECK_VERSION(3,19,2)
            context = mpCheckMenuItemStyle;
#else
@@ -1254,7 +1254,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
                flags = (GtkStateFlags)(flags | CHECKED);
            }
            break;
        case PART_MENU_ITEM_RADIO_MARK:
        case ControlPart::MenuItemRadioMark:
#if GTK_CHECK_VERSION(3,19,2)
            context = mpRadioMenuItemStyle;
#else
@@ -1268,12 +1268,12 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
                flags = (GtkStateFlags)(flags | CHECKED);
            }
            break;
        case PART_MENU_SEPARATOR:
        case ControlPart::Separator:
            context = mpSeparatorMenuItemStyle;
            flags = (GtkStateFlags)(GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_INSENSITIVE); //GTK_STATE_FLAG_BACKDROP hack ?
            renderType = RenderType::MenuSeparator;
            break;
        case PART_MENU_SUBMENU_ARROW:
        case ControlPart::SubmenuArrow:
#if GTK_CHECK_VERSION(3,19,2)
            context = mpMenuItemArrowStyle;
#else
@@ -1282,26 +1282,27 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
#endif
            renderType = RenderType::Arrow;
            break;
        case PART_ENTIRE_CONTROL:
        case ControlPart::Entire:
            context = mpMenuStyle;
            renderType = RenderType::Background;
            break;
        default: break;
        }
        break;
    case ControlType::Toolbar:
        switch(nPart)
        {
        case PART_DRAW_BACKGROUND_HORZ:
        case PART_DRAW_BACKGROUND_VERT:
        case ControlPart::DrawBackgroundHorz:
        case ControlPart::DrawBackgroundVert:
            context = mpToolbarStyle;
            break;
        case PART_BUTTON:
        case ControlPart::Button:
            /* For all checkbuttons in the toolbars */
            flags = (GtkStateFlags)(flags |
                    ( (rValue.getTristateVal() == ButtonValue::On) ? GTK_STATE_FLAG_ACTIVE : GTK_STATE_FLAG_NORMAL));
            context = mpToolButtonStyle;
            break;
        case PART_SEPARATOR_VERT:
        case ControlPart::SeparatorVert:
            context = mpToolbarSeperatorStyle;
            renderType = RenderType::ToolbarSeparator;
            break;
@@ -1313,7 +1314,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
        flags = (GtkStateFlags)(flags |
                ( (rValue.getTristateVal() == ButtonValue::On) ? CHECKED : GTK_STATE_FLAG_NORMAL));
        context = mpRadioButtonStyle;
        renderType = nPart == PART_FOCUS ? RenderType::Focus : RenderType::Radio;
        renderType = nPart == ControlPart::Focus ? RenderType::Focus : RenderType::Radio;
        break;
    case ControlType::Checkbox:
        flags = (GtkStateFlags)(flags |
@@ -1321,7 +1322,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
                  (rValue.getTristateVal() == ButtonValue::Mixed) ? GTK_STATE_FLAG_INCONSISTENT :
                  GTK_STATE_FLAG_NORMAL));
        context = mpCheckButtonStyle;
        renderType = nPart == PART_FOCUS ? RenderType::Focus : RenderType::Check;
        renderType = nPart == ControlPart::Focus ? RenderType::Focus : RenderType::Check;
        break;
    case ControlType::Pushbutton:
        context = mpButtonStyle;
@@ -1329,12 +1330,13 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
    case ControlType::Scrollbar:
        switch(nPart)
        {
        case PART_DRAW_BACKGROUND_VERT:
        case PART_DRAW_BACKGROUND_HORZ:
            context = (nPart == PART_DRAW_BACKGROUND_VERT)
        case ControlPart::DrawBackgroundVert:
        case ControlPart::DrawBackgroundHorz:
            context = (nPart == ControlPart::DrawBackgroundVert)
                ? mpVScrollbarStyle : mpHScrollbarStyle;
            renderType = RenderType::Scrollbar;
            break;
        default: break;
        }
        break;
    case ControlType::ListNet:
@@ -1367,7 +1369,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
        break;
    }
    case ControlType::Menubar:
        if (nPart == PART_MENU_ITEM)
        if (nPart == ControlPart::MenuItem)
        {
            context = mpMenuBarItemStyle;

@@ -1382,7 +1384,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
        }
        break;
    case ControlType::Fixedline:
        context = nPart == PART_SEPARATOR_HORZ ? mpFixedHoriLineStyle : mpFixedVertLineStyle;
        context = nPart == ControlPart::SeparatorHorz ? mpFixedHoriLineStyle : mpFixedVertLineStyle;
        renderType = RenderType::Separator;
        break;
    case ControlType::ListNode:
@@ -1396,7 +1398,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
    }
    case ControlType::ListHeader:
        context = mpTreeHeaderButtonStyle;
        if (nPart == PART_ARROW)
        if (nPart == ControlPart::Arrow)
        {
            const char* icon = (rValue.getNumericVal() & 1) ? "pan-down-symbolic" : "pan-up-symbolic";
            GtkIconTheme *pIconTheme = gtk_icon_theme_get_for_screen(gtk_widget_get_screen(mpWindow));
@@ -1483,7 +1485,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
                        rControlRegion.GetWidth() / 2, rControlRegion.GetHeight() * 0.8 );
        break;
    case RenderType::Separator:
        if (nPart == PART_SEPARATOR_HORZ)
        if (nPart == ControlPart::SeparatorHorz)
            gtk_render_line(context, cr, 0, nHeight / 2, nWidth - 1, nHeight / 2);
        else
            gtk_render_line(context, cr, nWidth / 2, 0, nWidth / 2, nHeight - 1);
@@ -1602,7 +1604,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
    gint indicator_size, indicator_spacing, point;

    if(((nType == ControlType::Checkbox) || (nType == ControlType::Radiobutton)) &&
       nPart == PART_ENTIRE_CONTROL)
       nPart == ControlPart::Entire)
    {
        rNativeBoundingRegion = rControlRegion;

@@ -1631,12 +1633,12 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
    }
    else if( nType == ControlType::MenuPopup)
    {
        if (((nPart == PART_MENU_ITEM_CHECK_MARK) ||
              (nPart == PART_MENU_ITEM_RADIO_MARK) ))
        if (((nPart == ControlPart::MenuItemCheckMark) ||
              (nPart == ControlPart::MenuItemRadioMark) ))
        {
            indicator_size = 0;

            GtkStyleContext *pMenuItemStyle = (nPart == PART_MENU_ITEM_CHECK_MARK ) ? mpCheckMenuItemStyle : mpRadioMenuItemStyle;
            GtkStyleContext *pMenuItemStyle = (nPart == ControlPart::MenuItemCheckMark ) ? mpCheckMenuItemStyle : mpRadioMenuItemStyle;

            gtk_style_context_get_style( pMenuItemStyle,
                                         "indicator-size", &indicator_size,
@@ -1646,7 +1648,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
            aEditRect = Rectangle( Point( 0, point / 2),
                                   Size( indicator_size, indicator_size ) );
        }
        else if (nPart == PART_MENU_SEPARATOR)
        else if (nPart == ControlPart::Separator)
        {
            gint separator_height, separator_width, wide_separators;

@@ -1659,7 +1661,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
            aEditRect = Rectangle( aEditRect.TopLeft(),
                                   Size( aEditRect.GetWidth(), wide_separators ? separator_height : 1 ) );
        }
        else if (nPart == PART_MENU_SUBMENU_ARROW)
        else if (nPart == ControlPart::SubmenuArrow)
        {
            gfloat arrow_size = getArrowSize(mpMenuItemArrowStyle);
            aEditRect = Rectangle( aEditRect.TopLeft(),
@@ -1667,8 +1669,8 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
        }
    }
    else if ( (nType==ControlType::Scrollbar) &&
              ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) ||
               (nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN)  ) )
              ((nPart==ControlPart::ButtonLeft) || (nPart==ControlPart::ButtonRight) ||
               (nPart==ControlPart::ButtonUp) || (nPart==ControlPart::ButtonDown)  ) )
    {
        rNativeBoundingRegion = NWGetScrollButtonRect( nPart, rControlRegion );
        rNativeContentRegion = rNativeBoundingRegion;
@@ -1680,44 +1682,44 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar

        return true;
    }
    if( (nType == ControlType::Menubar) && (nPart == PART_ENTIRE_CONTROL) )
    if( (nType == ControlType::Menubar) && (nPart == ControlPart::Entire) )
    {
        aEditRect = GetWidgetSize(rControlRegion, gMenuBarWidget);
    }
    else if ( (nType==ControlType::Spinbox) &&
              ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ||
               (nPart==PART_SUB_EDIT)) )
              ((nPart==ControlPart::ButtonUp) || (nPart==ControlPart::ButtonDown) ||
               (nPart==ControlPart::SubEdit)) )
    {
        Rectangle aControlRegion(GetWidgetSize(rControlRegion, gSpinBox));
        aEditRect = NWGetSpinButtonRect(nPart, aControlRegion);
    }
    else if ( (nType==ControlType::Combobox) &&
              ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
              ((nPart==ControlPart::ButtonDown) || (nPart==ControlPart::SubEdit)) )
    {
        aEditRect = NWGetComboBoxButtonRect( nType, nPart, rControlRegion );
    }
    else if ( (nType==ControlType::Listbox) &&
              ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
              ((nPart==ControlPart::ButtonDown) || (nPart==ControlPart::SubEdit)) )
    {
        aEditRect = NWGetComboBoxButtonRect( nType, nPart, rControlRegion );
    }
    else if (nType == ControlType::Editbox && nPart == PART_ENTIRE_CONTROL)
    else if (nType == ControlType::Editbox && nPart == ControlPart::Entire)
    {
        aEditRect = GetWidgetSize(rControlRegion, gEntryBox);
    }
    else if (nType == ControlType::Listbox && nPart == PART_ENTIRE_CONTROL)
    else if (nType == ControlType::Listbox && nPart == ControlPart::Entire)
    {
        aEditRect = GetWidgetSize(rControlRegion, gListBox);
    }
    else if (nType == ControlType::Combobox && nPart == PART_ENTIRE_CONTROL)
    else if (nType == ControlType::Combobox && nPart == ControlPart::Entire)
    {
        aEditRect = GetWidgetSize(rControlRegion, gComboBox);
    }
    else if (nType == ControlType::Spinbox && nPart == PART_ENTIRE_CONTROL)
    else if (nType == ControlType::Spinbox && nPart == ControlPart::Entire)
    {
        aEditRect = GetWidgetSize(rControlRegion, gSpinBox);
    }
    else if (nType == ControlType::TabItem && nPart == PART_ENTIRE_CONTROL)
    else if (nType == ControlType::TabItem && nPart == ControlPart::Entire)
    {
        const TabitemValue& rTabitemValue = static_cast<const TabitemValue&>(rValue);
        const Rectangle& rTabitemRect = rTabitemValue.getContentRect();
@@ -1725,7 +1727,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
        aEditRect = AdjustRectForTextBordersPadding(mpNotebookHeaderTabsTabStyle, rTabitemRect.GetWidth(),
                                                    rTabitemRect.GetHeight(), rControlRegion);
    }
    else if (nType == ControlType::Frame && nPart == PART_BORDER)
    else if (nType == ControlType::Frame && nPart == ControlPart::Border)
    {
        aEditRect = rControlRegion;
        DrawFrameFlags nStyle = static_cast<DrawFrameFlags>(rValue.getNumericVal() & 0xfff0);
@@ -2176,34 +2178,34 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
        case ControlType::Progress:
        case ControlType::ListNode:
        case ControlType::ListNet:
            if (nPart==PART_ENTIRE_CONTROL || nPart == PART_FOCUS)
            if (nPart==ControlPart::Entire || nPart == ControlPart::Focus)
                return true;
            break;

        case ControlType::Scrollbar:
            if(nPart==PART_DRAW_BACKGROUND_HORZ || nPart==PART_DRAW_BACKGROUND_VERT ||
               nPart==PART_ENTIRE_CONTROL       || nPart==HAS_THREE_BUTTONS)
            if(nPart==ControlPart::DrawBackgroundHorz || nPart==ControlPart::DrawBackgroundVert ||
               nPart==ControlPart::Entire       || nPart==ControlPart::HasThreeButtons)
                return true;
            break;

        case ControlType::Editbox:
        case ControlType::MultilineEditbox:
            if (nPart==PART_ENTIRE_CONTROL || nPart==HAS_BACKGROUND_TEXTURE)
            if (nPart==ControlPart::Entire || nPart==ControlPart::HasBackgroundTexture)
                return true;
            break;

        case ControlType::Combobox:
            if (nPart==PART_ENTIRE_CONTROL || nPart==HAS_BACKGROUND_TEXTURE || nPart == PART_ALL_BUTTONS)
            if (nPart==ControlPart::Entire || nPart==ControlPart::HasBackgroundTexture || nPart == ControlPart::AllButtons)
                return true;
            break;

        case ControlType::Spinbox:
            if (nPart==PART_ENTIRE_CONTROL || nPart==HAS_BACKGROUND_TEXTURE || nPart == PART_ALL_BUTTONS || nPart == PART_BUTTON_UP || nPart == PART_BUTTON_DOWN)
            if (nPart==ControlPart::Entire || nPart==ControlPart::HasBackgroundTexture || nPart == ControlPart::AllButtons || nPart == ControlPart::ButtonUp || nPart == ControlPart::ButtonDown)
                return true;
            break;

        case ControlType::SpinButtons:
            if (nPart==PART_ENTIRE_CONTROL || nPart==PART_ALL_BUTTONS)
            if (nPart==ControlPart::Entire || nPart==ControlPart::AllButtons)
                return true;
            break;

@@ -2215,62 +2217,62 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
        case ControlType::TabHeader:
        case ControlType::TabPane:
        case ControlType::TabBody:
            if(nPart==PART_ENTIRE_CONTROL || nPart==PART_TABS_DRAW_RTL)
            if(nPart==ControlPart::Entire || nPart==ControlPart::TabsDrawRtl)
                return true;
            break;

        case ControlType::Listbox:
            if (nPart==PART_ENTIRE_CONTROL || nPart==PART_WINDOW || nPart==HAS_BACKGROUND_TEXTURE || nPart == PART_FOCUS)
            if (nPart==ControlPart::Entire || nPart==ControlPart::ListboxWindow || nPart==ControlPart::HasBackgroundTexture || nPart == ControlPart::Focus)
                return true;
            break;

        case ControlType::Toolbar:
            if( 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
//                ||  nPart==PART_SEPARATOR_HORZ
                ||  nPart==PART_SEPARATOR_VERT
            if( nPart==ControlPart::Entire
//                ||  nPart==ControlPart::DrawBackgroundHorz
//                ||  nPart==ControlPart::DrawBackgroundVert
//                ||  nPart==ControlPart::ThumbHorz
//                ||  nPart==ControlPart::ThumbVert
                ||  nPart==ControlPart::Button
//                ||  nPart==ControlPart::SeparatorHorz
                ||  nPart==ControlPart::SeparatorVert
                )
                return true;
            break;

        case ControlType::Menubar:
            if (nPart==PART_ENTIRE_CONTROL || nPart==PART_MENU_ITEM)
            if (nPart==ControlPart::Entire || nPart==ControlPart::MenuItem)
                return true;
            break;

        case ControlType::MenuPopup:
            if (nPart==PART_ENTIRE_CONTROL
                ||  nPart==PART_MENU_ITEM
                ||  nPart==PART_MENU_ITEM_CHECK_MARK
                ||  nPart==PART_MENU_ITEM_RADIO_MARK
                ||  nPart==PART_MENU_SEPARATOR
                ||  nPart==PART_MENU_SUBMENU_ARROW
            if (nPart==ControlPart::Entire
                ||  nPart==ControlPart::MenuItem
                ||  nPart==ControlPart::MenuItemCheckMark
                ||  nPart==ControlPart::MenuItemRadioMark
                ||  nPart==ControlPart::Separator
                ||  nPart==ControlPart::SubmenuArrow
            )
                return true;
            break;

//        case ControlType::Slider:
//            if(nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA)
//            if(nPart == ControlPart::TrackHorzArea || nPart == ControlPart::TrackVertArea)
//                return true;
//            break;

        case ControlType::Fixedline:
            if (nPart == PART_SEPARATOR_VERT || nPart == PART_SEPARATOR_HORZ)
            if (nPart == ControlPart::SeparatorVert || nPart == ControlPart::SeparatorHorz)
                return true;
            break;

        case ControlType::ListHeader:
            if (nPart == PART_BUTTON || nPart == PART_ARROW)
            if (nPart == ControlPart::Button || nPart == ControlPart::Arrow)
                return true;
            break;
        default: break;
    }

    SAL_INFO("vcl.gtk", "Unhandled is native supported for Type:" << (int)nType << ", Part" << nPart);
    SAL_INFO("vcl.gtk", "Unhandled is native supported for Type:" << (int)nType << ", Part" << (int)nPart);

    return false;
}
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 624c965..e9c1f90 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -355,7 +355,7 @@ class WidgetPainter
        bool drawStyledWidget( QWidget *pWidget,
                ControlState nState, const ImplControlValue& aValue,
                X11SalGraphics* pGraphics,
                ControlPart nPart = PART_ENTIRE_CONTROL );
                ControlPart nPart = ControlPart::Entire );

    /** 'Get' method for push button.

@@ -785,7 +785,7 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
        QApplication::style().drawPrimitive( QStyle::PE_PanelDockWindow,
                &qPainter, qRect, pWidget->colorGroup(), nStyle );

        if ( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
        if ( nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert )
        {
            const ToolbarValue *pValue = static_cast< const ToolbarValue * >( &aValue );

@@ -824,13 +824,13 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget,
    }
    else if ( strcmp( QMenuBar_String, pClassName ) == 0 )
    {
        if ( nPart == PART_ENTIRE_CONTROL )
        if ( nPart == ControlPart::Entire )
        {
            QApplication::style().drawControl( QStyle::CE_MenuBarEmptyArea,
                    &qPainter, pWidget, qRect,
                    pWidget->colorGroup(), nStyle );
        }
        else if ( nPart == PART_MENU_ITEM )
        else if ( nPart == ControlPart::MenuItem )
        {
            int nMenuItem = ( nStyle & QStyle::Style_Enabled )? m_nMenuBarEnabledItem: m_nMenuBarDisabledItem;
            QMenuItem *pMenuItem = static_cast<QMenuBar*>( pWidget )->findItem( nMenuItem );
@@ -1268,28 +1268,28 @@ class KDESalGraphics : public X11SalGraphics
bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
    return
    ( (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) ) ||
    ( (nType == ControlType::Pushbutton)  && (nPart == ControlPart::Entire) ) ||
    ( (nType == ControlType::Radiobutton) && (nPart == ControlPart::Entire) ) ||
    ( (nType == ControlType::Checkbox)    && (nPart == ControlPart::Entire) ) ||
    ( (nType == ControlType::Combobox)    && (nPart == ControlPart::Entire || nPart == ControlPart::HasBackgroundTexture) ) ||
    ( (nType == ControlType::Editbox)     && (nPart == ControlPart::Entire || nPart == ControlPart::HasBackgroundTexture) ) ||
    ( (nType == ControlType::Listbox)     && (nPart == ControlPart::Entire || nPart == ControlPart::ListboxWindow || nPart == ControlPart::HasBackgroundTexture ) ) ||
    ( (nType == ControlType::Spinbox)     && (nPart == ControlPart::Entire || nPart == ControlPart::HasBackgroundTexture) ) ||
    // no ControlType::SpinButtons for KDE
    ( (nType == ControlType::TabItem)    && (nPart == PART_ENTIRE_CONTROL) ) ||
    ( (nType == ControlType::TabPane)    && (nPart == PART_ENTIRE_CONTROL) ) ||
    ( (nType == ControlType::TabItem)    && (nPart == ControlPart::Entire) ) ||
    ( (nType == ControlType::TabPane)    && (nPart == ControlPart::Entire) ) ||
    // 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
    ( (nType == ControlType::Scrollbar)   && (nPart == ControlPart::Entire || nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert) ) ||
    ( (nType == ControlType::Scrollbar)   && (nPart == ControlPart::HasThreeButtons) ) || // 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 == 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) )
    ( (nType == ControlType::Toolbar)     && (nPart == ControlPart::Entire ||
                                      nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert ||
                                      nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert ||
                                      nPart == ControlPart::Button) ) ||
    ( (nType == ControlType::Menubar)     && (nPart == ControlPart::Entire || nPart == ControlPart::MenuItem) ) ||
    ( (nType == ControlType::MenuPopup)  && (nPart == ControlPart::Entire || nPart == ControlPart::MenuItem) ) ||
    ( (nType == ControlType::Progress)    && (nPart == ControlPart::Entire) )
        ;
}

@@ -1309,7 +1309,7 @@ bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
    Point aPos = rPos - rControlRegion.TopLeft();
    rIsInside = false;

    bool bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
    bool bHorizontal = ( nPart == ControlPart::ButtonLeft || nPart == ControlPart::ButtonRight );

    QScrollBar *pScrollBar = pWidgetPainter->scrollBar( rControlRegion,
        bHorizontal, ImplControlValue() );
@@ -1349,7 +1349,7 @@ bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,

    switch ( nPart )
    {
        case PART_BUTTON_LEFT:
        case ControlPart::ButtonLeft:
        if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
            rIsInside = true;
        else if ( bTwoSubButtons )
@@ -1359,7 +1359,7 @@ bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
        }
        break;

        case PART_BUTTON_UP:
        case ControlPart::ButtonUp:
        if ( !bPlatinumStyle && qRectSubLine.contains( aPos.getX(), aPos.getY() ) )
            rIsInside = true;
        else if ( bTwoSubButtons )
@@ -1369,21 +1369,21 @@ bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
        }
        break;

        case PART_BUTTON_RIGHT:
        case ControlPart::ButtonRight:
        if ( bTwoSubButtons )
            qRectAddLine.setLeft( qRectAddLine.left() + qRectAddLine.width() / 2 );

        rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
        break;

        case PART_BUTTON_DOWN:
        case ControlPart::ButtonDown:
        if ( bTwoSubButtons )
            qRectAddLine.setTop( qRectAddLine.top() + qRectAddLine.height() / 2 );

        rIsInside = qRectAddLine.contains( aPos.getX(), aPos.getY() );
        break;

        // cases PART_TRACK_HORZ_AREA and PART_TRACK_VERT_AREA
        // cases ControlPart::TrackHorzArea and ControlPart::TrackVertArea
        default:
        return false;
    }
@@ -1412,97 +1412,97 @@ bool KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
{
    bool bReturn = false;

    if ( (nType == ControlType::Pushbutton) && (nPart == PART_ENTIRE_CONTROL) )
    if ( (nType == ControlType::Pushbutton) && (nPart == ControlPart::Entire) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->pushButton( rControlRegion, bool(nState & ControlState::DEFAULT) ),
        nState, aValue, this );
    }
    else if ( (nType == ControlType::Radiobutton) && (nPart == PART_ENTIRE_CONTROL) )
    else if ( (nType == ControlType::Radiobutton) && (nPart == ControlPart::Entire) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->radioButton( rControlRegion ),
        nState, aValue, this );
    }
    else if ( (nType == ControlType::Checkbox) && (nPart == PART_ENTIRE_CONTROL) )
    else if ( (nType == ControlType::Checkbox) && (nPart == ControlPart::Entire) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->checkBox( rControlRegion ),
        nState, aValue, this );
    }
    else if ( (nType == ControlType::Combobox) && (nPart == PART_ENTIRE_CONTROL) )
    else if ( (nType == ControlType::Combobox) && (nPart == ControlPart::Entire) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->comboBox( rControlRegion, true ),
        nState, aValue, this );
    }
    else if ( (nType == ControlType::Editbox) && (nPart == PART_ENTIRE_CONTROL) )
    else if ( (nType == ControlType::Editbox) && (nPart == ControlPart::Entire) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->lineEdit( rControlRegion ),
        nState, aValue, this );
    }
    else if ( (nType == ControlType::Listbox) && (nPart == PART_ENTIRE_CONTROL) )
    else if ( (nType == ControlType::Listbox) && (nPart == ControlPart::Entire) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->comboBox( rControlRegion, false ),
        nState, aValue, this );
    }
    else if ( (nType == ControlType::Listbox) && (nPart == PART_WINDOW) )
    else if ( (nType == ControlType::Listbox) && (nPart == ControlPart::ListboxWindow) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->listView( rControlRegion ),
        nState, aValue, this );
    }
    else if ( (nType == ControlType::Spinbox) && (nPart == PART_ENTIRE_CONTROL) )
    else if ( (nType == ControlType::Spinbox) && (nPart == ControlPart::Entire) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->spinWidget( rControlRegion ),
        nState, aValue, this );
    }
    else if ( (nType==ControlType::TabItem) && (nPart == PART_ENTIRE_CONTROL) )
    else if ( (nType==ControlType::TabItem) && (nPart == ControlPart::Entire) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->tabBar( rControlRegion ),
        nState, aValue, this );
    }
    else if ( (nType==ControlType::TabPane) && (nPart == PART_ENTIRE_CONTROL) )
    else if ( (nType==ControlType::TabPane) && (nPart == ControlPart::Entire) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->tabWidget( rControlRegion ),
        nState, aValue, this );
    }
    else if ( (nType == ControlType::Scrollbar) && (nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT) )
    else if ( (nType == ControlType::Scrollbar) && (nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert) )
    {
    bReturn = pWidgetPainter->drawStyledWidget(
        pWidgetPainter->scrollBar( rControlRegion, nPart == PART_DRAW_BACKGROUND_HORZ, aValue ),
        pWidgetPainter->scrollBar( rControlRegion, nPart == ControlPart::DrawBackgroundHorz, aValue ),
        nState, aValue, this );
    }
    else if ( (nType == ControlType::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 == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert || nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert) )
    {
        bReturn = pWidgetPainter->drawStyledWidget(
                pWidgetPainter->toolBar( rControlRegion, nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_THUMB_VERT ),
                pWidgetPainter->toolBar( rControlRegion, nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::ThumbVert ),
                nState, aValue, this, nPart );
    }
    else if ( (nType == ControlType::Toolbar) && (nPart == PART_BUTTON) )
    else if ( (nType == ControlType::Toolbar) && (nPart == ControlPart::Button) )
    {
        bReturn = pWidgetPainter->drawStyledWidget(
                pWidgetPainter->toolButton( rControlRegion ),
                nState, aValue, this, nPart );
    }
    else if ( (nType == ControlType::Menubar) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) )
    else if ( (nType == ControlType::Menubar) && (nPart == ControlPart::Entire || nPart == ControlPart::MenuItem) )
    {
        bReturn = pWidgetPainter->drawStyledWidget(
                pWidgetPainter->menuBar( rControlRegion ),
                nState, aValue, this, nPart );
    }
    else if ( (nType == ControlType::MenuPopup) && (nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM) )
    else if ( (nType == ControlType::MenuPopup) && (nPart == ControlPart::Entire || nPart == ControlPart::MenuItem) )
    {
        bReturn = pWidgetPainter->drawStyledWidget(
                pWidgetPainter->popupMenu( rControlRegion ),
                nState, aValue, this );
    }
    else if ( (nType == ControlType::Progress) && (nPart == PART_ENTIRE_CONTROL) )
    else if ( (nType == ControlType::Progress) && (nPart == ControlPart::Entire) )
    {
        bReturn = pWidgetPainter->drawStyledWidget(
                pWidgetPainter->progressBar( rControlRegion ),
@@ -1548,7 +1548,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar

        switch ( nPart )
        {
        case PART_ENTIRE_CONTROL:
        case ControlPart::Entire:
            qRect = qBoundingRect;

            if ( nState & ControlState::DEFAULT )
@@ -1567,7 +1567,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
        case ControlType::Radiobutton:
            pWidget = pWidgetPainter->radioButton( rControlRegion );

            if ( nPart == PART_ENTIRE_CONTROL )
            if ( nPart == ControlPart::Entire )
            {
                qRect.setWidth( QApplication::style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth, pWidget ) );
                qRect.setHeight( QApplication::style().pixelMetric( QStyle::PM_ExclusiveIndicatorHeight, pWidget ) );
@@ -1580,7 +1580,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
        case ControlType::Checkbox:
            pWidget = pWidgetPainter->checkBox( rControlRegion );

            if ( nPart == PART_ENTIRE_CONTROL )
            if ( nPart == ControlPart::Entire )
            {
                qRect.setWidth( QApplication::style().pixelMetric( QStyle::PM_IndicatorWidth, pWidget ) );
                qRect.setHeight( QApplication::style().pixelMetric( QStyle::PM_IndicatorHeight, pWidget ) );
@@ -1595,7 +1595,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
        pWidget = pWidgetPainter->comboBox( rControlRegion, ( nType == ControlType::Combobox ) );
        switch ( nPart )
        {
        case PART_BUTTON_DOWN:
        case ControlPart::ButtonDown:
            qRect = QApplication::style().querySubControlMetrics(
                QStyle::CC_ComboBox, pWidget, QStyle::SC_ComboBoxArrow );
            qRect.setLeft( QApplication::style().querySubControlMetrics(
@@ -1605,7 +1605,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
            bReturn = true;
            break;

        case PART_SUB_EDIT:
        case ControlPart::SubEdit:
            qRect = QApplication::style().querySubControlMetrics(
                QStyle::CC_ComboBox, pWidget, QStyle::SC_ComboBoxEditField );
            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
@@ -1619,21 +1619,21 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
        pWidget = pWidgetPainter->spinWidget( rControlRegion );
        switch ( nPart )
        {
        case PART_BUTTON_UP:
        case ControlPart::ButtonUp:
            qRect = QApplication::style().querySubControlMetrics(
                QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetUp );
            bReturn = true;
            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
            break;

        case PART_BUTTON_DOWN:
        case ControlPart::ButtonDown:
            qRect = QApplication::style().querySubControlMetrics(
                QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetDown );
            bReturn = true;
            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
            break;

        case PART_SUB_EDIT:
        case ControlPart::SubEdit:
            qRect = QApplication::style().querySubControlMetrics(
                QStyle::CC_SpinWidget, pWidget, QStyle::SC_SpinWidgetEditField );
            qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
@@ -1645,18 +1645,18 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
    // Metrics of the scroll bar
    case ControlType::Scrollbar:
        pWidget = pWidgetPainter->scrollBar( rControlRegion,
            ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT ),
            ( nPart == ControlPart::ButtonLeft || nPart == ControlPart::ButtonRight ),
            ImplControlValue() );
        switch ( nPart )
        {
        case PART_BUTTON_LEFT:
        case PART_BUTTON_UP:
        case ControlPart::ButtonLeft:
        case ControlPart::ButtonUp:
            qRect = QApplication::style().querySubControlMetrics(
                QStyle::CC_ScrollBar, pWidget, QStyle::SC_ScrollBarSubLine );

            // Workaround for Platinum style scroll bars. It makes the
            // left/up button invisible.
            if ( nPart == PART_BUTTON_LEFT )
            if ( nPart == ControlPart::ButtonLeft )
            {
            if ( qRect.left() > QApplication::style().querySubControlMetrics(
                    QStyle::CC_ScrollBar, pWidget,
@@ -1682,14 +1682,14 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
            bReturn = true;
            break;

        case PART_BUTTON_RIGHT:
        case PART_BUTTON_DOWN:
        case ControlPart::ButtonRight:
        case ControlPart::ButtonDown:
            qRect = QApplication::style().querySubControlMetrics(
                QStyle::CC_ScrollBar, pWidget, QStyle::SC_ScrollBarAddLine );

            // Workaround for Platinum and 3 button style scroll bars.
            // It makes the right/down button bigger.
            if ( nPart == PART_BUTTON_RIGHT )
            if ( nPart == ControlPart::ButtonRight )
                qRect.setLeft( QApplication::style().querySubControlMetrics(
                    QStyle::CC_ScrollBar, pWidget,
                    QStyle::SC_ScrollBarAddPage ).right() + 1 );
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index cdf1292..e6536e3 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -83,7 +83,7 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par
        case ControlType::Tooltip:
        case ControlType::Progress:
        case ControlType::ListNode:
            return (part == PART_ENTIRE_CONTROL);
            return (part == ControlPart::Entire);

        case ControlType::Menubar:
        case ControlType::MenuPopup:
@@ -98,13 +98,13 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par
            return true;

        case ControlType::Listbox:
            return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE);
            return (part == ControlPart::Entire || part == ControlPart::HasBackgroundTexture);

        case ControlType::Spinbox:
            return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE);
            return (part == ControlPart::Entire || part == ControlPart::HasBackgroundTexture);

        case ControlType::Slider:
            return (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA);
            return (part == ControlPart::TrackHorzArea || part == ControlPart::TrackVertArea);

        default:
            break;
@@ -210,7 +210,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
        return false;
    }

    if( lastPopupRect.isValid() && ( type != ControlType::MenuPopup || part != PART_MENU_ITEM ))
    if( lastPopupRect.isValid() && ( type != ControlType::MenuPopup || part != ControlPart::MenuItem ))
        lastPopupRect = QRect();

    bool returnVal = true;
@@ -235,7 +235,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
    }
    else if (type == ControlType::Menubar)
    {
        if (part == PART_MENU_ITEM)
        if (part == ControlPart::MenuItem)
        {
            QStyleOptionMenuItem option;
            if ( ( nControlState & ControlState::ROLLOVER )
@@ -248,7 +248,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
            draw( QStyle::CE_MenuBarItem, &option, m_image.get(),
                  vclStateValue2StateFlag(nControlState, value) );
        }
        else if (part == PART_ENTIRE_CONTROL)
        else if (part == ControlPart::Entire)
        {
            QStyleOptionMenuItem option;
            draw( QStyle::CE_MenuBarEmptyArea, &option, m_image.get(),
@@ -261,23 +261,23 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
    }
    else if (type == ControlType::MenuPopup)
    {
        OSL_ASSERT( part == PART_MENU_ITEM ? lastPopupRect.isValid() : !lastPopupRect.isValid());
        if( part == PART_MENU_ITEM )
        OSL_ASSERT( part == ControlPart::MenuItem ? lastPopupRect.isValid() : !lastPopupRect.isValid());
        if( part == ControlPart::MenuItem )
        {
            QStyleOptionMenuItem option;
            draw( QStyle::CE_MenuItem, &option, m_image.get(),
                  vclStateValue2StateFlag(nControlState, value) );
            // HACK: LO core first paints the entire popup and only then it paints menu items,
            // but QMenu::paintEvent() paints popup frame after all items. That means highlighted
            // items here would paint the highlight over the frame border. Since calls to PART_MENU_ITEM
            // are always preceded by calls to PART_ENTIRE_CONTROL, just remember the size for the whole
            // items here would paint the highlight over the frame border. Since calls to ControlPart::MenuItem
            // are always preceded by calls to ControlPart::Entire, just remember the size for the whole
            // popup (otherwise not possible to get here) and draw the border afterwards.
            QRect framerect( lastPopupRect.topLeft() - widgetRect.topLeft(),
                widgetRect.size().expandedTo( lastPopupRect.size()));
            QStyleOptionFrame frame;
            draw( QStyle::PE_FrameMenu, &frame, m_image.get(), vclStateValue2StateFlag( nControlState, value ), framerect );
        }
        else if( part == PART_MENU_SEPARATOR )
        else if( part == ControlPart::Separator )
        {
            QStyleOptionMenuItem option;
            option.menuItemType = QStyleOptionMenuItem::Separator;
@@ -296,10 +296,10 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
            draw( QStyle::CE_MenuItem, &option, m_image.get(),
                  vclStateValue2StateFlag(nControlState, value), rect );
        }
        else if( part == PART_MENU_ITEM_CHECK_MARK || part == PART_MENU_ITEM_RADIO_MARK )
        else if( part == ControlPart::MenuItemCheckMark || part == ControlPart::MenuItemRadioMark )
        {
            QStyleOptionMenuItem option;
            option.checkType = ( part == PART_MENU_ITEM_CHECK_MARK )
            option.checkType = ( part == ControlPart::MenuItemCheckMark )
                ? QStyleOptionMenuItem::NonExclusive : QStyleOptionMenuItem::Exclusive;
            option.checked = bool( nControlState & ControlState::PRESSED );
            // widgetRect is now the rectangle for the checkbox/radiobutton itself, but Qt
@@ -315,7 +315,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
            draw( QStyle::CE_MenuItem, &option, m_image.get(),
                  vclStateValue2StateFlag(nControlState, value), rect );
        }
        else if( part == PART_ENTIRE_CONTROL )
        else if( part == ControlPart::Entire )
        {
            QStyleOptionMenuItem option;
            draw( QStyle::PE_PanelMenu, &option, m_image.get(), vclStateValue2StateFlag( nControlState, value ));
@@ -328,7 +328,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
        else
            returnVal = false;
    }
    else if ( (type == ControlType::Toolbar) && (part == PART_BUTTON) )
    else if ( (type == ControlType::Toolbar) && (part == ControlPart::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 == ControlType::Toolbar) && (part == PART_ENTIRE_CONTROL) )
    else if ( (type == ControlType::Toolbar) && (part == ControlPart::Entire) )
    {
        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 == ControlType::Toolbar) && (part == PART_THUMB_VERT) )
    else if ( (type == ControlType::Toolbar) && (part == ControlPart::ThumbVert) )
    {   // reduce paint area only to the handle area
        const int width = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
        QRect rect( 0, 0, width, widgetRect.height());
@@ -385,19 +385,19 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
    {
        QStyleOptionComboBox option;
        switch (part) {
            case PART_WINDOW:
            case ControlPart::ListboxWindow:
                lcl_drawFrame( QStyle::PE_Frame, m_image.get(),
                               vclStateValue2StateFlag(nControlState, value) );
                break;
            case PART_SUB_EDIT:
            case ControlPart::SubEdit:
                draw( QStyle::CE_ComboBoxLabel, &option, m_image.get(),
                      vclStateValue2StateFlag(nControlState, value) );
                break;
            case PART_ENTIRE_CONTROL:
            case ControlPart::Entire:
                draw( QStyle::CC_ComboBox, &option, m_image.get(),
                      vclStateValue2StateFlag(nControlState, value) );
                break;
            case PART_BUTTON_DOWN:
            case ControlPart::ButtonDown:
                m_image->fill( Qt::transparent );
                option.subControls = QStyle::SC_ComboBoxArrow;
                draw( QStyle::CC_ComboBox, &option, m_image.get(),
@@ -426,7 +426,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
    }
    else if (type == ControlType::Scrollbar)
    {
        if ((part == PART_DRAW_BACKGROUND_VERT) || (part == PART_DRAW_BACKGROUND_HORZ))
        if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz))
        {
            QStyleOptionSlider option;
            OSL_ASSERT( value.getType() == ControlType::Scrollbar );
@@ -436,7 +436,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
            if (sbVal->mnVisibleSize < sbVal->mnMax)
                option.state = QStyle::State_MouseOver;

            bool horizontal = ( part == PART_DRAW_BACKGROUND_HORZ ); //horizontal or vertical
            bool horizontal = ( part == ControlPart::DrawBackgroundHorz ); //horizontal or vertical
            option.orientation = horizontal ? Qt::Horizontal : Qt::Vertical;
            if( horizontal )
                option.state |= QStyle::State_Horizontal;
@@ -448,7 +448,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
            option.sliderValue = sbVal->mnCur;
            option.sliderPosition = sbVal->mnCur;
            option.pageStep = sbVal->mnVisibleSize;
            if (part == PART_DRAW_BACKGROUND_HORZ)
            if (part == ControlPart::DrawBackgroundHorz)
                option.upsideDown = sbVal->maButton1Rect.Left() > sbVal->maButton2Rect.Left();

            //setup the active control...always the slider
@@ -521,7 +521,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
        draw( QStyle::CE_MenuItem, &option, m_image.get(),
              vclStateValue2StateFlag(nControlState, value) );
    }
    else if (type == ControlType::Slider && (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA))
    else if (type == ControlType::Slider && (part == ControlPart::TrackHorzArea || part == ControlPart::TrackVertArea))
    {
        OSL_ASSERT( value.getType() == ControlType::Slider );
        const SliderValue* slVal = static_cast<const SliderValue *>(&value);
@@ -532,14 +532,14 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
        option.maximum     = slVal->mnMax;
        option.minimum     = slVal->mnMin;
        option.sliderPosition = option.sliderValue = slVal->mnCur;
        bool horizontal = ( part == PART_TRACK_HORZ_AREA ); //horizontal or vertical
        bool horizontal = ( part == ControlPart::TrackHorzArea ); //horizontal or vertical
        option.orientation = horizontal ? Qt::Horizontal : Qt::Vertical;
        if( horizontal )
            option.state |= QStyle::State_Horizontal;

        draw( QStyle::CC_Slider, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) );
    }
    else if( type == ControlType::Progress && part == PART_ENTIRE_CONTROL )
    else if( type == ControlType::Progress && part == ControlPart::Entire )
    {
        QStyleOptionProgressBarV2 option;
        option.minimum = 0;
@@ -635,7 +635,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
    {
        // Metrics of the push button
        case ControlType::Pushbutton:
            if (part == PART_ENTIRE_CONTROL)
            if (part == ControlPart::Entire)
            {
                styleOption.state = vclStateValue2StateFlag(controlState, val);

@@ -672,7 +672,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
            break;
        }
        case ControlType::Checkbox:
            if (part == PART_ENTIRE_CONTROL)
            if (part == ControlPart::Entire)
            {
                styleOption.state = vclStateValue2StateFlag(controlState, val);

@@ -705,7 +705,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,

            switch ( part )
            {
                case PART_ENTIRE_CONTROL:
                case ControlPart::Entire:
                {
                    // find out the minimum size that should be used
                    // assume contents is a text ling
@@ -734,7 +734,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                    retVal = true;
                    break;
                }
                case PART_BUTTON_DOWN:
                case ControlPart::ButtonDown:
                    contentRect = QApplication::style()->subControlRect(
                        QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxArrow );

@@ -742,7 +742,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,

                    retVal = true;
                    break;
                case PART_SUB_EDIT:
                case ControlPart::SubEdit:
                {
                    contentRect = QApplication::style()->subControlRect(
                        QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxEditField );
@@ -758,7 +758,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                    retVal = true;
                    break;
                }
                case PART_WINDOW:
                case ControlPart::ListboxWindow:
                    retVal = true;
                    break;
            }
@@ -773,7 +773,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,

            switch ( part )
            {
                case PART_BUTTON_UP:
                case ControlPart::ButtonUp:
                    contentRect = QApplication::style()->subControlRect(
                        QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxUp );
                    contentRect.translate( boundingRect.left(), boundingRect.top() );
@@ -781,7 +781,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                    boundingRect = QRect();
                    break;

                case PART_BUTTON_DOWN:
                case ControlPart::ButtonDown:
                    contentRect = QApplication::style()->subControlRect(
                        QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxDown );
                    retVal = true;
@@ -789,7 +789,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
                    boundingRect = QRect();
                    break;

                case PART_SUB_EDIT:
                case ControlPart::SubEdit:
                    contentRect = QApplication::style()->subControlRect(
                        QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxEditField );
                    retVal = true;
@@ -804,12 +804,12 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
        {
            int h, w;
            switch ( part ) {
            case PART_MENU_ITEM_CHECK_MARK:
            case ControlPart::MenuItemCheckMark:
                h = QApplication::style()->pixelMetric(QStyle::PM_IndicatorHeight);
                w = QApplication::style()->pixelMetric(QStyle::PM_IndicatorWidth);
                retVal = true;
                break;
            case PART_MENU_ITEM_RADIO_MARK:
            case ControlPart::MenuItemRadioMark:
                h = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight);
                w = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth);
                retVal = true;
@@ -823,7 +823,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
        }
        case ControlType::Frame:
        {
            if( part == PART_BORDER )
            if( part == ControlPart::Border )
            {
                int nFrameWidth = static_cast< KDESalInstance* >(GetSalData()->m_pInstance)->getFrameWidth();
                auto nStyle = static_cast<DrawFrameFlags>(
@@ -859,13 +859,13 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
        case ControlType::Slider:
        {
            const int w = QApplication::style()->pixelMetric(QStyle::PM_SliderLength);
            if( part == PART_THUMB_HORZ )
            if( part == ControlPart::ThumbHorz )
            {
                contentRect = QRect(boundingRect.left(), boundingRect.top(), w, boundingRect.height());
                boundingRect = contentRect;
                retVal = true;
            }
            else if( part == PART_THUMB_VERT )
            else if( part == ControlPart::ThumbVert )
            {
                contentRect = QRect(boundingRect.left(), boundingRect.top(), boundingRect.width(), w);
                boundingRect = contentRect;
@@ -877,10 +877,10 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
        {
            // 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)
            if( part == PART_TRACK_VERT_AREA || part == PART_TRACK_HORZ_AREA )
            if( part == ControlPart::TrackVertArea || part == ControlPart::TrackHorzArea )
            {
                QStyleOptionSlider option;
                bool horizontal = ( part == PART_TRACK_HORZ_AREA ); //horizontal or vertical
                bool horizontal = ( part == ControlPart::TrackHorzArea ); //horizontal or vertical
                option.orientation = horizontal ? Qt::Horizontal : Qt::Vertical;
                if( horizontal )
                    option.state |= QStyle::State_Horizontal;
@@ -936,14 +936,14 @@ bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
{
    if ( nType == ControlType::Scrollbar )
    {
        if( nPart != PART_BUTTON_UP && nPart != PART_BUTTON_DOWN
            && nPart != PART_BUTTON_LEFT && nPart != PART_BUTTON_RIGHT )
        if( nPart != ControlPart::ButtonUp && nPart != ControlPart::ButtonDown
            && nPart != ControlPart::ButtonLeft && nPart != ControlPart::ButtonRight )
        { // we adjust only for buttons (because some scrollbars have 3 buttons,
          // and LO core doesn't handle such scrollbars well)
            return FALSE;
        }
        rIsInside = FALSE;
        bool bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
        bool bHorizontal = ( nPart == ControlPart::ButtonLeft || nPart == ControlPart::ButtonRight );
        QRect rect = region2QRect( rControlRegion );
        QPoint pos( rPos.X(), rPos.Y());
        // Adjust coordinates to make the widget appear to be at (0,0), i.e. make
@@ -964,7 +964,7 @@ bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
        options.sliderPosition = options.sliderValue = 4;
        options.pageStep = 2;
        QStyle::SubControl control = QApplication::style()->hitTestComplexControl( QStyle::CC_ScrollBar, &options, pos );
        if( nPart == PART_BUTTON_UP || nPart == PART_BUTTON_LEFT )
        if( nPart == ControlPart::ButtonUp || nPart == ControlPart::ButtonLeft )
            rIsInside = ( control == QStyle::SC_ScrollBarSubLine );
        else // DOWN, RIGHT
            rIsInside = ( control == QStyle::SC_ScrollBarAddLine );
diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx
index 1aa9d18..4526f7a 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -242,94 +242,94 @@ bool WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
        case ControlType::Pushbutton:
        case ControlType::Radiobutton:
        case ControlType::Checkbox:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Button");
            break;
        case ControlType::Scrollbar:
            if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT )
            if( nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert )
                return FALSE;   // no background painting needed
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Scrollbar");
            break;
        case ControlType::Combobox:
            if( nPart == HAS_BACKGROUND_TEXTURE )
            if( nPart == ControlPart::HasBackgroundTexture )
                return FALSE;   // we do not paint the inner part (ie the selection background/focus indication)
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Edit");
            else if( nPart == PART_BUTTON_DOWN )
            else if( nPart == ControlPart::ButtonDown )
                hTheme = getThemeHandle( mhWnd, L"Combobox");
            break;
        case ControlType::Spinbox:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Edit");
            else if( nPart == PART_ALL_BUTTONS ||
                nPart == PART_BUTTON_UP || nPart == PART_BUTTON_DOWN ||
                nPart == PART_BUTTON_LEFT|| nPart == PART_BUTTON_RIGHT )
            else if( nPart == ControlPart::AllButtons ||
                nPart == ControlPart::ButtonUp || nPart == ControlPart::ButtonDown ||
                nPart == ControlPart::ButtonLeft|| nPart == ControlPart::ButtonRight )
                hTheme = getThemeHandle( mhWnd, L"Spin");
            break;
        case ControlType::SpinButtons:
            if( nPart == PART_ENTIRE_CONTROL || nPart == PART_ALL_BUTTONS )
            if( nPart == ControlPart::Entire || nPart == ControlPart::AllButtons )
                hTheme = getThemeHandle( mhWnd, L"Spin");
            break;
        case ControlType::Editbox:
        case ControlType::MultilineEditbox:
            if( nPart == HAS_BACKGROUND_TEXTURE )
            if( nPart == ControlPart::HasBackgroundTexture )
                return FALSE;   // we do not paint the inner part (ie the selection background/focus indication)
                //return TRUE;
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Edit");
            break;
        case ControlType::Listbox:
            if( nPart == HAS_BACKGROUND_TEXTURE )
            if( nPart == ControlPart::HasBackgroundTexture )
                return FALSE;   // we do not paint the inner part (ie the selection background/focus indication)
            if( nPart == PART_ENTIRE_CONTROL || nPart == PART_WINDOW )
            if( nPart == ControlPart::Entire || nPart == ControlPart::ListboxWindow )
                hTheme = getThemeHandle( mhWnd, L"Listview");
            else if( nPart == PART_BUTTON_DOWN )
            else if( nPart == ControlPart::ButtonDown )
                hTheme = getThemeHandle( mhWnd, L"Combobox");
            break;
        case ControlType::TabPane:
        case ControlType::TabBody:
        case ControlType::TabItem:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Tab");
            break;
        case ControlType::Toolbar:
            if( nPart == PART_ENTIRE_CONTROL || nPart == PART_BUTTON )
            if( nPart == ControlPart::Entire || nPart == ControlPart::Button )
                hTheme = getThemeHandle( mhWnd, L"Toolbar");
            else
                // use rebar theme for grip and background
                hTheme = getThemeHandle( mhWnd, L"Rebar");
            break;
        case ControlType::Menubar:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Rebar");
            else if( GetSalData()->mbThemeMenuSupport )
            {
                if( nPart == PART_MENU_ITEM )
                if( nPart == ControlPart::MenuItem )
                    hTheme = getThemeHandle( mhWnd, L"Menu" );
            }
            break;
        case ControlType::MenuPopup:
            if( GetSalData()->mbThemeMenuSupport )
            {
                if( nPart == PART_ENTIRE_CONTROL ||
                    nPart == PART_MENU_ITEM ||
                    nPart == PART_MENU_ITEM_CHECK_MARK ||
                    nPart == PART_MENU_ITEM_RADIO_MARK ||
                    nPart == PART_MENU_SEPARATOR )
                if( nPart == ControlPart::Entire ||
                    nPart == ControlPart::MenuItem ||
                    nPart == ControlPart::MenuItemCheckMark ||
                    nPart == ControlPart::MenuItemRadioMark ||
                    nPart == ControlPart::Separator )
                    hTheme = getThemeHandle( mhWnd, L"Menu" );
            }
            break;
        case ControlType::Progress:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Progress");
            break;
        case ControlType::Slider:
            if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
            if( nPart == ControlPart::TrackHorzArea || nPart == ControlPart::TrackVertArea )
                hTheme = getThemeHandle( mhWnd, L"Trackbar" );
            break;
        case ControlType::ListNode:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"TreeView" );
            break;
        default:
@@ -384,10 +384,10 @@ Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState, const

// Helper functions

void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, const Rectangle& rRect,
void ImplConvertSpinbuttonValues( ControlPart nControlPart, const ControlState& rState, const Rectangle& rRect,
                                 int* pLunaPart, int *pLunaState, RECT *pRect )
{
    if( nControlPart == PART_BUTTON_DOWN )
    if( nControlPart == ControlPart::ButtonDown )
    {
        *pLunaPart = SPNP_DOWN;
        if( rState & ControlState::PRESSED )
@@ -399,7 +399,7 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, 
        else
            *pLunaState = DNS_NORMAL;
    }
    if( nControlPart == PART_BUTTON_UP )
    if( nControlPart == ControlPart::ButtonUp )
    {
        *pLunaPart = SPNP_UP;
        if( rState & ControlState::PRESSED )
@@ -411,7 +411,7 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, 
        else
            *pLunaState = UPS_NORMAL;
    }
    if( nControlPart == PART_BUTTON_RIGHT )
    if( nControlPart == ControlPart::ButtonRight )
    {
        *pLunaPart = SPNP_UPHORZ;
        if( rState & ControlState::PRESSED )
@@ -423,7 +423,7 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState, 
        else
            *pLunaState = DNHZS_NORMAL;
    }
    if( nControlPart == PART_BUTTON_LEFT )
    if( nControlPart == ControlPart::ButtonLeft )
    {
        *pLunaPart = SPNP_DOWNHORZ;
        if( rState & ControlState::PRESSED )
@@ -520,24 +520,24 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
{
    // a listbox dropdown is actually a combobox dropdown
    if( nType == ControlType::Listbox )
        if( nPart == PART_BUTTON_DOWN )
        if( nPart == ControlPart::ButtonDown )
            nType = ControlType::Combobox;

    // draw entire combobox as a large edit box
    if( nType == ControlType::Combobox )
        if( nPart == PART_ENTIRE_CONTROL )
        if( nPart == ControlPart::Entire )
            nType = ControlType::Editbox;

    // draw entire spinbox as a large edit box
    if( nType == ControlType::Spinbox )
        if( nPart == PART_ENTIRE_CONTROL )
        if( nPart == ControlPart::Entire )
            nType = ControlType::Editbox;

    int iPart(0), iState(0);
    if( nType == ControlType::Scrollbar )
    {
        HRESULT hr;
        if( nPart == PART_BUTTON_UP )
        if( nPart == ControlPart::ButtonUp )
        {
            iPart = SBP_ARROWBTN;
            if( nState & ControlState::PRESSED )
@@ -551,7 +551,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            hr = vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, 0);
            return (hr == S_OK);
        }
        if( nPart == PART_BUTTON_DOWN )
        if( nPart == ControlPart::ButtonDown )
        {
            iPart = SBP_ARROWBTN;
            if( nState & ControlState::PRESSED )
@@ -565,7 +565,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            hr = vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, 0);
            return (hr == S_OK);
        }
        if( nPart == PART_BUTTON_LEFT )
        if( nPart == ControlPart::ButtonLeft )
        {
            iPart = SBP_ARROWBTN;
            if( nState & ControlState::PRESSED )
@@ -579,7 +579,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            hr = vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, 0);
            return (hr == S_OK);
        }
        if( nPart == PART_BUTTON_RIGHT )
        if( nPart == ControlPart::ButtonRight )
        {
            iPart = SBP_ARROWBTN;
            if( nState & ControlState::PRESSED )
@@ -593,9 +593,9 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            hr = vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, 0);
            return (hr == S_OK);
        }
        if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
        if( nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert )
        {
            iPart = (nPart == PART_THUMB_HORZ) ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT;
            iPart = (nPart == ControlPart::ThumbHorz) ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT;
            if( nState & ControlState::PRESSED )
                iState = SCRBS_PRESSED;
            else if( !(nState & ControlState::ENABLED) )
@@ -612,23 +612,23 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,

            hr = vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, 0);
            // paint gripper on thumb if enough space
            if( ( (nPart == PART_THUMB_VERT) && (rc.bottom-rc.top > 12) ) ||
                ( (nPart == PART_THUMB_HORZ) && (rc.right-rc.left > 12) ) )
            if( ( (nPart == ControlPart::ThumbVert) && (rc.bottom-rc.top > 12) ) ||
                ( (nPart == ControlPart::ThumbHorz) && (rc.right-rc.left > 12) ) )
            {
                iPart = (nPart == PART_THUMB_HORZ) ? SBP_GRIPPERHORZ : SBP_GRIPPERVERT;
                iPart = (nPart == ControlPart::ThumbHorz) ? SBP_GRIPPERHORZ : SBP_GRIPPERVERT;
                iState = 0;
                vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, 0);
            }
            return (hr == S_OK);
        }
        if( nPart == PART_TRACK_HORZ_LEFT || nPart == PART_TRACK_HORZ_RIGHT || nPart == PART_TRACK_VERT_UPPER || nPart == PART_TRACK_VERT_LOWER )
        if( nPart == ControlPart::TrackHorzLeft || nPart == ControlPart::TrackHorzRight || nPart == ControlPart::TrackVertUpper || nPart == ControlPart::TrackVertLower )
        {
            switch( nPart )
            {
                case PART_TRACK_HORZ_LEFT:  iPart = SBP_UPPERTRACKHORZ; break;
                case PART_TRACK_HORZ_RIGHT: iPart = SBP_LOWERTRACKHORZ; break;
                case PART_TRACK_VERT_UPPER: iPart = SBP_UPPERTRACKVERT; break;
                case PART_TRACK_VERT_LOWER: iPart = SBP_LOWERTRACKVERT; break;
                case ControlPart::TrackHorzLeft:  iPart = SBP_UPPERTRACKHORZ; break;
                case ControlPart::TrackHorzRight: iPart = SBP_LOWERTRACKHORZ; break;
                case ControlPart::TrackVertUpper: iPart = SBP_UPPERTRACKVERT; break;
                case ControlPart::TrackVertLower: iPart = SBP_LOWERTRACKVERT; break;
            }

            if( nState & ControlState::PRESSED )
@@ -643,7 +643,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            return (hr == S_OK);
        }
    }
    if( nType == ControlType::SpinButtons && nPart == PART_ALL_BUTTONS )
    if( nType == ControlType::SpinButtons && nPart == ControlPart::AllButtons )
    {
        if( aValue.getType() == ControlType::SpinButtons )
        {
@@ -664,7 +664,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
    }
    if( nType == ControlType::Spinbox )
    {
        if( nPart == PART_ALL_BUTTONS )
        if( nPart == ControlPart::AllButtons )
        {
            if( aValue.getType() == ControlType::SpinButtons )
            {
@@ -684,7 +684,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            }
        }

        if( nPart == PART_BUTTON_DOWN )
        if( nPart == ControlPart::ButtonDown )
        {
            iPart = SPNP_DOWN;
            if( nState & ControlState::PRESSED )
@@ -696,7 +696,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            else
                iState = DNS_NORMAL;
        }
        if( nPart == PART_BUTTON_UP )
        if( nPart == ControlPart::ButtonUp )
        {
            iPart = SPNP_UP;
            if( nState & ControlState::PRESSED )
@@ -708,7 +708,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            else
                iState = UPS_NORMAL;
        }
        if( nPart == PART_BUTTON_RIGHT )
        if( nPart == ControlPart::ButtonRight )
        {
            iPart = SPNP_DOWNHORZ;
            if( nState & ControlState::PRESSED )
@@ -720,7 +720,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            else
                iState = DNHZS_NORMAL;
        }
        if( nPart == PART_BUTTON_LEFT )
        if( nPart == ControlPart::ButtonLeft )
        {
            iPart = SPNP_UPHORZ;
            if( nState & ControlState::PRESSED )
@@ -732,12 +732,12 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            else
                iState = UPHZS_NORMAL;
        }
        if( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT || nPart == PART_BUTTON_UP || nPart == PART_BUTTON_DOWN )
        if( nPart == ControlPart::ButtonLeft || nPart == ControlPart::ButtonRight || nPart == ControlPart::ButtonUp || nPart == ControlPart::ButtonDown )
            return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
    }
    if( nType == ControlType::Combobox )
    {
        if( nPart == PART_BUTTON_DOWN )
        if( nPart == ControlPart::ButtonDown )
        {
            iPart = CP_DROPDOWNBUTTON;
            if( nState & ControlState::PRESSED )
@@ -835,7 +835,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,

    if( nType == ControlType::Listbox )
    {
        if( nPart == PART_ENTIRE_CONTROL || nPart == PART_WINDOW )
        if( nPart == ControlPart::Entire || nPart == ControlPart::ListboxWindow )
        {
            iPart = LVP_EMPTYTEXT; // ??? no idea which part to choose here
            return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
@@ -901,7 +901,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,

    if( nType == ControlType::Toolbar )
    {
        if( nPart == PART_BUTTON )
        if( nPart == ControlPart::Button )
        {
            iPart = TP_BUTTON;
            bool bChecked = ( aValue.getTristateVal() == ButtonValue::On );
@@ -918,14 +918,14 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
                iState = bChecked ? TS_CHECKED : TS_NORMAL;
            return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
        }
        else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
        else if( nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert )
        {
            // the vertical gripper is not supported in most themes and it makes no
            // sense to only support horizontal gripper
            //iPart = (nPart == PART_THUMB_HORZ) ? RP_GRIPPERVERT : RP_GRIPPER;
            //iPart = (nPart == ControlPart::ThumbHorz) ? RP_GRIPPERVERT : RP_GRIPPER;
            //return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
        }
        else if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT )
        else if( nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert )
        {
            if( aValue.getType() == ControlType::Toolbar )
            {
@@ -937,7 +937,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            // make it more compatible with Aero
            if( ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames )
            {
                impl_drawAeroToolbar( hDC, rc, nPart == PART_DRAW_BACKGROUND_HORZ );
                impl_drawAeroToolbar( hDC, rc, nPart == ControlPart::DrawBackgroundHorz );
                return true;
            }

@@ -947,7 +947,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,

    if( nType == ControlType::Menubar )
    {
        if( nPart == PART_ENTIRE_CONTROL )
        if( nPart == ControlPart::Entire )
        {
            if( aValue.getType() == ControlType::Menubar )
            {
@@ -963,7 +963,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
            }
            return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
        }
        else if( nPart == PART_MENU_ITEM )
        else if( nPart == ControlPart::MenuItem )
        {
            if( nState & ControlState::ENABLED )
            {
@@ -989,7 +989,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,

    if( nType == ControlType::Progress )
    {
        if( nPart != PART_ENTIRE_CONTROL )
        if( nPart != ControlPart::Entire )
            return FALSE;

        if( ! ImplDrawTheme( hTheme, hDC, PP_BAR, iState, rc, aCaption) )
@@ -1011,12 +1011,12 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,

    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);
        iPart = (nPart == ControlPart::TrackHorzArea) ? TKP_TRACK : TKP_TRACKVERT;
        iState = (nPart == ControlPart::TrackHorzArea) ? static_cast<int>(TRS_NORMAL) : static_cast<int>(TRVS_NORMAL);

        Rectangle aTrackRect = ImplGetThemeRect( hTheme, hDC, iPart, iState, Rectangle() );
        RECT aTRect = rc;
        if( nPart == PART_TRACK_HORZ_AREA )
        if( nPart == ControlPart::TrackHorzArea )
        {
            long nH = aTrackRect.GetHeight();
            aTRect.top += (rc.bottom - rc.top - nH)/2;
@@ -1037,14 +1037,14 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
        aThumbRect.top    = pVal->maThumbRect.Top();
        aThumbRect.right  = pVal->maThumbRect.Right();
        aThumbRect.bottom = pVal->maThumbRect.Bottom();
        iPart = (nPart == PART_TRACK_HORZ_AREA) ? TKP_THUMB : TKP_THUMBVERT;
        iPart = (nPart == ControlPart::TrackHorzArea) ? TKP_THUMB : TKP_THUMBVERT;
        iState = (nState & ControlState::ENABLED) ? TUS_NORMAL : TUS_DISABLED;
        return ImplDrawTheme( hTheme, hDC, iPart, iState, aThumbRect, aCaption );
    }

    if( nType == ControlType::ListNode )
    {
        if( nPart != PART_ENTIRE_CONTROL )
        if( nPart != ControlPart::Entire )
            return FALSE;

        ButtonValue aButtonValue = aValue.getTristateVal();
@@ -1067,7 +1067,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
    {
        if( nType == ControlType::MenuPopup )
        {
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
            {
                RECT aGutterRC = rc;
                if( AllSettings::GetLayoutRTL() )
@@ -1085,7 +1085,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
                ImplDrawTheme( hTheme, hDC, MENU_POPUPGUTTER, 0, aGutterRC, aCaption )
                ;
            }
            else if( nPart == PART_MENU_ITEM )
            else if( nPart == ControlPart::MenuItem )
            {
                if( (nState & ControlState::ENABLED) )
                    iState = (nState & ControlState::SELECTED) ? MPI_HOT : MPI_NORMAL;
@@ -1093,7 +1093,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
                    iState = (nState & ControlState::SELECTED) ? MPI_DISABLEDHOT : MPI_DISABLED;
                return ImplDrawTheme( hTheme, hDC, MENU_POPUPITEM, iState, rc, aCaption );
            }
            else if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK )
            else if( nPart == ControlPart::MenuItemCheckMark || nPart == ControlPart::MenuItemRadioMark )
            {
                if( (nState & ControlState::PRESSED) )
                {
@@ -1117,7 +1117,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
                    }
                    iState = (nState & ControlState::ENABLED) ? MCB_NORMAL : MCB_DISABLED;
                    ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECKBACKGROUND, iState, aBGRect, aCaption );
                    if( nPart == PART_MENU_ITEM_CHECK_MARK )
                    if( nPart == ControlPart::MenuItemCheckMark )
                        iState = (nState & ControlState::ENABLED) ? MC_CHECKMARKNORMAL : MC_CHECKMARKDISABLED;
                    else
                        iState = (nState & ControlState::ENABLED) ? MC_BULLETNORMAL : MC_BULLETDISABLED;
@@ -1126,7 +1126,7 @@ bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
                else
                    return true; // unchecked: do nothing
            }
            else if( nPart == PART_MENU_SEPARATOR )
            else if( nPart == ControlPart::Separator )
            {
                // adjust for gutter position
                if( AllSettings::GetLayoutRTL() )
@@ -1202,13 +1202,13 @@ bool WinSalGraphics::drawNativeControl( ControlType nType,
            hTheme = getThemeHandle( mhWnd, L"Scrollbar");
            break;
        case ControlType::Combobox:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Edit");
            else if( nPart == PART_BUTTON_DOWN )
            else if( nPart == ControlPart::ButtonDown )
                hTheme = getThemeHandle( mhWnd, L"Combobox");
            break;
        case ControlType::Spinbox:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Edit");
            else
                hTheme = getThemeHandle( mhWnd, L"Spin");
@@ -1221,9 +1221,9 @@ bool WinSalGraphics::drawNativeControl( ControlType nType,
            hTheme = getThemeHandle( mhWnd, L"Edit");
            break;
        case ControlType::Listbox:
            if( nPart == PART_ENTIRE_CONTROL || nPart == PART_WINDOW )
            if( nPart == ControlPart::Entire || nPart == ControlPart::ListboxWindow )
                hTheme = getThemeHandle( mhWnd, L"Listview");
            else if( nPart == PART_BUTTON_DOWN )
            else if( nPart == ControlPart::ButtonDown )
                hTheme = getThemeHandle( mhWnd, L"Combobox");
            break;
        case ControlType::TabPane:
@@ -1232,39 +1232,39 @@ bool WinSalGraphics::drawNativeControl( ControlType nType,
            hTheme = getThemeHandle( mhWnd, L"Tab");
            break;
        case ControlType::Toolbar:
            if( nPart == PART_ENTIRE_CONTROL || nPart == PART_BUTTON )
            if( nPart == ControlPart::Entire || nPart == ControlPart::Button )
                hTheme = getThemeHandle( mhWnd, L"Toolbar");
            else
                // use rebar for grip and background
                hTheme = getThemeHandle( mhWnd, L"Rebar");
            break;
        case ControlType::Menubar:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Rebar");
            else if( GetSalData()->mbThemeMenuSupport )
            {
                if( nPart == PART_MENU_ITEM )
                if( nPart == ControlPart::MenuItem )
                    hTheme = getThemeHandle( mhWnd, L"Menu" );
            }
            break;
        case ControlType::Progress:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"Progress");
            break;
        case ControlType::ListNode:
            if( nPart == PART_ENTIRE_CONTROL )
            if( nPart == ControlPart::Entire )
                hTheme = getThemeHandle( mhWnd, L"TreeView");
            break;
        case ControlType::Slider:
            if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
            if( nPart == ControlPart::TrackHorzArea || nPart == ControlPart::TrackVertArea )
                hTheme = getThemeHandle( mhWnd, L"Trackbar" );
            break;
        case ControlType::MenuPopup:
            if( GetSalData()->mbThemeMenuSupport )
            {
                if( nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM ||
                    nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK ||
                    nPart == PART_MENU_SEPARATOR
                if( nPart == ControlPart::Entire || nPart == ControlPart::MenuItem ||
                    nPart == ControlPart::MenuItemCheckMark || nPart == ControlPart::MenuItemRadioMark ||
                    nPart == ControlPart::Separator
                    )
                    hTheme = getThemeHandle( mhWnd, L"Menu" );
            }
@@ -1346,7 +1346,7 @@ bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
    HDC hDC = GetDC( mhWnd );
    if( nType == ControlType::Toolbar )
    {
        if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
        if( nPart == ControlPart::ThumbHorz || nPart == ControlPart::ThumbVert )
        {
            /*
            // the vertical gripper is not supported in most themes and it makes no
@@ -1355,9 +1355,9 @@ bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
            HTHEME hTheme = getThemeHandle( mhWnd, L"Rebar");
            if( hTheme )
            {
                Rectangle aRect( ImplGetThemeRect( hTheme, hDC, nPart == PART_THUMB_HORZ ? RP_GRIPPERVERT : RP_GRIPPER,
                Rectangle aRect( ImplGetThemeRect( hTheme, hDC, nPart == ControlPart::ThumbHorz ? RP_GRIPPERVERT : RP_GRIPPER,
                    0, rControlRegion.GetBoundRect() ) );
                if( nPart == PART_THUMB_HORZ && !aRect.IsEmpty() )
                if( nPart == ControlPart::ThumbHorz && !aRect.IsEmpty() )
                {
                    Rectangle aVertRect( 0, 0, aRect.getHeight(), aRect.getWidth() );
                    rNativeContentRegion = aVertRect;
@@ -1370,7 +1370,7 @@ bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
            }
            */
        }
        if( nPart == PART_BUTTON )
        if( nPart == ControlPart::Button )
        {
            HTHEME hTheme = getThemeHandle( mhWnd, L"Toolbar");
            if( hTheme )
@@ -1384,7 +1384,7 @@ bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
            }
        }
    }
    if( nType == ControlType::Progress && nPart == PART_ENTIRE_CONTROL )
    if( nType == ControlType::Progress && nPart == ControlPart::Entire )
    {
        HTHEME hTheme = getThemeHandle( mhWnd, L"Progress");
        if( hTheme )
@@ -1397,7 +1397,7 @@ bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
                bRet = TRUE;
        }
    }
    if( (nType == ControlType::Listbox || nType == ControlType::Combobox ) && nPart == PART_ENTIRE_CONTROL )
    if( (nType == ControlType::Listbox || nType == ControlType::Combobox ) && nPart == ControlPart::Entire )
    {
        HTHEME hTheme = getThemeHandle( mhWnd, L"Combobox");
        if( hTheme )
@@ -1416,7 +1416,7 @@ bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
        }
    }

    if( (nType == ControlType::Editbox || nType == ControlType::Spinbox) && nPart == PART_ENTIRE_CONTROL )
    if( (nType == ControlType::Editbox || nType == ControlType::Spinbox) && nPart == ControlPart::Entire )
    {
        HTHEME hTheme = getThemeHandle( mhWnd, L"Edit");
        if( hTheme )
@@ -1454,8 +1454,8 @@ bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
    {
        if( nType == ControlType::MenuPopup )
        {
            if( nPart == PART_MENU_ITEM_CHECK_MARK ||
                nPart == PART_MENU_ITEM_RADIO_MARK )
            if( nPart == ControlPart::MenuItemCheckMark ||
                nPart == ControlPart::MenuItemRadioMark )
            {
                HTHEME hTheme = getThemeHandle( mhWnd, L"Menu");
                Rectangle aBoxRect( rControlRegion );
@@ -1473,15 +1473,15 @@ bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
        }
    }

    if( nType == ControlType::Slider && ( (nPart == PART_THUMB_HORZ) || (nPart == PART_THUMB_VERT) ) )
    if( nType == ControlType::Slider && ( (nPart == ControlPart::ThumbHorz) || (nPart == ControlPart::ThumbVert) ) )
    {
        HTHEME hTheme = getThemeHandle( mhWnd, L"Trackbar");
        if( hTheme )
        {
            int iPart = (nPart == PART_THUMB_HORZ) ? TKP_THUMB : TKP_THUMBVERT;
            int iState = (nPart == PART_THUMB_HORZ) ? static_cast<int>(TUS_NORMAL) : static_cast<int>(TUVS_NORMAL);
            int iPart = (nPart == ControlPart::ThumbHorz) ? TKP_THUMB : TKP_THUMBVERT;
            int iState = (nPart == ControlPart::ThumbHorz) ? static_cast<int>(TUS_NORMAL) : static_cast<int>(TUVS_NORMAL);
            Rectangle aThumbRect = ImplGetThemeRect( hTheme, hDC, iPart, iState, Rectangle() );
            if( nPart == PART_THUMB_HORZ )
            if( nPart == ControlPart::ThumbHorz )
            {
                long nW = aThumbRect.GetWidth();
                Rectangle aRect( rControlRegion );
@@ -1501,7 +1501,7 @@ bool WinSalGraphics::getNativeControlRegion(  ControlType nType,
        }
    }

    if ( ( nType == ControlType::TabItem ) && ( nPart == PART_ENTIRE_CONTROL ) )
    if ( ( nType == ControlType::TabItem ) && ( nPart == ControlPart::Entire ) )
    {
        Rectangle aControlRect( rControlRegion );
        rNativeContentRegion = aControlRect;