Commit Graph

4624 Commits

Author SHA1 Message Date
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
Zhiyi Zhang a769679113 comctl32/toolbar: Remove a redundant theme handle check in TOOLBAR_NCCreate().
This is a no-op. In TOOLBAR_NCCreate(), GetWindowTheme() always returns NULL because the theme
handle is not open by OpenThemeData() by that time. Also tests show that TBSTYLE_TRANSPARENT is not
added when theming is active.

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 02bfec6419 comctl32/treeview: Draw parent background before drawing control parts.
Fix residual glyphs on background when drawing treeview buttons with themes that contains
transparent button glyphs.

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 f8671aaedd comctl32/theme_scrollbar: Draw parent background before drawing control parts.
Control parts may be transparent, thus they need to be drawn on top of parent window background.
Otherwise, black artifacts may occur.

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 e9a5cd2e5a comctl32/tests: Add UDS_SETBUDDY tests.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-22 17:57:46 +02:00
Andrew Eikum ce8f724740 comctl32: Avoid gcc 11 maybe-uninitialized warning.
dlls/comctl32/monthcal.c:1783:19: warning: ‘htinfo.uHit’ may be used uninitialized [-Wmaybe-uninitialized]

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 21:41:15 +02:00
Hugh McMaster daf95aaadf comctl32/listview: Initialize marqueeRect from left-click coordinates before starting a marquee highlight.
The infoPtr->marqueeRect structure is not currently initialized before the
marquee highlight sequence starts, resulting in the RECT having initial
coordinates of (0,0)-(0,0). These coordinates cause the first item in
the listview control to be identified as being within the range of the
marqueeRect's coordinates.

That item is then set to LVIS_SELECTED even though it is not part of the
marquee selection.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 23:19:53 +02:00
Zhiyi Zhang 2de05267d7 comctl32/theme_dialog: Pass the WM_SYSCOLORCHANGE message to the original dialog procedure.
Even though themed dialog itself doesn't need to repaint after WM_SYSCOLORCHANGE is received,
WM_SYSCOLORCHANGE should be passed to the original dialog procedure DefDlgProcW(), which can then
forward WM_SYSCOLORCHANGE to its common controls and call COMCTL32_RefreshSysColors().

Fix wrong property sheet tab background color after winecfg disables theming.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44511
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-28 10:25:02 +02:00
Zhiyi Zhang 00e1664b0b comctl32/test: Test that WM_SYSCOLORCHANGE should always be passed to the dialog procedure.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-28 10:25:02 +02:00
Zhiyi Zhang 277daa7ea7 comctl32/theming: Register themed dialog and scrollbar even when theming is not active.
So that we can turn on theming in runtime. Otherwise, themed dialog and scrollbar
are not enabled even if a theme is made active in winecfg if theming is disabled at start.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44511
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-28 09:40:28 +02:00
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 a9eaf7a7da comctl32/tests: Test that WM_THEMECHANGED should invalidate client area.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-28 09:40:20 +02:00
Damjan Jovanovic 9b61a64601 comctl32: Send DTN_DATETIMECHANGE when the checkbox changes too.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=19756
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-23 20:02:07 +02:00
Nikolay Sivov b6b98933ec comctl32/tests: Remove unnecessary macro.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:34:17 +02:00
Nikolay Sivov 0bb8ddfd41 comctl32/tests: Add some tests for ComboEx callback functionality.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:34:15 +02:00
Nikolay Sivov 302c891eee comctl32/tests: Enable some ComboEx tests on version 6.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:34:13 +02:00
Nikolay Sivov bf1183654a comctl32/listview: Sort using duplicated items pointer array to preserve original order.
Issue reported by Haoyang Chen.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Nikolay Sivov fef35d7b5d comctl32/listview: Remove current sorting arguments from control structure.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Nikolay Sivov 043ecca384 comctl32: Fix DPA_GetPtr() prototype.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Zhiyi Zhang 52cdd22b52 comctl32/trackbar: Use correct state id for the focused thumb.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 21:43:27 +01:00
Zhiyi Zhang bde397d220 comctl32/toolbar: Use correct state id for checked items.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 21:43:27 +01:00
Zhiyi Zhang c703c96a78 comctl32/listview: Only draw themed frame when WS_EX_CLIENTEDGE is present.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 21:43:27 +01:00
Zhiyi Zhang 5ca79e66ad comctl32/hotkey: Implement themed frame painting.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 21:43:27 +01:00
Zhiyi Zhang 52992a99d6 comctl32/datetime: Implement themed painting.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 21:43:27 +01:00
Zhiyi Zhang 31fab6705a comctl32/edit: Call GetWindowTheme() only when necessary.
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 7951668581 comctl32/ipaddress: Do not open theme data in IPADDRESS_Draw().
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 161649e318 comctl32/combo: Subscribe to WM_MOUSELEAVE events.
Using WM_MOUSEMOVE events to determine whether the dropdown button is
hovered is unreliable and thus the dropdown button may stay in hovered
state even if mouse has left the window.

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 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 9dd0c07d7f comctl32/tests: Test themed painting after 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 c1395d9255 comctl32: Remove unnecessary OffsetRect() calls.
Target rectangles are already offset by previous OffsetRect() calls.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-01 10:10:54 +01:00
Zhiyi Zhang a8502312c6 comctl32: Fix memory leaks.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-01 10:09:31 +01:00
Zhiyi Zhang 7fba4ebba3 comctl32/listbox: Actually draw themed frame.
Previously, LISTBOX_NCPaint() is called and themed frame is drawn. And then DefWindowProcW() is
called with original clip region, overwriting the drawn themed frame.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-01 10:08:36 +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
Zhiyi Zhang d9b47aa303 comctl32/theme_scrollbar: Remove an unused variable.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 20:19:59 +01:00
Zhiyi Zhang 7315afbc13 comctl32/ipaddress: Only print an error when it actually occurs.
IPADDRESS_GetPartIndex() is also used for handling WM_KILLFOCUS
and WM_SETFOCUS messages. In this case, it's actually expected that the
window receiving or losing focus may not be a IP Address part window.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 18:48:07 +01:00
Gabriel Ivăncescu 4ac05afd39 comctl32: Remove the masked background when 32bpp bitmaps have no alpha values.
Fixes a regression introduced by 61b9209221.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50454
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-06 21:53:17 +01:00
Gabriel Ivăncescu a692a12541 comctl32/tests: Add more tests for 32bpp bitmaps with and without alpha, and masks.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-06 21:53:14 +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
Nikolay Sivov 564d5804b1 comctl32: Use wide-char string literals.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-16 17:51:30 +01:00
Nikolay Sivov c11fca37de comctl32/tests: Fix loop bounds.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-09 16:21:33 +02:00
Nikolay Sivov 573b3eb432 comctl32/ipaddress: Fix IPM_CLEARADDRESS return value.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-09 16:21:33 +02:00
Hirofumi Katayama 3c29108523 comctl32/ipaddress: Focus first field on WM_SETFOCUS.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49924
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-08 21:46:43 +02:00
Nikolay Sivov 6cfc5df3f5 comctl32/ipaddress: Fix IPM_SETFOCUS return value.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-08 21:46:43 +02:00
Nikolay Sivov 6f8957156e comctl32/ipaddress: Select field contents on IPM_SETFOCUS.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-08 21:46:43 +02:00
Nikolay Sivov 81727e1953 comctl32/tests: Remove skips from DPA tests.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-06 11:57:00 +02:00
Nikolay Sivov 120364fa9c comctl32/tests: Remove some workarounds from ListView tests.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 20:51:42 +02:00
Nikolay Sivov 4c86e860e6 comctl32/tests: Use wide strings literals.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 10:48:48 +02:00
Nikolay Sivov 9a5c9be164 comctl32/datetime: Do not call default procedure for WM_NCCREATE.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 10:48:45 +02:00