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
b2486d41
Commit
b2486d41
authored
Apr 15, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Implemented LVM_SORTITEMSEX.
parent
961f175c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
8 deletions
+39
-8
listview.c
dlls/comctl32/listview.c
+35
-8
commctrl.h
include/commctrl.h
+4
-0
No files found.
dlls/comctl32/listview.c
View file @
b2486d41
...
...
@@ -137,7 +137,6 @@
* -- LVM_SETINFOTIP
* -- LVM_SETTILEWIDTH
* -- LVM_SORTGROUPS
* -- LVM_SORTITEMSEX
*
* Macros:
* -- ListView_GetCheckSate, ListView_SetCheckState
...
...
@@ -148,7 +147,6 @@
* -- ListView_GetTextBkColor
* -- ListView_GetUnicodeFormat, ListView_SetUnicodeFormat
* -- ListView_GetWorkAreas, ListView_SetWorkAreas
* -- ListView_SortItemsEx
*
* Functions:
* -- LVGroupComparE
...
...
@@ -422,7 +420,6 @@ static void LISTVIEW_SetSelection(LISTVIEW_INFO *, INT);
static
void
LISTVIEW_UpdateSize
(
LISTVIEW_INFO
*
);
static
HWND
LISTVIEW_EditLabelT
(
LISTVIEW_INFO
*
,
INT
,
BOOL
);
static
LRESULT
LISTVIEW_Command
(
const
LISTVIEW_INFO
*
,
WPARAM
,
LPARAM
);
static
BOOL
LISTVIEW_SortItems
(
LISTVIEW_INFO
*
,
PFNLVCOMPARE
,
LPARAM
);
static
INT
LISTVIEW_GetStringWidthT
(
const
LISTVIEW_INFO
*
,
LPCWSTR
,
BOOL
);
static
BOOL
LISTVIEW_KeySelection
(
LISTVIEW_INFO
*
,
INT
,
BOOL
);
static
UINT
LISTVIEW_GetItemState
(
const
LISTVIEW_INFO
*
,
INT
,
UINT
);
...
...
@@ -7835,7 +7832,7 @@ static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL fUnicode)
/***
* DESCRIPTION:
* Callback internally used by LISTVIEW_SortItems()
* Callback internally used by LISTVIEW_SortItems()
in response of LVM_SORTITEMS
*
* PARAMETER(S):
* [I] first : pointer to first ITEM_INFO to compare
...
...
@@ -7859,18 +7856,44 @@ static INT WINAPI LISTVIEW_CallBackCompare(LPVOID first, LPVOID second, LPARAM l
/***
* DESCRIPTION:
* Callback internally used by LISTVIEW_SortItems() in response of LVM_SORTITEMSEX
*
* PARAMETER(S):
* [I] first : pointer to first ITEM_INFO to compare
* [I] second : pointer to second ITEM_INFO to compare
* [I] lParam : HWND of control
*
* RETURN:
* if first comes before second : negative
* if first comes after second : positive
* if first and second are equivalent : zero
*/
static
INT
WINAPI
LISTVIEW_CallBackCompareEx
(
LPVOID
first
,
LPVOID
second
,
LPARAM
lParam
)
{
LISTVIEW_INFO
*
infoPtr
=
(
LISTVIEW_INFO
*
)
lParam
;
INT
first_idx
=
DPA_GetPtrIndex
(
infoPtr
->
hdpaItems
,
first
);
INT
second_idx
=
DPA_GetPtrIndex
(
infoPtr
->
hdpaItems
,
second
);
/* Forward the call to the client defined callback */
return
(
infoPtr
->
pfnCompare
)(
first_idx
,
second_idx
,
infoPtr
->
lParamSort
);
}
/***
* DESCRIPTION:
* Sorts the listview items.
*
* PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure
* [I] pfnCompare : application-defined value
* [I] lParamSort : pointer to comparison callback
* [I] IsEx : TRUE when LVM_SORTITEMSEX used
*
* RETURN:
* SUCCESS : TRUE
* FAILURE : FALSE
*/
static
BOOL
LISTVIEW_SortItems
(
LISTVIEW_INFO
*
infoPtr
,
PFNLVCOMPARE
pfnCompare
,
LPARAM
lParamSort
)
static
BOOL
LISTVIEW_SortItems
(
LISTVIEW_INFO
*
infoPtr
,
PFNLVCOMPARE
pfnCompare
,
LPARAM
lParamSort
,
BOOL
IsEx
)
{
UINT
uView
=
infoPtr
->
dwStyle
&
LVS_TYPEMASK
;
HDPA
hdpaSubItems
;
...
...
@@ -7900,7 +7923,10 @@ static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare,
infoPtr
->
pfnCompare
=
pfnCompare
;
infoPtr
->
lParamSort
=
lParamSort
;
DPA_Sort
(
infoPtr
->
hdpaItems
,
LISTVIEW_CallBackCompare
,
(
LPARAM
)
infoPtr
);
if
(
IsEx
)
DPA_Sort
(
infoPtr
->
hdpaItems
,
LISTVIEW_CallBackCompareEx
,
(
LPARAM
)
infoPtr
);
else
DPA_Sort
(
infoPtr
->
hdpaItems
,
LISTVIEW_CallBackCompare
,
(
LPARAM
)
infoPtr
);
/* restore selection ranges */
for
(
i
=
0
;
i
<
infoPtr
->
nItemCount
;
i
++
)
...
...
@@ -10022,9 +10048,10 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case LVM_SORTGROUPS: */
case
LVM_SORTITEMS
:
return
LISTVIEW_SortItems
(
infoPtr
,
(
PFNLVCOMPARE
)
lParam
,
(
LPARAM
)
wParam
);
return
LISTVIEW_SortItems
(
infoPtr
,
(
PFNLVCOMPARE
)
lParam
,
(
LPARAM
)
wParam
,
FALSE
);
/* LVM_SORTITEMSEX: */
case
LVM_SORTITEMSEX
:
return
LISTVIEW_SortItems
(
infoPtr
,
(
PFNLVCOMPARE
)
lParam
,
(
LPARAM
)
wParam
,
TRUE
);
case
LVM_SUBITEMHITTEST
:
return
LISTVIEW_HitTest
(
infoPtr
,
(
LPLVHITTESTINFO
)
lParam
,
TRUE
,
FALSE
);
...
...
include/commctrl.h
View file @
b2486d41
...
...
@@ -3147,6 +3147,7 @@ static const WCHAR WC_LISTVIEWW[] = { 'S','y','s',
#define LVM_SETITEMTEXT WINELIB_NAME_AW(LVM_SETITEMTEXT)
#define LVM_SETITEMCOUNT (LVM_FIRST+47)
#define LVM_SORTITEMS (LVM_FIRST+48)
#define LVM_SORTITEMSEX (LVM_FIRST+81)
#define LVM_SETITEMPOSITION32 (LVM_FIRST+49)
#define LVM_GETSELECTEDCOUNT (LVM_FIRST+50)
#define LVM_GETITEMSPACING (LVM_FIRST+51)
...
...
@@ -3772,6 +3773,9 @@ typedef struct NMLVSCROLL
#define ListView_SortItems(hwndLV,_pfnCompare,_lPrm) \
(BOOL)SNDMSGA((hwndLV),LVM_SORTITEMS,(WPARAM)(LPARAM)_lPrm,(LPARAM)(PFNLVCOMPARE)_pfnCompare)
#define ListView_SortItemsEx(hwndLV, _pfnCompare, _lPrm) \
(BOOL)SNDMSGA((hwndLV), LVM_SORTITEMSEX, (WPARAM)(LPARAM)(_lPrm), (LPARAM)(PFNLVCOMPARE)(_pfnCompare))
#define ListView_SetItemPosition(hwndLV, i, x, y) \
(BOOL)SNDMSGA((hwndLV),LVM_SETITEMPOSITION,(WPARAM)(INT)(i),MAKELPARAM((x),(y)))
#define ListView_GetSelectedCount(hwndLV) \
...
...
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