casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
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   // What state is the key in: <src>True</src> for pressed,
00102   // <src>False</src> for released.
00103   virtual Bool keystate() const 
00104     { return itsKeyState; }
00105 
00106  protected:
00107 
00108   // (Required) default constructor.
00109   PCPositionEvent();
00110 
00111   // (Required) copy constructor.
00112   PCPositionEvent(const PCPositionEvent &other);
00113 
00114   // (Required) copy assignment.
00115   PCPositionEvent &operator=(const PCPositionEvent &other);
00116 
00117  private:
00118 
00119   // Store the key that was pressed or released here.
00120   Display::KeySym itsKey;
00121 
00122   // Store the state of that key here.
00123   Bool itsKeyState;
00124 
00125 };
00126 
00127 
00128 } //# NAMESPACE CASA - END
00129 
00130 #endif
00131 
00132