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