Files
wangchyz 02d1ed8832 1、统一了控件class name和interface name
2、修正了若干bug
2016-03-17 21:17:06 +08:00

82 lines
1.9 KiB
C++

#ifndef __UIBUTTON_H__
#define __UIBUTTON_H__
#pragma once
namespace DuiLib
{
class DUILIB_API CButtonUI : public CLabelUI
{
public:
CButtonUI();
LPCTSTR GetClass() const;
LPVOID GetInterface(LPCTSTR pstrName);
UINT GetControlFlags() const;
bool Activate();
void SetEnabled(bool bEnable = true);
void DoEvent(TEventUI& event);
LPCTSTR GetNormalImage();
void SetNormalImage(LPCTSTR pStrImage);
LPCTSTR GetHotImage();
void SetHotImage(LPCTSTR pStrImage);
LPCTSTR GetPushedImage();
void SetPushedImage(LPCTSTR pStrImage);
LPCTSTR GetFocusedImage();
void SetFocusedImage(LPCTSTR pStrImage);
LPCTSTR GetDisabledImage();
void SetDisabledImage(LPCTSTR pStrImage);
LPCTSTR GetForeImage();
void SetForeImage(LPCTSTR pStrImage);
LPCTSTR GetHotForeImage();
void SetHotForeImage(LPCTSTR pStrImage);
// śÔÓŚ°´ĹĽľÄ5¸ö×´ĚŹÍź
void SetFiveStatusImage(LPCTSTR pStrImage);
void SetFadeAlphaDelta(BYTE uDelta);
BYTE GetFadeAlphaDelta();
void SetHotBkColor(DWORD dwColor);
DWORD GetHotBkColor() const;
void SetHotTextColor(DWORD dwColor);
DWORD GetHotTextColor() const;
void SetPushedTextColor(DWORD dwColor);
DWORD GetPushedTextColor() const;
void SetFocusedTextColor(DWORD dwColor);
DWORD GetFocusedTextColor() const;
SIZE EstimateSize(SIZE szAvailable);
void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
void PaintText(HDC hDC);
void PaintStatusImage(HDC hDC);
protected:
enum
{
FADE_TIMERID = 11,
FADE_ELLAPSE = 30,
};
UINT m_uButtonState;
DWORD m_dwHotBkColor;
DWORD m_dwHotTextColor;
DWORD m_dwPushedTextColor;
DWORD m_dwFocusedTextColor;
BYTE m_uFadeAlpha;
BYTE m_uFadeAlphaDelta;
TDrawInfo m_diNormal;
TDrawInfo m_diHot;
TDrawInfo m_diHotFore;
TDrawInfo m_diPushed;
TDrawInfo m_diPushedFore;
TDrawInfo m_diFocused;
TDrawInfo m_diDisabled;
};
} // namespace DuiLib
#endif // __UIBUTTON_H__