[futurebasic] Re: [FB] Problem with SubMenu insertion (FB 3)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2001 : Group Archive : Group : All Groups

From: Joe Lewis Wilkins <PepeToo@...>
Date: Thu, 29 Mar 2001 23:00:51 -0800
Hi Robert,

Robert Covington wrote:

> I am trying to insert a submenu in a non-resource menu, with the below. But
> I will be darned if I can get it to show up in actual use, unlike my other
> submenu's do using the exact same approach . Any ideas how to fix it?
>
> ID has been changed as a test here and there, still no showing up of the
> submenu once built.
>
> Thanks,
>
> Robert Covington
>
> MENU 4,0, _enable,    "Frame"
> //
> MENU 4,1, 100,     "Ratio/"+ CHR$(&1B)
> <snip of other items below>
>
> CALL INSERTMENU(FN NEWMENU(100,""), -1)

****************

I think you should try it this way:

Set up a Resource Menu _NumberOfSubRrsrMenu containing:

"1 : 1"
"2 : 3"
"2 : 4"
"3 : 4"
"3 : 5"
"4 : 5"
"Custom..."
"-"
"Natural"


DIM itemStr$
DIM title$
DIM parentMenuID%
DIM parentMenuItem%
DIM childMenuID%

parentMenuID% = 4                      'Better to use constant
parentMenuItem% = 1                  'Ditto
childMenuID% = _NumberOfSubRsrcMenu  'Constant for Rsrc Number
itemStr$ = "Ratio"

// This works better to set up following as a Local FN and pass the
// above as parameters to it, then you can use it for several SubMenus.

title$ = "!" + CHR$(childMenuID%) + itemStr$ + "/"+ CHR$(&1B)

MENU parentMenuID%,parentMenuItem%, _enable,title$

CALL INSERTMENU (FN NEWMENU(childMenuID%,""),-1)

This should work if I didn't make any typos.

Joe Wilkins