Class ImGuiInputTextCallbackData
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.
-
Field Summary
Fields inherited from class imgui.binding.ImGuiStruct
ptr -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeleteChars(int pos, int bytesCount) Delete CharsgetBuf()[Resize] Can replace pointerbooleanSet if you modify Buf/BufTextLen!int[Resize,Completion,History,Always] Exclude zero-terminator storage.getCtx()Parent UI contextintCurrent cursor positionint[CharFilter] Replace character with another one, or set to zero to drop.intOne ImGuiInputTextFlags_Callback*int[Completion,History]intgetFlags()What user passed to InputText()intSelection EndintSelection StartbooleanhasEventFlag(int flags) One ImGuiInputTextFlags_Callback*booleanhasFlags(int flags) What user passed to InputText()booleanvoidinsertChars(int pos, String str) Insert Charsvoidvoid[Resize] Can replace pointervoidsetBufDirty(boolean value) Set if you modify Buf/BufTextLen!voidsetBufTextLen(int value) [Resize,Completion,History,Always] Exclude zero-terminator storage.voidsetCtx(ImGuiContext value) Parent UI contextvoidsetCursorPos(int value) Current cursor positionvoidsetEventChar(int value) [CharFilter] Replace character with another one, or set to zero to drop.voidsetSelectionEnd(int value) Selection EndvoidsetSelectionStart(int value) Selection StartMethods inherited from class imgui.binding.ImGuiStruct
isNotValidPtr, isValidPtr
-
Constructor Details
-
ImGuiInputTextCallbackData
public ImGuiInputTextCallbackData(long ptr)
-
-
Method Details
-
getCtx
Parent UI context -
setCtx
Parent UI context -
getEventFlag
public int getEventFlag()One ImGuiInputTextFlags_Callback* -
hasEventFlag
public boolean hasEventFlag(int flags) One ImGuiInputTextFlags_Callback* -
getFlags
public int getFlags()What user passed to InputText() -
hasFlags
public boolean hasFlags(int flags) What user passed to InputText() -
getEventChar
public int getEventChar()[CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0; -
setEventChar
public void setEventChar(int value) [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0; -
getEventKey
public int getEventKey()[Completion,History] -
getBuf
[Resize] Can replace pointer[Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
-
setBuf
[Resize] Can replace pointer[Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
-
getBufTextLen
public int getBufTextLen()[Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length() -
setBufTextLen
public void setBufTextLen(int value) [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length() -
getBufDirty
public boolean getBufDirty()Set if you modify Buf/BufTextLen! -
setBufDirty
public void setBufDirty(boolean value) Set if you modify Buf/BufTextLen! -
getCursorPos
public int getCursorPos()Current cursor position -
setCursorPos
public void setCursorPos(int value) Current cursor position -
getSelectionStart
public int getSelectionStart()Selection Start -
setSelectionStart
public void setSelectionStart(int value) Selection Start -
getSelectionEnd
public int getSelectionEnd()Selection End -
setSelectionEnd
public void setSelectionEnd(int value) Selection End -
deleteChars
public void deleteChars(int pos, int bytesCount) Delete Chars- Parameters:
pos- Start Delete PosbytesCount- Delete Char Count
-
insertChars
Insert Chars- Parameters:
pos- insert Psosstr- insert String
-
selectAll
public void selectAll() -
clearSelection
public void clearSelection() -
hasSelection
public boolean hasSelection()
-