diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index 8fa2b75a7a..31d104bccf 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -55,11 +55,12 @@ public: // Don't use this object after calling this method. WXHMENU MSWDetachHMENU() { WXHMENU m = m_hMenu; m_hMenu = NULL; return m; } + // Process WM_COMMAND. + virtual bool MSWCommand(WXUINT param, WXWORD id); + // implementation only from now on // ------------------------------- - bool MSWCommand(WXUINT param, WXWORD id); - // get the native menu handle WXHMENU GetHMenu() const { return m_hMenu; } diff --git a/interface/wx/menu.h b/interface/wx/menu.h index 8859dfd683..08c7c1f5c0 100644 --- a/interface/wx/menu.h +++ b/interface/wx/menu.h @@ -931,6 +931,33 @@ public: */ bool IsEnabled(int id) const; + /** + Allows handling native MSW menu command messages. + + This is a low-level function which allows handling MSW @c WM_COMMAND + messages generated when menu items are selected. It is particularly + useful for the popup menus, as specific handling can then be defined in + a wxMenu-derived class directly, instead of in the wxWindow-derived + owner class. + + The base class version of this function generates @c wxEVT_MENU command + events. + + @param param + The MSW command parameter. + + @param id + The id of the command. + + @return + @true if the command was handled, @false otherwise. + + @onlyfor{wxMSW} + + @since 3.1.5 + */ + virtual bool MSWCommand(WXUINT param, WXWORD id); + /** Inserts the given @a item at position 0, i.e.\ before all the other existing items.