UiSingleLineEdit类参考

单行编辑器类 更多...

#include <uisinglelineedit.h>

继承自UiWin

所有成员的列表。

公有成员

void AddChar (TCHAR c, int pos)
 在指定光标位置添加一个字符
void AddString (LPCWSTR str, int pos)
 在指定光标位置添加一个字符串
void EnableCaretShow (bool b)
 设置编辑器是否显示光标
void EnableCenterDisplay (bool b)
 设置编辑器字符串是否水平居中显示
void EnableFontChange (bool b)
 设置编辑器是否动态改变字体大小
void EnablePassWord ()
 设置编辑器为输入密码的风格
void EnableUpdateDis (bool b)
 编辑器收到字符串后是否立即更新显示
void EnableZoomIn (bool b)
 设置编辑器是否支持放大镜
int GetCursePos ()
 获取当前光标位置
DWORD GetEditStyle ()
 获取编辑器风格
int GetLeftInvalid ()
 获取编辑器左边的无效区域宽度
int GetMaxChars ()
 获取编辑器支持的最大字符个数
LPCWSTR GetPassWord ()
 获取密码字符串,必须是SINGLELINE_EDIT_STYLE_PASSWORD模式编译器才有效
int GetRightInvalid ()
 获取编辑器右边的无效区域宽度
int GetTextLen ()
 获取编辑器字符串长度
bool IsCaretShow ()
 查询编辑器是否显示光标
bool IsCenterDisplay ()
 查询编辑器是否水平居中显示
bool IsDefaultBgShow ()
 查询编辑器是否显示默认背景图
bool IsFontChangeable ()
 查询编辑器是否动态改变字体大小
bool IsPassWordEdit ()
 查询编辑器是否为输入密码的风格
bool IsZoomInEnable ()
 查询编辑器是否支持放大镜
void PrePaint ()
 编辑器重画前准备工作,包括光标、字体的自适应等工作
void RemoveChar (int pos)
 删除指定光标位置的字符
void ScrollChar (int flag)
void SetCursePos (int n)
 指定当前光标位置
void SetDrawBg (bool b)
 设置默认背景图风格
void SetEditStyle (DWORD dwStyle)
 设置编辑器风格
void SetLeftInvalid (int offset)
 设置编辑器左边的无效区域宽度
void SetMaxChars (int nCount)
 设置编辑器支持的最大字符个数
void SetMaxTextSize (int nSize)
 设置编辑器字体最大值,该选项仅对SINGLELINE_EDIT_STYLE_FONT_CHANGEABLE类型的编辑器有效
void SetMinTextSize (int nSize)
 设置编辑器字体最小值,该选项仅对SINGLELINE_EDIT_STYLE_FONT_CHANGEABLE类型的编辑器有效
void SetRightInvalid (int nInvalid)
 设置编辑器右边的无效区域宽度
void SetSipMode (DWORD dwMode, DWORD dwSipOffset=0xffffffff)
 设置编辑器输入法模式
void SetText (LPCTSTR text)
 设置编辑器初始字符串,如果是SINGLELINE_EDIT_STYLE_PASSWORD模式,设置的是密码字符串。
void SetTip (LPCTSTR text)
 设置提示文字,该文字在有输入后消失
void SetTip2 (LPCTSTR text, bool bRightAlign=false)
 设置提示文字,该文字一直在编辑框左边显示
void SwitchSipMode (DWORD dwMode, DWORD dwSipOffset=0xffffffff)
 UiSingleLineEdit (void)
void UpdateCharsPos ()
virtual ~UiSingleLineEdit (void)

保护成员

int CalCurPos (int x, int y)
int GetValidWidth ()
bool GetVisibleRange (int *nIndex, int *nCount)
virtual int OnChar (TCHAR chCharCode, LPARAM lKeyData)
 call when a keyboard character key is pressed.(only when the control has focus)
virtual void OnFocusd (UiWin *pWinPrev)
 called when the control gain keyboard focus
virtual int OnImeComposition (BOOL fFlags)
 call when receive a IME message.(only when the control has focus)
virtual int OnImeEndComposition ()
 call when receive a IME message.(only when the control has focus)
virtual int OnImeStartComposition ()
 call when receive a IME message.(only when the control has focus)
virtual int OnKeyDown (int nVirtKey, DWORD lKeyData)
 call when the keyboard is pressed down.(only when the control has focus)
virtual int OnLButtonDown (UINT fwKeys, int xPos, int yPos)
 called when the control is pressed down by mouse left button.
virtual int OnLButtonUp (UINT fwKeys, int xPos, int yPos)
 called when the mouse left button is is released on the control
virtual void OnLostFocus (UiWin *pWinNext)
 called when the control lost keyboard focus
virtual int OnMouseMove (UINT fwKeys, int xPos, int yPos)
 called when the control has mouse move message.
