You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking for a classic spinner input (int input with up/down arrows on right), but could not find anything. Of course this is basically the same as InputInt etc but replacing the +/- buttons with arrow buttons just improving the look.
I implemented based on InputScalar(), and modifying the +/- button code to use ArrowButtons within a group in order to stack the arrows. The only issue/hack is the ImGui ArrowButton/RenderArrow methods are dependent on the FontSize. So in order to properly scale the arrow buttons down I had to override/restore the current FontSize. Perhaps there is a better way.
The code below defines SpinInt/SpinScalar as I did not want to change the current widgets. The portion that is different from InputScalar is blocked with start/end diff comments.
Dear ImGui 1.72 WIP (17101)
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=201703
define: APPLE
define: GNUC=4
define: clang_version=10.0.1 (clang-1001.0.46.4)
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
I was looking for a classic spinner input (int input with up/down arrows on right), but could not find anything. Of course this is basically the same as InputInt etc but replacing the +/- buttons with arrow buttons just improving the look.
I implemented based on InputScalar(), and modifying the +/- button code to use ArrowButtons within a group in order to stack the arrows. The only issue/hack is the ImGui ArrowButton/RenderArrow methods are dependent on the FontSize. So in order to properly scale the arrow buttons down I had to override/restore the current FontSize. Perhaps there is a better way.
The code below defines SpinInt/SpinScalar as I did not want to change the current widgets. The portion that is different from InputScalar is blocked with start/end diff comments.
Example:
Hopefully someone will find this useful.
The text was updated successfully, but these errors were encountered: