14#ifndef DL_DISABLE_RENDER
172 _bSingleLine{ true },
189 bool _bClickLoseFocus;
192 std::size_t _maxSize;
193 std::size_t _iCursor;
203 std::vector<gcSprite> _vecSprSelect;
213 void _delete_this() {
delete this; }
217 _cptDeleteThis = std::bind(&EditBox::_delete_this,
this);
235 void _refresh_txt(
bool* focus =
nullptr);
236 void _refresh_cursor();
237 void _refresh_select();
240 void _delete_select();
242 bool _check_size(std::size_t add)
246 if (_str.size() + add <= _maxSize)
void PushBack(AnyType any)
添加一个任意对象
void SetOrder(float order)
设置绘制顺序,默认为 Constant::Z_DEFAULT @order 要设置的order,越小越靠近屏幕,范围[0, 1)
Position Index2Pos(size_t i)
下标转到 字符位置(在父坐标系)
size_t Pos2Index(const Position &pos)
返回所在位置(在父坐标系)的字符下标
void SetOrder(float order)
设置绘制顺序
FloatTime GetDelta()
返回帧间隔
void Set(const std::vector< Color > &mul_col)
void _on_string(std::string_view str)
void _on_focus(bool focus)
void SetSingleLine(bool single_line)
void SetColor(const std::vector< Color > &mul_col)
Position Cursor2Pos(size_t i)
下标 -> 本地坐标
void SetFocus(bool focus)
static EditBox * Create(Panel *panel)
创建列表框
void SetString(std::string_view str)
void _on_char(char32_t ch)
size_t Pos2Cursor(const Position &pos)
本地坐标 -> 选中下标
void SetOrder(float order)
设置绘制顺序
void SetStringTip(std::string_view str)
void Update()
执行逻辑 @node 默认情况会自动调用
void SetOrder(float order)
设置order
std::string Utf32ToUtf8(std::u32string_view str)
字符串转换:utf32 -> utf8
std::u32string Utf8ToUtf32(std::string_view str)
字符串转换:utf8 -> utf32
size_t FirstIndex(const T &container, const V &v)
find,返回下标
constexpr float OffsetOrder(float order, int u=1, int v=0, int w=0)
偏移order
std::array< float, 4 > Color