Use system-agnostic return values for SaveFileYesNoCancel()
This function was returning ID{YES,NO,CANCEL}, which are specific to Windows as return values for MessageBox(). These have been replaced with SAVE_{YES,NO,CANCEL}, which we define ourselves.
This commit is contained in:
parent
70b6bad551
commit
42a46e83fa
|
@ -343,16 +343,16 @@ bool SolveSpace::OkayToStartNewFile(void) {
|
||||||
if(!unsaved) return true;
|
if(!unsaved) return true;
|
||||||
|
|
||||||
switch(SaveFileYesNoCancel()) {
|
switch(SaveFileYesNoCancel()) {
|
||||||
case IDYES:
|
case SAVE_YES:
|
||||||
return GetFilenameAndSave(false);
|
return GetFilenameAndSave(false);
|
||||||
|
|
||||||
case IDNO:
|
case SAVE_NO:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case IDCANCEL:
|
case SAVE_CANCEL:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default: oops();
|
default: oops(); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,11 @@ class ExprQuaternion;
|
||||||
extern char RecentFile[MAX_RECENT][MAX_PATH];
|
extern char RecentFile[MAX_RECENT][MAX_PATH];
|
||||||
void RefreshRecentMenus(void);
|
void RefreshRecentMenus(void);
|
||||||
|
|
||||||
|
#define SAVE_YES (1)
|
||||||
|
#define SAVE_NO (-1)
|
||||||
|
#define SAVE_CANCEL (0)
|
||||||
int SaveFileYesNoCancel(void);
|
int SaveFileYesNoCancel(void);
|
||||||
|
|
||||||
// SolveSpace native file format
|
// SolveSpace native file format
|
||||||
#define SLVS_PATTERN "SolveSpace Models (*.slvs)\0*.slvs\0All Files (*)\0*\0\0"
|
#define SLVS_PATTERN "SolveSpace Models (*.slvs)\0*.slvs\0All Files (*)\0*\0\0"
|
||||||
#define SLVS_EXT "slvs"
|
#define SLVS_EXT "slvs"
|
||||||
|
|
|
@ -873,7 +873,14 @@ int SaveFileYesNoCancel(void)
|
||||||
EnableWindow(GraphicsWnd, TRUE);
|
EnableWindow(GraphicsWnd, TRUE);
|
||||||
SetForegroundWindow(GraphicsWnd);
|
SetForegroundWindow(GraphicsWnd);
|
||||||
|
|
||||||
return r;
|
switch(r) {
|
||||||
|
case IDYES: return SAVE_YES;
|
||||||
|
case IDNO: return SAVE_NO;
|
||||||
|
case IDCANCEL: return SAVE_CANCEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
oops();
|
||||||
|
return SAVE_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadAllFontFiles(void)
|
void LoadAllFontFiles(void)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user