mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
[PAINT]
- 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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user