virtual void SetTitle(const wxString& title);
+ // MSW-only methods
+ // ----------------
+
+ // Create a new menu from the given native HMENU. Takes ownership of the
+ // menu handle and will delete it when this object is destroyed.
+ static wxMenu *MSWNewFromHMENU(WXHMENU hMenu) { return new wxMenu(hMenu); }
+
+
// implementation only from now on
// -------------------------------
virtual wxMenuItem* DoRemove(wxMenuItem *item);
private:
- // common part of all ctors
+ // This constructor is private, use MSWNewFromHMENU() to use it.
+ wxMenu(WXHMENU hMenu);
+
+ // Common part of all ctors, it doesn't create a new HMENU.
+ void InitNoCreate();
+
+ // Common part of all ctors except of the one above taking a native menu
+ // handler: calls InitNoCreate() and also creates a new menu.
void Init();
// common part of Append/Insert (behaves as Append is pos == (size_t)-1)
virtual wxMenu *Remove(size_t pos);
virtual void EnableTop( size_t pos, bool flag );
+ virtual bool IsEnabledTop(size_t pos) const;
virtual void SetMenuLabel( size_t pos, const wxString& label );
virtual wxString GetMenuLabel( size_t pos ) const;