Class: ImGuiInputTextCallbackData

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/imgui.rb

Overview

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 + you can always use IsItemEdited(). The callback is useful 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.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.createObject



2261
2262
2263
# File 'lib/imgui.rb', line 2261

def self.create()
  return ImGuiInputTextCallbackData.new(ImGui::ImGuiInputTextCallbackData_ImGuiInputTextCallbackData())
end

Instance Method Details

#ClearSelectionObject



2249
2250
2251
# File 'lib/imgui.rb', line 2249

def ClearSelection()
  ImGui::ImGuiInputTextCallbackData_ClearSelection(self)
end

#DeleteChars(pos, bytes_count) ⇒ Object



2253
2254
2255
# File 'lib/imgui.rb', line 2253

def DeleteChars(pos, bytes_count)
  ImGui::ImGuiInputTextCallbackData_DeleteChars(self, pos, bytes_count)
end

#destroyObject



2273
2274
2275
# File 'lib/imgui.rb', line 2273

def destroy()
  ImGui::ImGuiInputTextCallbackData_destroy(self)
end

#HasSelectionObject



2257
2258
2259
# File 'lib/imgui.rb', line 2257

def HasSelection()
  ImGui::ImGuiInputTextCallbackData_HasSelection(self)
end

#InsertChars(pos, text, text_end = nil) ⇒ Object



2265
2266
2267
# File 'lib/imgui.rb', line 2265

def InsertChars(pos, text, text_end = nil)
  ImGui::ImGuiInputTextCallbackData_InsertChars(self, pos, text, text_end)
end

#SelectAllObject



2269
2270
2271
# File 'lib/imgui.rb', line 2269

def SelectAll()
  ImGui::ImGuiInputTextCallbackData_SelectAll(self)
end