]> git.saurik.com Git - wxWidgets.git/commitdiff
RTTI accessors for menus
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 25 Aug 2003 23:26:49 +0000 (23:26 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 25 Aug 2003 23:26:49 +0000 (23:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/menu.h

index 89d78c23b23c776ebcc6b34a6e7e7973cb260282..071ea344633f5629d5df38b35f21b00ce3e7686d 100644 (file)
@@ -123,10 +123,29 @@ private:
 // Menu Bar (a la Windows)
 // ----------------------------------------------------------------------------
 
+class WXDLLEXPORT wxMenuInfo : public wxObject
+{
+public :
+    wxMenuInfo() { m_menu = NULL ; }
+    virtual ~wxMenuInfo() { }
+
+    void Create( wxMenu *menu , const wxString &title ) 
+    { m_menu = menu ; m_title = title ; }
+    wxMenu* GetMenu() const { return m_menu ; }
+    wxString GetTitle() const { return m_title ; }
+private :
+    wxMenu *m_menu ;
+    wxString m_title ;
+
+    DECLARE_DYNAMIC_CLASS(wxMenuInfo) ;
+} ;
+
+WX_DECLARE_EXPORTED_LIST(wxMenuInfo, wxMenuInfoList );
+
 class WXDLLEXPORT wxMenuBar : public wxMenuBarBase
 {
 public:
-    // ctors & dtor
+    // ctors & dtor 
         // default constructor
     wxMenuBar();
         // unused under MSW
@@ -136,6 +155,9 @@ public:
     virtual ~wxMenuBar();
 
     // menubar construction
+    bool Append( wxMenuInfo *info ) { return Append( info->GetMenu() , info->GetTitle() ) ; }
+    const wxMenuInfoList& GetMenuInfos() const ;
+
     virtual bool Append( wxMenu *menu, const wxString &title );
     virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
     virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
@@ -179,7 +201,8 @@ protected:
     // common part of all ctors
     void Init();
 
-    wxArrayString m_titles;
+    wxArrayString m_titles ;
+    wxMenuInfoList m_menuInfos;
 
     WXHMENU       m_hMenu;