123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- #ifndef __UIBUTTON_H__
- #define __UIBUTTON_H__
- #pragma once
- namespace DuiLib
- {
- class UILIB_API CButtonUI : public CLabelUI
- {
- DECLARE_DUICONTROL(CButtonUI)
- public:
- CButtonUI();
- LPCTSTR GetClass() const;
- LPVOID GetInterface(LPCTSTR pstrName);
- UINT GetControlFlags() const;
- bool Activate();
- void SetEnabled(bool bEnable = true);
- void DoEvent(TEventUI& event);
- virtual LPCTSTR GetNormalImage();
- virtual void SetNormalImage(LPCTSTR pStrImage);
- virtual LPCTSTR GetHotImage();
- virtual void SetHotImage(LPCTSTR pStrImage);
- virtual LPCTSTR GetPushedImage();
- virtual void SetPushedImage(LPCTSTR pStrImage);
- virtual LPCTSTR GetFocusedImage();
- virtual void SetFocusedImage(LPCTSTR pStrImage);
- virtual LPCTSTR GetDisabledImage();
- virtual void SetDisabledImage(LPCTSTR pStrImage);
- virtual LPCTSTR GetHotForeImage();
- virtual void SetHotForeImage(LPCTSTR pStrImage);
- virtual LPCTSTR GetPushedForeImage();
- virtual void SetPushedForeImage(LPCTSTR pStrImage);
- void SetStateCount(int nCount);
- int GetStateCount() const;
- virtual LPCTSTR GetStateImage();
- virtual void SetStateImage(LPCTSTR pStrImage);
- void BindTabIndex(int _BindTabIndex);
- void BindTabLayoutName(LPCTSTR _TabLayoutName);
- void BindTriggerTabSel(int _SetSelectIndex = -1);
- void RemoveBindTabIndex();
- int GetBindTabLayoutIndex();
- LPCTSTR GetBindTabLayoutName();
- void SetHotFont(int index);
- int GetHotFont() const;
- void SetPushedFont(int index);
- int GetPushedFont() const;
- void SetFocusedFont(int index);
- int GetFocusedFont() const;
- void SetHotBkColor(DWORD dwColor);
- DWORD GetHotBkColor() const;
- void SetPushedBkColor(DWORD dwColor);
- DWORD GetPushedBkColor() const;
- void SetDisabledBkColor(DWORD dwColor);
- DWORD GetDisabledBkColor() const;
- void SetHotTextColor(DWORD dwColor);
- DWORD GetHotTextColor() const;
- void SetPushedTextColor(DWORD dwColor);
- DWORD GetPushedTextColor() const;
- void SetFocusedTextColor(DWORD dwColor);
- DWORD GetFocusedTextColor() const;
- void SetHotBorderColor(DWORD dwColor);
- DWORD GetHotBorderColor() const;
- void SetPushedBorderColor(DWORD dwColor);
- DWORD GetPushedBorderColor() const;
- void SetDisabledBorderColor(DWORD dwColor);
- DWORD GetDisabledBorderColor() const;
- void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
- void PaintText(HDC hDC);
- void PaintBkColor(HDC hDC);
- void PaintStatusImage(HDC hDC);
- void PaintBorder(HDC hDC);
- void PaintForeImage(HDC hDC);
- void DrawBorder(HDC hDC, const RECT& rcItem, const DWORD& dwBorderColor, const int& nBorderSize, const RECT& rcBorderSize, const SIZE& cxyBorderRound, const int& nBorderStyle);
- protected:
- UINT m_uButtonState;
- int m_iHotFont;
- int m_iPushedFont;
- int m_iFocusedFont;
- DWORD m_dwHotBkColor;
- DWORD m_dwPushedBkColor;
- DWORD m_dwDisabledBkColor;
- DWORD m_dwHotTextColor;
- DWORD m_dwPushedTextColor;
- DWORD m_dwFocusedTextColor;
- DWORD m_dwHotBorderColor;
- DWORD m_dwPushedBorderColor;
- DWORD m_dwDisabledBorderColor;
- CDuiString m_sNormalImage;
- CDuiString m_sHotImage;
- CDuiString m_sHotForeImage;
- CDuiString m_sPushedImage;
- CDuiString m_sPushedForeImage;
- CDuiString m_sFocusedImage;
- CDuiString m_sDisabledImage;
- int m_nStateCount;
- CDuiString m_sStateImage;
- int m_iBindTabIndex;
- CDuiString m_sBindTabLayoutName;
- };
- } // namespace DuiLib
- #endif // __UIBUTTON_H__
|