- Fix the "grey panel" bug when doing File --> New.
- Add the possibility, when doing File --> New, to save the drawing the user did before actually reset it, and take into account whether he/she cancels the operation in the middle.
Patch by Marco Vaiano, slightly modified by me.

CORE-5642 #resolve #comment Committed in revision r58408. Thanks :)

svn path=/trunk/; revision=58408
This commit is contained in:
Hermès Bélusca-Maïto
2013-03-02 20:44:09 +00:00
parent 41065e4d3c
commit 436f3df046
+31 -5
View File
@@ -710,12 +710,38 @@ WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
SendMessage(hwnd, WM_CLOSE, wParam, lParam);
break;
case IDM_FILENEW:
ShowWindow(hSelection, SW_HIDE);
clearHistory();
Rectangle(hDrawingDC, 0 - 1, 0 - 1, imgXRes + 1, imgYRes + 1);
SendMessage(hImageArea, WM_PAINT, 0, 0);
{
BOOL reset = TRUE;
if (!imageSaved)
{
TCHAR programname[20];
TCHAR saveprompttext[100];
TCHAR temptext[500];
LoadString(hProgInstance, IDS_PROGRAMNAME, programname, SIZEOF(programname));
LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, saveprompttext, SIZEOF(saveprompttext));
_stprintf(temptext, saveprompttext, filename);
switch (MessageBox(hwnd, temptext, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
{
case IDNO:
imageSaved = TRUE;
break;
case IDYES:
SendMessage(hwnd, WM_COMMAND, IDM_FILESAVEAS, 0);
break;
case IDCANCEL:
reset = FALSE;
break;
}
}
if (reset && imageSaved)
{
Rectangle(hDrawingDC, 0 - 1, 0 - 1, imgXRes + 1, imgYRes + 1);
SendMessage(hImageArea, WM_PAINT, 0, 0);
updateCanvasAndScrollbars();
clearHistory();
}
break;
}
case IDM_FILEOPEN:
if (GetOpenFileName(&ofn) != 0)
{