[Libreoffice-commits] core.git: desktop/source include/vcl sc/source svtools/source vcl/osx vcl/source vcl/unx vcl/win
Noel Grandin
noelgrandin at gmail.com
Mon Jun 20 09:34:14 UTC 2016
desktop/source/splash/splash.cxx | 6
include/vcl/salnativewidgets.hxx | 92 ++++-----
sc/source/ui/app/inputwin.cxx | 2
sc/source/ui/cctrl/checklistmenu.cxx | 20 -
svtools/source/contnr/svimpbox.cxx | 4
svtools/source/contnr/svlbitm.cxx | 8
svtools/source/contnr/treelistbox.cxx | 4
svtools/source/control/headbar.cxx | 12 -
svtools/source/control/tabbar.cxx | 4
svtools/source/control/toolbarmenu.cxx | 32 +--
vcl/osx/salnativewidgets.cxx | 155 +++++++--------
vcl/source/app/help.cxx | 6
vcl/source/control/button.cxx | 74 +++----
vcl/source/control/combobox.cxx | 8
vcl/source/control/edit.cxx | 12 -
vcl/source/control/imp_listbox.cxx | 28 +-
vcl/source/control/listbox.cxx | 18 -
vcl/source/control/prgsbar.cxx | 4
vcl/source/control/scrbar.cxx | 68 +++---
vcl/source/control/slider.cxx | 6
vcl/source/control/spinbtn.cxx | 4
vcl/source/control/spinfld.cxx | 34 +--
vcl/source/control/tabctrl.cxx | 26 +-
vcl/source/window/brdwin.cxx | 16 -
vcl/source/window/decoview.cxx | 8
vcl/source/window/dialog.cxx | 8
vcl/source/window/dockingarea.cxx | 14 -
vcl/source/window/menu.cxx | 38 +--
vcl/source/window/menubarwindow.cxx | 20 -
vcl/source/window/menufloatingwindow.cxx | 14 -
vcl/source/window/paint.cxx | 2
vcl/source/window/status.cxx | 22 +-
vcl/source/window/tabpage.cxx | 6
vcl/source/window/toolbox.cxx | 36 +--
vcl/source/window/window.cxx | 4
vcl/unx/gtk/salnativewidgets-gtk.cxx | 306 +++++++++++++++---------------
vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 180 ++++++++---------
vcl/unx/kde/salnativewidgets-kde.cxx | 122 +++++------
vcl/unx/kde4/KDESalGraphics.cxx | 96 ++++-----
vcl/win/gdi/salnativewidgets-luna.cxx | 210 ++++++++++----------
40 files changed, 867 insertions(+), 862 deletions(-)
New commits:
commit cf5208b67180dc1deaeca611706087b1e2acc1ae
Author: Noel Grandin <noelgrandin at gmail.com>
Date: Fri Jun 10 19:55:12 2016 +0200
Convert PART to scoped enum
Change-Id: If4c2849beb207593d3d450ae3846ed24eaf66ca4
Reviewed-on: https://gerrit.libreoffice.org/26173
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index d598060..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..02103df 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,
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list