@ -157,6 +157,7 @@ typedef int ImGuiButtonFlags; // -> enum ImGuiButtonFlags_ // Flags: f
typedefintImGuiColorEditFlags;// -> enum ImGuiColorEditFlags_ // Flags: for ColorEdit4(), ColorPicker4() etc.
typedefintImGuiConfigFlags;// -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags
typedefintImGuiComboFlags;// -> enum ImGuiComboFlags_ // Flags: for BeginCombo()
typedefintImGuiDragFlags;// -> enum ImGuiDragFlags_ // Flags: for DragFloat(), DragInt() etc.
typedefintImGuiDragDropFlags;// -> enum ImGuiDragDropFlags_ // Flags: for BeginDragDropSource(), AcceptDragDropPayload()
typedefintImGuiFocusedFlags;// -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused()
typedefintImGuiHoveredFlags;// -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
@ -164,11 +165,11 @@ typedef int ImGuiInputTextFlags; // -> enum ImGuiInputTextFlags_ // Flags: f
typedefintImGuiKeyModFlags;// -> enum ImGuiKeyModFlags_ // Flags: for io.KeyMods (Ctrl/Shift/Alt/Super)
typedefintImGuiPopupFlags;// -> enum ImGuiPopupFlags_ // Flags: for OpenPopup*(), BeginPopupContext*(), IsPopupOpen()
typedefintImGuiSelectableFlags;// -> enum ImGuiSelectableFlags_ // Flags: for Selectable()
typedefintImGuiSliderFlags;// -> enum ImGuiSliderFlags_ // Flags: for SliderFloat(), SliderInt() etc.
typedefintImGuiTabBarFlags;// -> enum ImGuiTabBarFlags_ // Flags: for BeginTabBar()
typedefintImGuiTabItemFlags;// -> enum ImGuiTabItemFlags_ // Flags: for BeginTabItem()
typedefintImGuiTreeNodeFlags;// -> enum ImGuiTreeNodeFlags_ // Flags: for TreeNode(), TreeNodeEx(), CollapsingHeader()
typedefintImGuiWindowFlags;// -> enum ImGuiWindowFlags_ // Flags: for Begin(), BeginChild()
typedefintImGuiDragSliderFlags;// -> enum ImGuiDragSliderFlags_ // Flags: for SliderFloat()/DragFloat()/etc
// Other types
#ifndef ImTextureID // ImTextureID [configurable type: override in imconfig.h with '#define ImTextureID xxx']
@ -466,57 +467,36 @@ namespace ImGui
// - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision).
// - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits.
// - Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum.
IMGUI_APIboolDragFloat(constchar*label,float*v,floatv_speed=1.0f,floatv_min=0.0f,floatv_max=0.0f,constchar*format="%.3f",ImGuiDragSliderFlagsflags=0);// If v_min >= v_max we have no bound
IMGUI_APIboolDragInt(constchar*label,int*v,floatv_speed=1.0f,intv_min=0,intv_max=0,constchar*format="%d",ImGuiDragSliderFlagsflags=0);// If v_min >= v_max we have no bound
IMGUI_APIboolDragFloat(constchar*label,float*v,floatv_speed=1.0f,floatv_min=0.0f,floatv_max=0.0f,constchar*format="%.3f",ImGuiDragFlagsflags=0);// If v_min >= v_max we have no bound
IMGUI_APIboolDragInt(constchar*label,int*v,floatv_speed=1.0f,intv_min=0,intv_max=0,constchar*format="%d",ImGuiDragFlagsflags=0);// If v_min >= v_max we have no bound
// - CTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped and can go off-bounds.
// - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
IMGUI_APIboolSliderFloat(constchar*label,float*v,floatv_min,floatv_max,constchar*format="%.3f",ImGuiDragSliderFlagsflags=0);// adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display.
// Old slider functions that take a power term instead of flags
IMGUI_APIboolSliderFloat(constchar*label,float*v,floatv_min,floatv_max,constchar*format,floatpower);// adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display. Use power!=1.0 for power curve sliders
IMGUI_APIboolSliderFloat(constchar*label,float*v,floatv_min,floatv_max,constchar*format="%.3f",ImGuiSliderFlagsflags=0);// adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display.
// - If you want to use InputText() with std::string or any custom dynamic string type, see misc/cpp/imgui_stdlib.h and comments in imgui_demo.cpp.
@ -1304,12 +1284,22 @@ enum ImGuiColorEditFlags_
#endif
};
// Flags for configuring drag/slider widgets
enumImGuiDragSliderFlags_
// Flags for DragFloat(), DragInt() etc.
enumImGuiDragFlags_
{
ImGuiDragSliderFlags__AnythingBelowThisMightBeAPowerTerm=8,// We treat anything < this as being potentially a (float) power term from the previous API that has got miscast to this enum, and trigger an assert
ImGuiDragSliderFlags_Vertical=1<<3,// Should this widget be orientated vertically?
ImGuiDragSliderFlags_Logarithmic=1<<4// Should this widget be logarithmic? (linear otherwise)
ImGuiDragFlags_None=0,
ImGuiDragFlags__AnythingBelowThisMightBeAPowerTerm=8,// We treat anything < this as being potentially a (float) power term from the previous API that has got miscast to this enum, and trigger an assert
ImGuiDragFlags_Vertical=1<<3,// Should this widget be orientated vertically?
ImGuiDragFlags_Logarithmic=1<<4// Should this widget be logarithmic? (linear otherwise)
};
// Flags for SliderFloat(), SliderInt() etc.
enumImGuiSliderFlags_
{
ImGuiSliderFlags_None=0,
ImGuiSliderFlags__AnythingBelowThisMightBeAPowerTerm=8,// We treat anything < this as being potentially a (float) power term from the previous API that has got miscast to this enum, and trigger an assert
ImGuiSliderFlags_Vertical=1<<3,// Should this widget be orientated vertically?
ImGuiSliderFlags_Logarithmic=1<<4// Should this widget be logarithmic? (linear otherwise)
};
// Identify a mouse button.
@ -1715,6 +1705,23 @@ struct ImGuiPayload
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
namespaceImGui
{
// OBSOLETED in 1.78 (from July 2020)
// Old drag/sliders functions that took a 'float power = 1.0' argument instead of flags
staticinlineboolOpenPopupOnItemClick(constchar*str_id=NULL,ImGuiMouseButtonmb=1){returnOpenPopupContextItem(str_id,mb);}// Passing a mouse button to ImGuiPopupFlags is legal
IMGUI_APIboolTreeNodeBehaviorIsOpen(ImGuiIDid,ImGuiTreeNodeFlagsflags=0);// Consume previous SetNextItemOpen() data, if any. May return true when logging
IMGUI_APIvoidTreePushOverrideID(ImGuiIDid);
// Internal implementations for some of the exposed functions (use the non-internal versions instead)
// Template functions are instantiated in imgui_widgets.cpp for a finite number of types.
// To use them externally (for custom widget) you may need an "extern template" statement in your code in order to link to existing instances and silence Clang warnings (see #2036).
// e.g. " extern template IMGUI_API float RoundScalarWithFormatT<float, float>(const char* format, ImGuiDataType data_type, float v); "
IM_ASSERT(((flags==0)||(flags>=ImGuiDragSliderFlags__AnythingBelowThisMightBeAPowerTerm))&&"Invalid ImGuiDragSliderFlags flags - has a power term been mistakenly cast to flags?");
IM_ASSERT(((flags==0)||(flags>=ImGuiDragFlags__AnythingBelowThisMightBeAPowerTerm))&&"Invalid ImGuiDragFlags flags - has a power term been mistakenly cast to flags?");
// Convert a value v in the output space of a slider into a parametric position on the slider itself (the logical opposite of SliderCalcValueFromRatioT)
@ -2630,14 +2628,14 @@ TYPE ImGui::SliderCalcValueFromRatioT(ImGuiDataType data_type, float t, TYPE v_m
// FIXME: Move some of the code into SliderBehavior(). Current responsibility is larger than what the equivalent DragBehaviorT<> does, we also do some rendering, etc.
IM_ASSERT(((flags==0)||(flags>=ImGuiDragSliderFlags__AnythingBelowThisMightBeAPowerTerm))&&"Invalid ImGuiDragSliderFlags flags - has a power term been mistakenly cast to flags?");
IM_ASSERT(((flags==0)||(flags>=ImGuiSliderFlags__AnythingBelowThisMightBeAPowerTerm))&&"Invalid ImGuiSliderFlags flags - has a power term been mistakenly cast to flags?");