X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/89511b42686033f8cb7e8a110580847bc2470b08..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/msw/menu.h diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index 4c5e95f5ad..5f4c9f1853 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: Vadim Zeitlin (wxMenuItem is now in separate file) // Created: 01/02/97 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -61,6 +60,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 +127,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 +196,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;