User Tools

Site Tools


addons:functions:imgui.imguitexteditcallbackdata

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
addons:functions:imgui.imguitexteditcallbackdata [2016/06/27 05:26]
atom0s
addons:functions:imgui.imguitexteditcallbackdata [2016/06/27 12:27] (current)
atom0s
Line 18: Line 18:
     int                 ​SelectionStart;//​ The selection start position.     int                 ​SelectionStart;//​ The selection start position.
     int                 ​SelectionEnd; ​ // The selection end position.     int                 ​SelectionEnd; ​ // The selection end position.
 +    ​
 +    void DeleteChars(int pos, int count);
 +    void InsertChars(int pos, const char* new_text);
 +    bool HasSelection();​
 }; };
 </​code>​ </​code>​
Line 23: Line 27:
 Some fields are read-only and cannot be edited. Some fields are read-only and cannot be edited.
  
-If you edit the '​Buf'​ field, you must update the BufTextLen to the new length as well as set BufDirty to true in order for it to be properly updated.+If you edit the '​Buf'​ field, you must update the BufTextLen to the new length as well as set BufDirty to true in order for it to be properly updated. To do this easily you can make use of the DeleteChars and InsertChars functions which will handle the property adjustments for you.
  
 You may also want to set CursorPos to the end of the string for a more expected result. You may also want to set CursorPos to the end of the string for a more expected result.
addons/functions/imgui.imguitexteditcallbackdata.txt · Last modified: 2016/06/27 12:27 by atom0s