UiRichButton类参考
可以显示多个图片和文本的按钮
更多...
#include <UiRichButton.h>
继承自UiButton。
所有成员的列表。
公有成员 |
UINT | AddItem (LPCTSTR lpszText, LPVOID pImage) |
| 向Button中添加一个Item
|
BOOL | GetExtendedProperty_UiRichButton (int nPropertyType, void *pValue, int nBufSize) |
BOOL | GetItemClip (UINT id, RECT *lprcClip) |
| 取得Button中id所指定的项的显示区域
|
DWORD | GetItemFormat (UINT id) |
| 取得Button中id所指定的项的绘制格式
|
LPVOID | GetItemImage (UINT id) |
| 取得Button中id所指定的项的显示图片
|
COLORREF | GetItemTextColor (UINT id) |
| 取得Button中id所指定的项的文本颜色
|
COLORREF | GetItemTextColor_Pressed (UINT id) |
| 取得Button中id所指定的项的文本按下时的颜色
|
BOOL | GetItemTextString (UINT id, TCHAR *buffer, DWORD length) |
| 取得Button中id所指定的项的显示的文本字符串
|
BOOL | IsItemVisible (UINT id) |
| 查询Button中id所指定的项的可视状态
|
BOOL | RemoveAllItem (void) |
| 删除Button中已添加的所有项
|
BOOL | RemoveItem (UINT id) |
| 删除Button中id所指定的项
|
BOOL | SetExtendedProperty_UiRichButton (int nPropertyType, void *pValue, int nBufSize) |
BOOL | SetItemClip (UINT id, CONST RECT *lprcClip) |
| 设置Button中id所指定的项的显示区域
|
BOOL | SetItemFormat (UINT id, DWORD dwFormat) |
| 设置Button中id所指定的项的绘制格式
|
BOOL | SetItemImage (UINT id, LPVOID pImage) |
| 设置Button中id所指定的项的显示图片,确保pImage在RichButton生存期内是有效的
|
BOOL | SetItemTextColor (UINT id, COLORREF crText) |
| 设置Button中id所指定的项的文本颜色
|
BOOL | SetItemTextColor_Pressed (UINT id, COLORREF crText) |
| 设置Button中id所指定的项的文本按下时的颜色
|
BOOL | SetItemTextFont (UINT id, HFONT hFont) |
| 设置Button中id所指定的项的文本的字体
|
BOOL | SetItemTextString (UINT id, LPCTSTR lpszText) |
| 设置Button中id所指定的项的显示的文本字符串
|
BOOL | SetItemVisible (UINT id, BOOL visible) |
| 设置Button中id所指定的项的可视状态
|
void | SetShowHighLight (bool bShow) |
| 设置按下状态时是否显示高亮
|
| UiRichButton (void) |
virtual | ~UiRichButton (void) |
保护成员 |
virtual BOOL | GetImageSize (LPVOID pImage, SIZE *pSize) |
virtual void | OnDrawImage (HDC hdc, CONST RECT &rcImage, LPVOID pImage) |
virtual void | PaintWin (HDC hdcDst, RECT *prcWin, RECT *prcUpdate) |
| 绘制控件
|
详细描述
可以显示多个图片和文本的按钮
UiRichButton 多用途按钮,可以随意添加多个图片或文本
构造及析构函数文档
UiRichButton::UiRichButton |
( |
void |
|
) |
|
virtual UiRichButton::~UiRichButton |
( |
void |
|
) |
[virtual] |
成员函数文档
UINT UiRichButton::AddItem |
( |
LPCTSTR |
lpszText, |
|
|
LPVOID |
pImage | |
|
) |
| | |
向Button中添加一个Item
- 参数:
-
| lpszText | -- Item的显示文本, 可以为NULL则不显示文本 |
| pImage | -- Item需要显示的图片,可以为NULL则不显示图片;默认为ImagingHelper指针,如果使用其他类型请重载OnDrawImage和GetImageSize方法 |
- 返回:
- 新添加的Item的ID,用于设置Item的其他属性。
BOOL UiRichButton::GetExtendedProperty_UiRichButton |
( |
int |
nPropertyType, |
|
|
void * |
pValue, |
|
|
int |
nBufSize | |
|
) |
| | |
virtual BOOL UiRichButton::GetImageSize |
( |
LPVOID |
pImage, |
|
|
SIZE * |
pSize | |
|
) |
| | [protected, virtual] |
BOOL UiRichButton::GetItemClip |
( |
UINT |
id, |
|
|
RECT * |
lprcClip | |
|
) |
| | |
取得Button中id所指定的项的显示区域
- 参数:
-
| id | -- AddItem返回的添加项的ID |
| lprcClip | -- 指向一个相对于Button的Item位置矩形的指针 |
- 返回:
- 返回TRUE表示设置成功
DWORD UiRichButton::GetItemFormat |
( |
UINT |
id |
) |
|
取得Button中id所指定的项的绘制格式
- 参数:
-
- 返回:
- 返回id指定项的格式
LPVOID UiRichButton::GetItemImage |
( |
UINT |
id |
) |
|
取得Button中id所指定的项的显示图片
- 参数:
-
- 返回:
- 返回id项的图片指针,NULL表示没有图片
COLORREF UiRichButton::GetItemTextColor |
( |
UINT |
id |
) |
|
取得Button中id所指定的项的文本颜色
- 参数:
-
- 返回:
- 返回文本显示颜色
COLORREF UiRichButton::GetItemTextColor_Pressed |
( |
UINT |
id |
) |
|
取得Button中id所指定的项的文本按下时的颜色
- 参数:
-
- 返回:
- 返回文本显示颜色
BOOL UiRichButton::GetItemTextString |
( |
UINT |
id, |
|
|
TCHAR * |
buffer, |
|
|
DWORD |
length | |
|
) |
| | |
取得Button中id所指定的项的显示的文本字符串
- 参数:
-
- 返回:
- 返回TRUE表示设置成功
BOOL UiRichButton::IsItemVisible |
( |
UINT |
id |
) |
|
查询Button中id所指定的项的可视状态
- 参数:
-
- 返回:
- 返回TRUE表示制定项可视
virtual void UiRichButton::OnDrawImage |
( |
HDC |
hdc, |
|
|
CONST RECT & |
rcImage, |
|
|
LPVOID |
pImage | |
|
) |
| | [protected, virtual] |
virtual void UiRichButton::PaintWin |
( |
HDC |
hdcDst, |
|
|
RECT * |
prcWin, |
|
|
RECT * |
prcUpdate | |
|
) |
| | [protected, virtual] |
绘制控件
重载此函数可以自定义控件的绘制
- 参数:
-
| hdcDst | 目的DC |
| prcWin | 控件所在区域(以HDC的左上角为原点) |
| prcUpdate | 需要更新的区域(以HDC的左上角为原点) |
重载UiButton。
BOOL UiRichButton::RemoveAllItem |
( |
void |
|
) |
|
删除Button中已添加的所有项
- 返回:
- 返回TRUE表示删除成功
BOOL UiRichButton::RemoveItem |
( |
UINT |
id |
) |
|
删除Button中id所指定的项
- 参数:
-
- 返回:
- 返回TRUE表示删除成功
BOOL UiRichButton::SetExtendedProperty_UiRichButton |
( |
int |
nPropertyType, |
|
|
void * |
pValue, |
|
|
int |
nBufSize | |
|
) |
| | |
BOOL UiRichButton::SetItemClip |
( |
UINT |
id, |
|
|
CONST RECT * |
lprcClip | |
|
) |
| | |
设置Button中id所指定的项的显示区域
- 参数:
-
| id | -- AddItem返回的添加项的ID |
| lprcClip | -- 指向一个相对于Button的Item位置矩形的指针,NULL表示使 用整个Button区域 |
- 返回:
- 返回TRUE表示设置成功
BOOL UiRichButton::SetItemFormat |
( |
UINT |
id, |
|
|
DWORD |
dwFormat | |
|
) |
| | |
设置Button中id所指定的项的绘制格式
- 参数:
-
| id | -- AddItem返回的添加项的ID |
| dwFormat | -- 使用和DrawText相同的格式表示,例如DT_LEFT、DT_VCENTER等, 显示图片时同样会使用dwFormat设置的位置格式。 |
- 返回:
- 返回TRUE表示设置成功
BOOL UiRichButton::SetItemImage |
( |
UINT |
id, |
|
|
LPVOID |
pImage | |
|
) |
| | |
设置Button中id所指定的项的显示图片,确保pImage在RichButton生存期内是有效的
- 参数:
-
| id | -- AddItem返回的添加项的ID |
| pImage | -- 需要显示的图片指针,可以为NULL则表示不显示图片 |
- 返回:
- 返回TRUE表示设置成功
BOOL UiRichButton::SetItemTextColor |
( |
UINT |
id, |
|
|
COLORREF |
crText | |
|
) |
| | |
设置Button中id所指定的项的文本颜色
- 参数:
-
| id | -- AddItem返回的添加项的ID |
| crText | -- 需要的显示文本颜色 |
- 返回:
- 返回TRUE表示设置成功
BOOL UiRichButton::SetItemTextColor_Pressed |
( |
UINT |
id, |
|
|
COLORREF |
crText | |
|
) |
| | |
设置Button中id所指定的项的文本按下时的颜色
- 参数:
-
| id | -- AddItem返回的添加项的ID |
| crText | -- 需要的显示文本颜色 |
- 返回:
- 返回TRUE表示设置成功
BOOL UiRichButton::SetItemTextFont |
( |
UINT |
id, |
|
|
HFONT |
hFont | |
|
) |
| | |
设置Button中id所指定的项的文本的字体
- 参数:
-
| id | -- AddItem返回的添加项的ID |
| hFont | -- 需要的显示文本字体,最好使用FontHelper生产字体,因为控件不会自动删除字体 |
- 返回:
- 返回TRUE表示设置成功
BOOL UiRichButton::SetItemTextString |
( |
UINT |
id, |
|
|
LPCTSTR |
lpszText | |
|
) |
| | |
设置Button中id所指定的项的显示的文本字符串
- 参数:
-
| id | -- AddItem返回的添加项的ID |
| lpszText | -- 需要显示的字符串指针,可以为NULL则表示不显示文本 |
- 返回:
- 返回TRUE表示设置成功
BOOL UiRichButton::SetItemVisible |
( |
UINT |
id, |
|
|
BOOL |
visible | |
|
) |
| | |
设置Button中id所指定的项的可视状态
- 参数:
-
| id | -- AddItem返回的添加项的ID |
| visible | -- 需要设置可视状态 |
- 返回:
- 返回TRUE表示设置成功
void UiRichButton::SetShowHighLight |
( |
bool |
bShow |
) |
|
该类的文档由以下文件生成: