]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/event.h
applied patch 430452 (mingw32 compilation fixes)
[wxWidgets.git] / include / wx / event.h
index f7bddba9b73a45d2168bfef1204a09c80e3455b8..cb13126bf640efda35f54da254d44c0bcf4250e3 100644 (file)
@@ -961,7 +961,6 @@ public:
  wxEVT_MENU_INIT,
  wxEVT_MENU_HIGHLIGHT,
  wxEVT_POPUP_MENU_INIT,
- wxEVT_CONTEXT_MENU,
 */
 
 class WXDLLEXPORT wxMenuEvent : public wxEvent
@@ -1044,10 +1043,7 @@ protected:
 
 class WXDLLEXPORT wxShowEvent : public wxEvent
 {
-    DECLARE_DYNAMIC_CLASS(wxShowEvent)
-
 public:
-
     wxShowEvent(int id = 0, bool show = FALSE)
         { m_eventType = wxEVT_SHOW; m_id = id; m_show = show; }
 
@@ -1058,6 +1054,8 @@ public:
 
 protected:
     bool m_show;
+
+    DECLARE_DYNAMIC_CLASS(wxShowEvent)
 };
 
 /*
@@ -1066,11 +1064,17 @@ protected:
 
 class WXDLLEXPORT wxIconizeEvent : public wxEvent
 {
-    DECLARE_DYNAMIC_CLASS(wxIconizeEvent)
-
 public:
-    wxIconizeEvent(int id = 0)
-        { m_eventType = wxEVT_ICONIZE; m_id = id; }
+    wxIconizeEvent(int id = 0, bool iconized = TRUE)
+        { m_eventType = wxEVT_ICONIZE; m_id = id; m_iconized = iconized; }
+
+    // return true if the frame was iconized, false if restored
+    bool Iconized() const { return m_iconized; }
+
+protected:
+    bool m_iconized;
+
+    DECLARE_DYNAMIC_CLASS(wxIconizeEvent)
 };
 
 /*
@@ -1079,11 +1083,11 @@ public:
 
 class WXDLLEXPORT wxMaximizeEvent : public wxEvent
 {
-    DECLARE_DYNAMIC_CLASS(wxMaximizeEvent)
-
 public:
-  wxMaximizeEvent(int id = 0)
-      { m_eventType = wxEVT_MAXIMIZE; m_id = id; }
+    wxMaximizeEvent(int id = 0)
+        { m_eventType = wxEVT_MAXIMIZE; m_id = id; }
+
+    DECLARE_DYNAMIC_CLASS(wxMaximizeEvent)
 };
 
 // Joystick event class
@@ -1425,6 +1429,37 @@ private:
     DECLARE_DYNAMIC_CLASS(wxHelpEvent)
 };
 
+// A Context event is sent when the user right clicks on a window or
+// presses Shift-F10
+// NOTE : Under windows this is a repackaged WM_CONTETXMENU message
+//        Under other systems it may have to be generated from a right click event
+/*
+ wxEVT_CONTEXT_MENU
+*/
+
+class WXDLLEXPORT wxContextMenuEvent : public wxCommandEvent
+{
+public:
+    wxContextMenuEvent(wxEventType type = wxEVT_NULL,
+                wxWindowID id = 0,
+                const wxPoint& pt = wxDefaultPosition)
+    {
+        m_eventType = type;
+        m_id = id;
+        m_pos = pt;
+    }
+
+    // Position of event (in screen coordinates)
+    const wxPoint& GetPosition() const { return m_pos; }
+    void SetPosition(const wxPoint& pos) { m_pos = pos; }
+
+protected:
+    wxPoint   m_pos;
+
+private:
+    DECLARE_DYNAMIC_CLASS(wxContextMenuEvent)
+};
+
 #endif // wxUSE_GUI
 
 // Idle event
@@ -1705,6 +1740,7 @@ typedef void (wxEvtHandler::*wxWindowDestroyEventFunction)(wxWindowDestroyEvent&
 typedef void (wxEvtHandler::*wxSetCursorEventFunction)(wxSetCursorEvent&);
 typedef void (wxEvtHandler::*wxNotifyEventFunction)(wxNotifyEvent&);
 typedef void (wxEvtHandler::*wxHelpEventFunction)(wxHelpEvent&);
+typedef void (wxEvtHandler::*wxContextMenuEventFunction)(wxContextMenuEvent&);
 #endif // wxUSE_GUI
 
 // N.B. In GNU-WIN32, you *have* to take the address of a member function
@@ -1935,6 +1971,10 @@ typedef void (wxEvtHandler::*wxHelpEventFunction)(wxHelpEvent&);
 #define EVT_DETAILED_HELP_RANGE(id1, id2, func) \
  DECLARE_EVENT_TABLE_ENTRY( wxEVT_DETAILED_HELP, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxHelpEventFunction) & func, (wxObject *) NULL ),
 
+// Context Menu Events
+#define EVT_CONTEXT_MENU(func) \
+ DECLARE_EVENT_TABLE_ENTRY(wxEVT_CONTEXT_MENU, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxContextMenuEventFunction) & func, (wxObject *) NULL ),
+
 // ----------------------------------------------------------------------------
 // Global data
 // ----------------------------------------------------------------------------