casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
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

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Protected Attributes

PlotCanvasm_canvas
 
char m_key
 
std::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 216 of file PlotEvent.h.

Member Enumeration Documentation

Modifier for a key press.

Enumerator
CONTROL 
SHIFT 
ALT 
F 

Definition at line 219 of file PlotEvent.h.

Constructor & Destructor Documentation

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

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

casa::PlotKeyEvent::~PlotKeyEvent ( )

Destructor.

Member Function Documentation

PlotCanvas* casa::PlotKeyEvent::canvas ( ) const

Returns the originating canvas.

Referenced by origin().

char casa::PlotKeyEvent::key ( ) const

Returns the pressed character key.

static casacore::String casa::PlotKeyEvent::modifier ( Modifier  f)
inlinestatic

Converts between KeyModifier and its casacore::String representation.

Definition at line 248 of file PlotEvent.h.

References ALT, CONTROL, F, and SHIFT.

static Modifier casa::PlotKeyEvent::modifier ( casacore::String  f)
inlinestatic

Definition at line 258 of file PlotEvent.h.

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

std::vector<Modifier> casa::PlotKeyEvent::modifiers ( ) const

Returns the key modifiers.

void* casa::PlotKeyEvent::origin ( ) const
inlinevirtual

Overrides PlotEvent::origin().

Implements casa::PlotEvent.

Definition at line 231 of file PlotEvent.h.

References canvas().

casacore::String casa::PlotKeyEvent::toString ( ) const

Returns a casacore::String representation of this key event.

Member Data Documentation

PlotCanvas* casa::PlotKeyEvent::m_canvas
protected

Definition at line 271 of file PlotEvent.h.

char casa::PlotKeyEvent::m_key
protected

Definition at line 272 of file PlotEvent.h.

std::vector<Modifier> casa::PlotKeyEvent::m_mods
protected

Definition at line 273 of file PlotEvent.h.


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