summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-06 14:34:03 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-05-07 13:28:09 +0000
commit0776b33f79327936e0bbf26acc73f2f0db45b9c8 (patch)
tree84685e5a2407e92963e9a1caa17a5336e5622688 /include
parent2c8dc0373377a6e801c9a9246ffdc3641f3be4ec (diff)
convert PUSHBUTTON_DROPDOWN constants to scoped enum
Change-Id: Iae363b8478ef2d560ae661af06ba989f27adc093 Reviewed-on: https://gerrit.libreoffice.org/15650 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/button.hxx38
1 files changed, 21 insertions, 17 deletions
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index bfa3f2019244..e0fc1786ba6e 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -76,9 +76,9 @@ public:
static OUString GetStandardText( StandardButtonType eButton );
- bool SetModeImage( const Image& rImage );
+ bool SetModeImage( const Image& rImage );
const Image GetModeImage( ) const;
- bool HasImage() const;
+ bool HasImage() const;
void SetImageAlign( ImageAlign eAlign );
ImageAlign GetImageAlign() const;
@@ -100,8 +100,12 @@ protected:
// - PushButton-Types -
-#define PUSHBUTTON_DROPDOWN_TOOLBOX ((sal_uInt16)0x0001)
-#define PUSHBUTTON_DROPDOWN_MENUBUTTON ((sal_uInt16)0x0002)
+enum class PushButtonDropdownStyle
+{
+ NONE = 0x0000,
+ Toolbox = 0x0001,
+ MenuButton = 0x0002,
+};
// - PushButton -
@@ -113,7 +117,7 @@ protected:
SymbolType meSymbol;
TriState meState;
TriState meSaveValue;
- sal_uInt16 mnDDStyle;
+ PushButtonDropdownStyle mnDDStyle;
bool mbPressed;
bool mbInUserDraw;
Link<> maToggleHdl;
@@ -125,7 +129,7 @@ protected:
const Rectangle& rRect, bool bLayout, bool bMenuBtnSep);
SAL_DLLPRIVATE void ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLayout = false);
using Button::ImplGetTextStyle;
- SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( sal_uLong nDrawFlags ) const;
+ SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( sal_uLong nDrawFlags ) const;
SAL_DLLPRIVATE bool IsSymbol() const { return ( (meSymbol != SymbolType::DONTKNOW) && (meSymbol != SymbolType::IMAGE) ); }
SAL_DLLPRIVATE bool IsImage() const { return Button::HasImage(); }
@@ -174,8 +178,8 @@ public:
SymbolType GetSymbol() const { return meSymbol; }
void SetSymbolAlign( SymbolAlign eAlign );
- void SetDropDown( sal_uInt16 nStyle );
- sal_uInt16 GetDropDown() const { return mnDDStyle; }
+ void SetDropDown( PushButtonDropdownStyle nStyle );
+ PushButtonDropdownStyle GetDropDown() const { return mnDDStyle; }
void SetState( TriState eState );
TriState GetState() const { return meState; }
@@ -197,7 +201,7 @@ public:
void SetToggleHdl( const Link<>& rLink ) { maToggleHdl = rLink; }
const Link<>& GetToggleHdl() const { return maToggleHdl; }
- virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
+ virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
};
inline void PushButton::Check( bool bCheck )
@@ -278,10 +282,10 @@ private:
Rectangle maStateRect;
Rectangle maMouseRect;
Image maImage;
- bool mbChecked;
- bool mbSaveValue;
- bool mbRadioCheck;
- bool mbStateChanged;
+ bool mbChecked;
+ bool mbSaveValue;
+ bool mbRadioCheck;
+ bool mbStateChanged;
Link<> maToggleHdl;
// when mbLegacyNoTextAlign is set then the old behaviour where
// the WB_LEFT, WB_RIGHT & WB_CENTER affect the image placement
@@ -315,7 +319,7 @@ public:
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
protected:
- virtual void FillLayoutData() const SAL_OVERRIDE;
+ virtual void FillLayoutData() const SAL_OVERRIDE;
virtual const vcl::Font&
GetCanonicalFont( const StyleSettings& _rStyle ) const SAL_OVERRIDE;
virtual const Color&
@@ -349,7 +353,7 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
- void Toggle();
+ void Toggle();
bool IsStateChanged() const { return mbStateChanged; }
@@ -435,7 +439,7 @@ protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
- virtual void FillLayoutData() const SAL_OVERRIDE;
+ virtual void FillLayoutData() const SAL_OVERRIDE;
virtual const vcl::Font& GetCanonicalFont( const StyleSettings& _rStyle ) const SAL_OVERRIDE;
virtual const Color& GetCanonicalTextColor( const StyleSettings& _rStyle ) const SAL_OVERRIDE;
@@ -463,7 +467,7 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
- void Toggle();
+ void Toggle();
void SetState( TriState eState );
TriState GetState() const { return meState; }