virtual void OnPressedHoldTimeup ()
 called when pressed-hold is ended
virtual int OnTimer (UINT_PTR nIDEvent)
 called then Timer arrived.
virtual void PaintWin (HDC hdc, RECT *prcWin, RECT *prcUpdate)
 Draw the control on the destinate DC.
virtual void PaintWinBg (HDC hdc, RECT *prcWin, RECT *prcUpdate)


详细描述

单行编辑器类

构造及析构函数文档

UiSingleLineEdit::UiSingleLineEdit ( void   ) 

virtual UiSingleLineEdit::~UiSingleLineEdit ( void   )  [virtual]


成员函数文档

void UiSingleLineEdit::AddChar ( TCHAR  c,
int  pos 
)

在指定光标位置添加一个字符

参数:
c 添加的字符.
pos 光标位置.

void UiSingleLineEdit::AddString ( LPCWSTR  str,
int  pos 
)

在指定光标位置添加一个字符串

参数:
str 添加的字符串指针.
pos 光标位置.

int UiSingleLineEdit::CalCurPos ( int  x,
int  y 
) [protected]

void UiSingleLineEdit::EnableCaretShow ( bool  b  ) 

设置编辑器是否显示光标

参数:
b true,显示光标; false,不显示光标

void UiSingleLineEdit::EnableCenterDisplay ( bool  b  ) 

设置编辑器字符串是否水平居中显示

参数:
b true,水平居中显示; false,不水平居中显示

void UiSingleLineEdit::EnableFontChange ( bool  b  ) 

设置编辑器是否动态改变字体大小

参数:
b true,根据字符数动态改变字体大小; false,不动态改变字体大小

void UiSingleLineEdit::EnablePassWord (  ) 

设置编辑器为输入密码的风格

void UiSingleLineEdit::EnableUpdateDis ( bool  b  ) 

编辑器收到字符串后是否立即更新显示

参数:
b true,立即更新显示; false,不显立即更新显示

void UiSingleLineEdit::EnableZoomIn ( bool  b  ) 

设置编辑器是否支持放大镜

参数:
b true,支持放大镜; false,不支持放大镜

int UiSingleLineEdit::GetCursePos (  ) 

获取当前光标位置

DWORD UiSingleLineEdit::GetEditStyle (  ) 

获取编辑器风格

参见:
enum SINGLELINE_EDIT_STYLE

int UiSingleLineEdit::GetLeftInvalid (  ) 

获取编辑器左边的无效区域宽度

int UiSingleLineEdit::GetMaxChars (  ) 

获取编辑器支持的最大字符个数

LPCWSTR UiSingleLineEdit::GetPassWord (  ) 

获取密码字符串,必须是SINGLELINE_EDIT_STYLE_PASSWORD模式编译器才有效

int UiSingleLineEdit::GetRightInvalid (  ) 

获取编辑器右边的无效区域宽度

int UiSingleLineEdit::GetTextLen (  ) 

获取编辑器字符串长度

int UiSingleLineEdit::GetValidWidth (  )  [protected]

bool UiSingleLineEdit::GetVisibleRange ( int *  nIndex,
int *  nCount 
) [protected]

bool UiSingleLineEdit::IsCaretShow (  ) 

查询编辑器是否显示光标

bool UiSingleLineEdit::IsCenterDisplay (  ) 

查询编辑器是否水平居中显示

bool UiSingleLineEdit::IsDefaultBgShow (  ) 

查询编辑器是否显示默认背景图

bool UiSingleLineEdit::IsFontChangeable (  ) 

查询编辑器是否动态改变字体大小

bool UiSingleLineEdit::IsPassWordEdit (  ) 

查询编辑器是否为输入密码的风格

bool UiSingleLineEdit::IsZoomInEnable (  ) 

查询编辑器是否支持放大镜

virtual int UiSingleLineEdit::OnChar ( TCHAR  chCharCode,
LPARAM  lKeyData 
) [protected, virtual]

call when a keyboard character key is pressed.(only when the control has focus)

重载UiWin

virtual void UiSingleLineEdit::OnFocusd ( UiWin pWinPrev  )  [protected, virtual]

called when the control gain keyboard focus

重载UiWin

virtual int UiSingleLineEdit::OnImeComposition ( BOOL  fFlags  )  [protected, virtual]

call when receive a IME message.(only when the control has focus)

重载UiWin

virtual int UiSingleLineEdit::OnImeEndComposition (  )  [protected, virtual]

call when receive a IME message.(only when the control has focus)

重载UiWin

virtual int UiSingleLineEdit::OnImeStartComposition (  )  [protected, virtual]

call when receive a IME message.(only when the control has focus)

重载UiWin

virtual int UiSingleLineEdit::OnKeyDown ( int  nVirtKey,
DWORD  lKeyData 
) [protected, virtual]

