14#ifndef DL_DISABLE_RENDER
46 EditBox* ret =
new EditBox;
107 && _timerCursor.Run(
g_time->GetDelta()))
108 _sprCursor->Render();
123 Position p = _txt->GetCoor()->ParentToThis(pos);
124 return _txt->Pos2CursorIndex(p);
133 return _txt->GetCoor()->ThisToParent(p);
140 return _panel->IsPickup();
189 _bSingleLine{ true },
196 _bChangeSelect{ false }
207 bool _bClickLoseFocus;
210 std::size_t _maxSize;
211 std::size_t _iCursor;
222 std::vector<gcSprite> _vecSprSelect;
233 void _delete_this() {
delete this; }
242 _cptDeleteThis = std::bind(&EditBox::_delete_this,
this);
247 _cptClone = std::bind(&EditBox::_clone,
this);
249 _cpt.PushBack(&_cptDeleteThis);
250 _cpt.PushBack(&_cptSetOrder);
251 _cpt.PushBack(&_cptUpdate);
252 _cpt.PushBack(&_cptRender);
253 _cpt.PushBack(&_cptGetCoor);
254 _cpt.PushBack(&_cptClone);
256 _cpt.PushBack(&_cptElemData);
263 void _refresh_txt(
bool* focus =
nullptr);
264 void _refresh_cursor();
265 void _refresh_select();
269 void _delete_select();
271 bool _check_size(std::size_t add)
275 if (_str.size() + add <= _maxSize)
void _on_string(std::string_view str)
static EditBox * Create(Panel *panel, gcText txt)
创建输入框
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)
void SetString(std::string_view str)
void _on_char(char32_t ch)
size_t Pos2Cursor(const Position &pos)
本地坐标 -> 选中下标
std::string GetStringSelect()
void SetOrder(float order)
设置绘制顺序
void SetStringTip(std::string_view str)
void SetOrderMode(OrderMode mode)
设置order模式
std::string Utf32ToUtf8(std::u32string_view str)
字符串转换:utf32 -> utf8
std::u32string Utf8ToUtf32(std::string_view str)
字符串转换:utf8 -> utf32
Function< std::function< void(float)>, str_uid("SetOrder")> SetOrder
设置order
Function< std::function< dl::Coor *()>, str_uid("GetCoor")> GetCoor
返回坐标系
Function< std::function< void()>, str_uid("Render")> Render
绘制
Function< std::function< void()>, str_uid("DeleteThis")> DeleteThis
删除自身
Function< std::function< void()>, str_uid("Update")> Update
逻辑
Function< std::function< Components *()>, str_uid("Clone")> Clone
克隆
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
constexpr float Z_DEFAULT_UI
std::array< float, 4 > Color