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
aec7e91d
Commit
aec7e91d
authored
Dec 13, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Always clip the button painting to the client rectangle.
parent
f4337b47
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
button.c
dlls/user32/button.c
+18
-14
No files found.
dlls/user32/button.c
View file @
aec7e91d
...
@@ -217,6 +217,15 @@ static inline WCHAR *get_button_text( HWND hwnd )
...
@@ -217,6 +217,15 @@ static inline WCHAR *get_button_text( HWND hwnd )
return
buffer
;
return
buffer
;
}
}
static
void
setup_clipping
(
HWND
hwnd
,
HDC
hdc
)
{
RECT
rc
;
GetClientRect
(
hwnd
,
&
rc
);
DPtoLP
(
hdc
,
(
POINT
*
)
&
rc
,
2
);
IntersectClipRect
(
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
}
/***********************************************************************
/***********************************************************************
* ButtonWndProc_common
* ButtonWndProc_common
*/
*/
...
@@ -798,6 +807,9 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
...
@@ -798,6 +807,9 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
parent
=
GetParent
(
hwnd
);
parent
=
GetParent
(
hwnd
);
if
(
!
parent
)
parent
=
hwnd
;
if
(
!
parent
)
parent
=
hwnd
;
SendMessageW
(
parent
,
WM_CTLCOLORBTN
,
(
WPARAM
)
hDC
,
(
LPARAM
)
hwnd
);
SendMessageW
(
parent
,
WM_CTLCOLORBTN
,
(
WPARAM
)
hDC
,
(
LPARAM
)
hwnd
);
setup_clipping
(
hwnd
,
hDC
);
hOldPen
=
(
HPEN
)
SelectObject
(
hDC
,
SYSCOLOR_GetPen
(
COLOR_WINDOWFRAME
));
hOldPen
=
(
HPEN
)
SelectObject
(
hDC
,
SYSCOLOR_GetPen
(
COLOR_WINDOWFRAME
));
hOldBrush
=
(
HBRUSH
)
SelectObject
(
hDC
,
GetSysColorBrush
(
COLOR_BTNFACE
));
hOldBrush
=
(
HBRUSH
)
SelectObject
(
hDC
,
GetSysColorBrush
(
COLOR_BTNFACE
));
oldBkMode
=
SetBkMode
(
hDC
,
TRANSPARENT
);
oldBkMode
=
SetBkMode
(
hDC
,
TRANSPARENT
);
...
@@ -970,7 +982,7 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
...
@@ -970,7 +982,7 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
if
(
dtFlags
==
(
UINT
)
-
1L
)
/* Noting to draw */
if
(
dtFlags
==
(
UINT
)
-
1L
)
/* Noting to draw */
return
;
return
;
IntersectClipRect
(
hDC
,
client
.
left
,
client
.
top
,
client
.
right
,
client
.
bottom
);
setup_clipping
(
hwnd
,
hDC
);
if
(
action
==
ODA_DRAWENTIRE
)
if
(
action
==
ODA_DRAWENTIRE
)
BUTTON_DrawLabel
(
hwnd
,
hDC
,
dtFlags
,
&
rtext
);
BUTTON_DrawLabel
(
hwnd
,
hDC
,
dtFlags
,
&
rtext
);
...
@@ -1046,6 +1058,8 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action )
...
@@ -1046,6 +1058,8 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action )
if
(
dtFlags
==
(
UINT
)
-
1L
)
if
(
dtFlags
==
(
UINT
)
-
1L
)
return
;
return
;
setup_clipping
(
hwnd
,
hDC
);
/* Because buttons have CS_PARENTDC class style, there is a chance
/* Because buttons have CS_PARENTDC class style, there is a chance
* that label will be drawn out of client rect.
* that label will be drawn out of client rect.
* But Windows doesn't clip label's rect, so do I.
* But Windows doesn't clip label's rect, so do I.
...
@@ -1100,8 +1114,6 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
...
@@ -1100,8 +1114,6 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
{
{
LONG
state
=
get_button_state
(
hwnd
);
LONG
state
=
get_button_state
(
hwnd
);
DRAWITEMSTRUCT
dis
;
DRAWITEMSTRUCT
dis
;
HRGN
clipRegion
;
RECT
clipRect
;
LONG_PTR
id
=
GetWindowLongPtrW
(
hwnd
,
GWLP_ID
);
LONG_PTR
id
=
GetWindowLongPtrW
(
hwnd
,
GWLP_ID
);
HWND
parent
;
HWND
parent
;
HFONT
hFont
,
hPrevFont
=
0
;
HFONT
hFont
,
hPrevFont
=
0
;
...
@@ -1118,21 +1130,13 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
...
@@ -1118,21 +1130,13 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
dis
.
itemData
=
0
;
dis
.
itemData
=
0
;
GetClientRect
(
hwnd
,
&
dis
.
rcItem
);
GetClientRect
(
hwnd
,
&
dis
.
rcItem
);
clipRegion
=
CreateRectRgnIndirect
(
&
dis
.
rcItem
);
if
(
GetClipRgn
(
hDC
,
clipRegion
)
!=
1
)
{
DeleteObject
(
clipRegion
);
clipRegion
=
NULL
;
}
clipRect
=
dis
.
rcItem
;
DPtoLP
(
hDC
,
(
LPPOINT
)
&
clipRect
,
2
);
IntersectClipRect
(
hDC
,
clipRect
.
left
,
clipRect
.
top
,
clipRect
.
right
,
clipRect
.
bottom
);
if
((
hFont
=
get_button_font
(
hwnd
)))
hPrevFont
=
SelectObject
(
hDC
,
hFont
);
if
((
hFont
=
get_button_font
(
hwnd
)))
hPrevFont
=
SelectObject
(
hDC
,
hFont
);
parent
=
GetParent
(
hwnd
);
parent
=
GetParent
(
hwnd
);
if
(
!
parent
)
parent
=
hwnd
;
if
(
!
parent
)
parent
=
hwnd
;
SendMessageW
(
parent
,
WM_CTLCOLORBTN
,
(
WPARAM
)
hDC
,
(
LPARAM
)
hwnd
);
SendMessageW
(
parent
,
WM_CTLCOLORBTN
,
(
WPARAM
)
hDC
,
(
LPARAM
)
hwnd
);
setup_clipping
(
hwnd
,
hDC
);
SendMessageW
(
GetParent
(
hwnd
),
WM_DRAWITEM
,
id
,
(
LPARAM
)
&
dis
);
SendMessageW
(
GetParent
(
hwnd
),
WM_DRAWITEM
,
id
,
(
LPARAM
)
&
dis
);
if
(
hPrevFont
)
SelectObject
(
hDC
,
hPrevFont
);
if
(
hPrevFont
)
SelectObject
(
hDC
,
hPrevFont
);
SelectClipRgn
(
hDC
,
clipRegion
);
}
}
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