mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 05:01:05 +01:00 
			
		
		
		
	imgui.h: Moved columns lower in the file. Various spacing changes and minor comments.
This commit is contained in:
		
							
								
								
									
										29
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								imgui.h
									
									
									
									
									
								
							| @@ -223,7 +223,7 @@ namespace ImGui | |||||||
|     IMGUI_API void          PushStyleVar(ImGuiStyleVar idx, float val); |     IMGUI_API void          PushStyleVar(ImGuiStyleVar idx, float val); | ||||||
|     IMGUI_API void          PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); |     IMGUI_API void          PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); | ||||||
|     IMGUI_API void          PopStyleVar(int count = 1); |     IMGUI_API void          PopStyleVar(int count = 1); | ||||||
|     IMGUI_API const ImVec4& GetStyleColorVec4(ImGuiCol idx);                                    // retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwhise use GetColorU32() to get style color + style alpha. |     IMGUI_API const ImVec4& GetStyleColorVec4(ImGuiCol idx);                                // retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwhise use GetColorU32() to get style color with style alpha baked in. | ||||||
|     IMGUI_API ImFont*       GetFont();                                                      // get current font |     IMGUI_API ImFont*       GetFont();                                                      // get current font | ||||||
|     IMGUI_API float         GetFontSize();                                                  // get current font size (= height in pixels) of current font with current scale applied |     IMGUI_API float         GetFontSize();                                                  // get current font size (= height in pixels) of current font with current scale applied | ||||||
|     IMGUI_API ImVec2        GetFontTexUvWhitePixel();                                       // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API |     IMGUI_API ImVec2        GetFontTexUvWhitePixel();                                       // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API | ||||||
| @@ -260,24 +260,13 @@ namespace ImGui | |||||||
|     IMGUI_API void          SetCursorPosY(float y);                                         // " |     IMGUI_API void          SetCursorPosY(float y);                                         // " | ||||||
|     IMGUI_API ImVec2        GetCursorStartPos();                                            // initial cursor position |     IMGUI_API ImVec2        GetCursorStartPos();                                            // initial cursor position | ||||||
|     IMGUI_API ImVec2        GetCursorScreenPos();                                           // cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API) |     IMGUI_API ImVec2        GetCursorScreenPos();                                           // cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API) | ||||||
|     IMGUI_API void          SetCursorScreenPos(const ImVec2& pos);                              // cursor position in absolute screen coordinates [0..io.DisplaySize] |     IMGUI_API void          SetCursorScreenPos(const ImVec2& screen_pos);                   // cursor position in absolute screen coordinates [0..io.DisplaySize] | ||||||
|     IMGUI_API void          AlignTextToFramePadding();                                          // vertically align/lower upcoming text to FramePadding.y so that it will aligns to upcoming widgets (call if you have text on a line before regular widgets) |     IMGUI_API void          AlignTextToFramePadding();                                      // vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item) | ||||||
|     IMGUI_API float         GetTextLineHeight();                                            // ~ FontSize |     IMGUI_API float         GetTextLineHeight();                                            // ~ FontSize | ||||||
|     IMGUI_API float         GetTextLineHeightWithSpacing();                                 // ~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text) |     IMGUI_API float         GetTextLineHeightWithSpacing();                                 // ~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text) | ||||||
|     IMGUI_API float         GetFrameHeight();                                               // ~ FontSize + style.FramePadding.y * 2 |     IMGUI_API float         GetFrameHeight();                                               // ~ FontSize + style.FramePadding.y * 2 | ||||||
|     IMGUI_API float         GetFrameHeightWithSpacing();                                    // ~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets) |     IMGUI_API float         GetFrameHeightWithSpacing();                                    // ~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets) | ||||||
|  |  | ||||||
|     // Columns |  | ||||||
|     // You can also use SameLine(pos_x) for simplified columns. The columns API is still work-in-progress and rather lacking. |  | ||||||
|     IMGUI_API void          Columns(int count = 1, const char* id = NULL, bool border = true); |  | ||||||
|     IMGUI_API void          NextColumn();                                                       // next column, defaults to current row or next row if the current row is finished |  | ||||||
|     IMGUI_API int           GetColumnIndex();                                                   // get current column index |  | ||||||
|     IMGUI_API float         GetColumnWidth(int column_index = -1);                              // get column width (in pixels). pass -1 to use current column |  | ||||||
|     IMGUI_API void          SetColumnWidth(int column_index, float width);                      // set column width (in pixels). pass -1 to use current column |  | ||||||
|     IMGUI_API float         GetColumnOffset(int column_index = -1);                             // get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0f |  | ||||||
|     IMGUI_API void          SetColumnOffset(int column_index, float offset_x);                  // set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column |  | ||||||
|     IMGUI_API int           GetColumnsCount(); |  | ||||||
|  |  | ||||||
|     // ID scopes |     // ID scopes | ||||||
|     // If you are creating widgets in a loop you most likely want to push a unique identifier (e.g. object pointer, loop index) so ImGui can differentiate them. |     // If you are creating widgets in a loop you most likely want to push a unique identifier (e.g. object pointer, loop index) so ImGui can differentiate them. | ||||||
|     // You can also use the "##foobar" syntax within widget label to distinguish them from each others. Read "A primer on the use of labels/IDs" in the FAQ for more details. |     // You can also use the "##foobar" syntax within widget label to distinguish them from each others. Read "A primer on the use of labels/IDs" in the FAQ for more details. | ||||||
| @@ -304,7 +293,6 @@ namespace ImGui | |||||||
|     IMGUI_API void          LabelTextV(const char* label, const char* fmt, va_list args)    IM_FMTLIST(2); |     IMGUI_API void          LabelTextV(const char* label, const char* fmt, va_list args)    IM_FMTLIST(2); | ||||||
|     IMGUI_API void          BulletText(const char* fmt, ...)                                IM_FMTARGS(1); // shortcut for Bullet()+Text() |     IMGUI_API void          BulletText(const char* fmt, ...)                                IM_FMTARGS(1); // shortcut for Bullet()+Text() | ||||||
|     IMGUI_API void          BulletTextV(const char* fmt, va_list args)                      IM_FMTLIST(1); |     IMGUI_API void          BulletTextV(const char* fmt, va_list args)                      IM_FMTLIST(1); | ||||||
|     IMGUI_API void          Bullet();                                                                     // draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses |  | ||||||
|  |  | ||||||
|     // Widgets: Main |     // Widgets: Main | ||||||
|     IMGUI_API bool          Button(const char* label, const ImVec2& size = ImVec2(0,0));            // button |     IMGUI_API bool          Button(const char* label, const ImVec2& size = ImVec2(0,0));            // button | ||||||
| @@ -443,6 +431,17 @@ namespace ImGui | |||||||
|     IMGUI_API bool          IsPopupOpen(const char* str_id);                                    // return true if the popup is open |     IMGUI_API bool          IsPopupOpen(const char* str_id);                                    // return true if the popup is open | ||||||
|     IMGUI_API void          CloseCurrentPopup();                                                // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup. |     IMGUI_API void          CloseCurrentPopup();                                                // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup. | ||||||
|  |  | ||||||
|  |     // Columns | ||||||
|  |     // You can also use SameLine(pos_x) for simplified columns. The columns API is still work-in-progress and rather lacking. | ||||||
|  |     IMGUI_API void          Columns(int count = 1, const char* id = NULL, bool border = true); | ||||||
|  |     IMGUI_API void          NextColumn();                                                       // next column, defaults to current row or next row if the current row is finished | ||||||
|  |     IMGUI_API int           GetColumnIndex();                                                   // get current column index | ||||||
|  |     IMGUI_API float         GetColumnWidth(int column_index = -1);                              // get column width (in pixels). pass -1 to use current column | ||||||
|  |     IMGUI_API void          SetColumnWidth(int column_index, float width);                      // set column width (in pixels). pass -1 to use current column | ||||||
|  |     IMGUI_API float         GetColumnOffset(int column_index = -1);                             // get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0f | ||||||
|  |     IMGUI_API void          SetColumnOffset(int column_index, float offset_x);                  // set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column | ||||||
|  |     IMGUI_API int           GetColumnsCount(); | ||||||
|  |  | ||||||
|     // Logging/Capture: all text output from interface is captured to tty/file/clipboard. By default, tree nodes are automatically opened during logging. |     // Logging/Capture: all text output from interface is captured to tty/file/clipboard. By default, tree nodes are automatically opened during logging. | ||||||
|     IMGUI_API void          LogToTTY(int max_depth = -1);                                       // start logging to tty |     IMGUI_API void          LogToTTY(int max_depth = -1);                                       // start logging to tty | ||||||
|     IMGUI_API void          LogToFile(int max_depth = -1, const char* filename = NULL);         // start logging to file |     IMGUI_API void          LogToFile(int max_depth = -1, const char* filename = NULL);         // start logging to file | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user