MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / UpdateList

Method UpdateList

Descent3/newui.cpp:1275–1300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1273const char *NewUIFileDialog::GetFilename() { return m_NewPath; }
1274
1275void NewUIFileDialog::UpdateList() {
1276 char search_str[_MAX_PATH];
1277 char filename[_MAX_PATH];
1278
1279 // remove items from listbox, free them.
1280 while (m_ListBox.GetNumItems()) {
1281 UIItem *item = m_ListBox.GetItem(0);
1282 m_ListBox.RemoveItem(item);
1283 delete item;
1284 }
1285
1286 // read in all files that have all search parameters met
1287 ddio_MakePath(search_str, m_SearchPath, m_SearchExt, NULL);
1288
1289 if (ddio_FindFileStart(search_str, filename)) {
1290 UIItem *item = new UITextItem(filename);
1291 m_ListBox.AddItem(item);
1292
1293 while (ddio_FindNextFile(filename)) {
1294 item = new UITextItem(filename);
1295 m_ListBox.AddItem(item);
1296 }
1297
1298 ddio_FindFileClose();
1299 }
1300}
1301
1302bool NewUIFileDialog::DoModal() {
1303 bool exit_menu = false, return_value = false;

Callers

nothing calls this directly

Calls 8

ddio_MakePathFunction · 0.50
ddio_FindFileStartFunction · 0.50
ddio_FindNextFileFunction · 0.50
ddio_FindFileCloseFunction · 0.50
GetNumItemsMethod · 0.45
GetItemMethod · 0.45
RemoveItemMethod · 0.45
AddItemMethod · 0.45

Tested by

no test coverage detected