PCPositionEvent.h

Go to the documentation of this file.
00001 //# PCPositionEvent.h: class which stores PixelCanvas position event info
00002 //# Copyright (C) 1993,1994,1995,1996,1999,2000
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 
00028 #ifndef TRIALDISPLAY_PCPOSITIONEVENT_H
00029 #define TRIALDISPLAY_PCPOSITIONEVENT_H
00030 
00031 #include <casa/aips.h>
00032 #include <display/Display/DisplayEnums.h>
00033 #include <display/DisplayEvents/PCMotionEvent.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037         class PixelCanvas;
00038 
00039 // <summary>
00040 // Class which stores PixelCanvas position event information.
00041 // </summary>
00042 
00043 // <use visibility=export>
00044 
00045 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00046 // </reviewed>
00047 
00048 // <etymology>
00049 // "PCPositionEvent" is a contraction and concatenation of "PixelCanvas",
00050 // "Position" and "Event", and describes position events occuring on
00051 // PixelCanvases.
00052 // </etymology>
00053 
00054 // <prerequisite>
00055 // <li> <linkto class=PixelCanvasEvent>PixelCanvasEvent</linkto>
00056 // </prerequisite>
00057 
00058 // <synopsis>
00059 // This class adds to the information stored in the <linkto
00060 // class=PCMotionEvent>PCMotionEvent</linkto> class.  It adds
00061 // information describing key that has been pressed or released, and
00062 // the state of that key.
00063 // </synopsis>
00064 
00065 // <example>
00066 // </example>
00067 
00068 // <motivation>
00069 // A compact way of passing passing position event information around
00070 // the PixelCanvas-oriented display classes was needed, with a
00071 // functional but tight and efficient interface.
00072 // </motivation>
00073 
00074 // <thrown>
00075 // None.
00076 // </thrown>
00077 
00078 // <todo asof="1999/10/15">
00079 // None.
00080 // </todo>
00081 
00082         class PCPositionEvent : public PCMotionEvent {
00083 
00084         public:
00085 
00086                 // Constructor taking a pointer to the PixelCanvas for which the
00087                 // event is valid, the symbol of the key, the state of the key,
00088                 // the position of the pointer, and the input "modifiers".
00089                 // User Constructor
00090                 PCPositionEvent(PixelCanvas *pc, const Display::KeySym &key,
00091                                 const Bool &keystate, const Int &x, const Int &y,
00092                                 const uInt &modifiers);
00093 
00094                 // Destructor.
00095                 virtual ~PCPositionEvent();
00096 
00097                 // Which key was pressed or released?
00098                 virtual Display::KeySym key() const {
00099                         return itsKey;
00100                 }
00101 
00102                 // What state is the key in: <src>True</src> for pressed,
00103                 // <src>False</src> for released.
00104                 virtual Bool keystate() const {
00105                         return itsKeyState;
00106                 }
00107 
00108         protected:
00109 
00110                 // (Required) default constructor.
00111                 PCPositionEvent();
00112 
00113                 // (Required) copy constructor.
00114                 PCPositionEvent(const PCPositionEvent &other);
00115 
00116                 // (Required) copy assignment.
00117                 PCPositionEvent &operator=(const PCPositionEvent &other);
00118 
00119         private:
00120 
00121                 // Store the key that was pressed or released here.
00122                 Display::KeySym itsKey;
00123 
00124                 // Store the state of that key here.
00125                 Bool itsKeyState;
00126 
00127         };
00128 
00129 
00130 } //# NAMESPACE CASA - END
00131 
00132 #endif
00133 
00134 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1