home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
swCHIP 1991 January
/
swCHIP_95-1.bin
/
chip
/
tvgenpas
/
demo3pas.exe
/
TEMPLATE
/
TDIALOG.DTF
< prev
next >
Wrap
Text File
|
1995-02-10
|
5KB
|
222 lines
\ ********************************************************
\ Standard dialog template file for TVGen 3.0
\ initializes objects outside the dialog constructor
\ (c) 1994 BOCIAN Software
\ ********************************************************
\
\ Define procedures only for standalone dialogs
@IF!APP
\ Recursively called procedure building up the cluster string lists
@DEFPROC LineProc
@IF!EQUAL %_LINETEXT% ''
NewSItem('%_LINETEXT%',
@NEXTLINE Lines
@CALL LineProc
@NOCR )
@ELSE
@NOCR nil
@ENDIF
@ENDPROC
\ End of procedure LineProc
\
\
\ Procedure for object flags redefinition
@DEFPROC ObjParams
@IF!DEFAULT Options
%_PARAMETER(1)%.Options:=%OPTIONS%;
@ENDIF
@IF!DEFAULT DragMode
%_PARAMETER(1)%.DragMode:=%DRAGMODE%;
@ENDIF
@IF!DEFAULT GrowMode
%_PARAMETER(1)%.GrowMode:=%GROWMODE%;
@ENDIF
@IF!DEFAULT EventMask
%_PARAMETER(1)%.EventMask:=%EVENTMASK%;
@ENDIF
@ENDPROC
\ End of procedure ObjParams
@ENDIF
\
\ Global variables
@IFAPP
@ASSIGN __DLGFILE[_DLGNUM] %_OUTFILE%.%_EXT%
@ASSIGN __HCCOUNTER 1
@ASSIGN __HELPFLAG 0
\ Set the flag - if the dialog has the help text
@IFOPTION HELP NOAPP FALSE
@IFSNIPPET TXT_HELP
@INC __HELPFLAG
@FILE 4
@NOCR .topic hc_D_%FUNCNAME%=%_HELPVALUE%
@ASSIGN __HCVAL %_HELPVALUE%
@ENDIF (ifsnippet)
@ENDIF (ifoption)
@ENDIF (ifapp)
\
@DEFINEFILE 1 %_OUTFILE%.%_EXT%
@FILE 1
@ASSIGN __MAKERSC 'NO'
@IFAPP
@ASSIGN __DLGTYPE[_DLGNUM] %TYPE%
@IFOPTION DLG_IN_RSC
@IFEQUAL %TYPE% 'TDialog'
@ASSIGN __MAKERSC 'YES'
@ENDIF
@ENDIF
@ENDIF
@IFOPTION HEADERS NOAPP TRUE
{ *************** %_YOURNAME% - %_YOURCOMPANY% *************** }
{ ********** Generated from template %_PADR(TEMPLATE,12,' ')% *********** }
{ ********** Date: %_PADR(_DATE,10,' ')% at %_PADR(_TIME,5,' ')% ********** }
@ENDIF (ifoption)
@IFAPP
@ASSIGN __LOCALCOMMANDS 0
@PUSHFILE 7
const %FUNCNAME%Cmds = %CMDORG%;
@POPFILE
@ENDIF
@IFHASDATA
@IFAPP
@PUSHFILE 3
@ENDIF
type
P%FUNCNAME%Data = ^T%FUNCNAME%Data;
T%FUNCNAME%Data = record
@FOREACH
@DATAXCHG ' '
@ENDFOR
end;
@IFAPP
@POPFILE
@ENDIF
@ENDIF (ifhasdata)
@ASSIGN __TYPEDEFINED 0
@IFSNIPPET MTD_*
@INC __TYPEDEFINED
@ENDIF
@IFSNIPPET USR*
@INC __TYPEDEFINED
@ENDIF
@IF!EQUAL %TYPE% 'TDialog'
@INC __TYPEDEFINED
@ENDIF
@IF!EQUAL %__TYPEDEFINED% 0
type P%_SUBSTR(TYPE,2,255)% = ^%TYPE%;
%TYPE% = object(TDialog)
@IFSNIPPET MTD_INIT
constructor Init(var Bounds : TRect; ATitle : string);
@ENDIF
@IFSNIPPET MTD_DONE
destructor Done; virtual;
@ENDIF
@IFSNIPPET MTD_HAND
procedure HandleEvent(var Event : TEvent); virtual;
@ENDIF
@ASSIGN __SECTION 'HEADER'
@SNIPPETS LIKE USR*
@ASSIGN __SECTION 'MAIN'
end;
@ENDIF (ifsnippet mtd_*)
@IFEQUAL %__MAKERSC% YES
{$IFNDEF RscMaker}
@ENDIF
@IFHASDATA
function %FUNCNAME%(var _Data : T%FUNCNAME%Data; _SetData : Boolean): Word;
var R : TRect;
@IF!OPTION TP6
DataPtr : Pointer;
@ENDIF
@ELSE
function %FUNCNAME% : Word;
var R : TRect;
@ENDIF (ifhasdata)
D : PDialog;
@IFEQUAL %__MAKERSC% YES
@PUSHFILE 6
{$IFDEF RscMaker}
procedure Define%FuncName%;
var R : TRect;
D : PDialog;
@ENDIF
C,CX : PView;
SB,VSB,HSB : PScrollBar;
begin
R.Assign(%_BOUNDS%);
D:=New(P%_SUBSTR(TYPE,2,255)%,Init(R,%TITLE%));
with D^ do
begin
@IF!DEFAULT FLAGS
D^.Flags:=%FLAGS%;
@ENDIF (if!default)
@IF!DEFAULT PALETTE
D^.Palette:=%PALETTE%;
@ENDIF
@IFAPP
D^.HelpCTX:=hc_D_%FUNCNAME%;
@ENDIF (ifapp)
@CALL ObjParams D^
@FOREACH
@OBJECT D^
@ENDFOR
SelectNext(False);
end;
@IFEQUAL %__MAKERSC% YES
ResFile.Put(D,'%FUNCNAME%');
end;
{$ENDIF}
@POPFILE
begin
D:=P%_SUBSTR(TYPE,2,$FF)%(ResFile.Get('%FUNCNAME%'));
@ENDIF
@IFOPTION TP6
@IFHASDATA
if _SetData then D^.SetData(_Data);
@ENDIF
%FUNCNAME%:=Desktop^.ExecView(D);
Dispose(D,Done);
@ELSE
@IFHASDATA
DataPtr:=@_Data;
if not _SetData then FillChar(_Data,SizeOf(_Data),0);
%FUNCNAME%:=Application^.ExecuteDialog(D,DataPtr);
@ELSE
%FUNCNAME%:=Application^.ExecuteDialog(D,nil);
@ENDIF (ifhasdata)
@ENDIF
end;
@IFEQUAL %__MAKERSC% YES
{$ENDIF}
@ENDIF
@IF!EQUAL %__TYPEDEFINED% 0
{ **************** Dialog Methods ****************** }
@SNIPPETS LIKE MTD_*
@SNIPPETS LIKE USR*
@ENDIF (if!equal)
{ ************ Generated by TVGen 3.0 ************** }
@CLOSEFILE 1
@IFAPP
\ Help text for the dialog
@IFOPTION HELP NOAPP FALSE
@IF!EQUAL __HELPFLAG 0
@FILE 4
@SNIPPET TXT_HELP
@ENDIF (if!equal)
@ENDIF (ifoption)
@ENDIF (ifapp)
\ End of the file...