Use WM_INITMENUPOPUP

Added wxMenu member to wxMenuEvent


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-07-12 23:09:04 +00:00
parent 1b80d34a52
commit 92f1a59c28
8 changed files with 79 additions and 39 deletions

View File

@@ -1184,12 +1184,12 @@ private:
class WXDLLIMPEXP_CORE wxMenuEvent : public wxEvent
{
public:
wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0)
wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0, wxMenu* menu = NULL)
: wxEvent(winid, type)
{ m_menuId = winid; }
{ m_menuId = winid; m_menu = NULL; }
wxMenuEvent(const wxMenuEvent & event)
: wxEvent(event)
{ m_menuId = event.m_menuId; }
{ m_menuId = event.m_menuId; m_menu = event.m_menu; }
// only for wxEVT_MENU_HIGHLIGHT
int GetMenuId() const { return m_menuId; }
@@ -1197,10 +1197,14 @@ public:
// only for wxEVT_MENU_OPEN/CLOSE
bool IsPopup() const { return m_menuId == -1; }
// only for wxEVT_MENU_OPEN/CLOSE
wxMenu* GetMenu() const { return m_menu; }
virtual wxEvent *Clone() const { return new wxMenuEvent(*this); }
private:
int m_menuId;
int m_menuId;
wxMenu* m_menu;
DECLARE_DYNAMIC_CLASS(wxMenuEvent)
};

View File

@@ -146,8 +146,9 @@ public:
void OnMenuHighlight(wxMenuEvent& event);
#if wxUSE_MENUS
// send wxUpdateUIEvents for all menu items (called from OnIdle())
void DoMenuUpdates();
// send wxUpdateUIEvents for all menu items in the menubar,
// or just for menu if non-NULL
void DoMenuUpdates(wxMenu* menu = NULL);
#endif // wxUSE_MENUS
// do the UI update processing for this window

View File

@@ -102,6 +102,12 @@ public:
// current size - this has an effect of refreshing the window layout
virtual void SendSizeEvent();
#ifdef __WXWINCE__
WXHWND GetCommandBar() { return m_commandBar; }
WXHWND CreateCommandBar() ;
void RemoveCommandBar() ;
#endif
protected:
// common part of all ctors
void Init();
@@ -128,8 +134,8 @@ protected:
// window proc for the frames
long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
// handle WM_INITMENU message
bool HandleInitMenu();
// handle WM_INITMENUPOPUP message
bool HandleInitMenuPopup(WXHMENU hMenu);
virtual bool IsMDIChild() const { return FALSE; }

View File

@@ -332,8 +332,7 @@
* Presently, only Windows and GTK+ support wxEVT_MENU_OPEN.
*/
#ifndef wxUSE_IDLEMENUUPDATES
#if (defined(__WXMSW__) && !defined(__WXWINCE)) ||\
defined(__WXGTK__)
#if defined(__WXMSW__) || defined(__WXGTK__)
#define wxUSE_IDLEMENUUPDATES 0
#else
#define wxUSE_IDLEMENUUPDATES 1