ionGUI.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionMath.h>
5 #include "imGUI.h"
6 #include "CGUIManager.h"
7 #include "CWindowWidget.h"
8 
9 
10 namespace ImGui
11 {
12  bool SliderDouble(const char* label, double* v, double v_min, double v_max, const char* display_format = "%.3f", double power = 1.0);
13 
14  bool ColorEdit3(const char* label, ion::color3f & Color);
15  bool ColorEdit3(const char* label, ion::color3i & Color);
16  bool ColorEdit4(const char* label, ion::color4f & Color);
17  bool ColorEdit4(const char* label, ion::color4i & Color);
18 
19  bool ColorPicker3(const char* label, ion::color3f & Color);
20  bool ColorPicker3(const char* label, ion::color3i & Color);
21  bool ColorPicker4(const char* label, ion::color4f & Color);
22  bool ColorPicker4(const char* label, ion::color4i & Color);
23 
24  bool DragVec2(const char * label, ion::vec2i & v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f");
25  bool DragVec2(const char * label, ion::vec2f & v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f);
26  bool DragVec3(const char * label, ion::vec3i & v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f");
27  bool DragVec3(const char * label, ion::vec3f & v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f);
28 
29  bool SliderVec2(const char* label, ion::vec2i & v, int v_min, int v_max, const char* display_format = "%.3f");
30  bool SliderVec2(const char* label, ion::vec2f & v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
31  bool SliderVec3(const char* label, ion::vec3i & v, int v_min, int v_max, const char* display_format = "%.3f");
32  bool SliderVec3(const char* label, ion::vec3f & v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
33 
34  bool Combo(const char* label, int* current_item, std::initializer_list<char const *> const & items, int height_in_items = -1);
35  bool Combo(const char* label, int* current_item, std::vector<ion::string> const & items, int height_in_items = -1);
36 
37  bool InputText(const char* label, ion::string & buf, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = nullptr, void* user_data = nullptr);
38 
39 
40  template <typename... Args>
41  static void PushIDString(char const * const Format, Args const &... args)
42  {
43  ion::string Buffer;
44  Buffer = ion::String::Build(Format, args...);
45  ImGui::PushID(Buffer.c_str(), Buffer.c_str() + Buffer.length());
46  }
47 
48  class scoped_id
49  {
50 
51  private:
52 
53  scoped_id(scoped_id const &) = delete;
54  scoped_id(scoped_id const &&) = delete;
55  scoped_id & operator =(scoped_id const &) = delete;
56  scoped_id & operator =(scoped_id const &&) = delete;
57 
58  public:
59 
60  scoped_id(char const * const str_id);
61  scoped_id(int const int_id);
62  ~scoped_id();
63  };
64 }
65 
66 namespace ion
67 {
68 
69  char const * BoolToString(bool const B);
70 
71 }
~scoped_id()
Definition: ionGUI.cpp:249
bool SliderVec2(const char *label, ion::vec2i &v, int v_min, int v_max, const char *display_format)
Definition: ionGUI.cpp:157
bool ColorEdit4(const char *label, color4f &Color)
Definition: ionGUI.cpp:46
char const * BoolToString(bool const B)
Definition: ionGUI.cpp:255
bool ColorPicker4(const char *label, ion::color4f &Color)
Definition: ionGUI.cpp:90
Definition: ionGUI.h:48
bool InputText(const char *label, string &buf, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void *user_data)
Definition: ionGUI.cpp:218
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
bool SliderDouble(const char *label, double *v, double v_min, double v_max, const char *display_format, double power)
Definition: ionGUI.cpp:10
bool DragVec2(const char *label, ion::vec2i &v, float v_speed, int v_min, int v_max, const char *display_format)
Definition: ionGUI.cpp:113
static string Build(char const *const Format, Args const &...args)
Definition: String.h:27
bool ColorPicker3(const char *label, ion::color3f &Color)
Definition: ionGUI.cpp:68
Definition: ionGUI.cpp:7
bool SliderVec3(const char *label, ion::vec3i &v, int v_min, int v_max, const char *display_format)
Definition: ionGUI.cpp:179
bool DragVec3(const char *label, ion::vec3i &v, float v_speed, int v_min, int v_max, const char *display_format)
Definition: ionGUI.cpp:135
bool ColorEdit3(const char *label, color3f &Color)
Definition: ionGUI.cpp:24
bool Combo(const char *label, int *current_item, std::initializer_list< char const * > const &items, int height_in_items)
Definition: ionGUI.cpp:201