diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-18 10:36:36 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-18 18:18:48 +0000 |
commit | 06562c678410e425de629109ce92933c2d89a8f6 (patch) | |
tree | 320a85d9de457bfc503cdad398e8bcfc2cf30376 /include/svtools | |
parent | 6118ea49aee18a95ac124bbac695b3bb1b152c1d (diff) |
convert SV_BMP_ constants to enum
Change-Id: I46cb7f649fa44d8967e0e7da03583157d2706f05
Reviewed-on: https://gerrit.libreoffice.org/12018
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/svtools')
-rw-r--r-- | include/svtools/svlbitm.hxx | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx index ff9c00f05317..07751290ed55 100644 --- a/include/svtools/svlbitm.hxx +++ b/include/svtools/svlbitm.hxx @@ -22,22 +22,23 @@ #define INCLUDED_SVTOOLS_SVLBITM_HXX #include <svtools/svtdllapi.h> - #include <tools/link.hxx> - #include <vcl/image.hxx> #include <svtools/treelistbox.hxx> class SvTreeListEntry; -#define SV_BMP_UNCHECKED 0 -#define SV_BMP_CHECKED 1 -#define SV_BMP_TRISTATE 2 -#define SV_BMP_HIUNCHECKED 3 -#define SV_BMP_HICHECKED 4 -#define SV_BMP_HITRISTATE 5 -#define SV_BMP_STATICIMAGE 6 +enum class SvBmp +{ + UNCHECKED = 0, + CHECKED = 1, + TRISTATE = 2, + HIUNCHECKED = 3, + HICHECKED = 4, + HITRISTATE = 5, + STATICIMAGE = 6 +}; struct SvLBoxButtonData_Impl; @@ -50,9 +51,10 @@ private: SvLBoxButtonData_Impl* pImpl; bool bDataOk; SvButtonState eState; + std::vector<Image> aBmps; // Indizes siehe Konstanten BMP_ .... - SVT_DLLPRIVATE void SetWidthAndHeight(); - SVT_DLLPRIVATE void InitData( bool bImagesFromDefault, + SVT_DLLPRIVATE void SetWidthAndHeight(); + SVT_DLLPRIVATE void InitData( bool bImagesFromDefault, bool _bRadioBtn, const Control* pControlForSettings = NULL ); public: // include creating default images (CheckBox or RadioButton) @@ -61,7 +63,7 @@ public: ~SvLBoxButtonData(); - sal_uInt16 GetIndex( sal_uInt16 nItemState ); + SvBmp GetIndex( sal_uInt16 nItemState ); long Width(); long Height(); void SetLink( const Link& rLink) { aLink=rLink; } @@ -73,14 +75,12 @@ public: void StoreButtonState( SvTreeListEntry* pEntry, sal_uInt16 nItemFlags ); SvButtonState ConvertToButtonState( sal_uInt16 nItemFlags ) const; - SvButtonState GetActButtonState() const - { - return eState; - } + SvButtonState GetActButtonState() const { return eState; } - SvTreeListEntry* GetActEntry() const; + SvTreeListEntry* GetActEntry() const; - Image aBmps[24]; // Indizes siehe Konstanten BMP_ .... + void SetImage(SvBmp nIndex, const Image& aImage) { aBmps[(int)nIndex] = aImage; } + Image& GetImage(SvBmp nIndex) { return aBmps[(int)nIndex]; } void SetDefaultImages( const Control* pControlForSettings = NULL ); // set images acording to the color scheeme of the Control @@ -138,7 +138,6 @@ class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem SvLBoxButtonData* pData; SvLBoxButtonKind eKind; sal_uInt16 nItemFlags; - sal_uInt16 nBaseOffs; void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, vcl::Window* pParent ); public: @@ -172,9 +171,6 @@ public: SvLBoxButtonKind GetKind() const { return eKind; } - void SetBaseOffs( sal_uInt16 nOffs ) { nBaseOffs = nOffs; } - sal_uInt16 GetBaseOffs() const { return nBaseOffs; } - // Check whether this button can be modified via UI bool CheckModification() const; SvLBoxButtonData* GetButtonData() const{ return pData;} |