Author | Topic: Menu Creation Lesson | |
---|---|---|
Carmelo Rioflorido | Menu Creation Lesson on Mon, 19 Sep 2005 20:45:44 -0700 Hi Everyone, In the attached menu coding, (1) How could I disable the menu item once the function is activated? (2) Where could I insert the "message" for each menu item so that it will appear at the bottom of the screen? Thanks for your help. Carmelo ************* oSubMenu := XbpMenu():new(oMenuBar):create() oSubMenu:title := "~Functional" oSubMenu:addItem( { "Function ~1", {|| MyFunction1() } } ) oSubMenu:addItem( { "Function ~2", {|| MyFunction2() } } ) oSubMenu:addItem( { "~End" , {|| MyFunction3() } } ) oMenuBar:addItem( { oSubMenu, NIL } ) ******** | |
James Loughner | Re: Menu Creation Lesson on Tue, 20 Sep 2005 01:06:30 -0400 ************* oSubMenu := XbpMenu():new(oMenuBar):create() oSubMenu:title := "~Functional" oSubMenu:addItem( { "Function ~1",; {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction1(),; oMenu:enabaleItem(nPos) } } ) oSubMenu:addItem( { "Function ~2",; {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction2(),; oMenu:enabaleItem(nPos) } } ) oSubMenu:addItem( { "~End" ,; {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction3(),; oMenu:enabaleItem(nPos) } } ) oMenuBar:addItem( { oSubMenu, NIL } ) ******** This assumes that your functions don't start new threads and thus return immediately. If so you will then have to pass the oMenu object to your function and enable the menu item before ending the thread. Jim Carmelo Rioflorido wrote: > Hi Everyone, > > In the attached menu coding, > > (1) How could I disable the menu item once the function is activated? > > (2) Where could I insert the "message" for each menu item so that it will > appear at the bottom of the screen? > > Thanks for your help. > > Carmelo > > ************* > oSubMenu := XbpMenu():new(oMenuBar):create() > oSubMenu:title := "~Functional" > oSubMenu:addItem( { "Function ~1", {|| MyFunction1() } } ) > oSubMenu:addItem( { "Function ~2", {|| MyFunction2() } } ) > oSubMenu:addItem( { "~End" , {|| MyFunction3() } } ) > > oMenuBar:addItem( { oSubMenu, NIL } ) > ******** > > | |
Carmelo Rioflorido | Re: Menu Creation Lesson on Mon, 19 Sep 2005 22:06:01 -0700 Hi Jim, Thank you very much for your quick response. I will try this immediately. Carmelo "James Loughner" <jwrl@charter.net> wrote in message news:DY$5DEavFHA.6152@S15147418... > > ************* > oSubMenu := XbpMenu():new(oMenuBar):create() > oSubMenu:title := "~Functional" > oSubMenu:addItem( { "Function ~1",; > {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction1(),; > oMenu:enabaleItem(nPos) } } ) > oSubMenu:addItem( { "Function ~2",; > {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction2(),; > oMenu:enabaleItem(nPos) } } ) > oSubMenu:addItem( { "~End" ,; > {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction3(),; > oMenu:enabaleItem(nPos) } } ) > > oMenuBar:addItem( { oSubMenu, NIL } ) > ******** > > This assumes that your functions don't start new threads and thus return > immediately. If so you will then have to pass the oMenu object to your > function and enable the menu item before ending the thread. > > > Jim > > Carmelo Rioflorido wrote: > > Hi Everyone, > > > > In the attached menu coding, > > > > (1) How could I disable the menu item once the function is activated? > > > > (2) Where could I insert the "message" for each menu item so that it will > > appear at the bottom of the screen? > > > > Thanks for your help. > > > > Carmelo > > > > ************* > > oSubMenu := XbpMenu():new(oMenuBar):create() > > oSubMenu:title := "~Functional" > > oSubMenu:addItem( { "Function ~1", {|| MyFunction1() } } ) > > oSubMenu:addItem( { "Function ~2", {|| MyFunction2() } } ) > > oSubMenu:addItem( { "~End" , {|| MyFunction3() } } ) > > > > oMenuBar:addItem( { oSubMenu, NIL } ) > > ******** > > > > | |
Mark Carew | Re: Menu Creation Lesson on Tue, 20 Sep 2005 18:09:41 +1000 Hi Carmelo & Jim, That is probably enable rather than enabale. Regards Mark "Carmelo Rioflorido" <unisoft@cox.net> wrote in message news:EkbwKHavFHA.6152@S15147418... > Hi Jim, > > Thank you very much for your quick response. I will try this immediately. > > Carmelo > > > > "James Loughner" <jwrl@charter.net> wrote in message > news:DY$5DEavFHA.6152@S15147418... >> >> ************* >> oSubMenu := XbpMenu():new(oMenuBar):create() >> oSubMenu:title := "~Functional" >> oSubMenu:addItem( { "Function ~1",; >> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction1(),; >> oMenu:enabaleItem(nPos) } } ) >> oSubMenu:addItem( { "Function ~2",; >> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction2(),; >> oMenu:enabaleItem(nPos) } } ) >> oSubMenu:addItem( { "~End" ,; >> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction3(),; >> oMenu:enabaleItem(nPos) } } ) >> >> oMenuBar:addItem( { oSubMenu, NIL } ) >> ******** >> >> This assumes that your functions don't start new threads and thus return >> immediately. If so you will then have to pass the oMenu object to your >> function and enable the menu item before ending the thread. >> >> >> Jim >> >> Carmelo Rioflorido wrote: >> > Hi Everyone, >> > >> > In the attached menu coding, >> > >> > (1) How could I disable the menu item once the function is activated? >> > >> > (2) Where could I insert the "message" for each menu item so that it > will >> > appear at the bottom of the screen? >> > >> > Thanks for your help. >> > >> > Carmelo >> > >> > ************* >> > oSubMenu := XbpMenu():new(oMenuBar):create() >> > oSubMenu:title := "~Functional" >> > oSubMenu:addItem( { "Function ~1", {|| MyFunction1() } } ) >> > oSubMenu:addItem( { "Function ~2", {|| MyFunction2() } } ) >> > oSubMenu:addItem( { "~End" , {|| MyFunction3() } } ) >> > >> > oMenuBar:addItem( { oSubMenu, NIL } ) >> > ******** >> > >> > > > | |
James Loughner | Re: Menu Creation Lesson on Tue, 20 Sep 2005 11:14:06 -0400 Yep, a slip of the old fingers Jim Mark Carew wrote: > Hi Carmelo & Jim, > That is probably enable rather than enabale. > Regards > Mark > > "Carmelo Rioflorido" <unisoft@cox.net> wrote in message > news:EkbwKHavFHA.6152@S15147418... > >>Hi Jim, >> >>Thank you very much for your quick response. I will try this immediately. >> >>Carmelo >> >> >> >>"James Loughner" <jwrl@charter.net> wrote in message >>news:DY$5DEavFHA.6152@S15147418... >> >>> ************* >>> oSubMenu := XbpMenu():new(oMenuBar):create() >>> oSubMenu:title := "~Functional" >>> oSubMenu:addItem( { "Function ~1",; >>> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction1(),; >>> oMenu:enabaleItem(nPos) } } ) >>> oSubMenu:addItem( { "Function ~2",; >>> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction2(),; >>> oMenu:enabaleItem(nPos) } } ) >>> oSubMenu:addItem( { "~End" ,; >>> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction3(),; >>> oMenu:enabaleItem(nPos) } } ) >>> >>> oMenuBar:addItem( { oSubMenu, NIL } ) >>> ******** >>> >>>This assumes that your functions don't start new threads and thus return >>>immediately. If so you will then have to pass the oMenu object to your >>>function and enable the menu item before ending the thread. >>> >>> >>>Jim >>> >>>Carmelo Rioflorido wrote: >>> >>>>Hi Everyone, >>>> >>>>In the attached menu coding, >>>> >>>>(1) How could I disable the menu item once the function is activated? >>>> >>>>(2) Where could I insert the "message" for each menu item so that it >> >>will >> >>>>appear at the bottom of the screen? >>>> >>>>Thanks for your help. >>>> >>>>Carmelo >>>> >>>>************* >>>>oSubMenu := XbpMenu():new(oMenuBar):create() >>>> oSubMenu:title := "~Functional" >>>> oSubMenu:addItem( { "Function ~1", {|| MyFunction1() } } ) >>>> oSubMenu:addItem( { "Function ~2", {|| MyFunction2() } } ) >>>> oSubMenu:addItem( { "~End" , {|| MyFunction3() } } ) >>>> >>>> oMenuBar:addItem( { oSubMenu, NIL } ) >>>>******** >>>> >>>> >> >> > > | |
Carmelo Rioflorido | Re: Menu Creation Lesson on Fri, 23 Sep 2005 21:05:48 -0700 Hi Jim, After some trial-and-error programming, I was able to disable and enable ALL of my main Menu Items whenever any one of the sub-items are selected. The only thing is I don't have explanation why it worked. For a last favor, how would I insert the caption for each menu item so that it shows up at the bottom of the screen whenever the menu item is highlighted. Here's what I did. Thanks again, Carmelo Item1 Item2 Item3 Search Reports About <<< Main Menu Items ... etc... oSubMenu := XbpMenu():new(oMenuBar):create() oSubMenu:title := "~Reports" oPopMenu := XbpMenu():new(oSubMenu):create() oPopMenu:title := "Lists of ~Subcribers" oPopMenu:Additem({"~Alphabetical List", {|| oMenuBar:disable(1), asub_subbar(), MenuBar:enable(1) }}) oPopMenu:Additem({"~By Account Number", {|| oMenuBar:disable(1), nsub_subbar(), oMenuBar:enable(1) }}) oPopMenu:Additem({"~Excess Payment", {|| oMenuBar:disable(1), expay_subbar(), oMenuBar:enable(1) }}) oPopMenu:Additem({"~Cash Accounts", {|| oMenuBar:disable(1), cashsub_subbar(), oMenuBar:enable(1) }}) oSubMenu:Additem({ oPopMenu, NIL}) oPopMenu := XbpMenu():new(oSubMenu):create() oPopMenu:title := "~Insurance Companies" oPopMenu:Additem({"~Alphabetical List", {|| oMenuBar:disable(1), ains_subbar(), oMenuBar:enable(1) }}) oPopMenu:Additem({"~List By Company Code", {|| oMenuBar:disable(1), nins_subbar(), oMenuBar:enable(1) }}) oPopMenu:addItem( {" ", {||DUMMY() }, XBPMENUBAR_MIS_SEPARATOR } ) oPopMenu:Additem({"~Capitation Listing", {|| oMenuBar:disable(1), capit_subbar(), oMenuBar:enable(1) }}) oPopMenu:Additem({"Account ~Statement", {|| oMenuBar:disable(1), accnt_subbar(), oMenuBar:enable(1) }}) oSubMenu:Additem({ oPopMenu, NIL}) oSubMenu:addItem( { "Summary of ~Treatments", {|| oMenuBar:disable(1), sumtreat_bar(), oMenuBar:enable(1) } } ) oSubMenu:addItem( {" ", {||DUMMY() }, XBPMENUBAR_MIS_SEPARATOR } ) oPopMenu := XbpMenu():new(oSubMenu):create() oPopMenu:title := "~Income Reports" oPopMenu:Additem({"~Today's Income", {|| oMenuBar:disable(1), tdinc_subbar(), oMenuBar:enable(1) }}) etc.... "James Loughner" <jwrl@charter.net> wrote in message news:6DQ4dXfvFHA.3184@S15147418... > Yep, a slip of the old fingers > > Jim > > Mark Carew wrote: > > > Hi Carmelo & Jim, > > That is probably enable rather than enabale. > > Regards > > Mark > > > > "Carmelo Rioflorido" <unisoft@cox.net> wrote in message > > news:EkbwKHavFHA.6152@S15147418... > > > >>Hi Jim, > >> > >>Thank you very much for your quick response. I will try this immediately. > >> > >>Carmelo > >> > >> > >> > >>"James Loughner" <jwrl@charter.net> wrote in message > >>news:DY$5DEavFHA.6152@S15147418... > >> > >>> ************* > >>> oSubMenu := XbpMenu():new(oMenuBar):create() > >>> oSubMenu:title := "~Functional" > >>> oSubMenu:addItem( { "Function ~1",; > >>> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction1(),; > >>> oMenu:enabaleItem(nPos) } } ) > >>> oSubMenu:addItem( { "Function ~2",; > >>> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction2(),; > >>> oMenu:enabaleItem(nPos) } } ) > >>> oSubMenu:addItem( { "~End" ,; > >>> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction3(),; > >>> oMenu:enabaleItem(nPos) } } ) > >>> > >>> oMenuBar:addItem( { oSubMenu, NIL } ) > >>> ******** > >>> > >>>This assumes that your functions don't start new threads and thus return > >>>immediately. If so you will then have to pass the oMenu object to your > >>>function and enable the menu item before ending the thread. > >>> > >>> > >>>Jim > >>> > >>>Carmelo Rioflorido wrote: > >>> > >>>>Hi Everyone, > >>>> > >>>>In the attached menu coding, > >>>> > >>>>(1) How could I disable the menu item once the function is activated? > >>>> > >>>>(2) Where could I insert the "message" for each menu item so that it > >> > >>will > >> > >>>>appear at the bottom of the screen? > >>>> > >>>>Thanks for your help. > >>>> > >>>>Carmelo > >>>> > >>>>************* > >>>>oSubMenu := XbpMenu():new(oMenuBar):create() > >>>> oSubMenu:title := "~Functional" > >>>> oSubMenu:addItem( { "Function ~1", {|| MyFunction1() } } ) > >>>> oSubMenu:addItem( { "Function ~2", {|| MyFunction2() } } ) > >>>> oSubMenu:addItem( { "~End" , {|| MyFunction3() } } ) > >>>> > >>>> oMenuBar:addItem( { oSubMenu, NIL } ) > >>>>******** > >>>> > >>>> > >> > >> > > > > | |
James Loughner | Re: Menu Creation Lesson on Sat, 24 Sep 2005 02:20:39 -0400 I don't know why it works either You should try and have a unique variable hold each of your menu objects. Your naming convention is very hard to understand. Rather then use opopmenu and osubmenu everywhere. I expect the odd why you are creating and naming them may be the reason that you must alway use the first menu item to enable disable. ????? Jim Carmelo Rioflorido wrote: > Hi Jim, > > After some trial-and-error programming, I was able to disable and enable ALL > of my main Menu Items whenever any one of the sub-items are selected. The > only thing is I don't have explanation why it worked. > > For a last favor, how would I insert the caption for each menu item so that > it shows up at the bottom of the screen whenever the menu item is > highlighted. > > Here's what I did. > > Thanks again, > Carmelo > > Item1 Item2 Item3 Search Reports About > <<< Main Menu Items > > ... etc... > oSubMenu := XbpMenu():new(oMenuBar):create() > oSubMenu:title := "~Reports" > oPopMenu := XbpMenu():new(oSubMenu):create() > oPopMenu:title := "Lists of ~Subcribers" > oPopMenu:Additem({"~Alphabetical List", {|| oMenuBar:disable(1), > asub_subbar(), MenuBar:enable(1) }}) > oPopMenu:Additem({"~By Account Number", {|| oMenuBar:disable(1), > nsub_subbar(), oMenuBar:enable(1) }}) > oPopMenu:Additem({"~Excess Payment", {|| oMenuBar:disable(1), > expay_subbar(), oMenuBar:enable(1) }}) > oPopMenu:Additem({"~Cash Accounts", {|| oMenuBar:disable(1), > cashsub_subbar(), oMenuBar:enable(1) }}) > oSubMenu:Additem({ oPopMenu, NIL}) > > oPopMenu := XbpMenu():new(oSubMenu):create() > oPopMenu:title := "~Insurance Companies" > oPopMenu:Additem({"~Alphabetical List", {|| oMenuBar:disable(1), > ains_subbar(), oMenuBar:enable(1) }}) > oPopMenu:Additem({"~List By Company Code", {|| oMenuBar:disable(1), > nins_subbar(), oMenuBar:enable(1) }}) > oPopMenu:addItem( {" ", {||DUMMY() }, XBPMENUBAR_MIS_SEPARATOR } ) > oPopMenu:Additem({"~Capitation Listing", {|| oMenuBar:disable(1), > capit_subbar(), oMenuBar:enable(1) }}) > oPopMenu:Additem({"Account ~Statement", {|| oMenuBar:disable(1), > accnt_subbar(), oMenuBar:enable(1) }}) > oSubMenu:Additem({ oPopMenu, NIL}) > > oSubMenu:addItem( { "Summary of ~Treatments", {|| oMenuBar:disable(1), > sumtreat_bar(), oMenuBar:enable(1) } } ) > oSubMenu:addItem( {" ", {||DUMMY() }, XBPMENUBAR_MIS_SEPARATOR } ) > oPopMenu := XbpMenu():new(oSubMenu):create() > > oPopMenu:title := "~Income Reports" > oPopMenu:Additem({"~Today's Income", {|| oMenuBar:disable(1), > tdinc_subbar(), oMenuBar:enable(1) }}) > > etc.... > > > > > "James Loughner" <jwrl@charter.net> wrote in message > news:6DQ4dXfvFHA.3184@S15147418... > >>Yep, a slip of the old fingers >> >>Jim >> >>Mark Carew wrote: >> >> >>>Hi Carmelo & Jim, >>> That is probably enable rather than enabale. >>> Regards >>> Mark >>> >>>"Carmelo Rioflorido" <unisoft@cox.net> wrote in message >>>news:EkbwKHavFHA.6152@S15147418... >>> >>> >>>>Hi Jim, >>>> >>>>Thank you very much for your quick response. I will try this > > immediately. > >>>>Carmelo >>>> >>>> >>>> >>>>"James Loughner" <jwrl@charter.net> wrote in message >>>>news:DY$5DEavFHA.6152@S15147418... >>>> >>>> >>>>> ************* >>>>> oSubMenu := XbpMenu():new(oMenuBar):create() >>>>> oSubMenu:title := "~Functional" >>>>> oSubMenu:addItem( { "Function ~1",; >>>>> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction1(),; >>>>> oMenu:enabaleItem(nPos) } } ) >>>>> oSubMenu:addItem( { "Function ~2",; >>>>> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction2(),; >>>>> oMenu:enabaleItem(nPos) } } ) >>>>> oSubMenu:addItem( { "~End" ,; >>>>> {|nPos,y,oMenu|oMenu:disable(nPos) ,MyFunction3(),; >>>>> oMenu:enabaleItem(nPos) } } ) >>>>> >>>>> oMenuBar:addItem( { oSubMenu, NIL } ) >>>>> ******** >>>>> >>>>>This assumes that your functions don't start new threads and thus > > return > >>>>>immediately. If so you will then have to pass the oMenu object to your >>>>>function and enable the menu item before ending the thread. >>>>> >>>>> >>>>>Jim >>>>> >>>>>Carmelo Rioflorido wrote: >>>>> >>>>> >>>>>>Hi Everyone, >>>>>> >>>>>>In the attached menu coding, >>>>>> >>>>>>(1) How could I disable the menu item once the function is activated? >>>>>> >>>>>>(2) Where could I insert the "message" for each menu item so that it >>>> >>>>will >>>> >>>> >>>>>>appear at the bottom of the screen? >>>>>> >>>>>>Thanks for your help. >>>>>> >>>>>>Carmelo >>>>>> >>>>>>************* >>>>>>oSubMenu := XbpMenu():new(oMenuBar):create() >>>>>> oSubMenu:title := "~Functional" >>>>>> oSubMenu:addItem( { "Function ~1", {|| MyFunction1() } } ) >>>>>> oSubMenu:addItem( { "Function ~2", {|| MyFunction2() } } ) >>>>>> oSubMenu:addItem( { "~End" , {|| MyFunction3() } } ) >>>>>> >>>>>> oMenuBar:addItem( { oSubMenu, NIL } ) >>>>>>******** >>>>>> >>>>>> >>>> >>>> >>> > > |