mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-30 13:55:24 +08:00
Demo: (Refactor) Moved DemoWindowWidgets() below the functions it calls, reducing amount of forward declarations.
This commit is contained in:
+51
-75
@@ -73,7 +73,6 @@ Index of this file:
|
|||||||
// [SECTION] Helpers: ExampleTreeNode, ExampleMemberInfo (for use by Property Editor & Multi-Select demos)
|
// [SECTION] Helpers: ExampleTreeNode, ExampleMemberInfo (for use by Property Editor & Multi-Select demos)
|
||||||
// [SECTION] Demo Window / ShowDemoWindow()
|
// [SECTION] Demo Window / ShowDemoWindow()
|
||||||
// [SECTION] DemoWindowMenuBar()
|
// [SECTION] DemoWindowMenuBar()
|
||||||
// [SECTION] DemoWindowWidgets()
|
|
||||||
// [SECTION] DemoWindowWidgetsBasic()
|
// [SECTION] DemoWindowWidgetsBasic()
|
||||||
// [SECTION] DemoWindowWidgetsBullets()
|
// [SECTION] DemoWindowWidgetsBullets()
|
||||||
// [SECTION] DemoWindowWidgetsCollapsingHeaders()
|
// [SECTION] DemoWindowWidgetsCollapsingHeaders()
|
||||||
@@ -98,6 +97,7 @@ Index of this file:
|
|||||||
// [SECTION] DemoWindowWidgetsTooltips()
|
// [SECTION] DemoWindowWidgetsTooltips()
|
||||||
// [SECTION] DemoWindowWidgetsTreeNodes()
|
// [SECTION] DemoWindowWidgetsTreeNodes()
|
||||||
// [SECTION] DemoWindowWidgetsVerticalSliders()
|
// [SECTION] DemoWindowWidgetsVerticalSliders()
|
||||||
|
// [SECTION] DemoWindowWidgets()
|
||||||
// [SECTION] DemoWindowLayout()
|
// [SECTION] DemoWindowLayout()
|
||||||
// [SECTION] DemoWindowPopups()
|
// [SECTION] DemoWindowPopups()
|
||||||
// [SECTION] DemoWindowTables()
|
// [SECTION] DemoWindowTables()
|
||||||
@@ -250,30 +250,6 @@ static void ShowExampleMenuFile();
|
|||||||
// (because the link time of very large functions tends to grow non-linearly)
|
// (because the link time of very large functions tends to grow non-linearly)
|
||||||
static void DemoWindowMenuBar(ImGuiDemoWindowData* demo_data);
|
static void DemoWindowMenuBar(ImGuiDemoWindowData* demo_data);
|
||||||
static void DemoWindowWidgets(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 DemoWindowLayout();
|
||||||
static void DemoWindowPopups();
|
static void DemoWindowPopups();
|
||||||
static void DemoWindowTables();
|
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()
|
// [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()
|
// [SECTION] DemoWindowLayout()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user