Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
a081e238
Commit
a081e238
authored
22 years ago
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
22 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Clear an old button text in WM_SETTEXT as Windows does.
parent
4344c368
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controls/button.c
+25
-1
25 additions, 1 deletion
controls/button.c
with
25 additions
and
1 deletion
controls/button.c
+
25
−
1
View file @
a081e238
...
...
@@ -47,6 +47,7 @@
#define BUTTON_UNKNOWN2 0x20
#define BUTTON_UNKNOWN3 0x10
static
UINT
BUTTON_CalcLabelRect
(
HWND
hwnd
,
HDC
hdc
,
RECT
*
rc
);
static
void
PB_Paint
(
HWND
hwnd
,
HDC
hDC
,
UINT
action
);
static
void
CB_Paint
(
HWND
hwnd
,
HDC
hDC
,
UINT
action
);
static
void
GB_Paint
(
HWND
hwnd
,
HDC
hDC
,
UINT
action
);
...
...
@@ -301,10 +302,33 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
break
;
case
WM_SETTEXT
:
{
/* Clear an old text here as Windows does */
HDC
hdc
=
GetDC
(
hWnd
);
HBRUSH
hbrush
;
RECT
client
,
rc
;
hbrush
=
SendMessageW
(
GetParent
(
hWnd
),
WM_CTLCOLORSTATIC
,
hdc
,
(
LPARAM
)
hWnd
);
if
(
!
hbrush
)
/* did the app forget to call DefWindowProc ? */
hbrush
=
DefWindowProcW
(
GetParent
(
hWnd
),
WM_CTLCOLORSTATIC
,
hdc
,
(
LPARAM
)
hWnd
);
GetClientRect
(
hWnd
,
&
client
);
rc
=
client
;
BUTTON_CalcLabelRect
(
hWnd
,
hdc
,
&
rc
);
/* Clip by client rect bounds */
if
(
rc
.
right
>
client
.
right
)
rc
.
right
=
client
.
right
;
if
(
rc
.
bottom
>
client
.
bottom
)
rc
.
bottom
=
client
.
bottom
;
FillRect
(
hdc
,
&
rc
,
hbrush
);
ReleaseDC
(
hWnd
,
hdc
);
if
(
unicode
)
DefWindowProcW
(
hWnd
,
WM_SETTEXT
,
wParam
,
lParam
);
else
DefWindowProcA
(
hWnd
,
WM_SETTEXT
,
wParam
,
lParam
);
paint_button
(
hWnd
,
btn_type
,
ODA_DRAWENTIRE
);
if
(
btn_type
==
BS_GROUPBOX
)
/* Yes, only for BS_GROUPBOX */
InvalidateRect
(
hWnd
,
NULL
,
TRUE
);
else
paint_button
(
hWnd
,
btn_type
,
ODA_DRAWENTIRE
);
return
1
;
/* success. FIXME: check text length */
}
case
WM_SETFONT
:
set_button_font
(
hWnd
,
wParam
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment