File indexing completed on 2023-03-17 11:01:09
0001 #ifndef Fireworks_Core_FWCustomIconsButton_h
0002 #define Fireworks_Core_FWCustomIconsButton_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "TGButton.h"
0023
0024
0025
0026
0027 class TGPicture;
0028
0029 class FWCustomIconsButton : public TGButton {
0030 public:
0031 FWCustomIconsButton(const TGWindow* iParent,
0032 const TGPicture* iUpIcon,
0033 const TGPicture* iDownIcon,
0034 const TGPicture* iDisableIcon,
0035 const TGPicture* iBelowMouseIcon = nullptr,
0036 Int_t id = -1,
0037 GContext_t norm = TGButton::GetDefaultGC()(),
0038 UInt_t option = 0);
0039
0040 ~FWCustomIconsButton() override;
0041
0042 bool HandleCrossing(Event_t*) override;
0043
0044
0045
0046
0047
0048
0049 void swapIcons(const TGPicture*& iUpIcon, const TGPicture*& iDownIcon, const TGPicture*& iDisabledIcon);
0050
0051 void setIcons(const TGPicture* iUpIcon,
0052 const TGPicture* iDownIcon,
0053 const TGPicture* iDisabledIcon,
0054 const TGPicture* ibelowMouseIcon = nullptr);
0055
0056 const TGPicture* upIcon() const { return m_upIcon; }
0057 const TGPicture* downIcon() const { return m_downIcon; }
0058 const TGPicture* disabledIcon() const { return m_disabledIcon; }
0059 const TGPicture* bellowMouseIcon() const { return m_belowMouseIcon; }
0060
0061 FWCustomIconsButton(const FWCustomIconsButton&) = delete;
0062
0063 const FWCustomIconsButton& operator=(const FWCustomIconsButton&) = delete;
0064
0065 protected:
0066 void DoRedraw() override;
0067
0068 private:
0069
0070 const TGPicture* m_upIcon;
0071 const TGPicture* m_downIcon;
0072 const TGPicture* m_disabledIcon;
0073 const TGPicture* m_belowMouseIcon;
0074
0075 bool m_inside;
0076 };
0077
0078 #endif