UiButton类参考

按钮控件. 更多...

#include <UiButton.h>

继承自UiWin

UiButton_GradientUiButton_ImageUiButtonExUiRichButtonUiSetDailyButton继承.

所有成员的列表。

公有成员

void EnableTextSinkOnPressed (bool bEnable)
 按下状态时,按键的文字是否稍微下沉.
int GetButtonMode ()
int GetButtonType ()
BOOL GetExtendedProperty_UiButton (int nPropertyType, void *pValue, int nBufSize)
 获取或设置对象的扩展属性值
DWORD GetState ()
COLORREF GetTextColor_Pressed ()
bool IsEnableTextSinkOnPressed ()
virtual int OnLButtonDblClk (UINT fwKeys, int xPos, int yPos)
 当控件被双击时,此函数会被调用.
virtual int OnLButtonDown (UINT fwKeys, int xPos, int yPos)
 当控件被左键按下时,此函数会被调用.
virtual int OnLButtonUp (UINT fwKeys, int xPos, int yPos)
 当控件被左键放开时,此函数会被调用.
virtual int OnMouseMove (UINT fwKeys, int xPos, int yPos)
 当控件上鼠标移动时,此函数会被调用.
virtual void OnStateChanged (DWORD dwState)
 当按钮状态改变时被调用
void PaintWin (HDC hdc, RECT *prcWin, RECT *prcUpdate)
 绘制控件
void SetButtonMode (int nMode)
 设置按钮的行为模式: Normal 模式 / Hold 模式
void SetButtonType (int nType)
 设置按钮类型
BOOL SetExtendedProperty_UiButton (int nPropertyType, void *pValue, int nBufSize)
 获取或设置对象的扩展属性值
void SetState (DWORD dwState)
 设置按钮的状态
void SetTextColor_Pressed (COLORREF clr)
 按下状态的文本颜色
 UiButton ()
virtual ~UiButton ()

详细描述

按钮控件.

这也是其它按钮控件的基类.
你可以用 UiButton::SetButtonType() 来设置按钮的不同类型(外观)
按钮被点击后,会给所在窗口发出MZ_WM_COMMAND命令通知消息, 重载MZFC窗口的CMzWndOnMzCommand(WPARAM wParam, LPARAM lParam)即可处理按钮发出的命令消息。


构造及析构函数文档

UiButton::UiButton (  ) 
virtual UiButton::~UiButton (  )  [virtual]

成员函数文档

void UiButton::EnableTextSinkOnPressed ( bool  bEnable  ) 

按下状态时,按键的文字是否稍微下沉.

int UiButton::GetButtonMode (  ) 
int UiButton::GetButtonType (  ) 
BOOL UiButton::GetExtendedProperty_UiButton ( int  nPropertyType,
void *  pValue,
int  nBufSize 
)

获取或设置对象的扩展属性值

参数:
nPropertyType 要获取或设置的属性类型
pValue 要获取或设置的属性值的指针
nBufSize pValue所指向的变量的size大小(单位: 字节)
返回:
操作是否成功
DWORD UiButton::GetState (  ) 
COLORREF UiButton::GetTextColor_Pressed (  ) 
bool UiButton::IsEnableTextSinkOnPressed (  ) 
virtual int UiButton::OnLButtonDblClk ( UINT  fwKeys,
int  xPos,
int  yPos 
) [virtual]

当控件被双击时,此函数会被调用.

重载UiWin

virtual int UiButton::OnLButtonDown ( UINT  fwKeys,
int  xPos,
int  yPos 
) [virtual]

当控件被左键按下时,此函数会被调用.

重载UiWin

virtual int UiButton::OnLButtonUp ( UINT  fwKeys,
int  xPos,
int  yPos 
) [virtual]

当控件被左键放开时,此函数会被调用.

重载UiWin

virtual int UiButton::OnMouseMove ( UINT  fwKeys,
int  xPos,
int  yPos 
) [virtual]

当控件上鼠标移动时,此函数会被调用.

重载UiWin

virtual void UiButton::OnStateChanged ( DWORD  dwState  )  [virtual]

当按钮状态改变时被调用

void UiButton::PaintWin ( HDC  hdcDst,
RECT *  prcWin,
RECT *  prcUpdate 
) [virtual]

绘制控件

重载此函数可以自定义控件的绘制

参数:
hdcDst 目的DC
prcWin 控件所在区域(以HDC的左上角为原点)
prcUpdate 需要更新的区域(以HDC的左上角为原点)

重载UiWin

UiSetDailyButtonUiButton_GradientUiButton_ImageUiButtonExUiRichButton重载。

void UiButton::SetButtonMode ( int  nMode  ) 

设置按钮的行为模式: Normal 模式 / Hold 模式

参数:
nMode 按钮的行为模式:

void UiButton::SetButtonType ( int  nType  ) 

设置按钮类型

参数:
nType 按钮的类型(外观), 例如 MZC_BUTTON_DEFAULT, 等. 以 MZC_BUTTON_ 作为前缀的定义. 请详见 MzControlDefs.h
BOOL UiButton::SetExtendedProperty_UiButton ( int  nPropertyType,
void *  pValue,
int  nBufSize 
)

获取或设置对象的扩展属性值

参数:
nPropertyType 要获取或设置的属性类型
pValue 要设置的属性值的指针
nBufSize pValue所指向的变量的size大小(单位: 字节)
返回:
操作是否成功
void UiButton::SetState ( DWORD  dwState  ) 

设置按钮的状态

参数:
dwState 状态: MZCS_BUTTON_NORMAL 普通状态, MZCS_BUTTON_PRESSED 按下状态
void UiButton::SetTextColor_Pressed ( COLORREF  clr  ) 

按下状态的文本颜色


该类的文档由以下文件生成:

Generated at Tue Feb 9 15:09:59 2010 for Meizu M8 SDK Documentation by  doxygen 1.6.1