CBlueUI  
C++ 跨平台跨框架的数据可视化工具
载入中...
搜索中...
未找到
BUI::CEditLine类 参考

行编辑类 更多...

类 BUI::CEditLine 继承关系图:

Public 成员函数

 CEditLine (CEditLineStyle *style)
 ~CEditLine ()
void OnMessageEdit (UINT message, WPARAM wp, LPARAM lp)
void Clear ()
 清空所有文本和风格
int InsertChars (int pos, LPCTSTR text, int count=-1, int style_id=-1)
 在pos位置插入文本
int InsertCharsW (int pos, LPCWSTR text, int count=-1, int style_id=-1)
 在pos位置插入文本(宽字节版本)
int InsertCharsA (int pos, LPCSTR text, int count=-1, int style_id=-1)
 在pos位置插入文本(UTF8格式)
int AppendPreimeChars (LPCTSTR text, int count=-1, int style_id=-1)
 输入法预输入
void EndPreInput (LPCTSTR text, int count=-1, int style_id=-1)
 输入法提交最后确定文本
BOOL DeleteChars (int pos, int count)
 删除文本
int SelectCount () const
 选中字符个数
BOOL DeleteSelectChars ()
 删除被选中的字符串
void SelectRange (int pos, int count)
 将字符串的一部分设置为选中模式
BeString GetText () const
 获得文本内容
LPCTSTR GetTextPtr (int pos)
 获得指定位置文本内容
int CharCount () const
 返回字符符号数量(注意这里不等于字节数)。当返回值为0,可以判定为空串
void SetCharStyle (int pos, int count, std::shared_ptr< CharStyle > &style)
 设置子串的样式索引号.在渲染时会调用CEditLineStyle::GetCharStyle(style_index)获得对应的样式.
int FindLocateCoord (RECT &rc_text, int dx, int dy)
 根据鼠标输入位置(dx,dy)。获得光标索引
int GetPixelWidth (int count) const
 获得字符串像素宽度
void SetErrorCodeState (int code)
int ErrorCodeState () const
int UpdateWordWrapLine (int width)
 重新计算换行信息,在视窗区域变化和每插入和删除一个字符时触发
void UpdateCharsSize (int pos, int count)
 更新单个字符尺寸
void UpdateCharsLex (const StateTransfer *lex, int32_t current_state, int pos, int count)
 更新词法状态
void UpdateSurfaceCharsSize (ISurface *surface, int pos, int count)
 更新字符尺寸信息
int CharCursorPos () const
 Edit光标位置
void SetCharCursorPos (int cursor)
 设置EditInput光标位置
int CharFixHeadPos () const
void SetCharFixHeadPos (int pos)
int LineBottomY () const
 行底部Y位置
void SetLineBottomY (int pos)
int GetLineWidth () const
 获得行宽度
int GetLineHeight (BOOL is_single_line=FALSE) const
 获得行高度,isSingleLine=TRUE,表示单行模式
int GetPreInputPos () const
 获得输入法预插入位置
int GetPreInputLength () const
 获得输入法待插入文本长度
int GetWraplineHeight (int sub_line, BOOL is_near_top) const
int GetWraplineIndex (int cursor) const
int GetWraplineCount () const
UINT ChangeFlags () const
 获得属性标记
void SetChangeFlags (UINT changed, UINT op)
 Set the Change Flags object
void PeekSelectText (BasicStringBuffer &buffer) const
 提取选中文本
void PeekText (BeString &buffer) const
 提取全部文本
void DrawLineCursor (ISurface *surface, int paint_state, int dx, RECT rc_line, GBrushArray &text_bru, POINT &pt_cursor, BOOL is_focus=FALSE)
void DrawLineTextOut (ISurface *surface, int paint_state, int dx, RECT rc_line, const GColor &color_text_bg, GBrushArray &text_bru, UINT text_flags, BOOL fill=FALSE)

Protected 成员函数

