home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
swCHIP 1991 January
/
swCHIP_95-1.bin
/
chip
/
tvgenpas
/
demo3pas.exe
/
TEMPLATE
/
MENUBAR.MTF
< prev
next >
Wrap
Text File
|
1994-10-27
|
3KB
|
102 lines
\ ********************************************************
\ Standard menubar template file for TVGen 3.0
\ (c) 1994 BOCIAN Software
\ ********************************************************
\
\ Recursively called procedure building up the menu source
\
@DEFPROC MenuProc
@IFEQUAL %_PARAMETER(2)% %_LEVELID%
\ Follows menu item
@IFEQUAL %_PARAMETER(1)% ITEM
NewItem('%_TEXT%','%_PARAM%',%_HOTKEY%,%_COMMAND%,%_HELPCTX%,
@IFAPP
@IF!EQUAL %_HINT% ''
@PUSHFILE 5
S.Put(%_HELPCTX%,'%_HINT%');
@INC __HINTCOUNTER
@POPFILE
@ENDIF (if!equal %hint%)
@IFOPTION HELP NOAPP FALSE
@IFSNIPPET HLP%_ITEMID%
@PUSHFILE 4
.topic %_SUBSTR(_HELPCTX,3,$FF)%=%_HELPVALUE%
@SNIPPET HLP%_ITEMID%
@POPFILE
@ENDIF (ifsnippet)
@ENDIF (ifoption)
@ENDIF (ifapp)
@ASSIGN __LEVEL %_LEVELID%
@NEXTITEM
@CALL MenuProc %_ITEMTYPE% %__LEVEL%
@NOCR )
@ENDIF (ifequal %_parameter(1)%)
\ Follows submenu
@IFEQUAL %_PARAMETER(1)% SUBMENU
NewSubMenu('%_TEXT%',%_HELPCTX%,NewMenu(
@IFAPP
@IF!EQUAL %_HINT% ''
@PUSHFILE 5
S.Put(%_HELPCTX%,'%_HINT%');
@INC __HINTCOUNTER
@POPFILE
@ENDIF (if!equal %hint%)
@IFOPTION HELP NOAPP FALSE
@IFSNIPPET HLP%_ITEMID%
@PUSHFILE 4
.topic %_SUBSTR(_HELPCTX,3,$FF)%=%_HELPVALUE%
@SNIPPET HLP%_ITEMID%
@POPFILE
@ENDIF (ifsnippet)
@ENDIF (ifoption)
@ENDIF (ifapp)
@ASSIGN __LEVEL %_ITEMID%
@NEXTITEM
@CALL MenuProc %_ITEMTYPE% %__LEVEL%
),
@ASSIGN __LEVEL %_PARAMETER(2)%
@CALL MenuProc %_ITEMTYPE% %__LEVEL%
@NOCR )
@ENDIF (ifequal %_parameter(1)%)
\ Follows divider line
@IFEQUAL %_PARAMETER(1)% LINE
NewLine(
@ASSIGN __LEVEL %_LEVELID%
@NEXTITEM
@CALL MenuProc %_ITEMTYPE% %__LEVEL%
@NOCR )
@ENDIF (ifequal %_parameter(1)%)
@ELSE
@NOCR nil
@ENDIF (ifequal %_parameter(2)%)
@ENDPROC
\
\
\ Main template sequence
@ASSIGN __MENUFILE %_OUTFILE%.%_EXT%
@DEFINEFILE 1 %_OUTFILE%.%_EXT%
@FILE 1
@IF!APP
@ASKFOR _APPTYPE 'TMyApp'
@ENDIF (if!app)
@IFOPTION MENU_IN_RSC NOAPP FALSE
procedure DefineMenuBar;
var R : TRect;
begin
MenuBar:=New(PMenuBar,Init(R,NewMenu(
@ELSE
procedure %_APPTYPE%.InitMenuBar;
var R : TRect;
begin
GetExtent(R);
R.B.Y:=R.A.Y+1;
MenuBar:=New(PMenuBar,Init(R,NewMenu(
@ENDIF (ifoption)
@FIRSTITEM
@CALL MenuProc %_ITEMTYPE% %_LEVELID%
)));
end;
{ ************ Generated by TVGen 3.0 ************** }
@CLOSEFILE 1