class WXDLLIMPEXP_CORE wxWindowBase;
#endif // wxUSE_GUI
+class WXDLLIMPEXP_BASE wxEvtHandler;
+
// ----------------------------------------------------------------------------
// Event types
// ----------------------------------------------------------------------------
public:
wxNavigationKeyEvent()
: wxEvent(0, wxEVT_NAVIGATION_KEY),
- m_flags(IsForward), // defaults are for TAB
+ m_flags(IsForward | FromTab), // defaults are for TAB
m_focus((wxWindow *)NULL)
{
m_propagationLevel = wxEVENT_PROPAGATE_NONE;
void SetWindowChange(bool bIs)
{ if ( bIs ) m_flags |= WinChange; else m_flags &= ~WinChange; }
+ // Set to true under MSW if the event was generated using the tab key.
+ // This is required for proper navogation over radio buttons
+ bool IsFromTab() const
+ { return (m_flags & FromTab) != 0; }
+ void SetFromTab(bool bIs)
+ { if ( bIs ) m_flags |= FromTab; else m_flags &= ~FromTab; }
+
// the child which has the focus currently (may be NULL - use
// wxWindow::FindFocus then)
wxWindow* GetCurrentFocus() const { return m_focus; }
{
IsBackward = 0x0000,
IsForward = 0x0001,
- WinChange = 0x0002
+ WinChange = 0x0002,
+ FromTab = 0x0004
};
long m_flags;
// event handler and related classes
// ============================================================================
-typedef void (wxObject::*wxObjectEventFunction)(wxEvent&);
+typedef void (wxEvtHandler::*wxObjectEventFunction)(wxEvent&);
// we can't have ctors nor base struct in backwards compatibility mode or
// otherwise we won't be able to initialize the objects with an agregate, so
wxObject *userData = (wxObject *) NULL,
wxEvtHandler *eventSink = (wxEvtHandler *) NULL);
- bool Disconnect(int winid,
+ bool Disconnect(int winid = wxID_ANY,
wxEventType eventType = wxEVT_NULL,
wxObjectEventFunction func = NULL,
wxObject *userData = (wxObject *) NULL,
wxEvtHandler *eventSink = (wxEvtHandler *) NULL)
{ return Disconnect(winid, wxID_ANY, eventType, func, userData, eventSink); }
- bool Disconnect(wxEventType eventType = wxEVT_NULL,
- wxObjectEventFunction func = NULL,
- wxObject *userData = (wxObject *) NULL,
- wxEvtHandler *eventSink = (wxEvtHandler *) NULL )
- { return Disconnect(wxID_ANY, wxID_ANY, eventType, func, userData, eventSink); }
-
wxList* GetDynamicEventTable() const { return m_dynamicEvents ; }
wx__DECLARE_EVT2(event, id1, id2, wxEventHandler(func))
// EVT_COMMAND
-#define EVT_COMMAND(winid, event, fn) \
+#define EVT_COMMAND(winid, event, func) \
wx__DECLARE_EVT1(event, winid, wxCommandEventHandler(func))
-#define EVT_COMMAND_RANGE(id1, id2, event, fn) \
+#define EVT_COMMAND_RANGE(id1, id2, event, func) \
wx__DECLARE_EVT2(event, id1, id2, wxCommandEventHandler(func))
#define EVT_NOTIFY(event, winid, func) \
// Context Menu Events
#define EVT_CONTEXT_MENU(func) wx__DECLARE_EVT0(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(func))
+#define EVT_COMMAND_CONTEXT_MENU(winid, func) wx__DECLARE_EVT1(wxEVT_CONTEXT_MENU, winid, wxContextMenuEventHandler(func))
// ----------------------------------------------------------------------------
// Global data