1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-28 01:20:55 +01:00

Refactor: Added empty imgui_widgets.cpp + updated project files / makefiles etc. accordingly (#2036)

This commit is contained in:
omar 2018-08-28 21:59:14 +02:00
parent f2aa124eb8
commit 01586d33f3
29 changed files with 76 additions and 5 deletions

View File

@ -22,6 +22,7 @@ Dear ImGui is self-contained within a few files that you can easily copy and com
- imgui.h - imgui.h
- imgui_demo.cpp - imgui_demo.cpp
- imgui_draw.cpp - imgui_draw.cpp
- imgui_widgets.cpp
- imgui_internal.h - imgui_internal.h
- imconfig.h (empty by default, user-editable) - imconfig.h (empty by default, user-editable)
- stb_rect_pack.h - stb_rect_pack.h

View File

@ -153,6 +153,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_allegro5.cpp" /> <ClCompile Include="..\imgui_impl_allegro5.cpp" />
<ClCompile Include="imconfig_allegro5.h" /> <ClCompile Include="imconfig_allegro5.h" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />

View File

@ -28,6 +28,9 @@
<ClCompile Include="imconfig_allegro5.h"> <ClCompile Include="imconfig_allegro5.h">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\imconfig.h"> <ClInclude Include="..\..\imconfig.h">

View File

@ -153,6 +153,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_freeglut.cpp" /> <ClCompile Include="..\imgui_impl_freeglut.cpp" />
<ClCompile Include="..\imgui_impl_opengl2.cpp" /> <ClCompile Include="..\imgui_impl_opengl2.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />

View File

@ -28,6 +28,9 @@
<ClCompile Include="..\imgui_impl_opengl2.cpp"> <ClCompile Include="..\imgui_impl_opengl2.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\imconfig.h"> <ClInclude Include="..\..\imconfig.h">

View File

@ -17,7 +17,7 @@
EXE = example_glfw_opengl2 EXE = example_glfw_opengl2
SOURCES = main.cpp SOURCES = main.cpp
SOURCES += ../imgui_impl_glfw.cpp ../imgui_impl_opengl2.cpp SOURCES += ../imgui_impl_glfw.cpp ../imgui_impl_opengl2.cpp
SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)

View File

@ -153,6 +153,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_glfw.cpp" /> <ClCompile Include="..\imgui_impl_glfw.cpp" />
<ClCompile Include="..\imgui_impl_opengl2.cpp" /> <ClCompile Include="..\imgui_impl_opengl2.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />

View File

@ -28,6 +28,9 @@
<ClCompile Include="..\imgui_impl_opengl2.cpp"> <ClCompile Include="..\imgui_impl_opengl2.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\imconfig.h"> <ClInclude Include="..\..\imconfig.h">

View File

@ -17,7 +17,7 @@
EXE = example_glfw_opengl3 EXE = example_glfw_opengl3
SOURCES = main.cpp SOURCES = main.cpp
SOURCES += ../imgui_impl_glfw.cpp ../imgui_impl_opengl3.cpp SOURCES += ../imgui_impl_glfw.cpp ../imgui_impl_opengl3.cpp
SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)

View File

@ -153,6 +153,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_glfw.cpp" /> <ClCompile Include="..\imgui_impl_glfw.cpp" />
<ClCompile Include="..\imgui_impl_opengl3.cpp" /> <ClCompile Include="..\imgui_impl_opengl3.cpp" />
<ClCompile Include="..\libs\gl3w\GL\gl3w.c" /> <ClCompile Include="..\libs\gl3w\GL\gl3w.c" />

View File

@ -34,6 +34,9 @@
<ClCompile Include="..\imgui_impl_opengl3.cpp"> <ClCompile Include="..\imgui_impl_opengl3.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\imconfig.h"> <ClInclude Include="..\..\imconfig.h">

View File

@ -33,6 +33,7 @@ files
../../imgui.cpp ../../imgui.cpp
../../imgui_demo.cpp ../../imgui_demo.cpp
../../imgui_draw.cpp ../../imgui_draw.cpp
../../imgui_widgets.cpp
../../imconfig.h ../../imconfig.h
../../imgui.h ../../imgui.h
../../imgui_internal.h ../../imgui_internal.h

View File

@ -16,7 +16,7 @@
EXE = example_sdl_opengl2 EXE = example_sdl_opengl2
SOURCES = main.cpp ../imgui_impl_sdl.cpp ../imgui_impl_opengl2.cpp SOURCES = main.cpp ../imgui_impl_sdl.cpp ../imgui_impl_opengl2.cpp
SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)

View File

