home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
tvrw31d.zip
/
DIALOG.SKL
< prev
next >
Wrap
Text File
|
1996-04-16
|
7KB
|
298 lines
!
! Dialog source skeleton file.
!
! Copyright (c) 1995-96 Balázs Scheidler
! This file is part of Turbo Vision Resource WorkShop
!
! Lines that begin with '!' are comments. All other lines are copied to the
! generated output.
!
! Lines that begin with ` are quoted lines. Quoted lines are directly copied
! to output WITHOUT macro expansion. Use this if you need something in a line
! beginning with $(
!
! The following macros are defined in this file:
!
! $(FULLNAME) = fully expanded filename
! $(FILENAME) = 8+3 filename
! $(FNAME) = 8 char file name
! $(FEXT) = 3 char extension
! $(RESNAME) = the Resource ID of the generated dialog.
! $(CLASSNAME) = the name of the derived class, without the preceding T or P
! $(REFPTRS) = put it into the Object definition, before the methods
! This macro is expanded to the Reference pointers
! $(GETSUBVIEWS)= expands to the usual GetSubViewPtr stuff in Load methods
! $(PUTSUBVIEWS)= expands to the usual PutSubViewPtr stuff in Store methods
! $(MAKEFUNCTION)= expands to the Make function of the generated object.
! $(TRANSFERREC)= expands to the transfer record of the Dialog
! $(DESCRIPTION)= The description of this item
! $(VERSION) = the version of this project
! $(AUTHOR) = the author of the project
!
! You can also use a conditional "macro". It is called $(IFDEF xxxx), where
! xxxx is one of the below listed strings. TVRW will ignore the lines
! between $(IFDEF) and $(ENDIF) if the symbol xxxx is not defined.
! NOTE: DO NOT write anything else in lines which contain $(IFDEF) and
! $(ENDIF)
!
! xxxx can be one of the following:
! DERIVED true if a new object type should be created
! CPP
! PASCAL
! TRANSFERREC
!
! anything else: true if you gave them in the Sourcer Options dialog
! Defines inputline.
!
! These macros are case insensitive.
!
!
$(IFDEF CPP)
!
//*************************************************
//* Header file for T$(CLASSNAME)
//* $(FNAME).H
//*************************************************
#ifndef __$(FNAME)_H_INCLUDED
#define __$(FNAME)_H_INCLUDED
! Add the needed defines...
#define Uses_TButton
#define Uses_TLabel
#define Uses_TStaticText
#define Uses_TParamText
#define Uses_TMemo
#define Uses_TListBox
#define Uses_TSortedListBox
#define Uses_TScrollBar
#define Uses_THistory
#define Uses_TInputLine
#define Uses_TCheckBoxes
#define Uses_TRadioButtons
#define Uses_TPXPictureValidator
#define Uses_TStringLookupValidator
#define Uses_TRangeValidator
#define Uses_TDialog
! Modify this for TV 1.XX
#include <tvision\tv.h>
!
$(IFDEF DERIVED)
class T$(CLASSNAME) : public TDialog
{
public:
T$(CLASSNAME)(const TRect &bounds, const char *aTitle) :
TDialog(bounds, aTitle),
TWindowInit(&T$(CLASSNAME)::initFrame) {};
T$(CLASSNAME)(StreamableInit) :
TDialog(streamableInit),
TWindowInit(&T$(CLASSNAME)::initFrame) {};
virtual void handleEvent( TEvent& );
$(IFDEF STREAMABLE)
static const char *const name;
static TStreamable *build(void);
$(ENDIF)
protected:
$(REFPTRS)
$(IFDEF STREAMABLE)
virtual void write(opstream &);
virtual void *read(ipstream &);
$(ENDIF)
private:
virtual const char *streamableName(void) const
{ return name; };
};
$(IFDEF STREAMABLE)
inline ipstream& operator >> ( ipstream& is, T$(CLASSNAME)& cl )
{ return is >> (TStreamable&)cl; }
inline ipstream& operator >> ( ipstream& is, T$(CLASSNAME)*& cl )
{ return is >> (void *&)cl; }
inline opstream& operator << ( opstream& os, T$(CLASSNAME)& cl )
{ return os << (TStreamable&)cl; }
inline opstream& operator << ( opstream& os, T$(CLASSNAME)* cl )
{ return os << (TStreamable *)cl; }
$(ENDIF)
!
$(ENDIF)
T$(CLASSNAME) *make$(RESNAME)(void);
$(IFDEF TRANSFERREC)
$(TRANSFERREC)
$(ENDIF)
#endif
$(ENDHEADER)
$(IFDEF DERIVED)
/*********************************************************
T$(CLASSNAME) member functions and make function
$(FNAME).CPP
$(ELSE)
/*********************************************************
$(RESNAME) make function.
$(FNAME).CPP
$(ENDIF)
$(DESCRIPTION)
Copyright (c) 1996 $(AUTHOR)
Generated by Turbo Vision Resource WorkShop
*********************************************************/
#include "$(FNAME).H"
$(IFDEF DERIVED)
void T$(CLASSNAME)::handleEvent(TEvent &event)
{
TDialog::handleEvent(event);
switch (event.what) {
case evBroadCast:
break;
case evCommand:
break;
}
}
$(IFDEF STREAMABLE)
const char * const T$(CLASSNAME)::name = "T$(CLASSNAME)";
TStreamable *T$(CLASSNAME)::build(void)
{
return new T$(CLASSNAME)(streamableInit);
}
void *T$(CLASSNAME)::read(ipstream &ip)
{
TDialog::read(ip);
$(GETSUBVIEWS ip)
return this;
}
void *T$(CLASSNAME)::write(opstream &op)
{
TDialog::write(op);
$(PUTSUBVIEWS op)
}
TStreamableClass R$(CLASSNAME)
(T$(CLASSNAME)::name,
T$(CLASSNAME)::build,
__DELTA(T$(CLASSNAME)));
$(ENDIF)
$(ENDIF)
!
$(MAKEFUNCTION)
!
$(ENDIF)
$(IFDEF PASCAL)
{*************************************************************************
$(FILENAME) - unit T$(CLASSNAME) object definition
and MakeFunction.
Copyright (c) 1996 $(AUTHOR)
Generated by Turbo Vision Resource WorkShop
**************************************************************************}
unit $(FNAME);
{$S-,V-,X+}
interface
uses
Drivers, Objects, Views, Dialogs, StdDlg, Validate, Editors;
$(IFDEF DERIVED)
type
P$(CLASSNAME) = ^T$(CLASSNAME);
T$(CLASSNAME) = Object(TDialog)
$(REFPTRS)
constructor Init(var Bounds: TRect; const ATitle: TTitleStr);
$(IFDEF STREAMABLE)
constructor Load(var S: TStream);
procedure Store(var S: TStream);
$(ENDIF)
procedure HandleEvent(var Event: TEvent); virtual;
end;
$(IFDEF STREAMABLE)
const
R$(CLASSNAME): TStreamRec =
(ObjType: 10000;
VMTLink: Ofs(TypeOf(T$(CLASSNAME))^);
Load: @T$(CLASSNAME).Load;
Store: @T$(CLASSNAME).Store);
$(ENDIF)
$(ENDIF)
$(IFDEF TRANSFERREC)
$(TRANSFERREC)
$(ENDIF)
function Make$(RESNAME): P$(CLASSNAME);
implementation
$(IFDEF DERIVED)
constructor T$(CLASSNAME).Init(var Bounds: TRect; const ATitle: TTitleStr);
begin
inherited Init(Bounds, ATitle);
end;
$(IFDEF STREAMABLE)
constructor T$(CLASSNAME).Load(var S: TStream);
begin
inherited Load(S);
$(GETSUBVIEWS S)
end;
procedure T$(CLASSNAME).Store(var S: TStream);
begin
inherited Store(S);
$(PUTSUBVIEWS S)
end;
$(ENDIF)
procedure T$(CLASSNAME).HandleEvent(var Event: TEvent);
begin
inherited HandleEvent(Event);
case Event.What of
evBroadCast:
case Event.Command of
0: ; { These are not really needed, but you know case
statements must contain something.... Delete them if
you need some real stuff here }
end;
evCommand:
case Event.Command of
0: ;
end;
end;
end;
$(ENDIF)
!
$(MAKEFUNCTION)
!
end.
$(ENDIF)