Package imgui

Class ImGuiInputTextCallbackData

java.lang.Object
imgui.binding.ImGuiStruct
imgui.ImGuiInputTextCallbackData

public class ImGuiInputTextCallbackData extends ImGuiStruct
Shared state of InputText(), passed as an argument to your callback when a ImGuiInputTextFlags_Callback* flag is used.

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.

  • Constructor Details

    • ImGuiInputTextCallbackData

      public ImGuiInputTextCallbackData(long ptr)
  • Method Details

    • getCtx

      public ImGuiContext getCtx()
      Parent UI context
    • setCtx

      public void setCtx(ImGuiContext value)
      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

      public String getBuf()
      [Resize] Can replace pointer

      [Completion,History,Always] Only write to pointed data, don't replace the actual pointer!

    • setBuf

      public void setBuf(String value)
      [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 Pos
      bytesCount - Delete Char Count
    • insertChars

      public void insertChars(int pos, String str)
      Insert Chars
      Parameters:
      pos - insert Psos
      str - insert String
    • selectAll

      public void selectAll()
    • clearSelection

      public void clearSelection()
    • hasSelection

      public boolean hasSelection()