|
| ToolTip () |
| 初始化ToolTip
|
|
| ToolTip (DWORD style) |
| 初始化ToolTip,指定窗口样式
|
|
bool | SetToolTip (HWND hwnd, const std::wstring &tooltip) |
| 给指定句柄设置提示信息
|
|
bool | SetToolTip (const WndBase &wnd, const std::wstring &tooltip) |
| 给指定窗口或控件设置提示信息
|
|
void | RemoveAll () |
| 移除所有关联的提示信息
|
|
virtual | ~WndBase ()=0 |
| 析构函数,这里用纯虚函数使该类成为抽象类
|
|
bool | operator== (const WndBase &other) const |
| 判断两个WndBase是否为同一实例
|
|
bool | operator!= (const WndBase &other) const |
| 判断两个WndBase是否为不同实例
|
|
virtual UIElement * | ToUIElement () |
| 尝试将对象转换成UIElement
|
|
void | Show (int nCmdShow) |
| 该函数调用ShowWindow
|
|
void | Close () |
| 发送关闭消息
|
|
void | Update () |
| 该函数调用UpdateWindow
|
|
void | UpdateFont () |
| 更新字体
|
|
HFONT | GetFontHandle () |
| 获取字体句柄
|
|
void | Redraw (bool erase=false, bool updateWindow=false) |
| 重画
|
|
bool | IsVisible () |
| 判断当前对象在界面中是否可视,与Visible属性不同的是该函数返回值会受父窗口的影响
|
|
DWORD | GetStyle () |
| 获取窗口样式
|
|
void | SetStyle (DWORD style) |
| 设置窗口样式
|
|
bool | GetStyle (DWORD mask) |
| 判断窗口是否设有指定样式
|
|
void | SetStyle (DWORD mask, bool value) |
| 打开或关闭指定的样式
|
|
DWORD | GetExtendedStyle () |
| 获取扩展窗口样式
|
|
void | SetExtendedStyle (DWORD style) |
| 设置扩展窗口样式
|
|
bool | GetExtendedStyle (DWORD mask) |
| 判断窗口是否设有指定扩展样式
|
|
void | SetExtendedStyle (DWORD mask, bool value) |
| 打开或关闭指定的扩展样式
|
|
Point | PointToScreen (const Point &point) |
| 获取用户区点在屏幕上点的位置
|
|
Point | PointFromScreen (const Point &screenPoint) |
| 获取屏幕上点在当前用户区点的位置
|
|
LRESULT | SendMessageA (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 发送消息(ASCII)
|
|
LRESULT | SendMessageW (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 发送消息(UNICODE)
|
|
BOOL | PostMessageA (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 发送消息(ASCII)并立即返回
|
|
BOOL | PostMessageW (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 发送消息(UNICODE)并立即返回
|
|
HitTestResult | NcHitTest (const Point &testPoint) |
| 测试指定点在窗口的哪一部分
|
|
|
static WndBase * | GetWndBase (HWND hwnd) |
| 通过窗口句柄获取WndBase
|
|
| WndBase () |
| 初始化WndBase
|
|
| WndBase (const WndBase &)=delete |
|
| WndBase (WndBase &&)=delete |
|
WndBase & | operator= (const WndBase &)=delete |
|
WndBase & | operator= (WndBase &&)=delete |
|
void | InitWindow (LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle) |
| 初始化为窗口,该函数会调用CreateWindowExW
|
|
void | InitControl (LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle, LPVOID lpParam=NULL) |
| 初始化为控件,该函数会调用CreateWindowExW
|
|
LRESULT | DefaultWndProc (const ProcMsg &refMsg) |
| 调用默认的WndProc,对于窗口则调用DefWindowProcW,控件则调用_controlOldWndProc
|
|
virtual LRESULT | WndProc (const ProcMsg &refMsg) |
| 对WndProc的封装
|
|
void | UpdateText () |
| 更新_text字段
|
|
virtual std::wstring & | GetText () |
| 获取窗口文本
|
|
virtual void | SetText (const std::wstring &value) |
| 调用SetWindowTextW设置窗口文本
|
|
virtual bool | OnCreate () |
| 接收到WM_CREATE时调用该函数
|
|
virtual bool | OnClose () |
| 接收到WM_CLOSE时调用该函数
|
|
virtual bool | OnDestroy () |
| 接收到WM_DESTROY时调用该函数
|
|
virtual bool | OnPaint () |
| 接收到WM_PAINT时调用该函数
|
|
virtual void | OnEndPaint () |
| 在OnPaint函数完成之后调用该函数
|
|
virtual bool | OnMove (Point newClientPosition) |
| 接收到WM_MOVE时调用该函数
|
|
virtual bool | OnSize (Size newClientSize) |
| 接收到WM_SIZE时调用该函数
|
|
virtual void | OnTextChanged () |
| Text属性更改时调用此函数
|
|
virtual bool | OnSetFocus (HWND hPrevFocus) |
| 接收到WM_SETFOCUS时调用该函数
|
|
virtual bool | OnKillFocus (HWND hNextFocus) |
| 接收到WM_KILLFOCUS时调用该函数
|
|
virtual bool | OnMouseMove (Point mousePosition, MouseKey keyState) |
| 接收到WM_MOUSEMOVE时调用该函数
|
|
virtual bool | OnMouseLeave () |
| 接收到WM_MOUSELEAVE时调用该函数
|
|
virtual bool | OnMouseWheel (int wheelDelta, Point mousePosition, MouseKey keyState) |
| 接收到WM_MOUSEWHEEL时调用该函数
|
|
virtual bool | OnMouseLeftButtonDown (Point mousePosition, MouseKey keyState) |
| 接收到WM_LBUTTONDOWN时调用该函数
|
|
virtual bool | OnMouseLeftButtonUp (Point mousePosition, MouseKey keyState) |
| 接收到WM_LBUTTONUP时调用该函数
|
|
virtual bool | OnMouseLeftButtonDoubleClick (Point mousePosition, MouseKey keyState) |
| 接收到WM_LBUTTONDBLCLK时调用该函数
|
|
virtual bool | OnMouseRightButtonDown (Point mousePosition, MouseKey keyState) |
| 接收到WM_RBUTTONDOWN时调用该函数
|
|
virtual bool | OnMouseRightButtonUp (Point mousePosition, MouseKey keyState) |
| 接收到WM_RBUTTONUP时调用该函数
|
|
virtual bool | OnMouseRightButtonDoubleClick (Point mousePosition, MouseKey keyState) |
| 接收到WM_RBUTTONDBLCLK时调用该函数
|
|
virtual bool | OnMouseMiddleButtonDown (Point mousePosition, MouseKey keyState) |
| 接收到WM_MBUTTONDOWN时调用该函数
|
|
virtual bool | OnMouseMiddleButtonUp (Point mousePosition, MouseKey keyState) |
| 接收到WM_MBUTTONUP时调用该函数
|
|
virtual bool | OnMouseMiddleButtonDoubleClick (Point mousePosition, MouseKey keyState) |
| 接收到WM_MBUTTONDBLCLK时调用该函数
|
|
virtual bool | OnChar (wchar_t ch, KeyFlags flags) |
| 接收到WM_CHAR时调用该函数
|
|
virtual bool | OnDeadChar (wchar_t ch, KeyFlags flags) |
| 接收到WM_DEADCHAR时调用该函数
|
|
virtual bool | OnKeyDown (VirtualKey key, KeyFlags flags) |
| 接收到WM_KEYDOWN时调用该函数
|
|
virtual bool | OnKeyUp (VirtualKey key, KeyFlags flags) |
| 接收到WM_KEYUP时调用该函数
|
|
virtual bool | OnSysChar (wchar_t ch, KeyFlags flags) |
| 接收到WM_SYSCHAR时调用该函数
|
|
virtual bool | OnSysDeadChar (wchar_t ch, KeyFlags flags) |
| 接收到WM_SYSDEADCHAR时调用该函数
|
|
virtual bool | OnSysKeyDown (VirtualKey key, KeyFlags flags) |
| 接收到WM_SYSKEYDOWN时调用该函数
|
|
virtual bool | OnSysKeyUp (VirtualKey key, KeyFlags flags) |
| 接收到WM_SYSKEYUP时调用该函数
|
|
virtual void | VisibleChanged (bool newVisible) |
| Visible属性改变时调用此函数
|
|
virtual bool | SetParent (WndBase *parent) |
| 设置父窗口
|
|
virtual void | ParentChanged (WndBase *newParent) |
| 父窗口改变时调用此函数
|
|
virtual void | OnCommand (int code) |
| 当父窗口接收到控件的WM_COMMAND时调用该函数
|
|
virtual void | OnControlCommand (WndBase *pControl, int code, int id) |
| 当WM_COMMAND接收到控件命令时调用该函数
|
|
virtual void | OnMenuCommand (int id) |
| 当WM_COMMAND接收到菜单命令时调用该函数
|
|
virtual void | OnAcceleratorCommand (int id) |
| 当WM_COMMAND接收到快捷键命令时调用该函数
|
|
virtual void | HandleInitialized (HWND hwnd) |
| 窗口句柄初始化完成
|
|
virtual void | FontChanged (HFONT hfont) |
| 字体改变时调用该函数
|
|
virtual bool | OnSetCursor (HWND hwnd, HitTestResult hitTest, int message, bool &result) |
| 接收到WM_SETCURSOR消息时调用该函数
|
|
virtual bool | OnContextMenu (bool isKeyboardMsg, Point mousePosition) |
| 接收到WM_CONTEXTMENU后调用目标控件的该函数
|
|
virtual bool | OnNotify (NMHDR *pNMHDR, LRESULT &result) |
| 接收到WM_NOTIFY后调用该函数
|
|
virtual bool | OnNotified (NMHDR *pNMHDR, LRESULT &result) |
| 父窗口接收到WM_NOTIFY后且父窗口OnNotify函数返回false时调用发出通知控件的该函数
|
|
virtual bool | OnVerticalScroll (int event, int pos) |
| 接收到WM_VSCROLL时调用目标控件的该函数
|
|
virtual bool | OnHorizontalScroll (int event, int pos) |
| 接收到WM_HSCROLL时调用目标控件的该函数
|
|
virtual bool | OnEnabledChanged (bool newValue) |
| 接收到WM_ENABLE时调用该函数
|
|
virtual bool | OnCtlColor (WndBase *pControl, HDC hdc, HBRUSH &hRetBrush) |
| 接收到WM_CTLCOLORxxx时调用该函数
|
|
virtual bool | OnColor (HDC hdc, HBRUSH &hRetBrush) |
| 父窗口接收到WM_CTLCOLORxxx时调用对应控件的该函数
|
|
virtual void | OnNcHitTest (const Point &testPoint, HitTestResult &result) |
| 接收到WM_NCHITTEST后调用该函数
|
|
virtual bool | OnEraseBackground (HDC hdc, LRESULT &result) |
| 接收到WM_ERASEBKGND时调用该函数
|
|
virtual bool | OnDrawItem (int id, DRAWITEMSTRUCT *pDrawItem) |
| 接收到WM_DRAWITEM时调用该函数
|
|
virtual bool | OnDrawItemSelf (DRAWITEMSTRUCT *pDrawItem) |
| 父窗口接收到WM_DRAWITEM后且父窗口OnDrawItem函数返回false时调用发出通知控件的该函数
|
|
virtual bool | OnMeasureItem (int id, MEASUREITEMSTRUCT *pMeasure) |
| 接收到WM_MEASUREITEM时调用该函数
|
|
virtual bool | OnMeasureItemSelf (MEASUREITEMSTRUCT *pMeasure) |
| 父窗口接收到WM_MEASUREITEM后且父窗口OnMeasureItem函数返回false时调用发出通知控件的该函数
|
|
virtual bool | OnDropFiles (HDROP hDrop) |
| 接收到WM_DROPFILES时调用该函数
|
|