Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bbc20456
Commit
bbc20456
authored
Jul 18, 2007
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Aug 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Prompt for format when selecting new file.
parent
425c2c64
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
257 additions
and
6 deletions
+257
-6
De.rc
programs/wordpad/De.rc
+18
-0
En.rc
programs/wordpad/En.rc
+18
-0
Fr.rc
programs/wordpad/Fr.rc
+18
-0
Hu.rc
programs/wordpad/Hu.rc
+18
-0
Ko.rc
programs/wordpad/Ko.rc
+11
-0
Nl.rc
programs/wordpad/Nl.rc
+18
-0
No.rc
programs/wordpad/No.rc
+18
-0
Pl.rc
programs/wordpad/Pl.rc
+18
-0
Ru.rc
programs/wordpad/Ru.rc
+18
-0
Tr.rc
programs/wordpad/Tr.rc
+18
-0
resource.h
programs/wordpad/resource.h
+8
-0
wordpad.c
programs/wordpad/wordpad.c
+76
-6
No files found.
programs/wordpad/De.rc
View file @
bbc20456
...
...
@@ -93,6 +93,17 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "New"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "New document type",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich-Text-Format (*.rtf)"
...
...
@@ -103,6 +114,13 @@ END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
STRING_NEWFILE_TXT, "Text document"
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
STRING_PROMPT_SAVE_CHANGES, "Save changes to '%s'?"
STRING_SEARCH_FINISHED, "Finished searching the document."
...
...
programs/wordpad/En.rc
View file @
bbc20456
...
...
@@ -93,6 +93,17 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "New"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "New document type",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
...
...
@@ -103,6 +114,13 @@ END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
STRING_NEWFILE_TXT, "Text document"
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
STRING_PROMPT_SAVE_CHANGES, "Save changes to '%s'?"
STRING_SEARCH_FINISHED, "Finished searching the document."
...
...
programs/wordpad/Fr.rc
View file @
bbc20456
...
...
@@ -93,6 +93,17 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "New"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "New document type",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
...
...
@@ -103,6 +114,13 @@ END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
STRING_NEWFILE_TXT, "Text document"
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
STRING_PROMPT_SAVE_CHANGES, "Save changes to '%s'?"
STRING_SEARCH_FINISHED, "Finished searching the document."
...
...
programs/wordpad/Hu.rc
View file @
bbc20456
...
...
@@ -93,6 +93,17 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "New"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "New document type",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
...
...
@@ -103,6 +114,13 @@ END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
STRING_NEWFILE_TXT, "Text document"
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
STRING_PROMPT_SAVE_CHANGES, "Save changes to '%s'?"
STRING_SEARCH_FINISHED, "Finished searching the document."
...
...
programs/wordpad/Ko.rc
View file @
bbc20456
...
...
@@ -94,6 +94,17 @@ BEGIN
PUSHBUTTON "취소(&C)",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "New"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "New document type",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "리치 텍스트 파일형식 (*.rtf)"
...
...
programs/wordpad/Nl.rc
View file @
bbc20456
...
...
@@ -93,6 +93,17 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "New"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "New document type",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
...
...
@@ -103,6 +114,13 @@ END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
STRING_NEWFILE_TXT, "Text document"
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
STRING_PROMPT_SAVE_CHANGES, "Save changes to '%s'?"
STRING_SEARCH_FINISHED, "Finished searching the document."
...
...
programs/wordpad/No.rc
View file @
bbc20456
...
...
@@ -93,6 +93,17 @@ BEGIN
PUSHBUTTON "&Avbryt",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Ny"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "Ny dokumenttype",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Avbryt",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rikt tekstformat (*.rtf)"
...
...
@@ -103,6 +114,13 @@ END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rikt tekstdokument"
STRING_NEWFILE_TXT, "Tekstdokument"
STRING_NEWFILE_TXT_UNICODE, "Tekstdokument (Unicode)"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Dokument"
STRING_PROMPT_SAVE_CHANGES, "Lagre endringer i %s?"
STRING_SEARCH_FINISHED, "Ferdig med ske i dokumentet."
...
...
programs/wordpad/Pl.rc
View file @
bbc20456
...
...
@@ -94,6 +94,17 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "New"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "New document type",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Tekst sformatowany - RTF (*.rtf)"
...
...
@@ -104,6 +115,13 @@ END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
STRING_NEWFILE_TXT, "Text document"
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
STRING_PROMPT_SAVE_CHANGES, "Save changes to '%s'?"
STRING_SEARCH_FINISHED, "Finished searching the document."
...
...
programs/wordpad/Ru.rc
View file @
bbc20456
...
...
@@ -91,6 +91,17 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "New"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "New document type",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
...
...
@@ -101,6 +112,13 @@ END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
STRING_NEWFILE_TXT, "Text document"
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
STRING_PROMPT_SAVE_CHANGES, "Save changes to '%s'?"
STRING_SEARCH_FINISHED, "Finished searching the document."
...
...
programs/wordpad/Tr.rc
View file @
bbc20456
...
...
@@ -95,6 +95,17 @@ BEGIN
PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12
END
IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "New"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "New document type",0,3,2,100,15
LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT
PUSHBUTTON "&OK",IDOK,97,12,40,12
PUSHBUTTON "&Cancel",IDCANCEL,97,26,40,12
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)"
...
...
@@ -105,6 +116,13 @@ END
STRINGTABLE DISCARDABLE
BEGIN
STRING_NEWFILE_RICHTEXT, "Rich text document"
STRING_NEWFILE_TXT, "Text document"
STRING_NEWFILE_TXT_UNICODE, "Unicode text document"
END
STRINGTABLE DISCARDABLE
BEGIN
STRING_DEFAULT_FILENAME, "Document"
STRING_PROMPT_SAVE_CHANGES, "Save changes to '%s'?"
STRING_SEARCH_FINISHED, "Finished searching the document."
...
...
programs/wordpad/resource.h
View file @
bbc20456
...
...
@@ -71,6 +71,8 @@
#define FILELIST_ENTRIES 4
#define FILELIST_ENTRY_LENGTH 33
#define ID_NEWFILE_ABORT 100
#define ID_DATETIME 1600
#define IDC_STATUSBAR 2000
...
...
@@ -80,8 +82,10 @@
#define IDC_REBAR 2004
#define IDC_COMBO 2005
#define IDC_DATETIME 2006
#define IDC_NEWFILE 2007
#define IDD_DATETIME 2100
#define IDD_NEWFILE 2101
#define IDB_TOOLBAR 100
#define IDB_FORMATBAR 101
...
...
@@ -93,6 +97,10 @@
#define STRING_TEXT_FILES_UNICODE_TXT 1402
#define STRING_RICHTEXT_FILES_RTF 1403
#define STRING_NEWFILE_RICHTEXT 1404
#define STRING_NEWFILE_TXT 1405
#define STRING_NEWFILE_TXT_UNICODE 1406
#define STRING_DEFAULT_FILENAME 1700
#define STRING_PROMPT_SAVE_CHANGES 1701
#define STRING_SEARCH_FINISHED 1702
...
...
programs/wordpad/wordpad.c
View file @
bbc20456
...
...
@@ -429,6 +429,16 @@ static void registry_set_filelist(LPCWSTR newFile)
registry_read_filelist
(
hMainWnd
);
}
static
void
clear_formatting
(
void
)
{
PARAFORMAT2
pf
;
pf
.
cbSize
=
sizeof
(
pf
);
pf
.
dwMask
=
PFM_ALIGNMENT
;
pf
.
wAlignment
=
PFA_LEFT
;
SendMessageW
(
hEditorWnd
,
EM_SETPARAFORMAT
,
0
,
(
LPARAM
)
&
pf
);
}
static
int
fileformat_number
(
WPARAM
format
)
{
int
number
=
0
;
...
...
@@ -928,6 +938,49 @@ BOOL CALLBACK datetime_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
return
FALSE
;
}
BOOL
CALLBACK
newfile_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_NEWFILE
);
LoadStringW
(
hInstance
,
STRING_NEWFILE_RICHTEXT
,
(
LPWSTR
)
buffer
,
MAX_STRING_LEN
);
SendMessageW
(
hListWnd
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
&
buffer
);
LoadStringW
(
hInstance
,
STRING_NEWFILE_TXT
,
(
LPWSTR
)
buffer
,
MAX_STRING_LEN
);
SendMessageW
(
hListWnd
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
&
buffer
);
LoadStringW
(
hInstance
,
STRING_NEWFILE_TXT_UNICODE
,
(
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_NEWFILE
);
index
=
SendMessageW
(
hListWnd
,
LB_GETCURSEL
,
0
,
0
);
if
(
index
!=
LB_ERR
)
EndDialog
(
hWnd
,
MAKELONG
(
fileformat_flags
(
index
),
0
));
}
return
TRUE
;
case
IDCANCEL
:
EndDialog
(
hWnd
,
MAKELONG
(
ID_NEWFILE_ABORT
,
0
));
return
TRUE
;
}
}
return
FALSE
;
}
static
LRESULT
OnCreate
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HWND
hToolBarWnd
,
hFormatBarWnd
,
hReBarWnd
;
...
...
@@ -1137,13 +1190,30 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
break
;
case
ID_FILE_NEW
:
if
(
prompt_save_changes
())
{
set_caption
(
NULL
);
wszFileName
[
0
]
=
'\0'
;
SetWindowTextW
(
hwndEditor
,
wszFileName
);
SendMessageW
(
hEditorWnd
,
EM_SETMODIFY
,
FALSE
,
0
);
fileFormat
=
SF_RTF
;
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLongPtr
(
hWnd
,
GWLP_HINSTANCE
);
int
ret
=
DialogBox
(
hInstance
,
MAKEINTRESOURCE
(
IDD_NEWFILE
),
hWnd
,
(
DLGPROC
)
newfile_proc
);
if
(
ret
!=
ID_NEWFILE_ABORT
)
{
if
(
prompt_save_changes
())
{
SETTEXTEX
st
;
set_caption
(
NULL
);
wszFileName
[
0
]
=
'\0'
;
st
.
flags
=
ST_DEFAULT
;
st
.
codepage
=
1200
;
SendMessageW
(
hEditorWnd
,
EM_SETTEXTEX
,
(
WPARAM
)
&
st
,
0
);
clear_formatting
();
SendMessageW
(
hEditorWnd
,
EM_SETMODIFY
,
FALSE
,
0
);
set_fileformat
(
ret
);
}
}
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment