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
bf0f6a22
Commit
bf0f6a22
authored
Mar 24, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure there's only one place we allocate dialog controls.
parent
c3ab871f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
53 deletions
+37
-53
dialog.c
dlls/msi/dialog.c
+37
-53
No files found.
dlls/msi/dialog.c
View file @
bf0f6a22
...
...
@@ -226,17 +226,16 @@ static UINT msi_dialog_build_font_list( msi_dialog *dialog )
return
r
;
}
static
msi_control
*
msi_dialog_add_control
(
msi_dialog
*
dialog
,
MSIRECORD
*
rec
,
LPCWSTR
szCls
,
DWORD
style
)
static
msi_control
*
msi_dialog_create_window
(
msi_dialog
*
dialog
,
MSIRECORD
*
rec
,
LPCWSTR
szCls
,
LPCWSTR
name
,
LPCWSTR
text
,
DWORD
style
,
HWND
parent
)
{
DWORD
x
,
y
,
width
,
height
,
attributes
;
LPCWSTR
text
,
name
;
DWORD
x
,
y
,
width
,
height
;
LPWSTR
font
=
NULL
,
title
=
NULL
;
msi_control
*
control
=
NULL
;
msi_control
*
control
;
style
|=
WS_CHILD
|
WS_GROUP
;
name
=
MSI_RecordGetString
(
rec
,
2
);
control
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
control
+
strlenW
(
name
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
control
->
name
,
name
);
...
...
@@ -249,34 +248,51 @@ static msi_control *msi_dialog_add_control( msi_dialog *dialog,
y
=
MSI_RecordGetInteger
(
rec
,
5
);
width
=
MSI_RecordGetInteger
(
rec
,
6
);
height
=
MSI_RecordGetInteger
(
rec
,
7
);
attributes
=
MSI_RecordGetInteger
(
rec
,
8
);
text
=
MSI_RecordGetString
(
rec
,
10
);
TRACE
(
"Dialog %s control %s
\n
"
,
debugstr_w
(
dialog
->
name
),
debugstr_w
(
text
));
x
=
msi_dialog_scale_unit
(
dialog
,
x
);
y
=
msi_dialog_scale_unit
(
dialog
,
y
);
width
=
msi_dialog_scale_unit
(
dialog
,
width
);
height
=
msi_dialog_scale_unit
(
dialog
,
height
);
if
(
attributes
&
1
)
style
|=
WS_VISIBLE
;
if
(
~
attributes
&
2
)
style
|=
WS_DISABLED
;
if
(
text
)
{
font
=
msi_dialog_get_style
(
&
text
);
deformat_string
(
dialog
->
package
,
text
,
&
title
);
}
control
->
hwnd
=
CreateWindowW
(
szCls
,
title
,
style
,
x
,
y
,
width
,
height
,
dialog
->
hwnd
,
NULL
,
NULL
,
NULL
);
x
,
y
,
width
,
height
,
parent
,
NULL
,
NULL
,
NULL
);
TRACE
(
"Dialog %s control %s hwnd %p
\n
"
,
debugstr_w
(
dialog
->
name
),
debugstr_w
(
text
),
control
->
hwnd
);
msi_dialog_set_font
(
dialog
,
control
->
hwnd
,
font
?
font
:
dialog
->
default_font
);
HeapFree
(
GetProcessHeap
(),
0
,
font
);
HeapFree
(
GetProcessHeap
(),
0
,
title
);
return
control
;
}
/* everything except radio buttons */
static
msi_control
*
msi_dialog_add_control
(
msi_dialog
*
dialog
,
MSIRECORD
*
rec
,
LPCWSTR
szCls
,
DWORD
style
)
{
DWORD
attributes
;
LPCWSTR
text
,
name
;
name
=
MSI_RecordGetString
(
rec
,
2
);
attributes
=
MSI_RecordGetInteger
(
rec
,
8
);
text
=
MSI_RecordGetString
(
rec
,
10
);
if
(
attributes
&
1
)
style
|=
WS_VISIBLE
;
if
(
~
attributes
&
2
)
style
|=
WS_DISABLED
;
return
msi_dialog_create_window
(
dialog
,
rec
,
szCls
,
name
,
text
,
style
,
dialog
->
hwnd
);
}
static
UINT
msi_dialog_text_control
(
msi_dialog
*
dialog
,
MSIRECORD
*
rec
)
{
TRACE
(
"%p %p
\n
"
,
dialog
,
rec
);
...
...
@@ -327,7 +343,7 @@ static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec )
{
const
static
WCHAR
szEdit
[]
=
{
'E'
,
'D'
,
'I'
,
'T'
,
0
};
TRAC
E
(
"%p %p
\n
"
,
dialog
,
rec
);
FIXM
E
(
"%p %p
\n
"
,
dialog
,
rec
);
msi_dialog_add_control
(
dialog
,
rec
,
szEdit
,
WS_BORDER
|
ES_MULTILINE
|
WS_VSCROLL
|
ES_READONLY
|
ES_AUTOVSCROLL
);
...
...
@@ -377,58 +393,26 @@ static UINT msi_dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec )
return
msi_dialog_edit_control
(
dialog
,
rec
);
}
/* radio buttons are a bit different to a normal control */
static
UINT
msi_dialog_create_radiobutton
(
MSIRECORD
*
rec
,
LPVOID
param
)
{
radio_button_group_descr
*
group
=
(
radio_button_group_descr
*
)
param
;
msi_dialog
*
dialog
=
group
->
dialog
;
msi_control
*
control
;
LPCWSTR
prop
;
DWORD
x
,
y
,
width
,
height
,
style
;
LPCWSTR
prop
,
text
,
name
;
DWORD
style
;
DWORD
attributes
=
group
->
attributes
;
LPCWSTR
text
,
name
;
LPWSTR
font
=
NULL
,
title
=
NULL
;
style
=
WS_CHILD
|
BS_AUTORADIOBUTTON
|
BS_MULTILINE
;
name
=
MSI_RecordGetString
(
rec
,
3
);
control
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
control
+
strlenW
(
name
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
control
->
name
,
name
);
control
->
next
=
dialog
->
control_list
;
dialog
->
control_list
=
control
;
x
=
MSI_RecordGetInteger
(
rec
,
4
);
y
=
MSI_RecordGetInteger
(
rec
,
5
);
width
=
MSI_RecordGetInteger
(
rec
,
6
);
height
=
MSI_RecordGetInteger
(
rec
,
7
);
text
=
MSI_RecordGetString
(
rec
,
8
);
x
=
msi_dialog_scale_unit
(
dialog
,
x
);
y
=
msi_dialog_scale_unit
(
dialog
,
y
);
width
=
msi_dialog_scale_unit
(
dialog
,
width
);
height
=
msi_dialog_scale_unit
(
dialog
,
height
);
if
(
attributes
&
1
)
style
|=
WS_VISIBLE
;
if
(
~
attributes
&
2
)
style
|=
WS_DISABLED
;
if
(
text
)
{
font
=
msi_dialog_get_style
(
&
text
);
deformat_string
(
dialog
->
package
,
text
,
&
title
);
}
control
->
hwnd
=
CreateWindowW
(
szButton
,
title
,
style
,
x
,
y
,
width
,
height
,
group
->
parent
->
hwnd
,
NULL
,
NULL
,
NULL
);
TRACE
(
"Dialog %s control %s hwnd %p
\n
"
,
debugstr_w
(
dialog
->
name
),
debugstr_w
(
text
),
control
->
hwnd
);
msi_dialog_set_font
(
dialog
,
control
->
hwnd
,
font
?
font
:
dialog
->
default_font
);
HeapFree
(
GetProcessHeap
(),
0
,
font
);
HeapFree
(
GetProcessHeap
(),
0
,
title
);
control
=
msi_dialog_create_window
(
dialog
,
rec
,
szButton
,
name
,
text
,
style
,
group
->
parent
->
hwnd
);
control
->
handler
=
msi_dialog_radiogroup_handler
;
prop
=
MSI_RecordGetString
(
rec
,
1
);
...
...
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