]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/event.h
Added IRIX compile fixes
[wxWidgets.git] / include / wx / event.h
index e65b2333e66e46440cae9fc61dcd490333ca63c0..418cfd5aae492758548c41eb85dbde3e0b011fdb 100644 (file)
@@ -9,8 +9,8 @@
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifndef __EVENTH__
-#define __EVENTH__
+#ifndef _WX_EVENTH__
+#define _WX_EVENTH__
 
 #ifdef __GNUG__
 #pragma interface "event.h"
@@ -395,6 +395,7 @@ class WXDLLEXPORT wxScrollEvent: public wxCommandEvent
  wxEVT_NC_RIGHT_DCLICK,
 */
 
+class WXDLLEXPORT wxDC;
 class WXDLLEXPORT wxMouseEvent: public wxEvent
 {
   DECLARE_DYNAMIC_CLASS(wxMouseEvent)
@@ -907,6 +908,46 @@ class WXDLLEXPORT wxSysColourChangedEvent: public wxEvent
      { m_eventType = wxEVT_SYS_COLOUR_CHANGED; }
 };
 
+/*
+ wxEVT_PALETTE_CHANGED
+ */
+
+class WXDLLEXPORT wxPaletteChangedEvent: public wxEvent
+{
+  DECLARE_DYNAMIC_CLASS(wxPaletteChangedEvent)
+
+public:
+  inline wxPaletteChangedEvent(wxWindowID id = 0): wxEvent(id)
+     { m_eventType = wxEVT_PALETTE_CHANGED; m_changedWindow = NULL; }
+
+  inline void SetChangedWindow(wxWindow* win) { m_changedWindow = win; }
+  inline wxWindow* GetChangedWindow() const { return m_changedWindow; }
+
+protected:
+  wxWindow*     m_changedWindow;
+};
+
+/*
+ wxEVT_QUERY_NEW_PALETTE
+ Indicates the window is getting keyboard focus and should re-do its palette.
+ */
+
+class WXDLLEXPORT wxQueryNewPaletteEvent: public wxEvent
+{
+  DECLARE_DYNAMIC_CLASS(wxQueryNewPaletteEvent)
+
+public:
+  inline wxQueryNewPaletteEvent(wxWindowID id = 0): wxEvent(id)
+     { m_eventType = wxEVT_QUERY_NEW_PALETTE; m_paletteRealized = FALSE; }
+
+  // App sets this if it changes the palette.
+  inline void SetPaletteRealized(bool realized) { m_paletteRealized = realized; }
+  inline bool GetPaletteRealized() const { return m_paletteRealized; }
+
+protected:
+  bool      m_paletteRealized;
+};
+
 /*
  Event generated by dialog navigation keys
  wxEVT_NAVIGATION_KEY
@@ -940,8 +981,6 @@ public:
  wxEVT_DESTROY,
  wxEVT_MOUSE_CAPTURE_CHANGED,
  wxEVT_SETTING_CHANGED, // WM_WININICHANGE (NT) / WM_SETTINGCHANGE (Win95)
- wxEVT_QUERY_NEW_PALETTE,
- wxEVT_PALETTE_CHANGED,
 // wxEVT_FONT_CHANGED,  // WM_FONTCHANGE: roll into wxEVT_SETTING_CHANGED, but remember to propagate
                         // wxEVT_FONT_CHANGED to all other windows (maybe).
  wxEVT_DRAW_ITEM, // Leave these three as virtual functions in wxControl?? Platform-specific.
@@ -1046,6 +1085,8 @@ typedef void (wxEvtHandler::*wxShowEventFunction)(wxShowEvent&);
 typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxShowEvent&);
 typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxShowEvent&);
 typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&);
+typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&);
+typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&);
 
 // N.B. In GNU-WIN32, you *have* to take the address of a member function
 // (use &) or the compiler crashes...
@@ -1097,6 +1138,8 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
 #define EVT_MAXIMIZE(func) { wxEVT_MAXIMIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMaximizeEventFunction) & func, NULL },
 #define EVT_ICONIZE(func) { wxEVT_ICONIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIconizeEventFunction) & func, NULL },
 #define EVT_NAVIGATION_KEY(func) { wxEVT_NAVIGATION_KEY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNavigationKeyEventFunction) & func, NULL },
+#define EVT_PALETTE_CHANGED(func) { wxEVT_PALETTE_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaletteChangedEventFunction) & func, NULL },
+#define EVT_QUERY_NEW_PALETTE(func) { wxEVT_QUERY_NEW_PALETTE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, NULL },
 
 // Mouse events
 #define EVT_LEFT_DOWN(func) { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, NULL },
@@ -1226,4 +1269,4 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
  { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, NULL },\
 
 #endif
-       // __EVENTH__
+       // _WX_EVENTH__