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
e6369988
Commit
e6369988
authored
Jun 07, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Use LV_VIEW_* constants instead of style.
parent
ed250886
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
31 deletions
+22
-31
listview.c
dlls/comctl32/listview.c
+22
-31
No files found.
dlls/comctl32/listview.c
View file @
e6369988
...
@@ -3494,7 +3494,6 @@ static inline BOOL is_assignable_item(const LVITEMW *lpLVItem, LONG lStyle)
...
@@ -3494,7 +3494,6 @@ static inline BOOL is_assignable_item(const LVITEMW *lpLVItem, LONG lStyle)
*/
*/
static
BOOL
set_main_item
(
LISTVIEW_INFO
*
infoPtr
,
const
LVITEMW
*
lpLVItem
,
BOOL
isNew
,
BOOL
isW
,
BOOL
*
bChanged
)
static
BOOL
set_main_item
(
LISTVIEW_INFO
*
infoPtr
,
const
LVITEMW
*
lpLVItem
,
BOOL
isNew
,
BOOL
isW
,
BOOL
*
bChanged
)
{
{
UINT
uView
=
infoPtr
->
dwStyle
&
LVS_TYPEMASK
;
ITEM_INFO
*
lpItem
;
ITEM_INFO
*
lpItem
;
NMLISTVIEW
nmlv
;
NMLISTVIEW
nmlv
;
UINT
uChanged
=
0
;
UINT
uChanged
=
0
;
...
@@ -3619,7 +3618,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
...
@@ -3619,7 +3618,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL
}
}
infoPtr
->
nFocusedItem
=
lpLVItem
->
iItem
;
infoPtr
->
nFocusedItem
=
lpLVItem
->
iItem
;
LISTVIEW_EnsureVisible
(
infoPtr
,
lpLVItem
->
iItem
,
uView
==
LVS
_LIST
);
LISTVIEW_EnsureVisible
(
infoPtr
,
lpLVItem
->
iItem
,
infoPtr
->
uView
==
LV_VIEW
_LIST
);
}
}
else
if
(
infoPtr
->
nFocusedItem
==
lpLVItem
->
iItem
)
else
if
(
infoPtr
->
nFocusedItem
==
lpLVItem
->
iItem
)
{
{
...
@@ -4800,7 +4799,6 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
...
@@ -4800,7 +4799,6 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
*/
*/
static
void
LISTVIEW_ScrollOnInsert
(
LISTVIEW_INFO
*
infoPtr
,
INT
nItem
,
INT
dir
)
static
void
LISTVIEW_ScrollOnInsert
(
LISTVIEW_INFO
*
infoPtr
,
INT
nItem
,
INT
dir
)
{
{
UINT
uView
=
infoPtr
->
dwStyle
&
LVS_TYPEMASK
;
INT
nPerCol
,
nItemCol
,
nItemRow
;
INT
nPerCol
,
nItemCol
,
nItemRow
;
RECT
rcScroll
;
RECT
rcScroll
;
POINT
Origin
;
POINT
Origin
;
...
@@ -4823,9 +4821,9 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
...
@@ -4823,9 +4821,9 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
LISTVIEW_UpdateScroll
(
infoPtr
);
LISTVIEW_UpdateScroll
(
infoPtr
);
/* figure out the item's position */
/* figure out the item's position */
if
(
uView
==
LVS_REPORT
)
if
(
infoPtr
->
uView
==
LV_VIEW_DETAILS
)
nPerCol
=
infoPtr
->
nItemCount
+
1
;
nPerCol
=
infoPtr
->
nItemCount
+
1
;
else
if
(
uView
==
LVS
_LIST
)
else
if
(
infoPtr
->
uView
==
LV_VIEW
_LIST
)
nPerCol
=
LISTVIEW_GetCountPerColumn
(
infoPtr
);
nPerCol
=
LISTVIEW_GetCountPerColumn
(
infoPtr
);
else
/* LV_VIEW_ICON, or LV_VIEW_SMALLICON */
else
/* LV_VIEW_ICON, or LV_VIEW_SMALLICON */
return
;
return
;
...
@@ -4849,7 +4847,7 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
...
@@ -4849,7 +4847,7 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
}
}
/* report has only that column, so we're done */
/* report has only that column, so we're done */
if
(
uView
==
LVS_REPORT
)
return
;
if
(
infoPtr
->
uView
==
LV_VIEW_DETAILS
)
return
;
/* now for LISTs, we have to deal with the columns to the right */
/* now for LISTs, we have to deal with the columns to the right */
rcScroll
.
left
=
(
nItemCol
+
1
)
*
infoPtr
->
nItemWidth
;
rcScroll
.
left
=
(
nItemCol
+
1
)
*
infoPtr
->
nItemWidth
;
...
@@ -5147,7 +5145,6 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW)
...
@@ -5147,7 +5145,6 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW)
*/
*/
static
BOOL
LISTVIEW_EnsureVisible
(
LISTVIEW_INFO
*
infoPtr
,
INT
nItem
,
BOOL
bPartial
)
static
BOOL
LISTVIEW_EnsureVisible
(
LISTVIEW_INFO
*
infoPtr
,
INT
nItem
,
BOOL
bPartial
)
{
{
UINT
uView
=
infoPtr
->
dwStyle
&
LVS_TYPEMASK
;
INT
nScrollPosHeight
=
0
;
INT
nScrollPosHeight
=
0
;
INT
nScrollPosWidth
=
0
;
INT
nScrollPosWidth
=
0
;
INT
nHorzAdjust
=
0
;
INT
nHorzAdjust
=
0
;
...
@@ -5163,41 +5160,41 @@ static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *infoPtr, INT nItem, BOOL bPart
...
@@ -5163,41 +5160,41 @@ static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *infoPtr, INT nItem, BOOL bPart
if
(
rcItem
.
left
<
infoPtr
->
rcList
.
left
||
rcItem
.
right
>
infoPtr
->
rcList
.
right
)
if
(
rcItem
.
left
<
infoPtr
->
rcList
.
left
||
rcItem
.
right
>
infoPtr
->
rcList
.
right
)
{
{
/* scroll left/right, but in LV
S_REPORT
mode */
/* scroll left/right, but in LV
_VIEW_DETAILS
mode */
if
(
uView
==
LVS
_LIST
)
if
(
infoPtr
->
uView
==
LV_VIEW
_LIST
)
nScrollPosWidth
=
infoPtr
->
nItemWidth
;
nScrollPosWidth
=
infoPtr
->
nItemWidth
;
else
if
((
uView
==
LVS_SMALLICON
)
||
(
uView
==
LVS
_ICON
))
else
if
((
infoPtr
->
uView
==
LV_VIEW_SMALLICON
)
||
(
infoPtr
->
uView
==
LV_VIEW
_ICON
))
nScrollPosWidth
=
1
;
nScrollPosWidth
=
1
;
if
(
rcItem
.
left
<
infoPtr
->
rcList
.
left
)
if
(
rcItem
.
left
<
infoPtr
->
rcList
.
left
)
{
{
nHorzAdjust
=
-
1
;
nHorzAdjust
=
-
1
;
if
(
uView
!=
LVS_REPORT
)
nHorzDiff
=
rcItem
.
left
-
infoPtr
->
rcList
.
left
;
if
(
infoPtr
->
uView
!=
LV_VIEW_DETAILS
)
nHorzDiff
=
rcItem
.
left
-
infoPtr
->
rcList
.
left
;
}
}
else
else
{
{
nHorzAdjust
=
1
;
nHorzAdjust
=
1
;
if
(
uView
!=
LVS_REPORT
)
nHorzDiff
=
rcItem
.
right
-
infoPtr
->
rcList
.
right
;
if
(
infoPtr
->
uView
!=
LV_VIEW_DETAILS
)
nHorzDiff
=
rcItem
.
right
-
infoPtr
->
rcList
.
right
;
}
}
}
}
if
(
rcItem
.
top
<
infoPtr
->
rcList
.
top
||
rcItem
.
bottom
>
infoPtr
->
rcList
.
bottom
)
if
(
rcItem
.
top
<
infoPtr
->
rcList
.
top
||
rcItem
.
bottom
>
infoPtr
->
rcList
.
bottom
)
{
{
/* scroll up/down, but not in LVS_LIST mode */
/* scroll up/down, but not in LVS_LIST mode */
if
(
uView
==
LVS_REPORT
)
if
(
infoPtr
->
uView
==
LV_VIEW_DETAILS
)
nScrollPosHeight
=
infoPtr
->
nItemHeight
;
nScrollPosHeight
=
infoPtr
->
nItemHeight
;
else
if
((
uView
==
LVS_ICON
)
||
(
uView
==
LVS
_SMALLICON
))
else
if
((
infoPtr
->
uView
==
LV_VIEW_ICON
)
||
(
infoPtr
->
uView
==
LV_VIEW
_SMALLICON
))
nScrollPosHeight
=
1
;
nScrollPosHeight
=
1
;
if
(
rcItem
.
top
<
infoPtr
->
rcList
.
top
)
if
(
rcItem
.
top
<
infoPtr
->
rcList
.
top
)
{
{
nVertAdjust
=
-
1
;
nVertAdjust
=
-
1
;
if
(
uView
!=
LVS
_LIST
)
nVertDiff
=
rcItem
.
top
-
infoPtr
->
rcList
.
top
;
if
(
infoPtr
->
uView
!=
LV_VIEW
_LIST
)
nVertDiff
=
rcItem
.
top
-
infoPtr
->
rcList
.
top
;
}
}
else
else
{
{
nVertAdjust
=
1
;
nVertAdjust
=
1
;
if
(
uView
!=
LVS
_LIST
)
nVertDiff
=
rcItem
.
bottom
-
infoPtr
->
rcList
.
bottom
;
if
(
infoPtr
->
uView
!=
LV_VIEW
_LIST
)
nVertDiff
=
rcItem
.
bottom
-
infoPtr
->
rcList
.
bottom
;
}
}
}
}
...
@@ -6701,7 +6698,6 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
...
@@ -6701,7 +6698,6 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
*/
*/
static
INT
LISTVIEW_InsertItemT
(
LISTVIEW_INFO
*
infoPtr
,
const
LVITEMW
*
lpLVItem
,
BOOL
isW
)
static
INT
LISTVIEW_InsertItemT
(
LISTVIEW_INFO
*
infoPtr
,
const
LVITEMW
*
lpLVItem
,
BOOL
isW
)
{
{
UINT
uView
=
infoPtr
->
dwStyle
&
LVS_TYPEMASK
;
INT
nItem
;
INT
nItem
;
HDPA
hdpaSubItems
;
HDPA
hdpaSubItems
;
NMLISTVIEW
nmlv
;
NMLISTVIEW
nmlv
;
...
@@ -6788,7 +6784,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
...
@@ -6788,7 +6784,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
if
(
!
set_main_item
(
infoPtr
,
&
item
,
TRUE
,
isW
,
&
has_changed
))
goto
undo
;
if
(
!
set_main_item
(
infoPtr
,
&
item
,
TRUE
,
isW
,
&
has_changed
))
goto
undo
;
/* make room for the position, if we are in the right mode */
/* make room for the position, if we are in the right mode */
if
((
uView
==
LVS_SMALLICON
)
||
(
uView
==
LVS
_ICON
))
if
((
infoPtr
->
uView
==
LV_VIEW_SMALLICON
)
||
(
infoPtr
->
uView
==
LV_VIEW
_ICON
))
{
{
if
(
DPA_InsertPtr
(
infoPtr
->
hdpaPosX
,
nItem
,
0
)
==
-
1
)
if
(
DPA_InsertPtr
(
infoPtr
->
hdpaPosX
,
nItem
,
0
)
==
-
1
)
goto
undo
;
goto
undo
;
...
@@ -6808,7 +6804,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
...
@@ -6808,7 +6804,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
return
-
1
;
return
-
1
;
/* align items (set position of each item) */
/* align items (set position of each item) */
if
(
(
uView
==
LVS_SMALLICON
||
uView
==
LVS_ICON
)
)
if
(
infoPtr
->
uView
==
LV_VIEW_SMALLICON
||
infoPtr
->
uView
==
LV_VIEW_ICON
)
{
{
POINT
pt
;
POINT
pt
;
...
@@ -8368,7 +8364,6 @@ fail:
...
@@ -8368,7 +8364,6 @@ fail:
static
LRESULT
LISTVIEW_Create
(
HWND
hwnd
,
const
CREATESTRUCTW
*
lpcs
)
static
LRESULT
LISTVIEW_Create
(
HWND
hwnd
,
const
CREATESTRUCTW
*
lpcs
)
{
{
LISTVIEW_INFO
*
infoPtr
=
(
LISTVIEW_INFO
*
)
GetWindowLongPtrW
(
hwnd
,
0
);
LISTVIEW_INFO
*
infoPtr
=
(
LISTVIEW_INFO
*
)
GetWindowLongPtrW
(
hwnd
,
0
);
UINT
uView
=
lpcs
->
style
&
LVS_TYPEMASK
;
TRACE
(
"(lpcs=%p)
\n
"
,
lpcs
);
TRACE
(
"(lpcs=%p)
\n
"
,
lpcs
);
...
@@ -8380,7 +8375,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
...
@@ -8380,7 +8375,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
/* on error defaulting to ANSI notifications */
/* on error defaulting to ANSI notifications */
if
(
infoPtr
->
notifyFormat
==
0
)
infoPtr
->
notifyFormat
=
NFR_ANSI
;
if
(
infoPtr
->
notifyFormat
==
0
)
infoPtr
->
notifyFormat
=
NFR_ANSI
;
if
((
uView
==
LVS_REPORT
)
&&
(
lpcs
->
style
&
WS_VISIBLE
))
if
((
infoPtr
->
uView
==
LV_VIEW_DETAILS
)
&&
(
lpcs
->
style
&
WS_VISIBLE
))
{
{
if
(
LISTVIEW_CreateHeader
(
infoPtr
)
<
0
)
return
-
1
;
if
(
LISTVIEW_CreateHeader
(
infoPtr
)
<
0
)
return
-
1
;
}
}
...
@@ -8390,7 +8385,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
...
@@ -8390,7 +8385,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
/* init item size to avoid division by 0 */
/* init item size to avoid division by 0 */
LISTVIEW_UpdateItemSize
(
infoPtr
);
LISTVIEW_UpdateItemSize
(
infoPtr
);
if
(
uView
==
LVS_REPORT
)
if
(
infoPtr
->
uView
==
LV_VIEW_DETAILS
)
{
{
if
(
!
(
LVS_NOCOLUMNHEADER
&
lpcs
->
style
)
&&
(
WS_VISIBLE
&
lpcs
->
style
))
if
(
!
(
LVS_NOCOLUMNHEADER
&
lpcs
->
style
)
&&
(
WS_VISIBLE
&
lpcs
->
style
))
{
{
...
@@ -8402,7 +8397,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
...
@@ -8402,7 +8397,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
OpenThemeData
(
hwnd
,
themeClass
);
OpenThemeData
(
hwnd
,
themeClass
);
/* initialize the icon sizes */
/* initialize the icon sizes */
set_icon_size
(
&
infoPtr
->
iconSize
,
infoPtr
->
himlNormal
,
uView
!=
LVS
_ICON
);
set_icon_size
(
&
infoPtr
->
iconSize
,
infoPtr
->
himlNormal
,
infoPtr
->
uView
!=
LV_VIEW
_ICON
);
set_icon_size
(
&
infoPtr
->
iconStateSize
,
infoPtr
->
himlState
,
TRUE
);
set_icon_size
(
&
infoPtr
->
iconStateSize
,
infoPtr
->
himlState
,
TRUE
);
return
0
;
return
0
;
}
}
...
@@ -9748,13 +9743,11 @@ static LRESULT LISTVIEW_Size(LISTVIEW_INFO *infoPtr, int Width, int Height)
...
@@ -9748,13 +9743,11 @@ static LRESULT LISTVIEW_Size(LISTVIEW_INFO *infoPtr, int Width, int Height)
*/
*/
static
void
LISTVIEW_UpdateSize
(
LISTVIEW_INFO
*
infoPtr
)
static
void
LISTVIEW_UpdateSize
(
LISTVIEW_INFO
*
infoPtr
)
{
{
UINT
uView
=
infoPtr
->
dwStyle
&
LVS_TYPEMASK
;
TRACE
(
"uView=%d, rcList(old)=%s
\n
"
,
infoPtr
->
uView
,
wine_dbgstr_rect
(
&
infoPtr
->
rcList
));
TRACE
(
"uView=%d, rcList(old)=%s
\n
"
,
uView
,
wine_dbgstr_rect
(
&
infoPtr
->
rcList
));
GetClientRect
(
infoPtr
->
hwndSelf
,
&
infoPtr
->
rcList
);
GetClientRect
(
infoPtr
->
hwndSelf
,
&
infoPtr
->
rcList
);
if
(
uView
==
LVS
_LIST
)
if
(
infoPtr
->
uView
==
LV_VIEW
_LIST
)
{
{
/* Apparently the "LIST" style is supposed to have the same
/* Apparently the "LIST" style is supposed to have the same
* number of items in a column even if there is no scroll bar.
* number of items in a column even if there is no scroll bar.
...
@@ -9767,7 +9760,7 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
...
@@ -9767,7 +9760,7 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
infoPtr
->
rcList
.
bottom
-=
GetSystemMetrics
(
SM_CYHSCROLL
);
infoPtr
->
rcList
.
bottom
-=
GetSystemMetrics
(
SM_CYHSCROLL
);
infoPtr
->
rcList
.
bottom
=
max
(
infoPtr
->
rcList
.
bottom
-
2
,
0
);
infoPtr
->
rcList
.
bottom
=
max
(
infoPtr
->
rcList
.
bottom
-
2
,
0
);
}
}
else
if
(
uView
==
LVS_REPORT
)
else
if
(
infoPtr
->
uView
==
LV_VIEW_DETAILS
)
{
{
HDLAYOUT
hl
;
HDLAYOUT
hl
;
WINDOWPOS
wp
;
WINDOWPOS
wp
;
...
@@ -9945,10 +9938,8 @@ static INT LISTVIEW_StyleChanging(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
...
@@ -9945,10 +9938,8 @@ static INT LISTVIEW_StyleChanging(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
*/
*/
static
LRESULT
LISTVIEW_ShowWindow
(
LISTVIEW_INFO
*
infoPtr
,
BOOL
bShown
,
INT
iStatus
)
static
LRESULT
LISTVIEW_ShowWindow
(
LISTVIEW_INFO
*
infoPtr
,
BOOL
bShown
,
INT
iStatus
)
{
{
UINT
uView
=
infoPtr
->
dwStyle
&
LVS_TYPEMASK
;
/* header delayed creation */
/* header delayed creation */
if
((
uView
==
LVS_REPORT
)
&&
bShown
)
if
((
infoPtr
->
uView
==
LV_VIEW_DETAILS
)
&&
bShown
)
{
{
LISTVIEW_CreateHeader
(
infoPtr
);
LISTVIEW_CreateHeader
(
infoPtr
);
...
...
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