casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
casa::PlotKeyEvent Class Reference

Event for when the user makes a keyboard command when a canvas has focus. More...

#include <PlotEvent.h>

Inheritance diagram for casa::PlotKeyEvent:
casa::PlotEvent

List of all members.

Public Types

enum  Modifier {
  CONTROL,
  SHIFT,
  ALT,
  F
}
 Modifier for a key press. More...

Public Member Functions

 PlotKeyEvent (PlotCanvas *canvas, char key, const vector< Modifier > &mods)
 Constructor that takes the originating canvas, the key pressed, and any modifiers.
 ~PlotKeyEvent ()
 Destructor.
void * origin () const
 Overrides PlotEvent::origin().
PlotCanvascanvas () const
 Returns the originating canvas.
char key () const
 Returns the pressed character key.
vector< Modifiermodifiers () const
 Returns the key modifiers.
String toString () const
 Returns a String representation of this key event.

Static Public Member Functions

static String modifier (Modifier f)
 Converts between KeyModifier and its String representation.
static Modifier modifier (String f)

Protected Attributes

PlotCanvasm_canvas
 
     

char m_key
vector< Modifierm_mods

Detailed Description

Event for when the user makes a keyboard command when a canvas has focus.

An example of a keyboard command would be "ctrl+s" or "n" or "shift+g" or "F3". Note that this event is only valid for key commands that can be represented with a char (or, in the case of the F1-F12 keys, the F modifier plus the character representation of the number).

Definition at line 218 of file PlotEvent.h.


Member Enumeration Documentation

Modifier for a key press.

Enumerator:
CONTROL 
SHIFT 
ALT 
F 

Definition at line 221 of file PlotEvent.h.


Constructor & Destructor Documentation

casa::PlotKeyEvent::PlotKeyEvent ( PlotCanvas canvas,
char  key,
const vector< Modifier > &  mods 
)

Constructor that takes the originating canvas, the key pressed, and any modifiers.

Destructor.


Member Function Documentation

Returns the originating canvas.

Referenced by origin().

char casa::PlotKeyEvent::key ( ) const

Returns the pressed character key.

static String casa::PlotKeyEvent::modifier ( Modifier  f) [inline, static]

Converts between KeyModifier and its String representation.

Definition at line 250 of file PlotEvent.h.

References ALT, CONTROL, F, and SHIFT.

static Modifier casa::PlotKeyEvent::modifier ( String  f) [inline, static]

Definition at line 260 of file PlotEvent.h.

References ALT, CONTROL, casa::String::downcase(), F, and SHIFT.

Returns the key modifiers.

void* casa::PlotKeyEvent::origin ( ) const [inline, virtual]

Overrides PlotEvent::origin().

Implements casa::PlotEvent.

Definition at line 233 of file PlotEvent.h.

References canvas().

Returns a String representation of this key event.


Member Data Documentation

     

Definition at line 273 of file PlotEvent.h.

char casa::PlotKeyEvent::m_key [protected]

Definition at line 274 of file PlotEvent.h.

vector<Modifier> casa::PlotKeyEvent::m_mods [protected]

Definition at line 275 of file PlotEvent.h.


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