wordpad: Add date/time dialog.
This commit is contained in:
parent
099bfbe1a4
commit
4c6c9e596f
|
@ -58,6 +58,10 @@ BEGIN
|
|||
MENUITEM "&Formatbar", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "&Statusbar", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "&Insert"
|
||||
BEGIN
|
||||
MENUITEM "&Date and time . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "F&ormat"
|
||||
BEGIN
|
||||
POPUP "&Hintergrund"
|
||||
|
@ -74,6 +78,17 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Date and time"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Available formats",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "Rich-Text-Format (*.rtf)"
|
||||
|
|
|
@ -58,6 +58,10 @@ BEGIN
|
|||
MENUITEM "&Formatbar", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "&Statusbar", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "&Insert"
|
||||
BEGIN
|
||||
MENUITEM "&Date and time . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "F&ormat"
|
||||
BEGIN
|
||||
POPUP "&Background"
|
||||
|
@ -74,6 +78,17 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Date and time"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Available formats",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
|
||||
|
|
|
@ -58,6 +58,10 @@ BEGIN
|
|||
MENUITEM "&Barre de format", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "&Barre d'état", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "&Insert"
|
||||
BEGIN
|
||||
MENUITEM "&Date and time . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "Forma&t"
|
||||
BEGIN
|
||||
POPUP "&Fond"
|
||||
|
@ -74,6 +78,24 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Date and time"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Available formats",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
|
||||
STRING_TEXT_FILES_TXT, "Text files (*.txt)"
|
||||
STRING_ALL_FILES, "All documents (*.*)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_DEFAULT_FILENAME, "Document"
|
||||
|
|
|
@ -58,6 +58,10 @@ BEGIN
|
|||
MENUITEM "&Formatbar", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "&Statusbar", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "&Insert"
|
||||
BEGIN
|
||||
MENUITEM "&Date and time . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "F&ormátum"
|
||||
BEGIN
|
||||
POPUP "&Háttér"
|
||||
|
@ -74,6 +78,24 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Date and time"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Available formats",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
|
||||
STRING_TEXT_FILES_TXT, "Text files (*.txt)"
|
||||
STRING_ALL_FILES, "All documents (*.*)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_DEFAULT_FILENAME, "Document"
|
||||
|
|
|
@ -59,6 +59,10 @@ BEGIN
|
|||
MENUITEM "형식바(&F)", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "상태바(&S)", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "&Insert"
|
||||
BEGIN
|
||||
MENUITEM "&Date and time . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "형식(&O)"
|
||||
BEGIN
|
||||
POPUP "배경(&B)"
|
||||
|
@ -75,6 +79,17 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Date and time"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Available formats",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "리치 텍스트 파일형식 (*.rtf)"
|
||||
|
|
|
@ -58,6 +58,10 @@ BEGIN
|
|||
MENUITEM "&Formatbar", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "&Statusbar", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "&Insert"
|
||||
BEGIN
|
||||
MENUITEM "&Date and time . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "&Opmaak"
|
||||
BEGIN
|
||||
POPUP "&Achtergrond"
|
||||
|
@ -74,6 +78,24 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Date and time"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Available formats",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
|
||||
STRING_TEXT_FILES_TXT, "Text files (*.txt)"
|
||||
STRING_ALL_FILES, "All documents (*.*)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_DEFAULT_FILENAME, "Document"
|
||||
|
|
|
@ -58,6 +58,10 @@ BEGIN
|
|||
MENUITEM "&Formatlinje", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "&Statuslinje", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "Sett &inn"
|
||||
BEGIN
|
||||
MENUITEM "&Dato og klokkeslett . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "F&ormat"
|
||||
BEGIN
|
||||
POPUP "&Bakgrunn"
|
||||
|
@ -74,6 +78,17 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dato og klokkeslett"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Tilgjengelige formater",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Avbryt",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "Rikt tekstformat (*.rtf)"
|
||||
|
|
|
@ -59,6 +59,10 @@ BEGIN
|
|||
MENUITEM "&Formatbar", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "&Statusbar", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "&Insert"
|
||||
BEGIN
|
||||
MENUITEM "&Date and time . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "F&ormat"
|
||||
BEGIN
|
||||
POPUP "&T³o"
|
||||
|
@ -75,6 +79,17 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Date and time"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Available formats",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "Tekst sformatowany - RTF (*.rtf)"
|
||||
|
|
|
@ -56,6 +56,10 @@ BEGIN
|
|||
MENUITEM "&Formatbar", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "&Statusbar", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "&Insert"
|
||||
BEGIN
|
||||
MENUITEM "&Date and time . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "Ôîð&ìàò"
|
||||
BEGIN
|
||||
POPUP "&Ôîí"
|
||||
|
@ -72,6 +76,24 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Date and time"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Available formats",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
|
||||
STRING_TEXT_FILES_TXT, "Text files (*.txt)"
|
||||
STRING_ALL_FILES, "All documents (*.*)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_DEFAULT_FILENAME, "Document"
|
||||
|
|
|
@ -60,6 +60,10 @@ BEGIN
|
|||
MENUITEM "&Formatbar", ID_TOGGLE_FORMATBAR
|
||||
MENUITEM "&Statusbar", ID_TOGGLE_STATUSBAR
|
||||
END
|
||||
POPUP "&Insert"
|
||||
BEGIN
|
||||
MENUITEM "&Date and time . . .", ID_DATETIME
|
||||
END
|
||||
POPUP "&Biçim"
|
||||
BEGIN
|
||||
POPUP "&Arkaplan"
|
||||
|
@ -76,6 +80,24 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Date and time"
|
||||
FONT 10, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Available formats",0,3,2,100,15
|
||||
LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT
|
||||
PUSHBUTTON "&OK",IDOK,87,12,40,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
|
||||
STRING_TEXT_FILES_TXT, "Text files (*.txt)"
|
||||
STRING_ALL_FILES, "All documents (*.*)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
STRING_DEFAULT_FILENAME, "Document"
|
||||
|
|
|
@ -60,12 +60,17 @@
|
|||
#define BANDID_TOOLBAR 0
|
||||
#define BANDID_FORMATBAR 1
|
||||
|
||||
#define ID_DATETIME 1600
|
||||
|
||||
#define IDC_STATUSBAR 2000
|
||||
#define IDC_EDITOR 2001
|
||||
#define IDC_TOOLBAR 2002
|
||||
#define IDC_FORMATBAR 2003
|
||||
#define IDC_REBAR 2004
|
||||
#define IDC_COMBO 2005
|
||||
#define IDC_DATETIME 2006
|
||||
|
||||
#define IDD_DATETIME 2100
|
||||
|
||||
#define IDB_FORMATBAR 100
|
||||
|
||||
|
|
|
@ -434,6 +434,57 @@ static void toggle_toolbar(int bandId)
|
|||
}
|
||||
}
|
||||
|
||||
BOOL CALLBACK datetime_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch(message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
WCHAR buffer[MAX_STRING_LEN];
|
||||
SYSTEMTIME st;
|
||||
HWND hListWnd = GetDlgItem(hWnd, IDC_DATETIME);
|
||||
GetLocalTime(&st);
|
||||
|
||||
GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, 0, (LPWSTR)&buffer,
|
||||
MAX_STRING_LEN);
|
||||
SendMessageW(hListWnd, LB_ADDSTRING, 0, (LPARAM)&buffer);
|
||||
GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, 0, (LPWSTR)&buffer,
|
||||
MAX_STRING_LEN);
|
||||
SendMessageW(hListWnd, LB_ADDSTRING, 0, (LPARAM)&buffer);
|
||||
GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, 0, (LPWSTR)&buffer, MAX_STRING_LEN);
|
||||
SendMessageW(hListWnd, LB_ADDSTRING, 0, (LPARAM)&buffer);
|
||||
|
||||
SendMessageW(hListWnd, LB_SETSEL, TRUE, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
{
|
||||
LRESULT index;
|
||||
HWND hListWnd = GetDlgItem(hWnd, IDC_DATETIME);
|
||||
|
||||
index = SendMessageW(hListWnd, LB_GETCURSEL, 0, 0);
|
||||
|
||||
if(index != LB_ERR)
|
||||
{
|
||||
WCHAR buffer[MAX_STRING_LEN];
|
||||
SendMessageW(hListWnd, LB_GETTEXT, index, (LPARAM)&buffer);
|
||||
SendMessageW(hEditorWnd, EM_REPLACESEL, TRUE, (LPARAM)&buffer);
|
||||
}
|
||||
}
|
||||
/* Fall through */
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog(hWnd, wParam);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HWND hToolBarWnd, hFormatBarWnd, hReBarWnd;
|
||||
|
@ -831,6 +882,13 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||
update_window();
|
||||
break;
|
||||
|
||||
case ID_DATETIME:
|
||||
{
|
||||
HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE);
|
||||
DialogBoxW(hInstance, MAKEINTRESOURCEW(IDD_DATETIME), hWnd, (DLGPROC)datetime_proc);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
SendMessageW(hwndEditor, WM_COMMAND, wParam, lParam);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue