http://bugs.winehq.org/show_bug.cgi?id=27920
Summary: ComboBoxEx doesn't process WM_ENABLE properly Product: Wine Version: 1.3.25 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: comctl32 AssignedTo: wine-bugs@winehq.org ReportedBy: lightning_uk@imgburn.com
Created an attachment (id=35721) --> (http://bugs.winehq.org/attachment.cgi?id=35721) Test / Demo App
Unlike ComboBox, ComboBoxEx doesn't appear to process WM_ENABLE properly.
Its 'look' never changes from the initial one - be that enabled or disabled.
So if it's disabled when created, it'll stay looking disabled even after you've enabled it. If it's enabled when created, it'll stay looking enabled even after you've disabled it.
If disabled when created, you can't interact with it (get it to drop down etc) even when you've supposedly enabled it.
The above can be fixed by handling WM_ENABLE in COMBOEX_WindowProc.
Something like the following does the trick (idea taken from combo.c)...
case WM_ENABLE: if( infoPtr->hwndEdit ) EnableWindow( infoPtr->hwndEdit, (BOOL)wParam ); EnableWindow( infoPtr->hwndCombo, (BOOL)wParam );
/* Force the control to repaint when the enabled state changes. */ InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); return TRUE;
Once that has been added, you see another problem with the control...
When disabled, it doesn't draw the contents of the combobox - compared to Windows (Vista/7 anyway), that's wrong.
Windows greys the control (drop down arrow etc) out but the image+text remain visible and 'normal' colour.
That can be fixed by commenting out the following line in COMBOEX_DrawItem
if (!IsWindowEnabled(infoPtr->hwndCombo)) return 0;
I've added a demo app attachment that shows the problem with ComboBoxEx. You should notice that if you press the 'Enable' button before the 'Show' button, the ComboBoxEx control looks and behaves differently to if you press 'Show' and then 'Enable'.
There's a traditional ComboBox on the form too just for comparison.
http://bugs.winehq.org/show_bug.cgi?id=27920
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|wine-bugs@winehq.org |bunglehead@gmail.com
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com 2011-07-31 15:10:27 CDT --- Okay, I'll take a look.
http://bugs.winehq.org/show_bug.cgi?id=27920
--- Comment #2 from LIGHTNING UK! lightning_uk@imgburn.com 2011-07-31 15:17:52 CDT --- Thanks.
I did actually send in a patch earlier today (under my real name) but I'm sure you know more about this stuff than I do :)
http://bugs.winehq.org/show_bug.cgi?id=27920
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com 2011-07-31 15:30:27 CDT --- (In reply to comment #2)
Thanks.
I did actually send in a patch earlier today (under my real name) but I'm sure you know more about this stuff than I do :)
You're probably not subscribed to wine-patches, so your mail is pre-moderated.
Could you attach sources for that test app?
http://bugs.winehq.org/show_bug.cgi?id=27920
--- Comment #4 from LIGHTNING UK! lightning_uk@imgburn.com 2011-07-31 16:22:07 CDT --- It's a Delphi app so they wouldn't be of much use.
All clicking on the buttons do is something like this:
Show Button -> ComboBoxEx1.Visible := True; ComboBox1.Visible := True; Hide Button -> ComboBoxEx1.Visible := False; ComboBox1.Visible := False; Enable Button -> ComboBoxEx1.Enable:= True; ComboBox1.Enable:= True; Disable Button -> ComboBoxEx1.Enable:= False; ComboBox1.Enable:= False;
Both of the comboboxes are set to 'drop down list' style (so no 'edit' box).
As a side note (and not something my patch did anything about), if the ComboBoxEx items have images, they aren't displayed in the same way as they are in Windows.
In Windows, only the currently selected item (the one shown in the control) uses the 'selected' image - highlighting them in the drop down list does NOT make them selected in the sense that they should suddenly use the selected image, which is what happens under Wine.
Also, under Wine, when the comboboex loses focus (even just when displaying the drop down list), the item shown in the control stops being displayed with its selected image. That doesn't happen in Windows.
I have an updated demo where the comboboxex items have images associated with them if you fancy tackling that issue?!
http://bugs.winehq.org/show_bug.cgi?id=27920
--- Comment #5 from LIGHTNING UK! lightning_uk@imgburn.com 2011-07-31 16:53:09 CDT --- Created an attachment (id=35761) --> (http://bugs.winehq.org/attachment.cgi?id=35761) Updated Demo / Test App where items have images
http://bugs.winehq.org/show_bug.cgi?id=27920
--- Comment #6 from LIGHTNING UK! lightning_uk@imgburn.com 2011-08-02 15:12:41 CDT --- Ok so my 1st attempt with the patch was marked 'Apply failure', as was my 2nd attempt - so now I just give up.
I'll leave it to someone that know what they're doing.
Hopefully it'll get done sooner rather than later because now I've worked around bug 27559 in my code, people will just end up seeing empty ComboBoxEx controls in my program that they can't do anything with.
http://bugs.winehq.org/show_bug.cgi?id=27920
Stefan Leichter Stefan.Leichter@camLine.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |Stefan.Leichter@camLine.com
--- Comment #7 from Stefan Leichter Stefan.Leichter@camLine.com 2011-08-02 16:43:34 CDT --- (In reply to comment #6)
Ok so my 1st attempt with the patch was marked 'Apply failure', as was my 2nd attempt - so now I just give up.
You may have more luck if you attach the patches to the mail. It looks to me like your mailer changes TABs to spaces.
http://bugs.winehq.org/show_bug.cgi?id=27920
--- Comment #8 from LIGHTNING UK! lightning_uk@imgburn.com 2011-08-02 17:57:36 CDT --- (In reply to comment #7)
You may have more luck if you attach the patches to the mail. It looks to me like your mailer changes TABs to spaces.
Ok, thanks for the tip.
I've given it one last shot.
My patches don't fix the image drawing issues with ComboBoxEx though.
http://bugs.winehq.org/show_bug.cgi?id=27920
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bunglehead@gmail.com |wine-bugs@winehq.org
http://bugs.winehq.org/show_bug.cgi?id=27920
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #9 from Nikolay Sivov bunglehead@gmail.com 2011-08-05 20:11:47 CDT --- This is fixed with f9d9720d251567e2e9142c078f65095f8e980609 and 5495b53eb12936077050b64c8e481978cc0d8e4a. Please open new bug for image drawing problem.
http://bugs.winehq.org/show_bug.cgi?id=27920
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org 2011-08-26 13:24:02 CDT --- Closing bugs fixed in 1.3.27.
http://bugs.winehq.org/show_bug.cgi?id=27920
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |f9d9720d251567e2e9142c078f6 | |5095f8e980609