[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - desktop/source include/vcl sc/source svtools/source vcl/osx vcl/source vcl/unx vcl/win
Noel Grandin
noel at peralex.com
Thu Nov 17 09:28:06 UTC 2016
desktop/source/splash/splash.cxx | 6
include/vcl/edit.hxx | 2
include/vcl/salnativewidgets.hxx | 243 +++++++---------
sc/source/core/data/document.cxx | 8
sc/source/filter/xml/sheetdata.cxx | 2
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 | 20 -
svtools/source/contnr/treelistbox.cxx | 10
svtools/source/control/headbar.cxx | 14
svtools/source/control/tabbar.cxx | 4
svtools/source/control/toolbarmenu.cxx | 44 +-
vcl/osx/salnativewidgets.cxx | 326 +++++++++++----------
vcl/source/app/help.cxx | 6
vcl/source/control/button.cxx | 104 +++---
vcl/source/control/combobox.cxx | 10
vcl/source/control/edit.cxx | 36 +-
vcl/source/control/imp_listbox.cxx | 28 -
vcl/source/control/listbox.cxx | 18 -
vcl/source/control/prgsbar.cxx | 4
vcl/source/control/scrbar.cxx | 76 ++---
vcl/source/control/slider.cxx | 8
vcl/source/control/spinbtn.cxx | 4
vcl/source/control/spinfld.cxx | 48 +--
vcl/source/control/tabctrl.cxx | 26 -
vcl/source/gdi/salgdilayout.cxx | 11
vcl/source/outdev/nativecontrols.cxx | 18 -
vcl/source/window/brdwin.cxx | 46 +--
vcl/source/window/decoview.cxx | 12
vcl/source/window/dialog.cxx | 8
vcl/source/window/dockingarea.cxx | 14
vcl/source/window/menu.cxx | 54 +--
vcl/source/window/menubarwindow.cxx | 20 -
vcl/source/window/menufloatingwindow.cxx | 14
vcl/source/window/paint.cxx | 4
vcl/source/window/status.cxx | 22 -
vcl/source/window/tabpage.cxx | 8
vcl/source/window/toolbox.cxx | 42 +-
vcl/source/window/window.cxx | 4
vcl/unx/gtk/salnativewidgets-gtk.cxx | 449 +++++++++++++++---------------
vcl/unx/gtk/salprn-gtk.cxx | 2
vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 411 +++++++++++++--------------
vcl/unx/kde/salnativewidgets-kde.cxx | 160 +++++-----
vcl/unx/kde4/KDESalGraphics.cxx | 210 +++++++-------
vcl/win/gdi/salnativewidgets-luna.cxx | 380 ++++++++++++-------------
46 files changed, 1474 insertions(+), 1488 deletions(-)
New commits:
commit aec55b660a0e0348201825f48de02ce069c5b3f3
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 27 16:24:21 2016 +0200
backport various scoped enum conversion to make other backporting safer
Convert ControlType to scoped enum
Reviewed-on: https://gerrit.libreoffice.org/25554
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
(cherry picked from commit 5c977a9ddff3c221c098a57855ede7c0ef4fe31f)
Change-Id: Iaa13c3e7030296a97bab144103745867d43b4b19
Convert ButtonValue to scoped enum
Change-Id: Ia882914fb99844f21ce89d7218321933ef084b22
Reviewed-on: https://gerrit.libreoffice.org/26036
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
(cherry picked from commit 7fb70ff650ce3a1e4a39bd1b936f511d6be8986c)
Convert RenderType to scoped enum
Change-Id: I2f4bb201babc9050b19de2dacc0dea462255dfa2
(cherry picked from commit 8a70742bf395fc2aab6197f04ddbfbd8ee16f263)
remove some unnecessary casting
Change-Id: I451df09db58256fed68ce8537b2d8eb4b6ab6942
Reviewed-on: https://gerrit.libreoffice.org/26184
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
(cherry picked from commit 2ed5fa14f0e7624db241fde26e10fdd1009adfc7)
Convert PART to scoped enum
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>
(cherry picked from commit cf5208b67180dc1deaeca611706087b1e2acc1ae)
Change-Id: If4c2849beb207593d3d450ae3846ed24eaf66ca4
Reviewed-on: https://gerrit.libreoffice.org/30911
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index 9f95e03..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(CTRL_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(CTRL_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(CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
+ if ((rRenderContext.DrawNativeControl(ControlType::IntroProgress, ControlPart::Entire, 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..54b4209 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
+// ControlPart::HasBackgroundTexture, 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:
@@ -145,32 +120,33 @@ typedef sal_uInt32 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
@@ -183,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.
*/
@@ -192,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.
@@ -203,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:
*
@@ -282,21 +259,21 @@ 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:
- if (mnPart == PART_ENTIRE_CONTROL)
+ case ControlType::Menubar:
+ if (mnPart == ControlPart::Entire)
return false;
break;
@@ -313,11 +290,11 @@ public:
* that buttons allow
*/
-enum ButtonValue {
- BUTTONVALUE_DONTKNOW,
- BUTTONVALUE_ON,
- BUTTONVALUE_OFF,
- BUTTONVALUE_MIXED
+enum class ButtonValue {
+ DontKnow,
+ On,
+ Off,
+ Mixed
};
/* ImplControlValue:
@@ -336,17 +313,17 @@ class VCL_DLLPUBLIC ImplControlValue
protected:
ImplControlValue( ControlType i_eType, long i_nNumber )
: mType( i_eType )
- , mTristate( BUTTONVALUE_DONTKNOW )
+ , mTristate( ButtonValue::DontKnow )
, mNumber( i_nNumber )
{}
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) {}
- inline ImplControlValue()
- : mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber(0) {}
+ : mType( ControlType::Generic ), mTristate(ButtonValue::DontKnow), mNumber( nNumeric) {}
+ ImplControlValue()
+ : mType( ControlType::Generic ), mTristate(ButtonValue::DontKnow), mNumber(0) {}
virtual ~ImplControlValue();
@@ -354,11 +331,11 @@ class VCL_DLLPUBLIC ImplControlValue
ControlType getType() const { return mType; }
- inline ButtonValue getTristateVal() const { return mTristate; }
- inline void setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
+ ButtonValue getTristateVal() const { return mTristate; }
+ void setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
- inline long getNumericVal() const { return mNumber; }
- inline void setNumericVal( long nNumeric ) { mNumber = nNumeric; }
+ long getNumericVal() const { return mNumber; }
+ void setNumericVal( long nNumeric ) { mNumber = nNumeric; }
};
/* ScrollbarValue:
@@ -382,7 +359,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 +379,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 +412,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)
{
@@ -465,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( CTRL_SPINBUTTONS, 0 )
+ : ImplControlValue( ControlType::SpinButtons, 0 )
, mnUpperState(ControlState::NONE)
, mnLowerState(ControlState::NONE)
- , mnUpperPart(0)
- , mnLowerPart(0)
+ , mnUpperPart(ControlPart::NONE)
+ , mnLowerPart(ControlPart::NONE)
{
}
@@ -488,7 +465,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 +481,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 +497,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 +513,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/core/data/document.cxx b/sc/source/core/data/document.cxx
index 3ce2df4..c94e4a8 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6486,12 +6486,12 @@ ScAddress ScDocument::GetNotePosition( size_t nIndex ) const
return ScAddress(nCol, nRow, nTab);
OSL_FAIL("note not found");
- return ScAddress(ScAddress::INITIALIZE_INVALID);
+ return ScAddress::INITIALIZE_INVALID;
}
}
OSL_FAIL("note not found");
- return ScAddress(ScAddress::INITIALIZE_INVALID);
+ return ScAddress::INITIALIZE_INVALID;
}
ScAddress ScDocument::GetNotePosition( size_t nIndex, SCTAB nTab ) const
@@ -6513,11 +6513,11 @@ ScAddress ScDocument::GetNotePosition( size_t nIndex, SCTAB nTab ) const
return ScAddress(nCol, nRow, nTab);
OSL_FAIL("note not found");
- return ScAddress(ScAddress::INITIALIZE_INVALID);
+ return ScAddress::INITIALIZE_INVALID;
}
OSL_FAIL("note not found");
- return ScAddress(ScAddress::INITIALIZE_INVALID);
+ return ScAddress::INITIALIZE_INVALID;
}
SCROW ScDocument::GetNotePosition( SCTAB nTab, SCCOL nCol, size_t nIndex ) const
diff --git a/sc/source/filter/xml/sheetdata.cxx b/sc/source/filter/xml/sheetdata.cxx
index e5e771d..1d1cfb9 100644
--- a/sc/source/filter/xml/sheetdata.cxx
+++ b/sc/source/filter/xml/sheetdata.cxx
@@ -28,7 +28,7 @@
ScSheetSaveData::ScSheetSaveData() :
mnStartTab( -1 ),
mnStartOffset( -1 ),
- maPreviousNote( OUString(), OUString(), ScAddress(ScAddress::INITIALIZE_INVALID) ),
+ maPreviousNote( OUString(), OUString(), ScAddress::INITIALIZE_INVALID ),
mbInSupportedSave( false )
{
}
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index d64601f..5896653 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, 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 6f369e9..4cb88b9 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, ControlPart::Entire))
{
rRenderContext.SetClipRegion();
- bNativeDrawn = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, 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(CTRL_MENU_POPUP, 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(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect,
+ rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire, aCtrlRect,
ControlState::ENABLED, ImplControlValue(), OUString());
rRenderContext.Pop();
}
bool bNativeDrawn = false;
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, 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(CTRL_MENU_POPUP, 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(CTRL_MENU_POPUP, 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(CTRL_MENU_POPUP, 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(CTRL_MENU_POPUP, 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(CTRL_MENU_POPUP, 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 d380870..47ec1ab 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, ControlPart::Entire))
{
ImplControlValue aControlValue;
ControlState nState = ControlState::ENABLED;
- if (rRenderContext.DrawNativeControl(CTRL_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 ccc86ca..d7e448e 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -337,8 +337,8 @@ void SvLBoxButton::Paint(
//Native drawing
bool bNativeOK = false;
- ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
- if ( nIndex != SvBmp::STATICIMAGE && rRenderContext.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
+ ControlType eCtrlType = (pData->IsRadio())? ControlType::Radiobutton : ControlType::Checkbox;
+ if ( nIndex != SvBmp::STATICIMAGE && rRenderContext.IsNativeControlSupported( eCtrlType, ControlPart::Entire) )
{
Size aSize(pData->Width(), pData->Height());
@@ -353,14 +353,14 @@ void SvLBoxButton::Paint(
if (nStyle != DrawImageFlags::Disable)
nState |= ControlState::ENABLED;
if (IsStateChecked())
- aControlValue.setTristateVal(BUTTONVALUE_ON);
+ aControlValue.setTristateVal(ButtonValue::On);
else if (IsStateUnchecked())
- aControlValue.setTristateVal(BUTTONVALUE_OFF);
+ aControlValue.setTristateVal(ButtonValue::Off);
else if (IsStateTristate())
- aControlValue.setTristateVal( BUTTONVALUE_MIXED );
+ aControlValue.setTristateVal( ButtonValue::Mixed );
if (isVis)
- bNativeOK = rRenderContext.DrawNativeControl(eCtrlType, PART_ENTIRE_CONTROL,
+ bNativeOK = rRenderContext.DrawNativeControl(eCtrlType, ControlPart::Entire,
aCtrlRegion, nState, aControlValue, OUString());
}
@@ -380,17 +380,17 @@ 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 );
ControlState nState = ControlState::ENABLED;
- aControlValue.setTristateVal( BUTTONVALUE_ON );
+ aControlValue.setTristateVal( ButtonValue::On );
Rectangle aNativeBounds, aNativeContent;
bool bNativeOK = rRenderContext.GetNativeControlRegion( i_eType,
- PART_ENTIRE_CONTROL,
+ ControlPart::Entire,
aCtrlRegion,
nState,
aControlValue,
@@ -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 3008069..b73d4df 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3036,7 +3036,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, ControlPart::Entire))
{
ImplControlValue aControlValue;
Rectangle aCtrlRegion(aPos, pImg->GetSizePixel());
@@ -3046,22 +3046,22 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
nState |= ControlState::ENABLED;
if (IsExpanded(&rEntry))
- aControlValue.setTristateVal(BUTTONVALUE_ON); //expanded node
+ aControlValue.setTristateVal(ButtonValue::On); //expanded node
else
{
if ((!rEntry.HasChildren()) && rEntry.HasChildrenOnDemand() &&
(!(rEntry.GetFlags() & SvTLEntryFlags::HAD_CHILDREN)) &&
pImp->GetDontKnowNodeBmp().GetSizePixel().Width())
{
- aControlValue.setTristateVal( BUTTONVALUE_DONTKNOW ); //don't know
+ aControlValue.setTristateVal( ButtonValue::DontKnow ); //don't know
}
else
{
- aControlValue.setTristateVal( BUTTONVALUE_OFF ); //collapsed node
+ aControlValue.setTristateVal( ButtonValue::Off ); //collapsed node
}
}
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_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 c7ffa20..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(CTRL_WINDOW_BACKGROUND, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, ControlPart::Entire))
{
aCtrlRegion = aRect;
- rRenderContext.DrawNativeControl(CTRL_WINDOW_BACKGROUND, 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(CTRL_LISTHEADER, PART_BUTTON))
+ if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, ControlPart::Button))
{
aCtrlRegion = aRect;
- aControlValue.setTristateVal(BUTTONVALUE_ON);
+ aControlValue.setTristateVal(ButtonValue::On);
nState |= ControlState::ENABLED;
if (bHigh)
nState |= ControlState::PRESSED;
- rRenderContext.DrawNativeControl(CTRL_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(CTRL_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(CTRL_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 faa4ebf..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(CTRL_WINDOW_BACKGROUND,PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground,ControlPart::Entire))
{
- rRenderContext.DrawNativeControl(CTRL_WINDOW_BACKGROUND,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 4da09d7..4eee265 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -545,10 +545,10 @@ 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, ControlPart::MenuItemCheckMark))
{
- if (rRenderContext.GetNativeControlRegion(ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_CHECK_MARK),
- aCtrlRegion, ControlState(ControlState::ENABLED), aVal, OUString(),
+ if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart::MenuItemCheckMark,
+ aCtrlRegion, ControlState::ENABLED, aVal, OUString(),
aNativeBounds, aNativeContent)
)
{
@@ -556,10 +556,10 @@ 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, ControlPart::MenuItemRadioMark))
{
- if (rRenderContext.GetNativeControlRegion(ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_RADIO_MARK),
- aCtrlRegion, ControlState(ControlState::ENABLED), aVal, OUString(),
+ if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart::MenuItemRadioMark,
+ aCtrlRegion, ControlState::ENABLED, aVal, OUString(),
aNativeBounds, aNativeContent)
)
{
@@ -633,9 +633,9 @@ Size ToolbarMenu::implCalcSize()
if( pEntry->HasCheck() && !pEntry->mbHasImage )
{
- if (IsNativeControlSupported(CTRL_MENU_POPUP, (pEntry->mnBits & MenuItemBits::RADIOCHECK)
- ? PART_MENU_ITEM_CHECK_MARK
- : PART_MENU_ITEM_RADIO_MARK ) )
+ if (IsNativeControlSupported(ControlType::MenuPopup, (pEntry->mnBits & MenuItemBits::RADIOCHECK)
+ ? 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(CTRL_MENU_POPUP, 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(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect,
+ rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire, aCtrlRect,
ControlState::ENABLED, ImplControlValue(), OUString());
- if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, 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(CTRL_MENU_POPUP, 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(CTRL_TOOLBAR, PART_BUTTON))
+ if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, ControlPart::Button))
{
ImplControlValue aControlValue;
ControlState nState = ControlState::PRESSED | ControlState::ENABLED;
- aControlValue.setTristateVal(BUTTONVALUE_ON);
+ aControlValue.setTristateVal(ButtonValue::On);
- bNativeOk = rRenderContext.DrawNativeControl(CTRL_TOOLBAR, PART_BUTTON,
+ bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, ControlPart::Button,
i_rRect, nState, aControlValue, OUString());
}
@@ -1275,14 +1275,14 @@ 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))
+ ? 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;
@@ -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..b05860d 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -101,16 +101,16 @@ static ThemeButtonValue ImplGetButtonValue( ButtonValue aButtonValue )
{
switch( aButtonValue )
{
- case BUTTONVALUE_ON:
+ case ButtonValue::On:
return kThemeButtonOn;
break;
- case BUTTONVALUE_OFF:
+ case ButtonValue::Off:
return kThemeButtonOff;
break;
- case BUTTONVALUE_MIXED:
- case BUTTONVALUE_DONTKNOW:
+ case ButtonValue::Mixed:
+ case ButtonValue::DontKnow:
default:
return kThemeButtonMixed;
break;
@@ -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;
@@ -175,117 +175,118 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
switch( nType )
{
- case CTRL_PUSHBUTTON:
- case CTRL_RADIOBUTTON:
- case CTRL_CHECKBOX:
- case CTRL_LISTNODE:
- if( nPart == PART_ENTIRE_CONTROL )
+ case ControlType::Pushbutton:
+ case ControlType::Radiobutton:
+ case ControlType::Checkbox:
+ case ControlType::ListNode:
+ if( nPart == ControlPart::Entire )
return true;
break;
- case CTRL_SCROLLBAR:
- if( nPart == PART_DRAW_BACKGROUND_HORZ ||
- nPart == PART_DRAW_BACKGROUND_VERT ||
- nPart == PART_ENTIRE_CONTROL ||
- nPart == HAS_THREE_BUTTONS )
+ case ControlType::Scrollbar:
+ if( nPart == ControlPart::DrawBackgroundHorz ||
+ nPart == ControlPart::DrawBackgroundVert ||
+ nPart == ControlPart::Entire ||
+ nPart == ControlPart::HasThreeButtons )
return true;
break;
- case CTRL_SLIDER:
- if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
+ case ControlType::Slider:
+ if( nPart == ControlPart::TrackHorzArea || nPart == ControlPart::TrackVertArea )
return true;
break;
- case CTRL_EDITBOX:
- if( nPart == PART_ENTIRE_CONTROL ||
- nPart == HAS_BACKGROUND_TEXTURE )
+ case ControlType::Editbox:
+ if( nPart == ControlPart::Entire ||
+ nPart == ControlPart::HasBackgroundTexture )
return true;
break;
- case CTRL_MULTILINE_EDITBOX:
- if( nPart == PART_ENTIRE_CONTROL ||
- nPart == HAS_BACKGROUND_TEXTURE )
+ case ControlType::MultilineEditbox:
+ if( nPart == ControlPart::Entire ||
+ nPart == ControlPart::HasBackgroundTexture )
return true;
break;
- case CTRL_SPINBOX:
- if( nPart == PART_ENTIRE_CONTROL ||
- nPart == PART_ALL_BUTTONS ||
- nPart == HAS_BACKGROUND_TEXTURE )
+ case ControlType::Spinbox:
+ if( nPart == ControlPart::Entire ||
+ nPart == ControlPart::AllButtons ||
+ nPart == ControlPart::HasBackgroundTexture )
return true;
break;
- case CTRL_SPINBUTTONS:
+ case ControlType::SpinButtons:
return false;
break;
- case CTRL_COMBOBOX:
- if( nPart == PART_ENTIRE_CONTROL ||
- nPart == HAS_BACKGROUND_TEXTURE )
+ case ControlType::Combobox:
+ if( nPart == ControlPart::Entire ||
+ nPart == ControlPart::HasBackgroundTexture )
return true;
break;
- case CTRL_LISTBOX:
- if( nPart == PART_ENTIRE_CONTROL ||
- nPart == PART_WINDOW ||
- nPart == HAS_BACKGROUND_TEXTURE ||
- nPart == PART_SUB_EDIT
+ case ControlType::Listbox:
+ if( nPart == ControlPart::Entire ||
+ nPart == ControlPart::ListboxWindow ||
+ nPart == ControlPart::HasBackgroundTexture ||
+ nPart == ControlPart::SubEdit
)
return true;
break;
- case CTRL_TAB_ITEM:
- case CTRL_TAB_PANE:
- case CTRL_TAB_BODY: // see vcl/source/window/tabpage.cxx
- if( nPart == PART_ENTIRE_CONTROL ||
- nPart == PART_TABS_DRAW_RTL ||
- nPart == HAS_BACKGROUND_TEXTURE )
+ case ControlType::TabItem:
+ case ControlType::TabPane:
+ case ControlType::TabBody: // see vcl/source/window/tabpage.cxx
+ 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 CTRL_TOOLBAR:
- if( nPart == PART_ENTIRE_CONTROL ||
- nPart == PART_DRAW_BACKGROUND_HORZ ||
- nPart == PART_DRAW_BACKGROUND_VERT)
+ case ControlType::Toolbar:
+ if( nPart == ControlPart::Entire ||
+ nPart == ControlPart::DrawBackgroundHorz ||
+ nPart == ControlPart::DrawBackgroundVert)
return true;
break;
- case CTRL_WINDOW_BACKGROUND:
- if ( nPart == PART_BACKGROUND_WINDOW ||
- nPart == PART_BACKGROUND_DIALOG )
+ case ControlType::WindowBackground:
+ if ( nPart == ControlPart::BackgroundWindow ||
+ nPart == ControlPart::BackgroundDialog )
return true;
break;
- case CTRL_MENUBAR:
- if( nPart == PART_ENTIRE_CONTROL )
+ case ControlType::Menubar:
+ if( nPart == ControlPart::Entire )
return true;
break;
- case CTRL_TOOLTIP: // ** TO DO
+ case ControlType::Tooltip: // ** TO DO
break;
- case CTRL_MENU_POPUP:
- if( nPart == PART_ENTIRE_CONTROL ||
- nPart == PART_MENU_ITEM ||
- nPart == PART_MENU_ITEM_CHECK_MARK ||
- nPart == PART_MENU_ITEM_RADIO_MARK)
+ case ControlType::MenuPopup:
+ if( nPart == ControlPart::Entire ||
+ nPart == ControlPart::MenuItem ||
+ nPart == ControlPart::MenuItemCheckMark ||
+ nPart == ControlPart::MenuItemRadioMark)
return true;
break;
- case CTRL_PROGRESS:
- case CTRL_INTROPROGRESS:
- if( nPart == PART_ENTIRE_CONTROL )
+ case ControlType::Progress:
+ case ControlType::IntroProgress:
+ if( nPart == ControlPart::Entire )
return true;
break;
- case CTRL_FRAME:
- if( nPart == PART_BORDER )
+ case ControlType::Frame:
+ if( nPart == ControlPart::Border )
return true;
break;
- case CTRL_LISTNET:
- if( nPart == PART_ENTIRE_CONTROL )
+ case ControlType::ListNet:
+ if( nPart == ControlPart::Entire )
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,9 +381,9 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
switch( nType )
{
- case CTRL_COMBOBOX:
- if ( nPart == HAS_BACKGROUND_TEXTURE ||
- nPart == PART_ENTIRE_CONTROL )
+ case ControlType::Combobox:
+ if ( nPart == ControlPart::HasBackgroundTexture ||
+ nPart == ControlPart::Entire )
{
HIThemeButtonDrawInfo aComboInfo;
aComboInfo.version = 0;
@@ -399,7 +400,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_TOOLBAR:
+ case ControlType::Toolbar:
{
#if HAVE_FEATURE_MACOSX_SANDBOX
HIThemeMenuItemDrawInfo aMenuItemDrawInfo;
@@ -408,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();
@@ -437,7 +438,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_WINDOW_BACKGROUND:
+ case ControlType::WindowBackground:
{
HIThemeBackgroundDrawInfo aThemeBackgroundInfo;
aThemeBackgroundInfo.version = 0;
@@ -453,10 +454,10 @@ 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 ))
+ 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;
@@ -469,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;
@@ -488,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;
@@ -502,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)
@@ -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,11 +608,11 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_LISTNODE:
+ case ControlType::ListNode:
{
ButtonValue aButtonValue = aValue.getTristateVal();
- if( AllSettings::GetLayoutRTL() && aButtonValue == BUTTONVALUE_OFF )
+ if( AllSettings::GetLayoutRTL() && aButtonValue == ButtonValue::Off )
{
// FIXME: a value of kThemeDisclosureLeft
// should draw a theme compliant left disclosure triangle
@@ -643,9 +645,9 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
aInfo.adornment = kThemeAdornmentNone;
switch( aButtonValue ) {
- case BUTTONVALUE_ON: aInfo.value = kThemeDisclosureDown;//expanded
+ case ButtonValue::On: aInfo.value = kThemeDisclosureDown;//expanded
break;
- case BUTTONVALUE_OFF:
+ case ButtonValue::Off:
// FIXME: this should have drawn a theme compliant disclosure triangle
// (see above)
if( AllSettings::GetLayoutRTL() )
@@ -653,7 +655,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
aInfo.value = kThemeDisclosureLeft;//collapsed, RTL
}
break;
- case BUTTONVALUE_DONTKNOW: //what to do?
+ case ButtonValue::DontKnow: //what to do?
default:
break;
}
@@ -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,13 +695,13 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_SLIDER:
+ case ControlType::Slider:
{
SliderValue const * pSLVal = static_cast<SliderValue const *>(&aValue);
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;
@@ -707,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;
@@ -723,17 +725,17 @@ 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 )
+ 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;
@@ -744,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 );
@@ -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,11 +854,11 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_LISTBOX:
+ case ControlType::Listbox:
switch( nPart)
{
- case PART_ENTIRE_CONTROL:
- case PART_BUTTON_DOWN:
+ case ControlPart::Entire:
+ case ControlPart::ButtonDown:
{
HIThemeButtonDrawInfo aListInfo;
aListInfo.version = 0;
@@ -872,7 +874,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
bOK = true;
break;
}
- case PART_WINDOW:
+ case ControlPart::ListboxWindow:
{
HIThemeFrameDrawInfo aTextDrawInfo;
aTextDrawInfo.version=0;
@@ -889,11 +891,12 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
bOK=true;
break;
}
+ default: break;
}
break;
- case CTRL_EDITBOX:
- case CTRL_MULTILINE_EDITBOX:
+ case ControlType::Editbox:
+ case ControlType::MultilineEditbox:
{
HIThemeFrameDrawInfo aTextDrawInfo;
aTextDrawInfo.version=0;
@@ -919,9 +922,9 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_SPINBOX:
+ case ControlType::Spinbox:
{
- if(nPart == PART_ENTIRE_CONTROL)
+ if(nPart == ControlPart::Entire)
{
//text field:
HIThemeFrameDrawInfo aTextDrawInfo;
@@ -945,7 +948,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
@@ -976,12 +979,12 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
switch( aValue.getTristateVal() )
{
- case BUTTONVALUE_ON: aSpinInfo.value = kThemeButtonOn;
+ case ButtonValue::On: aSpinInfo.value = kThemeButtonOn;
break;
- case BUTTONVALUE_OFF: aSpinInfo.value = kThemeButtonOff;
+ case ButtonValue::Off: aSpinInfo.value = kThemeButtonOff;
break;
- case BUTTONVALUE_MIXED:
- case BUTTONVALUE_DONTKNOW:
+ case ButtonValue::Mixed:
+ case ButtonValue::DontKnow:
default: aSpinInfo.value = kThemeButtonMixed;
break;
}
@@ -1002,10 +1005,10 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
}
break;
- case CTRL_FRAME:
+ 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
@@ -1036,13 +1039,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 +1057,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,16 +1103,16 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
switch (nType)
{
- case CTRL_SLIDER:
+ 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
@@ -1119,7 +1122,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 +1134,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 +1160,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 +1173,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 +1183,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 +1195,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,10 +1210,10 @@ 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 )
+ if( nPart == ControlPart::Entire )
{
w = aCtrlBoundRect.GetWidth();
h = COMBOBOX_HEIGHT_NORMAL;//listboxes and comboxes have the same height
@@ -1220,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 )
@@ -1236,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
@@ -1246,7 +1249,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,8 +1260,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
}
}
break;
- case CTRL_SPINBOX:
- if( nPart == PART_ENTIRE_CONTROL ) {
+ case ControlType::Spinbox:
+ 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;
@@ -1269,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
@@ -1282,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
@@ -1296,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;
@@ -1308,11 +1311,11 @@ 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);
- if( ( nPart == PART_BORDER ) &&
+ if( ( nPart == ControlPart::Border ) &&
!( nFlags & (DrawFrameFlags::Menu | DrawFrameFlags::WindowBorder | DrawFrameFlags::BorderWindowBorder) ) )
{
Rectangle aRect(aCtrlBoundRect);
@@ -1339,10 +1342,10 @@ 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 )) {
+ if(( nPart == ControlPart::MenuItemCheckMark )||( nPart == ControlPart::MenuItemRadioMark )) {
w=10;
h=10;//dimensions of the mark (10px font)
@@ -1354,6 +1357,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 d29806a..900a192 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -296,7 +296,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, ControlPart::Entire))
{
EnableChildTransparentMode();
SetParentClipMode(ParentClipMode::NoClip);
@@ -381,12 +381,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, ControlPart::Entire))
{
// #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, ControlPart::Entire, aCtrlRegion,
ControlState::NONE, aControlValue, OUString());
}
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 75e92e5..570354a 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, ControlPart::Entire ) ||
(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, ControlPart::Entire) )
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,26 +974,26 @@ 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))
+ if (GetParent()->IsNativeControlSupported(aCtrlType, ControlPart::Entire))
{
// 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()))
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 CTRL_LISTBOX/PART_BUTTON_DOWN and CTRL_COMBOBOX/PART_BUTTON_DOWN
+ // for ControlType::Listbox/ControlPart::ButtonDown and ControlType::Combobox/ControlPart::ButtonDown
ImplControlValue aControlValue;
ControlState nState = ControlState::NONE;
@@ -1012,7 +1012,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());
}
}
@@ -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, ControlPart::Entire)))
{
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, ControlPart::Entire, 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, ControlPart::Entire) )
{
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, ControlPart::Entire, 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;
@@ -1519,11 +1519,11 @@ 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 == 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, ControlPart::Entire) )
{
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, ControlPart::Focus))
{
ImplControlValue aControlValue;
Rectangle aInRect(Point(), GetOutputSizePixel());
- GetOutDev()->DrawNativeControl(CTRL_PUSHBUTTON, PART_FOCUS, aInRect,
+ GetOutDev()->DrawNativeControl(ControlType::Pushbutton, ControlPart::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, ControlPart::Entire ) ) )
{
EnableChildTransparentMode();
SetParentClipMode( ParentClipMode::NoClip );
SetPaintTransparent( true );
SetBackground();
- if( IsNativeControlSupported( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL ) )
+ if( IsNativeControlSupported( ControlType::Radiobutton, ControlPart::Entire ) )
mpWindowImpl->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
@@ -1902,9 +1902,9 @@ 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, ControlPart::Entire)))
{
- ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
+ ImplControlValue aControlValue( mbChecked ? ButtonValue::On : ButtonValue::Off );
Rectangle aCtrlRect(maStateRect.TopLeft(), maStateRect.GetSize());
ControlState nState = ControlState::NONE;
@@ -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, ControlPart::Entire, 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, ControlPart::Entire) )
{
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, ControlPart::Entire ) )
{
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, ControlPart::Entire, 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, ControlPart::Entire, 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, ControlPart::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, ControlPart::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, ControlPart::Entire ) ) )
{
EnableChildTransparentMode();
SetParentClipMode( ParentClipMode::NoClip );
SetPaintTransparent( true );
SetBackground();
- if( IsNativeControlSupported( CTRL_CHECKBOX, PART_ENTIRE_CONTROL ) )
+ if( IsNativeControlSupported( ControlType::Checkbox, ControlPart::Entire ) )
ImplGetWindowImpl()->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
}
else
@@ -3021,9 +3021,9 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
{
bool bNativeOK = true;
- if ((bNativeOK = rRenderContext.IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)))
+ if ((bNativeOK = rRenderContext.IsNativeControlSupported(ControlType::Checkbox, ControlPart::Entire)))
{
- ImplControlValue aControlValue(meState == TRISTATE_TRUE ? BUTTONVALUE_ON : BUTTONVALUE_OFF);
+ ImplControlValue aControlValue(meState == TRISTATE_TRUE ? ButtonValue::On : ButtonValue::Off);
Rectangle aCtrlRegion(maStateRect);
ControlState nState = ControlState::NONE;
@@ -3037,14 +3037,14 @@ void CheckBox::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
nState |= ControlState::ENABLED;
if (meState == TRISTATE_TRUE)
- aControlValue.setTristateVal(BUTTONVALUE_ON);
+ aControlValue.setTristateVal(ButtonValue::On);
else if (meState == TRISTATE_INDET)
- aControlValue.setTristateVal(BUTTONVALUE_MIXED);
+ aControlValue.setTristateVal(ButtonValue::Mixed);
if (IsMouseOver() && maMouseRect.IsInside(GetPointerPosPixel()))
nState |= ControlState::ROLLOVER;
- bNativeOK = rRenderContext.DrawNativeControl(CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::Checkbox, ControlPart::Entire, 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, ControlPart::Entire) )
{
if( ( maMouseRect.IsInside( GetPointerPosPixel()) &&
!maMouseRect.IsInside( GetLastPointerPosPixel()) ) ||
@@ -3621,7 +3621,7 @@ Size CheckBox::ImplGetCheckImageSize() const
{
Size aSize;
bool bDefaultSize = true;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list