Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Menu items become owner drawn if created after wxCheckListBox
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jaakko Salli  
View profile  
 More options Oct 20 2009, 9:01 am
From: Jaakko Salli <jaakko.sa...@dnainternet.net>
Date: Tue, 20 Oct 2009 16:01:21 +0300
Local: Tues, Oct 20 2009 9:01 am
Subject: [wxMSW] Menu items become owner drawn if created after wxCheckListBox

Hi all,

Attached is a minimal sample (for SVN trunk) that demonstrates
a problem with wxCheckListBox on wxMSW. In essence, if radio
menu items (and possibly other types as well) are added after
wxCheckListBox has been created, then these menu items are
incorrectly marked as 'ownerdrawn' and will not get rendered
properly (their radio 'dot' is missing).

I have tracked this issue down to msw/ownerdrw.cpp, where
m_nMarginWidth member variable gets its initial value from
a static variable ms_nLastMarginWidth, which I think
wxCheckListBox will leave in inconsistent state. Then, in
wx/ownerdrw.h, SetMarginWidth() member function marks the
menu item as owner drawn since its m_nMarginWidth doesn't
match the default margin width.

Hopefully someone has an idea how to properly resolve this
issue.

BTW, I originally found this bug in wxPython 2.8.10.1, but it
could also be reproduced in wx2.9 trunk.

Thanks,
   Jaakko

[ checklistbox_problem.patch 1K ]
Index: samples/minimal/minimal.cpp
===================================================================
--- samples/minimal/minimal.cpp (revision 62459)
+++ samples/minimal/minimal.cpp (working copy)
@@ -141,6 +141,8 @@
 // main frame
 // --------------------------------------------------------------------------- -

+#include <wx/checklst.h>
+
 // frame constructor
 MyFrame::MyFrame(const wxString& title)
        : wxFrame(NULL, wxID_ANY, title)
@@ -148,6 +150,11 @@
     // set the frame icon
     SetIcon(wxICON(sample));

+    wxCheckListBox* clb = new wxCheckListBox(this, wxID_ANY);
+    clb->Append("Checkable Item 1");
+    clb->Append("Checkable Item 2");
+    clb->Append("Checkable Item 3");
+
 #if wxUSE_MENUS
     // create a menu bar
     wxMenu *fileMenu = new wxMenu;
@@ -156,6 +163,12 @@
     wxMenu *helpMenu = new wxMenu;
     helpMenu->Append(Minimal_About, "&About...\tF1", "Show about dialog");

+    fileMenu->AppendRadioItem(wxID_ANY, "Disabled");
+    fileMenu->AppendRadioItem(wxID_ANY, "Almost Enabled");
+    fileMenu->AppendRadioItem(wxID_ANY, "Enabled");
+
+    fileMenu->AppendSeparator();
+
     fileMenu->Append(Minimal_Quit, "E&xit\tAlt-X", "Quit this program");

     // now append the freshly created menu to the menu bar...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »