enum
{
wxMOUSE_BTN_ANY = -1,
- wxMOUSE_BTN_NONE = -1,
- wxMOUSE_BTN_LEFT = 0,
- wxMOUSE_BTN_MIDDLE = 1,
- wxMOUSE_BTN_RIGHT = 2
+ wxMOUSE_BTN_NONE = 0,
+ wxMOUSE_BTN_LEFT = 1,
+ wxMOUSE_BTN_MIDDLE = 2,
+ wxMOUSE_BTN_RIGHT = 3
};
class WXDLLIMPEXP_CORE wxMouseEvent : public wxEvent
// Was it a button event? (*doesn't* mean: is any button *down*?)
bool IsButton() const { return Button(wxMOUSE_BTN_ANY); }
- // Was it a down event from button 1, 2 or 3 or any?
+ // Was it a down event from this (or any) button?
bool ButtonDown(int but = wxMOUSE_BTN_ANY) const;
- // Was it a dclick event from button 1, 2 or 3 or any?
+ // Was it a dclick event from this (or any) button?
bool ButtonDClick(int but = wxMOUSE_BTN_ANY) const;
- // Was it a up event from button 1, 2 or 3 or any?
+ // Was it a up event from this (or any) button?
bool ButtonUp(int but = wxMOUSE_BTN_ANY) const;
- // Was the given button 1,2,3 or any changing state?
+ // Was the given button?
bool Button(int but) const;
- // Was the given button 1,2,3 or any in Down state?
+ // Was the given button in Down state?
bool ButtonIsDown(int but) const;
// Get the button which is changing state (wxMOUSE_BTN_NONE if none)
// True if a button is down and the mouse is moving
bool Dragging() const
{
- return ((m_eventType == wxEVT_MOTION) &&
- (LeftIsDown() || MiddleIsDown() || RightIsDown()));
+ return (m_eventType == wxEVT_MOTION) && ButtonIsDown(wxMOUSE_BTN_ANY);
}
// True if the mouse is moving, and no button is down
- bool Moving() const { return (m_eventType == wxEVT_MOTION); }
+ bool Moving() const
+ {
+ return (m_eventType == wxEVT_MOTION) && !ButtonIsDown(wxMOUSE_BTN_ANY);
+ }
// True if the mouse is just entering the window
bool Entering() const { return (m_eventType == wxEVT_ENTER_WINDOW); }
public:
wxNavigationKeyEvent()
: wxEvent(0, wxEVT_NAVIGATION_KEY),
- m_flags(IsForward | Propagate), // defaults are for TAB
+ m_flags(IsForward), // defaults are for TAB
m_focus((wxWindow *)NULL)
- { }
+ {
+ m_propagationLevel = wxEVENT_PROPAGATE_NONE;
+ }
wxNavigationKeyEvent(const wxNavigationKeyEvent& event)
: wxEvent(event),
void SetWindowChange(bool bIs)
{ if ( bIs ) m_flags |= WinChange; else m_flags &= ~WinChange; }
- // some navigation events are meant to be propagated upwards (Windows
- // convention is to do this for TAB events) while others should always
- // cycle inside the panel/radiobox/whatever we're current inside
- bool ShouldPropagate() const
- { return (m_flags & Propagate) != 0; }
- void SetPropagate(bool bDoIt)
- { if ( bDoIt ) m_flags |= Propagate; else m_flags &= ~Propagate; }
-
// the child which has the focus currently (may be NULL - use
// wxWindow::FindFocus then)
wxWindow* GetCurrentFocus() const { return m_focus; }
enum
{
IsForward = 0x0001,
- WinChange = 0x0002,
- Propagate = 0x0004
+ WinChange = 0x0002
};
long m_flags;
// wxEventHashTable: a helper of wxEvtHandler to speed up wxEventTable lookups.
// ----------------------------------------------------------------------------
-WX_DEFINE_ARRAY_NO_PTR(const wxEventTableEntry*, wxEventTableEntryPointerArray);
+WX_DEFINE_ARRAY_PTR(const wxEventTableEntry*, wxEventTableEntryPointerArray);
class WXDLLIMPEXP_BASE wxEvtHandler;
class WXDLLIMPEXP_BASE wxEventHashTable