/* $Id: POSITION.H 2.4 1995/07/20 11:24:33 leon Exp $
 */

#if !defined( __POSITION_H )

#define __POSITION_H


#define Uses_TStreamable

#define Uses_TStreamableClass

#define Uses_TEvent

#define Uses_TRect

#define Uses_TDialog

#define Uses_TButton

#define Uses_TInputLine

#define Uses_TLabel

#include <tvision/tv.h>


#define Uses_TInputDouble

#include "input.h"


/**
 ** Position indicator data record
 **/
struct positionRec  {
  double z;   //TInputDouble

  double x;   //TInputDouble

  double y;   //TInputDouble

  };


/**
 ** Current position indicator dialog window and position
 ** manipulator.
 **/
class PositionWnd : public TDialog
{

public:

    PositionWnd( );
    PositionWnd( StreamableInit ) :
           TDialog (streamableInit),
           TWindowInit(PositionWnd::initFrame) {};
    virtual void handleEvent( TEvent& );
    void update();
    ~PositionWnd();

    TInputDouble *positionZ;
    TInputDouble *positionX;
    TInputDouble *positionY;

private:

    virtual const char *streamableName() const
        { return name; }
    long lastPosition[3];

protected:

    virtual void write( opstream& );
    virtual void *read( ipstream& );
    void getPosition();
    void moveTo();
    void moveToZero();
    void store(short memory);
    void recall(short memory);

public:

    static const char * const name;
    static TStreamable *build();

};

inline ipstream& operator >> ( ipstream& is, PositionWnd& cl )
    { return is >> (TStreamable&)cl; }
inline ipstream& operator >> ( ipstream& is, PositionWnd*& cl )
    { return is >> (void *&)cl; }
inline opstream& operator << ( opstream& os, PositionWnd& cl )
    { return os << (TStreamable&)cl; }
inline opstream& operator << ( opstream& os, PositionWnd* cl )
    { return os << (TStreamable *)cl; }


#endif  // __POSITION_H



syntax highlighted by Code2HTML, v. 0.9.1