|
@@ -1,5 +1,5 @@
|
1
|
|
-// ImGui library v1.31 wip
|
2
|
|
-// See .cpp file for commentary.
|
|
1
|
+// ImGui library v1.32
|
|
2
|
+// See .cpp file for documentation.
|
3
|
3
|
// See ImGui::ShowTestWindow() for sample code.
|
4
|
4
|
// Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
|
5
|
5
|
// Get latest version at https://github.com/ocornut/imgui
|
|
@@ -44,6 +44,7 @@ typedef int ImGuiWindowFlags; // enum ImGuiWindowFlags_
|
44
|
44
|
typedef int ImGuiSetCondition; // enum ImGuiSetCondition_
|
45
|
45
|
typedef int ImGuiInputTextFlags; // enum ImGuiInputTextFlags_
|
46
|
46
|
struct ImGuiTextEditCallbackData; // for advanced uses of InputText()
|
|
47
|
+typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data);
|
47
|
48
|
|
48
|
49
|
struct ImVec2
|
49
|
50
|
{
|
|
@@ -159,25 +160,26 @@ namespace ImGui
|
159
|
160
|
IMGUI_API bool Begin(const char* name = "Debug", bool* p_opened = NULL, ImVec2 size = ImVec2(0,0), float fill_alpha = -1.0f, ImGuiWindowFlags flags = 0);// return false when window is collapsed, so you can early out in your code. passing 'bool* p_opened' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed.
|
160
|
161
|
IMGUI_API void End();
|
161
|
162
|
IMGUI_API void BeginChild(const char* str_id, ImVec2 size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). on each axis.
|
|
163
|
+ IMGUI_API void BeginChild(ImGuiID id, ImVec2 size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // "
|
162
|
164
|
IMGUI_API void EndChild();
|
163
|
165
|
IMGUI_API bool GetWindowIsFocused();
|
164
|
|
- IMGUI_API ImVec2 GetContentRegionMax(); // window or current column boundaries
|
165
|
|
- IMGUI_API ImVec2 GetWindowContentRegionMin(); // window boundaries
|
|
166
|
+ IMGUI_API ImVec2 GetContentRegionMax(); // window or current column boundaries, in windows coordinates
|
|
167
|
+ IMGUI_API ImVec2 GetWindowContentRegionMin(); // window boundaries, in windows coordinates
|
166
|
168
|
IMGUI_API ImVec2 GetWindowContentRegionMax();
|
167
|
169
|
IMGUI_API ImDrawList* GetWindowDrawList(); // get rendering command-list if you want to append your own draw primitives.
|
168
|
170
|
IMGUI_API ImFont* GetWindowFont();
|
169
|
|
- IMGUI_API float GetWindowFontSize();
|
|
171
|
+ IMGUI_API float GetWindowFontSize(); // size (also height in pixels) of current font with current scale applied
|
170
|
172
|
IMGUI_API void SetWindowFontScale(float scale); // per-window font scale. Adjust IO.FontGlobalScale if you want to scale all windows.
|
171
|
173
|
IMGUI_API ImVec2 GetWindowPos(); // you should rarely need/care about the window position, but it can be useful if you want to do your own drawing.
|
172
|
174
|
IMGUI_API ImVec2 GetWindowSize(); // get current window position.
|
173
|
175
|
IMGUI_API float GetWindowWidth();
|
174
|
176
|
IMGUI_API bool GetWindowCollapsed();
|
175
|
|
- IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiSetCondition cond = 0); // set current window position - call within Begin()/End().
|
176
|
|
- IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0); // set current window size. set to ImVec2(0,0) to force an auto-fit
|
177
|
|
- IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond = 0); // set current window collapsed state.
|
178
|
177
|
IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiSetCondition cond = 0); // set next window position - call before Begin().
|
179
|
|
- IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0); // set next window size. set to ImVec2(0,0) to force an auto-fit
|
|
178
|
+ IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0); // set next window size. set to ImVec2(0,0) to force an auto-fit.
|
180
|
179
|
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiSetCondition cond = 0); // set next window collapsed state.
|
|
180
|
+ IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiSetCondition cond = 0); // set current window position - call within Begin()/End(). may incur tearing.
|
|
181
|
+ IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0); // set current window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing.
|
|
182
|
+ IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond = 0); // set current window collapsed state.
|
181
|
183
|
|
182
|
184
|
IMGUI_API void SetScrollPosHere(); // adjust scrolling position to center into the current cursor position.
|
183
|
185
|
IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget.
|
|
@@ -194,9 +196,9 @@ namespace ImGui
|
194
|
196
|
IMGUI_API void PopStyleVar(int count = 1);
|
195
|
197
|
|
196
|
198
|
// Parameters stacks (current window)
|
197
|
|
- IMGUI_API void PushItemWidth(float item_width); // width of items for the common item+label case. default to ~2/3 of windows width.
|
|
199
|
+ IMGUI_API void PushItemWidth(float item_width); // width of items for the common item+label case, pixels. 0.0f = default to ~2/3 of windows width, >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -0.01f always align width to the right side)
|
198
|
200
|
IMGUI_API void PopItemWidth();
|
199
|
|
- IMGUI_API float GetItemWidth();
|
|
201
|
+ IMGUI_API float CalcItemWidth(); // width of item given pushed settings and current cursor position
|
200
|
202
|
IMGUI_API void PushAllowKeyboardFocus(bool v); // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets.
|
201
|
203
|
IMGUI_API void PopAllowKeyboardFocus();
|
202
|
204
|
IMGUI_API void PushTextWrapPos(float wrap_pos_x = 0.0f); // word-wrapping for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space.
|
|
@@ -218,14 +220,16 @@ namespace ImGui
|
218
|
220
|
IMGUI_API void SetColumnOffset(int column_index, float offset);
|
219
|
221
|
IMGUI_API float GetColumnWidth(int column_index = -1);
|
220
|
222
|
IMGUI_API ImVec2 GetCursorPos(); // cursor position is relative to window position
|
|
223
|
+ IMGUI_API float GetCursorPosX(); // "
|
|
224
|
+ IMGUI_API float GetCursorPosY(); // "
|
221
|
225
|
IMGUI_API void SetCursorPos(const ImVec2& pos); // "
|
222
|
226
|
IMGUI_API void SetCursorPosX(float x); // "
|
223
|
227
|
IMGUI_API void SetCursorPosY(float y); // "
|
224
|
228
|
IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position in absolute screen coordinates (0..io.DisplaySize)
|
225
|
229
|
IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position in absolute screen coordinates (0..io.DisplaySize)
|
226
|
230
|
IMGUI_API void AlignFirstTextHeightToWidgets(); // call once if the first item on the line is a Text() item and you want to vertically lower it to match subsequent (bigger) widgets.
|
227
|
|
- IMGUI_API float GetTextLineSpacing();
|
228
|
|
- IMGUI_API float GetTextLineHeight();
|
|
231
|
+ IMGUI_API float GetTextLineHeight(); // height of font == GetWindowFontSize()
|
|
232
|
+ IMGUI_API float GetTextLineHeightWithSpacing(); // spacing (in pixels) between 2 consecutive lines of text == GetWindowFontSize() + GetStyle().ItemSpacing.y
|
229
|
233
|
|
230
|
234
|
// ID scopes
|
231
|
235
|
// If you are creating repeated widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them.
|
|
@@ -253,7 +257,7 @@ namespace ImGui
|
253
|
257
|
IMGUI_API bool SmallButton(const char* label);
|
254
|
258
|
IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size);
|
255
|
259
|
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0));
|
256
|
|
- IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,1)); // <0 frame_padding uses default frame padding settings. 0 for no paddnig.
|
|
260
|
+ IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,1), const ImVec4& tint_col = ImVec4(1,1,1,1)); // <0 frame_padding uses default frame padding settings. 0 for no paddnig.
|
257
|
261
|
IMGUI_API bool CollapsingHeader(const char* label, const char* str_id = NULL, const bool display_frame = true, const bool default_open = false);
|
258
|
262
|
IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); // adjust display_format to decorate the value with a prefix or a suffix. Use power!=1.0 for logarithmic sliders.
|
259
|
263
|
IMGUI_API bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
|
|
@@ -272,15 +276,15 @@ namespace ImGui
|
272
|
276
|
IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value);
|
273
|
277
|
IMGUI_API bool RadioButton(const char* label, bool active);
|
274
|
278
|
IMGUI_API bool RadioButton(const char* label, int* v, int v_button);
|
275
|
|
- IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, void (*callback)(ImGuiTextEditCallbackData*) = NULL, void* user_data = NULL);
|
|
279
|
+ IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
|
276
|
280
|
IMGUI_API bool InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
|
277
|
281
|
IMGUI_API bool InputFloat2(const char* label, float v[2], int decimal_precision = -1);
|
278
|
282
|
IMGUI_API bool InputFloat3(const char* label, float v[3], int decimal_precision = -1);
|
279
|
283
|
IMGUI_API bool InputFloat4(const char* label, float v[4], int decimal_precision = -1);
|
280
|
284
|
IMGUI_API bool InputInt(const char* label, int* v, int step = 1, int step_fast = 100, ImGuiInputTextFlags extra_flags = 0);
|
281
|
|
- IMGUI_API bool Combo(const char* label, int* current_item, const char** items, int items_count, int popup_height_items = 7);
|
282
|
|
- IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_height_items = 7); // separate items with \0, end item-list with \0\0
|
283
|
|
- IMGUI_API bool Combo(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_height_items = 7);
|
|
285
|
+ IMGUI_API bool Combo(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
|
|
286
|
+ IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items = -1); // separate items with \0, end item-list with \0\0
|
|
287
|
+ IMGUI_API bool Combo(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
|
284
|
288
|
IMGUI_API bool ColorButton(const ImVec4& col, bool small_height = false, bool outline_border = true);
|
285
|
289
|
IMGUI_API bool ColorEdit3(const char* label, float col[3]);
|
286
|
290
|
IMGUI_API bool ColorEdit4(const char* label, float col[4], bool show_alpha = true);
|
|
@@ -295,6 +299,15 @@ namespace ImGui
|
295
|
299
|
IMGUI_API void TreePop();
|
296
|
300
|
IMGUI_API void OpenNextNode(bool open); // force open/close the next TreeNode or CollapsingHeader
|
297
|
301
|
|
|
302
|
+ // Selectable / Lists
|
|
303
|
+ IMGUI_API bool Selectable(const char* label, bool selected, const ImVec2& size = ImVec2(0,0));
|
|
304
|
+ IMGUI_API bool Selectable(const char* label, bool* p_selected, const ImVec2& size = ImVec2(0,0));
|
|
305
|
+ IMGUI_API bool ListBox(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
|
|
306
|
+ IMGUI_API bool ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
|
|
307
|
+ IMGUI_API bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0,0)); // use if you want to reimplement ListBox() will custom data or interactions. make sure to call ListBoxFooter() afterwards.
|
|
308
|
+ IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
|
|
309
|
+ IMGUI_API void ListBoxFooter(); // terminate the scrolling region
|
|
310
|
+
|
298
|
311
|
// Value() Helpers: output single value in "name: value" format. Tip: freely declare your own within the ImGui namespace!
|
299
|
312
|
IMGUI_API void Value(const char* prefix, bool b);
|
300
|
313
|
IMGUI_API void Value(const char* prefix, int v);
|
|
@@ -329,11 +342,20 @@ namespace ImGui
|
329
|
342
|
IMGUI_API int GetFrameCount();
|
330
|
343
|
IMGUI_API const char* GetStyleColName(ImGuiCol idx);
|
331
|
344
|
IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
|
|
345
|
+ IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // helper to manually clip large list of items. see comments in implementation.
|
|
346
|
+
|
|
347
|
+ IMGUI_API void BeginChildFrame(ImGuiID id, const ImVec2& size); // helper to create a child window / scrolling region that looks like a normal widget frame.
|
|
348
|
+ IMGUI_API void EndChildFrame();
|
332
|
349
|
|
333
|
350
|
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4& in);
|
334
|
351
|
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v);
|
335
|
352
|
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
|
336
|
353
|
|
|
354
|
+ // Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
|
|
355
|
+ IMGUI_API void* GetInternalState();
|
|
356
|
+ IMGUI_API size_t GetInternalStateSize();
|
|
357
|
+ IMGUI_API void SetInternalState(void* state, bool construct = false);
|
|
358
|
+
|
337
|
359
|
// Obsolete (will be removed)
|
338
|
360
|
IMGUI_API void GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size);
|
339
|
361
|
|
|
@@ -366,11 +388,14 @@ enum ImGuiInputTextFlags_
|
366
|
388
|
// Default: 0
|
367
|
389
|
ImGuiInputTextFlags_CharsDecimal = 1 << 0, // Allow 0123456789.+-*/
|
368
|
390
|
ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, // Allow 0123456789ABCDEFabcdef
|
369
|
|
- ImGuiInputTextFlags_AutoSelectAll = 1 << 2, // Select entire text when first taking focus
|
370
|
|
- ImGuiInputTextFlags_EnterReturnsTrue = 1 << 3, // Return 'true' when Enter is pressed (as opposed to when the value was modified)
|
371
|
|
- ImGuiInputTextFlags_CallbackCompletion = 1 << 4, // Call user function on pressing TAB (for completion handling)
|
372
|
|
- ImGuiInputTextFlags_CallbackHistory = 1 << 5, // Call user function on pressing Up/Down arrows (for history handling)
|
373
|
|
- ImGuiInputTextFlags_CallbackAlways = 1 << 6 // Call user function every time
|
|
391
|
+ ImGuiInputTextFlags_CharsUppercase = 1 << 2, // Turn a..z into A..Z
|
|
392
|
+ ImGuiInputTextFlags_CharsNoBlank = 1 << 3, // Filter out spaces, tabs
|
|
393
|
+ ImGuiInputTextFlags_AutoSelectAll = 1 << 4, // Select entire text when first taking focus
|
|
394
|
+ ImGuiInputTextFlags_EnterReturnsTrue = 1 << 5, // Return 'true' when Enter is pressed (as opposed to when the value was modified)
|
|
395
|
+ ImGuiInputTextFlags_CallbackCompletion = 1 << 6, // Call user function on pressing TAB (for completion handling)
|
|
396
|
+ ImGuiInputTextFlags_CallbackHistory = 1 << 7, // Call user function on pressing Up/Down arrows (for history handling)
|
|
397
|
+ ImGuiInputTextFlags_CallbackAlways = 1 << 8, // Call user function every time
|
|
398
|
+ ImGuiInputTextFlags_CallbackCharFilter = 1 << 9 // Call user function to filter character. Modify data->EventChar to replace/filter input, or return 1 to discard character.
|
374
|
399
|
//ImGuiInputTextFlags_AlignCenter = 1 << 6,
|
375
|
400
|
};
|
376
|
401
|
|
|
@@ -402,6 +427,7 @@ enum ImGuiCol_
|
402
|
427
|
{
|
403
|
428
|
ImGuiCol_Text,
|
404
|
429
|
ImGuiCol_WindowBg,
|
|
430
|
+ ImGuiCol_ChildWindowBg,
|
405
|
431
|
ImGuiCol_Border,
|
406
|
432
|
ImGuiCol_BorderShadow,
|
407
|
433
|
ImGuiCol_FrameBg, // Background of checkbox, radio button, plot, slider, text input
|
|
@@ -445,14 +471,15 @@ enum ImGuiCol_
|
445
|
471
|
// NB: the enum only refers to fields of ImGuiStyle() which makes sense to be pushed/poped in UI code. Feel free to add others.
|
446
|
472
|
enum ImGuiStyleVar_
|
447
|
473
|
{
|
448
|
|
- ImGuiStyleVar_Alpha, // float
|
449
|
|
- ImGuiStyleVar_WindowPadding, // ImVec2
|
450
|
|
- ImGuiStyleVar_WindowRounding, // float
|
451
|
|
- ImGuiStyleVar_FramePadding, // ImVec2
|
452
|
|
- ImGuiStyleVar_FrameRounding, // float
|
453
|
|
- ImGuiStyleVar_ItemSpacing, // ImVec2
|
454
|
|
- ImGuiStyleVar_ItemInnerSpacing, // ImVec2
|
455
|
|
- ImGuiStyleVar_TreeNodeSpacing // float
|
|
474
|
+ ImGuiStyleVar_Alpha, // float
|
|
475
|
+ ImGuiStyleVar_WindowPadding, // ImVec2
|
|
476
|
+ ImGuiStyleVar_WindowRounding, // float
|
|
477
|
+ ImGuiStyleVar_ChildWindowRounding, // float
|
|
478
|
+ ImGuiStyleVar_FramePadding, // ImVec2
|
|
479
|
+ ImGuiStyleVar_FrameRounding, // float
|
|
480
|
+ ImGuiStyleVar_ItemSpacing, // ImVec2
|
|
481
|
+ ImGuiStyleVar_ItemInnerSpacing, // ImVec2
|
|
482
|
+ ImGuiStyleVar_TreeNodeSpacing // float
|
456
|
483
|
};
|
457
|
484
|
|
458
|
485
|
// Enumeration for ColorEditMode()
|
|
@@ -480,6 +507,7 @@ struct ImGuiStyle
|
480
|
507
|
ImVec2 WindowPadding; // Padding within a window
|
481
|
508
|
ImVec2 WindowMinSize; // Minimum window size
|
482
|
509
|
float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows
|
|
510
|
+ float ChildWindowRounding; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows
|
483
|
511
|
ImVec2 FramePadding; // Padding within a framed rectangle (used by most widgets)
|
484
|
512
|
float FrameRounding; // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
|
485
|
513
|
ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines
|
|
@@ -561,6 +589,7 @@ struct ImGuiIO
|
561
|
589
|
|
562
|
590
|
bool WantCaptureMouse; // Mouse is hovering a window or widget is active (= ImGui will use your mouse input)
|
563
|
591
|
bool WantCaptureKeyboard; // Widget is active (= ImGui will use your keyboard input)
|
|
592
|
+ float Framerate; // Framerate estimation, in frame per second. Rolling average estimation based on IO.DeltaTime over 120 frames
|
564
|
593
|
|
565
|
594
|
//------------------------------------------------------------------
|
566
|
595
|
// [Internal] ImGui will maintain those fields for you
|
|
@@ -692,15 +721,21 @@ struct ImGuiStorage
|
692
|
721
|
// Shared state of InputText(), passed to callback when a ImGuiInputTextFlags_Callback* flag is used.
|
693
|
722
|
struct ImGuiTextEditCallbackData
|
694
|
723
|
{
|
695
|
|
- ImGuiKey EventKey; // Key pressed (Up/Down/TAB) // Read-only
|
696
|
|
- char* Buf; // Current text // Read-write (pointed data only)
|
697
|
|
- size_t BufSize; // // Read-only
|
698
|
|
- bool BufDirty; // Set if you modify Buf directly // Write
|
699
|
|
- ImGuiInputTextFlags Flags; // What user passed to InputText() // Read-only
|
700
|
|
- int CursorPos; // // Read-write
|
701
|
|
- int SelectionStart; // // Read-write (== to SelectionEnd when no selection)
|
702
|
|
- int SelectionEnd; // // Read-write
|
703
|
|
- void* UserData; // What user passed to InputText()
|
|
724
|
+ ImGuiInputTextFlags EventFlag; // One of ImGuiInputTextFlags_Callback* // Read-only
|
|
725
|
+ ImGuiInputTextFlags Flags; // What user passed to InputText() // Read-only
|
|
726
|
+ void* UserData; // What user passed to InputText() // Read-only
|
|
727
|
+
|
|
728
|
+ // CharFilter event:
|
|
729
|
+ ImWchar EventChar; // Character input // Read-write (replace character or set to zero)
|
|
730
|
+
|
|
731
|
+ // Completion,History,Always events:
|
|
732
|
+ ImGuiKey EventKey; // Key pressed (Up/Down/TAB) // Read-only
|
|
733
|
+ char* Buf; // Current text // Read-write (pointed data only)
|
|
734
|
+ size_t BufSize; // // Read-only
|
|
735
|
+ bool BufDirty; // Set if you modify Buf directly // Write
|
|
736
|
+ int CursorPos; // // Read-write
|
|
737
|
+ int SelectionStart; // // Read-write (== to SelectionEnd when no selection)
|
|
738
|
+ int SelectionEnd; // // Read-write
|
704
|
739
|
|
705
|
740
|
// NB: calling those function loses selection.
|
706
|
741
|
void DeleteChars(int pos, int bytes_count);
|
|
@@ -796,7 +831,7 @@ struct ImDrawList
|
796
|
831
|
IMGUI_API void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
797
|
832
|
IMGUI_API void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
798
|
833
|
IMGUI_API void AddArc(const ImVec2& center, float rad, ImU32 col, int a_min, int a_max, bool tris = false, const ImVec2& third_point_offset = ImVec2(0,0));
|
799
|
|
- IMGUI_API void AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f);
|
|
834
|
+ IMGUI_API void AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL);
|
800
|
835
|
IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col = 0xFFFFFFFF);
|
801
|
836
|
|
802
|
837
|
// Advanced
|
|
@@ -886,6 +921,7 @@ struct ImFont
|
886
|
921
|
};
|
887
|
922
|
ImFontAtlas* ContainerAtlas; // What we has been loaded into
|
888
|
923
|
ImVector<Glyph> Glyphs;
|
|
924
|
+ ImVector<float> IndexXAdvance; // Glyphs->XAdvance directly indexable (for CalcTextSize functions which are often bottleneck in large UI)
|
889
|
925
|
ImVector<int> IndexLookup; // Index glyphs by Unicode code-point
|
890
|
926
|
const Glyph* FallbackGlyph; // == FindGlyph(FontFallbackChar)
|
891
|
927
|
|
|
@@ -901,7 +937,7 @@ struct ImFont
|
901
|
937
|
// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
902
|
938
|
IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL) const; // utf8
|
903
|
939
|
IMGUI_API ImVec2 CalcTextSizeW(float size, float max_width, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL) const; // wchar
|
904
|
|
- IMGUI_API void RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width = 0.0f) const;
|
|
940
|
+ IMGUI_API void RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL) const;
|
905
|
941
|
IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const;
|
906
|
942
|
};
|
907
|
943
|
|