mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-30 20:51:06 +01:00 
			
		
		
		
	Internals: Added code in TempInputScalar() to clamp values, NOT used by stock Drag/Float (#3209, #1829, #946, #413)
This commit is contained in:
		| @@ -715,6 +715,11 @@ struct IMGUI_API ImRect | ||||
|     bool        IsInverted() const                  { return Min.x > Max.x || Min.y > Max.y; } | ||||
| }; | ||||
|  | ||||
| struct ImGuiDataTypeTempStorage | ||||
| { | ||||
|     ImU8        Data[8];        // Can fit any data up to ImGuiDataType_COUNT | ||||
| }; | ||||
|  | ||||
| // Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo(). | ||||
| struct ImGuiDataTypeInfo | ||||
| { | ||||
| @@ -1893,11 +1898,12 @@ namespace ImGui | ||||
|     IMGUI_API int           DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format); | ||||
|     IMGUI_API void          DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, void* arg_1, const void* arg_2); | ||||
|     IMGUI_API bool          DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* p_data, const char* format); | ||||
|     IMGUI_API bool          DataTypeClamp(ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max); | ||||
|  | ||||
|     // InputText | ||||
|     IMGUI_API bool          InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); | ||||
|     IMGUI_API bool          TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags); | ||||
|     IMGUI_API bool          TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format); | ||||
|     IMGUI_API bool          TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min = NULL, const void* p_clamp_max = NULL); | ||||
|     inline bool             TempInputIsActive(ImGuiID id)       { ImGuiContext& g = *GImGui; return (g.ActiveId == id && g.TempInputId == id); } | ||||
|     inline ImGuiInputTextState* GetInputTextState(ImGuiID id)   { ImGuiContext& g = *GImGui; return (g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user