GMouse Class Reference

All the parameters of a mouse click event. More...

#include <LgiClass.h>

Inheritance diagram for GMouse:

GUiEvent

List of all members.

Public Member Functions

bool Left ()
 True if the left mouse button was clicked.
bool Middle ()
 True if the middle mouse button was clicked.
bool Right ()
 True if the right mouse button was clicked.
void Left (bool i)
 Sets the left button flag.
void Middle (bool i)
 Sets the middle button flag.
void Right (bool i)
 Sets the right button flag.
bool ToScreen ()
 Converts to screen coordinates.
bool ToView ()
 Converts to local coordinates.
bool IsContextMenu ()

Public Attributes

class GViewI * Target
 Receiving view.
bool ViewCoords
 True if specified in view coordinates, false if in screen coords.
int x
 The x co-ordinate of the mouse relitive to the current view.
int y
 The y co-ordinate of the mouse relitive to the current view.


Detailed Description

All the parameters of a mouse click event.

The parent class GUiEvent keeps information about whether it was a Down() or Double() click. You can also query whether the Alt(), Ctrl() or Shift() keys were pressed at the time the event occured.

To get the position of the mouse in screen co-ordinates you can either use GView::GetMouse() and pass true in the 'ScreenCoords' parameter. Or you can construct a GdcPt2 out of the x,y fields of this class and use GView::PointToScreen() to map the point to screen co-ordinates.


Member Function Documentation

bool GMouse::IsContextMenu (  ) 

Returns:
true if this event should show a context menu

References GUiEvent::Ctrl(), Left(), and Right().

Referenced by GToolButton::OnMouseClick(), GTextView3::OnMouseClick(), Html2::GHtml2::OnMouseClick(), and GHtml::OnMouseClick().


The documentation for this class was generated from the following files:

Generated on Wed Dec 1 15:41:03 2010 for Lgi by  doxygen 1.5.7.1