Home | Trees | Index | Help |
|
---|
Package wx :: Class MouseEvent |
|
object
--+ |Object
--+ |Event
--+ | MouseEvent
This event class contains information about the events generated by the mouse: they include mouse buttons press and release events and mouse move events.
All mouse events involving the buttons use wx.MOUSE_BTN_LEFT for the left mouse button, wx.MOUSE_BTN_MIDDLE for the middle one and wx.MOUSE_BTN_RIGHT for the right one. Note that not all mice have a middle button so a portable application should avoid relying on the events from it.
Note the difference between methods like LeftDown
and LeftIsDown
:
the former returns true when the event corresponds to the left mouse
button click while the latter returns true if the left mouse button is
currently being pressed. For example, when the user is dragging the
mouse you can use LeftIsDown
to test whether the left mouse button
is (still) depressed. Also, by convention, if LeftDown
returns true,
LeftIsDown
will also return true in wxWidgets whatever the
underlying GUI behaviour is (which is platform-dependent). The same
applies, of course, to other mouse buttons as well.
EVT_LEFT_DOWN Left mouse button down event. The handler of this event should normally call event.Skip() to allow the default processing to take place as otherwise the window under mouse wouldn't get the focus. EVT_LEFT_UP Left mouse button up event EVT_LEFT_DCLICK Left mouse button double click event EVT_MIDDLE_DOWN Middle mouse button down event EVT_MIDDLE_UP Middle mouse button up event EVT_MIDDLE_DCLICK Middle mouse button double click event EVT_RIGHT_DOWN Right mouse button down event EVT_RIGHT_UP Right mouse button up event EVT_RIGHT_DCLICK Right mouse button double click event EVT_MOTION Event sent when the mouse is moving EVT_ENTER_WINDOW Event sent when the mouse enters the boundaries of a window. EVT_LEAVE_WINDOW Sent when the mouse leaves the window's bounds EVT_MOUSEWHEEL Mouse scroll wheel event EVT_MOUSE_EVENTS Binds all mouse events at once.
Method Summary | |
---|---|
MouseEvent |
Constructs a wx.MouseEvent. |
bool |
Returns true if the Alt key was down at the time of the event. |
bool |
If the argument is omitted, this returns true if the event was any mouse double click event. |
bool |
If the argument is omitted, this returns true if the event was any mouse button down event. |
bool | ButtonIsDown(self,
but)
|
bool |
If the argument is omitted, this returns true if the event was any mouse button up event. |
bool |
"Cmd" is a pseudo key which is the same as Control for PC and Unix platforms but the special "Apple" (a.k.a as "Command") key on Macs. |
bool |
Returns true if the control key was down at the time of the event. |
bool |
Returns true if this was a dragging event (motion while a button is depressed). |
bool |
Returns true if the mouse was entering the window. |
int |
Returns the mouse button which generated this event or wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or leave event, for example). |
int |
Returns the configured number of lines (or whatever) to be scrolled per wheel action. |
Point |
Returns the logical mouse position in pixels (i.e. |
Point |
Returns the pixel position of the mouse in window coordinates when the event happened. |
(x,y) |
Returns the pixel position of the mouse in window coordinates when the event happened. |
int |
Get wheel delta, normally 120. |
int |
Get wheel rotation, positive or negative indicates direction of rotation. |
int |
Returns X coordinate of the physical mouse event position. |
int |
Returns Y coordinate of the physical mouse event position. |
bool |
Returns true if the event was a mouse button event (not necessarily a button down event - that may be tested using ButtonDown ). |
bool |
Returns true if the system has been setup to do page scrolling with the mouse wheel instead of line scrolling. |
bool |
Returns true if the mouse was leaving the window. |
bool |
Returns true if the event was a left button double click. |
bool |
Returns true if the left mouse button state changed to down. |
bool |
Returns true if the left mouse button is currently down, independent of the current event type. |
bool |
Returns true if the left mouse button state changed to up. |
bool |
Returns true if the Meta key was down at the time of the event. |
bool |
Returns true if the event was a middle button double click. |
bool |
Returns true if the middle mouse button state changed to down. |
bool |
Returns true if the middle mouse button is currently down, independent of the current event type. |
bool |
Returns true if the middle mouse button state changed to up. |
bool |
Returns true if this was a motion event and no mouse buttons were pressed. |
bool |
Returns true if the event was a right button double click. |
bool |
Returns true if the right mouse button state changed to down. |
bool |
Returns true if the right mouse button is currently down, independent of the current event type. |
bool |
Returns true if the right mouse button state changed to up. |
bool |
Returns true if the Shift key was down at the time of the event. |
Property Summary | |
---|---|
Button : See GetButton | |
LinesPerAction : See GetLinesPerAction | |
LogicalPosition : See GetLogicalPosition | |
m_altDown | |
m_controlDown | |
m_leftDown | |
m_linesPerAction | |
m_metaDown | |
m_middleDown | |
m_rightDown | |
m_shiftDown | |
m_wheelDelta | |
m_wheelRotation | |
m_x | |
m_y | |
Position : See GetPosition | |
thisown : The membership flag | |
WheelDelta : See GetWheelDelta | |
WheelRotation : See GetWheelRotation | |
X : See GetX | |
Y : See GetY |
Method Details |
---|
__init__(self,
mouseType=wxEVT_NULL)
|
AltDown(self)Returns true if the Alt key was down at the time of the event.
|
ButtonDClick(self, but=MOUSE_BTN_ANY)If the argument is omitted, this returns true if the event was any
mouse double click event. Otherwise the argument specifies which
double click event to check for (see
|
ButtonDown(self, but=MOUSE_BTN_ANY)If the argument is omitted, this returns true if the event was any
mouse button down event. Otherwise the argument specifies which
button-down event shold be checked for (see
|
ButtonUp(self, but=MOUSE_BTN_ANY)If the argument is omitted, this returns true if the event was any
mouse button up event. Otherwise the argument specifies which button
up event to check for (see
|
CmdDown(self)"Cmd" is a pseudo key which is the same as Control for PC and Unix
platforms but the special "Apple" (a.k.a as "Command") key on
Macs. It often makes sense to use it instead of, say,
|
ControlDown(self)Returns true if the control key was down at the time of the event.
|
Dragging(self)Returns true if this was a dragging event (motion while a button is depressed).
|
Entering(self)Returns true if the mouse was entering the window.
|
GetButton(self)Returns the mouse button which generated this event or wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE and wx.MOUSE_BTN_RIGHT for the same events for the middle and the right buttons respectively.
|
GetLinesPerAction(self)Returns the configured number of lines (or whatever) to be scrolled per wheel action. Defaults to three.
|
GetLogicalPosition(self, dc)Returns the logical mouse position in pixels (i.e. translated according to the translation set for the DC, which usually indicates that the window has been scrolled).
|
GetPosition(self)Returns the pixel position of the mouse in window coordinates when the event happened.
|
GetPositionTuple()Returns the pixel position of the mouse in window coordinates when the event happened.
|
GetWheelDelta(self)Get wheel delta, normally 120. This is the threshold for action to be taken, and one such action (for example, scrolling one increment) should occur for each delta.
|
GetWheelRotation(self)Get wheel rotation, positive or negative indicates direction of rotation. Current devices all send an event when rotation is equal to +/-WheelDelta, but this allows for finer resolution devices to be created in the future. Because of this you shouldn't assume that one event is equal to 1 line or whatever, but you should be able to either do partial line scrolling or wait until +/-WheelDelta rotation values have been accumulated before scrolling.
|
GetX(self)Returns X coordinate of the physical mouse event position.
|
GetY(self)Returns Y coordinate of the physical mouse event position.
|
IsButton(self)Returns true if the event was a mouse button event (not necessarily a
button down event - that may be tested using
|
IsPageScroll(self)Returns true if the system has been setup to do page scrolling with the mouse wheel instead of line scrolling.
|
Leaving(self)Returns true if the mouse was leaving the window.
|
LeftDClick(self)Returns true if the event was a left button double click.
|
LeftDown(self)Returns true if the left mouse button state changed to down.
|
LeftIsDown(self)Returns true if the left mouse button is currently down, independent of the current event type. Please notice that it is not the same as LeftDown which returns true if the left mouse button was just pressed. Rather, it describes the state of the mouse button before the event happened. This event is usually used in the mouse event handlers which process "move mouse" messages to determine whether the user is (still) dragging the mouse.
|
LeftUp(self)Returns true if the left mouse button state changed to up.
|
MetaDown(self)Returns true if the Meta key was down at the time of the event.
|
MiddleDClick(self)Returns true if the event was a middle button double click.
|
MiddleDown(self)Returns true if the middle mouse button state changed to down.
|
MiddleIsDown(self)Returns true if the middle mouse button is currently down, independent of the current event type.
|
MiddleUp(self)Returns true if the middle mouse button state changed to up.
|
Moving(self)Returns true if this was a motion event and no mouse buttons were pressed. If any mouse button is held pressed, then this method returns false and Dragging returns true.
|
RightDClick(self)Returns true if the event was a right button double click.
|
RightDown(self)Returns true if the right mouse button state changed to down.
|
RightIsDown(self)Returns true if the right mouse button is currently down, independent of the current event type.
|
RightUp(self)Returns true if the right mouse button state changed to up.
|
ShiftDown(self)Returns true if the Shift key was down at the time of the event.
|
Property Details |
---|
ButtonSee
|
LinesPerAction
|
LogicalPosition
|
PositionSee
|
thisownThe membership flag |
WheelDeltaSee
|
WheelRotationSee
|
XSee
|
YSee
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:14:34 2007 | http://epydoc.sf.net |