call when the keyboard is pressed down.(only when the control has focus)

重载UiWin

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

called when the control is pressed down by mouse left button.

重载UiWin

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

called when the mouse left button is is released on the control

重载UiWin

virtual void UiSingleLineEdit::OnLostFocus ( UiWin pWinNext  )  [protected, virtual]

called when the control lost keyboard focus

重载UiWin

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

called when the control has mouse move message.

重载UiWin

virtual void UiSingleLineEdit::OnPressedHoldTimeup (  )  [protected, virtual]

called when pressed-hold is ended

重载UiWin

virtual int UiSingleLineEdit::OnTimer ( UINT_PTR  nIDEvent  )  [protected, virtual]

called then Timer arrived.

重载UiWin

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

Draw the control on the destinate DC.

Override this member function to define your own drawings of the control

参数:
hdcDst Destinate device contact
prcWin The Rect of the control(hdc 's left-top is the origin)
prcUpdate Rect of the hdc that need to be update(hdc 's left-top is the origin)

重载UiWin

virtual void UiSingleLineEdit::PaintWinBg ( HDC  hdc,
RECT *  prcWin,
RECT *  prcUpdate 
) [protected, virtual]

void UiSingleLineEdit::PrePaint (  ) 

编辑器重画前准备工作,包括光标、字体的自适应等工作

void UiSingleLineEdit::RemoveChar ( int  pos  ) 

删除指定光标位置的字符

参数:
pos 光标位置.

void UiSingleLineEdit::ScrollChar ( int  flag  ) 

void UiSingleLineEdit::SetCursePos ( int  n  ) 

指定当前光标位置

参数:
n 光标位置.

void UiSingleLineEdit::SetDrawBg ( bool  b  ) 

设置默认背景图风格

参数:
b true,显示默认背景图; false,不显示默认背景图

void UiSingleLineEdit::SetEditStyle ( DWORD  dwStyle  ) 

设置编辑器风格

参数:
dwStyle 编辑器风格.
参见:
enum SINGLELINE_EDIT_STYLE

void UiSingleLineEdit::SetLeftInvalid ( int  offset  ) 

设置编辑器左边的无效区域宽度

参数:
offset 无效区域宽度.

void UiSingleLineEdit::SetMaxChars ( int  nCount  ) 

设置编辑器支持的最大字符个数

参数:
nCount 编辑器支持的最大字符个数.

void UiSingleLineEdit::SetMaxTextSize ( int  nSize  ) 

设置编辑器字体最大值,该选项仅对SINGLELINE_EDIT_STYLE_FONT_CHANGEABLE类型的编辑器有效

参数:
nSize 编辑器字体最大值.

void UiSingleLineEdit::SetMinTextSize ( int  nSize  ) 

设置编辑器字体最小值,该选项仅对SINGLELINE_EDIT_STYLE_FONT_CHANGEABLE类型的编辑器有效

参数:
nSize 编辑器字体最小值.

void UiSingleLineEdit::SetRightInvalid ( int  nInvalid  ) 

设置编辑器右边的无效区域宽度

参数:
nInvalid 无效区域宽度.

void UiSingleLineEdit::SetSipMode ( DWORD  dwMode,
DWORD  dwSipOffset = 0xffffffff 
)

设置编辑器输入法模式

参数:
dwMode 输入法模式
dwSipOffset 输入法离屏幕底部的偏移高度,如果值为0xffffffff,采用系统默认值
参见:
MzOpenSip()

void UiSingleLineEdit::SetText ( LPCTSTR  text  )  [virtual]

设置编辑器初始字符串,如果是SINGLELINE_EDIT_STYLE_PASSWORD模式,设置的是密码字符串。

参数:
text 编辑器初始字符串.

重载UiWin

void UiSingleLineEdit::SetTip ( LPCTSTR  text  ) 

设置提示文字,该文字在有输入后消失

参数:
text 提示文字.

void UiSingleLineEdit::SetTip2 ( LPCTSTR  text,
bool  bRightAlign = false 
)

设置提示文字,该文字一直在编辑框左边显示

参数:
text 提示文字.
bRightAlign 提示文字位置。true 居右 false居左. 如果居左调用SetLeftInvalid设置提示文字的宽度。否则如果 居右调用SetRightInvalid设置提示文字的宽度

void UiSingleLineEdit::SwitchSipMode ( DWORD  dwMode,
DWORD  dwSipOffset = 0xffffffff 
)

切换编辑器输入法模式

参数:
dwMode 输入法模式
dwSipOffset 输入法离屏幕底部的偏移高度,如果值为0xffffffff,采用系统默认值
参见:
MzOpenSip()

void UiSingleLineEdit::UpdateCharsPos (  ) 


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

Generated at Fri Feb 20 15:17:30 2009 for Meizu M8 MZFC Documentation by 魅族手机