wordpad: Add file saving dialog.
This commit is contained in:
parent
69c9565e6f
commit
68ce602381
|
@ -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 "&Megnyitás\tCtrl+O", ID_FILE_OPEN
|
||||
MENUITEM "M&entés\tCtrl+S", ID_FILE_SAVE
|
||||
MENUITEM "Mentés má&sként...", ID_FILE_SAVEAS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Kilépés", 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 "&Otwórz\tCtrl+O", ID_FILE_OPEN
|
||||
MENUITEM "&Zapisz\tCtrl+S", ID_FILE_SAVE
|
||||
MENUITEM "Z&apisz jako...", ID_FILE_SAVEAS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Za&koñcz", 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:
|
||||
|
|
Loading…
Reference in New Issue