Commit 68ce6023 authored by Alexander Nicolaysen Sørnes's avatar Alexander Nicolaysen Sørnes Committed by Alexandre Julliard

wordpad: Add file saving dialog.

parent 69c9565e
......@@ -25,6 +25,7 @@ BEGIN
MENUITEM "&Neu\tCtrl+N", ID_FILE_NEW
MENUITEM "&ffnen\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Speichern\tCtrl+S", ID_FILE_SAVE
MENUITEM "Speichern &unter...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Beenden", ID_FILE_EXIT
END
......
......@@ -25,6 +25,7 @@ BEGIN
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
MENUITEM "&Open\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE
MENUITEM "Save &as . . .", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_FILE_EXIT
END
......
......@@ -24,7 +24,8 @@ BEGIN
BEGIN
MENUITEM "&Nouveau\tCtrl+N", ID_FILE_NEW
MENUITEM "&Ouvrir\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Sauver\tCtrl+S", ID_FILE_SAVE
MENUITEM "&Enregistrer\tCtrl+S", ID_FILE_SAVE
MENUITEM "Enregistrer &sous...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Quitter", ID_FILE_EXIT
END
......
......@@ -25,6 +25,7 @@ BEGIN
MENUITEM "&j\tCtrl+N", ID_FILE_NEW
MENUITEM "&Megnyits\tCtrl+O", ID_FILE_OPEN
MENUITEM "M&ents\tCtrl+S", ID_FILE_SAVE
MENUITEM "Ments m&sknt...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Kilps", ID_FILE_EXIT
END
......
......@@ -26,6 +26,7 @@ BEGIN
MENUITEM "새 파일(&N)\tCtrl+N", ID_FILE_NEW
MENUITEM "열기(&O)\tCtrl+O", ID_FILE_OPEN
MENUITEM "저장(&S)\tCtrl+S", ID_FILE_SAVE
MENUITEM "다른 이름으로 저장(&A)...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "나가기(&X)", ID_FILE_EXIT
END
......
......@@ -25,6 +25,7 @@ BEGIN
MENUITEM "&Nieuw\tCtrl+N" ID_FILE_NEW
MENUITEM "&Openen\tCtrl+O", ID_FILE_OPEN
MENUITEM "O&pslaan\tCtrl+S", ID_FILE_SAVE
MENUITEM "Ops&laan als...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Afsluiten", ID_FILE_EXIT
END
......
......@@ -25,6 +25,7 @@ BEGIN
MENUITEM "&Ny\tCtrl+N", ID_FILE_NEW
MENUITEM "&pne\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Lagre\tCtrl+S", ID_FILE_SAVE
MENUITEM "Lagre &som . . .", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Avslutt", ID_FILE_EXIT
END
......
......@@ -26,6 +26,7 @@ BEGIN
MENUITEM "&Nowy\tCtrl+N", ID_FILE_NEW
MENUITEM "&Otwrz\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Zapisz\tCtrl+S", ID_FILE_SAVE
MENUITEM "Z&apisz jako...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "Za&kocz", ID_FILE_EXIT
END
......
......@@ -25,6 +25,7 @@ BEGIN
MENUITEM "&\tCtrl+N", ID_FILE_NEW
MENUITEM "&\tCtrl+O", ID_FILE_OPEN
MENUITEM "&\tCtrl+S", ID_FILE_SAVE
MENUITEM " &...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&", ID_FILE_EXIT
END
......
......@@ -27,6 +27,7 @@ BEGIN
MENUITEM "&Yeni\tCtrl+N", ID_FILE_NEW
MENUITEM "&A\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Kaydet\tCtrl+S", ID_FILE_SAVE
MENUITEM "&Farkl Kaydet...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&k", ID_FILE_EXIT
END
......
......@@ -20,11 +20,12 @@
#define ID_FILE_OPEN 1001
#define ID_FILE_SAVE 1002
#define ID_FILE_NEW 1003
#define ID_FILE_SAVEAS 1004
#define ID_PRINT 1004
#define ID_PREVIEW 1005
#define ID_PRINT 1005
#define ID_PREVIEW 1006
#define ID_FIND 1006
#define ID_FIND 1007
#define ID_ALIGN_LEFT 1100
#define ID_ALIGN_CENTER 1101
......
......@@ -223,6 +223,29 @@ static void DoSaveFile(LPCWSTR wszSaveFileName)
set_caption(wszFileName);
}
static void DialogSaveFile(void)
{
OPENFILENAMEW sfn;
WCHAR wszFile[MAX_PATH] = {'\0'};
static const WCHAR wszDefExt[] = {'r','t','f','\0'};
ZeroMemory(&sfn, sizeof(sfn));
sfn.lStructSize = sizeof(sfn);
sfn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
sfn.hwndOwner = hMainWnd;
sfn.lpstrFilter = wszFilter;
sfn.lpstrFile = wszFile;
sfn.nMaxFile = MAX_PATH;
sfn.lpstrDefExt = wszDefExt;
if(!GetSaveFileNameW(&sfn))
return;
DoSaveFile(sfn.lpstrFile);
}
static void HandleCommandLine(LPWSTR cmdline)
{
WCHAR delimiter;
......@@ -466,9 +489,14 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
case ID_FILE_SAVE:
if(wszFileName[0])
{
DoSaveFile(wszFileName);
else
MessageBox(hWnd, "Can only save existing for now", "WordPad", MB_OK);
break;
}
/* Fall through */
case ID_FILE_SAVEAS:
DialogSaveFile();
break;
case ID_PRINT:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment