wordpad: Add paragraph format dialog.

This commit is contained in:
Alexander Nicolaysen Sørnes 2007-08-23 01:15:17 +02:00 committed by Alexandre Julliard
parent 1faecfe6ed
commit fd129c23d9
12 changed files with 498 additions and 60 deletions

View File

@ -68,17 +68,12 @@ BEGIN
POPUP "F&ormat"
BEGIN
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
POPUP "&Hintergrund"
BEGIN
MENUITEM "&System\tCtrl+1", ID_BACK_1
MENUITEM "&PostIt-Notiz\tCtrl+2", ID_BACK_2
END
POPUP "&Ausrichtung"
BEGIN
MENUITEM "&Links\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "&Zentriert\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "&Rechts\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -104,6 +99,24 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Paragraph format"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Indentation", 0, 10, 10, 120, 68
LTEXT "Left", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Right", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich-Text-Format (*.rtf)"
@ -112,6 +125,13 @@ BEGIN
STRING_ALL_FILES, "Alle Dokumente (*.*)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Left"
STRING_ALIGN_RIGHT, "Right"
STRING_ALIGN_CENTER, "Center"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
@ -119,6 +139,11 @@ BEGIN
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
@ -128,4 +153,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "You have chosen to save in plain text format, " \
"which will cause all formatting to be lost. " \
"Are you sure that you wish to do this?"
STRING_INVALID_NUMBER, "Invalid number format"
END

View File

@ -68,17 +68,12 @@ BEGIN
POPUP "F&ormat"
BEGIN
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
POPUP "Backgroun&d"
BEGIN
MENUITEM "&System\tCtrl+1", ID_BACK_1
MENUITEM "&PostThat yellowish\tCtrl+2", ID_BACK_2
END
POPUP "&Alignment"
BEGIN
MENUITEM "&Left\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "&Center\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "&Right\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -104,6 +99,24 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Paragraph format"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Indentation", 0, 10, 10, 120, 68
LTEXT "Left", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Right", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
@ -112,6 +125,13 @@ BEGIN
STRING_ALL_FILES, "All documents (*.*)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Left"
STRING_ALIGN_RIGHT, "Right"
STRING_ALIGN_CENTER, "Center"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
@ -119,6 +139,11 @@ BEGIN
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
@ -128,4 +153,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "You have chosen to save in plain text format, " \
"which will cause all formatting to be lost. " \
"Are you sure that you wish to do this?"
STRING_INVALID_NUMBER, "Invalid number format"
END

View File

@ -68,17 +68,12 @@ BEGIN
POPUP "Forma&t"
BEGIN
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
POPUP "&Fond"
BEGIN
MENUITEM "&Système\tCtrl+1", ID_BACK_1
MENUITEM "&Jaunasse\tCtrl+2", ID_BACK_2
END
POPUP "&Alignement"
BEGIN
MENUITEM "Aligné à &gauche\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "&Centré\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "Aligné à &droite\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -104,6 +99,24 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Paragraph format"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Indentation", 0, 10, 10, 120, 68
LTEXT "Left", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Right", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
@ -112,6 +125,13 @@ BEGIN
STRING_ALL_FILES, "All documents (*.*)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Left"
STRING_ALIGN_RIGHT, "Right"
STRING_ALIGN_CENTER, "Center"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
@ -119,6 +139,11 @@ BEGIN
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
@ -128,4 +153,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "You have chosen to save in plain text format, " \
"which will cause all formatting to be lost. " \
"Are you sure that you wish to do this?"
STRING_INVALID_NUMBER, "Invalid number format"
END

View File

@ -68,17 +68,12 @@ BEGIN
POPUP "F&ormátum"
BEGIN
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
POPUP "&Háttér"
BEGIN
MENUITEM "&Rendszer\tCtrl+1", ID_BACK_1
MENUITEM "&Sárgában kérem\tCtrl+2", ID_BACK_2
END
POPUP "&Igazítás"
BEGIN
MENUITEM "&Balra\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "&Középre\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "&Jobbra\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -104,6 +99,24 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Paragraph format"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Indentation", 0, 10, 10, 120, 68
LTEXT "Left", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Right", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
@ -112,6 +125,13 @@ BEGIN
STRING_ALL_FILES, "All documents (*.*)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Left"
STRING_ALIGN_RIGHT, "Right"
STRING_ALIGN_CENTER, "Center"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
@ -119,6 +139,11 @@ BEGIN
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
@ -128,4 +153,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "You have chosen to save in plain text format, " \
"which will cause all formatting to be lost. " \
"Are you sure that you wish to do this?"
STRING_INVALID_NUMBER, "Invalid number format"
END

View File

@ -69,17 +69,12 @@ BEGIN
POPUP "형식(&O)"
BEGIN
MENUITEM " 강조 점(&U)" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
POPUP "배경(&B)"
BEGIN
MENUITEM "시스템(&S)\tCtrl+1", ID_BACK_1
MENUITEM "노랑색으로(&P)\tCtrl+2", ID_BACK_2
END
POPUP "정렬(&A)"
BEGIN
MENUITEM "왼쪽(&L)\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "가운데(&C)\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "오른쪽(&R)\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -105,6 +100,31 @@ BEGIN
PUSHBUTTON "취소(&C)",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Paragraph format"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Indentation", 0, 10, 10, 120, 68
LTEXT "Left", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Right", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Left"
STRING_ALIGN_RIGHT, "Right"
STRING_ALIGN_CENTER, "Center"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "리치 텍스트 파일형식 (*.rtf)"
@ -113,6 +133,11 @@ BEGIN
STRING_ALL_FILES, "모든 문서 (*.*)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "문서"
@ -122,4 +147,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "당신은 보통 텍스트 형식으로 저장하기를 선택했습니다, " \
"이것은 특수한 꾸밈을 없엘 것입니다. " \
"당신은 정말로 저장하기를 원합니까?"
STRING_INVALID_NUMBER, "Invalid number format"
END

View File

@ -68,17 +68,12 @@ BEGIN
POPUP "&Opmaak"
BEGIN
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
POPUP "&Achtergrond"
BEGIN
MENUITEM "&Systeem\tCtrl+1", ID_BACK_1
MENUITEM "&Geeltje\tCtrl+2", ID_BACK_2
END
POPUP "&Uitlijning"
BEGIN
MENUITEM "&Links\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "&Gecentreerd\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "&Rechts\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -104,6 +99,24 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Paragraph format"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Indentation", 0, 10, 10, 120, 68
LTEXT "Left", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Right", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
@ -112,6 +125,13 @@ BEGIN
STRING_ALL_FILES, "All documents (*.*)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Left"
STRING_ALIGN_RIGHT, "Right"
STRING_ALIGN_CENTER, "Center"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
@ -119,6 +139,11 @@ BEGIN
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
@ -128,4 +153,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "You have chosen to save in plain text format, " \
"which will cause all formatting to be lost. " \
"Are you sure that you wish to do this?"
STRING_INVALID_NUMBER, "Invalid number format"
END

View File

@ -68,17 +68,12 @@ BEGIN
POPUP "F&ormat"
BEGIN
MENUITEM "&Punktmerking" ID_BULLET
MENUITEM "&Avsnitt . . ." ID_PARAFORMAT
POPUP "&Bakgrunn"
BEGIN
MENUITEM "&System\tCtrl+1", ID_BACK_1
MENUITEM "Merkela&pp-gult\tCtrl+2", ID_BACK_2
END
POPUP "&Justering"
BEGIN
MENUITEM "&Venstrestilt\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "&Midtstilt\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "Høy&restilt\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -104,6 +99,24 @@ BEGIN
PUSHBUTTON "&Avbryt",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Formater avsnitt"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Innrykk", 0, 10, 10, 120, 68
LTEXT "Venstre", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Høyre", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "Første linje", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Justering", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Avbryt", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rikt tekstformat (*.rtf)"
@ -119,6 +132,18 @@ BEGIN
STRING_NEWFILE_TXT_UNICODE, "Tekstdokument (Unicode)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Venstrestilt"
STRING_ALIGN_RIGHT, "Høyrestilt"
STRING_ALIGN_CENTER, "Midtstilt"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Dokument"
@ -128,4 +153,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "Du har valgt å lagre i rent tekstformat, noe som " \
"vil føre til at all formatering går tapt. Er du " \
"sikker på at du vil fortsette?"
STRING_INVALID_NUMBER, "Ugyldig tallformat"
END

View File

@ -69,17 +69,12 @@ BEGIN
POPUP "F&ormat"
BEGIN
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
POPUP "&T³o"
BEGIN
MENUITEM "&System\tCtrl+1", ID_BACK_1
MENUITEM "&PostThat (¿ó³ty)\tCtrl+2", ID_BACK_2
END
POPUP "&Wyrównanie"
BEGIN
MENUITEM "Do &lewej\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "&Wyśrodkowanie\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "Do &Prawej\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -105,6 +100,24 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Paragraph format"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Indentation", 0, 10, 10, 120, 68
LTEXT "Left", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Right", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Tekst sformatowany - RTF (*.rtf)"
@ -113,6 +126,13 @@ BEGIN
STRING_ALL_FILES, "Wszystkie dokumenty (*.*)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Left"
STRING_ALIGN_RIGHT, "Right"
STRING_ALIGN_CENTER, "Center"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
@ -120,6 +140,11 @@ BEGIN
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
@ -129,4 +154,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "You have chosen to save in plain text format, " \
"which will cause all formatting to be lost. " \
"Are you sure that you wish to do this?"
STRING_INVALID_NUMBER, "Invalid number format"
END

View File

@ -66,17 +66,12 @@ BEGIN
POPUP "Ôîð&ìàò"
BEGIN
MENUITEM "B&ullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
POPUP "&Ôîí"
BEGIN
MENUITEM "&Ñèñòåìíûé\tCtrl+1", ID_BACK_1
MENUITEM "&Æåëòîâàòûé PostThat\tCtrl+2", ID_BACK_2
END
POPUP "&Âûðàâíèâàíèå"
BEGIN
MENUITEM "Â&ëåâî\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "Ïî &öåíòðó\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "Â&ïðàâî\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -102,6 +97,24 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Paragraph format"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Indentation", 0, 10, 10, 120, 68
LTEXT "Left", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Right", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
@ -110,6 +123,13 @@ BEGIN
STRING_ALL_FILES, "All documents (*.*)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Left"
STRING_ALIGN_RIGHT, "Right"
STRING_ALIGN_CENTER, "Center"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
@ -117,6 +137,11 @@ BEGIN
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
@ -126,4 +151,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "You have chosen to save in plain text format, " \
"which will cause all formatting to be lost. " \
"Are you sure that you wish to do this?"
STRING_INVALID_NUMBER, "Invalid number format"
END

View File

@ -70,17 +70,12 @@ BEGIN
POPUP "&Biçim"
BEGIN
MENUITEM "&Bullet points" ID_BULLET
MENUITEM "&Paragraph . . ." ID_PARAFORMAT
POPUP "&Arkaplan"
BEGIN
MENUITEM "S&istem\tCtrl+1", ID_BACK_1
MENUITEM "&Sarýmtýrak\tCtrl+2", ID_BACK_2
END
POPUP "&Hizalama"
BEGIN
MENUITEM "S&ol\tCtrl+L", ID_ALIGN_LEFT
MENUITEM "O&rta\tCtrl+E", ID_ALIGN_CENTER
MENUITEM "S&að\tCtrl+R", ID_ALIGN_RIGHT
END
END
END
@ -106,6 +101,24 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
Caption "Paragraph format"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Indentation", 0, 10, 10, 120, 68
LTEXT "Left", 0, 15, 22, 40, 13
EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13
LTEXT "Right", 0, 15, 40, 40, 13
EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13
LTEXT "First line", 0, 15, 58, 40, 13
EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13
LTEXT "Alignment", 0, 15, 87, 40, 13
COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 13, CBS_DROPDOWNLIST
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
PUSHBUTTON "&Cancel", IDCANCEL, 137, 33, 50, 15
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
@ -114,6 +127,13 @@ BEGIN
STRING_ALL_FILES, "All documents (*.*)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_ALIGN_LEFT, "Left"
STRING_ALIGN_RIGHT, "Right"
STRING_ALIGN_CENTER, "Center"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
@ -121,6 +141,11 @@ BEGIN
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_UNITS_CM, "cm"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
@ -130,4 +155,5 @@ BEGIN
STRING_SAVE_LOSEFORMATTING, "You have chosen to save in plain text format, " \
"which will cause all formatting to be lost. " \
"Are you sure that you wish to do this?"
STRING_INVALID_NUMBER, "Invalid number format"
END

View File

@ -76,6 +76,7 @@
#define ID_NEWFILE_ABORT 100
#define ID_DATETIME 1600
#define ID_PARAFORMAT 1601
#define IDC_STATUSBAR 2000
#define IDC_EDITOR 2001
@ -85,9 +86,14 @@
#define IDC_COMBO 2005
#define IDC_DATETIME 2006
#define IDC_NEWFILE 2007
#define IDC_PARA_LEFT 2008
#define IDC_PARA_RIGHT 2009
#define IDC_PARA_FIRST 2010
#define IDC_PARA_ALIGN 2011
#define IDD_DATETIME 2100
#define IDD_NEWFILE 2101
#define IDD_PARAFORMAT 2102
#define IDB_TOOLBAR 100
#define IDB_FORMATBAR 101
@ -103,8 +109,15 @@
#define STRING_NEWFILE_TXT 1405
#define STRING_NEWFILE_TXT_UNICODE 1406
#define STRING_ALIGN_LEFT 1407
#define STRING_ALIGN_RIGHT 1408
#define STRING_ALIGN_CENTER 1409
#define STRING_UNITS_CM 1410
#define STRING_DEFAULT_FILENAME 1700
#define STRING_PROMPT_SAVE_CHANGES 1701
#define STRING_SEARCH_FINISHED 1702
#define STRING_LOAD_RICHED_FAILED 1703
#define STRING_SAVE_LOSEFORMATTING 1704
#define STRING_INVALID_NUMBER 1705

View File

@ -34,6 +34,8 @@
#include <commdlg.h>
#include <shlobj.h>
#include <shellapi.h>
#include <math.h>
#include <errno.h>
#include "resource.h"
@ -67,6 +69,8 @@ static WCHAR wszFilter[MAX_STRING_LEN*4+6*3+5];
static WCHAR wszDefaultFileName[MAX_STRING_LEN];
static WCHAR wszSaveChanges[MAX_STRING_LEN];
static char units_cmA[MAX_STRING_LEN];
static LRESULT OnSize( HWND hWnd, WPARAM wParam, LPARAM lParam );
/* Load string resources */
@ -101,6 +105,8 @@ static void DoLoadStrings(void)
p = wszSaveChanges;
LoadStringW(hInstance, STRING_PROMPT_SAVE_CHANGES, p, MAX_STRING_LEN);
LoadStringA(hInstance, STRING_UNITS_CM, units_cmA, MAX_STRING_LEN);
}
static void AddButton(HWND hwndToolBar, int nImage, int nCommand)
@ -476,6 +482,45 @@ static void registry_set_filelist(LPCWSTR newFile)
registry_read_filelist(hMainWnd);
}
static BOOL validate_endptr(LPCSTR endptr, BOOL units)
{
if(!endptr || !*endptr)
return TRUE;
while(*endptr == ' ')
endptr++;
if(!units)
return *endptr != '\0';
/* FIXME: Allow other units and convert between them */
if(!lstrcmpA(endptr, units_cmA))
endptr += 2;
return *endptr != '\0';
}
static BOOL number_from_string(LPCWSTR string, float *num, BOOL units)
{
double ret;
char buffer[MAX_STRING_LEN];
char *endptr = buffer;
WideCharToMultiByte(CP_ACP, 0, string, -1, buffer, MAX_STRING_LEN, NULL, NULL);
*num = 0;
errno = 0;
ret = strtod(buffer, &endptr);
if((ret == 0 && errno != 0) || endptr == buffer || validate_endptr(endptr, units))
{
return FALSE;
} else
{
*num = (float)ret;
return TRUE;
}
}
static void clear_formatting(void)
{
PARAFORMAT2 pf;
@ -1030,6 +1075,22 @@ static void registry_set_options(void)
registry_set_options_format(reg_formatindex(SF_TEXT), key_text);
}
static int current_units_to_twips(float number)
{
int twips = (int)(number * 567);
return twips;
}
static void number_with_units(LPWSTR buffer, int number)
{
float converted = (float)number / 567;
char string[MAX_STRING_LEN];
sprintf(string, "%.2f ", converted);
lstrcatA(string, units_cmA);
MultiByteToWideChar(CP_ACP, 0, string, -1, buffer, MAX_STRING_LEN);
}
BOOL CALLBACK datetime_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
@ -1124,6 +1185,102 @@ BOOL CALLBACK newfile_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
return FALSE;
}
static INT_PTR CALLBACK paraformat_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
{
HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(hMainWnd,
GWLP_HINSTANCE);
WCHAR buffer[MAX_STRING_LEN];
HWND hListWnd = GetDlgItem(hWnd, IDC_PARA_ALIGN);
HWND hLeftWnd = GetDlgItem(hWnd, IDC_PARA_LEFT);
HWND hRightWnd = GetDlgItem(hWnd, IDC_PARA_RIGHT);
HWND hFirstWnd = GetDlgItem(hWnd, IDC_PARA_FIRST);
PARAFORMAT2 pf;
int index = 0;
LoadStringW(hInstance, STRING_ALIGN_LEFT, buffer,
MAX_STRING_LEN);
SendMessageW(hListWnd, CB_ADDSTRING, 0, (LPARAM)buffer);
LoadStringW(hInstance, STRING_ALIGN_RIGHT, buffer,
MAX_STRING_LEN);
SendMessageW(hListWnd, CB_ADDSTRING, 0, (LPARAM)buffer);
LoadStringW(hInstance, STRING_ALIGN_CENTER, buffer,
MAX_STRING_LEN);
SendMessageW(hListWnd, CB_ADDSTRING, 0, (LPARAM)buffer);
pf.cbSize = sizeof(pf);
pf.dwMask = PFM_ALIGNMENT | PFM_OFFSET | PFM_RIGHTINDENT |
PFM_OFFSETINDENT;
SendMessageW(hEditorWnd, EM_GETPARAFORMAT, 0, (LPARAM)&pf);
if(pf.wAlignment == PFA_RIGHT)
index ++;
else if(pf.wAlignment == PFA_CENTER)
index += 2;
SendMessageW(hListWnd, CB_SETCURSEL, index, 0);
number_with_units(buffer, pf.dxOffset);
SetWindowTextW(hLeftWnd, buffer);
number_with_units(buffer, pf.dxRightIndent);
SetWindowTextW(hRightWnd, buffer);
number_with_units(buffer, pf.dxStartIndent - pf.dxOffset);
SetWindowTextW(hFirstWnd, buffer);
}
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
{
HWND hLeftWnd = GetDlgItem(hWnd, IDC_PARA_LEFT);
HWND hRightWnd = GetDlgItem(hWnd, IDC_PARA_RIGHT);
HWND hFirstWnd = GetDlgItem(hWnd, IDC_PARA_FIRST);
WCHAR buffer[MAX_STRING_LEN];
float num;
int ret = 0;
PARAFORMAT pf;
GetWindowTextW(hLeftWnd, buffer, MAX_STRING_LEN);
if(number_from_string(buffer, &num, TRUE))
ret++;
pf.dxOffset = current_units_to_twips(num);
GetWindowTextW(hRightWnd, buffer, MAX_STRING_LEN);
if(number_from_string(buffer, &num, TRUE))
ret++;
pf.dxRightIndent = current_units_to_twips(num);
GetWindowTextW(hFirstWnd, buffer, MAX_STRING_LEN);
if(number_from_string(buffer, &num, TRUE))
ret++;
pf.dxStartIndent = current_units_to_twips(num);
if(ret != 3)
{
MessageBoxW(hMainWnd, MAKEINTRESOURCEW(STRING_INVALID_NUMBER),
wszAppTitle, MB_OK | MB_ICONASTERISK);
return FALSE;
} else
{
pf.dxStartIndent = pf.dxStartIndent + pf.dxOffset;
pf.cbSize = sizeof(pf);
pf.dwMask = PFM_OFFSET | PFM_OFFSETINDENT | PFM_RIGHTINDENT;
SendMessageW(hEditorWnd, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
}
}
/* Fall through */
case IDCANCEL:
EndDialog(hWnd, wParam);
return TRUE;
}
}
return FALSE;
}
static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
{
HWND hToolBarWnd, hFormatBarWnd, hReBarWnd;
@ -1613,6 +1770,14 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
break;
}
case ID_PARAFORMAT:
{
HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE);
DialogBoxW(hInstance, MAKEINTRESOURCEW(IDD_PARAFORMAT), hWnd,
paraformat_proc);
}
break;
default:
SendMessageW(hwndEditor, WM_COMMAND, wParam, lParam);
break;