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
8f691adf
Commit
8f691adf
authored
Sep 01, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Sep 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Load and display the VolumeCostList control's column headers.
parent
1cfdc518
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
dialog.c
dlls/msi/dialog.c
+85
-0
No files found.
dlls/msi/dialog.c
View file @
8f691adf
...
...
@@ -408,6 +408,24 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog,
return
control
;
}
static
LPWSTR
msi_dialog_get_uitext
(
msi_dialog
*
dialog
,
LPCWSTR
key
)
{
MSIRECORD
*
rec
;
LPWSTR
text
;
static
const
WCHAR
query
[]
=
{
's'
,
'e'
,
'l'
,
'e'
,
'c'
,
't'
,
' '
,
'*'
,
' '
,
'f'
,
'r'
,
'o'
,
'm'
,
' '
,
'`'
,
'U'
,
'I'
,
'T'
,
'e'
,
'x'
,
't'
,
'`'
,
' '
,
'w'
,
'h'
,
'e'
,
'r'
,
'e'
,
' '
,
'`'
,
'K'
,
'e'
,
'y'
,
'`'
,
' '
,
'='
,
' '
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
rec
=
MSI_QueryGetRecord
(
dialog
->
package
->
db
,
query
,
key
);
if
(
!
rec
)
return
NULL
;
text
=
strdupW
(
MSI_RecordGetString
(
rec
,
2
)
);
msiobj_release
(
&
rec
->
hdr
);
return
text
;
}
static
MSIRECORD
*
msi_get_binary_record
(
MSIDATABASE
*
db
,
LPCWSTR
name
)
{
static
const
WCHAR
query
[]
=
{
...
...
@@ -2138,6 +2156,71 @@ static UINT msi_dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec )
/******************** VolumeCost List ***************************************/
static
BOOL
str_is_number
(
LPCWSTR
str
)
{
int
i
;
for
(
i
=
0
;
i
<
lstrlenW
(
str
);
i
++
)
if
(
!
isdigitW
(
str
[
i
]))
return
FALSE
;
return
TRUE
;
}
WCHAR
column_keys
[][
80
]
=
{
{
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'C'
,
'o'
,
's'
,
't'
,
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
0
},
{
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'C'
,
'o'
,
's'
,
't'
,
'S'
,
'i'
,
'z'
,
'e'
,
0
},
{
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'C'
,
'o'
,
's'
,
't'
,
'A'
,
'v'
,
'a'
,
'i'
,
'l'
,
'a'
,
'b'
,
'l'
,
'e'
,
0
},
{
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'C'
,
'o'
,
's'
,
't'
,
'R'
,
'e'
,
'q'
,
'u'
,
'i'
,
'r'
,
'e'
,
'd'
,
0
},
{
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'C'
,
'o'
,
's'
,
't'
,
'D'
,
'i'
,
'f'
,
'f'
,
'e'
,
'r'
,
'e'
,
'n'
,
'c'
,
'e'
,
0
}
};
static
void
msi_dialog_vcl_add_columns
(
msi_dialog
*
dialog
,
msi_control
*
control
,
MSIRECORD
*
rec
)
{
LPCWSTR
text
=
MSI_RecordGetString
(
rec
,
10
);
LPCWSTR
begin
=
text
,
end
;
WCHAR
num
[
10
];
LVCOLUMNW
lvc
;
DWORD
count
=
0
;
LRESULT
r
;
static
const
WCHAR
zero
[]
=
{
'0'
,
0
};
static
const
WCHAR
negative
[]
=
{
'-'
,
0
};
while
((
begin
=
strchrW
(
begin
,
'{'
))
&&
count
<
5
)
{
if
(
!
(
end
=
strchrW
(
begin
,
'}'
)))
return
;
lstrcpynW
(
num
,
begin
+
1
,
end
-
begin
);
begin
+=
end
-
begin
+
1
;
/* empty braces or '0' hides the column */
if
(
!
num
[
0
]
||
!
lstrcmpW
(
num
,
zero
)
)
{
count
++
;
continue
;
}
/* the width must be a positive number
* if a width is invalid, all remaining columns are hidden
*/
if
(
!
strncmpW
(
num
,
negative
,
1
)
||
!
str_is_number
(
num
)
)
return
;
lvc
.
mask
=
LVCF_FMT
|
LVCF_ORDER
|
LVCF_WIDTH
|
LVCF_TEXT
;
lvc
.
iOrder
=
count
;
lvc
.
pszText
=
msi_dialog_get_uitext
(
dialog
,
column_keys
[
count
++
]
);
lvc
.
cx
=
atolW
(
num
);
lvc
.
fmt
=
LVCFMT_LEFT
;
r
=
SendMessageW
(
control
->
hwnd
,
LVM_INSERTCOLUMNW
,
0
,
(
LPARAM
)
&
lvc
);
msi_free
(
lvc
.
pszText
);
if
(
r
)
return
;
}
}
static
UINT
msi_dialog_volumecost_list
(
msi_dialog
*
dialog
,
MSIRECORD
*
rec
)
{
msi_control
*
control
;
...
...
@@ -2150,6 +2233,8 @@ static UINT msi_dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec )
if
(
!
control
)
return
ERROR_FUNCTION_FAILED
;
msi_dialog_vcl_add_columns
(
dialog
,
control
,
rec
);
return
ERROR_SUCCESS
;
}
...
...
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