Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fe0c5cb6
Commit
fe0c5cb6
authored
Apr 28, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Apr 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineconsole: Use the explicit W types/functions in dialog.c.
parent
f6217640
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
114 additions
and
117 deletions
+114
-117
dialog.c
programs/wineconsole/dialog.c
+114
-117
No files found.
programs/wineconsole/dialog.c
View file @
fe0c5cb6
...
...
@@ -65,23 +65,23 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
case
WM_INITDIALOG
:
di
=
(
struct
dialog_info
*
)((
PROPSHEETPAGEA
*
)
lParam
)
->
lParam
;
di
->
hDlg
=
hDlg
;
SetWindowLongPtr
(
hDlg
,
DWLP_USER
,
(
LONG_PTR
)
di
);
SetWindowLongPtrW
(
hDlg
,
DWLP_USER
,
(
LONG_PTR
)
di
);
SendMessage
(
GetDlgItem
(
hDlg
,
IDC_OPT_HIST_SIZE_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
500
,
0
));
SendMessageW
(
GetDlgItem
(
hDlg
,
IDC_OPT_HIST_SIZE_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
500
,
0
));
if
(
di
->
config
.
cursor_size
<=
25
)
idc
=
IDC_OPT_CURSOR_SMALL
;
else
if
(
di
->
config
.
cursor_size
<=
50
)
idc
=
IDC_OPT_CURSOR_MEDIUM
;
else
idc
=
IDC_OPT_CURSOR_LARGE
;
SendDlgItemMessage
(
hDlg
,
idc
,
BM_SETCHECK
,
BST_CHECKED
,
0L
);
SendDlgItemMessageW
(
hDlg
,
idc
,
BM_SETCHECK
,
BST_CHECKED
,
0
);
SetDlgItemInt
(
hDlg
,
IDC_OPT_HIST_SIZE
,
di
->
config
.
history_size
,
FALSE
);
SendDlgItemMessage
(
hDlg
,
IDC_OPT_HIST_NODOUBLE
,
BM_SETCHECK
,
(
di
->
config
.
history_nodup
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0L
);
SendDlgItemMessage
(
hDlg
,
IDC_OPT_CONF_CTRL
,
BM_SETCHECK
,
(
di
->
config
.
menu_mask
&
MK_CONTROL
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0L
);
SendDlgItemMessage
(
hDlg
,
IDC_OPT_CONF_SHIFT
,
BM_SETCHECK
,
(
di
->
config
.
menu_mask
&
MK_SHIFT
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0L
);
SendDlgItemMessage
(
hDlg
,
IDC_OPT_QUICK_EDIT
,
BM_SETCHECK
,
(
di
->
config
.
quick_edit
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0L
);
SendDlgItemMessage
W
(
hDlg
,
IDC_OPT_HIST_NODOUBLE
,
BM_SETCHECK
,
(
di
->
config
.
history_nodup
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0
);
SendDlgItemMessage
W
(
hDlg
,
IDC_OPT_CONF_CTRL
,
BM_SETCHECK
,
(
di
->
config
.
menu_mask
&
MK_CONTROL
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0
);
SendDlgItemMessage
W
(
hDlg
,
IDC_OPT_CONF_SHIFT
,
BM_SETCHECK
,
(
di
->
config
.
menu_mask
&
MK_SHIFT
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0
);
SendDlgItemMessage
W
(
hDlg
,
IDC_OPT_QUICK_EDIT
,
BM_SETCHECK
,
(
di
->
config
.
quick_edit
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0
);
return
FALSE
;
/* because we set the focus */
case
WM_COMMAND
:
break
;
...
...
@@ -91,7 +91,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
DWORD
val
;
BOOL
done
;
di
=
(
struct
dialog_info
*
)
GetWindowLongPtr
(
hDlg
,
DWLP_USER
);
di
=
(
struct
dialog_info
*
)
GetWindowLongPtrW
(
hDlg
,
DWLP_USER
);
switch
(
nmhdr
->
code
)
{
...
...
@@ -106,7 +106,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
idc
=
IDC_OPT_CURSOR_MEDIUM
;
else
idc
=
IDC_OPT_CURSOR_LARGE
;
PostMessage
(
hDlg
,
WM_NEXTDLGCTL
,
(
WPARAM
)
GetDlgItem
(
hDlg
,
idc
),
TRUE
);
PostMessageW
(
hDlg
,
WM_NEXTDLGCTL
,
(
WPARAM
)
GetDlgItem
(
hDlg
,
idc
),
TRUE
);
di
->
hDlg
=
hDlg
;
break
;
case
PSN_APPLY
:
...
...
@@ -129,7 +129,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
val
=
(
IsDlgButtonChecked
(
hDlg
,
IDC_OPT_QUICK_EDIT
)
&
BST_CHECKED
)
?
TRUE
:
FALSE
;
di
->
config
.
quick_edit
=
val
;
SetWindowLongPtr
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_NOERROR
);
SetWindowLongPtr
W
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_NOERROR
);
return
TRUE
;
default:
return
FALSE
;
...
...
@@ -152,12 +152,12 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
switch
(
msg
)
{
case
WM_CREATE
:
SetWindowLongPtr
(
hWnd
,
0
,
0
);
SetWindowLongPtr
W
(
hWnd
,
0
,
0
);
break
;
case
WM_GETFONT
:
return
GetWindowLongPtr
(
hWnd
,
0
);
return
GetWindowLongPtr
W
(
hWnd
,
0
);
case
WM_SETFONT
:
SetWindowLongPtr
(
hWnd
,
0
,
wParam
);
SetWindowLongPtr
W
(
hWnd
,
0
,
wParam
);
if
(
LOWORD
(
lParam
))
{
InvalidateRect
(
hWnd
,
NULL
,
TRUE
);
...
...
@@ -166,7 +166,7 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
break
;
case
WM_DESTROY
:
{
HFONT
hFont
=
(
HFONT
)
GetWindowLongPtr
(
hWnd
,
0L
);
HFONT
hFont
=
(
HFONT
)
GetWindowLongPtr
W
(
hWnd
,
0
);
if
(
hFont
)
DeleteObject
(
hFont
);
}
break
;
...
...
@@ -178,13 +178,13 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
struct
dialog_info
*
di
;
HFONT
hFont
,
hOldFont
;
di
=
(
struct
dialog_info
*
)
GetWindowLongPtr
(
GetParent
(
hWnd
),
DWLP_USER
);
di
=
(
struct
dialog_info
*
)
GetWindowLongPtr
W
(
GetParent
(
hWnd
),
DWLP_USER
);
BeginPaint
(
hWnd
,
&
ps
);
font_idx
=
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_GETCURSEL
,
0L
,
0L
);
size_idx
=
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_GETCURSEL
,
0L
,
0L
);
font_idx
=
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_GETCURSEL
,
0
,
0
);
size_idx
=
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_GETCURSEL
,
0
,
0
);
hFont
=
(
HFONT
)
GetWindowLongPtr
(
hWnd
,
0L
);
hFont
=
(
HFONT
)
GetWindowLongPtr
W
(
hWnd
,
0
);
if
(
hFont
)
{
WCHAR
ascii
[]
=
{
'A'
,
'S'
,
'C'
,
'I'
,
'I'
,
':'
,
' '
,
'a'
,
'b'
,
'c'
,
'X'
,
'Y'
,
'Z'
,
'\0'
};
...
...
@@ -192,13 +192,13 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
int
len
;
hOldFont
=
SelectObject
(
ps
.
hdc
,
hFont
);
SetBkColor
(
ps
.
hdc
,
WCUSER_ColorMap
[
GetWindowLong
(
GetDlgItem
(
di
->
hDlg
,
IDC_FNT_COLOR_BK
),
0
)]);
SetTextColor
(
ps
.
hdc
,
WCUSER_ColorMap
[
GetWindowLong
(
GetDlgItem
(
di
->
hDlg
,
IDC_FNT_COLOR_FG
),
0
)]);
len
=
LoadString
(
GetModuleHandle
(
NULL
),
IDS_FNT_PREVIEW
,
SetBkColor
(
ps
.
hdc
,
WCUSER_ColorMap
[
GetWindowLong
W
(
GetDlgItem
(
di
->
hDlg
,
IDC_FNT_COLOR_BK
),
0
)]);
SetTextColor
(
ps
.
hdc
,
WCUSER_ColorMap
[
GetWindowLong
W
(
GetDlgItem
(
di
->
hDlg
,
IDC_FNT_COLOR_FG
),
0
)]);
len
=
LoadString
W
(
GetModuleHandleW
(
NULL
),
IDS_FNT_PREVIEW
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]));
if
(
len
)
TextOut
(
ps
.
hdc
,
0
,
0
,
buf
,
len
);
TextOut
(
ps
.
hdc
,
0
,
di
->
font
[
size_idx
].
height
,
ascii
,
TextOut
W
(
ps
.
hdc
,
0
,
0
,
buf
,
len
);
TextOut
W
(
ps
.
hdc
,
0
,
di
->
font
[
size_idx
].
height
,
ascii
,
sizeof
(
ascii
)
/
sizeof
(
ascii
[
0
])
-
1
);
SelectObject
(
ps
.
hdc
,
hOldFont
);
}
...
...
@@ -206,7 +206,7 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam,
}
break
;
default:
return
DefWindowProc
(
hWnd
,
msg
,
wParam
,
lParam
);
return
DefWindowProcW
(
hWnd
,
msg
,
wParam
,
lParam
);
}
return
0L
;
}
...
...
@@ -240,7 +240,7 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam
hbr
=
CreateSolidBrush
(
WCUSER_ColorMap
[
i
]);
FillRect
(
ps
.
hdc
,
&
r
,
hbr
);
DeleteObject
(
hbr
);
if
(
GetWindowLong
(
hWnd
,
0
)
==
i
)
if
(
GetWindowLong
W
(
hWnd
,
0
)
==
i
)
{
HPEN
hOldPen
;
int
i
=
2
;
...
...
@@ -275,13 +275,13 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam
step
=
client
.
right
/
8
;
i
=
(
HIWORD
(
lParam
)
>=
client
.
bottom
/
2
)
?
8
:
0
;
i
+=
LOWORD
(
lParam
)
/
step
;
SetWindowLong
(
hWnd
,
0
,
i
);
SetWindowLong
W
(
hWnd
,
0
,
i
);
InvalidateRect
(
GetDlgItem
(
GetParent
(
hWnd
),
IDC_FNT_PREVIEW
),
NULL
,
FALSE
);
InvalidateRect
(
hWnd
,
NULL
,
FALSE
);
}
break
;
default:
return
DefWindowProc
(
hWnd
,
msg
,
wParam
,
lParam
);
return
DefWindowProcW
(
hWnd
,
msg
,
wParam
,
lParam
);
}
return
0L
;
}
...
...
@@ -291,7 +291,7 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam
*
* enumerates all the font names with at least one valid font
*/
static
int
CALLBACK
font_enum_size2
(
const
LOGFONT
*
lf
,
const
TEXTMETRIC
*
tm
,
static
int
CALLBACK
font_enum_size2
(
const
LOGFONT
W
*
lf
,
const
TEXTMETRICW
*
tm
,
DWORD
FontType
,
LPARAM
lParam
)
{
struct
dialog_info
*
di
=
(
struct
dialog_info
*
)
lParam
;
...
...
@@ -305,7 +305,7 @@ static int CALLBACK font_enum_size2(const LOGFONT* lf, const TEXTMETRIC* tm,
return
1
;
}
static
int
CALLBACK
font_enum
(
const
LOGFONT
*
lf
,
const
TEXTMETRIC
*
tm
,
static
int
CALLBACK
font_enum
(
const
LOGFONT
W
*
lf
,
const
TEXTMETRICW
*
tm
,
DWORD
FontType
,
LPARAM
lParam
)
{
struct
dialog_info
*
di
=
(
struct
dialog_info
*
)
lParam
;
...
...
@@ -316,14 +316,14 @@ static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm,
if
(
FontType
&
RASTER_FONTTYPE
)
{
di
->
nFont
=
0
;
EnumFontFamilies
(
PRIVATE
(
di
->
data
)
->
hMemDC
,
lf
->
lfFaceName
,
font_enum_size2
,
(
LPARAM
)
di
);
EnumFontFamilies
W
(
PRIVATE
(
di
->
data
)
->
hMemDC
,
lf
->
lfFaceName
,
font_enum_size2
,
(
LPARAM
)
di
);
}
else
di
->
nFont
=
1
;
if
(
di
->
nFont
)
{
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_ADDSTRING
,
SendDlgItemMessageW
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
lf
->
lfFaceName
);
}
}
...
...
@@ -336,7 +336,7 @@ static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm,
*
*
*/
static
int
CALLBACK
font_enum_size
(
const
LOGFONT
*
lf
,
const
TEXTMETRIC
*
tm
,
static
int
CALLBACK
font_enum_size
(
const
LOGFONT
W
*
lf
,
const
TEXTMETRICW
*
tm
,
DWORD
FontType
,
LPARAM
lParam
)
{
struct
dialog_info
*
di
=
(
struct
dialog_info
*
)
lParam
;
...
...
@@ -361,9 +361,9 @@ static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm,
}
di
->
font
[
i
].
height
=
sizes
[
i
];
di
->
font
[
i
].
weight
=
400
;
lstrcpy
(
di
->
font
[
i
].
faceName
,
lf
->
lfFaceName
);
wsprintf
(
buf
,
fmt
,
sizes
[
i
]);
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_INSERTSTRING
,
i
,
(
LPARAM
)
buf
);
lstrcpy
W
(
di
->
font
[
i
].
faceName
,
lf
->
lfFaceName
);
wsprintf
W
(
buf
,
fmt
,
sizes
[
i
]);
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_INSERTSTRING
,
i
,
(
LPARAM
)
buf
);
}
/* don't need to enumerate other */
return
0
;
...
...
@@ -386,8 +386,8 @@ static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm,
tm
->
tmWeight
<
di
->
font
[
idx
].
weight
)
{
/* here we need to add the new entry */
wsprintf
(
buf
,
fmt
,
tm
->
tmHeight
);
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_INSERTSTRING
,
idx
,
(
LPARAM
)
buf
);
wsprintf
W
(
buf
,
fmt
,
tm
->
tmHeight
);
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_INSERTSTRING
,
idx
,
(
LPARAM
)
buf
);
/* now grow our arrays and insert the values at the same index than in the list box */
if
(
di
->
nFont
)
...
...
@@ -400,7 +400,7 @@ static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm,
di
->
font
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
di
->
font
));
di
->
font
[
idx
].
height
=
tm
->
tmHeight
;
di
->
font
[
idx
].
weight
=
tm
->
tmWeight
;
lstrcpy
(
di
->
font
[
idx
].
faceName
,
lf
->
lfFaceName
);
lstrcpy
W
(
di
->
font
[
idx
].
faceName
,
lf
->
lfFaceName
);
di
->
nFont
++
;
}
}
...
...
@@ -417,12 +417,12 @@ static BOOL select_font(struct dialog_info* di)
int
font_idx
,
size_idx
;
WCHAR
buf
[
256
];
WCHAR
fmt
[
128
];
LOGFONT
lf
;
LOGFONT
W
lf
;
HFONT
hFont
,
hOldFont
;
struct
config_data
config
;
font_idx
=
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_GETCURSEL
,
0L
,
0L
);
size_idx
=
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_GETCURSEL
,
0L
,
0L
);
font_idx
=
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_GETCURSEL
,
0
,
0
);
size_idx
=
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_GETCURSEL
,
0
,
0
);
if
(
font_idx
<
0
||
size_idx
<
0
||
size_idx
>=
di
->
nFont
)
return
FALSE
;
...
...
@@ -435,15 +435,15 @@ static BOOL select_font(struct dialog_info* di)
if
(
config
.
cell_height
!=
di
->
font
[
size_idx
].
height
)
WINE_TRACE
(
"mismatched heights (%u<>%u)
\n
"
,
config
.
cell_height
,
di
->
font
[
size_idx
].
height
);
hOldFont
=
(
HFONT
)
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_PREVIEW
,
WM_GETFONT
,
0L
,
0L
);
hOldFont
=
(
HFONT
)
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_PREVIEW
,
WM_GETFONT
,
0
,
0
);
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_PREVIEW
,
WM_SETFONT
,
(
WPARAM
)
hFont
,
TRUE
);
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_PREVIEW
,
WM_SETFONT
,
(
WPARAM
)
hFont
,
TRUE
);
if
(
hOldFont
)
DeleteObject
(
hOldFont
);
LoadString
(
GetModuleHandle
(
NULL
),
IDS_FNT_DISPLAY
,
fmt
,
sizeof
(
fmt
)
/
sizeof
(
WCHAR
));
wsprintf
(
buf
,
fmt
,
config
.
cell_width
,
config
.
cell_height
);
LoadString
W
(
GetModuleHandleW
(
NULL
),
IDS_FNT_DISPLAY
,
fmt
,
sizeof
(
fmt
)
/
sizeof
(
fmt
[
0
]
));
wsprintf
W
(
buf
,
fmt
,
config
.
cell_width
,
config
.
cell_height
);
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_FONT_INFO
,
WM_SETTEXT
,
0
,
(
LPARAM
)
buf
);
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_FONT_INFO
,
WM_SETTEXT
,
0
,
(
LPARAM
)
buf
);
return
TRUE
;
}
...
...
@@ -458,16 +458,16 @@ static BOOL fill_list_size(struct dialog_info* di, BOOL doInit)
int
idx
;
WCHAR
lfFaceName
[
LF_FACESIZE
];
idx
=
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_GETCURSEL
,
0L
,
0L
);
idx
=
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_GETCURSEL
,
0
,
0
);
if
(
idx
<
0
)
return
FALSE
;
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_GETTEXT
,
idx
,
(
LPARAM
)
lfFaceName
);
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_RESETCONTENT
,
0L
,
0L
);
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_GETTEXT
,
idx
,
(
LPARAM
)
lfFaceName
);
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_RESETCONTENT
,
0
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
di
->
font
);
di
->
nFont
=
0
;
di
->
font
=
NULL
;
EnumFontFamilies
(
PRIVATE
(
di
->
data
)
->
hMemDC
,
lfFaceName
,
font_enum_size
,
(
LPARAM
)
di
);
EnumFontFamilies
W
(
PRIVATE
(
di
->
data
)
->
hMemDC
,
lfFaceName
,
font_enum_size
,
(
LPARAM
)
di
);
if
(
doInit
)
{
...
...
@@ -475,7 +475,7 @@ static BOOL fill_list_size(struct dialog_info* di, BOOL doInit)
for
(
idx
=
0
;
idx
<
di
->
nFont
;
idx
++
)
{
if
(
!
lstrcmp
(
di
->
font
[
idx
].
faceName
,
di
->
config
.
face_name
)
&&
if
(
!
lstrcmp
W
(
di
->
font
[
idx
].
faceName
,
di
->
config
.
face_name
)
&&
di
->
font
[
idx
].
height
==
di
->
config
.
cell_height
&&
di
->
font
[
idx
].
weight
==
di
->
config
.
font_weight
)
{
...
...
@@ -487,7 +487,7 @@ static BOOL fill_list_size(struct dialog_info* di, BOOL doInit)
}
else
idx
=
0
;
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_SETCURSEL
,
idx
,
0L
);
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_SETCURSEL
,
idx
,
0
);
select_font
(
di
);
return
TRUE
;
}
...
...
@@ -499,11 +499,11 @@ static BOOL fill_list_size(struct dialog_info* di, BOOL doInit)
*/
static
BOOL
fill_list_font
(
struct
dialog_info
*
di
)
{
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_RESETCONTENT
,
0L
,
0L
);
EnumFontFamilies
(
PRIVATE
(
di
->
data
)
->
hMemDC
,
NULL
,
font_enum
,
(
LPARAM
)
di
);
if
(
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_SELECTSTRING
,
(
WPARAM
)
-
1
,
(
LPARAM
)
di
->
config
.
face_name
)
==
LB_ERR
)
SendDlgItemMessage
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_SETCURSEL
,
0L
,
0L
);
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_RESETCONTENT
,
0
,
0
);
EnumFontFamilies
W
(
PRIVATE
(
di
->
data
)
->
hMemDC
,
NULL
,
font_enum
,
(
LPARAM
)
di
);
if
(
SendDlgItemMessage
W
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_SELECTSTRING
,
-
1
,
(
LPARAM
)
di
->
config
.
face_name
)
==
LB_ERR
)
SendDlgItemMessageW
(
di
->
hDlg
,
IDC_FNT_LIST_FONT
,
LB_SETCURSEL
,
0
,
0
);
fill_list_size
(
di
,
TRUE
);
return
TRUE
;
}
...
...
@@ -522,15 +522,15 @@ static INT_PTR WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
case
WM_INITDIALOG
:
di
=
(
struct
dialog_info
*
)((
PROPSHEETPAGEA
*
)
lParam
)
->
lParam
;
di
->
hDlg
=
hDlg
;
SetWindowLongPtr
(
hDlg
,
DWLP_USER
,
(
DWORD_PTR
)
di
);
SetWindowLongPtrW
(
hDlg
,
DWLP_USER
,
(
DWORD_PTR
)
di
);
/* remove dialog from this control, font will be reset when listboxes are filled */
SendDlgItemMessage
(
hDlg
,
IDC_FNT_PREVIEW
,
WM_SETFONT
,
0L
,
0L
);
SendDlgItemMessage
W
(
hDlg
,
IDC_FNT_PREVIEW
,
WM_SETFONT
,
0
,
0
);
fill_list_font
(
di
);
SetWindowLong
(
GetDlgItem
(
hDlg
,
IDC_FNT_COLOR_BK
),
0
,
(
di
->
config
.
def_attr
>>
4
)
&
0x0F
);
SetWindowLong
(
GetDlgItem
(
hDlg
,
IDC_FNT_COLOR_FG
),
0
,
di
->
config
.
def_attr
&
0x0F
);
SetWindowLong
W
(
GetDlgItem
(
hDlg
,
IDC_FNT_COLOR_BK
),
0
,
(
di
->
config
.
def_attr
>>
4
)
&
0x0F
);
SetWindowLong
W
(
GetDlgItem
(
hDlg
,
IDC_FNT_COLOR_FG
),
0
,
di
->
config
.
def_attr
&
0x0F
);
break
;
case
WM_COMMAND
:
di
=
(
struct
dialog_info
*
)
GetWindowLongPtr
(
hDlg
,
DWLP_USER
);
di
=
(
struct
dialog_info
*
)
GetWindowLongPtrW
(
hDlg
,
DWLP_USER
);
switch
(
LOWORD
(
wParam
))
{
case
IDC_FNT_LIST_FONT
:
...
...
@@ -552,18 +552,18 @@ static INT_PTR WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
NMHDR
*
nmhdr
=
(
NMHDR
*
)
lParam
;
DWORD
val
;
di
=
(
struct
dialog_info
*
)
GetWindowLongPtr
(
hDlg
,
DWLP_USER
);
di
=
(
struct
dialog_info
*
)
GetWindowLongPtrW
(
hDlg
,
DWLP_USER
);
switch
(
nmhdr
->
code
)
{
case
PSN_SETACTIVE
:
di
->
hDlg
=
hDlg
;
break
;
case
PSN_APPLY
:
val
=
SendDlgItemMessage
(
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_GETCURSEL
,
0L
,
0L
);
val
=
SendDlgItemMessageW
(
hDlg
,
IDC_FNT_LIST_SIZE
,
LB_GETCURSEL
,
0
,
0
);
if
(
val
<
di
->
nFont
)
{
LOGFONT
lf
;
LOGFONT
W
lf
;
WCUSER_FillLogFont
(
&
lf
,
di
->
font
[
val
].
faceName
,
di
->
font
[
val
].
height
,
di
->
font
[
val
].
weight
);
...
...
@@ -571,11 +571,11 @@ static INT_PTR WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
di
->
data
->
hWnd
,
&
lf
,
NULL
));
}
val
=
(
GetWindowLong
(
GetDlgItem
(
hDlg
,
IDC_FNT_COLOR_BK
),
0
)
<<
4
)
|
GetWindowLong
(
GetDlgItem
(
hDlg
,
IDC_FNT_COLOR_FG
),
0
);
val
=
(
GetWindowLong
W
(
GetDlgItem
(
hDlg
,
IDC_FNT_COLOR_BK
),
0
)
<<
4
)
|
GetWindowLongW
(
GetDlgItem
(
hDlg
,
IDC_FNT_COLOR_FG
),
0
);
di
->
config
.
def_attr
=
val
;
SetWindowLongPtr
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_NOERROR
);
SetWindowLongPtr
W
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_NOERROR
);
return
TRUE
;
default:
return
FALSE
;
...
...
@@ -604,34 +604,31 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
di
=
(
struct
dialog_info
*
)((
PROPSHEETPAGEA
*
)
lParam
)
->
lParam
;
di
->
hDlg
=
hDlg
;
SetWindowLongPtr
(
hDlg
,
DWLP_USER
,
(
DWORD_PTR
)
di
);
SetWindowLongPtr
W
(
hDlg
,
DWLP_USER
,
(
DWORD_PTR
)
di
);
SetDlgItemInt
(
hDlg
,
IDC_CNF_SB_WIDTH
,
di
->
config
.
sb_width
,
FALSE
);
SetDlgItemInt
(
hDlg
,
IDC_CNF_SB_HEIGHT
,
di
->
config
.
sb_height
,
FALSE
);
SetDlgItemInt
(
hDlg
,
IDC_CNF_WIN_WIDTH
,
di
->
config
.
win_width
,
FALSE
);
SetDlgItemInt
(
hDlg
,
IDC_CNF_WIN_HEIGHT
,
di
->
config
.
win_height
,
FALSE
);
SendMessage
(
GetDlgItem
(
hDlg
,
IDC_CNF_WIN_HEIGHT_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
nMaxUD
,
0
));
SendMessage
(
GetDlgItem
(
hDlg
,
IDC_CNF_WIN_WIDTH_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
nMaxUD
,
0
));
SendMessage
(
GetDlgItem
(
hDlg
,
IDC_CNF_SB_HEIGHT_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
nMaxUD
,
0
));
SendMessage
(
GetDlgItem
(
hDlg
,
IDC_CNF_SB_WIDTH_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
nMaxUD
,
0
));
SendMessage
W
(
GetDlgItem
(
hDlg
,
IDC_CNF_WIN_HEIGHT_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
nMaxUD
,
0
));
SendMessage
W
(
GetDlgItem
(
hDlg
,
IDC_CNF_WIN_WIDTH_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
nMaxUD
,
0
));
SendMessage
W
(
GetDlgItem
(
hDlg
,
IDC_CNF_SB_HEIGHT_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
nMaxUD
,
0
));
SendMessage
W
(
GetDlgItem
(
hDlg
,
IDC_CNF_SB_WIDTH_UD
),
UDM_SETRANGE
,
0
,
MAKELPARAM
(
nMaxUD
,
0
));
SendDlgItemMessage
(
hDlg
,
IDC_CNF_CLOSE_EXIT
,
BM_SETCHECK
,
(
di
->
config
.
exit_on_die
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0L
);
SendDlgItemMessage
W
(
hDlg
,
IDC_CNF_CLOSE_EXIT
,
BM_SETCHECK
,
(
di
->
config
.
exit_on_die
)
?
BST_CHECKED
:
BST_UNCHECKED
,
0
);
{
static
const
WCHAR
s1
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
s2
[]
=
{
'E'
,
'm'
,
'a'
,
'c'
,
's'
,
0
};
SendDlgItemMessage
(
hDlg
,
IDC_CNF_EDITION_MODE
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
s1
);
SendDlgItemMessage
(
hDlg
,
IDC_CNF_EDITION_MODE
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
s2
);
SendDlgItemMessage
(
hDlg
,
IDC_CNF_EDITION_MODE
,
CB_SETCURSEL
,
di
->
config
.
edition_mode
,
0
);
SendDlgItemMessageW
(
hDlg
,
IDC_CNF_EDITION_MODE
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
s1
);
SendDlgItemMessageW
(
hDlg
,
IDC_CNF_EDITION_MODE
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
s2
);
SendDlgItemMessageW
(
hDlg
,
IDC_CNF_EDITION_MODE
,
CB_SETCURSEL
,
di
->
config
.
edition_mode
,
0
);
}
break
;
case
WM_COMMAND
:
di
=
(
struct
dialog_info
*
)
GetWindowLongPtr
(
hDlg
,
DWLP_USER
);
di
=
(
struct
dialog_info
*
)
GetWindowLongPtrW
(
hDlg
,
DWLP_USER
);
switch
(
LOWORD
(
wParam
))
{
}
...
...
@@ -642,7 +639,7 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
int
win_w
,
win_h
,
sb_w
,
sb_h
;
BOOL
st1
,
st2
;
di
=
(
struct
dialog_info
*
)
GetWindowLongPtr
(
hDlg
,
DWLP_USER
);
di
=
(
struct
dialog_info
*
)
GetWindowLongPtrW
(
hDlg
,
DWLP_USER
);
switch
(
nmhdr
->
code
)
{
case
PSN_SETACTIVE
:
...
...
@@ -653,14 +650,14 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
sb_h
=
GetDlgItemInt
(
hDlg
,
IDC_CNF_SB_HEIGHT
,
&
st2
,
FALSE
);
if
(
!
st1
||
!
st2
)
{
SetWindowLongPtr
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_INVALID
);
SetWindowLongPtr
W
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_INVALID
);
return
TRUE
;
}
win_w
=
GetDlgItemInt
(
hDlg
,
IDC_CNF_WIN_WIDTH
,
&
st1
,
FALSE
);
win_h
=
GetDlgItemInt
(
hDlg
,
IDC_CNF_WIN_HEIGHT
,
&
st2
,
FALSE
);
if
(
!
st1
||
!
st2
)
{
SetWindowLongPtr
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_INVALID
);
SetWindowLongPtr
W
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_INVALID
);
return
TRUE
;
}
if
(
win_w
>
sb_w
||
win_h
>
sb_h
)
...
...
@@ -668,13 +665,13 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
WCHAR
cap
[
256
];
WCHAR
txt
[
256
];
LoadString
(
GetModuleHandle
(
NULL
),
IDS_DLG_TIT_ERROR
,
cap
,
sizeof
(
cap
)
/
sizeof
(
WCHAR
));
LoadString
(
GetModuleHandle
(
NULL
),
IDS_DLG_ERR_SBWINSIZE
,
txt
,
sizeof
(
txt
)
/
sizeof
(
WCHAR
));
LoadString
W
(
GetModuleHandleW
(
NULL
),
IDS_DLG_TIT_ERROR
,
cap
,
sizeof
(
cap
)
/
sizeof
(
cap
[
0
]
));
LoadString
W
(
GetModuleHandleW
(
NULL
),
IDS_DLG_ERR_SBWINSIZE
,
txt
,
sizeof
(
txt
)
/
sizeof
(
cap
[
0
]
));
MessageBox
(
hDlg
,
txt
,
cap
,
MB_OK
);
SetWindowLongPtr
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_INVALID
);
MessageBox
W
(
hDlg
,
txt
,
cap
,
MB_OK
);
SetWindowLongPtr
W
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_INVALID
);
return
TRUE
;
}
di
->
config
.
win_width
=
win_w
;
...
...
@@ -683,9 +680,9 @@ static INT_PTR WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
di
->
config
.
sb_height
=
sb_h
;
di
->
config
.
exit_on_die
=
IsDlgButtonChecked
(
hDlg
,
IDC_CNF_CLOSE_EXIT
)
?
1
:
0
;
di
->
config
.
edition_mode
=
SendDlgItemMessage
(
hDlg
,
IDC_CNF_EDITION_MODE
,
CB_GETCURSEL
,
0
,
0
);
SetWindowLongPtr
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_NOERROR
);
di
->
config
.
edition_mode
=
SendDlgItemMessage
W
(
hDlg
,
IDC_CNF_EDITION_MODE
,
CB_GETCURSEL
,
0
,
0
);
SetWindowLongPtr
W
(
hDlg
,
DWLP_MSGRESULT
,
PSNRET_NOERROR
);
return
TRUE
;
default:
return
FALSE
;
...
...
@@ -709,7 +706,7 @@ static INT_PTR WINAPI WCUSER_SaveDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
switch
(
msg
)
{
case
WM_INITDIALOG
:
SendDlgItemMessage
(
hDlg
,
IDC_SAV_SESSION
,
BM_SETCHECK
,
BST_CHECKED
,
0
);
SendDlgItemMessage
W
(
hDlg
,
IDC_SAV_SESSION
,
BM_SETCHECK
,
BST_CHECKED
,
0
);
break
;
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
))
...
...
@@ -737,10 +734,10 @@ static INT_PTR WINAPI WCUSER_SaveDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
BOOL
WCUSER_GetProperties
(
struct
inner_data
*
data
,
BOOL
current
)
{
HPROPSHEETPAGE
psPage
[
3
];
PROPSHEETPAGE
psp
;
PROPSHEETHEADER
psHead
;
PROPSHEETPAGE
W
psp
;
PROPSHEETHEADER
W
psHead
;
WCHAR
buff
[
256
];
WNDCLASS
wndclass
;
WNDCLASS
W
wndclass
;
static
const
WCHAR
szFntPreview
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'C'
,
'o'
,
'n'
,
'F'
,
'o'
,
'n'
,
't'
,
'P'
,
'r'
,
'e'
,
'v'
,
'i'
,
'e'
,
'w'
,
0
};
static
const
WCHAR
szColorPreview
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'C'
,
'o'
,
'n'
,
'C'
,
'o'
,
'l'
,
'o'
,
'r'
,
'P'
,
'r'
,
'e'
,
'v'
,
'i'
,
'e'
,
'w'
,
0
};
struct
dialog_info
di
;
...
...
@@ -771,25 +768,25 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current)
wndclass
.
lpfnWndProc
=
WCUSER_FontPreviewProc
;
wndclass
.
cbClsExtra
=
0
;
wndclass
.
cbWndExtra
=
sizeof
(
DWORD_PTR
);
/* for hFont */
wndclass
.
hInstance
=
GetModuleHandle
(
NULL
);
wndclass
.
hInstance
=
GetModuleHandle
W
(
NULL
);
wndclass
.
hIcon
=
0
;
wndclass
.
hCursor
=
LoadCursor
(
0
,
IDC_ARROW
);
wndclass
.
hCursor
=
LoadCursor
W
(
0
,
(
LPCWSTR
)
IDC_ARROW
);
wndclass
.
hbrBackground
=
GetStockObject
(
BLACK_BRUSH
);
wndclass
.
lpszMenuName
=
NULL
;
wndclass
.
lpszClassName
=
szFntPreview
;
RegisterClass
(
&
wndclass
);
RegisterClass
W
(
&
wndclass
);
wndclass
.
style
=
0
;
wndclass
.
lpfnWndProc
=
WCUSER_ColorPreviewProc
;
wndclass
.
cbClsExtra
=
0
;
wndclass
.
cbWndExtra
=
sizeof
(
DWORD
);
wndclass
.
hInstance
=
GetModuleHandle
(
NULL
);
wndclass
.
hInstance
=
GetModuleHandle
W
(
NULL
);
wndclass
.
hIcon
=
0
;
wndclass
.
hCursor
=
LoadCursor
(
0
,
IDC_ARROW
);
wndclass
.
hCursor
=
LoadCursor
W
(
0
,
(
LPCWSTR
)
IDC_ARROW
);
wndclass
.
hbrBackground
=
GetStockObject
(
BLACK_BRUSH
);
wndclass
.
lpszMenuName
=
NULL
;
wndclass
.
lpszClassName
=
szColorPreview
;
RegisterClass
(
&
wndclass
);
RegisterClass
W
(
&
wndclass
);
memset
(
&
psp
,
0
,
sizeof
(
psp
));
psp
.
dwSize
=
sizeof
(
psp
);
...
...
@@ -797,22 +794,22 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current)
psp
.
hInstance
=
wndclass
.
hInstance
;
psp
.
lParam
=
(
LPARAM
)
&
di
;
psp
.
u
.
pszTemplate
=
MAKEINTRESOURCE
(
IDD_OPTION
);
psp
.
u
.
pszTemplate
=
MAKEINTRESOURCE
W
(
IDD_OPTION
);
psp
.
pfnDlgProc
=
WCUSER_OptionDlgProc
;
psPage
[
0
]
=
CreatePropertySheetPage
(
&
psp
);
psPage
[
0
]
=
CreatePropertySheetPage
W
(
&
psp
);
psp
.
u
.
pszTemplate
=
MAKEINTRESOURCE
(
IDD_FONT
);
psp
.
u
.
pszTemplate
=
MAKEINTRESOURCE
W
(
IDD_FONT
);
psp
.
pfnDlgProc
=
WCUSER_FontDlgProc
;
psPage
[
1
]
=
CreatePropertySheetPage
(
&
psp
);
psPage
[
1
]
=
CreatePropertySheetPage
W
(
&
psp
);
psp
.
u
.
pszTemplate
=
MAKEINTRESOURCE
(
IDD_CONFIG
);
psp
.
u
.
pszTemplate
=
MAKEINTRESOURCE
W
(
IDD_CONFIG
);
psp
.
pfnDlgProc
=
WCUSER_ConfigDlgProc
;
psPage
[
2
]
=
CreatePropertySheetPage
(
&
psp
);
psPage
[
2
]
=
CreatePropertySheetPage
W
(
&
psp
);
memset
(
&
psHead
,
0
,
sizeof
(
psHead
));
psHead
.
dwSize
=
sizeof
(
psHead
);
if
(
!
LoadString
(
GetModuleHandle
(
NULL
),
if
(
!
LoadString
W
(
GetModuleHandleW
(
NULL
),
(
current
)
?
IDS_DLG_TIT_CURRENT
:
IDS_DLG_TIT_DEFAULT
,
buff
,
sizeof
(
buff
)
/
sizeof
(
buff
[
0
])))
{
...
...
@@ -832,7 +829,7 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current)
WINECON_DumpConfig
(
"init"
,
refcfg
);
PropertySheet
(
&
psHead
);
PropertySheet
W
(
&
psHead
);
if
(
memcmp
(
refcfg
,
&
di
.
config
,
sizeof
(
*
refcfg
))
==
0
)
return
TRUE
;
...
...
@@ -841,7 +838,7 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current)
WINECON_DumpConfig
(
"cur"
,
&
di
.
config
);
if
(
refcfg
==
&
data
->
curcfg
)
{
switch
(
DialogBox
(
GetModuleHandle
(
NULL
),
MAKEINTRESOURCE
(
IDD_SAVE_SETTINGS
),
switch
(
DialogBox
W
(
GetModuleHandleW
(
NULL
),
MAKEINTRESOURCEW
(
IDD_SAVE_SETTINGS
),
data
->
hWnd
,
WCUSER_SaveDlgProc
))
{
case
IDC_SAV_SAVE
:
save
=
TRUE
;
modify_session
=
TRUE
;
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