home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
swCHIP 1991 January
/
swCHIP_95-1.bin
/
chip
/
tvgencpp
/
demo3cpp.exe
/
TEMPLATE
/
MENUBOX.MTF
< prev
next >
Wrap
Text File
|
1994-12-02
|
4KB
|
139 lines
\ ********************************************************
\ Standard menubox 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
@IFEQUAL %__FIRSTFLAG% YES
@ASSIGN __FIRSTFLAG NO
@ELSE
+
@ENDIF
@IFEQUAL %_PARAM% ''
@NOCR *new TMenuItem("%_TEXT%",%_COMMAND%,%_HOTKEY%,%_HELPCTX%)
@ELSE
@NOCR *new TMenuItem("%_TEXT%",%_COMMAND%,%_HOTKEY%,%_HELPCTX%,"%_PARAM%")
@ENDIF
@ASSIGN __LEVEL %_LEVELID%
@NEXTITEM
@CALL MenuProc %_ITEMTYPE% %__LEVEL%
@ENDIF (ifequal %_parameter(1)%)
\ Follows submenu
@IFEQUAL %_PARAMETER(1)% SUBMENU
@IFEQUAL %__FIRSTFLAG% YES
@ELSE
+
@ENDIF
*new TMenuItem("%_TEXT%",kbNoKey, new TMenu(
@ASSIGN __MENUHC[_PARAMETER(2)] %_HELPCTX%
@ASSIGN __LEVEL %_ITEMID%
@ASSIGN __FIRSTFLAG YES
@NEXTITEM
@CALL MenuProc %_ITEMTYPE% %__LEVEL%
@NOCR ),%__MENUHC[_PARAMETER(2)]%)
@ASSIGN __LEVEL %_PARAMETER(2)%
@CALL MenuProc %_ITEMTYPE% %__LEVEL%
@ENDIF (ifequal %_parameter(1)%)
\ Follows divider line
@IFEQUAL %_PARAMETER(1)% LINE
@IFEQUAL %__FIRSTFLAG% YES
@ASSIGN __FIRSTFLAG NO
@ELSE
+
@ENDIF
@NOCR newLine()
@ASSIGN __LEVEL %_LEVELID%
@NEXTITEM
@CALL MenuProc %_ITEMTYPE% %__LEVEL%
@ENDIF (ifequal %_parameter(1)%)
@ELSE
@ENDIF (ifequal %_parameter(2)%)
@ENDPROC
@DEFPROC MainMenuProc
@IFEQUAL %_PARAMETER(2)% %_LEVELID%
\ Follows menu item
@IFEQUAL %_PARAMETER(1)% ITEM
TMenuItem *top%__COUNTER% = new TMenuItem("%_TEXT%",%_COMMAND%,%_HOTKEY%,%_HELPCTX%);
@ASSIGN __LEVEL %_LEVELID%
@NEXTITEM
@INC __COUNTER
@CALL MainMenuProc %_ITEMTYPE% %_LEVELID%
@ENDIF
@IFEQUAL %_PARAMETER(1)% LINE
TMenuItem *top%__COUNTER% = newLine();
@ASSIGN __LEVEL %_LEVELID%
@NEXTITEM
@INC __COUNTER
@CALL MainMenuProc %_ITEMTYPE% %_LEVELID%
@ENDIF
@IFEQUAL %_PARAMETER(1)% SUBMENU
TMenuItem *top%__COUNTER% = new TMenuItem("%_TEXT%",kbNoKey, new TMenu(
@ASSIGN __LEVEL %_ITEMID%
@ASSIGN __MENUHC[_PARAMETER(2)] %_HELPCTX%
@ASSIGN __FIRSTFLAG YES
@NEXTITEM
@CALL MenuProc %_ITEMTYPE% %__LEVEL%
),%__MENUHC[_PARAMETER(2)]%);
@ASSIGN __LEVEL %_PARAMETER(2)%
@INC __COUNTER
@CALL MainMenuProc %_ITEMTYPE% %__LEVEL%
@ENDIF
@ENDPROC
\
\
\ Main template sequence
@ASSIGN __MENUFILE %_OUTFILE%.%_EXT%
@ASSIGN __COUNTER 1
@FIRSTITEM
@DEFINEFILE 1 %_OUTFILE%.%_EXT%
@FILE 1
TMenuItem& operator +(TMenuItem& menuItem1, TMenuItem& menuItem2)
{
TMenuItem *p=&menuItem1;
while(p->next!=NULL) p=p->next;
p->next=&menuItem2;
return menuItem1;
}
@ASKFOR __FUNCNAME 'MakeMenuBox' 'MenuBox function name'
TMenuBox *%__FUNCNAME%(TRect r)
{
@CALL MainMenuProc %_ITEMTYPE% %_LEVELID%
@DEC __COUNTER
@ASSIGN __LOOPCOUNTER 1
return (new TMenuBox(r, new TMenu(
@LOOP
@IFEQUAL %__LOOPCOUNTER% %__COUNTER%
@IFEQUAL %__LOOPCOUNTER% 1
*top%__LOOPCOUNTER%),0));
@ELSE
+ *top%__LOOPCOUNTER%),0));
@ENDIF
@EXIT
@ELSE
@IFEQUAL %__LOOPCOUNTER% 1
*top%__LOOPCOUNTER%
@ELSE
+ *top%__LOOPCOUNTER%
@ENDIF
@INC __LOOPCOUNTER
@ENDIF
@ENDLOOP
}
// ************ Generated by TVGen 3.0 **************
@CLOSEFILE 1