diff --git a/docs/_hwnd_host_8h_source.html b/docs/_hwnd_host_8h_source.html new file mode 100644 index 00000000..8a350ae4 --- /dev/null +++ b/docs/_hwnd_host_8h_source.html @@ -0,0 +1,146 @@ + + +
+ + + + +
+ SimpleWindow
+
+ |
+
+ SimpleWindow
+
+ |
+
+ SimpleWindow
+
+ |
+
成员的完整列表,这些成员属于 sw::HwndHost,包括所有继承而来的类成员
+AddChild(UIElement *element) | sw::UIElement | |
AddChild(UIElement &element) | sw::UIElement | |
AddChild(UIElement *element, uint64_t layoutTag) | sw::UIElement | |
AddChild(UIElement &element, uint64_t layoutTag) | sw::UIElement | |
Arrange(const sw::Rect &finalPosition) override | sw::UIElement | virtual |
BackColor | sw::UIElement | |
BuildWindowCore(HWND hParent)=0 | sw::HwndHost | protectedpure virtual |
ChildCount | sw::UIElement | |
ClearChildren() | sw::UIElement | |
ClientHeight | sw::WndBase | |
ClientRect | sw::WndBase | |
ClientWidth | sw::WndBase | |
Close() | sw::WndBase | |
CollapseWhenHide | sw::UIElement | |
ContextMenu | sw::UIElement | |
Control() | sw::Control | protected |
DefaultWndProc(const ProcMsg &refMsg) | sw::WndBase | protected |
DestroyWindowCore(HWND hwnd)=0 | sw::HwndHost | protectedpure virtual |
Enabled | sw::WndBase | |
Float | sw::UIElement | |
Focused | sw::WndBase | |
Font | sw::WndBase | |
FontChanged(HFONT hfont) | sw::WndBase | protectedvirtual |
FontName | sw::WndBase | |
FontSize | sw::WndBase | |
FontWeight | sw::WndBase | |
GetArrangeOffsetX() | sw::UIElement | protected |
GetArrangeOffsetY() | sw::UIElement | protected |
GetChildBottommost(bool update) | sw::UIElement | protected |
GetChildLayoutAt(int index) override | sw::UIElement | virtual |
GetChildLayoutCount() override | sw::UIElement | virtual |
GetChildRightmost(bool update) | sw::UIElement | protected |
GetDesireSize() override | sw::UIElement | virtual |
GetExtendedStyle() | sw::WndBase | |
GetExtendedStyle(LONG_PTR mask) | sw::WndBase | |
GetFontHandle() | sw::WndBase | |
GetLayoutTag() override | sw::UIElement | virtual |
GetNextElement() | sw::UIElement | |
GetNextTabStopElement() | sw::UIElement | |
GetRealBackColor() | sw::UIElement | |
GetRealTextColor() | sw::UIElement | |
GetRootElement() | sw::UIElement | |
GetStyle() | sw::WndBase | |
GetStyle(LONG_PTR mask) | sw::WndBase | |
GetTag() override | sw::UIElement | virtual |
GetText() | sw::WndBase | protectedvirtual |
GetWndBase(HWND hwnd) | sw::WndBase | static |
Handle | sw::WndBase | |
HandleChenged() | sw::Control | protectedvirtual |
HandleInitialized(HWND hwnd) | sw::WndBase | protectedvirtual |
Height | sw::WndBase | |
HorizontalAlignment | sw::UIElement | |
IndexOf(UIElement *element) | sw::UIElement | |
IndexOf(UIElement &element) | sw::UIElement | |
InheritTextColor | sw::UIElement | |
InitControl(LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle) | sw::WndBase | protected |
InitHwndHost() | sw::HwndHost | protected |
InitWindow(LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle) | sw::WndBase | protected |
IsControl() | sw::WndBase | |
IsDestroyed | sw::WndBase | |
IsRootElement() | sw::UIElement | |
IsRoutedEventRegistered(RoutedEventType eventType) | sw::UIElement | |
IsVisible() | sw::WndBase | |
LayoutTag | sw::UIElement | |
Left | sw::WndBase | |
Margin | sw::UIElement | |
Measure(const Size &availableSize) override | sw::UIElement | virtual |
MoveToBottom() | sw::UIElement | |
MoveToTop() | sw::UIElement | |
NcHitTest(const Point &testPoint) | sw::WndBase | |
Notify | sw::StaticControl | |
NotifyLayoutUpdated() | sw::UIElement | protected |
OnAcceleratorCommand(int id) | sw::WndBase | protectedvirtual |
OnAddedChild(UIElement &element) | sw::UIElement | protectedvirtual |
OnChar(wchar_t ch, KeyFlags flags) override | sw::UIElement | protectedvirtual |
OnClose() override | sw::UIElement | protectedvirtual |
OnColor(HDC hdc, HBRUSH &hRetBrush) override | sw::UIElement | protectedvirtual |
OnCommand(int code) | sw::WndBase | protectedvirtual |
OnContextMenu(bool isKeyboardMsg, Point mousePosition) override | sw::UIElement | protectedvirtual |
OnControlCommand(WndBase *pControl, int code, int id) | sw::WndBase | protectedvirtual |
OnCreate() | sw::WndBase | protectedvirtual |
OnCtlColor(WndBase *pControl, HDC hdc, HBRUSH &hRetBrush) | sw::WndBase | protectedvirtual |
OnDeadChar(wchar_t ch, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnDestroy() override | sw::HwndHost | protectedvirtual |
OnDrawFocusRect() | sw::UIElement | protectedvirtual |
OnDrawItem(int id, DRAWITEMSTRUCT *pDrawItem) | sw::WndBase | protectedvirtual |
OnEnabledChanged(bool newValue) | sw::WndBase | protectedvirtual |
OnEndPaint() override | sw::UIElement | protectedvirtual |
OnEraseBackground(int &result) | sw::WndBase | protectedvirtual |
OnHorizontalScroll(int event, int pos) | sw::WndBase | protectedvirtual |
OnKeyDown(VirtualKey key, KeyFlags flags) override | sw::UIElement | protectedvirtual |
OnKeyUp(VirtualKey key, KeyFlags flags) override | sw::UIElement | protectedvirtual |
OnKillFocus(HWND hNextFocus) override | sw::UIElement | protectedvirtual |
OnMenuCommand(int id) override | sw::UIElement | protectedvirtual |
OnMouseLeave() override | sw::UIElement | protectedvirtual |
OnMouseLeftButtonDoubleClick(Point mousePosition, MouseKey keyState) | sw::WndBase | protectedvirtual |
OnMouseLeftButtonDown(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseLeftButtonUp(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseMiddleButtonDoubleClick(Point mousePosition, MouseKey keyState) | sw::WndBase | protectedvirtual |
OnMouseMiddleButtonDown(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseMiddleButtonUp(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseMove(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseRightButtonDoubleClick(Point mousePosition, MouseKey keyState) | sw::WndBase | protectedvirtual |
OnMouseRightButtonDown(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseRightButtonUp(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseWheel(int wheelDelta, Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMove(Point newClientPosition) override | sw::UIElement | protectedvirtual |
OnNcHitTest(const Point &testPoint, HitTestResult &result) | sw::WndBase | protectedvirtual |
OnNotified(NMHDR *pNMHDR) | sw::WndBase | protectedvirtual |
OnNotify(NMHDR *pNMHDR) | sw::WndBase | protectedvirtual |
OnPaint() | sw::WndBase | protectedvirtual |
OnRemovedChild(UIElement &element) | sw::UIElement | protectedvirtual |
OnSetCursor(HWND hwnd, HitTestResult hitTest, int message, bool &result) override | sw::UIElement | protectedvirtual |
OnSetFocus(HWND hPrevFocus) override | sw::UIElement | protectedvirtual |
OnSize(Size newClientSize) override | sw::HwndHost | protectedvirtual |
OnSysChar(wchar_t ch, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnSysDeadChar(wchar_t ch, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnSysKeyDown(VirtualKey key, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnSysKeyUp(VirtualKey key, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnTabStop() | sw::UIElement | protectedvirtual |
OnTextChanged() override | sw::UIElement | protectedvirtual |
OnVerticalScroll(int event, int pos) | sw::WndBase | protectedvirtual |
operator=(const WndBase &)=delete (定义于 sw::WndBase) | sw::WndBase | protected |
operator=(WndBase &&)=delete (定义于 sw::WndBase) | sw::WndBase | protected |
operator[](int index) const | sw::UIElement | |
Parent | sw::UIElement | |
ParentChanged(WndBase *newParent) override | sw::UIElement | protectedvirtual |
PointFromScreen(const Point &screenPoint) | sw::WndBase | |
PointToScreen(const Point &point) | sw::WndBase | |
RaiseRoutedEvent(RoutedEventType eventType) | sw::UIElement | protected |
RaiseRoutedEvent(RoutedEventArgs &eventArgs) | sw::UIElement | protected |
Rect | sw::WndBase | |
Redraw(bool erase=false) | sw::WndBase | |
RegisterRoutedEvent(RoutedEventType eventType, const RoutedEvent &handler) | sw::UIElement | |
RegisterRoutedEvent(RoutedEventType eventType, T &obj, void(T::*handler)(UIElement &, RoutedEventArgs &)) | sw::UIElement | inline |
RegisterRoutedEvent(std::function< void(UIElement &, TEventArgs &)> handler) | sw::UIElement | inline |
RegisterRoutedEvent(THandleObj &obj, void(THandleObj::*handler)(UIElement &, TEventArgs &)) | sw::UIElement | inline |
RemoveChild(UIElement *element) | sw::UIElement | |
RemoveChild(UIElement &element) | sw::UIElement | |
RemoveChildAt(int index) | sw::UIElement | |
ResetCursor() | sw::UIElement | |
ResetHandle() | sw::Control | protected |
SendMessageA(UINT uMsg, WPARAM wParam, LPARAM lParam) | sw::WndBase | |
SendMessageW(UINT uMsg, WPARAM wParam, LPARAM lParam) | sw::WndBase | |
SetAlignment(sw::HorizontalAlignment horz, sw::VerticalAlignment vert) | sw::UIElement | |
SetBackColor(Color color, bool redraw) | sw::UIElement | protectedvirtual |
SetCursor(HCURSOR hCursor) | sw::UIElement | |
SetCursor(StandardCursor cursor) | sw::UIElement | |
SetDesireSize(const Size &size) override | sw::UIElement | virtual |
SetExtendedStyle(LONG_PTR style) | sw::WndBase | |
SetExtendedStyle(LONG_PTR mask, bool value) | sw::WndBase | |
SetNextTabStopFocus() | sw::UIElement | protected |
SetParent(WndBase *parent) override | sw::UIElement | protectedvirtual |
SetStyle(LONG_PTR style) | sw::WndBase | |
SetStyle(LONG_PTR mask, bool value) | sw::WndBase | |
SetTag(uint64_t tag) override | sw::UIElement | virtual |
SetText(const std::wstring &value) | sw::WndBase | protectedvirtual |
SetTextColor(Color color, bool redraw) | sw::UIElement | protectedvirtual |
Show(int nCmdShow) | sw::WndBase | |
ShowContextMenu(const Point &point) | sw::UIElement | |
StaticControl() | sw::StaticControl | |
TabStop | sw::UIElement | |
Tag | sw::UIElement | |
Text | sw::WndBase | |
TextColor | sw::UIElement | |
Top | sw::WndBase | |
Transparent | sw::UIElement | |
UIElement() | sw::UIElement | protected |
UnregisterRoutedEvent(RoutedEventType eventType) | sw::UIElement | |
Update() | sw::WndBase | |
UpdateChildrenZOrder() | sw::UIElement | protected |
UpdateFont() | sw::WndBase | |
UpdateSiblingsZOrder() | sw::UIElement | protected |
UpdateText() | sw::WndBase | protected |
VerticalAlignment | sw::UIElement | |
Visible | sw::WndBase | |
VisibleChanged(bool newVisible) override | sw::UIElement | protectedvirtual |
Width | sw::WndBase | |
WndBase() | sw::WndBase | protected |
WndBase(const WndBase &)=delete (定义于 sw::WndBase) | sw::WndBase | protected |
WndBase(WndBase &&)=delete (定义于 sw::WndBase) | sw::WndBase | protected |
WndProc(const ProcMsg &refMsg) | sw::WndBase | protectedvirtual |
~Control()=0 | sw::Control | pure virtual |
~UIElement()=0 | sw::UIElement | pure virtual |
~WndBase()=0 | sw::WndBase | pure virtual |
+ SimpleWindow
+
+ |
+
将Win32 window托管为SimpleWindow控件 + 更多...
+ +#include <HwndHost.h>
+Protected 成员函数 | |
+void | InitHwndHost () |
子类需要调用该函数以初始化HwndHost,该函数会调用BuildWindowCore | |
virtual bool | OnSize (Size newClientSize) override |
接收到WM_SIZE时调用该函数 | |
virtual bool | OnDestroy () override |
接收到WM_DESTROY时调用该函数 | |
virtual HWND | BuildWindowCore (HWND hParent)=0 |
HwndHost创建时会调用该函数,需在该函数中创建要被托管的窗口句柄,设置其父窗口并返回被托管的句柄 | |
virtual void | DestroyWindowCore (HWND hwnd)=0 |
HwndHost被销毁时会调用该函数来销毁被托管的窗口句柄 | |
Protected 成员函数 继承自 sw::Control | |
+ | Control () |
初始化控件 | |
+void | ResetHandle () |
销毁控件句柄并重新初始化,该操作会创建新的句柄并设置样式、文本、字体等 | |
+virtual void | HandleChenged () |
控件句柄发生改变时调用该函数 | |
Protected 成员函数 继承自 sw::UIElement | |
+ | UIElement () |
初始化UIElement | |
void | RaiseRoutedEvent (RoutedEventType eventType) |
触发路由事件 | |
void | RaiseRoutedEvent (RoutedEventArgs &eventArgs) |
触发路由事件 | |
+void | NotifyLayoutUpdated () |
通知顶级窗口布局改变 | |
+double & | GetArrangeOffsetX () |
获取Arrange时子元素的水平偏移量 | |
+double & | GetArrangeOffsetY () |
获取Arrange时子元素的垂直偏移量 | |
double | GetChildRightmost (bool update) |
获取所有子元素在当前元素中最右边的位置(只考虑参与布局的子窗口且忽略悬浮的元素) | |
double | GetChildBottommost (bool update) |
获取所有子元素在当前元素中最底边的位置(只考虑参与布局的子窗口且忽略悬浮的元素) | |
+void | UpdateChildrenZOrder () |
更新子元素的Z轴位置 | |
+void | UpdateSiblingsZOrder () |
更新兄弟元素的Z轴位置 | |
+void | SetNextTabStopFocus () |
设置下一个TabStop属性为true的元素为焦点元素 | |
virtual void | SetBackColor (Color color, bool redraw) |
设置背景颜色 | |
virtual void | SetTextColor (Color color, bool redraw) |
设置文本颜色 | |
virtual void | OnAddedChild (UIElement &element) |
添加子元素后调用该函数 | |
virtual void | OnRemovedChild (UIElement &element) |
移除子元素后调用该函数 | |
+virtual void | OnTabStop () |
通过tab键将焦点移动到当前元素时调用该函数 | |
virtual void | OnDrawFocusRect () |
绘制虚线框时调用该函数 | |
virtual bool | SetParent (WndBase *parent) override |
设置父窗口 | |
virtual void | ParentChanged (WndBase *newParent) override |
父窗口改变时调用此函数 | |
virtual void | OnEndPaint () override |
在OnPaint函数完成之后调用该函数 | |
virtual bool | OnClose () override |
接收到WM_CLOSE时调用该函数 | |
virtual bool | OnMove (Point newClientPosition) override |
接收到WM_MOVE时调用该函数 | |
virtual void | OnTextChanged () override |
Text属性更改时调用此函数 | |
virtual void | VisibleChanged (bool newVisible) override |
Visible属性改变时调用此函数 | |
virtual bool | OnSetFocus (HWND hPrevFocus) override |
接收到WM_SETFOCUS时调用该函数 | |
virtual bool | OnKillFocus (HWND hNextFocus) override |
接收到WM_KILLFOCUS时调用该函数 | |
virtual bool | OnChar (wchar_t ch, KeyFlags flags) override |
接收到WM_CHAR时调用该函数 | |
virtual bool | OnKeyDown (VirtualKey key, KeyFlags flags) override |
接收到WM_KEYDOWN时调用该函数 | |
virtual bool | OnKeyUp (VirtualKey key, KeyFlags flags) override |
接收到WM_KEYUP时调用该函数 | |
virtual bool | OnMouseMove (Point mousePosition, MouseKey keyState) override |
接收到WM_MOUSEMOVE时调用该函数 | |
virtual bool | OnMouseLeave () override |
接收到WM_MOUSELEAVE时调用该函数 | |
virtual bool | OnMouseWheel (int wheelDelta, Point mousePosition, MouseKey keyState) override |
接收到WM_MOUSEWHEEL时调用该函数 | |
virtual bool | OnMouseLeftButtonDown (Point mousePosition, MouseKey keyState) override |
接收到WM_LBUTTONDOWN时调用该函数 | |
virtual bool | OnMouseLeftButtonUp (Point mousePosition, MouseKey keyState) override |
接收到WM_LBUTTONUP时调用该函数 | |
virtual bool | OnMouseRightButtonDown (Point mousePosition, MouseKey keyState) override |
接收到WM_RBUTTONDOWN时调用该函数 | |
virtual bool | OnMouseRightButtonUp (Point mousePosition, MouseKey keyState) override |
接收到WM_RBUTTONUP时调用该函数 | |
virtual bool | OnMouseMiddleButtonDown (Point mousePosition, MouseKey keyState) override |
接收到WM_MBUTTONDOWN时调用该函数 | |
virtual bool | OnMouseMiddleButtonUp (Point mousePosition, MouseKey keyState) override |
接收到WM_MBUTTONUP时调用该函数 | |
virtual bool | OnContextMenu (bool isKeyboardMsg, Point mousePosition) override |
接收到WM_CONTEXTMENU后调用目标控件的该函数 | |
virtual void | OnMenuCommand (int id) override |
当WM_COMMAND接收到菜单命令时调用该函数 | |
virtual bool | OnColor (HDC hdc, HBRUSH &hRetBrush) override |
父窗口接收到WM_CTLCOLORxxx时调用对应控件的该函数 | |
virtual bool | OnSetCursor (HWND hwnd, HitTestResult hitTest, int message, bool &result) override |
接收到WM_SETCURSOR消息时调用该函数 | |
Protected 成员函数 继承自 sw::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) |
初始化为控件,该函数会调用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 | OnPaint () |
接收到WM_PAINT时调用该函数 | |
virtual bool | OnMouseLeftButtonDoubleClick (Point mousePosition, MouseKey keyState) |
接收到WM_LBUTTONDBLCLK时调用该函数 | |
virtual bool | OnMouseRightButtonDoubleClick (Point mousePosition, MouseKey keyState) |
接收到WM_RBUTTONDBLCLK时调用该函数 | |
virtual bool | OnMouseMiddleButtonDoubleClick (Point mousePosition, MouseKey keyState) |
接收到WM_MBUTTONDBLCLK时调用该函数 | |
virtual bool | OnDeadChar (wchar_t ch, KeyFlags flags) |
接收到WM_DEADCHAR时调用该函数 | |
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 | OnCommand (int code) |
当父窗口接收到控件的WM_COMMAND时调用该函数 | |
virtual void | OnControlCommand (WndBase *pControl, int code, int id) |
当WM_COMMAND接收到控件命令时调用该函数 | |
virtual void | OnAcceleratorCommand (int id) |
当WM_COMMAND接收到快捷键命令时调用该函数 | |
virtual void | HandleInitialized (HWND hwnd) |
窗口句柄初始化完成 | |
virtual void | FontChanged (HFONT hfont) |
字体改变时调用该函数 | |
virtual bool | OnNotify (NMHDR *pNMHDR) |
接收到WM_NOTIFY后调用该函数 | |
virtual void | OnNotified (NMHDR *pNMHDR) |
父窗口接收到WM_NOTIFY后调用发出通知控件的该函数 | |
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 void | OnNcHitTest (const Point &testPoint, HitTestResult &result) |
接收到WM_NCHITTEST后调用该函数 | |
virtual bool | OnEraseBackground (int &result) |
接收到WM_ERASEBKGND时调用该函数 | |
virtual bool | OnDrawItem (int id, DRAWITEMSTRUCT *pDrawItem) |
接收到WM_DRAWITEM时调用该函数 | |
+额外继承的成员函数 | |
Public 成员函数 继承自 sw::StaticControl | |
+ | StaticControl () |
初始化静态控件 | |
Public 成员函数 继承自 sw::Control | |
+virtual | ~Control ()=0 |
析构函数,这里用纯虚函数使该类成为抽象类 | |
Public 成员函数 继承自 sw::UIElement | |
+virtual | ~UIElement ()=0 |
析构函数,这里用纯虚函数使该类成为抽象类 | |
void | RegisterRoutedEvent (RoutedEventType eventType, const RoutedEvent &handler) |
注册路由事件处理函数,当事件已注册时会覆盖已注册的函数 | |
template<typename T > | |
void | RegisterRoutedEvent (RoutedEventType eventType, T &obj, void(T::*handler)(UIElement &, RoutedEventArgs &)) |
注册成员函数作为路由事件处理函数,当事件已注册时会覆盖已注册的函数 | |
template<typename TEventArgs , typename std::enable_if< std::is_base_of< RoutedEventArgs, TEventArgs >::value, int >::type = 0, typename std::enable_if< sw::_IsTypedRoutedEventArgs< TEventArgs >::value, int >::type = 0> | |
void | RegisterRoutedEvent (std::function< void(UIElement &, TEventArgs &)> handler) |
根据事件参数类型注册路由事件 | |
template<typename TEventArgs , typename THandleObj , typename std::enable_if< std::is_base_of< RoutedEventArgs, TEventArgs >::value, int >::type = 0, typename std::enable_if< sw::_IsTypedRoutedEventArgs< TEventArgs >::value, int >::type = 0> | |
void | RegisterRoutedEvent (THandleObj &obj, void(THandleObj::*handler)(UIElement &, TEventArgs &)) |
根据事件参数类型注册成员函数作为路由事件 | |
void | UnregisterRoutedEvent (RoutedEventType eventType) |
取消对应类型路由事件的注册 | |
bool | IsRoutedEventRegistered (RoutedEventType eventType) |
判断路由事件是否已被注册 | |
bool | AddChild (UIElement *element) |
添加子控件 | |
bool | AddChild (UIElement &element) |
添加子控件 | |
bool | AddChild (UIElement *element, uint64_t layoutTag) |
添加子控件并设置布局标记 | |
bool | AddChild (UIElement &element, uint64_t layoutTag) |
添加子控件并设置布局标记 | |
bool | RemoveChildAt (int index) |
移除指定索引处的子控件 | |
bool | RemoveChild (UIElement *element) |
移除子控件 | |
bool | RemoveChild (UIElement &element) |
移除子控件 | |
+void | ClearChildren () |
移除所有子控件 | |
int | IndexOf (UIElement *element) |
获取指定元素的索引 | |
int | IndexOf (UIElement &element) |
获取指定元素的索引 | |
+UIElement & | operator[] (int index) const |
通过索引获取子控件 | |
void | ShowContextMenu (const Point &point) |
弹出当前元素的上下文菜单 | |
+void | MoveToTop () |
移动到界面顶部 | |
+void | MoveToBottom () |
移动到界面底部 | |
+bool | IsRootElement () |
判断当前元素是否为根节点 | |
+UIElement * | GetRootElement () |
获取当前元素所在界面树的根节点 | |
+UIElement * | GetNextElement () |
获取当前元素在界面树上的下一个节点,若已是最后一个节点则返回根节点 | |
+UIElement * | GetNextTabStopElement () |
获取下一个TabStop属性为true的元素 | |
+Color | GetRealBackColor () |
获取当前要显示的背景颜色:当Transparent为true时获取到祖先节点中首个Transparent为false的背景颜色,否则返回当前元素的背景颜色 | |
+Color | GetRealTextColor () |
获取当前要显示的文本颜色:当InheritTextColor为true时获取到祖先节点中首个InheritTextColor为false的文本颜色,否则返回当前元素的文本颜色 | |
void | SetCursor (HCURSOR hCursor) |
设置鼠标样式 | |
void | SetCursor (StandardCursor cursor) |
设置鼠标样式 | |
+void | ResetCursor () |
将鼠标样式设置为默认样式 | |
void | SetAlignment (sw::HorizontalAlignment horz, sw::VerticalAlignment vert) |
设置对齐方式 | |
virtual uint64_t | GetTag () override |
获取Tag | |
virtual void | SetTag (uint64_t tag) override |
设置Tag | |
virtual uint64_t | GetLayoutTag () override |
获取布局标记 | |
virtual int | GetChildLayoutCount () override |
获取参与布局的子控件数量 | |
virtual ILayout & | GetChildLayoutAt (int index) override |
获取对应索引处的子控件,使用此函数前必须先调用GetChildLayoutCount | |
virtual Size | GetDesireSize () override |
获取控件所需尺寸 | |
virtual void | SetDesireSize (const Size &size) override |
设置当前控件所需的尺寸 | |
virtual void | Measure (const Size &availableSize) override |
测量控件所需尺寸 | |
virtual void | Arrange (const sw::Rect &finalPosition) override |
安排控件位置 | |
Public 成员函数 继承自 sw::WndBase | |
+virtual | ~WndBase ()=0 |
析构函数,这里用纯虚函数使该类成为抽象类 | |
+void | Show (int nCmdShow) |
该函数调用ShowWindow | |
+void | Close () |
发送关闭消息 | |
+void | Update () |
该函数调用UpdateWindow | |
+void | UpdateFont () |
更新字体 | |
+HFONT | GetFontHandle () |
获取字体句柄 | |
void | Redraw (bool erase=false) |
重画 | |
+bool | IsControl () |
判断当前对象是否是控件 | |
+bool | IsVisible () |
判断当前对象在界面中是否可视,与Visible属性不同的是该函数返回值会受父窗口的影响 | |
+LONG_PTR | GetStyle () |
获取窗口样式 | |
+void | SetStyle (LONG_PTR style) |
设置窗口样式 | |
bool | GetStyle (LONG_PTR mask) |
判断窗口是否设有指定样式 | |
void | SetStyle (LONG_PTR mask, bool value) |
打开或关闭指定的样式 | |
+LONG_PTR | GetExtendedStyle () |
获取扩展窗口样式 | |
+void | SetExtendedStyle (LONG_PTR style) |
设置扩展窗口样式 | |
bool | GetExtendedStyle (LONG_PTR mask) |
判断窗口是否设有指定扩展样式 | |
void | SetExtendedStyle (LONG_PTR 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) | |
HitTestResult | NcHitTest (const Point &testPoint) |
测试指定点在窗口的哪一部分 | |
静态 Public 成员函数 继承自 sw::WndBase | |
static WndBase * | GetWndBase (HWND hwnd) |
通过窗口句柄获取WndBase | |
Public 属性 继承自 sw::StaticControl | |
+const Property< bool > | Notify |
获取或设置控件的SS_NOTIFY样式 | |
Public 属性 继承自 sw::UIElement | |
+const Property< Thickness > | Margin |
边距 | |
+const Property< HorizontalAlignment > | HorizontalAlignment |
水平对齐方式 | |
+const Property< VerticalAlignment > | VerticalAlignment |
垂直对齐方式 | |
+const ReadOnlyProperty< int > | ChildCount |
子控件数量 | |
+const Property< bool > | CollapseWhenHide |
是否在不可见时不参与布局 | |
+const ReadOnlyProperty< UIElement * > | Parent |
指向父元素的指针,当前元素为顶级窗口时该值为nullptr | |
+const Property< uint64_t > | Tag |
储存用户自定义信息的标记 | |
+const Property< uint64_t > | LayoutTag |
布局标记,对于不同的布局有不同含义 | |
+const Property< sw::ContextMenu * > | ContextMenu |
右键按下时弹出的菜单 | |
+const Property< bool > | Float |
元素是否悬浮,若元素悬浮则该元素不会随滚动条滚动而改变位置 | |
+const Property< bool > | TabStop |
表示用户是否可以通过按下Tab键将焦点移动到当前元素 | |
+const Property< Color > | BackColor |
背景颜色,修改该属性会同时将Transparent属性设为false,对于部分控件该属性可能不生效 | |
+const Property< Color > | TextColor |
文本颜色,修改该属性会同时将InheritTextColor属性设为false,对于部分控件该属性可能不生效 | |
+const Property< bool > | Transparent |
是否使用透明背景(此属性并非真正意义上的透明,将该属性设为true可继承父元素的背景颜色) | |
+const Property< bool > | InheritTextColor |
是否继承父元素的文本颜色 | |
Public 属性 继承自 sw::WndBase | |
+const ReadOnlyProperty< HWND > | Handle |
窗口句柄 | |
+const Property< sw::Font > | Font |
字体 | |
+const Property< std::wstring > | FontName |
字体名称 | |
+const Property< double > | FontSize |
字体大小 | |
+const Property< sw::FontWeight > | FontWeight |
字体粗细 | |
+const Property< sw::Rect > | Rect |
位置和尺寸 | |
+const Property< double > | Left |
左边 | |
+const Property< double > | Top |
顶边 | |
+const Property< double > | Width |
宽度 | |
+const Property< double > | Height |
高度 | |
+const ReadOnlyProperty< sw::Rect > | ClientRect |
用户区尺寸 | |
+const ReadOnlyProperty< double > | ClientWidth |
用户区宽度 | |
+const ReadOnlyProperty< double > | ClientHeight |
用户区高度 | |
+const Property< bool > | Enabled |
窗口或控件是否可用 | |
+const Property< bool > | Visible |
窗口或控件是否可见 | |
+const Property< std::wstring > | Text |
窗口标题或控件文本 | |
+const Property< bool > | Focused |
窗口是否拥有焦点 | |
+const ReadOnlyProperty< WndBase * > | Parent |
父窗口 | |
+const ReadOnlyProperty< bool > | IsDestroyed |
是否已销毁,当该值为true时不应该继续使用当前对象 | |
将Win32 window托管为SimpleWindow控件
+
+
|
+ +protectedpure virtual | +
HwndHost创建时会调用该函数,需在该函数中创建要被托管的窗口句柄,设置其父窗口并返回被托管的句柄
+hParent | 需要给被托管窗口句柄设置的父窗口句柄 |
+
|
+ +protectedpure virtual | +
HwndHost被销毁时会调用该函数来销毁被托管的窗口句柄
+hwnd | 被托管窗口句柄 |
+
|
+ +overrideprotectedvirtual | +
接收到WM_SIZE时调用该函数
+newClientSize | 改变后的用户区尺寸 |
重载 sw::UIElement .
+ +
+ SimpleWindow
+
+ |
+
成员的完整列表,这些成员属于 sw::Splitter,包括所有继承而来的类成员
+AddChild(UIElement *element) | sw::UIElement | |
AddChild(UIElement &element) | sw::UIElement | |
AddChild(UIElement *element, uint64_t layoutTag) | sw::UIElement | |
AddChild(UIElement &element, uint64_t layoutTag) | sw::UIElement | |
Arrange(const sw::Rect &finalPosition) override | sw::UIElement | virtual |
BackColor | sw::UIElement | |
ChildCount | sw::UIElement | |
ClearChildren() | sw::UIElement | |
ClientHeight | sw::WndBase | |
ClientRect | sw::WndBase | |
ClientWidth | sw::WndBase | |
Close() | sw::WndBase | |
CollapseWhenHide | sw::UIElement | |
ContextMenu | sw::UIElement | |
Control() | sw::Control | protected |
DefaultWndProc(const ProcMsg &refMsg) | sw::WndBase | protected |
Enabled | sw::WndBase | |
Float | sw::UIElement | |
Focused | sw::WndBase | |
Font | sw::WndBase | |
FontChanged(HFONT hfont) | sw::WndBase | protectedvirtual |
FontName | sw::WndBase | |
FontSize | sw::WndBase | |
FontWeight | sw::WndBase | |
GetArrangeOffsetX() | sw::UIElement | protected |
GetArrangeOffsetY() | sw::UIElement | protected |
GetChildBottommost(bool update) | sw::UIElement | protected |
GetChildLayoutAt(int index) override | sw::UIElement | virtual |
GetChildLayoutCount() override | sw::UIElement | virtual |
GetChildRightmost(bool update) | sw::UIElement | protected |
GetDesireSize() override | sw::UIElement | virtual |
GetExtendedStyle() | sw::WndBase | |
GetExtendedStyle(LONG_PTR mask) | sw::WndBase | |
GetFontHandle() | sw::WndBase | |
GetLayoutTag() override | sw::UIElement | virtual |
GetNextElement() | sw::UIElement | |
GetNextTabStopElement() | sw::UIElement | |
GetRealBackColor() | sw::UIElement | |
GetRealTextColor() | sw::UIElement | |
GetRootElement() | sw::UIElement | |
GetStyle() | sw::WndBase | |
GetStyle(LONG_PTR mask) | sw::WndBase | |
GetTag() override | sw::UIElement | virtual |
GetText() | sw::WndBase | protectedvirtual |
GetWndBase(HWND hwnd) | sw::WndBase | static |
Handle | sw::WndBase | |
HandleChenged() | sw::Control | protectedvirtual |
HandleInitialized(HWND hwnd) | sw::WndBase | protectedvirtual |
Height | sw::WndBase | |
HorizontalAlignment | sw::UIElement | |
IndexOf(UIElement *element) | sw::UIElement | |
IndexOf(UIElement &element) | sw::UIElement | |
InheritTextColor | sw::UIElement | |
InitControl(LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle) | sw::WndBase | protected |
InitWindow(LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle) | sw::WndBase | protected |
IsControl() | sw::WndBase | |
IsDestroyed | sw::WndBase | |
IsRootElement() | sw::UIElement | |
IsRoutedEventRegistered(RoutedEventType eventType) | sw::UIElement | |
IsVisible() | sw::WndBase | |
LayoutTag | sw::UIElement | |
Left | sw::WndBase | |
Margin | sw::UIElement | |
Measure(const Size &availableSize) override | sw::UIElement | virtual |
MoveToBottom() | sw::UIElement | |
MoveToTop() | sw::UIElement | |
NcHitTest(const Point &testPoint) | sw::WndBase | |
Notify | sw::StaticControl | |
NotifyLayoutUpdated() | sw::UIElement | protected |
OnAcceleratorCommand(int id) | sw::WndBase | protectedvirtual |
OnAddedChild(UIElement &element) | sw::UIElement | protectedvirtual |
OnChar(wchar_t ch, KeyFlags flags) override | sw::UIElement | protectedvirtual |
OnClose() override | sw::UIElement | protectedvirtual |
OnColor(HDC hdc, HBRUSH &hRetBrush) override | sw::UIElement | protectedvirtual |
OnCommand(int code) | sw::WndBase | protectedvirtual |
OnContextMenu(bool isKeyboardMsg, Point mousePosition) override | sw::UIElement | protectedvirtual |
OnControlCommand(WndBase *pControl, int code, int id) | sw::WndBase | protectedvirtual |
OnCreate() | sw::WndBase | protectedvirtual |
OnCtlColor(WndBase *pControl, HDC hdc, HBRUSH &hRetBrush) | sw::WndBase | protectedvirtual |
OnDeadChar(wchar_t ch, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnDestroy() | sw::WndBase | protectedvirtual |
OnDrawFocusRect() | sw::UIElement | protectedvirtual |
OnDrawItem(int id, DRAWITEMSTRUCT *pDrawItem) | sw::WndBase | protectedvirtual |
OnEnabledChanged(bool newValue) | sw::WndBase | protectedvirtual |
OnEndPaint() override | sw::UIElement | protectedvirtual |
OnEraseBackground(int &result) | sw::WndBase | protectedvirtual |
OnHorizontalScroll(int event, int pos) | sw::WndBase | protectedvirtual |
OnKeyDown(VirtualKey key, KeyFlags flags) override | sw::UIElement | protectedvirtual |
OnKeyUp(VirtualKey key, KeyFlags flags) override | sw::UIElement | protectedvirtual |
OnKillFocus(HWND hNextFocus) override | sw::UIElement | protectedvirtual |
OnMenuCommand(int id) override | sw::UIElement | protectedvirtual |
OnMouseLeave() override | sw::UIElement | protectedvirtual |
OnMouseLeftButtonDoubleClick(Point mousePosition, MouseKey keyState) | sw::WndBase | protectedvirtual |
OnMouseLeftButtonDown(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseLeftButtonUp(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseMiddleButtonDoubleClick(Point mousePosition, MouseKey keyState) | sw::WndBase | protectedvirtual |
OnMouseMiddleButtonDown(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseMiddleButtonUp(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseMove(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseRightButtonDoubleClick(Point mousePosition, MouseKey keyState) | sw::WndBase | protectedvirtual |
OnMouseRightButtonDown(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseRightButtonUp(Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMouseWheel(int wheelDelta, Point mousePosition, MouseKey keyState) override | sw::UIElement | protectedvirtual |
OnMove(Point newClientPosition) override | sw::UIElement | protectedvirtual |
OnNcHitTest(const Point &testPoint, HitTestResult &result) | sw::WndBase | protectedvirtual |
OnNotified(NMHDR *pNMHDR) | sw::WndBase | protectedvirtual |
OnNotify(NMHDR *pNMHDR) | sw::WndBase | protectedvirtual |
OnPaint() override | sw::Splitter | protectedvirtual |
OnRemovedChild(UIElement &element) | sw::UIElement | protectedvirtual |
OnSetCursor(HWND hwnd, HitTestResult hitTest, int message, bool &result) override | sw::UIElement | protectedvirtual |
OnSetFocus(HWND hPrevFocus) override | sw::UIElement | protectedvirtual |
OnSize(Size newClientSize) override | sw::Splitter | protectedvirtual |
OnSysChar(wchar_t ch, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnSysDeadChar(wchar_t ch, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnSysKeyDown(VirtualKey key, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnSysKeyUp(VirtualKey key, KeyFlags flags) | sw::WndBase | protectedvirtual |
OnTabStop() | sw::UIElement | protectedvirtual |
OnTextChanged() override | sw::UIElement | protectedvirtual |
OnVerticalScroll(int event, int pos) | sw::WndBase | protectedvirtual |
operator=(const WndBase &)=delete (定义于 sw::WndBase) | sw::WndBase | protected |
operator=(WndBase &&)=delete (定义于 sw::WndBase) | sw::WndBase | protected |
operator[](int index) const | sw::UIElement | |
Orientation | sw::Splitter | |
Parent | sw::UIElement | |
ParentChanged(WndBase *newParent) override | sw::UIElement | protectedvirtual |
PointFromScreen(const Point &screenPoint) | sw::WndBase | |
PointToScreen(const Point &point) | sw::WndBase | |
RaiseRoutedEvent(RoutedEventType eventType) | sw::UIElement | protected |
RaiseRoutedEvent(RoutedEventArgs &eventArgs) | sw::UIElement | protected |
Rect | sw::WndBase | |
Redraw(bool erase=false) | sw::WndBase | |
RegisterRoutedEvent(RoutedEventType eventType, const RoutedEvent &handler) | sw::UIElement | |
RegisterRoutedEvent(RoutedEventType eventType, T &obj, void(T::*handler)(UIElement &, RoutedEventArgs &)) | sw::UIElement | inline |
RegisterRoutedEvent(std::function< void(UIElement &, TEventArgs &)> handler) | sw::UIElement | inline |
RegisterRoutedEvent(THandleObj &obj, void(THandleObj::*handler)(UIElement &, TEventArgs &)) | sw::UIElement | inline |
RemoveChild(UIElement *element) | sw::UIElement | |
RemoveChild(UIElement &element) | sw::UIElement | |
RemoveChildAt(int index) | sw::UIElement | |
ResetCursor() | sw::UIElement | |
ResetHandle() | sw::Control | protected |
SendMessageA(UINT uMsg, WPARAM wParam, LPARAM lParam) | sw::WndBase | |
SendMessageW(UINT uMsg, WPARAM wParam, LPARAM lParam) | sw::WndBase | |
SetAlignment(sw::HorizontalAlignment horz, sw::VerticalAlignment vert) | sw::UIElement | |
SetBackColor(Color color, bool redraw) | sw::UIElement | protectedvirtual |
SetCursor(HCURSOR hCursor) | sw::UIElement | |
SetCursor(StandardCursor cursor) | sw::UIElement | |
SetDesireSize(const Size &size) override | sw::UIElement | virtual |
SetExtendedStyle(LONG_PTR style) | sw::WndBase | |
SetExtendedStyle(LONG_PTR mask, bool value) | sw::WndBase | |
SetNextTabStopFocus() | sw::UIElement | protected |
SetParent(WndBase *parent) override | sw::UIElement | protectedvirtual |
SetStyle(LONG_PTR style) | sw::WndBase | |
SetStyle(LONG_PTR mask, bool value) | sw::WndBase | |
SetTag(uint64_t tag) override | sw::UIElement | virtual |
SetText(const std::wstring &value) | sw::WndBase | protectedvirtual |
SetTextColor(Color color, bool redraw) | sw::UIElement | protectedvirtual |
Show(int nCmdShow) | sw::WndBase | |
ShowContextMenu(const Point &point) | sw::UIElement | |
Splitter() | sw::Splitter | |
StaticControl() | sw::StaticControl | |
TabStop | sw::UIElement | |
Tag | sw::UIElement | |
Text | sw::WndBase | |
TextColor | sw::UIElement | |
Top | sw::WndBase | |
Transparent | sw::UIElement | |
UIElement() | sw::UIElement | protected |
UnregisterRoutedEvent(RoutedEventType eventType) | sw::UIElement | |
Update() | sw::WndBase | |
UpdateChildrenZOrder() | sw::UIElement | protected |
UpdateFont() | sw::WndBase | |
UpdateSiblingsZOrder() | sw::UIElement | protected |
UpdateText() | sw::WndBase | protected |
VerticalAlignment | sw::UIElement | |
Visible | sw::WndBase | |
VisibleChanged(bool newVisible) override | sw::UIElement | protectedvirtual |
Width | sw::WndBase | |
WndBase() | sw::WndBase | protected |
WndBase(const WndBase &)=delete (定义于 sw::WndBase) | sw::WndBase | protected |
WndBase(WndBase &&)=delete (定义于 sw::WndBase) | sw::WndBase | protected |
WndProc(const ProcMsg &refMsg) | sw::WndBase | protectedvirtual |
~Control()=0 | sw::Control | pure virtual |
~UIElement()=0 | sw::UIElement | pure virtual |
~WndBase()=0 | sw::WndBase | pure virtual |
+ SimpleWindow
+
+ |
+
分隔条 + 更多...
+ +#include <Splitter.h>
+Public 成员函数 | |
+ | Splitter () |
初始化分隔条 | |
Public 成员函数 继承自 sw::StaticControl | |
+ | StaticControl () |
初始化静态控件 | |
Public 成员函数 继承自 sw::Control | |
+virtual | ~Control ()=0 |
析构函数,这里用纯虚函数使该类成为抽象类 | |
Public 成员函数 继承自 sw::UIElement | |
+virtual | ~UIElement ()=0 |
析构函数,这里用纯虚函数使该类成为抽象类 | |
void | RegisterRoutedEvent (RoutedEventType eventType, const RoutedEvent &handler) |
注册路由事件处理函数,当事件已注册时会覆盖已注册的函数 | |
template<typename T > | |
void | RegisterRoutedEvent (RoutedEventType eventType, T &obj, void(T::*handler)(UIElement &, RoutedEventArgs &)) |
注册成员函数作为路由事件处理函数,当事件已注册时会覆盖已注册的函数 | |
template<typename TEventArgs , typename std::enable_if< std::is_base_of< RoutedEventArgs, TEventArgs >::value, int >::type = 0, typename std::enable_if< sw::_IsTypedRoutedEventArgs< TEventArgs >::value, int >::type = 0> | |
void | RegisterRoutedEvent (std::function< void(UIElement &, TEventArgs &)> handler) |
根据事件参数类型注册路由事件 | |
template<typename TEventArgs , typename THandleObj , typename std::enable_if< std::is_base_of< RoutedEventArgs, TEventArgs >::value, int >::type = 0, typename std::enable_if< sw::_IsTypedRoutedEventArgs< TEventArgs >::value, int >::type = 0> | |
void | RegisterRoutedEvent (THandleObj &obj, void(THandleObj::*handler)(UIElement &, TEventArgs &)) |
根据事件参数类型注册成员函数作为路由事件 | |
void | UnregisterRoutedEvent (RoutedEventType eventType) |
取消对应类型路由事件的注册 | |
bool | IsRoutedEventRegistered (RoutedEventType eventType) |
判断路由事件是否已被注册 | |
bool | AddChild (UIElement *element) |
添加子控件 | |
bool | AddChild (UIElement &element) |
添加子控件 | |
bool | AddChild (UIElement *element, uint64_t layoutTag) |
添加子控件并设置布局标记 | |
bool | AddChild (UIElement &element, uint64_t layoutTag) |
添加子控件并设置布局标记 | |
bool | RemoveChildAt (int index) |
移除指定索引处的子控件 | |
bool | RemoveChild (UIElement *element) |
移除子控件 | |
bool | RemoveChild (UIElement &element) |
移除子控件 | |
+void | ClearChildren () |
移除所有子控件 | |
int | IndexOf (UIElement *element) |
获取指定元素的索引 | |
int | IndexOf (UIElement &element) |
获取指定元素的索引 | |
+UIElement & | operator[] (int index) const |
通过索引获取子控件 | |
void | ShowContextMenu (const Point &point) |
弹出当前元素的上下文菜单 | |
+void | MoveToTop () |
移动到界面顶部 | |
+void | MoveToBottom () |
移动到界面底部 | |
+bool | IsRootElement () |
判断当前元素是否为根节点 | |
+UIElement * | GetRootElement () |
获取当前元素所在界面树的根节点 | |
+UIElement * | GetNextElement () |
获取当前元素在界面树上的下一个节点,若已是最后一个节点则返回根节点 | |
+UIElement * | GetNextTabStopElement () |
获取下一个TabStop属性为true的元素 | |
+Color | GetRealBackColor () |
获取当前要显示的背景颜色:当Transparent为true时获取到祖先节点中首个Transparent为false的背景颜色,否则返回当前元素的背景颜色 | |
+Color | GetRealTextColor () |
获取当前要显示的文本颜色:当InheritTextColor为true时获取到祖先节点中首个InheritTextColor为false的文本颜色,否则返回当前元素的文本颜色 | |
void | SetCursor (HCURSOR hCursor) |
设置鼠标样式 | |
void | SetCursor (StandardCursor cursor) |
设置鼠标样式 | |
+void | ResetCursor () |
将鼠标样式设置为默认样式 | |
void | SetAlignment (sw::HorizontalAlignment horz, sw::VerticalAlignment vert) |
设置对齐方式 | |
virtual uint64_t | GetTag () override |
获取Tag | |
virtual void | SetTag (uint64_t tag) override |
设置Tag | |
virtual uint64_t | GetLayoutTag () override |
获取布局标记 | |
virtual int | GetChildLayoutCount () override |
获取参与布局的子控件数量 | |
virtual ILayout & | GetChildLayoutAt (int index) override |
获取对应索引处的子控件,使用此函数前必须先调用GetChildLayoutCount | |
virtual Size | GetDesireSize () override |
获取控件所需尺寸 | |
virtual void | SetDesireSize (const Size &size) override |
设置当前控件所需的尺寸 | |
virtual void | Measure (const Size &availableSize) override |
测量控件所需尺寸 | |
virtual void | Arrange (const sw::Rect &finalPosition) override |
安排控件位置 | |
Public 成员函数 继承自 sw::WndBase | |
+virtual | ~WndBase ()=0 |
析构函数,这里用纯虚函数使该类成为抽象类 | |
+void | Show (int nCmdShow) |
该函数调用ShowWindow | |
+void | Close () |
发送关闭消息 | |
+void | Update () |
该函数调用UpdateWindow | |
+void | UpdateFont () |
更新字体 | |
+HFONT | GetFontHandle () |
获取字体句柄 | |
void | Redraw (bool erase=false) |
重画 | |
+bool | IsControl () |
判断当前对象是否是控件 | |
+bool | IsVisible () |
判断当前对象在界面中是否可视,与Visible属性不同的是该函数返回值会受父窗口的影响 | |
+LONG_PTR | GetStyle () |
获取窗口样式 | |
+void | SetStyle (LONG_PTR style) |
设置窗口样式 | |
bool | GetStyle (LONG_PTR mask) |
判断窗口是否设有指定样式 | |
void | SetStyle (LONG_PTR mask, bool value) |
打开或关闭指定的样式 | |
+LONG_PTR | GetExtendedStyle () |
获取扩展窗口样式 | |
+void | SetExtendedStyle (LONG_PTR style) |
设置扩展窗口样式 | |
bool | GetExtendedStyle (LONG_PTR mask) |
判断窗口是否设有指定扩展样式 | |
void | SetExtendedStyle (LONG_PTR 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) | |
HitTestResult | NcHitTest (const Point &testPoint) |
测试指定点在窗口的哪一部分 | |
+Public 属性 | |
+const Property< Orientation > | Orientation |
分隔条的方向,给该属性赋值同时会改变HorizontalAlignment和VerticalAlignment属性的值 | |
Public 属性 继承自 sw::StaticControl | |
+const Property< bool > | Notify |
获取或设置控件的SS_NOTIFY样式 | |
Public 属性 继承自 sw::UIElement | |
+const Property< Thickness > | Margin |
边距 | |
+const Property< HorizontalAlignment > | HorizontalAlignment |
水平对齐方式 | |
+const Property< VerticalAlignment > | VerticalAlignment |
垂直对齐方式 | |
+const ReadOnlyProperty< int > | ChildCount |
子控件数量 | |
+const Property< bool > | CollapseWhenHide |
是否在不可见时不参与布局 | |
+const ReadOnlyProperty< UIElement * > | Parent |
指向父元素的指针,当前元素为顶级窗口时该值为nullptr | |
+const Property< uint64_t > | Tag |
储存用户自定义信息的标记 | |
+const Property< uint64_t > | LayoutTag |
布局标记,对于不同的布局有不同含义 | |
+const Property< sw::ContextMenu * > | ContextMenu |
右键按下时弹出的菜单 | |
+const Property< bool > | Float |
元素是否悬浮,若元素悬浮则该元素不会随滚动条滚动而改变位置 | |
+const Property< bool > | TabStop |
表示用户是否可以通过按下Tab键将焦点移动到当前元素 | |
+const Property< Color > | BackColor |
背景颜色,修改该属性会同时将Transparent属性设为false,对于部分控件该属性可能不生效 | |
+const Property< Color > | TextColor |
文本颜色,修改该属性会同时将InheritTextColor属性设为false,对于部分控件该属性可能不生效 | |
+const Property< bool > | Transparent |
是否使用透明背景(此属性并非真正意义上的透明,将该属性设为true可继承父元素的背景颜色) | |
+const Property< bool > | InheritTextColor |
是否继承父元素的文本颜色 | |
Public 属性 继承自 sw::WndBase | |
+const ReadOnlyProperty< HWND > | Handle |
窗口句柄 | |
+const Property< sw::Font > | Font |
字体 | |
+const Property< std::wstring > | FontName |
字体名称 | |
+const Property< double > | FontSize |
字体大小 | |
+const Property< sw::FontWeight > | FontWeight |
字体粗细 | |
+const Property< sw::Rect > | Rect |
位置和尺寸 | |
+const Property< double > | Left |
左边 | |
+const Property< double > | Top |
顶边 | |
+const Property< double > | Width |
宽度 | |
+const Property< double > | Height |
高度 | |
+const ReadOnlyProperty< sw::Rect > | ClientRect |
用户区尺寸 | |
+const ReadOnlyProperty< double > | ClientWidth |
用户区宽度 | |
+const ReadOnlyProperty< double > | ClientHeight |
用户区高度 | |
+const Property< bool > | Enabled |
窗口或控件是否可用 | |
+const Property< bool > | Visible |
窗口或控件是否可见 | |
+const Property< std::wstring > | Text |
窗口标题或控件文本 | |
+const Property< bool > | Focused |
窗口是否拥有焦点 | |
+const ReadOnlyProperty< WndBase * > | Parent |
父窗口 | |
+const ReadOnlyProperty< bool > | IsDestroyed |
是否已销毁,当该值为true时不应该继续使用当前对象 | |
+Protected 成员函数 | |
virtual bool | OnPaint () override |
接收到WM_PAINT时调用该函数 | |
virtual bool | OnSize (Size newClientSize) override |
接收到WM_SIZE时调用该函数 | |
Protected 成员函数 继承自 sw::Control | |
+ | Control () |
初始化控件 | |
+void | ResetHandle () |
销毁控件句柄并重新初始化,该操作会创建新的句柄并设置样式、文本、字体等 | |
+virtual void | HandleChenged () |
控件句柄发生改变时调用该函数 | |
Protected 成员函数 继承自 sw::UIElement | |
+ | UIElement () |
初始化UIElement | |
void | RaiseRoutedEvent (RoutedEventType eventType) |
触发路由事件 | |
void | RaiseRoutedEvent (RoutedEventArgs &eventArgs) |
触发路由事件 | |
+void | NotifyLayoutUpdated () |
通知顶级窗口布局改变 | |
+double & | GetArrangeOffsetX () |
获取Arrange时子元素的水平偏移量 | |
+double & | GetArrangeOffsetY () |
获取Arrange时子元素的垂直偏移量 | |
double | GetChildRightmost (bool update) |
获取所有子元素在当前元素中最右边的位置(只考虑参与布局的子窗口且忽略悬浮的元素) | |
double | GetChildBottommost (bool update) |
获取所有子元素在当前元素中最底边的位置(只考虑参与布局的子窗口且忽略悬浮的元素) | |
+void | UpdateChildrenZOrder () |
更新子元素的Z轴位置 | |
+void | UpdateSiblingsZOrder () |
更新兄弟元素的Z轴位置 | |
+void | SetNextTabStopFocus () |
设置下一个TabStop属性为true的元素为焦点元素 | |
virtual void | SetBackColor (Color color, bool redraw) |
设置背景颜色 | |
virtual void | SetTextColor (Color color, bool redraw) |
设置文本颜色 | |
virtual void | OnAddedChild (UIElement &element) |
添加子元素后调用该函数 | |
virtual void | OnRemovedChild (UIElement &element) |
移除子元素后调用该函数 | |
+virtual void | OnTabStop () |
通过tab键将焦点移动到当前元素时调用该函数 | |
virtual void | OnDrawFocusRect () |
绘制虚线框时调用该函数 | |
virtual bool | SetParent (WndBase *parent) override |
设置父窗口 | |
virtual void | ParentChanged (WndBase *newParent) override |
父窗口改变时调用此函数 | |
virtual void | OnEndPaint () override |
在OnPaint函数完成之后调用该函数 | |
virtual bool | OnClose () override |
接收到WM_CLOSE时调用该函数 | |
virtual bool | OnMove (Point newClientPosition) override |
接收到WM_MOVE时调用该函数 | |
virtual void | OnTextChanged () override |
Text属性更改时调用此函数 | |
virtual void | VisibleChanged (bool newVisible) override |
Visible属性改变时调用此函数 | |
virtual bool | OnSetFocus (HWND hPrevFocus) override |
接收到WM_SETFOCUS时调用该函数 | |
virtual bool | OnKillFocus (HWND hNextFocus) override |
接收到WM_KILLFOCUS时调用该函数 | |
virtual bool | OnChar (wchar_t ch, KeyFlags flags) override |
接收到WM_CHAR时调用该函数 | |
virtual bool | OnKeyDown (VirtualKey key, KeyFlags flags) override |
接收到WM_KEYDOWN时调用该函数 | |
virtual bool | OnKeyUp (VirtualKey key, KeyFlags flags) override |
接收到WM_KEYUP时调用该函数 | |
virtual bool | OnMouseMove (Point mousePosition, MouseKey keyState) override |
接收到WM_MOUSEMOVE时调用该函数 | |
virtual bool | OnMouseLeave () override |
接收到WM_MOUSELEAVE时调用该函数 | |
virtual bool | OnMouseWheel (int wheelDelta, Point mousePosition, MouseKey keyState) override |
接收到WM_MOUSEWHEEL时调用该函数 | |
virtual bool | OnMouseLeftButtonDown (Point mousePosition, MouseKey keyState) override |
接收到WM_LBUTTONDOWN时调用该函数 | |
virtual bool | OnMouseLeftButtonUp (Point mousePosition, MouseKey keyState) override |
接收到WM_LBUTTONUP时调用该函数 | |
virtual bool | OnMouseRightButtonDown (Point mousePosition, MouseKey keyState) override |
接收到WM_RBUTTONDOWN时调用该函数 | |
virtual bool | OnMouseRightButtonUp (Point mousePosition, MouseKey keyState) override |
接收到WM_RBUTTONUP时调用该函数 | |
virtual bool | OnMouseMiddleButtonDown (Point mousePosition, MouseKey keyState) override |
接收到WM_MBUTTONDOWN时调用该函数 | |
virtual bool | OnMouseMiddleButtonUp (Point mousePosition, MouseKey keyState) override |
接收到WM_MBUTTONUP时调用该函数 | |
virtual bool | OnContextMenu (bool isKeyboardMsg, Point mousePosition) override |
接收到WM_CONTEXTMENU后调用目标控件的该函数 | |
virtual void | OnMenuCommand (int id) override |
当WM_COMMAND接收到菜单命令时调用该函数 | |
virtual bool | OnColor (HDC hdc, HBRUSH &hRetBrush) override |
父窗口接收到WM_CTLCOLORxxx时调用对应控件的该函数 | |
virtual bool | OnSetCursor (HWND hwnd, HitTestResult hitTest, int message, bool &result) override |
接收到WM_SETCURSOR消息时调用该函数 | |
Protected 成员函数 继承自 sw::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) |
初始化为控件,该函数会调用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 | OnDestroy () |
接收到WM_DESTROY时调用该函数 | |
virtual bool | OnMouseLeftButtonDoubleClick (Point mousePosition, MouseKey keyState) |
接收到WM_LBUTTONDBLCLK时调用该函数 | |
virtual bool | OnMouseRightButtonDoubleClick (Point mousePosition, MouseKey keyState) |
接收到WM_RBUTTONDBLCLK时调用该函数 | |
virtual bool | OnMouseMiddleButtonDoubleClick (Point mousePosition, MouseKey keyState) |
接收到WM_MBUTTONDBLCLK时调用该函数 | |
virtual bool | OnDeadChar (wchar_t ch, KeyFlags flags) |
接收到WM_DEADCHAR时调用该函数 | |
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 | OnCommand (int code) |
当父窗口接收到控件的WM_COMMAND时调用该函数 | |
virtual void | OnControlCommand (WndBase *pControl, int code, int id) |
当WM_COMMAND接收到控件命令时调用该函数 | |
virtual void | OnAcceleratorCommand (int id) |
当WM_COMMAND接收到快捷键命令时调用该函数 | |
virtual void | HandleInitialized (HWND hwnd) |
窗口句柄初始化完成 | |
virtual void | FontChanged (HFONT hfont) |
字体改变时调用该函数 | |
virtual bool | OnNotify (NMHDR *pNMHDR) |
接收到WM_NOTIFY后调用该函数 | |
virtual void | OnNotified (NMHDR *pNMHDR) |
父窗口接收到WM_NOTIFY后调用发出通知控件的该函数 | |
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 void | OnNcHitTest (const Point &testPoint, HitTestResult &result) |
接收到WM_NCHITTEST后调用该函数 | |
virtual bool | OnEraseBackground (int &result) |
接收到WM_ERASEBKGND时调用该函数 | |
virtual bool | OnDrawItem (int id, DRAWITEMSTRUCT *pDrawItem) |
接收到WM_DRAWITEM时调用该函数 | |
+额外继承的成员函数 | |
静态 Public 成员函数 继承自 sw::WndBase | |
static WndBase * | GetWndBase (HWND hwnd) |
通过窗口句柄获取WndBase | |
分隔条
+
+
|
+ +overrideprotectedvirtual | +
接收到WM_SIZE时调用该函数
+newClientSize | 改变后的用户区尺寸 |
重载 sw::UIElement .
+ +