MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / Draw

Method Draw

external/imgui/imgui_demo.cpp:10911–11193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10909 }
10910
10911 void Draw(const char* title, bool* p_open)
10912 {
10913 if (IconSize <= 0.0f)
10914 IconSize = ImGui::CalcTextSize("99999").x;
10915
10916 ImGui::SetNextWindowSize(ImVec2(IconSize * 25, IconSize * 15), ImGuiCond_FirstUseEver);
10917 if (!ImGui::Begin(title, p_open, ImGuiWindowFlags_MenuBar))
10918 {
10919 ImGui::End();
10920 return;
10921 }
10922 IMGUI_DEMO_MARKER("Examples/Assets Browser");
10923
10924 // Menu bar
10925 if (ImGui::BeginMenuBar())
10926 {
10927 if (ImGui::BeginMenu("File"))
10928 {
10929 if (ImGui::MenuItem("Add 10000 items"))
10930 AddItems(10000);
10931 if (ImGui::MenuItem("Clear items"))
10932 ClearItems();
10933 ImGui::Separator();
10934 if (ImGui::MenuItem("Close", NULL, false, p_open != NULL))
10935 *p_open = false;
10936 ImGui::EndMenu();
10937 }
10938 if (ImGui::BeginMenu("Edit"))
10939 {
10940 if (ImGui::MenuItem("Delete", "Del", false, Selection.Size > 0))
10941 RequestDelete = true;
10942 ImGui::EndMenu();
10943 }
10944 if (ImGui::BeginMenu("Options"))
10945 {
10946 ImGui::PushItemWidth(ImGui::GetFontSize() * 10);
10947
10948 ImGui::SeparatorText("Contents");
10949 ImGui::Checkbox("Show Type Overlay", &ShowTypeOverlay);
10950 ImGui::Checkbox("Allow Sorting", &AllowSorting);
10951
10952 ImGui::SeparatorText("Selection Behavior");
10953 ImGui::Checkbox("Allow box-selection", &AllowBoxSelect);
10954 if (ImGui::Checkbox("Allow box-selection from selected items", &AllowBoxSelectInsideSelection) && AllowBoxSelectInsideSelection)
10955 AllowDragUnselected = false;
10956 if (ImGui::Checkbox("Allow dragging unselected item", &AllowDragUnselected) && AllowDragUnselected)
10957 AllowBoxSelectInsideSelection = false;
10958
10959 ImGui::SeparatorText("Layout");
10960 ImGui::SliderFloat("Icon Size", &IconSize, 16.0f, 128.0f, "%.0f");
10961 ImGui::SameLine(); HelpMarker("Use Ctrl+Wheel to zoom");
10962 ImGui::SliderInt("Icon Spacing", &IconSpacing, 0, 32);
10963 ImGui::SliderInt("Icon Hit Spacing", &IconHitSpacing, 0, 32);
10964 ImGui::Checkbox("Stretch Spacing", &StretchSpacing);
10965 ImGui::Checkbox("Use ScrollX", &UseScrollX);
10966 ImGui::PopItemWidth();
10967 ImGui::EndMenu();
10968 }

Callers 8

ShowStyleEditorMethod · 0.45
DrawFunction · 0.45
ShowExampleAppConsoleFunction · 0.45
ShowExampleAppLogFunction · 0.45

Calls 14

ImVec2Function · 0.85
HelpMarkerFunction · 0.85
ApplyRequestsMethod · 0.80
ApplyDeletionPreLoopMethod · 0.80
BeginMethod · 0.80
IncludeItemByIndexMethod · 0.80
GetNextSelectedItemMethod · 0.80
AddRectFilledMethod · 0.80
AddTextMethod · 0.80
EndMethod · 0.80
ApplyDeletionPostLoopMethod · 0.80
StepMethod · 0.45

Tested by

no test coverage detected