@ -19,7 +19,7 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{2AE17FDE-F7F3-4CAC-ADAB-0710EDA4F741}</ProjectGuid> <ProjectGuid>{94E991D0-790A-4DAF-B442-AAADE3233C75}</ProjectGuid>
<RootNamespace>example_sdl_opengl2</RootNamespace> <RootNamespace>example_sdl_opengl2</RootNamespace>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@ -153,6 +153,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_opengl2.cpp" /> <ClCompile Include="..\imgui_impl_opengl2.cpp" />
<ClCompile Include="..\imgui_impl_sdl.cpp" /> <ClCompile Include="..\imgui_impl_sdl.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />

View File

@ -28,6 +28,9 @@
<ClCompile Include="..\imgui_impl_opengl2.cpp"> <ClCompile Include="..\imgui_impl_opengl2.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\imconfig.h"> <ClInclude Include="..\..\imconfig.h">

View File

@ -17,7 +17,7 @@
EXE = example_sdl_opengl3 EXE = example_sdl_opengl3
SOURCES = main.cpp SOURCES = main.cpp
SOURCES += ../imgui_impl_sdl.cpp ../imgui_impl_opengl3.cpp SOURCES += ../imgui_impl_sdl.cpp ../imgui_impl_opengl3.cpp
SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)

View File

@ -153,6 +153,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_opengl3.cpp" /> <ClCompile Include="..\imgui_impl_opengl3.cpp" />
<ClCompile Include="..\imgui_impl_sdl.cpp" /> <ClCompile Include="..\imgui_impl_sdl.cpp" />
<ClCompile Include="..\libs\gl3w\GL\gl3w.c" /> <ClCompile Include="..\libs\gl3w\GL\gl3w.c" />

View File

@ -34,6 +34,9 @@
<ClCompile Include="..\imgui_impl_sdl.cpp"> <ClCompile Include="..\imgui_impl_sdl.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\imconfig.h"> <ClInclude Include="..\..\imconfig.h">

View File

@ -153,6 +153,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_sdl.cpp" /> <ClCompile Include="..\imgui_impl_sdl.cpp" />
<ClCompile Include="..\imgui_impl_vulkan.cpp" /> <ClCompile Include="..\imgui_impl_vulkan.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />

View File

@ -28,6 +28,9 @@
<ClCompile Include="..\imgui_impl_vulkan.cpp"> <ClCompile Include="..\imgui_impl_vulkan.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\imconfig.h"> <ClInclude Include="..\..\imconfig.h">

View File

@ -150,6 +150,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_dx10.cpp" /> <ClCompile Include="..\imgui_impl_dx10.cpp" />
<ClCompile Include="..\imgui_impl_win32.cpp" /> <ClCompile Include="..\imgui_impl_win32.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />

View File

@ -44,6 +44,9 @@
<ClCompile Include="..\imgui_impl_win32.cpp"> <ClCompile Include="..\imgui_impl_win32.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\README.txt" /> <None Include="..\README.txt" />

View File

@ -150,6 +150,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_dx11.cpp" /> <ClCompile Include="..\imgui_impl_dx11.cpp" />
<ClCompile Include="..\imgui_impl_win32.cpp" /> <ClCompile Include="..\imgui_impl_win32.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />

View File

@ -44,6 +44,9 @@
<ClCompile Include="..\imgui_impl_dx11.cpp"> <ClCompile Include="..\imgui_impl_dx11.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\README.txt" /> <None Include="..\README.txt" />

View File

@ -153,6 +153,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_dx12.cpp" /> <ClCompile Include="..\imgui_impl_dx12.cpp" />
<ClCompile Include="..\imgui_impl_win32.cpp" /> <ClCompile Include="..\imgui_impl_win32.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />

View File

@ -44,6 +44,9 @@
<ClCompile Include="..\imgui_impl_win32.cpp"> <ClCompile Include="..\imgui_impl_win32.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\README.txt" /> <None Include="..\README.txt" />

View File

@ -143,6 +143,7 @@
<ClCompile Include="..\..\imgui.cpp" /> <ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" /> <ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" /> <ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\imgui_impl_dx9.cpp" /> <ClCompile Include="..\imgui_impl_dx9.cpp" />
<ClCompile Include="..\imgui_impl_win32.cpp" /> <ClCompile Include="..\imgui_impl_win32.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />

View File

@ -28,6 +28,9 @@
<ClCompile Include="..\imgui_impl_dx9.cpp"> <ClCompile Include="..\imgui_impl_dx9.cpp">
<Filter>sources</Filter> <Filter>sources</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\imgui_widgets.cpp">
<Filter>imgui</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\imconfig.h"> <ClInclude Include="..\..\imconfig.h">

25
imgui_widgets.cpp Normal file
View File

@ -0,0 +1,25 @@
// dear imgui, v1.64 WIP
// (widgets code)
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "imgui.h"
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
#include "imgui_internal.h"
//-------------------------------------------------------------------------
// Forward Declarations
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Shared Utilities
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Widgets
//-------------------------------------------------------------------------