MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Window_OpenFileDialog

Function Window_OpenFileDialog

src/Window_SDL2.c:354–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354cc_result Window_OpenFileDialog(const struct OpenFileDialogArgs* args) {
355#if defined CC_BUILD_OS2
356 FILEDLG fileDialog;
357 HWND hDialog;
358
359 memset(&fileDialog, 0, sizeof(FILEDLG));
360 fileDialog.cbSize = sizeof(FILEDLG);
361 fileDialog.fl = FDS_HELPBUTTON | FDS_CENTER | FDS_PRELOAD_VOLINFO | FDS_OPEN_DIALOG;
362 fileDialog.pszTitle = args->description;
363 fileDialog.pszOKButton = NULL;
364 fileDialog.pfnDlgProc = WinDefFileDlgProc;
365
366 Mem_Copy(fileDialog.szFullFile, *args->filters, CCHMAXPATH);
367 hDialog = WinFileDlg(HWND_DESKTOP, 0, &fileDialog);
368 if (fileDialog.lReturn == DID_OK) {
369 cc_string temp = String_FromRaw(fileDialog.szFullFile, CCHMAXPATH);
370 args->Callback(&temp);
371 }
372
373 return 0;
374#else
375 return ERR_NOT_SUPPORTED;
376#endif
377}
378
379cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) {
380#if defined CC_BUILD_OS2

Callers

nothing calls this directly

Calls 2

Mem_CopyFunction · 0.85
String_FromRawFunction · 0.85

Tested by

no test coverage detected