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
1da10fdc
Commit
1da10fdc
authored
Aug 01, 2000
by
Susan Farley
Committed by
Alexandre Julliard
Aug 01, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More consistent calculation of line height, scrolls a full item on
line up/down.
parent
176cee7e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
13 deletions
+23
-13
treeview.c
dlls/comctl32/treeview.c
+23
-13
No files found.
dlls/comctl32/treeview.c
View file @
1da10fdc
...
...
@@ -62,6 +62,8 @@ DEFAULT_DEBUG_CHANNEL(treeview)
#define TREEVIEW_GetInfoPtr(hwnd) \
((TREEVIEW_INFO *) GetWindowLongA( hwnd, 0))
#define FOCUS_BORDER 3
static
BOOL
TREEVIEW_SendSimpleNotify
(
HWND
hwnd
,
UINT
code
);
static
BOOL
...
...
@@ -1062,6 +1064,8 @@ TREEVIEW_Refresh (HWND hwnd, HDC hdc)
TREEVIEW_INFO
*
infoPtr
=
TREEVIEW_GetInfoPtr
(
hwnd
);
TEXTMETRICA
tm
;
HBRUSH
hbrBk
;
HFONT
hOldFont
;
RECT
rect
;
INT
iItem
,
indent
,
x
,
y
,
height
,
itemHeight
;
INT
viewtop
,
viewbottom
,
viewleft
,
viewright
;
...
...
@@ -1077,14 +1081,14 @@ TREEVIEW_Refresh (HWND hwnd, HDC hdc)
GetClientRect
(
hwnd
,
&
rect
);
if
((
rect
.
left
-
rect
.
right
==
0
)
||
(
rect
.
top
-
rect
.
bottom
==
0
))
return
;
if
((
rect
.
left
>=
rect
.
right
)
||
(
rect
.
top
>=
rect
.
bottom
))
return
;
infoPtr
->
cdmode
=
TREEVIEW_SendCustomDrawNotify
(
hwnd
,
CDDS_PREPAINT
,
hdc
,
rect
);
if
(
infoPtr
->
cdmode
==
CDRF_SKIPDEFAULT
)
return
;
infoPtr
->
uVisibleHeight
=
rect
.
bottom
-
rect
.
top
;
infoPtr
->
uVisibleWidth
=
rect
.
right
-
rect
.
left
;
infoPtr
->
uVisibleHeight
=
rect
.
bottom
-
rect
.
top
+
1
;
infoPtr
->
uVisibleWidth
=
rect
.
right
-
rect
.
left
+
1
;
viewtop
=
infoPtr
->
cy
;
viewbottom
=
infoPtr
->
cy
+
rect
.
bottom
-
rect
.
top
;
...
...
@@ -1103,9 +1107,12 @@ TREEVIEW_Refresh (HWND hwnd, HDC hdc)
if
(
infoPtr
->
uItemHeight
>
itemHeight
)
itemHeight
=
infoPtr
->
uItemHeight
;
// assume that bold and normal fonts have same height
hOldFont
=
SelectObject
(
hdc
,
infoPtr
->
hBoldFont
);
GetTextMetricsA
(
hdc
,
&
tm
);
if
((
tm
.
tmHeight
+
tm
.
tmExternalLeading
)
>
itemHeight
)
itemHeight
=
tm
.
tmHeight
+
tm
.
tmExternalLeading
;
if
((
tm
.
tmHeight
+
tm
.
tmExternalLeading
+
FOCUS_BORDER
)
>
itemHeight
)
itemHeight
=
tm
.
tmHeight
+
tm
.
tmExternalLeading
+
FOCUS_BORDER
;
SelectObject
(
hdc
,
hOldFont
);
infoPtr
->
uRealItemHeight
=
itemHeight
;
...
...
@@ -1134,12 +1141,12 @@ TREEVIEW_Refresh (HWND hwnd, HDC hdc)
wineItem->rect.left, wineItem->rect.right);
*/
height
=
itemHeight
*
wineItem
->
iIntegral
+
1
;
height
=
itemHeight
*
wineItem
->
iIntegral
;
if
((
y
>=
viewtop
)
&&
(
y
<=
viewbottom
)
&&
(
x
>=
viewleft
)
&&
(
x
<=
viewright
))
{
wineItem
->
visible
=
TRUE
;
wineItem
->
rect
.
top
=
y
-
infoPtr
->
cy
+
rect
.
top
;
wineItem
->
rect
.
bottom
=
wineItem
->
rect
.
top
+
height
;
wineItem
->
rect
.
bottom
=
wineItem
->
rect
.
top
+
height
-
1
;
wineItem
->
rect
.
left
=
x
-
infoPtr
->
cx
+
rect
.
left
;
wineItem
->
rect
.
right
=
rect
.
right
;
if
(
!
infoPtr
->
firstVisible
)
...
...
@@ -3651,7 +3658,7 @@ TREEVIEW_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
hdc
=
GetDC
(
0
);
hOldFont
=
SelectObject
(
hdc
,
hFont
);
GetTextMetricsA
(
hdc
,
&
tm
);
height
=
tm
.
tmHeight
+
tm
.
tmExternalLeading
;
height
=
tm
.
tmHeight
+
tm
.
tmExternalLeading
+
FOCUS_BORDER
;
if
(
height
>
infoPtr
->
uRealItemHeight
)
infoPtr
->
uRealItemHeight
=
height
;
SelectObject
(
hdc
,
hOldFont
);
...
...
@@ -3670,6 +3677,7 @@ TREEVIEW_VScroll (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TREEVIEW_INFO
*
infoPtr
=
TREEVIEW_GetInfoPtr
(
hwnd
);
WORD
nVisibleItems
;
int
maxHeight
;
TRACE
(
"wp %x, lp %lx
\n
"
,
wParam
,
lParam
);
...
...
@@ -3682,10 +3690,11 @@ TREEVIEW_VScroll (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
infoPtr
->
cy
<
0
)
infoPtr
->
cy
=
0
;
break
;
case
SB_LINEDOWN
:
maxHeight
=
infoPtr
->
uTotalHeight
-
infoPtr
->
uVisibleHeight
;
if
(
infoPtr
->
cy
==
maxHeight
)
return
FALSE
;
nVisibleItems
=
infoPtr
->
uVisibleHeight
/
infoPtr
->
uRealItemHeight
;
maxHeight
=
infoPtr
->
uTotalHeight
-
nVisibleItems
*
infoPtr
->
uRealItemHeight
;
if
(
infoPtr
->
cy
>=
maxHeight
)
return
FALSE
;
infoPtr
->
cy
+=
infoPtr
->
uRealItemHeight
;
if
(
infoPtr
->
cy
>
maxHeight
)
if
(
infoPtr
->
cy
>
=
maxHeight
)
infoPtr
->
cy
=
maxHeight
;
break
;
case
SB_PAGEUP
:
...
...
@@ -3694,10 +3703,11 @@ TREEVIEW_VScroll (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
infoPtr
->
cy
<
0
)
infoPtr
->
cy
=
0
;
break
;
case
SB_PAGEDOWN
:
maxHeight
=
infoPtr
->
uTotalHeight
-
infoPtr
->
uVisibleHeight
;
nVisibleItems
=
infoPtr
->
uVisibleHeight
/
infoPtr
->
uRealItemHeight
;
maxHeight
=
infoPtr
->
uTotalHeight
-
nVisibleItems
*
infoPtr
->
uRealItemHeight
;
if
(
infoPtr
->
cy
==
maxHeight
)
return
FALSE
;
infoPtr
->
cy
+=
infoPtr
->
uVisibleHeight
;
if
(
infoPtr
->
cy
>
maxHeight
)
if
(
infoPtr
->
cy
>=
maxHeight
)
infoPtr
->
cy
=
maxHeight
;
break
;
case
SB_THUMBTRACK
:
...
...
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