void DrawWrapLineTextOut (ISurface *surface, int paint_state, int dx, RECT rc_line, const GColor &color_text_bg, GBrushArray &text_bru, UINT text_flags, BOOL is_select_fill)
void DrawTextRangePos (ISurface *surface, GFont *default_font, int start, int end, int &x0, int &y0, const TCHAR *&p, RECT &rc_line, const GColor &textcolor)
void insertCharsInternal (int pos, LPCTSTR text, int count, int style_id)
int GetBytesLength (LPCTSTR text, int pos, int count)
BOOL CheckDecimal (const TCHAR *text)
int PreCheckBeforeInsert (BasicStringBuffer &buffer, int pos, LPCTSTR text, int count, UINT text_flag)
void GetCharFont (int pos, GFont *&font) const
CharStyleGetCharStyle (int pos) const
BOOL GetCharLexStyle (int pos, GColor &color) const

Protected 属性

CEditLineStylem_style
BeString m_text_line
std::vector< CharSizem_sizes
std::vector< std::shared_ptr< CharStyle > > m_char_ui
std::vector< int16_t > m_char_style_id
UINT m_change_flags
SIZE m_line_size
int m_cursor_pos
int m_cursor_offset
int m_select_start
int m_select_count
int m_select_rect_left
int m_select_rect_width
int m_string_bytes
int m_string_count
int m_pre_input_pos
int m_pre_input_count
int m_fix_head_pos
int m_line_bottom_pos
int m_error_code
std::vector< WordWrapLineInfom_wordwrap
int m_fisrt_printf_pos
int m_fisrt_printf_head

详细描述

行编辑类

构造及析构函数说明

◆ CEditLine()

BUI::CEditLine::CEditLine ( CEditLineStyle * style)

◆ ~CEditLine()

BUI::CEditLine::~CEditLine ( )

成员函数说明

◆ AppendPreimeChars()

int BUI::CEditLine::AppendPreimeChars ( LPCTSTR text,
int count = -1,
int style_id = -1 )

输入法预输入

◆ ChangeFlags()

UINT BUI::CEditLine::ChangeFlags ( ) const

获得属性标记

◆ CharCount()

int BUI::CEditLine::CharCount ( ) const

返回字符符号数量(注意这里不等于字节数)。当返回值为0,可以判定为空串

◆ CharCursorPos()

int BUI::CEditLine::CharCursorPos ( ) const

Edit光标位置

◆ CharFixHeadPos()

int BUI::CEditLine::CharFixHeadPos ( ) const

◆ CheckDecimal()

BOOL BUI::CEditLine::CheckDecimal ( const TCHAR * text)
protected

◆ Clear()

void BUI::CEditLine::Clear ( )

清空所有文本和风格

◆ DeleteChars()

BOOL BUI::CEditLine::DeleteChars ( int pos,
int count )

删除文本

参数
pos删除起点位置
count删除符号个数(注意不是字节数)
返回
BOOL: 若成功,返回TRUE。否则返回FALSE

◆ DeleteSelectChars()

BOOL BUI::CEditLine::DeleteSelectChars ( )

删除被选中的字符串

◆ DrawLineCursor()

void BUI::CEditLine::DrawLineCursor ( ISurface * surface,
int paint_state,
int dx,
RECT rc_line,
GBrushArray & text_bru,
POINT & pt_cursor,
BOOL is_focus = FALSE )

◆ DrawLineTextOut()

void BUI::CEditLine::DrawLineTextOut ( ISurface * surface,
int paint_state,
int dx,
RECT rc_line,
const GColor & color_text_bg,
GBrushArray & text_bru,
UINT text_flags,
BOOL fill = FALSE )

◆ DrawTextRangePos()

void BUI::CEditLine::DrawTextRangePos ( ISurface * surface,
GFont * default_font,
int start,
int end,
int & x0,
int & y0,
const TCHAR *& p,
RECT & rc_line,
const GColor & textcolor )
protected

◆ DrawWrapLineTextOut()

void BUI::CEditLine::DrawWrapLineTextOut ( ISurface * surface,
int paint_state,
int dx,
RECT rc_line,
const GColor & color_text_bg,
GBrushArray & text_bru,
UINT text_flags,
BOOL is_select_fill )
protected

◆ EndPreInput()

