Patch #2024 2007-05-28 19:37

raph_

wxSmith: MenuEditor loosing variable and member state
Download
2024-wxSmith_MenuEd.patch (2.1 KB)
Category
Plugin::Bugfix
Status
Accepted
Close date
2007-05-28 21:44
Assigned to
 
Index: wxSmith/wxwidgets/defitems/wxsmenueditor.cpp
===================================================================
--- wxSmith/wxwidgets/defitems/wxsmenueditor.cpp    (revision 4006)
+++ wxSmith/wxwidgets/defitems/wxsmenueditor.cpp    (working copy)
@@ -244,6 +244,8 @@
         wxsMenu* ChildMenu = (wxsMenu*)Menu->GetChild(i);
         MenuItem* ChildItem = new MenuItem;
         ChildItem->m_Type = wxsMenuItem::Normal;
+        ChildItem->m_Variable = ChildMenu->GetVarName();
+        ChildItem->m_IsMember = ChildMenu->GetIsMember();
         ChildItem->m_Label = ChildMenu->m_Label;
         ChildItem->m_Enabled = true;
         ChildItem->m_Checked = false;
@@ -266,6 +268,8 @@
 void wxsMenuEditor::CreateDataCopyReq(wxsMenuItem* Menu,MenuItem* Parent)
 {
     Parent->m_Type = Menu->m_Type;
+    Parent->m_Variable = Menu->GetVarName();
+    Parent->m_IsMember = Menu->GetIsMember();
     Parent->m_Id = Menu->GetIdName();
     Parent->m_Label = Menu->m_Label;
     Parent->m_Accelerator = Menu->m_Accelerator;
@@ -507,6 +511,8 @@
             {
                 wxsMenu* NewMenu = new wxsMenu(m_MenuBar->GetResourceData());
                 NewMenu->m_Label = Item->m_Label;
+                NewMenu->SetVarName(Item->m_Variable);
+                NewMenu->SetIsMember(Item->m_IsMember);
                 m_MenuBar->AddChild(NewMenu);
                 StoreDataCopyReq(NewMenu,Item->m_Child);
             }
@@ -539,6 +545,8 @@
             continue;
         }
 
+        Menu->SetVarName(Item->m_Variable);
+        Menu->SetIsMember(Item->m_IsMember);
         Menu->SetIdName(_T(""));
         Menu->m_Label.Clear();
         Menu->m_Accelerator.Clear();
Index: wxSmith/wxwidgets/defitems/wxsmenueditor.h
===================================================================
--- wxSmith/wxwidgets/defitems/wxsmenueditor.h    (revision 4006)
+++ wxSmith/wxwidgets/defitems/wxsmenueditor.h    (working copy)
@@ -48,6 +48,8 @@
         struct MenuItem
         {
             Type      m_Type;
+            wxString  m_Variable;
+            bool      m_IsMember;
             wxString  m_Id;
             wxString  m_Label;
             wxString  m_Accelerator;