系统按钮控件
更多...
#include <SysButton.h>
|
| | SysButton () |
| |
| | SysButton (HWND hParent, RECT rct, std::wstring strText=L"") |
| |
| | SysButton (HWND hParent, int x, int y, int w, int h, std::wstring strText=L"") |
| |
| LRESULT | UpdateMessage (UINT msg, WPARAM wParam, LPARAM lParam, bool &bRet) override |
| | 更新消息,此函数无需用户调用 更多...
|
| |
| void | RegisterMessage (void(*pFunc)()) |
| | 注册点击消息 更多...
|
| |
| void | Image (bool enable, IMAGE *img=nullptr, bool reserve_text=false) |
| | 设置图片 更多...
|
| |
| int | GetClickCount () |
| | 获取点击次数 更多...
|
| |
| bool | IsClicked () |
| |
| | SysControlBase () |
| |
| virtual | ~SysControlBase () |
| |
| void | UpdateRect (RECT rctOld) override |
| | 响应更新区域消息 更多...
|
| |
| HWND | Create (HWND hParent, RECT rct, std::wstring strText=L"") |
| |
| HWND | Create (HWND hParent, int x, int y, int w, int h, std::wstring strText=L"") |
| |
| void | Remove () |
| | 移除控件 更多...
|
| |
| HWND | GetHandle () const |
| |
| SysControlType | GetControlType () const |
| | 获取此控件类型 更多...
|
| |
| bool | IsEnable () |
| |
| void | Enable (bool enable) |
| |
| bool | IsVisible () |
| |
| void | Show (bool show) |
| |
| bool | IsFocused () |
| |
| void | SetFocus (bool focused) |
| |
| int | GetTextLength () |
| |
| std::wstring | GetText () |
| |
| void | SetText (std::wstring wstr) |
| |
| HFONT | GetFont () |
| |
| void | SetFont (int h, int w=0, std::wstring typeface=L"") |
| |
| int | GetID () |
| |
| | Container () |
| |
| virtual | ~Container () |
| |
| RECT | GetRect () const |
| |
| void | SetRect (int x, int y, int w, int h) |
| | 设置位置和宽高 更多...
|
| |
| void | SetRect (RECT rct) |
| | 设置矩形区域 更多...
|
| |
| POINT | GetPos () const |
| |
| int | GetX () const |
| |
| int | GetY () const |
| |
| void | SetPos (int x, int y) |
| |
| void | SetPos (POINT pt) |
| |
| void | Move (int x, int y) |
| |
| void | MoveRel (int dx, int dy) |
| |
| int | GetWidth () const |
| |
| void | SetWidth (int w) |
| |
| int | GetHeight () const |
| |
| void | SetHeight (int h) |
| |
| void | Resize (int w, int h) |
| |
|
| void | RealCreate (HWND hParent) override |
| | 实际调用的创建控件函数(各种控件实现不同,但内部都调用 CreateControl 创建控件) 更多...
|
| |
| HWND | CreateControl (HWND hParent, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle) |
| | 创建控件 更多...
|
| |
系统按钮控件
在文件 SysButton.h 第 18 行定义.
◆ SysButton() [1/3]
| HiEasyX::SysButton::SysButton |
( |
| ) |
|
◆ SysButton() [2/3]
| HiEasyX::SysButton::SysButton |
( |
HWND |
hParent, |
|
|
RECT |
rct, |
|
|
std::wstring |
strText = L"" |
|
) |
| |
◆ SysButton() [3/3]
| HiEasyX::SysButton::SysButton |
( |
HWND |
hParent, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
std::wstring |
strText = L"" |
|
) |
| |
◆ GetClickCount()
| int HiEasyX::SysButton::GetClickCount |
( |
| ) |
|
◆ Image()
| void HiEasyX::SysButton::Image |
( |
bool |
enable, |
|
|
IMAGE * |
img = nullptr, |
|
|
bool |
reserve_text = false |
|
) |
| |
设置图片
- 参数
-
| [in] | enable | 是否启用按钮图片 |
| [in] | img | 图片 |
| [in] | reserve_text | 是否保留按钮中的文字 |
在文件 SysButton.cpp 第 53 行定义.
55 long style = GetWindowLong(
GetHandle(), GWL_STYLE);
60 if (!enable || (enable && !reserve_text))
62 SetWindowLongPtr(
GetHandle(), GWL_STYLE, style);
67 SendMessage(
GetHandle(), BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap);
68 DeleteObject(hBitmap);
◆ IsClicked()
| bool HiEasyX::SysButton::IsClicked |
( |
| ) |
|
判断是否点击按键 备注:
建议使用 GetClickCount,使用此函数可能丢失点击次数信息
在文件 SysButton.cpp 第 79 行定义.
◆ RealCreate()
| void HiEasyX::SysButton::RealCreate |
( |
HWND |
hParent | ) |
|
|
overrideprotectedvirtual |
◆ RegisterMessage()
| void HiEasyX::SysButton::RegisterMessage |
( |
void(*)() |
pFunc | ) |
|
◆ UpdateMessage()
| LRESULT HiEasyX::SysButton::UpdateMessage |
( |
UINT |
msg, |
|
|
WPARAM |
wParam, |
|
|
LPARAM |
lParam, |
|
|
bool & |
bRet |
|
) |
| |
|
overridevirtual |
该类的文档由以下文件生成:
- E:/_MYC/_VS_Project/HiEasyX/HiEasyX/HiEasyX/HiSysGUI/SysButton.h
- E:/_MYC/_VS_Project/HiEasyX/HiEasyX/HiEasyX/HiSysGUI/SysButton.cpp