Show the open filename in the title bar of the graphics window.
[git-p4: depot-paths = "//depot/solvespace/": change = 1826]solver
parent
9136d86bff
commit
4c42f329cd
|
@ -150,6 +150,8 @@ void SolveSpace::AfterNewFile(void) {
|
||||||
later.showTW = true;
|
later.showTW = true;
|
||||||
// Then zoom to fit again, to fit the triangles
|
// Then zoom to fit again, to fit the triangles
|
||||||
GW.ZoomToFit();
|
GW.ZoomToFit();
|
||||||
|
|
||||||
|
UpdateWindowTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SolveSpace::RemoveFromRecentList(char *file) {
|
void SolveSpace::RemoveFromRecentList(char *file) {
|
||||||
|
@ -209,6 +211,16 @@ bool SolveSpace::OkayToStartNewFile(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SolveSpace::UpdateWindowTitle(void) {
|
||||||
|
if(strlen(saveFile) == 0) {
|
||||||
|
SetWindowTitle("SolveSpace - (not yet saved)");
|
||||||
|
} else {
|
||||||
|
char buf[MAX_PATH+100];
|
||||||
|
sprintf(buf, "SolveSpace - %s", saveFile);
|
||||||
|
SetWindowTitle(buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SolveSpace::MenuFile(int id) {
|
void SolveSpace::MenuFile(int id) {
|
||||||
if(id >= RECENT_OPEN && id < (RECENT_OPEN+MAX_RECENT)) {
|
if(id >= RECENT_OPEN && id < (RECENT_OPEN+MAX_RECENT)) {
|
||||||
char newFile[MAX_PATH];
|
char newFile[MAX_PATH];
|
||||||
|
@ -287,4 +299,6 @@ void SolveSpace::MenuFile(int id) {
|
||||||
|
|
||||||
default: oops();
|
default: oops();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SS.UpdateWindowTitle();
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,8 +89,10 @@ void dbp(char *str, ...);
|
||||||
dbp("tri: (%.3f %.3f %.3f) (%.3f %.3f %.3f) (%.3f %.3f %.3f)", \
|
dbp("tri: (%.3f %.3f %.3f) (%.3f %.3f %.3f) (%.3f %.3f %.3f)", \
|
||||||
CO((tri).a), CO((tri).b), CO((tri).c))
|
CO((tri).a), CO((tri).b), CO((tri).c))
|
||||||
|
|
||||||
|
void SetWindowTitle(char *str);
|
||||||
void Error(char *str, ...);
|
void Error(char *str, ...);
|
||||||
void ExitNow(void);
|
void ExitNow(void);
|
||||||
|
|
||||||
void CnfFreezeString(char *str, char *name);
|
void CnfFreezeString(char *str, char *name);
|
||||||
void CnfFreezeDWORD(DWORD v, char *name);
|
void CnfFreezeDWORD(DWORD v, char *name);
|
||||||
void CnfFreezeFloat(float v, char *name);
|
void CnfFreezeFloat(float v, char *name);
|
||||||
|
@ -398,6 +400,7 @@ public:
|
||||||
bool GetFilenameAndSave(bool saveAs);
|
bool GetFilenameAndSave(bool saveAs);
|
||||||
bool OkayToStartNewFile(void);
|
bool OkayToStartNewFile(void);
|
||||||
hGroup CreateDefaultDrawingGroup(void);
|
hGroup CreateDefaultDrawingGroup(void);
|
||||||
|
void UpdateWindowTitle(void);
|
||||||
void NewFile(void);
|
void NewFile(void);
|
||||||
bool SaveToFile(char *filename);
|
bool SaveToFile(char *filename);
|
||||||
bool LoadFromFile(char *filename);
|
bool LoadFromFile(char *filename);
|
||||||
|
|
|
@ -102,6 +102,10 @@ float CnfThawFloat(float v, char *name) {
|
||||||
return *((float *)&d);
|
return *((float *)&d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetWindowTitle(char *str) {
|
||||||
|
SetWindowText(GraphicsWnd, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// A separate heap, on which we allocate expressions. Maybe a bit faster,
|
// A separate heap, on which we allocate expressions. Maybe a bit faster,
|
||||||
|
|
Loading…
Reference in New Issue