21 #define STB_TEXTEDIT_CHARTYPE char16_t 22 #define STB_TEXTEDIT_POSITIONTYPE int 23 #define STB_TEXTEDIT_STRING iplug::igraphics::ITextEntryControl 24 #define STB_TEXTEDIT_KEYTYPE uint32_t 26 #include "stb_textedit.h" 31 BEGIN_IGRAPHICS_NAMESPACE
50 void OnEndAnimation()
override;
53 static int InsertChars(
ITextEntryControl* _this,
size_t pos,
const char16_t* text,
size_t num);
59 bool EditInProgress() {
return mEditing; }
63 void CreateTextEntry(
int paramIdx,
const IText& text,
const IRECT& bounds,
int length,
const char* str);
67 void SetStr(
const char* str);
69 template<
typename Proc>
70 bool CallSTB(Proc proc);
71 void OnStateChanged();
73 void FillCharWidthCache();
74 void CalcCursorSizes();
75 float MeasureCharWidth(char16_t c, char16_t nc);
81 bool mDrawCursor =
false;
82 bool mEditing =
false;
83 bool mRecursiveKeyGuard =
false;
84 bool mCursorIsSet =
false;
85 bool mCursorSizesValid =
false;
86 bool mNotifyTextChange =
false;
88 STB_TexteditState mEditState;
89 WDL_TypedBuf<float> mCharWidths;
90 std::u16string mEditString;
93 END_IGRAPHICS_NAMESPACE
The lowest level base class of an IGraphics control.
A Text entry widget drawn by IGraphics.
Used to manage a rectangular area, independent of draw class/platform.
Used to manage mouse modifiers i.e.
void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod &mod) override
Implement this method to respond to a mouse drag event on this control.
bool OnKeyDown(float x, float y, const IKeyPress &key) override
Implement this method to respond to a key down event on this control.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
This file contains the base IControl implementation, along with some base classes for specific types ...
void Draw(IGraphics &g) override
Draw the control to the graphics context.
IText is used to manage font and text/text entry style for a piece of text on the UI...
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
The lowest level base class of an IGraphics context.
void OnMouseDblClick(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse double click event on this control.
Used for key press info, such as ASCII representation, virtual key (mapped to win32 codes) and modifi...