mirror of
https://github.com/ocornut/imgui.git
synced 2025-04-05 13:35:09 +00:00
Demo: (Refactor) Moved DemoWindowWidgets() below the functions it calls, reducing amount of forward declarations.
This commit is contained in:
parent
a7657f2ed4
commit
324172fb1f
1 changed files with 51 additions and 75 deletions
126
imgui_demo.cpp
126
imgui_demo.cpp
|
@ -73,7 +73,6 @@ Index of this file:
|
|||
// [SECTION] Helpers: ExampleTreeNode, ExampleMemberInfo (for use by Property Editor & Multi-Select demos)
|
||||
// [SECTION] Demo Window / ShowDemoWindow()
|
||||
// [SECTION] DemoWindowMenuBar()
|
||||
// [SECTION] DemoWindowWidgets()
|
||||
// [SECTION] DemoWindowWidgetsBasic()
|
||||
// [SECTION] DemoWindowWidgetsBullets()
|
||||
// [SECTION] DemoWindowWidgetsCollapsingHeaders()
|
||||
|
@ -98,6 +97,7 @@ Index of this file:
|
|||
// [SECTION] DemoWindowWidgetsTooltips()
|
||||
// [SECTION] DemoWindowWidgetsTreeNodes()
|
||||
// [SECTION] DemoWindowWidgetsVerticalSliders()
|
||||
// [SECTION] DemoWindowWidgets()
|
||||
// [SECTION] DemoWindowLayout()
|
||||
// [SECTION] DemoWindowPopups()
|
||||
// [SECTION] DemoWindowTables()
|
||||
|
@ -250,30 +250,6 @@ static void ShowExampleMenuFile();
|
|||
// (because the link time of very large functions tends to grow non-linearly)
|
||||
static void DemoWindowMenuBar(ImGuiDemoWindowData* demo_data);
|
||||
static void DemoWindowWidgets(ImGuiDemoWindowData* demo_data);
|
||||
static void DemoWindowWidgetsBasic();
|
||||
static void DemoWindowWidgetsBullets();
|
||||
static void DemoWindowWidgetsCollapsingHeaders();
|
||||
static void DemoWindowWidgetsComboBoxes();
|
||||
static void DemoWindowWidgetsColorAndPickers();
|
||||
static void DemoWindowWidgetsDataTypes();
|
||||
static void DemoWindowWidgetsDisableBlocks(ImGuiDemoWindowData* demo_data);
|
||||
static void DemoWindowWidgetsDragAndDrop();
|
||||
static void DemoWindowWidgetsDragsAndSliders();
|
||||
static void DemoWindowWidgetsImages();
|
||||
static void DemoWindowWidgetsListBoxes();
|
||||
static void DemoWindowWidgetsPlotting();
|
||||
static void DemoWindowWidgetsMultiComponents();
|
||||
static void DemoWindowWidgetsProgressBars();
|
||||
static void DemoWindowWidgetsQueryingStatuses();
|
||||
static void DemoWindowWidgetsSelectables();
|
||||
static void DemoWindowWidgetsSelectionAndMultiSelect(ImGuiDemoWindowData* demo_data);
|
||||
static void DemoWindowWidgetsTabs();
|
||||
static void DemoWindowWidgetsText();
|
||||
static void DemoWindowWidgetsTextFilter();
|
||||
static void DemoWindowWidgetsTextInput();
|
||||
static void DemoWindowWidgetsTooltips();
|
||||
static void DemoWindowWidgetsTreeNodes();
|
||||
static void DemoWindowWidgetsVerticalSliders();
|
||||
static void DemoWindowLayout();
|
||||
static void DemoWindowPopups();
|
||||
static void DemoWindowTables();
|
||||
|
@ -816,56 +792,6 @@ static void DemoWindowMenuBar(ImGuiDemoWindowData* demo_data)
|
|||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] DemoWindowWidgets()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static void DemoWindowWidgets(ImGuiDemoWindowData* demo_data)
|
||||
{
|
||||
IMGUI_DEMO_MARKER("Widgets");
|
||||
//ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||
if (!ImGui::CollapsingHeader("Widgets"))
|
||||
return;
|
||||
|
||||
const bool disable_all = demo_data->DisableSections; // The Checkbox for that is inside the "Disabled" section at the bottom
|
||||
if (disable_all)
|
||||
ImGui::BeginDisabled();
|
||||
|
||||
DemoWindowWidgetsBasic();
|
||||
DemoWindowWidgetsBullets();
|
||||
DemoWindowWidgetsCollapsingHeaders();
|
||||
DemoWindowWidgetsComboBoxes();
|
||||
DemoWindowWidgetsColorAndPickers();
|
||||
DemoWindowWidgetsDataTypes();
|
||||
|
||||
if (disable_all)
|
||||
ImGui::EndDisabled();
|
||||
DemoWindowWidgetsDisableBlocks(demo_data);
|
||||
if (disable_all)
|
||||
ImGui::BeginDisabled();
|
||||
|
||||
DemoWindowWidgetsDragAndDrop();
|
||||
DemoWindowWidgetsDragsAndSliders();
|
||||
DemoWindowWidgetsImages();
|
||||
DemoWindowWidgetsListBoxes();
|
||||
DemoWindowWidgetsMultiComponents();
|
||||
DemoWindowWidgetsPlotting();
|
||||
DemoWindowWidgetsProgressBars();
|
||||
DemoWindowWidgetsQueryingStatuses();
|
||||
DemoWindowWidgetsSelectables();
|
||||
DemoWindowWidgetsSelectionAndMultiSelect(demo_data);
|
||||
DemoWindowWidgetsTabs();
|
||||
DemoWindowWidgetsText();
|
||||
DemoWindowWidgetsTextFilter();
|
||||
DemoWindowWidgetsTextInput();
|
||||
DemoWindowWidgetsTooltips();
|
||||
DemoWindowWidgetsTreeNodes();
|
||||
DemoWindowWidgetsVerticalSliders();
|
||||
|
||||
if (disable_all)
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] DemoWindowWidgetsBasic()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -4183,6 +4109,56 @@ static void DemoWindowWidgetsVerticalSliders()
|
|||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] DemoWindowWidgets()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static void DemoWindowWidgets(ImGuiDemoWindowData* demo_data)
|
||||
{
|
||||
IMGUI_DEMO_MARKER("Widgets");
|
||||
//ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||
if (!ImGui::CollapsingHeader("Widgets"))
|
||||
return;
|
||||
|
||||
const bool disable_all = demo_data->DisableSections; // The Checkbox for that is inside the "Disabled" section at the bottom
|
||||
if (disable_all)
|
||||
ImGui::BeginDisabled();
|
||||
|
||||
DemoWindowWidgetsBasic();
|
||||
DemoWindowWidgetsBullets();
|
||||
DemoWindowWidgetsCollapsingHeaders();
|
||||
DemoWindowWidgetsComboBoxes();
|
||||
DemoWindowWidgetsColorAndPickers();
|
||||
DemoWindowWidgetsDataTypes();
|
||||
|
||||
if (disable_all)
|
||||
ImGui::EndDisabled();
|
||||
DemoWindowWidgetsDisableBlocks(demo_data);
|
||||
if (disable_all)
|
||||
ImGui::BeginDisabled();
|
||||
|
||||
DemoWindowWidgetsDragAndDrop();
|
||||
DemoWindowWidgetsDragsAndSliders();
|
||||
DemoWindowWidgetsImages();
|
||||
DemoWindowWidgetsListBoxes();
|
||||
DemoWindowWidgetsMultiComponents();
|
||||
DemoWindowWidgetsPlotting();
|
||||
DemoWindowWidgetsProgressBars();
|
||||
DemoWindowWidgetsQueryingStatuses();
|
||||
DemoWindowWidgetsSelectables();
|
||||
DemoWindowWidgetsSelectionAndMultiSelect(demo_data);
|
||||
DemoWindowWidgetsTabs();
|
||||
DemoWindowWidgetsText();
|
||||
DemoWindowWidgetsTextFilter();
|
||||
DemoWindowWidgetsTextInput();
|
||||
DemoWindowWidgetsTooltips();
|
||||
DemoWindowWidgetsTreeNodes();
|
||||
DemoWindowWidgetsVerticalSliders();
|
||||
|
||||
if (disable_all)
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] DemoWindowLayout()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Reference in a new issue