public class ImGuiInputTextCallbackData extends ImGuiStruct
The callback function should return 0 by default.
Callbacks (follow a flag name and see comments in ImGuiInputTextFlags_ declarations for more details)
- ImGuiInputTextFlags_CallbackEdit: Callback on buffer edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active)
- ImGuiInputTextFlags_CallbackAlways: Callback on each iteration
- ImGuiInputTextFlags_CallbackCompletion: Callback on pressing TAB
- ImGuiInputTextFlags_CallbackHistory: Callback on pressing Up/Down arrows
- ImGuiInputTextFlags_CallbackCharFilter: Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard.
- ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.
ptr
Constructor and Description |
---|
ImGuiInputTextCallbackData(long ptr) |
Modifier and Type | Method and Description |
---|---|
void |
deleteChars(int pos,
int bytesCount)
Delete Chars
|
java.lang.String |
getBuf()
[Resize] Can replace pointer
|
boolean |
getBufDirty()
Set if you modify Buf/BufTextLen!
|
int |
getCursorPos()
Current cursor position
|
int |
getEventChar()
[CharFilter] Character input;
|
int |
getEventFlag()
One ImGuiInputTextFlags_Callback*
|
int |
getEventKey()
[Completion,History]
|
int |
getFlags()
What user passed to InputText()
|
int |
getSelectionEnd()
Selection End
|
int |
getSelectionStart()
Selection Start
|
void |
insertChars(int pos,
java.lang.String str)
Insert Chars
|
void |
setBufDirty(boolean dirty)
Set if you modify Buf/BufTextLen!
|
void |
setCursorPos(int pos)
Set the current cursor position
|
void |
setEventChar(char c)
[CharFilter] Replace character with another one, or set to zero to drop.
|
void |
setEventChar(int c)
[CharFilter] Replace character with another one, or set to zero to drop.
|
void |
setSelectionEnd(int pos)
Set Selection End
|
void |
setSelectionStart(int pos)
Set Selection Start
|
isNotValidPtr, isValidPtr
public int getEventFlag()
public int getFlags()
public int getEventChar()
public void setEventChar(char c)
c
- Replaced characterspublic void setEventChar(int c)
c
- Replaced characterspublic int getEventKey()
public java.lang.String getBuf()
[Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
public boolean getBufDirty()
public void setBufDirty(boolean dirty)
dirty
- Dirtypublic int getCursorPos()
public void setCursorPos(int pos)
pos
- Set the current cursor positionpublic int getSelectionStart()
public void setSelectionStart(int pos)
pos
- Selection Startpublic int getSelectionEnd()
public void setSelectionEnd(int pos)
pos
- Selection Endpublic void deleteChars(int pos, int bytesCount)
pos
- Start Delete PosbytesCount
- Delete Char Countpublic void insertChars(int pos, java.lang.String str)
pos
- insert Psosstr
- insert String