//-------------------------------------------------------
//
// speed.h: Header file for speed.cpp
//
//-------------------------------------------------------
#if !defined( __SPEED_H )
#define __SPEED_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>
struct speedRec {
char x[11]; //TInputDouble
char y[11]; //TInputDouble
char z[11]; //TInputDouble
};
class Speed : public TDialog
{
public:
Speed( );
Speed( StreamableInit ) :
TDialog (streamableInit),
TWindowInit(Speed::initFrame) {};
virtual void handleEvent( TEvent& );
virtual Boolean valid( ushort );
TButton *c;
private:
virtual const char *streamableName() const
{ return name; }
protected:
virtual void write( opstream& );
virtual void *read( ipstream& );
public:
static const char * const name;
static TStreamable *build();
};
inline ipstream& operator >> ( ipstream& is, Speed& cl )
{ return is >> (TStreamable&)cl; }
inline ipstream& operator >> ( ipstream& is, Speed*& cl )
{ return is >> (void *&)cl; }
inline opstream& operator << ( opstream& os, Speed& cl )
{ return os << (TStreamable&)cl; }
inline opstream& operator << ( opstream& os, Speed* cl )
{ return os << (TStreamable *)cl; }
#endif // __SPEED_H
//-----------cut here------
//-------------------------------------------------------
// speed.cpp
//-------------------------------------------------------
#define Uses_TEvent
#include <tv.h>
#if !defined( __SPEED_H )
#include "speed.h"
#endif
Speed::Speed() :
TDialog(TRect(22, 4, 49, 9), "Speed"),
TWindowInit(Speed::initFrame)
{
TView *control;
control = new TInputDouble(TRect(5, 1, 15, 2), 11);
insert(control);
insert(new TLabel(TRect(2, 1, 5, 2), "~X~:", control));
control = new TInputDouble(TRect(5, 2, 15, 3), 11);
insert(control);
insert(new TLabel(TRect(2, 2, 5, 3), "~Y~:", control));
control = new TInputDouble(TRect(5, 3, 15, 4), 11);
insert(control);
insert(new TLabel(TRect(2, 3, 5, 4), "~Z~:", control));
c = new TButton(TRect(15, 2, 25, 4), "~S~et", cmSetSpeed, bfNormal);
insert(c);
selectNext(False);
}
void Speed::handleEvent( TEvent& event)
{
TDialog::handleEvent(event);
}
Boolean Speed::valid(ushort command)
{
Boolean rslt = TDialog::valid(command);
if (rslt && (command == cmOK))
{
}
return rslt;
}
const char * const Speed::name = "Speed";
void Speed::write( opstream& os )
{
TDialog::write( os );
os << c;
}
void *Speed::read( ipstream& is )
{
TDialog::read( is );
is >> c;
return this;
}
TStreamable *Speed::build()
{
return new Speed( streamableInit );
}
// From here to end of file may be removed if Speed will not be streamed.
TStreamableClass Rpeed( Speed::name,
Speed::build,
__DELTA(Speed)
);
__link(Rpeed)
__link(RButton)
__link(RInputDouble)
__link(RLabel)
syntax highlighted by Code2HTML, v. 0.9.1