X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/89511b42686033f8cb7e8a110580847bc2470b08..11e3c6ef36393fb5863ea2f9601d8facd73acb12:/include/wx/msw/menu.h?ds=inline diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index 4c5e95f5ad..0e7c6c52f0 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -61,6 +61,14 @@ public: 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 // ------------------------------- @@ -120,7 +128,14 @@ protected: 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) @@ -182,6 +197,7 @@ public: 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;