[Libreoffice-commits] core.git: desktop/source include/vcl sc/source svtools/source vcl/osx vcl/source vcl/unx vcl/win
Noel Grandin
noel at peralex.com
Tue May 31 09:09:55 UTC 2016
desktop/source/splash/splash.cxx | 6
include/vcl/edit.hxx | 2
include/vcl/salnativewidgets.hxx | 129 ++++++++------------
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 | 4
svtools/source/contnr/treelistbox.cxx | 4
svtools/source/control/headbar.cxx | 12 -
svtools/source/control/tabbar.cxx | 4
svtools/source/control/toolbarmenu.cxx | 26 ++--
vcl/osx/salnativewidgets.cxx | 147 ++++++++++++-----------
vcl/source/app/help.cxx | 6
vcl/source/control/button.cxx | 82 ++++++-------
vcl/source/control/combobox.cxx | 8 -
vcl/source/control/edit.cxx | 30 ++--
vcl/source/control/imp_listbox.cxx | 28 ++--
vcl/source/control/listbox.cxx | 18 +-
vcl/source/control/prgsbar.cxx | 4
vcl/source/control/scrbar.cxx | 64 +++++-----
vcl/source/control/slider.cxx | 6
vcl/source/control/spinbtn.cxx | 4
vcl/source/control/spinfld.cxx | 44 +++----
vcl/source/control/tabctrl.cxx | 26 ++--
vcl/source/gdi/salgdilayout.cxx | 11 -
vcl/source/outdev/nativecontrols.cxx | 18 +-
vcl/source/window/brdwin.cxx | 32 ++---
vcl/source/window/decoview.cxx | 10 -
vcl/source/window/dialog.cxx | 4
vcl/source/window/dockingarea.cxx | 14 +-
vcl/source/window/menu.cxx | 34 ++---
vcl/source/window/menubarwindow.cxx | 20 +--
vcl/source/window/menufloatingwindow.cxx | 14 +-
vcl/source/window/paint.cxx | 2
vcl/source/window/status.cxx | 20 +--
vcl/source/window/tabpage.cxx | 6
vcl/source/window/toolbox.cxx | 38 +++---
vcl/source/window/window.cxx | 2
vcl/unx/gtk/salnativewidgets-gtk.cxx | 185 +++++++++++++++---------------
vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 145 +++++++++++------------
vcl/unx/kde/salnativewidgets-kde.cxx | 94 +++++++--------
vcl/unx/kde4/KDESalGraphics.cxx | 116 +++++++++---------
vcl/win/gdi/salnativewidgets-luna.cxx | 158 ++++++++++++-------------
43 files changed, 792 insertions(+), 811 deletions(-)
New commits:
commit 5c977a9ddff3c221c098a57855ede7c0ef4fe31f
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 27 16:24:21 2016 +0200
Convert ControlType to scoped enum
Change-Id: Iaa13c3e7030296a97bab144103745867d43b4b19
Reviewed-on: https://gerrit.libreoffice.org/25554
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 9f95e03..d598060 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -620,7 +620,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang
//native drawing
// in case of native controls we need to draw directly to the window
- if (pSpl->_bNativeProgress && rRenderContext.IsNativeControlSupported(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL))
+ if (pSpl->_bNativeProgress && rRenderContext.IsNativeControlSupported(ControlType::IntroProgress, PART_ENTIRE_CONTROL))
{
rRenderContext.DrawBitmapEx(Point(), pSpl->_aIntroBmp);
@@ -628,7 +628,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang
Rectangle aDrawRect( Point(pSpl->_tlx, pSpl->_tly), Size( pSpl->_barwidth, pSpl->_barheight));
Rectangle aNativeControlRegion, aNativeContentRegion;
- if (rRenderContext.GetNativeControlRegion(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
+ if (rRenderContext.GetNativeControlRegion(ControlType::IntroProgress, PART_ENTIRE_CONTROL, aDrawRect,
ControlState::ENABLED, aValue, OUString(),
aNativeControlRegion, aNativeContentRegion))
{
@@ -637,7 +637,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang
aDrawRect.Bottom() += (nProgressHeight - pSpl->_barheight)/2;
}
- if ((rRenderContext.DrawNativeControl(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
+ if ((rRenderContext.DrawNativeControl(ControlType::IntroProgress, PART_ENTIRE_CONTROL, aDrawRect,
ControlState::ENABLED, aValue, pSpl->_sProgressText)))
{
return;
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index d203bf7..722a258 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -137,7 +137,7 @@ protected:
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, bool bPaint = true );
- SAL_DLLPRIVATE int ImplGetNativeControlType() const;
+ SAL_DLLPRIVATE ControlType ImplGetNativeControlType() const;
SAL_DLLPRIVATE long ImplGetExtraXOffset() const;
SAL_DLLPRIVATE long ImplGetExtraYOffset() const;
static SAL_DLLPRIVATE void ImplInvalidateOutermostBorder( vcl::Window* pWin );
diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
index 88f1ae0..7c2ce42 100644
--- a/include/vcl/salnativewidgets.hxx
+++ b/include/vcl/salnativewidgets.hxx
@@ -32,111 +32,86 @@
* control if it were composite).
*/
-typedef sal_uInt32 ControlType;
-
+enum class ControlType {
// for use in general purpose ImplControlValue
-#define CTRL_GENERIC 0
-
+ Generic = 0,
// Normal PushButton/Command Button
-#define CTRL_PUSHBUTTON 1
-
+ Pushbutton = 1,
// Normal single radio button
-#define CTRL_RADIOBUTTON 2
-
+ Radiobutton = 2,
// Normal single checkbox
-#define CTRL_CHECKBOX 10
-
+ Checkbox = 10,
// Combobox, i.e. a ListBox
// that allows data entry by user
-#define CTRL_COMBOBOX 20
-
+ Combobox = 20,
// Control that allows text entry
-#define CTRL_EDITBOX 30
-
+ Editbox = 30,
// Control that allows text entry, but without the usual border
// Has to be handled separately, because this one cannot handle
// HAS_BACKGROUND_TEXTURE, which is drawn in the edit box'es
// border window.
-#define CTRL_EDITBOX_NOBORDER 31
-
+ EditboxNoBorder = 31,
// Control that allows text entry
// ( some systems distinguish between single and multi line edit boxes )
-#define CTRL_MULTILINE_EDITBOX 32
-
+ MultilineEditbox = 32,
// Control that pops up a menu,
// but does NOT allow data entry
-#define CTRL_LISTBOX 35
-
+ Listbox = 35,
// An edit field together with two little
// buttons on the side (aka spin field)
-#define CTRL_SPINBOX 40
-
+ Spinbox = 40,
// Two standalone spin buttons
// without an edit field
-#define CTRL_SPINBUTTONS 45
-
+ SpinButtons = 45,
// A single tab
-#define CTRL_TAB_ITEM 50
-
+ TabItem = 50,
// The border around a tab area,
// but without the tabs themselves.
// May have a gap at the top for
// the active tab
-#define CTRL_TAB_PANE 55
-
+ TabPane = 55,
// The background to the tab area
-#define CTRL_TAB_HEADER 56
-
+ TabHeader = 56,
// Background of a Tab Pane
-#define CTRL_TAB_BODY 57
-
+ TabBody = 57,
// Normal scrollbar, including
// all parts like slider, buttons
-#define CTRL_SCROLLBAR 60
-
-#define CTRL_SLIDER 65
-
+ Scrollbar = 60,
+ Slider = 65,
// Border around a group of related
// items, perhaps also displaying
// a label of identification
-#define CTRL_GROUPBOX 70
-
+ Groupbox = 70,
// A separator line
-#define CTRL_FIXEDLINE 80
-
+ Fixedline = 80,
// A toolbar control with buttons and a grip
-#define CTRL_TOOLBAR 100
-
+ Toolbar = 100,
// The menubar
-#define CTRL_MENUBAR 120
+ Menubar = 120,
// popup menu
-#define CTRL_MENU_POPUP 121
-
-#define CTRL_PROGRESS 131
+ MenuPopup = 121,
+ Progress = 131,
// Progress bar for the intro window
// (aka splash screen), in case some
// wants native progress bar in the
// application but not for the splash
// screen (used in desktop/)
-#define CTRL_INTROPROGRESS 132
-
+ IntroProgress = 132,
// tool tips
-#define CTRL_TOOLTIP 140
-
+ Tooltip = 140,
// to draw the implemented theme
-#define CTRL_WINDOW_BACKGROUND 150
-
+ WindowBackground = 150,
//to draw border of frames natively
-#define CTRL_FRAME 160
-
+ Frame = 160,
// for nodes in listviews
// used in svtools/source/contnr/svtreebx.cxx
-#define CTRL_LISTNODE 170
+ ListNode = 170,
// nets between elements of listviews
// with nodes
-#define CTRL_LISTNET 171
+ ListNet = 171,
// for list headers
-#define CTRL_LISTHEADER 172
+ ListHeader = 172,
+};
/* Control Parts:
@@ -282,20 +257,20 @@ public:
{
switch(mnType)
{
- case CTRL_CHECKBOX:
- case CTRL_RADIOBUTTON:
- case CTRL_LISTNODE:
- case CTRL_SLIDER:
- case CTRL_PROGRESS:
+ case ControlType::Checkbox:
+ case ControlType::Radiobutton:
+ case ControlType::ListNode:
+ case ControlType::Slider:
+ case ControlType::Progress:
// FIXME: these guys have complex state hidden in ImplControlValue
// structs which affects rendering, needs to be a and needs to be
// part of the key to our cache.
- case CTRL_SPINBOX:
- case CTRL_SPINBUTTONS:
- case CTRL_TAB_ITEM:
+ case ControlType::Spinbox:
+ case ControlType::SpinButtons:
+ case ControlType::TabItem:
return false;
- case CTRL_MENUBAR:
+ case ControlType::Menubar:
if (mnPart == PART_ENTIRE_CONTROL)
return false;
break;
@@ -342,11 +317,11 @@ class VCL_DLLPUBLIC ImplControlValue
public:
explicit ImplControlValue( ButtonValue nTristate )
- : mType( CTRL_GENERIC ), mTristate(nTristate), mNumber(0) {}
+ : mType( ControlType::Generic ), mTristate(nTristate), mNumber(0) {}
explicit ImplControlValue( long nNumeric )
- : mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric) {}
+ : mType( ControlType::Generic ), mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric) {}
inline ImplControlValue()
- : mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber(0) {}
+ : mType( ControlType::Generic ), mTristate(BUTTONVALUE_DONTKNOW), mNumber(0) {}
virtual ~ImplControlValue();
@@ -382,7 +357,7 @@ class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
ControlState mnPage2State;
inline ScrollbarValue()
- : ImplControlValue( CTRL_SCROLLBAR, 0 )
+ : ImplControlValue( ControlType::Scrollbar, 0 )
{
mnMin = 0; mnMax = 0; mnCur = 0; mnVisibleSize = 0;
mnButton1State = ControlState::NONE; mnButton2State = ControlState::NONE;
@@ -402,7 +377,7 @@ class VCL_DLLPUBLIC SliderValue : public ImplControlValue
ControlState mnThumbState;
SliderValue()
- : ImplControlValue( CTRL_SLIDER, 0 )
+ : ImplControlValue( ControlType::Slider, 0 )
, mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( ControlState::NONE )
{}
virtual ~SliderValue();
@@ -435,7 +410,7 @@ class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
Rectangle maContentRect;
TabitemValue(const Rectangle &rContentRect)
- : ImplControlValue( CTRL_TAB_ITEM, 0 )
+ : ImplControlValue( ControlType::TabItem, 0 )
, mnAlignment(TabitemFlags::NONE)
, maContentRect(rContentRect)
{
@@ -469,7 +444,7 @@ class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue
int mnLowerPart;
SpinbuttonValue()
- : ImplControlValue( CTRL_SPINBUTTONS, 0 )
+ : ImplControlValue( ControlType::SpinButtons, 0 )
, mnUpperState(ControlState::NONE)
, mnLowerState(ControlState::NONE)
, mnUpperPart(0)
@@ -488,7 +463,7 @@ class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue
class VCL_DLLPUBLIC ToolbarValue : public ImplControlValue
{
public:
- ToolbarValue() : ImplControlValue( CTRL_TOOLBAR, 0 )
+ ToolbarValue() : ImplControlValue( ControlType::Toolbar, 0 )
{ mbIsTopDockingArea = false; }
virtual ~ToolbarValue();
virtual ToolbarValue* clone() const override;
@@ -504,7 +479,7 @@ public:
class VCL_DLLPUBLIC MenubarValue : public ImplControlValue
{
public:
- MenubarValue() : ImplControlValue( CTRL_MENUBAR, 0 )
+ MenubarValue() : ImplControlValue( ControlType::Menubar, 0 )
{ maTopDockingAreaHeight=0; }
virtual ~MenubarValue();
virtual MenubarValue* clone() const override;
@@ -520,7 +495,7 @@ class VCL_DLLPUBLIC MenupopupValue : public ImplControlValue
{
public:
MenupopupValue( long i_nGutterWidth, const Rectangle& i_rItemRect )
- : ImplControlValue( CTRL_MENU_POPUP, i_nGutterWidth )
+ : ImplControlValue( ControlType::MenuPopup, i_nGutterWidth )
, maItemRect( i_rItemRect )
{}
virtual ~MenupopupValue();
@@ -536,7 +511,7 @@ class VCL_DLLPUBLIC PushButtonValue : public ImplControlValue
{
public:
PushButtonValue()
- : ImplControlValue( CTRL_PUSHBUTTON, 0 )
+ : ImplControlValue( ControlType::Pushbutton, 0 )
, mbBevelButton( false ), mbSingleLine( true ) {}
virtual ~PushButtonValue();
virtual PushButtonValue* clone() const override;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index dc46535..904c465 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -102,7 +102,7 @@ enum ScNameInputType
ScTextWndBase::ScTextWndBase( vcl::Window* pParent, WinBits nStyle )
: Window ( pParent, nStyle )
{
- if ( IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) )
+ if ( IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) )
{
SetType( WINDOW_CALCINPUTLINE );
SetBorderStyle( WindowBorderStyle::NWF );
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 2bf014a..ec51967 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -251,10 +251,10 @@ void ScMenuFloatingWindow::Paint(vcl::RenderContext& rRenderContext, const Recta
// Window background
bool bNativeDrawn = true;
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
{
rRenderContext.SetClipRegion();
- bNativeDrawn = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect,
+ bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect,
ControlState::ENABLED, ImplControlValue(), OUString());
}
else
@@ -384,26 +384,26 @@ void ScMenuFloatingWindow::drawSeparator(vcl::RenderContext& rRenderContext, siz
getMenuItemPosSize(nPos, aPos, aSize);
Rectangle aRegion(aPos,aSize);
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
{
rRenderContext.Push(PushFlags::CLIPREGION);
rRenderContext.IntersectClipRegion(aRegion);
Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel());
- rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect,
+ rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect,
ControlState::ENABLED, ImplControlValue(), OUString());
rRenderContext.Pop();
}
bool bNativeDrawn = false;
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SEPARATOR))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_SEPARATOR))
{
ControlState nState = ControlState::NONE;
const MenuItemData& rData = maMenuItems[nPos];
if (rData.mbEnabled)
nState |= ControlState::ENABLED;
- bNativeDrawn = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_SEPARATOR,
+ bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_SEPARATOR,
aRegion, nState, ImplControlValue(), OUString());
}
@@ -677,23 +677,23 @@ void ScMenuFloatingWindow::highlightMenuItem(vcl::RenderContext& rRenderContext,
getMenuItemPosSize(nPos, aPos, aSize);
Rectangle aRegion(aPos,aSize);
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
{
rRenderContext.Push(PushFlags::CLIPREGION);
rRenderContext.IntersectClipRegion(Rectangle(aPos, aSize));
Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel());
- rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED,
+ rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect, ControlState::ENABLED,
ImplControlValue(), OUString());
rRenderContext.Pop();
}
bool bNativeDrawn = true;
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM))
{
ControlState nState = bSelected ? ControlState::SELECTED : ControlState::NONE;
if (maMenuItems[nPos].mbEnabled)
nState |= ControlState::ENABLED;
- bNativeDrawn = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_ITEM,
+ bNativeDrawn = rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_ITEM,
aRegion, nState, ImplControlValue(), OUString());
}
else
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index fd412c9..10e0cd7 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -1026,11 +1026,11 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext)
// for platforms that don't have nets, DrawNativeControl does nothing and returns true
// so that SvImpLBox::DrawNet() doesn't draw anything either
- if (rRenderContext.IsNativeControlSupported(CTRL_LISTNET, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::ListNet, PART_ENTIRE_CONTROL))
{
ImplControlValue aControlValue;
ControlState nState = ControlState::ENABLED;
- if (rRenderContext.DrawNativeControl(CTRL_LISTNET, PART_ENTIRE_CONTROL,
+ if (rRenderContext.DrawNativeControl(ControlType::ListNet, PART_ENTIRE_CONTROL,
Rectangle(), nState, aControlValue, OUString()))
{
return;
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 353ff60..341827f 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -337,7 +337,7 @@ void SvLBoxButton::Paint(
//Native drawing
bool bNativeOK = false;
- ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ ControlType eCtrlType = (pData->IsRadio())? ControlType::Radiobutton : ControlType::Checkbox;
if ( nIndex != SvBmp::STATICIMAGE && rRenderContext.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
{
@@ -415,7 +415,7 @@ void SvLBoxButton::InitViewData(SvTreeListBox* pView,SvTreeListEntry* pEntry, Sv
pViewData = pView->GetViewDataItem( pEntry, this );
Size aSize( pData->Width(), pData->Height() );
- ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ ControlType eCtrlType = (pData->IsRadio())? ControlType::Radiobutton : ControlType::Checkbox;
if ( eKind != SvLBoxButtonKind::StaticImage && pView )
ImplAdjustBoxSize(aSize, eCtrlType, *pView);
pViewData->maSize = aSize;
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index fc72252..7a931b8 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3034,7 +3034,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
//native
bool bNativeOK = false;
- if (rRenderContext.IsNativeControlSupported(CTRL_LISTNODE, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::ListNode, PART_ENTIRE_CONTROL))
{
ImplControlValue aControlValue;
Rectangle aCtrlRegion(aPos, pImg->GetSizePixel());
@@ -3059,7 +3059,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
}
}
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_LISTNODE, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString());
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::ListNode, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString());
}
if (!bNativeOK)
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index c7ffa20..cd35991 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -310,10 +310,10 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
HeaderBarItemBits nBits = pItem->mnBits;
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- if (rRenderContext.IsNativeControlSupported(CTRL_WINDOW_BACKGROUND, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, PART_ENTIRE_CONTROL))
{
aCtrlRegion = aRect;
- rRenderContext.DrawNativeControl(CTRL_WINDOW_BACKGROUND, PART_ENTIRE_CONTROL,
+ rRenderContext.DrawNativeControl(ControlType::WindowBackground, PART_ENTIRE_CONTROL,
aCtrlRegion, nState, aControlValue, OUString());
}
@@ -332,14 +332,14 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
Color aSelectionTextColor(COL_TRANSPARENT);
- if (rRenderContext.IsNativeControlSupported(CTRL_LISTHEADER, PART_BUTTON))
+ if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, PART_BUTTON))
{
aCtrlRegion = aRect;
aControlValue.setTristateVal(BUTTONVALUE_ON);
nState |= ControlState::ENABLED;
if (bHigh)
nState |= ControlState::PRESSED;
- rRenderContext.DrawNativeControl(CTRL_LISTHEADER, PART_BUTTON,
+ rRenderContext.DrawNativeControl(ControlType::ListHeader, PART_BUTTON,
aCtrlRegion, nState, aControlValue, OUString());
}
else
@@ -553,7 +553,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
if (bDraw)
{
- if (rRenderContext.IsNativeControlSupported(CTRL_LISTHEADER, PART_ARROW))
+ if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, PART_ARROW))
{
aCtrlRegion = Rectangle(Point(nArrowX, aRect.Top()), Size(nArrowWidth, aRect.GetHeight()));
// control value passes 1 if arrow points down, 0 otherwise
@@ -561,7 +561,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
nState |= ControlState::ENABLED;
if (bHigh)
nState |= ControlState::PRESSED;
- rRenderContext.DrawNativeControl(CTRL_LISTHEADER, PART_ARROW, aCtrlRegion,
+ rRenderContext.DrawNativeControl(ControlType::ListHeader, PART_ARROW, aCtrlRegion,
nState, aControlValue, OUString());
}
else
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index faa4ebf..c9859e7 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -1187,9 +1187,9 @@ void TabBar::MouseButtonUp(const MouseEvent& rMEvt)
void TabBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rect)
{
- if (rRenderContext.IsNativeControlSupported(CTRL_WINDOW_BACKGROUND,PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground,PART_ENTIRE_CONTROL))
{
- rRenderContext.DrawNativeControl(CTRL_WINDOW_BACKGROUND,PART_ENTIRE_CONTROL,rect,
+ rRenderContext.DrawNativeControl(ControlType::WindowBackground,PART_ENTIRE_CONTROL,rect,
ControlState::ENABLED,ImplControlValue(0),OUString());
}
// calculate items and emit
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 4da09d7..c846ef0 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -545,9 +545,9 @@ static long ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, l
Rectangle aNativeContent;
Point tmp( 0, 0 );
Rectangle aCtrlRegion( tmp, Size( 100, 15 ) );
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_CHECK_MARK))
{
- if (rRenderContext.GetNativeControlRegion(ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_CHECK_MARK),
+ if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_CHECK_MARK),
aCtrlRegion, ControlState(ControlState::ENABLED), aVal, OUString(),
aNativeBounds, aNativeContent)
)
@@ -556,9 +556,9 @@ static long ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, l
rMaxWidth = aNativeContent.GetWidth();
}
}
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_RADIO_MARK))
{
- if (rRenderContext.GetNativeControlRegion(ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_RADIO_MARK),
+ if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_RADIO_MARK),
aCtrlRegion, ControlState(ControlState::ENABLED), aVal, OUString(),
aNativeBounds, aNativeContent)
)
@@ -633,7 +633,7 @@ Size ToolbarMenu::implCalcSize()
if( pEntry->HasCheck() && !pEntry->mbHasImage )
{
- if (IsNativeControlSupported(CTRL_MENU_POPUP, (pEntry->mnBits & MenuItemBits::RADIOCHECK)
+ if (IsNativeControlSupported(ControlType::MenuPopup, (pEntry->mnBits & MenuItemBits::RADIOCHECK)
? PART_MENU_ITEM_CHECK_MARK
: PART_MENU_ITEM_RADIO_MARK ) )
{
@@ -811,19 +811,19 @@ void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHi
aItemRect.Right() -= nFontHeight + nFontHeight / 4;
}
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
{
Size aPxSize(GetOutputSizePixel());
rRenderContext.Push(PushFlags::CLIPREGION);
rRenderContext.IntersectClipRegion(Rectangle(Point(nX, nY), Size(aSz.Width(), pEntry->maSize.Height())));
Rectangle aCtrlRect(Point(nX, 0), Size(aPxSize.Width() - nX, aPxSize.Height()));
- rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect,
+ rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect,
ControlState::ENABLED, ImplControlValue(), OUString());
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM))
{
bDrawItemRect = false;
ControlState eState = ControlState::SELECTED | (pEntry->mbEnabled ? ControlState::ENABLED : ControlState::NONE);
- if (!rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect,
+ if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_ITEM, aItemRect,
eState, ImplControlValue(), OUString()))
{
bDrawItemRect = true;
@@ -1168,14 +1168,14 @@ void ToolbarMenu::KeyInput( const KeyEvent& rKEvent )
static void ImplPaintCheckBackground(vcl::RenderContext& rRenderContext, vcl::Window& rWindow, const Rectangle& i_rRect, bool i_bHighlight )
{
bool bNativeOk = false;
- if (rRenderContext.IsNativeControlSupported(CTRL_TOOLBAR, PART_BUTTON))
+ if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, PART_BUTTON))
{
ImplControlValue aControlValue;
ControlState nState = ControlState::PRESSED | ControlState::ENABLED;
aControlValue.setTristateVal(BUTTONVALUE_ON);
- bNativeOk = rRenderContext.DrawNativeControl(CTRL_TOOLBAR, PART_BUTTON,
+ bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, PART_BUTTON,
i_rRect, nState, aControlValue, OUString());
}
@@ -1275,7 +1275,7 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry
if (!pEntry->mbHasImage)
{
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP,
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup,
(pEntry->mnBits & MenuItemBits::RADIOCHECK)
? PART_MENU_ITEM_CHECK_MARK
: PART_MENU_ITEM_RADIO_MARK))
@@ -1300,7 +1300,7 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight) / 2;
Rectangle aCheckRect(aTmpPos, Size(nCtrlHeight, nCtrlHeight));
- rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, nPart, aCheckRect,
+ rRenderContext.DrawNativeControl(ControlType::MenuPopup, nPart, aCheckRect,
nState, ImplControlValue(), OUString());
aPos.setX(aPos.getX() + nCtrlHeight + gfxExtra);
}
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 757ac2c..901fbf2 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -175,15 +175,15 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
switch( nType )
{
- case CTRL_PUSHBUTTON:
- case CTRL_RADIOBUTTON:
- case CTRL_CHECKBOX:
- case CTRL_LISTNODE:
+ case ControlType::Pushbutton:
+ case ControlType::Radiobutton:
+ case ControlType::Checkbox:
+ case ControlType::ListNode:
if( nPart == PART_ENTIRE_CONTROL )
return true;
break;
- case CTRL_SCROLLBAR:
+ case ControlType::Scrollbar:
if( nPart == PART_DRAW_BACKGROUND_HORZ ||
nPart == PART_DRAW_BACKGROUND_VERT ||
nPart == PART_ENTIRE_CONTROL ||
@@ -191,41 +191,41 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
return true;
break;
- case CTRL_SLIDER:
+ case ControlType::Slider:
if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
return true;
break;
- case CTRL_EDITBOX:
+ case ControlType::Editbox:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == HAS_BACKGROUND_TEXTURE )
return true;
break;
- case CTRL_MULTILINE_EDITBOX:
+ case ControlType::MultilineEditbox:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == HAS_BACKGROUND_TEXTURE )
return true;
break;
- case CTRL_SPINBOX:
+ case ControlType::Spinbox:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == PART_ALL_BUTTONS ||
nPart == HAS_BACKGROUND_TEXTURE )
return true;
break;
- case CTRL_SPINBUTTONS:
+ case ControlType::SpinButtons:
return false;
break;
- case CTRL_COMBOBOX:
+ case ControlType::Combobox:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == HAS_BACKGROUND_TEXTURE )
return true;
break;
- case CTRL_LISTBOX:
+ case ControlType::Listbox:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == PART_WINDOW ||
nPart == HAS_BACKGROUND_TEXTURE ||
@@ -234,9 +234,9 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
return true;
break;
- case CTRL_TAB_ITEM:
- case CTRL_TAB_PANE:
- case CTRL_TAB_BODY: // see vcl/source/window/tabpage.cxx
+ case ControlType::TabItem:
+ case ControlType::TabPane:
+ case ControlType::TabBody: // see vcl/source/window/tabpage.cxx
if( nPart == PART_ENTIRE_CONTROL ||
nPart == PART_TABS_DRAW_RTL ||
nPart == HAS_BACKGROUND_TEXTURE )
@@ -245,47 +245,48 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
// when PART_BUTTON is used, toolbar icons are not highlighted when mouse rolls over.
// More Aqua compliant
- case CTRL_TOOLBAR:
+ case ControlType::Toolbar:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == PART_DRAW_BACKGROUND_HORZ ||
nPart == PART_DRAW_BACKGROUND_VERT)
return true;
break;
- case CTRL_WINDOW_BACKGROUND:
+ case ControlType::WindowBackground:
if ( nPart == PART_BACKGROUND_WINDOW ||
nPart == PART_BACKGROUND_DIALOG )
return true;
break;
- case CTRL_MENUBAR:
+ case ControlType::Menubar:
if( nPart == PART_ENTIRE_CONTROL )
return true;
break;
- case CTRL_TOOLTIP: // ** TO DO
+ case ControlType::Tooltip: // ** TO DO
break;
- case CTRL_MENU_POPUP:
+ case ControlType::MenuPopup:
if( nPart == PART_ENTIRE_CONTROL ||
nPart == PART_MENU_ITEM ||
nPart == PART_MENU_ITEM_CHECK_MARK ||
nPart == PART_MENU_ITEM_RADIO_MARK)
return true;
break;
- case CTRL_PROGRESS:
- case CTRL_INTROPROGRESS:
+ case ControlType::Progress:
+ case ControlType::IntroProgress:
if( nPart == PART_ENTIRE_CONTROL )
return true;
break;
- case CTRL_FRAME:
+ case ControlType::Frame:
if( nPart == PART_BORDER )
return true;
break;
- case CTRL_LISTNET:
+ case ControlType::ListNet:
if( nPart == PART_ENTIRE_CONTROL )
return true;
break;
+ default: break;
}
return bOk;
@@ -301,13 +302,13 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
const Point& rPos, bool& rIsInside )
{
- if ( nType == CTRL_SCROLLBAR )
+ if ( nType == ControlType::Scrollbar )
{
Rectangle aRect;
bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect );
rIsInside = bValid && aRect.IsInside( rPos );
return bValid;
- } // CTRL_SCROLLBAR
+ } // ControlType::Scrollbar
return false;
}
@@ -380,7 +381,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
switch( nType )
{
- case CTRL_COMBOBOX:
+ case ControlType::Combobox:
if ( nPart == HAS_BACKGROUND_TEXTURE ||
nPart == PART_ENTIRE_CONTROL )
{
@@ -399,7 +400,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_TOOLBAR:
+ case ControlType::Toolbar:
{
#if HAVE_FEATURE_MACOSX_SANDBOX
HIThemeMenuItemDrawInfo aMenuItemDrawInfo;
@@ -437,7 +438,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_WINDOW_BACKGROUND:
+ case ControlType::WindowBackground:
{
HIThemeBackgroundDrawInfo aThemeBackgroundInfo;
aThemeBackgroundInfo.version = 0;
@@ -453,8 +454,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_MENUBAR:
- case CTRL_MENU_POPUP:
+ case ControlType::Menubar:
+ case ControlType::MenuPopup:
{
if ((nPart == PART_ENTIRE_CONTROL) || (nPart == PART_MENU_ITEM )|| (nPart == HAS_BACKGROUND_TEXTURE ))
{
@@ -514,7 +515,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_PUSHBUTTON:
+ case ControlType::Pushbutton:
{
// [ FIXME] : instead of use a value, vcl can retrieve correct values on the fly (to be implemented)
const int PB_Mini_Height = 15;
@@ -526,7 +527,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
// no animation
aPushInfo.animation.time.start = 0;
aPushInfo.animation.time.current = 0;
- PushButtonValue const * pPBVal = aValue.getType() == CTRL_PUSHBUTTON ? static_cast<PushButtonValue const *>(&aValue) : nullptr;
+ PushButtonValue const * pPBVal = aValue.getType() == ControlType::Pushbutton ? static_cast<PushButtonValue const *>(&aValue) : nullptr;
int nPaintHeight = static_cast<int>(rc.size.height);
if( pPBVal && pPBVal->mbBevelButton )
@@ -576,19 +577,20 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_RADIOBUTTON:
- case CTRL_CHECKBOX:
+ case ControlType::Radiobutton:
+ case ControlType::Checkbox:
{
HIThemeButtonDrawInfo aInfo;
aInfo.version = 0;
switch( nType )
{
- case CTRL_RADIOBUTTON: if(rc.size.width >= BUTTON_HEIGHT) aInfo.kind = kThemeRadioButton;
+ case ControlType::Radiobutton: if(rc.size.width >= BUTTON_HEIGHT) aInfo.kind = kThemeRadioButton;
else aInfo.kind = kThemeSmallRadioButton;
break;
- case CTRL_CHECKBOX: if(rc.size.width >= BUTTON_HEIGHT) aInfo.kind = kThemeCheckBox;
+ case ControlType::Checkbox: if(rc.size.width >= BUTTON_HEIGHT) aInfo.kind = kThemeCheckBox;
else aInfo.kind = kThemeSmallCheckBox;
break;
+ default: break;
}
aInfo.state = getState( nState );
@@ -606,7 +608,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_LISTNODE:
+ case ControlType::ListNode:
{
ButtonValue aButtonValue = aValue.getTristateVal();
@@ -664,8 +666,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_PROGRESS:
- case CTRL_INTROPROGRESS:
+ case ControlType::Progress:
+ case ControlType::IntroProgress:
{
long nProgressWidth = aValue.getNumericVal();
HIThemeTrackDrawInfo aTrackInfo;
@@ -683,7 +685,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
aTrackInfo.attributes |= kThemeTrackRightToLeft;
aTrackInfo.enableState = getTrackState( nState );
// the intro bitmap never gets key anyway; we want to draw that enabled
- if( nType == CTRL_INTROPROGRESS )
+ if( nType == ControlType::IntroProgress )
aTrackInfo.enableState = kThemeTrackActive;
aTrackInfo.filler1 = 0;
aTrackInfo.trackInfo.progress.phase = static_cast<UInt8>(CFAbsoluteTimeGetCurrent()*10.0);
@@ -693,7 +695,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_SLIDER:
+ case ControlType::Slider:
{
SliderValue const * pSLVal = static_cast<SliderValue const *>(&aValue);
@@ -723,9 +725,9 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_SCROLLBAR:
+ case ControlType::Scrollbar:
{
- const ScrollbarValue* pScrollbarVal = (aValue.getType() == CTRL_SCROLLBAR) ? static_cast<const ScrollbarValue*>(&aValue) : nullptr;
+ const ScrollbarValue* pScrollbarVal = (aValue.getType() == ControlType::Scrollbar) ? static_cast<const ScrollbarValue*>(&aValue) : nullptr;
if( nPart == PART_DRAW_BACKGROUND_VERT ||
nPart == PART_DRAW_BACKGROUND_HORZ )
@@ -778,7 +780,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_TAB_PANE:
+ case ControlType::TabPane:
{
HIThemeTabPaneDrawInfo aTabPaneDrawInfo;
aTabPaneDrawInfo.version = 1;
@@ -800,7 +802,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_TAB_ITEM:
+ case ControlType::TabItem:
{
HIThemeTabDrawInfo aTabItemDrawInfo;
aTabItemDrawInfo.version=1;
@@ -852,7 +854,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_LISTBOX:
+ case ControlType::Listbox:
switch( nPart)
{
case PART_ENTIRE_CONTROL:
@@ -892,8 +894,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_EDITBOX:
- case CTRL_MULTILINE_EDITBOX:
+ case ControlType::Editbox:
+ case ControlType::MultilineEditbox:
{
HIThemeFrameDrawInfo aTextDrawInfo;
aTextDrawInfo.version=0;
@@ -919,7 +921,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_SPINBOX:
+ case ControlType::Spinbox:
{
if(nPart == PART_ENTIRE_CONTROL)
{
@@ -945,7 +947,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
if(nState & ControlState::FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal);
//buttons:
- const SpinbuttonValue* pSpinButtonVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue*>(&aValue) : nullptr;
+ const SpinbuttonValue* pSpinButtonVal = (aValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue*>(&aValue) : nullptr;
ControlState nUpperState = ControlState::ENABLED;//state of the upper button
ControlState nLowerState = ControlState::ENABLED;//and of the lower button
if(pSpinButtonVal) {//pSpinButtonVal is sometimes null
@@ -1002,7 +1004,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_FRAME:
+ case ControlType::Frame:
{
DrawFrameFlags nStyle = static_cast<DrawFrameFlags>(aValue.getNumericVal());
if( nPart == PART_BORDER ) {
@@ -1036,13 +1038,13 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_LISTNET:
+ case ControlType::ListNet:
{
//do nothing as there isn't net for listviews on macos
bOK=true;
}
break;
-
+ default: break;
}
CGContextRestoreGState( mrContext );
@@ -1054,7 +1056,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
(the background is always drawn as a whole since we don't know anything
about its possible contents)
*/
- if( nType == CTRL_WINDOW_BACKGROUND )
+ if( nType == ControlType::WindowBackground )
{
CGRect aRect = { { 0, 0 }, { 0, 0 } };
if( mxClipPath )
@@ -1100,7 +1102,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
switch (nType)
{
- case CTRL_SLIDER:
+ case ControlType::Slider:
{
if( nPart == PART_THUMB_HORZ )
{
@@ -1119,7 +1121,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
}
break;
- case CTRL_SCROLLBAR:
+ case ControlType::Scrollbar:
{
Rectangle aRect;
if( AquaGetScrollRect( /* m_nScreen */ nPart, aCtrlBoundRect, aRect ) )
@@ -1131,11 +1133,11 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
}
break;
- case CTRL_PUSHBUTTON:
- case CTRL_RADIOBUTTON:
- case CTRL_CHECKBOX:
+ case ControlType::Pushbutton:
+ case ControlType::Radiobutton:
+ case ControlType::Checkbox:
{
- if ( nType == CTRL_PUSHBUTTON )
+ if ( nType == ControlType::Pushbutton )
{
w = aCtrlBoundRect.GetWidth();
h = aCtrlBoundRect.GetHeight();
@@ -1157,7 +1159,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
toReturn = true;
}
break;
- case CTRL_PROGRESS:
+ case ControlType::Progress:
{
Rectangle aRect( aCtrlBoundRect );
if( aRect.GetHeight() < 16 )
@@ -1170,7 +1172,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
}
break;
- case CTRL_INTROPROGRESS:
+ case ControlType::IntroProgress:
{
Rectangle aRect( aCtrlBoundRect );
aRect.Bottom() = aRect.Top() + INTRO_PROGRESS_HEIGHT; // values taken from HIG for medium progress
@@ -1180,7 +1182,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
}
break;
- case CTRL_TAB_ITEM:
+ case ControlType::TabItem:
w = aCtrlBoundRect.GetWidth() + 2*TAB_TEXT_OFFSET - 2*VCL_TAB_TEXT_OFFSET;
h = TAB_HEIGHT_NORMAL+2;
@@ -1192,7 +1194,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
break;
- case CTRL_EDITBOX:
+ case ControlType::Editbox:
{
w = aCtrlBoundRect.GetWidth();
if( w < 3+2*FOCUS_RING_WIDTH )
@@ -1207,8 +1209,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
toReturn = true;
}
break;
- case CTRL_LISTBOX:
- case CTRL_COMBOBOX:
+ case ControlType::Listbox:
+ case ControlType::Combobox:
{
if( nPart == PART_ENTIRE_CONTROL )
{
@@ -1246,7 +1248,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
y += 2; // don't draw into upper border
y += FOCUS_RING_WIDTH;
w -= 3 + DROPDOWN_BUTTON_WIDTH + 2*FOCUS_RING_WIDTH;
- if( nType == CTRL_LISTBOX )
+ if( nType == ControlType::Listbox )
w -= 9; // HIG specifies 9 units distance between dropdown button area and content
h -= 4; // don't draw into lower border
@@ -1257,7 +1259,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
}
}
break;
- case CTRL_SPINBOX:
+ case ControlType::Spinbox:
if( nPart == PART_ENTIRE_CONTROL ) {
w = aCtrlBoundRect.GetWidth();
if( w < 3+2*FOCUS_RING_WIDTH+SPIN_BUTTON_SPACE+SPIN_BUTTON_WIDTH )
@@ -1308,7 +1310,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
toReturn = true;
}
break;
- case CTRL_FRAME:
+ case ControlType::Frame:
{
DrawFrameStyle nStyle = static_cast<DrawFrameStyle>(aValue.getNumericVal() & 0x000f);
DrawFrameFlags nFlags = static_cast<DrawFrameFlags>(aValue.getNumericVal() & 0xfff0);
@@ -1339,8 +1341,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
}
break;
- case CTRL_MENUBAR:
- case CTRL_MENU_POPUP:
+ case ControlType::Menubar:
+ case ControlType::MenuPopup:
{
if(( nPart == PART_MENU_ITEM_CHECK_MARK )||( nPart == PART_MENU_ITEM_RADIO_MARK )) {
@@ -1354,6 +1356,7 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
}
}
break;
+ default: break;
}
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 9b72256..f979155 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -284,7 +284,7 @@ void HelpTextWindow::ApplySettings(vcl::RenderContext& rRenderContext)
rRenderContext.SetTextColor(rStyleSettings.GetHelpTextColor());
rRenderContext.SetTextAlign(ALIGN_TOP);
- if (rRenderContext.IsNativeControlSupported(CTRL_TOOLTIP, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::Tooltip, PART_ENTIRE_CONTROL))
{
EnableChildTransparentMode();
SetParentClipMode(ParentClipMode::NoClip);
@@ -369,12 +369,12 @@ void HelpTextWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle&
{
// paint native background
bool bNativeOK = false;
- if (rRenderContext.IsNativeControlSupported(CTRL_TOOLTIP, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::Tooltip, PART_ENTIRE_CONTROL))
{
// #i46472# workaround gcc3.3 temporary problem
Rectangle aCtrlRegion(Point(0, 0), GetOutputSizePixel());
ImplControlValue aControlValue;
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_TOOLTIP, PART_ENTIRE_CONTROL, aCtrlRegion,
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Tooltip, PART_ENTIRE_CONTROL, aCtrlRegion,
ControlState::NONE, aControlValue, OUString());
}
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 75e92e5..cef59a4 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -701,7 +701,7 @@ void PushButton::ImplInitSettings( bool bFont,
// #i38498#: do not check for GetParent()->IsChildTransparentModeEnabled()
// otherwise the formcontrol button will be overdrawn due to ParentClipMode::NoClip
// for radio and checkbox this is ok as they should appear transparent in documents
- if ( IsNativeControlSupported( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL ) ||
+ if ( IsNativeControlSupported( ControlType::Pushbutton, PART_ENTIRE_CONTROL ) ||
(GetStyle() & WB_FLATBUTTON) != 0 )
{
EnableChildTransparentMode();
@@ -840,7 +840,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl
if ( nDrawFlags & DrawFlags::Mono )
aColor = Color( COL_BLACK );
- else if( (nDrawFlags & DrawFlags::NoRollover) && IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL) )
+ else if( (nDrawFlags & DrawFlags::NoRollover) && IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL) )
aColor = rStyleSettings.GetButtonRolloverTextColor();
else if ( IsControlForeground() )
aColor = GetControlForeground();
@@ -949,13 +949,13 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
nButtonStyle |= DrawButtonFlags::Pressed;
// TODO: move this to Window class or make it a member !!!
- ControlType aCtrlType = 0;
+ ControlType aCtrlType = ControlType::Generic;
switch(GetParent()->GetType())
{
case WINDOW_LISTBOX:
case WINDOW_MULTILISTBOX:
case WINDOW_TREELISTBOX:
- aCtrlType = CTRL_LISTBOX;
+ aCtrlType = ControlType::Listbox;
break;
case WINDOW_COMBOBOX:
@@ -966,7 +966,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
case WINDOW_DATEBOX:
case WINDOW_TIMEBOX:
case WINDOW_LONGCURRENCYBOX:
- aCtrlType = CTRL_COMBOBOX;
+ aCtrlType = ControlType::Combobox;
break;
default:
break;
@@ -974,12 +974,12 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
bool bDropDown = (IsSymbol() && (GetSymbol() == SymbolType::SPIN_DOWN) && GetText().isEmpty());
- if( bDropDown && (aCtrlType == CTRL_COMBOBOX || aCtrlType == CTRL_LISTBOX))
+ if( bDropDown && (aCtrlType == ControlType::Combobox || aCtrlType == ControlType::Listbox))
{
if (GetParent()->IsNativeControlSupported(aCtrlType, PART_ENTIRE_CONTROL))
{
// skip painting if the button was already drawn by the theme
- if (aCtrlType == CTRL_COMBOBOX)
+ if (aCtrlType == ControlType::Combobox)
{
Edit* pEdit = static_cast<Edit*>(GetParent());
if (pEdit->ImplUseNativeBorder(rRenderContext, pEdit->GetStyle()))
@@ -993,7 +993,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
if (!bNativeOK && GetParent()->IsNativeControlSupported(aCtrlType, PART_BUTTON_DOWN))
{
// let the theme draw it, note we then need support
- // for CTRL_LISTBOX/PART_BUTTON_DOWN and CTRL_COMBOBOX/PART_BUTTON_DOWN
+ // for ControlType::Listbox/PART_BUTTON_DOWN and ControlType::Combobox/PART_BUTTON_DOWN
ImplControlValue aControlValue;
ControlState nState = ControlState::NONE;
@@ -1028,7 +1028,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
if (!bRollOver && !HasFocus())
bDrawMenuSep = false;
}
- if ((bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)))
+ if ((bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL)))
{
PushButtonValue aControlValue;
Rectangle aCtrlRegion(aInRect);
@@ -1072,7 +1072,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
if (((nState & ControlState::ROLLOVER)) || !(GetStyle() & WB_FLATBUTTON))
{
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Pushbutton, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
aControlValue, OUString() /*PushButton::GetText()*/);
}
else
@@ -1123,7 +1123,7 @@ void PushButton::ImplSetDefButton( bool bSet )
int dLeft(0), dRight(0), dTop(0), dBottom(0);
bool bSetPos = false;
- if ( IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL) )
+ if ( IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL) )
{
Rectangle aBound, aCont;
Rectangle aCtrlRect( 0, 0, 80, 20 ); // use a constant size to avoid accumulating
@@ -1134,7 +1134,7 @@ void PushButton::ImplSetDefButton( bool bSet )
// get native size of a 'default' button
// and adjust the VCL button if more space for adornment is required
- if( GetNativeControlRegion( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
+ if( GetNativeControlRegion( ControlType::Pushbutton, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, OUString(),
aBound, aCont ) )
{
@@ -1494,13 +1494,13 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt )
// trigger redraw as mouse over state has changed
// TODO: move this to Window class or make it a member !!!
- ControlType aCtrlType = 0;
+ ControlType aCtrlType = ControlType::Generic;
switch( GetParent()->GetType() )
{
case WINDOW_LISTBOX:
case WINDOW_MULTILISTBOX:
case WINDOW_TREELISTBOX:
- aCtrlType = CTRL_LISTBOX;
+ aCtrlType = ControlType::Listbox;
break;
case WINDOW_COMBOBOX:
@@ -1511,7 +1511,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt )
case WINDOW_DATEBOX:
case WINDOW_TIMEBOX:
case WINDOW_LONGCURRENCYBOX:
- aCtrlType = CTRL_COMBOBOX;
+ aCtrlType = ControlType::Combobox;
break;
default:
break;
@@ -1523,7 +1523,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt )
!GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN) )
{
vcl::Window *pBorder = GetParent()->GetWindow( GetWindowType::Border );
- if(aCtrlType == CTRL_COMBOBOX)
+ if(aCtrlType == ControlType::Combobox)
{
// only paint the button part to avoid flickering of the combobox text
Point aPt;
@@ -1538,7 +1538,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt )
}
}
else if( (GetStyle() & WB_FLATBUTTON) ||
- IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL) )
+ IsNativeControlSupported(ControlType::Pushbutton, PART_ENTIRE_CONTROL) )
{
Invalidate();
}
@@ -1685,11 +1685,11 @@ bool PushButton::set_property(const OString &rKey, const OString &rValue)
void PushButton::ShowFocus(const Rectangle& rRect)
{
- if (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_FOCUS))
+ if (IsNativeControlSupported(ControlType::Pushbutton, PART_FOCUS))
{
ImplControlValue aControlValue;
Rectangle aInRect(Point(), GetOutputSizePixel());
- GetOutDev()->DrawNativeControl(CTRL_PUSHBUTTON, PART_FOCUS, aInRect,
+ GetOutDev()->DrawNativeControl(ControlType::Pushbutton, PART_FOCUS, aInRect,
ControlState::FOCUSED, aControlValue, OUString());
}
Button::ShowFocus(rRect);
@@ -1869,13 +1869,13 @@ void RadioButton::ImplInitSettings( bool bFont,
{
vcl::Window* pParent = GetParent();
if ( !IsControlBackground() &&
- (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) ) )
+ (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( ControlType::Radiobutton, PART_ENTIRE_CONTROL ) ) )
{
EnableChildTransparentMode();
SetParentClipMode( ParentClipMode::NoClip );
SetPaintTransparent( true );
SetBackground();
- if( IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) )
+ if( IsNativeControlSupported( ControlType::Radiobutton, PART_ENTIRE_CONTROL ) )
mpWindowImpl->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
@@ -1902,7 +1902,7 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext)
bool bNativeOK = false;
// no native drawing for image radio buttons
- if (!maImage && (bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)))
+ if (!maImage && (bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Radiobutton, PART_ENTIRE_CONTROL)))
{
ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
Rectangle aCtrlRect(maStateRect.TopLeft(), maStateRect.GetSize());
@@ -1920,7 +1920,7 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext)
if (IsMouseOver() && maMouseRect.IsInside(GetPointerPosPixel()))
nState |= ControlState::ROLLOVER;
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRect,
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Radiobutton, PART_ENTIRE_CONTROL, aCtrlRect,
nState, aControlValue, OUString());
}
@@ -2618,7 +2618,7 @@ bool RadioButton::PreNotify( NotifyEvent& rNEvt )
if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() )
{
// trigger redraw if mouse over state has changed
- if( IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL) )
+ if( IsNativeControlSupported(ControlType::Radiobutton, PART_ENTIRE_CONTROL) )
{
if( ( maMouseRect.IsInside( GetPointerPosPixel()) &&
!maMouseRect.IsInside( GetLastPointerPosPixel()) ) ||
@@ -2741,7 +2741,7 @@ Size RadioButton::ImplGetRadioImageSize() const
{
Size aSize;
bool bDefaultSize = true;
- if( IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) )
+ if( IsNativeControlSupported( ControlType::Radiobutton, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aControlValue;
// #i45896# workaround gcc3.3 temporary problem
@@ -2750,7 +2750,7 @@ Size RadioButton::ImplGetRadioImageSize() const
Rectangle aBoundingRgn, aContentRgn;
// get native size of a radio button
- if( GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
+ if( GetNativeControlRegion( ControlType::Radiobutton, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, OUString(),
aBoundingRgn, aContentRgn ) )
{
@@ -2857,7 +2857,7 @@ void RadioButton::ImplSetMinimumNWFSize()
Rectangle aBoundingRgn, aContentRgn;
// get native size of a radiobutton
- if( GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
+ if( GetNativeControlRegion( ControlType::Radiobutton, PART_ENTIRE_CONTROL, aCtrlRegion,
ControlState::DEFAULT|ControlState::ENABLED, aControlValue, OUString(),
aBoundingRgn, aContentRgn ) )
{
@@ -2921,7 +2921,7 @@ Size RadioButton::GetOptimalSize() const
void RadioButton::ShowFocus(const Rectangle& rRect)
{
- if (IsNativeControlSupported(CTRL_RADIOBUTTON, PART_FOCUS))
+ if (IsNativeControlSupported(ControlType::Radiobutton, PART_FOCUS))
{
ImplControlValue aControlValue;
Rectangle aInRect(Point(0, 0), GetSizePixel());
@@ -2934,7 +2934,7 @@ void RadioButton::ShowFocus(const Rectangle& rRect)
aInRect.Top()-=2;
aInRect.Bottom()+=2;
- DrawNativeControl(CTRL_RADIOBUTTON, PART_FOCUS, aInRect,
+ DrawNativeControl(ControlType::Radiobutton, PART_FOCUS, aInRect,
ControlState::FOCUSED, aControlValue, OUString());
}
Button::ShowFocus(rRect);
@@ -2984,13 +2984,13 @@ void CheckBox::ImplInitSettings( bool bFont,
{
vcl::Window* pParent = GetParent();
if ( !IsControlBackground() &&
- (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) ) )
+ (pParent->IsChildTransparentModeEnabled() || IsNativeControlSupported( ControlType::Checkbox, PART_ENTIRE_CONTROL ) ) )
{
EnableChildTransparentMode();
SetParentClipMode( ParentClipMode::NoClip );
SetPaintTransparent( true );
SetBackground();
- if( IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) )
+ if( IsNativeControlSupported( ControlType::Checkbox, PART_ENTIRE_CONTROL ) )
ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
@@ -3021,7 +3021,7 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
{
bool bNativeOK = true;
- if ((bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)))
+ if ((bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Checkbox, PART_ENTIRE_CONTROL)))
{
ImplControlValue aControlValue(meState == TRISTATE_TRUE ? BUTTONVALUE_ON : BUTTONVALUE_OFF);
Rectangle aCtrlRegion(maStateRect);
@@ -3044,7 +3044,7 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
if (IsMouseOver() && maMouseRect.IsInside(GetPointerPosPixel()))
nState |= ControlState::ROLLOVER;
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Checkbox, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, OUString());
}
@@ -3555,7 +3555,7 @@ bool CheckBox::PreNotify( NotifyEvent& rNEvt )
if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() )
{
// trigger redraw if mouse over state has changed
- if( IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL) )
+ if( IsNativeControlSupported(ControlType::Checkbox, PART_ENTIRE_CONTROL) )
{
if( ( maMouseRect.IsInside( GetPointerPosPixel()) &&
!maMouseRect.IsInside( GetLastPointerPosPixel()) ) ||
@@ -3621,7 +3621,7 @@ Size CheckBox::ImplGetCheckImageSize() const
{
Size aSize;
bool bDefaultSize = true;
- if( IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) )
+ if( IsNativeControlSupported( ControlType::Checkbox, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aControlValue;
// #i45896# workaround gcc3.3 temporary problem
@@ -3630,7 +3630,7 @@ Size CheckBox::ImplGetCheckImageSize() const
Rectangle aBoundingRgn, aContentRgn;
// get native size of a check box
- if( GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
+ if( GetNativeControlRegion( ControlType::Checkbox, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, OUString(),
aBoundingRgn, aContentRgn ) )
{
@@ -3716,7 +3716,7 @@ void CheckBox::ImplSetMinimumNWFSize()
Rectangle aBoundingRgn, aContentRgn;
// get native size of a radiobutton
- if( GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
+ if( GetNativeControlRegion( ControlType::Checkbox, PART_ENTIRE_CONTROL, aCtrlRegion,
ControlState::DEFAULT|ControlState::ENABLED, aControlValue, OUString(),
aBoundingRgn, aContentRgn ) )
{
@@ -3772,7 +3772,7 @@ Size CheckBox::GetOptimalSize() const
void CheckBox::ShowFocus(const Rectangle& rRect)
{
- if (IsNativeControlSupported(CTRL_CHECKBOX, PART_FOCUS))
+ if (IsNativeControlSupported(ControlType::Checkbox, PART_FOCUS))
{
ImplControlValue aControlValue;
Rectangle aInRect(Point(0, 0), GetSizePixel());
@@ -3785,7 +3785,7 @@ void CheckBox::ShowFocus(const Rectangle& rRect)
aInRect.Top()-=2;
aInRect.Bottom()+=2;
- DrawNativeControl(CTRL_CHECKBOX, PART_FOCUS, aInRect,
+ DrawNativeControl(ControlType::Checkbox, PART_FOCUS, aInRect,
ControlState::FOCUSED, aControlValue, OUString());
}
Button::ShowFocus(rRect);
@@ -3852,7 +3852,7 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
will fit into the rectangle occupied by a normal checkbox on all themes.
If this does not hold true for some theme, ImplGetCheckImageSize
would have to be overridden for DisclosureButton; also GetNativeControlRegion
- for CTRL_LISTNODE would have to be implemented and taken into account
+ for ControlType::ListNode would have to be implemented and taken into account
*/
Rectangle aStateRect(GetStateRect());
@@ -3870,7 +3870,7 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
if (IsMouseOver() && GetMouseRect().IsInside(GetPointerPosPixel()))
nState |= ControlState::ROLLOVER;
- if (!rRenderContext.DrawNativeControl(CTRL_LISTNODE, PART_ENTIRE_CONTROL, aCtrlRegion,
+ if (!rRenderContext.DrawNativeControl(ControlType::ListNode, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, OUString()))
{
ImplSVCtrlData& rCtrlData(ImplGetSVData()->maCtrlData);
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 3bd8197..c9f24b0 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -168,7 +168,7 @@ void ComboBox::ImplCalcEditHeight()
Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) );
Rectangle aBoundRegion, aContentRegion;
ImplControlValue aControlValue;
- ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX;
+ ControlType aType = IsDropDownBox() ? ControlType::Combobox : ControlType::Editbox;
if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL,
aCtrlRegion,
ControlState::ENABLED,
@@ -1069,7 +1069,7 @@ long ComboBox::getMaxWidthScrollBarAndDownButton() const
// use the full extent of the control
Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
- if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_BUTTON_DOWN,
+ if ( GetNativeControlRegion(ControlType::Combobox, PART_BUTTON_DOWN,
aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
{
nButtonDownWidth = aContent.getWidth();
@@ -1507,7 +1507,7 @@ ComboBoxBounds ComboBox::Impl::calcComboBoxDropDownComponentBounds(
// use the full extent of the control
Rectangle aArea( aPoint, rBorderOutSz );
- if (m_rThis.GetNativeControlRegion(CTRL_COMBOBOX, PART_BUTTON_DOWN,
+ if (m_rThis.GetNativeControlRegion(ControlType::Combobox, PART_BUTTON_DOWN,
aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
{
// convert back from border space to local coordinates
@@ -1518,7 +1518,7 @@ ComboBoxBounds ComboBox::Impl::calcComboBoxDropDownComponentBounds(
aBounds.aButtonSize = Size(aContent.getWidth(), (nBottom-nTop));
// adjust the size of the edit field
- if (m_rThis.GetNativeControlRegion(CTRL_COMBOBOX, PART_SUB_EDIT,
+ if (m_rThis.GetNativeControlRegion(ControlType::Combobox, PART_SUB_EDIT,
aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
{
// convert back from border space to local coordinates
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index aab72e8..7174c75 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -443,8 +443,8 @@ long Edit::ImplGetExtraXOffset() const
long Edit::ImplGetExtraYOffset() const
{
long nExtraOffset = 0;
- int eCtrlType = ImplGetNativeControlType();
- if (eCtrlType != CTRL_EDITBOX_NOBORDER)
+ ControlType eCtrlType = ImplGetNativeControlType();
+ if (eCtrlType != ControlType::EditboxNoBorder)
{
// add some space between text entry and border
nExtraOffset = 2;
@@ -951,9 +951,9 @@ void Edit::ImplSetText( const OUString& rText, const Selection* pNewSelection )
}
}
-int Edit::ImplGetNativeControlType() const
+ControlType Edit::ImplGetNativeControlType() const
{
- int nCtrl = 0;
+ ControlType nCtrl = ControlType::Generic;
const vcl::Window* pControl = mbIsSubEdit ? GetParent() : this;
switch (pControl->GetType())
@@ -966,14 +966,14 @@ int Edit::ImplGetNativeControlType() const
case WINDOW_DATEBOX:
case WINDOW_TIMEBOX:
case WINDOW_LONGCURRENCYBOX:
- nCtrl = CTRL_COMBOBOX;
+ nCtrl = ControlType::Combobox;
break;
case WINDOW_MULTILINEEDIT:
if ( GetWindow( GetWindowType::Border ) != this )
- nCtrl = CTRL_MULTILINE_EDITBOX;
+ nCtrl = ControlType::MultilineEditbox;
else
- nCtrl = CTRL_EDITBOX_NOBORDER;
+ nCtrl = ControlType::EditboxNoBorder;
break;
case WINDOW_EDIT:
@@ -986,18 +986,18 @@ int Edit::ImplGetNativeControlType() const
case WINDOW_NUMERICFIELD:
case WINDOW_SPINFIELD:
if (pControl->GetStyle() & WB_SPIN)
- nCtrl = CTRL_SPINBOX;
+ nCtrl = ControlType::Spinbox;
else
{
if (GetWindow(GetWindowType::Border) != this)
- nCtrl = CTRL_EDITBOX;
+ nCtrl = ControlType::Editbox;
else
- nCtrl = CTRL_EDITBOX_NOBORDER;
+ nCtrl = ControlType::EditboxNoBorder;
}
break;
default:
- nCtrl = CTRL_EDITBOX;
+ nCtrl = ControlType::Editbox;
}
return nCtrl;
}
@@ -1925,7 +1925,7 @@ void Edit::GetFocus()
// check for other platforms that need similar handling
if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
IsNativeWidgetEnabled() &&
- IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) )
+ IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) )
{
ImplInvalidateOutermostBorder( mbIsSubEdit ? GetParent() : this );
}
@@ -1959,7 +1959,7 @@ void Edit::LoseFocus()
// check for other platforms that need similar handling
if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
IsNativeWidgetEnabled() &&
- IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) )
+ IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) )
{
ImplInvalidateOutermostBorder( mbIsSubEdit ? GetParent() : this );
}
@@ -2400,7 +2400,7 @@ void Edit::Modify()
// check for other platforms that need similar handling
if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
IsNativeWidgetEnabled() &&
- IsNativeControlSupported( CTRL_EDITBOX, PART_ENTIRE_CONTROL ) )
+ IsNativeControlSupported( ControlType::Editbox, PART_ENTIRE_CONTROL ) )
{
ImplInvalidateOutermostBorder( this );
}
@@ -2726,7 +2726,7 @@ void Edit::SetSubEdit(Edit* pEdit)
Size Edit::CalcMinimumSizeForText(const OUString &rString) const
{
- int eCtrlType = ImplGetNativeControlType();
+ ControlType eCtrlType = ImplGetNativeControlType();
Size aSize;
if (mnWidthInChars != -1)
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index d81e5b5..669078b 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -51,8 +51,8 @@ void ImplInitDropDownButton( PushButton* pButton )
{
pButton->SetSymbol( SymbolType::SPIN_DOWN );
- if ( pButton->IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL)
- && ! pButton->IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) )
+ if ( pButton->IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL)
+ && ! pButton->IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) )
pButton->SetBackground();
}
@@ -2572,8 +2572,8 @@ void ImplListBox::SetEdgeBlending(bool bNew)
ImplWin::ImplWin( vcl::Window* pParent, WinBits nWinStyle ) :
Control ( pParent, nWinStyle )
{
- if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL)
- && ! IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) )
+ if ( IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL)
+ && ! IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) )
SetBackground();
else
SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) );
@@ -2616,8 +2616,8 @@ bool ImplWin::PreNotify( NotifyEvent& rNEvt )
if( pMouseEvt->IsEnterWindow() || pMouseEvt->IsLeaveWindow() )
{
// trigger redraw as mouse over state has changed
- if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL)
- && ! IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) )
+ if ( IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL)
+ && ! IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) )
{
GetParent()->GetWindow( GetWindowType::Border )->Invalidate( InvalidateFlags::NoErase );
GetParent()->GetWindow( GetWindowType::Border )->Update();
@@ -2637,8 +2637,8 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
bool bNativeOK = false;
ControlState nState = ControlState::ENABLED;
- if (rRenderContext.IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL)
- && rRenderContext.IsNativeControlSupported(CTRL_LISTBOX, HAS_BACKGROUND_TEXTURE) )
+ if (rRenderContext.IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL)
+ && rRenderContext.IsNativeControlSupported(ControlType::Listbox, HAS_BACKGROUND_TEXTURE) )
{
// Repaint the (focused) area similarly to
// ImplSmallBorderWindowView::DrawWindow() in
@@ -2676,11 +2676,11 @@ void ImplWin::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
if( ! (nParentStyle & WB_BORDER) || (nParentStyle & WB_NOBORDER) )
{
Rectangle aParentRect( Point( 0, 0 ), pWin->GetSizePixel() );
- pWin->DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aParentRect,
+ pWin->DrawNativeControl( ControlType::Listbox, PART_ENTIRE_CONTROL, aParentRect,
nState, aControlValue, OUString() );
}
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_LISTBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Listbox, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, OUString());
}
@@ -2847,7 +2847,7 @@ void ImplWin::GetFocus()
ShowFocus( maFocusRect );
if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
IsNativeWidgetEnabled() &&
- IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) )
+ IsNativeControlSupported( ControlType::Listbox, PART_ENTIRE_CONTROL ) )
{
vcl::Window* pWin = GetParent()->GetWindow( GetWindowType::Border );
if( ! pWin )
@@ -2864,7 +2864,7 @@ void ImplWin::LoseFocus()
HideFocus();
if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
IsNativeWidgetEnabled() &&
- IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) )
+ IsNativeControlSupported( ControlType::Listbox, PART_ENTIRE_CONTROL ) )
{
vcl::Window* pWin = GetParent()->GetWindow( GetWindowType::Border );
if( ! pWin )
@@ -2878,13 +2878,13 @@ void ImplWin::LoseFocus()
void ImplWin::ShowFocus(const Rectangle& rRect)
{
- if (IsNativeControlSupported(CTRL_LISTBOX, PART_FOCUS))
+ if (IsNativeControlSupported(ControlType::Listbox, PART_FOCUS))
{
ImplControlValue aControlValue;
vcl::Window *pWin = GetParent();
Rectangle aParentRect(Point(0, 0), pWin->GetSizePixel());
- pWin->DrawNativeControl(CTRL_LISTBOX, PART_FOCUS, aParentRect,
+ pWin->DrawNativeControl(ControlType::Listbox, PART_FOCUS, aParentRect,
ControlState::FOCUSED, aControlValue, OUString());
}
Control::ShowFocus(rRect);
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index f5d0dad..3492881 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -115,13 +115,13 @@ void ListBox::ImplInit( vcl::Window* pParent, WinBits nStyle )
mnDDHeight = (sal_uInt16)(GetTextHeight() + nTop + nBottom + 4);
if( IsNativeWidgetEnabled() &&
- IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) )
+ IsNativeControlSupported( ControlType::Listbox, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aControlValue;
Rectangle aCtrlRegion( Point( 0, 0 ), Size( 20, mnDDHeight ) );
Rectangle aBoundingRgn( aCtrlRegion );
Rectangle aContentRgn( aCtrlRegion );
- if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
+ if( GetNativeControlRegion( ControlType::Listbox, PART_ENTIRE_CONTROL, aCtrlRegion,
ControlState::ENABLED, aControlValue, OUString(),
aBoundingRgn, aContentRgn ) )
{
@@ -619,7 +619,7 @@ void ListBox::Resize()
// Use the full extent of the control
Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
- if ( GetNativeControlRegion( CTRL_LISTBOX, PART_BUTTON_DOWN,
+ if ( GetNativeControlRegion( ControlType::Listbox, PART_BUTTON_DOWN,
aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
{
long nTop = 0;
@@ -632,7 +632,7 @@ void ListBox::Resize()
mpBtn->setPosSizePixel( aContent.Left(), nTop, aContent.Right(), (nBottom-nTop) );
// Adjust the size of the edit field
- if ( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT,
+ if ( GetNativeControlRegion( ControlType::Listbox, PART_SUB_EDIT,
aArea, ControlState::NONE, aControlValue, OUString(), aBound, aContent) )
{
// Convert back from border space to local coordinates
@@ -768,8 +768,8 @@ void ListBox::StateChanged( StateChangedType nType )
if( mpImplWin )
{
mpImplWin->Enable( IsEnabled() );
- if ( IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL)
- && ! IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) )
+ if ( IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL)
+ && ! IsNativeControlSupported(ControlType::Listbox, PART_BUTTON_DOWN) )
{
GetWindow( GetWindowType::Border )->Invalidate( InvalidateFlags::NoErase );
}
@@ -821,7 +821,7 @@ void ListBox::StateChanged( StateChangedType nType )
mpImplLB->SetControlBackground( GetControlBackground() );
if ( mpImplWin )
{
- if ( mpImplWin->IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) )
+ if ( mpImplWin->IsNativeControlSupported(ControlType::Listbox, PART_ENTIRE_CONTROL) )
{
// Transparent background
mpImplWin->SetBackground();
@@ -1221,7 +1221,7 @@ Size ListBox::CalcMinimumSize() const
Rectangle aContent, aBound;
Size aTestSize( 100, 20 );
Rectangle aArea( aPoint, aTestSize );
- if( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT, aArea, ControlState::NONE,
+ if( GetNativeControlRegion( ControlType::Listbox, PART_SUB_EDIT, aArea, ControlState::NONE,
aControlValue, OUString(), aBound, aContent) )
{
// use the themes drop down size
@@ -1238,7 +1238,7 @@ Size ListBox::CalcMinimumSize() const
ImplControlValue aControlValue;
Rectangle aRect( Point( 0, 0 ), aSz );
Rectangle aContent, aBound;
- if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aRect, ControlState::NONE,
+ if( GetNativeControlRegion( ControlType::Listbox, PART_ENTIRE_CONTROL, aRect, ControlState::NONE,
aControlValue, OUString(), aBound, aContent) )
{
if( aBound.GetHeight() > aSz.Height() )
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index 9f8f303..a2963e4 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -39,7 +39,7 @@ static WinBits clearProgressBarBorder( vcl::Window* pParent, WinBits nOrgStyle )
WinBits nOutStyle = nOrgStyle;
if( pParent && (nOrgStyle & WB_BORDER) != 0 )
{
- if( pParent->IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
+ if( pParent->IsNativeControlSupported( ControlType::Progress, PART_ENTIRE_CONTROL ) )
nOutStyle &= WB_BORDER;
}
return nOutStyle;
@@ -76,7 +76,7 @@ void ProgressBar::ImplInitSettings( bool bFont,
if ( bBackground )
{
if( !IsControlBackground() &&
- IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
+ IsNativeControlSupported( ControlType::Progress, PART_ENTIRE_CONTROL ) )
{
if( (GetStyle() & WB_BORDER) )
SetBorderStyle( WindowBorderStyle::REMOVEBORDER );
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index fa68c42..eee34fc 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -200,7 +200,7 @@ void ScrollBar::ImplUpdateRects( bool bUpdate )
}
}
- if( !IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL) )
+ if( !IsNativeControlSupported(ControlType::Scrollbar, PART_ENTIRE_CONTROL) )
{
// disable scrollbar buttons only in VCL's own 'theme'
// as it is uncommon on other platforms
@@ -260,9 +260,9 @@ void ScrollBar::ImplCalc( bool bUpdate )
if ( GetStyle() & WB_HORZ )
{
- if ( GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT,
+ if ( GetNativeControlRegion( ControlType::Scrollbar, IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT,
aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) &&
- GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT,
+ GetNativeControlRegion( ControlType::Scrollbar, IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT,
aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) )
{
maBtn1Rect = aBtn1Region;
@@ -277,7 +277,7 @@ void ScrollBar::ImplCalc( bool bUpdate )
maBtn2Rect.SetSize( aBtnSize );
}
- if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_HORZ_AREA,
+ if ( GetNativeControlRegion( ControlType::Scrollbar, PART_TRACK_HORZ_AREA,
aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) )
aTrackRect = aTrackRegion;
else
@@ -301,9 +301,9 @@ void ScrollBar::ImplCalc( bool bUpdate )
}
else
{
- if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_UP,
+ if ( GetNativeControlRegion( ControlType::Scrollbar, PART_BUTTON_UP,
aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn1Region ) &&
- GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_DOWN,
+ GetNativeControlRegion( ControlType::Scrollbar, PART_BUTTON_DOWN,
aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aBtn2Region ) )
{
maBtn1Rect = aBtn1Region;
@@ -318,7 +318,7 @@ void ScrollBar::ImplCalc( bool bUpdate )
maBtn2Rect.SetSize( aBtnSize );
}
- if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_VERT_AREA,
+ if ( GetNativeControlRegion( ControlType::Scrollbar, PART_TRACK_VERT_AREA,
aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) )
aTrackRect = aTrackRegion;
else
@@ -439,14 +439,14 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD
{
ScrollbarValue scrValue;
- bool bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL);
+ bool bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, PART_ENTIRE_CONTROL);
if (!bNativeOK)
return false;
bool bHorz = (GetStyle() & WB_HORZ) != 0;
// Draw the entire background if the control supports it
- if (rRenderContext.IsNativeControlSupported(CTRL_SCROLLBAR, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT))
+ if (rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT))
{
ControlState nState = (IsEnabled() ? ControlState::ENABLED : ControlState::NONE)
| (HasFocus() ? ControlState::FOCUSED : ControlState::NONE);
@@ -504,7 +504,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD
rRenderContext.DrawRect(aRequestedRegion);
}
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT),
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT),
aCtrlRegion, nState, scrValue, OUString());
}
else
@@ -535,10 +535,10 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD
}
if (nDrawFlags & SCRBAR_DRAW_PAGE1)
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1, scrValue, OUString());
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part1, aCtrlRegion1, nState1, scrValue, OUString());
if (nDrawFlags & SCRBAR_DRAW_PAGE2)
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2, scrValue, OUString());
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part2, aCtrlRegion2, nState2, scrValue, OUString());
}
if ((nDrawFlags & SCRBAR_DRAW_BTN1) || (nDrawFlags & SCRBAR_DRAW_BTN2))
{
@@ -575,10 +575,10 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD
}
if (nDrawFlags & SCRBAR_DRAW_BTN1)
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1, scrValue, OUString());
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part1, aCtrlRegion1, nState1, scrValue, OUString());
if (nDrawFlags & SCRBAR_DRAW_BTN2)
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2, scrValue, OUString());
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, part2, aCtrlRegion2, nState2, scrValue, OUString());
}
if ((nDrawFlags & SCRBAR_DRAW_THUMB) && !maThumbRect.IsEmpty())
{
@@ -601,7 +601,7 @@ bool ScrollBar::ImplDrawNative(vcl::RenderContext& rRenderContext, sal_uInt16 nD
}
}
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_SCROLLBAR, (bHorz ? PART_THUMB_HORZ : PART_THUMB_VERT),
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Scrollbar, (bHorz ? PART_THUMB_HORZ : PART_THUMB_VERT),
aCtrlRegion, nState, scrValue, OUString());
}
}
@@ -626,7 +626,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla
// pWin = static_cast<vcl::Window*>(&rRenderContext);
// Draw the entire control if the native theme engine needs it
- if (nDrawFlags && rRenderContext.IsNativeControlSupported(CTRL_SCROLLBAR, PART_DRAW_BACKGROUND_HORZ))
+ if (nDrawFlags && rRenderContext.IsNativeControlSupported(ControlType::Scrollbar, PART_DRAW_BACKGROUND_HORZ))
{
ImplDrawNative(rRenderContext, SCRBAR_DRAW_BACKGROUND);
return;
@@ -760,7 +760,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction )
switch ( meScrollType )
{
case SCROLL_LINEUP:
- if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP,
+ if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP,
aControlRegion, rMousePos, bIsInside )?
bIsInside:
maBtn1Rect.IsInside( rMousePos ) )
@@ -773,7 +773,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction )
break;
case SCROLL_LINEDOWN:
- if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN,
+ if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN,
aControlRegion, rMousePos, bIsInside )?
bIsInside:
maBtn2Rect.IsInside( rMousePos ) )
@@ -787,7 +787,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction )
case SCROLL_PAGEUP:
// HitTestNativeControl, see remark at top of file
- if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT: PART_TRACK_VERT_UPPER,
+ if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_LEFT: PART_TRACK_VERT_UPPER,
maPage1Rect, rMousePos, bIsInside )?
bIsInside:
maPage1Rect.IsInside( rMousePos ) )
@@ -801,7 +801,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction )
case SCROLL_PAGEDOWN:
// HitTestNativeControl, see remark at top of file
- if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_RIGHT: PART_TRACK_VERT_LOWER,
+ if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_RIGHT: PART_TRACK_VERT_LOWER,
maPage2Rect, rMousePos, bIsInside )?
bIsInside:
maPage2Rect.IsInside( rMousePos ) )
@@ -885,7 +885,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
- if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP,
+ if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP,
aControlRegion, rMousePos, bIsInside )?
bIsInside:
maBtn1Rect.IsInside( rMousePos ) )
@@ -897,7 +897,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
mnDragDraw = SCRBAR_DRAW_BTN1;
}
}
- else if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN,
+ else if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN,
aControlRegion, rMousePos, bIsInside )?
bIsInside:
maBtn2Rect.IsInside( rMousePos ) )
@@ -911,7 +911,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
}
else
{
- bool bThumbHit = HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_THUMB_HORZ : PART_THUMB_VERT,
+ bool bThumbHit = HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_THUMB_HORZ : PART_THUMB_VERT,
maThumbRect, rMousePos, bIsInside )
? bIsInside : maThumbRect.IsInside( rMousePos );
@@ -957,14 +957,14 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
Invalidate();
}
}
- else if(bPage && (!HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA,
+ else if(bPage && (!HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA,
aControlRegion, rMousePos, bIsInside ) ||
bIsInside) )
{
nTrackFlags = StartTrackingFlags::ButtonRepeat;
// HitTestNativeControl, see remark at top of file
- if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
+ if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
maPage1Rect, rMousePos, bIsInside )?
bIsInside:
maPage1Rect.IsInside( rMousePos ) )
@@ -1238,30 +1238,30 @@ Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt )
Point aPoint( 0, 0 );
Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
- if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP,
+ if( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? PART_BUTTON_RIGHT: PART_BUTTON_LEFT): PART_BUTTON_UP,
aControlRegion, rPt, bIsInside )?
bIsInside:
maBtn1Rect.IsInside( rPt ) )
return &maBtn1Rect;
- else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? (IsRTLEnabled()? PART_BUTTON_LEFT: PART_BUTTON_RIGHT): PART_BUTTON_DOWN,
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list