#ifndef _WX_EVENT_H__
#define _WX_EVENT_H__
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__)
-// Some older compilers (such as EMX) cannot handle
-// #pragma interface/implementation correctly, iff
-// #pragma implementation is used in _two_ translation
-// units (as created by e.g. event.cpp compiled for
-// libwx_base and event.cpp compiled for libwx_gui_core).
-// So we must not use those pragmas for those compilers in
-// such files.
- #pragma interface "event.h"
-#endif
-
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/clntdata.h"
// change the switch()es to if()s
//
// if these are real problems for you, define WXWIN_COMPATIBILITY_EVENT_TYPES
-// to get 100% old behaviour, however you won't be able to use the libraries
-// using the new dynamic event type allocation in such case, so avoid it if
-// possible.
+// as 1 to get 100% old behaviour, however you won't be able to use the
+// libraries using the new dynamic event type allocation in such case, so avoid
+// it if possible.
+#ifndef WXWIN_COMPATIBILITY_EVENT_TYPES
+ #define WXWIN_COMPATIBILITY_EVENT_TYPES 0
+#endif
#if WXWIN_COMPATIBILITY_EVENT_TYPES
DECLARE_EVENT_TYPE(wxEVT_SCROLL_PAGEDOWN, 305)
DECLARE_EVENT_TYPE(wxEVT_SCROLL_THUMBTRACK, 306)
DECLARE_EVENT_TYPE(wxEVT_SCROLL_THUMBRELEASE, 307)
-#if wxABI_VERSION >= 20601
DECLARE_EVENT_TYPE(wxEVT_SCROLL_CHANGED, 308)
-#endif
// Scroll events from wxWindow
DECLARE_EVENT_TYPE(wxEVT_SCROLLWIN_TOP, 320)
};
#endif
-#ifdef __VISUALC__
- // 'this' : used in base member initializer list (for m_commandString)
- #if _MSC_VER > 1100
- #pragma warning(push)
- #endif
- #pragma warning(disable:4355)
-#endif
-
class WXDLLIMPEXP_CORE wxCommandEvent : public wxEvent
{
public:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCommandEvent)
};
-#if defined(__VISUALC__) && (_MSC_VER > 1100)
- #pragma warning(pop)
-#endif
-
#if WXWIN_COMPATIBILITY_2_4
inline void wxCommandEventStringHelper::operator=(const wxString &str)
{
wxSize GetSize() const { return m_size; }
wxRect GetRect() const { return m_rect; }
- void SetRect(wxRect rect) { m_rect = rect; }
+ void SetRect(const wxRect& rect) { m_rect = rect; }
virtual wxEvent *Clone() const { return new wxSizeEvent(*this); }
wxPoint GetPosition() const { return m_pos; }
void SetPosition(const wxPoint& pos) { m_pos = pos; }
wxRect GetRect() const { return m_rect; }
- void SetRect(wxRect rect) { m_rect = rect; }
+ void SetRect(const wxRect& rect) { m_rect = rect; }
virtual wxEvent *Clone() const { return new wxMoveEvent(*this); }
#define EVT_SCROLL_PAGEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(func))
#define EVT_SCROLL_THUMBTRACK(func) wx__DECLARE_EVT0(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(func))
#define EVT_SCROLL_THUMBRELEASE(func) wx__DECLARE_EVT0(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(func))
-#if wxABI_VERSION >= 20601
#define EVT_SCROLL_CHANGED(func) wx__DECLARE_EVT0(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(func))
-#define wx__EVT_SCROLL_CHANGED(func) EVT_SCROLL_CHANGED(func)
-#else
-#define wx__EVT_SCROLL_CHANGED(func)
-#endif
#define EVT_SCROLL(func) \
EVT_SCROLL_TOP(func) \
EVT_SCROLL_PAGEDOWN(func) \
EVT_SCROLL_THUMBTRACK(func) \
EVT_SCROLL_THUMBRELEASE(func) \
- wx__EVT_SCROLL_CHANGED(func)
+ EVT_SCROLL_CHANGED(func)
// Scrolling from wxSlider and wxScrollBar, with an id
#define EVT_COMMAND_SCROLL_TOP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_TOP, winid, wxScrollEventHandler(func))
#define EVT_COMMAND_SCROLL_PAGEDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_PAGEDOWN, winid, wxScrollEventHandler(func))
#define EVT_COMMAND_SCROLL_THUMBTRACK(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBTRACK, winid, wxScrollEventHandler(func))
#define EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBRELEASE, winid, wxScrollEventHandler(func))
-#if wxABI_VERSION >= 20601
#define EVT_COMMAND_SCROLL_CHANGED(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_CHANGED, winid, wxScrollEventHandler(func))
-#define wx__EVT_COMMAND_SCROLL_CHANGED(winid, func) EVT_COMMAND_SCROLL_CHANGED(winid, func)
-#else
-#define wx__EVT_COMMAND_SCROLL_CHANGED(winid, func)
-#endif
#define EVT_COMMAND_SCROLL(winid, func) \
EVT_COMMAND_SCROLL_TOP(winid, func) \
EVT_COMMAND_SCROLL_PAGEDOWN(winid, func) \
EVT_COMMAND_SCROLL_THUMBTRACK(winid, func) \
EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) \
- wx__EVT_COMMAND_SCROLL_CHANGED(winid, func)
+ EVT_COMMAND_SCROLL_CHANGED(winid, func)
// compatibility macros for the old name, to be deprecated in 2.8
-//
-// note that simply #defines suffice for the macro names as they're only
-// present in the source code and macros are enough to maintain source
-// backwards compatibility, but that we have to ensure that we also have
-// wxEVT_SCROLL_ENDSCROLL inside the library for binary backwards compatibility
-// and this is done in event.cpp
-#if wxABI_VERSION >= 20601
#define wxEVT_SCROLL_ENDSCROLL wxEVT_SCROLL_CHANGED
#define EVT_COMMAND_SCROLL_ENDSCROLL EVT_COMMAND_SCROLL_CHANGED
#define EVT_SCROLL_ENDSCROLL EVT_SCROLL_CHANGED
-#endif
// Convenience macros for commonly-used commands
#define EVT_CHECKBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHECKBOX_CLICKED, winid, wxCommandEventHandler(func))
// Find a window with the focus, that is also a descendant of the given window.
// This is used to determine the window to initially send commands to.
-wxWindow* wxFindFocusDescendant(wxWindow* ancestor);
+WXDLLIMPEXP_CORE wxWindow* wxFindFocusDescendant(wxWindow* ancestor);
#endif // wxUSE_GUI