Commit Graph

4671 Commits

Author SHA1 Message Date
Zhiyi Zhang 3c789e2f10 comctl32/tests: Add an optional message to avoid test failures.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-25 21:19:46 +01:00
Thomas Faber 102d691050 comctl32/tests: Fix DC handle leak.
Signed-off-by: Thomas Faber <thomas.faber@reactos.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-24 11:04:37 +01:00
Dmitry Timoshkov c692c59c2e comctl32: Add semi-stub for ImageList_WriteEx.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 19:58:11 +01:00
Zhiyi Zhang 438078d045 comctl32/button: Use client rectangle as content rectangle for themed group boxes.
Themed group boxes always use client rectangle as content rectangle regardless of group box content
margin specified by theme files.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52028
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:31:38 +01:00
Thomas Faber 68b48acbc4 comctl32/tests: Test SB_GETPARTS with large wParam.
Signed-off-by: Thomas Faber <thomas.faber@reactos.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 22:42:52 +01:00
Mark Jansen bb24e75625 comctl32: Safely handle large wParam in SB_GETPARTS.
Signed-off-by: Mark Jansen <mark.jansen@reactos.org>
Signed-off-by: Thomas Faber <thomas.faber@reactos.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 22:42:52 +01:00
Gabriel Ivăncescu c82d6ee4a7 comctl32: Redraw children when the combo box is dropped down.
Some applications subclass the combo box and handle WM_ERASEBKGND themselves,
without using WS_CLIPCHILDREN. This causes them to erase over the editbox
child, so it requires a refresh as well.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=22260
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 22:42:51 +01:00
Zhiyi Zhang ce9d006a45 comctl32/button: Support BS_PUSHLIKE for themed command links.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-11 09:52:45 +01:00
Zhiyi Zhang 3a2d2adc4e comctl32/button: Support BS_PUSHLIKE for themed group boxes.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-11 09:52:43 +01:00
Zhiyi Zhang 9e9448e72b comctl32/button: Correctly align parts in group boxes with BS_PUSHLIKE when theming is off.
Parts in group boxes with BS_PUSHLIKE can be at the bottom, center and top when theming is off.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-11 09:52:41 +01:00
Zhiyi Zhang fcd63df421 comctl32/button: Support BS_PUSHLIKE for themed check boxes and radio buttons.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-11 09:52:39 +01:00
Zhiyi Zhang ed06aa2f7e comctl32/button: Use correct state for default buttons.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-11 09:52:37 +01:00
Zhiyi Zhang a7f6d78406 comctl32/button: Use correct state for BS_3STATE and BS_AUTO3STATE buttons.
BS_3STATE and BS_AUTO3STATE are check boxes. Fix BS_3STATE and BS_AUTO3STATE buttons drawing
indeterminate state as unchecked.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-11 09:52:34 +01:00
Zhiyi Zhang 595f5c59ec comctl32/button: Correctly place parts for themed split buttons.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-05 10:24:48 +01:00
Zhiyi Zhang 7c9cacd47f comctl32/button: Correctly place parts for themed group boxes.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-05 10:24:45 +01:00
Zhiyi Zhang 4f912012a9 comctl32/button: Correctly place parts for themed check boxes.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-05 10:24:41 +01:00
Zhiyi Zhang e1fb7f8b86 comctl32/button: Correctly place parts for themed push buttons.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51916
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-05 10:24:37 +01:00
Zhiyi Zhang 2f2cfaf076 comctl32/button: Correctly place parts for buttons with WS_EX_RIGHT.
WS_EX_RIGHT has the same effect as BS_RIGHT.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-05 10:24:32 +01:00
Serge Gautherie 16a17576a0 comctl32: Fix 'pszHeaderTitle' copypasta.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-04 22:36:29 +01:00
Zhiyi Zhang a161fa7789 comctl32/button: Add a get_box_rect() helper to calculation box rectangle.
get_box_rect() is introduced so that we don't need to duplicate the check box rectangle calculation
when painting themed check boxes.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-04 10:25:30 +01:00
Zhiyi Zhang 5182c46cbe comctl32/button: Simplify focus rectangle calculation for drawing themed split buttons.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-04 10:25:28 +01:00
Zhiyi Zhang 3d3914bca0 comctl32/button: Simplify focus rectangle calculation for drawing themed push buttons.
The focus rectangle is the same as the result from GetThemeBackgroundContentRect(). So there is no
need to retrieve content margins and calculate it again.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-04 10:25:25 +01:00
Zhiyi Zhang 2f1bbd88ed uxtheme: Do not draw parent background when handling WM_CTLCOLORSTATIC for static controls.
SetBkMode(TRANSPARENT) already indicates that the parent background should remain untouched.
Drawing parent background destroys any previous content that applications drawn and some
applications rely on the content being unchanged.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51914
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-04 10:25:07 +01:00
Zhiyi Zhang e17aedb284 comctl32/tests: Test WM_CTLCOLORSTATIC for static controls in a themed dialog.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-04 10:25:05 +01:00
Zhiyi Zhang 5e16493f71 comctl32/button: Use BS_PUSHLIKE instead of WS_EX_RIGHT in BUTTON_PositionRect().
BS_PUSHLIKE and WS_EX_RIGHT have the same value and it was a typo to use WS_EX_RIGHT.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-02 17:09:39 +01:00
Zhiyi Zhang ff5f45f444 comctl32/button: Remove useless calculation for drawing group boxes.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-02 17:09:39 +01:00
Zhiyi Zhang 8018f95a83 comctl32/combo: Invalidate child edit control after painting themed background.
Fix the edit control in a themed combo control not displaying text when
clicking the combo control dropdown button.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-19 11:33:05 +02:00
Zhiyi Zhang 0f2f195831 comctl32/tests: Fix a treeview test failure when theming is on.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Zhiyi Zhang 8f6a4438b4 comctl32/status: Do not use theme metrics to compute height.
Fix status test failures when theming is on.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Zhiyi Zhang f51a12f969 comctl32/tests: Delete unused headers.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Zhiyi Zhang 106a5f43ec comctl32/rebar: Do not remove WS_BORDER when theming is on.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Zhiyi Zhang a9165162dd comctl32/rebar: Do not adjust non-client size when themed.
Fix rebar test failures when theming is on.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Zhiyi Zhang 887e1bcfc3 comctl32/button: Do not restore command link font after themed painting.
Fix button test failures when theming is on.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:36:34 +02:00
Zhiyi Zhang 84e0eac1f9 comctl32/button: Do not restore split button font after themed painting.
Fix button test failures when theming is on.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:36:31 +02:00
Zhiyi Zhang 1e7e31cab9 comctl32/button: Do not restore groupbox font after themed painting.
Fix button tests failures when theming is on.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:36:29 +02:00
Zhiyi Zhang 687d9d0bee comctl32/button: Do not restore checkbox font after themed painting.
Fix button tests failures when theming is on.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:36:26 +02:00
Zhiyi Zhang 8b30c00a7b comctl32/button: Do not restore push button font after themed painting.
Fix button tests failures when theming is on.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:36:23 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Zhiyi Zhang 7be103bba9 comctl32: Use OpenThemeDataForDpi() to create a theme handle not associated to a window.
If a window is not passed to OpenThemeData(), OpenThemeData() assumes the DPI is 96 according to
tests. And GetThemePartSize() should select theme parts according to the DPI stored in theme
handles rather than using GDI device contexts. Thus, OpenThemeDataForDpi() should be used in place
of OpenThemeData() when DPI is not 96 and theme handles shouldn't be associated with a window.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 17:06:22 +02:00
Francois Gouget 29f73481df comctl32: Fix an ASCII / ANSI mixup in a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-31 16:06:40 +02:00
Nikolay Sivov 8df5e1bc5c comctl32/listview: Remove description headers from Edit box helpers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-30 22:49:58 +02:00
Dmitry Timoshkov 9b7faf98a9 comctl32: Check control type in the STM_SETIMAGE/STM_SETICON handlers before calling the helpers.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:08:42 +02:00
Akihiro Sagawa a056663efb comctl32/listbox: Fix redraw after LB_SETCOUNT message.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Akihiro Sagawa d3cb9a2961 comctl32/tests: Test pending redraw state with owner-drawn list box.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Zhiyi Zhang eedad8a8ee user32: Load uxtheme when theming is active.
In comctl32 DllMain(), IsThemeActive() is a delay-loaded function and shouldn't be called in
DllMain(). Instead, tests showed that uxtheme should be loaded by user32.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51540
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 11:40:14 +02:00
Zhiyi Zhang b0e51ead0d uxtheme: Move themed dialog to uxtheme.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51137
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 18:49:55 +02:00
Zhiyi Zhang d9063802f2 uxtheme: Move themed scroll bar to uxtheme.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 18:49:49 +02:00
Zhiyi Zhang 6799667b71 comctl32/trackbar: Update control parts when style changed.
Fix trackbar draws incorrectly after changing style. For example, adding TBS_BOTH should cause a
total repaint.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:57:46 +02:00
Zhiyi Zhang 8107462b8a comctl32/toolbar: Don't use outside theme handles.
Fix Spy++ Toolbar buttons have artifacts. Spy++ first creates a Toolbar window, then calls
OpenThemeData(hwnd, "Rebar") with the Toolbar window. Then when the Toolbar control uses the theme
handle from GetWindowTheme(), it gets a Rebar theme the next time it draws, thus drawing wrong theme
parts.

According the tests, not all of the common controls have such behaviors. Some of them do have theme
handles opened by their window and then use that theme handle afterwards even it's changed from the
outside. However, for other controls, the behaviors are not very consistent across all Windows
versions. Also no applications depend on such behaviors for other controls yet. So, only modify the
Toolbar control for now.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:57:46 +02:00
Zhiyi Zhang 677c459b86 comctl32/toolbar: Test that toolbar shouldn't use outside theme handles.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:57:46 +02:00