casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PCPositionEvent.h
Go to the documentation of this file.
1 //# PCPositionEvent.h: class which stores PixelCanvas position event info
2 //# Copyright (C) 1993,1994,1995,1996,1999,2000
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_PCPOSITIONEVENT_H
29 #define TRIALDISPLAY_PCPOSITIONEVENT_H
30 
31 #include <casa/aips.h>
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37  class PixelCanvas;
38 
39 // <summary>
40 // Class which stores PixelCanvas position event information.
41 // </summary>
42 
43 // <use visibility=export>
44 
45 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46 // </reviewed>
47 
48 // <etymology>
49 // "PCPositionEvent" is a contraction and concatenation of "PixelCanvas",
50 // "Position" and "Event", and describes position events occuring on
51 // PixelCanvases.
52 // </etymology>
53 
54 // <prerequisite>
55 // <li> <linkto class=PixelCanvasEvent>PixelCanvasEvent</linkto>
56 // </prerequisite>
57 
58 // <synopsis>
59 // This class adds to the information stored in the <linkto
60 // class=PCMotionEvent>PCMotionEvent</linkto> class. It adds
61 // information describing key that has been pressed or released, and
62 // the state of that key.
63 // </synopsis>
64 
65 // <example>
66 // </example>
67 
68 // <motivation>
69 // A compact way of passing passing position event information around
70 // the PixelCanvas-oriented display classes was needed, with a
71 // functional but tight and efficient interface.
72 // </motivation>
73 
74 // <thrown>
75 // None.
76 // </thrown>
77 
78 // <todo asof="1999/10/15">
79 // None.
80 // </todo>
81 
82  class PCPositionEvent : public PCMotionEvent {
83 
84  public:
85 
86  // Constructor taking a pointer to the PixelCanvas for which the
87  // event is valid, the symbol of the key, the state of the key,
88  // the position of the pointer, and the input "modifiers".
89  // User Constructor
91  const casacore::Bool &keystate, const casacore::Int &x, const casacore::Int &y,
92  const casacore::uInt &modifiers);
93 
94  // Destructor.
95  virtual ~PCPositionEvent();
96 
97  // Which key was pressed or released?
98  virtual Display::KeySym key() const {
99  return itsKey;
100  }
101 
102  // What state is the key in: <src>true</src> for pressed,
103  // <src>false</src> for released.
104  virtual casacore::Bool keystate() const {
105  return itsKeyState;
106  }
107 
108  protected:
109 
110  // (Required) default constructor.
111  PCPositionEvent();
112 
113  // (Required) copy constructor.
114  PCPositionEvent(const PCPositionEvent &other);
115 
116  // (Required) copy assignment.
118 
119  private:
120 
121  // Store the key that was pressed or released here.
123 
124  // Store the state of that key here.
126 
127  };
128 
129 
130 } //# NAMESPACE CASA - END
131 
132 #endif
133 
134 
int Int
Definition: aipstype.h:50
virtual Display::KeySym key() const
Which key was pressed or released?
Class which stores PixelCanvas motion event information.
Definition: PCMotionEvent.h:82
casacore::Bool itsKeyState
Store the state of that key here.
Base class defining interface to pixel-based output devices.
Definition: PixelCanvas.h:161
virtual casacore::Int x() const
The x and y pixel position of the pointer when the event occured.
Definition: PCMotionEvent.h:97
virtual casacore::Bool keystate() const
What state is the key in: true for pressed, false for released.
Display::KeySym itsKey
Store the key that was pressed or released here.
virtual ~PCPositionEvent()
Destructor.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Class which stores PixelCanvas position event information.
PCPositionEvent & operator=(const PCPositionEvent &other)
(Required) copy assignment.
PCPositionEvent()
(Required) default constructor.
virtual casacore::uInt modifiers() const
Return the state of the &quot;modifiers&quot;: this is made up of mask bits referring to various keys on the ke...
KeySym
Keysyms for PixelCanvas keyboard events.
Definition: DisplayEnums.h:412
virtual casacore::Int y() const
unsigned int uInt
Definition: aipstype.h:51