Bug #18718 2012-08-31 10:51

codedwarf

wxSmith does not save selected check menu settings

This bug was seen with C:B 10.5 release and in the last two nightly builds, currently I am using 8248 (Aug, 25th 2012).

Bug is repeatable:

Create menu entries in wxSmith, and make them 'checkable'. Now set some of the entries to 'Checked' in wxSmith.

wxSmith creates correct code, ie. it inserts lines

'MenuItem6->Check(true);'

But somehow it seems not to save this - if you close the project, or close the wxSmith sheet (name.wxs), and reopen it, it has all the menus correctly, but the 'Checked' box is now empty, and the code

..->Check(true) is removed.

I have only tried this under Windows, but I suspect this is a generic bug.

Category
Plugin::wxSmith
Group
Platform:Windows
Status
Closed
Close date
2012-09-03 07:58
Assigned to
ollydbg
codedwarf 2012-08-31 10:55

Sorry - overlooked 17078 - this seems to be a duplicate

CodeDwarf

ollydbg 2012-09-01 13:47

Add the link to bug 17078.

https://developer.berlios.de/bugs/?func=detailbug&bug_id=17078&group_id=5358

It looks like there is not way to quick jump to that bug report.

ollydbg 2012-09-02 14:31
I'm testing a patch to fix this problem, the patch is quite simple, tested without any problem. see below:

Index: E:/code/cb/cleantrunk/src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsmenuitem.cpp
===================================================================
--- E:/code/cb/cleantrunk/src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsmenuitem.cpp	(revision 8249)
+++ E:/code/cb/cleantrunk/src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsmenuitem.cpp	(working copy)
@@ -279,6 +279,11 @@
                 if ( Node && (cbC2U(Node->GetText())==_T("1")) )
                 {
                     m_Type = Check;
+                    // Now, we are going to check its state, either checked or not checked
+                    TiXmlElement* checkedNode = Element->FirstChildElement("checked");
+                    if (checkedNode && (cbC2U(checkedNode->GetText())==_T("1")))
+                        m_Checked = true;
+                    // otherwise, the m_Checked will default to false.
                 }
                 else
                 {
ollydbg 2012-09-03 07:58

Fixed in the trunk rev 8337.