MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / DoPromptFileName

Method DoPromptFileName

Source/FamiTracker.cpp:865–886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863//
864
865BOOL CDocManager0CC::DoPromptFileName(CStringW &fileName, UINT nIDSTitle, DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate *pTemplate)
866{
867 // Copied from MFC
868 // // // disregard doc template
869 CStringW path = theApp.GetSettings()->GetPath(PATH_FTM).c_str();
870
871 CFileDialog OpenFileDlg(bOpenFileDialog, L"0cc", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LoadDefaultFilter(IDS_FILTER_0CC, L"*.0cc; *.ftm")); // // //
872 OpenFileDlg.m_ofn.Flags |= lFlags;
873 OpenFileDlg.m_ofn.lpstrFile = fileName.GetBuffer(_MAX_PATH);
874 OpenFileDlg.m_ofn.lpstrInitialDir = path.GetBuffer(_MAX_PATH);
875 CStringW title(MAKEINTRESOURCEW(nIDSTitle));
876 OpenFileDlg.m_ofn.lpstrTitle = title;
877 INT_PTR nResult = OpenFileDlg.DoModal();
878 fileName.ReleaseBuffer();
879 path.ReleaseBuffer();
880
881 if (nResult == IDOK) {
882 theApp.GetSettings()->SetPath(fs::path {(LPCWSTR)fileName}.parent_path(), PATH_FTM);
883 return true;
884 }
885 return false;
886}

Callers 2

OnFileSaveAsMethod · 0.80
OnFileOpenMethod · 0.80

Calls 4

LoadDefaultFilterFunction · 0.85
GetPathMethod · 0.80
SetPathMethod · 0.80
GetSettingsMethod · 0.45

Tested by

no test coverage detected