void BUI::CEditLine::EndPreInput ( LPCTSTR text,
int count = -1,
int style_id = -1 )

输入法提交最后确定文本

◆ ErrorCodeState()

int BUI::CEditLine::ErrorCodeState ( ) const

◆ FindLocateCoord()

int BUI::CEditLine::FindLocateCoord ( RECT & rc_text,
int dx,
int dy )

根据鼠标输入位置(dx,dy)。获得光标索引

参数
rc_text文本输入区域
dx坐标x
dy坐标y
返回
int: 返回命中的字符索引

◆ GetBytesLength()

int BUI::CEditLine::GetBytesLength ( LPCTSTR text,
int pos,
int count )
protected

◆ GetCharFont()

void BUI::CEditLine::GetCharFont ( int pos,
GFont *& font ) const
protected

◆ GetCharLexStyle()

BOOL BUI::CEditLine::GetCharLexStyle ( int pos,
GColor & color ) const
protected

◆ GetCharStyle()

CharStyle * BUI::CEditLine::GetCharStyle ( int pos) const
protected

◆ GetLineHeight()

int BUI::CEditLine::GetLineHeight ( BOOL is_single_line = FALSE) const

获得行高度,isSingleLine=TRUE,表示单行模式

◆ GetLineWidth()

int BUI::CEditLine::GetLineWidth ( ) const

获得行宽度

◆ GetPixelWidth()

int BUI::CEditLine::GetPixelWidth ( int count) const

获得字符串像素宽度

◆ GetPreInputLength()

int BUI::CEditLine::GetPreInputLength ( ) const

获得输入法待插入文本长度

◆ GetPreInputPos()

int BUI::CEditLine::GetPreInputPos ( ) const

获得输入法预插入位置

◆ GetText()

BeString BUI::CEditLine::GetText ( ) const

获得文本内容

◆ GetTextPtr()

LPCTSTR BUI::CEditLine::GetTextPtr ( int pos)

获得指定位置文本内容

◆ GetWraplineCount()

int BUI::CEditLine::GetWraplineCount ( ) const

◆ GetWraplineHeight()

int BUI::CEditLine::GetWraplineHeight ( int sub_line,
BOOL is_near_top ) const

◆ GetWraplineIndex()

int BUI::CEditLine::GetWraplineIndex ( int cursor) const

◆ InsertChars()

int BUI::CEditLine::InsertChars ( int pos,
LPCTSTR text,
int count = -1,
int style_id = -1 )

在pos位置插入文本

◆ InsertCharsA()

int BUI::CEditLine::InsertCharsA ( int pos,
LPCSTR text,
int count = -1,
int style_id = -1 )

在pos位置插入文本(UTF8格式)

◆ insertCharsInternal()

void BUI::CEditLine::insertCharsInternal ( int pos,
LPCTSTR text,
int count,
int style_id )
protected

◆ InsertCharsW()

int BUI::CEditLine::InsertCharsW ( int pos,
LPCWSTR text,
int count = -1,
int style_id = -1 )

在pos位置插入文本(宽字节版本)

◆ LineBottomY()

int BUI::CEditLine::LineBottomY ( ) const

行底部Y位置

◆ OnMessageEdit()

void BUI::CEditLine::OnMessageEdit ( UINT message,
WPARAM wp,
LPARAM lp )

◆ PeekSelectText()

void BUI::CEditLine::PeekSelectText ( BasicStringBuffer & buffer) const

提取选中文本

参数
buffer:输出参数。用于接收文本

◆ PeekText()

void BUI::CEditLine::PeekText ( BeString & buffer) const

提取全部文本

参数
buffer:输出参数。用于接收文本

◆ PreCheckBeforeInsert()

int BUI::CEditLine::PreCheckBeforeInsert ( BasicStringBuffer & buffer,
int pos,
LPCTSTR text,
int count,
UINT text_flag )
protected

◆ SelectCount()

int BUI::CEditLine::SelectCount ( ) const

选中字符个数

◆ SelectRange()

void BUI::CEditLine::SelectRange ( int pos,
int count )

将字符串的一部分设置为选中模式

参数
pos选中的起点位置
count选中符号数量(注意不是字节数)

