+// ============================================================================
+// implementation
+// ============================================================================
+
+// Menus
+
+// Construct a menu with optional title (then use append)
+wxMenu::wxMenu(const wxString& title, const wxFunction func)
+{
+ m_title = title;
+ m_parent = NULL;
+ m_eventHandler = this;
+ m_noItems = 0;
+ m_menuBar = NULL;
+ if (m_title != "")
+ {
+ Append(-2, m_title) ;
+ AppendSeparator() ;
+ }
+
+ Callback(func);
+
+ // TODO create menu
+}
+
+// The wxWindow destructor will take care of deleting the submenus.
+wxMenu::~wxMenu()
+{
+ // TODO destroy menu and children
+
+ wxNode *node = m_menuItems.First();
+ while (node)
+ {
+ wxMenuItem *item = (wxMenuItem *)node->Data();
+
+ // Delete child menus.
+ // Beware: they must not be appended to children list!!!
+ // (because order of delete is significant)
+ if (item->GetSubMenu())
+ item->DeleteSubMenu();
+
+ wxNode *next = node->Next();
+ delete item;
+ delete node;
+ node = next;
+ }
+}
+
+void wxMenu::Break()