User Tools

Site Tools


addons:functions:imgui

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
addons:functions:imgui [2016/06/27 04:33]
atom0s
addons:functions:imgui [2016/06/27 13:51]
atom0s
Line 62: Line 62:
   * <color green>​void SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond = 0);</​color>​\\   * <color green>​void SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond = 0);</​color>​\\
   * <color green>​void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeConstraintCallback custom_callback = NULL, void* custom_callback_data = NULL);</​color>​\\   * <color green>​void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeConstraintCallback custom_callback = NULL, void* custom_callback_data = NULL);</​color>​\\
-    * Callbacks are not implemented.+    * callback is implemented as a string. It is the name to a Lua function to call when the callback is invoked. (custom_callback_data is not implemented.)
   * <color green>​void SetNextWindowContentSize(const ImVec2& size);</​color>​\\   * <color green>​void SetNextWindowContentSize(const ImVec2& size);</​color>​\\
   * <color green>​void SetNextWindowContentWidth(float width);</​color>​\\   * <color green>​void SetNextWindowContentWidth(float width);</​color>​\\
Line 389: Line 389:
 ===== Notes ===== ===== Notes =====
  
-InputText / InputTextMultiline - The callback, if present, should be a string that points to a callback function like this:+**InputText / InputTextMultiline** - The callback, if present, should be a string that points to a callback function like this:
  - The callbacks data is a [[imgui.ImGuiTextEditCallbackData]] structure instance.  - The callbacks data is a [[imgui.ImGuiTextEditCallbackData]] structure instance.
  
Line 403: Line 403:
 </​code>​ </​code>​
  
 +**SetNextWindowSizeConstraints** - The callback, if present, should be a string that points to a callback function like this:
 + - The callbacks data is a [[imgui.ImGuiSizeConstraintCallbackData]] structure instance.
 +
 +<code lua>
 +function SquareResizeConstraint(data)
 +    data.DesiredSize = ImVec2(math.max(data.DesiredSize.x,​ data.DesiredSize.y),​ math.max(data.DesiredSize.x,​ data.DesiredSize.y)); ​   ​
 +end
 +
 +imgui.SetNextWindowSizeConstraints(0,​ 0, float_max, float_max, '​SquareResizeConstraint'​);​
 +</​code>​
addons/functions/imgui.txt · Last modified: 2016/06/27 21:37 by atom0s