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
e74f219d
Commit
e74f219d
authored
Jul 18, 1999
by
Alex Priem
Committed by
Alexandre Julliard
Jul 18, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Implementation of simple comctl32 v5.0 changes.
- TVM_SORTCHILDRENCB also accepts TVI_ROOT as a valid hParent.
parent
e6bffc09
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
14 deletions
+83
-14
treeview.c
dlls/comctl32/treeview.c
+57
-14
commctrl.h
include/commctrl.h
+25
-0
treeview.h
include/treeview.h
+1
-0
No files found.
dlls/comctl32/treeview.c
View file @
e74f219d
...
...
@@ -459,6 +459,26 @@ TREEVIEW_GetItemHeight (HWND hwnd)
}
static
LRESULT
TREEVIEW_GetLineColor
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TREEVIEW_INFO
*
infoPtr
=
TREEVIEW_GetInfoPtr
(
hwnd
);
TRACE
(
"
\n
"
);
return
(
LRESULT
)
infoPtr
->
clrLine
;
}
static
LRESULT
TREEVIEW_SetLineColor
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TREEVIEW_INFO
*
infoPtr
=
TREEVIEW_GetInfoPtr
(
hwnd
);
COLORREF
prevColor
=
infoPtr
->
clrLine
;
TRACE
(
"
\n
"
);
infoPtr
->
clrLine
=
(
COLORREF
)
lParam
;
return
(
LRESULT
)
prevColor
;
}
static
LRESULT
TREEVIEW_SetTextColor
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TREEVIEW_INFO
*
infoPtr
=
TREEVIEW_GetInfoPtr
(
hwnd
);
...
...
@@ -522,11 +542,12 @@ TREEVIEW_DrawItem (HWND hwnd, HDC hdc, TREEVIEW_ITEM *wineItem)
hOldFont
=
SelectObject
(
hdc
,
infoPtr
->
hFont
);
cditem
=
0
;
TRACE
(
"cdmode:%x
\n
"
,
infoPtr
->
cdmode
);
if
(
infoPtr
->
cdmode
&
CDRF_NOTIFYITEMDRAW
)
{
drawmode
=
CDDS_ITEMPREPAINT
;
if
(
infoPtr
->
cdmode
&
CDRF_NOTIFYSUBITEMDRAW
)
drawmode
|=
CDDS_SUBITEM
;
drawmode
|=
CDDS_SUBITEM
;
cditem
=
TREEVIEW_SendCustomDrawItemNotify
(
hwnd
,
hdc
,
wineItem
,
drawmode
);
...
...
@@ -597,9 +618,9 @@ TREEVIEW_DrawItem (HWND hwnd, HDC hdc, TREEVIEW_ITEM *wineItem)
}
/*
* Get a doted pen
* Get a dot
t
ed pen
*/
hnewPen
=
CreatePen
(
PS_DOT
,
0
,
GetSysColor
(
COLOR_WINDOWTEXT
)
);
hnewPen
=
CreatePen
(
PS_DOT
,
0
,
infoPtr
->
clrLine
);
hOldPen
=
SelectObject
(
hdc
,
hnewPen
);
if
(
hasParentOrSibling
)
...
...
@@ -874,7 +895,6 @@ TREEVIEW_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
tvItem
->
mask
&
TVIF_INTEGRAL
)
{
wineItem
->
iIntegral
=
tvItem
->
iIntegral
;
FIXME
(
" TVIF_INTEGRAL not supported yet
\n
"
);
}
if
(
tvItem
->
mask
&
TVIF_PARAM
)
{
...
...
@@ -907,6 +927,19 @@ TREEVIEW_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
return
TRUE
;
}
static
LRESULT
TREEVIEW_GetItemState
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TREEVIEW_INFO
*
infoPtr
=
TREEVIEW_GetInfoPtr
(
hwnd
);
TREEVIEW_ITEM
*
wineItem
;
wineItem
=
TREEVIEW_ValidItem
(
infoPtr
,
(
HTREEITEM
)
wParam
);
if
(
!
wineItem
)
return
0
;
return
(
wineItem
->
state
&
lParam
);
}
...
...
@@ -1141,7 +1174,6 @@ TREEVIEW_GetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
tvItem
->
mask
&
TVIF_INTEGRAL
)
{
tvItem
->
iIntegral
=
wineItem
->
iIntegral
;
FIXME
(
" TVIF_INTEGRAL not supported yet
\n
"
);
}
/* undocumented: windows ignores TVIF_PARAM and
...
...
@@ -1427,10 +1459,14 @@ LRESULT WINAPI TREEVIEW_Sort (
/* Obtain the TVSORTBC struct */
infoPtr
->
pCallBackSort
=
pSort
;
/* undocumented feature: TVI_ROOT means `sort the whole tree' */
if
(
parent
==
TVI_ROOT
)
parent
=
infoPtr
->
TopRootItem
;
/* Check for a valid handle to the parent item */
if
(
!
TREEVIEW_ValidItem
(
infoPtr
,
parent
))
{
ERR
(
"invalid item hParent=%
d
\n
"
,
(
INT
)
parent
);
ERR
(
"invalid item hParent=%
x
\n
"
,
(
INT
)
parent
);
return
FALSE
;
}
...
...
@@ -2053,9 +2089,9 @@ TREEVIEW_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE
(
"wnd %x
\n
"
,
hwnd
);
/* allocate memory for info structure */
infoPtr
=
(
TREEVIEW_INFO
*
)
COMCTL32_Alloc
(
sizeof
(
TREEVIEW_INFO
));
infoPtr
=
(
TREEVIEW_INFO
*
)
COMCTL32_Alloc
(
sizeof
(
TREEVIEW_INFO
));
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
);
if
(
infoPtr
==
NULL
)
{
ERR
(
"could not allocate info memory!
\n
"
);
...
...
@@ -2072,8 +2108,9 @@ TREEVIEW_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* set default settings */
infoPtr
->
uInternalStatus
=
0
;
infoPtr
->
uNumItems
=
0
;
infoPtr
->
clrBk
=
GetSysColor
(
COLOR_WINDOW
);
infoPtr
->
clrBk
=
GetSysColor
(
COLOR_WINDOW
);
infoPtr
->
clrText
=
GetSysColor
(
COLOR_BTNTEXT
);
infoPtr
->
clrLine
=
GetSysColor
(
COLOR_WINDOWTEXT
);
infoPtr
->
cy
=
0
;
infoPtr
->
cx
=
0
;
infoPtr
->
uIndent
=
15
;
...
...
@@ -2234,7 +2271,7 @@ TREEVIEW_SendSimpleNotify (HWND hwnd, UINT code)
TRACE
(
"%x
\n
"
,
code
);
nmhdr
.
hwndFrom
=
hwnd
;
nmhdr
.
idFrom
=
GetWindowLongA
(
hwnd
,
GWL_ID
);
nmhdr
.
idFrom
=
GetWindowLongA
(
hwnd
,
GWL_ID
);
nmhdr
.
code
=
code
;
return
(
BOOL
)
SendMessageA
(
GetParent
(
hwnd
),
WM_NOTIFY
,
...
...
@@ -3544,6 +3581,15 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
TVM_GETSCROLLTIME
:
FIXME
(
"Unimplemented msg TVM_GETSCROLLTIME
\n
"
);
return
0
;
case
TVM_GETITEMSTATE
:
return
TREEVIEW_GetItemState
(
hwnd
,
wParam
,
lParam
);
case
TVM_GETLINECOLOR
:
return
TREEVIEW_GetLineColor
(
hwnd
,
wParam
,
lParam
);
case
TVM_SETLINECOLOR
:
return
TREEVIEW_SetLineColor
(
hwnd
,
wParam
,
lParam
);
case
TVM_SETINSERTMARKCOLOR
:
FIXME
(
"Unimplemented msg TVM_SETINSERTMARKCOLOR
\n
"
);
...
...
@@ -3586,14 +3632,12 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
WM_KEYDOWN
:
return
TREEVIEW_KeyDown
(
hwnd
,
wParam
,
lParam
);
case
WM_SETFOCUS
:
return
TREEVIEW_SetFocus
(
hwnd
,
wParam
,
lParam
);
case
WM_KILLFOCUS
:
return
TREEVIEW_KillFocus
(
hwnd
,
wParam
,
lParam
);
case
WM_LBUTTONDOWN
:
return
TREEVIEW_LButtonDown
(
hwnd
,
wParam
,
lParam
);
...
...
@@ -3612,11 +3656,10 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case
WM_MOUSEMOVE
:
return
TREEVIEW_MouseMove
(
hwnd
,
wParam
,
lParam
);
/* case WM_SYSCOLORCHANGE: */
case
WM_STYLECHANGED
:
return
TREEVIEW_StyleChanged
(
hwnd
,
wParam
,
lParam
);
/* case WM_SYSCOLORCHANGE: */
/* case WM_SETREDRAW: */
case
WM_TIMER
:
...
...
include/commctrl.h
View file @
e74f219d
...
...
@@ -1669,9 +1669,34 @@ typedef struct
#define TVM_UNKNOWN36 (TV_FIRST+36)
#define TVM_SETINSERTMARKCOLOR (TV_FIRST+37)
#define TVM_GETINSERTMARKCOLOR (TV_FIRST+38)
#define TVM_GETITEMSTATE (TV_FIRST+39)
#define TVM_SETLINECOLOR (TV_FIRST+40)
#define TVM_GETLINECOLOR (TV_FIRST+41)
#define TVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define TVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
#define TreeView_GetItemState(hwndTV, hti, mask) \
(UINT)SendMessageA((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), (LPARAM)(mask))
#define TreeView_GetCheckState(hwndTV, hti) \
((((UINT)(SendMessageA((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), \
TVIS_STATEIMAGEMASK))) >> 12) -1)
#define TreeView_SetLineColor(hwnd, clr) \
(COLORREF)SendMessageA((hwnd), TVM_SETLINECOLOR, 0, (LPARAM)(clr))
#define TreeView_GetLineColor(hwnd) \
(COLORREF)SendMessageA((hwnd), TVM_GETLINECOLOR, 0, 0)
#define TreeView_SetItemState(hwndTV, hti, data, _mask) \
{ TVITEM _TVi; \
_TVi.mask = TVIF_STATE; \
_TVi.hItem = hti; \
_TVi.stateMask = _mask; \
_TVi.state = data; \
SendMessageA((hwndTV), TVM_SETITEM, 0, (LPARAM)(TV_ITEM *)&_TVi); \
}
#define TVN_FIRST (0U-400U)
#define TVN_LAST (0U-499U)
...
...
include/treeview.h
View file @
e74f219d
...
...
@@ -70,6 +70,7 @@ typedef struct tagTREEVIEW_INFO
INT
cx
,
cy
;
/* current x/y place in list */
COLORREF
clrBk
;
COLORREF
clrText
;
COLORREF
clrLine
;
HFONT
hFont
;
HFONT
hBoldFont
;
HWND
hwndToolTip
;
...
...
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