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 |
clearSelection() |
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 |
getBufTextLen()
[Resize,Completion,History,Always] Exclude zero-terminator storage.
|
int |
getCursorPos()
Current cursor position
|
int |
getEventChar()
[CharFilter] Replace character with another one, or set to zero to drop.
|
int |
getEventFlag()
One ImGuiInputTextFlags_Callback*
|
int |
getEventKey()
[Completion,History]
|
int |
getFlags()
What user passed to InputText()
|
int |
getSelectionEnd()
Selection End
|
int |
getSelectionStart()
Selection Start
|
boolean |
hasEventFlag(int flags)
One ImGuiInputTextFlags_Callback*
|
boolean |
hasFlags(int flags)
What user passed to InputText()
|
boolean |
hasSelection() |
void |
insertChars(int pos,
java.lang.String str)
Insert Chars
|
void |
selectAll() |
void |
setBuf(java.lang.String value)
[Resize] Can replace pointer
|
void |
setBufDirty(boolean value)
Set if you modify Buf/BufTextLen!
|
void |
setBufTextLen(int value)
[Resize,Completion,History,Always] Exclude zero-terminator storage.
|
void |
setCursorPos(int value)
Current cursor position
|
void |
setEventChar(int value)
[CharFilter] Replace character with another one, or set to zero to drop.
|
void |
setSelectionEnd(int value)
Selection End
|
void |
setSelectionStart(int value)
Selection Start
|
isNotValidPtr, isValidPtr
public int getEventFlag()
public boolean hasEventFlag(int flags)
public int getFlags()
public boolean hasFlags(int flags)
public int getEventChar()
public void setEventChar(int value)
public int getEventKey()
public java.lang.String getBuf()
[Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
public void setBuf(java.lang.String value)
[Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
public int getBufTextLen()
public void setBufTextLen(int value)
public boolean getBufDirty()
public void setBufDirty(boolean value)
public int getCursorPos()
public void setCursorPos(int value)
public int getSelectionStart()
public void setSelectionStart(int value)
public int getSelectionEnd()
public void setSelectionEnd(int value)
public 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 Stringpublic void selectAll()
public void clearSelection()
public boolean hasSelection()