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
036ae0b6
Commit
036ae0b6
authored
Oct 13, 2000
by
Susan Farley
Committed by
Alexandre Julliard
Oct 13, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
To improve custom-drawn items, add focus border to itemRects and do
not overlap them.
parent
11776c1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
treeview.c
dlls/comctl32/treeview.c
+17
-17
No files found.
dlls/comctl32/treeview.c
View file @
036ae0b6
...
...
@@ -73,7 +73,7 @@ typedef struct tagTREEVIEW_INFO
INT
Timer
;
UINT
uNumItems
;
/* number of valid TREEVIEW_ITEMs */
INT
cdmode
;
/* last custom draw setting */
UINT
uScrollTime
;
/* max. time for scrolling in milliseconds*/
UINT
uScrollTime
;
/* max. time for scrolling in milliseconds
*/
BOOL
bRedraw
;
/* if FALSE we validate but don't redraw in TREEVIEW_Paint() */
UINT
uItemHeight
;
/* item height */
...
...
@@ -726,7 +726,7 @@ TREEVIEW_ComputeItemRect(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
(
item
->
visibleOrder
-
infoPtr
->
firstVisible
->
visibleOrder
);
item
->
rect
.
bottom
=
item
->
rect
.
top
+
infoPtr
->
uItemHeight
*
item
->
iIntegral
;
+
infoPtr
->
uItemHeight
*
item
->
iIntegral
-
1
;
item
->
rect
.
left
=
0
;
item
->
rect
.
right
=
infoPtr
->
clientWidth
;
...
...
@@ -1029,7 +1029,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
}
}
TRACE
(
"parent %p position %p:
%s
\n
"
,
parentItem
,
insertAfter
,
TRACE
(
"parent %p position %p:
'%s'
\n
"
,
parentItem
,
insertAfter
,
(
tvItem
->
mask
&
TVIF_TEXT
)
?
((
tvItem
->
pszText
==
LPSTR_TEXTCALLBACKA
)
?
"<callback>"
:
tvItem
->
pszText
)
...
...
@@ -1116,7 +1116,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
}
/*
* we reach the end of the child list and the item as not
* we reach the end of the child list and the item
h
as not
* yet been inserted, therefore, insert it after the last child.
*/
if
((
!
bItemInserted
)
&&
(
aChild
==
NULL
))
...
...
@@ -1376,7 +1376,7 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem)
}
/* Validate insertMark dropItem.
* hotItem ??? - used for comparis
i
on only.
* hotItem ??? - used for comparison only.
*/
if
(
!
TREEVIEW_ValidItem
(
infoPtr
,
infoPtr
->
insertMarkItem
))
infoPtr
->
insertMarkItem
=
0
;
...
...
@@ -1570,7 +1570,8 @@ TREEVIEW_NaturalHeight(TREEVIEW_INFO *infoPtr)
ReleaseDC
(
0
,
hdc
);
/* The 16 is a hack because our fonts are tiny. */
return
max
(
16
,
tm
.
tmHeight
+
tm
.
tmExternalLeading
);
/* add 2 for the focus border and 1 more for margin some apps assume */
return
max
(
16
,
tm
.
tmHeight
+
tm
.
tmExternalLeading
+
3
);
}
static
LRESULT
...
...
@@ -2359,8 +2360,7 @@ TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem)
DeleteObject
(
hNewPen
);
}
rcText
.
left
+=
2
;
rcText
.
right
-=
2
;
InflateRect
(
&
rcText
,
-
2
,
-
1
);
/* allow for the focus rect */
/* Draw it */
DrawTextA
(
hdc
,
...
...
@@ -3353,11 +3353,11 @@ TREEVIEW_EditLabelA(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
hOldFont
=
SelectObject
(
hdc
,
infoPtr
->
hFont
);
}
/*
Get String Lenght
in pixels */
/*
Get string length
in pixels */
GetTextExtentPoint32A
(
hdc
,
editItem
->
pszText
,
strlen
(
editItem
->
pszText
),
&
sz
);
/*Add Extra spacing for the next character */
/*
Add Extra spacing for the next character */
GetTextMetricsA
(
hdc
,
&
textMetric
);
sz
.
cx
+=
(
textMetric
.
tmMaxCharWidth
*
2
);
...
...
@@ -3577,14 +3577,14 @@ TREEVIEW_LButtonDoubleClick(TREEVIEW_INFO *infoPtr, LPARAM lParam)
wineItem
=
(
TREEVIEW_ITEM
*
)
TREEVIEW_HitTest
(
infoPtr
,
&
hit
);
if
(
!
wineItem
)
return
0
;
TRACE
(
"item %d
\n
"
,
TREEVIEW_GetItemIndex
(
infoPtr
,
wineItem
));
TRACE
(
"item %d
\n
"
,
TREEVIEW_GetItemIndex
(
infoPtr
,
wineItem
));
if
(
TREEVIEW_SendSimpleNotify
(
infoPtr
,
NM_DBLCLK
)
==
FALSE
)
{
/* FIXME! */
switch
(
hit
.
flags
)
{
case
TVHT_ONITEMRIGHT
:
/* FIXME: we should not have sen
d
NM_DBLCLK in this case. */
/* FIXME: we should not have sen
t
NM_DBLCLK in this case. */
break
;
case
TVHT_ONITEMINDENT
:
...
...
@@ -3646,7 +3646,7 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
ht
.
pt
.
y
=
SHIWORD
(
lParam
);
TREEVIEW_HitTest
(
infoPtr
,
&
ht
);
TRACE
(
"item %d
\n
"
,
TREEVIEW_GetItemIndex
(
infoPtr
,
ht
.
hItem
));
TRACE
(
"item %d
\n
"
,
TREEVIEW_GetItemIndex
(
infoPtr
,
ht
.
hItem
));
/* update focusedItem and redraw both items */
if
(
ht
.
hItem
&&
(
ht
.
flags
&
TVHT_ONITEM
))
...
...
@@ -3679,7 +3679,7 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
ht
.
pt
);
infoPtr
->
dropItem
=
ht
.
hItem
;
/* clean up focuedItem as we dragged and won't select this item */
/* clean up focu
s
edItem as we dragged and won't select this item */
if
(
infoPtr
->
focusedItem
)
{
/* refresh the item that was focused */
...
...
@@ -3699,7 +3699,7 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
goto
setfocus
;
/*
* If the style allow editing and the node is already selected
* If the style allow
s
editing and the node is already selected
* and the click occured on the item label...
*/
if
((
infoPtr
->
dwStyle
&
TVS_EDITLABELS
)
&&
...
...
@@ -3738,7 +3738,7 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
BOOL
closeit
=
TRUE
;
SelItem
=
ht
.
hItem
;
/* determine
o
f the hitItem is a child of the currently selected item */
/* determine
i
f the hitItem is a child of the currently selected item */
while
(
closeit
&&
SelItem
&&
TREEVIEW_ValidItem
(
infoPtr
,
SelItem
)
&&
(
SelItem
!=
infoPtr
->
root
))
{
closeit
=
(
SelItem
!=
infoPtr
->
selectedItem
);
...
...
@@ -4241,7 +4241,7 @@ TREEVIEW_HScroll(TREEVIEW_INFO *infoPtr, WPARAM wParam)
SetFocus
(
infoPtr
->
hwnd
);
maxWidth
=
infoPtr
->
treeWidth
-
infoPtr
->
clientWidth
;
/* shall never occur
e
*/
/* shall never occur */
if
(
maxWidth
<=
0
)
{
scrollX
=
0
;
...
...
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