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

Method DoModal

Descent3/newui.cpp:1302–1340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1300}
1301
1302bool NewUIFileDialog::DoModal() {
1303 bool exit_menu = false, return_value = false;
1304
1305 this->Open();
1306
1307 // update file list in listbox.
1308 UpdateList();
1309
1310 while (!exit_menu) {
1311 const char *filename;
1312 int index;
1313 int result;
1314
1315 result = DoUI();
1316
1317 switch (result) {
1318 case NEWUIRES_FORCEQUIT:
1319 case UID_CANCEL:
1320 exit_menu = true;
1321 return_value = false;
1322 break;
1323
1324 case UID_OK:
1325 case UID_FILELIST:
1326 index = m_ListBox.GetSelectedIndex();
1327 filename = ((UITextItem *)m_ListBox.GetItem(index))->GetBuffer();
1328 ASSERT(strlen(filename) < (_MAX_PATH));
1329 strcpy(m_NewPath, filename);
1330 return_value = true;
1331 exit_menu = true;
1332 break;
1333 }
1334 }
1335
1336 this->Close();
1337 this->Destroy();
1338
1339 return return_value;
1340}
1341
1342void NewUIFileDialog::OnDestroy() {
1343 // remove items from listbox, free them.

Callers 15

OnYesMethod · 0.45
InitInstanceMethod · 0.45
OnVideocardDetectMethod · 0.45
OnInitDialogMethod · 0.45
OnBtnSetupMethod · 0.45
OnBtnPlayMethod · 0.45
OnBtnUpdateMethod · 0.45
OnBtnDirectxMethod · 0.45
RunOpenGLSetupMethod · 0.45
OnAppAboutMethod · 0.45
OnActionInsertMethod · 0.45
OnFileOpenMethod · 0.45

Calls 7

DoUIFunction · 0.85
GetBufferMethod · 0.80
OpenMethod · 0.45
GetSelectedIndexMethod · 0.45
GetItemMethod · 0.45
CloseMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected