Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

Ars::MouseMessage Class Reference

Any messages generated from mouse input. More...

#include <arsmessages.h>

Inheritance diagram for Ars::MouseMessage:

Inheritance graph
[legend]
Collaboration diagram for Ars::MouseMessage:

Collaboration graph
[legend]

Public Types

enum  EMouseButton { NONE = 0, LEFT = 1, RIGHT = 2, MIDDLE = 4 }
 Constants for all the mouse buttons, these values can be ORed together for more than one button. More...


Public Member Functions

 MouseMessage (const EMessageType MessageType, MessageClient *pDestination, const XPoint &Point, const XPoint &Relative, const unsigned int Button)

Static Public Member Functions

unsigned int TranslateSDLButton (Uint8 SDLButton)
 Converst an SDLButton value into an EMouseButton value.

unsigned int TranslateSDLButtonState (Uint8 SDLButtonState)
 Converts an SDLButtonState value into an ORing of EMouseButton values.


Data Fields

const XPoint Point
 The point where the mouse cursor was at the time of the message.

const XPoint Relative
 The relative movement of the cursor (only valid for MOUSE_MOVE messages).

const unsigned int Button
 Any mouse buttons pressed.


Detailed Description

Any messages generated from mouse input.

Definition at line 92 of file arsmessages.h.


Member Enumeration Documentation

enum Ars::MouseMessage::EMouseButton
 

Constants for all the mouse buttons, these values can be ORed together for more than one button.

Enumeration values:
NONE  No mouse button.
LEFT  The left mouse button.
RIGHT  The right mouse button.
MIDDLE  The middle mouse button.

Definition at line 95 of file arsmessages.h.

00096         {
00097                 NONE = 0, 
00098                 LEFT = 1,  
00099                 RIGHT = 2,  
00100                 MIDDLE = 4  
00101         };


Constructor & Destructor Documentation

Ars::MouseMessage::MouseMessage const EMessageType  MessageType,
MessageClient pDestination,
const XPoint Point,
const XPoint Relative,
const unsigned int  Button
[inline]
 

Construct a new mouse message

Parameters:
MessageType The type of message being created
pDestination A pointer to the window that the message is destined for (0 for no specific destination, or to broadcast to all)
Point The location of the mouse cursor
Relative The relative movement of the cursor (only valid for MOUSE_MOVE messages)
Button An OR of all the EMouseButton values indicating which mouse buttons are pressed

Definition at line 109 of file arsmessages.h.

References Button.

00110         : Message( MessageType , pDestination ) , Point(Point), Relative(Relative), Button(Button)
00111         {}


Member Function Documentation

unsigned int Ars::MouseMessage::TranslateSDLButton Uint8  SDLButton  )  [static]
 

Converst an SDLButton value into an EMouseButton value.

Definition at line 6 of file arsmessage.cpp.

References Button, LEFT, MIDDLE, and RIGHT.

00007 {
00008         unsigned int Button = 0;
00009         switch (SDLButton)
00010         {
00011                 case SDL_BUTTON_LEFT:
00012                         Button = LEFT;
00013                         break;
00014                 case SDL_BUTTON_RIGHT:
00015                         Button = RIGHT;
00016                         break;
00017                 case SDL_BUTTON_MIDDLE:
00018                         Button = MIDDLE;
00019                         break;
00020         }
00021 
00022         return Button;
00023 }

unsigned int Ars::MouseMessage::TranslateSDLButtonState Uint8  SDLButtonState  )  [static]
 

Converts an SDLButtonState value into an ORing of EMouseButton values.

Definition at line 26 of file arsmessage.cpp.

References Button, LEFT, MIDDLE, and RIGHT.

00027 {
00028         unsigned int Button = 0;
00029         if (SDLButtonState & SDL_BUTTON(1))
00030                 Button |= LEFT;
00031         if (SDLButtonState & SDL_BUTTON(2))
00032                 Button |= RIGHT;
00033         if (SDLButtonState & SDL_BUTTON(3))
00034                 Button |= MIDDLE;
00035 
00036         return Button;
00037 }


Field Documentation

const unsigned int Ars::MouseMessage::Button
 

Any mouse buttons pressed.

Definition at line 122 of file arsmessages.h.

Referenced by Ars::XScrollBar::evMouseButtonDown(), Ars::XListBox::evMouseButtonDown(), Ars::XEditBox::evMouseButtonDown(), Ars::Window::evMouseButtonDown(), Ars::XScrollBar::evMouseButtonUp(), Ars::XListBox::evMouseButtonUp(), Ars::Window::evMouseButtonUp(), MouseMessage(), TranslateSDLButton(), and TranslateSDLButtonState().

const XPoint Ars::MouseMessage::Point
 

The point where the mouse cursor was at the time of the message.

Definition at line 120 of file arsmessages.h.

Referenced by Ars::XScrollBar::evMouseButtonDown(), Ars::XListBox::evMouseButtonDown(), Ars::XEditBox::evMouseButtonDown(), Ars::XButton::evMouseButtonDown(), Ars::Window::evMouseButtonDown(), Ars::XListBox::evMouseButtonUp(), Ars::Window::evMouseButtonUp(), Ars::XScrollBar::evMouseMove(), Ars::XLabel::evMouseMove(), Ars::XEditBox::evMouseMove(), Ars::XButton::evMouseMove(), and Ars::XToolTip::evMouseMove().

const XPoint Ars::MouseMessage::Relative
 

The relative movement of the cursor (only valid for MOUSE_MOVE messages).

Definition at line 121 of file arsmessages.h.


The documentation for this class was generated from the following files:
Generated on Fri Dec 5 04:06:46 2003 for Borqueror by doxygen 1.3.3