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
1faecfe6
Commit
1faecfe6
authored
Aug 22, 2007
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Sep 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Set default font according to format.
parent
5a2efbcb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
18 deletions
+27
-18
wordpad.c
programs/wordpad/wordpad.c
+27
-18
No files found.
programs/wordpad/wordpad.c
View file @
1faecfe6
...
...
@@ -512,6 +512,30 @@ static WPARAM fileformat_flags(int format)
return
flags
[
format
];
}
static
void
set_default_font
(
void
)
{
static
const
WCHAR
richTextFont
[]
=
{
'T'
,
'i'
,
'm'
,
'e'
,
's'
,
' '
,
'N'
,
'e'
,
'w'
,
' '
,
'R'
,
'o'
,
'm'
,
'a'
,
'n'
,
0
};
static
const
WCHAR
plainTextFont
[]
=
{
'C'
,
'o'
,
'u'
,
'r'
,
'i'
,
'e'
,
'r'
,
' '
,
'N'
,
'e'
,
'w'
,
0
};
CHARFORMAT2W
fmt
;
LPCWSTR
font
;
ZeroMemory
(
&
fmt
,
sizeof
(
fmt
));
fmt
.
cbSize
=
sizeof
(
fmt
);
fmt
.
dwMask
=
CFM_FACE
|
CFM_BOLD
|
CFM_ITALIC
|
CFM_UNDERLINE
;
fmt
.
dwEffects
=
0
;
if
(
fileFormat
&
SF_RTF
)
font
=
richTextFont
;
else
font
=
plainTextFont
;
lstrcpyW
(
fmt
.
szFaceName
,
font
);
SendMessageW
(
hEditorWnd
,
EM_SETCHARFORMAT
,
SCF_DEFAULT
,
(
LPARAM
)
&
fmt
);
}
static
void
update_window
(
void
)
{
RECT
rect
;
...
...
@@ -588,6 +612,7 @@ static void set_fileformat(WPARAM format)
fileFormat
=
format
;
set_bar_states
();
set_default_font
();
}
static
void
DoOpenFile
(
LPCWSTR
szOpenFileName
)
...
...
@@ -621,6 +646,7 @@ static void DoOpenFile(LPCWSTR szOpenFileName)
es
.
pfnCallback
=
stream_in
;
clear_formatting
();
set_fileformat
(
format
);
SendMessageW
(
hEditorWnd
,
EM_STREAMIN
,
format
,
(
LPARAM
)
&
es
);
CloseHandle
(
hFile
);
...
...
@@ -953,23 +979,6 @@ static void dialog_find(LPFINDREPLACEW fr)
hFindWnd
=
FindTextW
(
fr
);
}
static
void
DoDefaultFont
(
void
)
{
static
const
WCHAR
szFaceName
[]
=
{
'T'
,
'i'
,
'm'
,
'e'
,
's'
,
' '
,
'N'
,
'e'
,
'w'
,
' '
,
'R'
,
'o'
,
'm'
,
'a'
,
'n'
,
0
};
CHARFORMAT2W
fmt
;
ZeroMemory
(
&
fmt
,
sizeof
(
fmt
));
fmt
.
cbSize
=
sizeof
(
fmt
);
fmt
.
dwMask
=
CFM_FACE
|
CFM_BOLD
|
CFM_ITALIC
|
CFM_UNDERLINE
;
fmt
.
dwEffects
=
0
;
lstrcpyW
(
fmt
.
szFaceName
,
szFaceName
);
SendMessageW
(
hEditorWnd
,
EM_SETCHARFORMAT
,
SCF_DEFAULT
,
(
LPARAM
)
&
fmt
);
}
static
void
registry_read_options_format
(
int
index
,
LPCWSTR
key
)
{
HKEY
hKey
;
...
...
@@ -1222,7 +1231,7 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
SetFocus
(
hEditorWnd
);
SendMessageW
(
hEditorWnd
,
EM_SETEVENTMASK
,
0
,
ENM_SELCHANGE
);
DoDefaultF
ont
();
set_default_f
ont
();
DoLoadStrings
();
SendMessageW
(
hEditorWnd
,
EM_SETMODIFY
,
FALSE
,
0
);
...
...
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