DirectUI interface library
Time:2011-06-03 Author:xmboo.com Click:
China's first open source directui interface library, open, sharing, public benefits, win-win situation, follow the bsd protocol, free for commercial projects, now supports Windows 32, Window CE, Mobile and other platforms.
wohtml.com,wohtml.com
[code] [C/C++/Objective-C]
|
001 |
#ifndef __UICONTROL_H__ |
|
002 |
#define __UICONTROL_H__ |
|
008 |
///////////////////////////////////////////////////////////////////////////////////// |
|
011 |
typedef CControlUI* (CALLBACK* FINDCONTROLPROC)(CControlUI*, LPVOID); |
|
013 |
class UILIB_API CControlUI |
|
017 |
virtual ~CControlUI(); |
|
020 |
virtual CStdString GetName() const; |
|
021 |
virtual void SetName(LPCTSTR pstrName); |
|
022 |
virtual LPCTSTR GetClass() const; |
|
023 |
virtual LPVOID GetInterface(LPCTSTR pstrName); |
|
024 |
virtual UINT GetControlFlags() const; |
|
026 |
virtual bool Activate(); |
|
027 |
virtual CPaintManagerUI* GetManager() const; |
|
028 |
virtual void SetManager(CPaintManagerUI* pManager, CControlUI* pParent, bool bInit = true); |
|
029 |
virtual CControlUI* GetParent() const; |
|
032 |
virtual CStdString GetText() const; |
|
033 |
virtual void SetText(LPCTSTR pstrText); |
|
036 |
DWORD GetBkColor() const; |
|
037 |
void SetBkColor(DWORD dwBackColor); |
|
038 |
DWORD GetBkColor2() const; |
|
039 |
void SetBkColor2(DWORD dwBackColor); |
|
040 |
DWORD GetBkColor3() const; |
|
041 |
void SetBkColor3(DWORD dwBackColor); |
|
042 |
LPCTSTR GetBkImage(); |
|
043 |
void SetBkImage(LPCTSTR pStrImage); |
|
044 |
DWORD GetBorderColor() const; |
|
045 |
void SetBorderColor(DWORD dwBorderColor); |
|
046 |
DWORD GetFocusBorderColor() const; |
|
047 |
void SetFocusBorderColor(DWORD dwBorderColor); |
|
048 |
int GetBorderSize() const; |
|
049 |
void SetBorderSize(int nSize); |
|
050 |
SIZE GetBorderRound() const; |
|
051 |
void SetBorderRound(SIZE cxyRound); |
|
052 |
bool DrawImage(HDC hDC, LPCTSTR pStrImage, LPCTSTR pStrModify = NULL); |
|
055 |
virtual const RECT& GetPos() const; |
|
056 |
virtual void SetPos(RECT rc); |
|
057 |
virtual int GetWidth() const; |
|
058 |
virtual int GetHeight() const; |
|
059 |
virtual int GetX() const; |
|
060 |
virtual int GetY() const; |
|
061 |
virtual RECT GetPadding() const; |
|
062 |
virtual void SetPadding(RECT rcPadding); // 设置外边距,由上层窗口绘制 |
|
063 |
virtual SIZE GetFixedXY() const; // 实际大小位置使用GetPos获取,这里得到的是预设的参考值 |
|
064 |
virtual void SetFixedXY(SIZE szXY); // 仅float为true时有效 |
|
065 |
virtual int GetFixedWidth() const; // 实际大小位置使用GetPos获取,这里得到的是预设的参考值 |
|
066 |
virtual void SetFixedWidth(int cx); // 预设的参考值 |
|
067 |
virtual int GetFixedHeight() const; // 实际大小位置使用GetPos获取,这里得到的是预设的参考值 |
|
068 |
virtual void SetFixedHeight(int cy); // 预设的参考值 |
|
069 |
virtual int GetMinWidth() const; |
|
070 |
virtual void SetMinWidth(int cx); |
|
071 |
virtual int GetMaxWidth() const; |
|
072 |
virtual void SetMaxWidth(int cx); |
|
073 |
virtual int GetMinHeight() const; |
|
074 |
virtual void SetMinHeight(int cy); |
|
075 |
virtual int GetMaxHeight() const; |
|
076 |
virtual void SetMaxHeight(int cy); |
|
077 |
virtual void SetRelativePos(SIZE szMove,SIZE szZoom); |
|
078 |
virtual void SetRelativeParentSize(SIZE sz); |
|
079 |
virtual TRelativePosUI GetRelativePos() const; |
|
080 |
virtual bool IsRelativePos() const; |
|
083 |
virtual CStdString GetToolTip() const; |
|
084 |
virtual void SetToolTip(LPCTSTR pstrText); |
|
087 |
virtual TCHAR GetShortcut() const; |
|
088 |
virtual void SetShortcut(TCHAR ch); |
|
091 |
virtual bool IsContextMenuUsed() const; |
|
092 |
virtual void SetContextMenuUsed(bool bMenuUsed); |
|
095 |
virtual const CStdString& GetUserData(); // 辅助函数,供用户使用 |
|
096 |
virtual void SetUserData(LPCTSTR pstrText); // 辅助函数,供用户使用 |
|
097 |
virtual UINT_PTR GetTag() const; // 辅助函数,供用户使用 |
|
098 |
virtual void SetTag(UINT_PTR pTag); // 辅助函数,供用户使用 |
|
101 |
virtual bool IsVisible() const; |
|
102 |
virtual void SetVisible(bool bVisible = true); |
|
103 |
virtual void SetInternVisible(bool bVisible = true); // 仅供内部调用,有些UI拥有窗口句柄,需要重写此函数 |
|
104 |
virtual bool IsEnabled() const; |
|
105 |
virtual void SetEnabled(bool bEnable = true); |
|
106 |
virtual bool IsMouseEnabled() const; |
|
107 |
virtual void SetMouseEnabled(bool bEnable = true); |
|
108 |
virtual bool IsFocused() const; |
|
109 |
virtual void SetFocus(); |
|
110 |
virtual bool IsFloat() const; |
|
111 |
virtual void SetFloat(bool bFloat = true); |
|
113 |
virtual CControlUI* FindControl(FINDCONTROLPROC Proc, LPVOID pData, UINT uFlags); |
|
116 |
bool IsUpdateNeeded() const; |
|
118 |
void NeedParentUpdate(); |
|
120 |
virtual void Init(TEventUI& event); |
|
121 |
virtual void DoInit(); |
|
123 |
virtual void Event(TEventUI& event); |
|
124 |
virtual void DoEvent(TEventUI& event); |
|
126 |
virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); |
|
127 |
CControlUI* ApplyAttributeList(LPCTSTR pstrList); |
|
129 |
virtual SIZE EstimateSize(SIZE szAvailable); |
|
131 |
virtual void DoPaint(HDC hDC, const RECT& rcPaint); |
|
132 |
virtual void PaintBkColor(HDC hDC); |
|
133 |
virtual void PaintBkImage(HDC hDC); |
|
134 |
virtual void PaintStatusImage(HDC hDC); |
|
135 |
virtual void PaintText(HDC hDC); |
|
136 |
virtual void PaintBorder(HDC hDC); |
|
138 |
virtual void DoPostPaint(HDC hDC, const RECT& rcPaint); |
|
142 |
CEventSource OnDestroy; |
|
143 |
CEventSource OnEvent; |
|
146 |
CPaintManagerUI* m_pManager; |
|
147 |
CControlUI* m_pParent; |
|
149 |
bool m_bUpdateNeeded; |
|
158 |
bool m_bInternVisible; |
|
160 |
bool m_bMouseEnabled; |
|
163 |
bool m_bFloatSetPos; // 防止SetPos循环调用 |
|
164 |
TRelativePosUI m_tRelativePos; |
|
167 |
CStdString m_sToolTip; |
|
169 |
CStdString m_sUserData; |
|
173 |
DWORD m_dwBackColor2; |
|
174 |
DWORD m_dwBackColor3; |
|
175 |
CStdString m_sBkImage; |
|
176 |
DWORD m_dwBorderColor; |
|
177 |
DWORD m_dwFocusBorderColor; |
|
179 |
SIZE m_cxyBorderRound; |
|
183 |
} // namespace DuiLib |
|
185 |
#endif // __UICONTROL_H__ |
copyright:wohtml.com
Keywords: DirectUI,library,Open Source,Php Program,Asp Program,Js Script (
Source:go2html.com)
TAGS:
DirectUI(1)library(1)