◆ SetChangeFlags()

void BUI::CEditLine::SetChangeFlags ( UINT changed,
UINT op )

Set the Change Flags object

参数
changed:字体变更(0x01),词法变更(0x02)
opADD_FLAGS-添加属性,REMOVE_FLAGS-删除属性

◆ SetCharCursorPos()

void BUI::CEditLine::SetCharCursorPos ( int cursor)

设置EditInput光标位置

◆ SetCharFixHeadPos()

void BUI::CEditLine::SetCharFixHeadPos ( int pos)

◆ SetCharStyle()

void BUI::CEditLine::SetCharStyle ( int pos,
int count,
std::shared_ptr< CharStyle > & style )

设置子串的样式索引号.在渲染时会调用CEditLineStyle::GetCharStyle(style_index)获得对应的样式.

参数
pos子串起点
count子串长度
std::shared_ptr<CharStyle>&style 风格样式

◆ SetErrorCodeState()

void BUI::CEditLine::SetErrorCodeState ( int code)

◆ SetLineBottomY()

void BUI::CEditLine::SetLineBottomY ( int pos)

◆ UpdateCharsLex()

void BUI::CEditLine::UpdateCharsLex ( const StateTransfer * lex,
int32_t current_state,
int pos,
int count )

更新词法状态

◆ UpdateCharsSize()

void BUI::CEditLine::UpdateCharsSize ( int pos,
int count )

更新单个字符尺寸

◆ UpdateSurfaceCharsSize()

void BUI::CEditLine::UpdateSurfaceCharsSize ( ISurface * surface,
int pos,
int count )

更新字符尺寸信息

◆ UpdateWordWrapLine()

int BUI::CEditLine::UpdateWordWrapLine ( int width)

重新计算换行信息,在视窗区域变化和每插入和删除一个字符时触发

参数
width
返回
int 返回高度差=新高度 - 旧高度

类成员变量说明

◆ m_change_flags

UINT BUI::CEditLine::m_change_flags
protected

◆ m_char_style_id

std::vector<int16_t> BUI::CEditLine::m_char_style_id
protected

◆ m_char_ui

std::vector<std::shared_ptr<CharStyle> > BUI::CEditLine::m_char_ui
protected

◆ m_cursor_offset

int BUI::CEditLine::m_cursor_offset
protected

◆ m_cursor_pos

int BUI::CEditLine::m_cursor_pos
protected

◆ m_error_code

int BUI::CEditLine::m_error_code
protected

◆ m_fisrt_printf_head

int BUI::CEditLine::m_fisrt_printf_head
protected

◆ m_fisrt_printf_pos

int BUI::CEditLine::m_fisrt_printf_pos
protected

◆ m_fix_head_pos

int BUI::CEditLine::m_fix_head_pos
protected

◆ m_line_bottom_pos

int BUI::CEditLine::m_line_bottom_pos
protected

◆ m_line_size

SIZE BUI::CEditLine::m_line_size
protected

◆ m_pre_input_count

int BUI::CEditLine::m_pre_input_count
protected

◆ m_pre_input_pos

int BUI::CEditLine::m_pre_input_pos
protected

◆ m_select_count

int BUI::CEditLine::m_select_count
protected

◆ m_select_rect_left

int BUI::CEditLine::m_select_rect_left
protected

◆ m_select_rect_width

int BUI::CEditLine::m_select_rect_width
protected

◆ m_select_start

int BUI::CEditLine::m_select_start
protected

◆ m_sizes

std::vector<CharSize> BUI::CEditLine::m_sizes
protected

◆ m_string_bytes

int BUI::CEditLine::m_string_bytes
protected

◆ m_string_count

int BUI::CEditLine::m_string_count
protected

◆ m_style

CEditLineStyle* BUI::CEditLine::m_style
protected

◆ m_text_line

BeString BUI::CEditLine::m_text_line
protected

◆ m_wordwrap

std::vector<WordWrapLineInfo> BUI::CEditLine::m_wordwrap
protected
鄂公网安备42018502007752 鄂ICP备2024082886
Copyright © 2026 · CBlueStudio 版权所有