Commit Graph

56 Commits

Author SHA1 Message Date
Zhiyi Zhang 6576d461b8 comctl32: Repaint after the WM_THEMECHANGED message is received.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-28 09:40:22 +02:00
Zhiyi Zhang 3c81ca8381 comctl32/button: Use themed painting when possible for handling WM_SETTEXT.
Fix an issue that themed buttons are drawn unthemed after receiving a
WM_SETTEXT message.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-03 21:54:45 +01:00
Zhiyi Zhang b08c622e22 comctl32/button: Turn off themed painting if parts are unavailable for Command Links.
Themed painting for Command Links requires BP_COMMANDLINK and
BP_COMMANDLINKGLYPH to be defined in the theme. However, Wine currently
only supports the v3 theme file format used by XP, which doesn't support
Command Links. So turn off themed painting for Command Links if user
uses a third party theme that doesn't have the required parts. Otherwise,
only plain text is drawn.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 20:20:01 +01:00
Michael Stefaniuc f67ef3213c comctl32: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-19 11:23:08 +01:00
Zhiyi Zhang 463482a829 comctl32/button: Do not set BS_PUSHBUTTON and BS_DEFPUSHBUTTON style directly to Split Buttons and Command Links.
For Split Buttons and Command Links of common control version 6, setting
BS_PUSHBUTTON and BS_DEFPUSHBUTTON style toggles their default bit.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47621
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-06 19:01:39 +02:00
Nikolay Sivov 5fcd20396f comctl32/button: Use duplicated image for drawing.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47794
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-01 22:13:07 +02:00
Nikolay Sivov a058c72b0a comctl32/button: Improve repainting on WM_SETFOCUS.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-23 23:50:45 +02:00
Gabriel Ivăncescu b15859d871 comctl32/button: Implement BCM_GETIDEALSIZE for command links.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 19:48:28 +02:00
Gabriel Ivăncescu 7316f69389 comctl32/button: Implement themed command links.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 19:48:28 +02:00
Gabriel Ivăncescu 9fee8a7d25 comctl32/button: Implement command links.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 19:48:28 +02:00
Gabriel Ivăncescu 4fa7aa29b5 comctl32/button: Move the drawing of the button's image into a separate function.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 19:48:28 +02:00
Gabriel Ivăncescu d89facbc50 comctl32/button: Preserve BST_HOT when mouse button is released.
This fixes button state when it is released and the mouse is still
hot-tracking it.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-22 19:48:28 +02:00
Gabriel Ivăncescu 8ee1e3453e comctl32/button: Use WM_GETTEXTLENGTH to see if the button has any text.
There's no reason to allocate and then parse the entire string just to see
if its length is zero.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-05 22:27:23 +02:00
Gabriel Ivăncescu 715065feb3 comctl32/button: Delay calling get_button_text until it is needed to prevent a leak.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-05 22:27:19 +02:00
Gabriel Ivăncescu 9c62f7e42b comctl32/button: Implement BCM_GETIDEALSIZE for split buttons.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-04 16:58:59 +02:00
Gabriel Ivăncescu 6fbb64fe67 comctl32/button: Implement themed split buttons.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=20123
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-04 16:58:59 +02:00
Gabriel Ivăncescu ee2f71d8f6 comctl32/button: Implement split buttons.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=20123
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-04 16:58:59 +02:00
Gabriel Ivăncescu 4e08a7e5d7 comctl32/button: Implement BCM_GETSPLITINFO.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-03 19:28:19 +02:00
Gabriel Ivăncescu 82d39e1817 comctl32/button: Implement BCM_SETSPLITINFO.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-03 19:28:19 +02:00
Gabriel Ivăncescu 202a1c1ef0 comctl32/button: Implement BCM_SETDROPDOWNSTATE.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-03 19:28:19 +02:00
Gabriel Ivăncescu 725d3ff9f3 comctl32/button: Center align split buttons' text by default.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-03 19:28:19 +02:00
Gabriel Ivăncescu efacaf1b5a comctl32/button: Don't draw the button when losing focus before invalidating it.
It's already invalidated at the end so there's no reason to draw it before
that.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 17:55:06 +01:00
Gabriel Ivăncescu 026233c429 comctl32/button: Implement NM_CUSTOMDRAW for BS_USERBUTTON.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 17:55:02 +01:00
Gabriel Ivăncescu 04de7c9f05 comctl32/button: Implement NM_CUSTOMDRAW for other themed buttons.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 17:54:59 +01:00
Gabriel Ivăncescu 8fdc9d76a9 comctl32/button: Implement NM_CUSTOMDRAW for other buttons.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 17:54:32 +01:00
Gabriel Ivăncescu 3062a594bd comctl32/button: Implement NM_CUSTOMDRAW for themed Push Buttons.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=10531
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 17:54:22 +01:00
Gabriel Ivăncescu 4b85740ebf comctl32/button: Implement NM_CUSTOMDRAW for Push Buttons.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=10531
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 17:54:14 +01:00
Nikolay Sivov ec09119f2e comctl32/button: Fix text buffer leak (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-17 15:41:54 +02:00
Zhiyi Zhang 81f6437482 comctl32/button: Support BCM_GETIDEALSIZE message.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=24623
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-05 19:05:46 +02:00
Zhiyi Zhang eb79ebe50c comctl32/button: Support text margin rendering.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-05 19:05:39 +02:00
Zhiyi Zhang c9aa8dab8f comctl32/button: Support imagelist rendering.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40445
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40062
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45246
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-05 19:05:33 +02:00
Zhiyi Zhang 790d13ee98 comctl32/button: Avoid push button content covering frames.
A focus frame may be covered by content in the push button.
Shrink the label rectangle before layout calculation so that
content can never cover the frame.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-05 19:05:20 +02:00
Zhiyi Zhang 1f323f31d6 comctl32/button: Support displaying both image and text.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45727
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-05 19:05:01 +02:00
Zhiyi Zhang fa4183ef84 comctl32/button: Use get_draw_state() helper.
Use a helper so that the get draw state routine can be shared
by later code.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-05 19:04:55 +02:00
Nikolay Sivov 40298cc69a comctl32/button: Use per-window dpi settings.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-17 17:39:56 +02:00
Zhiyi Zhang 84ce292217 comctl32: Fix checkbox wrong box alignment with BS_VCENTER.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-26 21:17:38 +02:00
Zhiyi Zhang 45eb3cb4fc comctl32: GroupBox can have multiline text.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-18 17:10:47 +02:00
Zhiyi Zhang 1c6e71d62a comctl32/button: Implement BCM_{GET,SET}TEXTMARGIN message.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-04 22:04:25 +02:00
Zhiyi Zhang 0d4940b732 comctl32/button: Implement BCM_{GET,SET}IMAGELIST message.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-04 22:04:25 +02:00
Zhiyi Zhang 05d4e4a23b comctl32/button: Remove style checking when handling BM_SETIMAGE.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-03 09:44:29 +02:00
Nikolay Sivov b442a5c0f0 comctl32/button: Keep control style.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-02 12:28:12 +02:00
Nikolay Sivov 733a3ec1b9 comctl32/button: Improve button data layout compatibility.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-30 16:52:05 +02:00
Zhiyi Zhang 06d2ad29ae comctl32/button: Implement BCM_{GETNOTE,SETNOTE,GETNOTELENGTH} message.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-28 19:37:26 +02:00
Nikolay Sivov 81e698da27 comctl32/button: Do not select old font back after painting.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-01 19:25:57 +01:00
Nikolay Sivov 6e55073574 comctl32/button: Use allocated structure to keep control data.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-15 19:34:41 +01:00
Nikolay Sivov 389c3add0a comctl32/button: Fix paint handler check when theming is on.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-14 20:37:56 +01:00
Nikolay Sivov 9d897b73a8 comctl32/button: Use the global memory allocation helpers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-13 20:23:27 +01:00
Nikolay Sivov 65f23a745a comctl32/button: Use messages to get control text.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-13 20:23:27 +01:00
Nikolay Sivov 287c5a25b6 comctl32/button: Invalidate on BM_SETCHECK.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-12 11:07:41 +01:00
Nikolay Sivov f8eb74e10c comctl32/button: Invalidate on BM_SETSTATE.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-12 11:07:38 +01:00