MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / ModalDialog

Method ModalDialog

extensions/olcPGEX_QuickGUI.h:1088–1105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1086
1087#pragma region Modal
1088 ModalDialog::ModalDialog() : olc::PGEX(true)
1089 {
1090
1091 // Create File Open Dialog
1092 olc::vi2d vScreenSize = pge->GetScreenSize();
1093
1094 m_listDirectory = new ListBox(m_manFileSelect, m_vDirectory, olc::vf2d(20, 20), olc::vf2d(300, 500));
1095 m_listFiles = new ListBox(m_manFileSelect, m_vFiles, olc::vf2d(330, 20), olc::vf2d(300, 500));
1096
1097 m_path = "/";
1098 for (auto const& dir_entry : std::filesystem::directory_iterator{ m_path })
1099 {
1100 if(dir_entry.is_directory())
1101 m_vDirectory.push_back(dir_entry.path().filename().string());
1102 else
1103 m_vFiles.push_back(dir_entry.path().filename().string());
1104 }
1105 }
1106
1107 void ModalDialog::ShowFileOpen(const std::string& sPath)
1108 {

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected