Menu bar question 
Author Message
 Menu bar question
Hey There,

I have built a custom menu bar and would like to add the MenuWorkGroupOpen
function to the menu bar, but I'm not sure how.  Do I do it as an AddPopUp
in the arrive method or do I do it in the menuaction method?  Does any one
have some Example code?

TIA
Craig Kunzel



Sun, 09 Jun 2002 03:00:00 GMT
 Menu bar question

i have done this type of thing before with the following code. This allows
me to have a standard menu that replaces the Pdox menu and creates
consistency through out the entire application. Each form in the application
has the same code. I change the library method InvRecMenuChoices() to add
additional items to the application. Works like a charm for me. Developed in
Pdox7.0 and use it in Pdox9.0.

I store the standard menu in a library. this code intializes the library
where the menu options  are:

A> At the form level have the following code;

method init(var eventInfo Event)

InvRecLib.open("InvRecVariables")
InvRecLib.InvRecMenu() ;************* see method in the library

if isToolbarshowing() then
 hidetoolbar()
endif
endMethod

B> on the form menaction have the following

method menuAction(var eventInfo MenuEvent)
const
kKeepFormOpen=UserMenu
endconst

var
mchoice     string
userinput,pstring  string

endvar
 if eventInfo.isPreFilter() then
  ;// This code executes for each object on the form

 else
  ;// This code executes only for the form

  if eventinfo.id()=MenuChangingWork then
   eventinfo.setErrorCode(kKeepFormOpen)
  endif

 mchoice = eventinfo.menuchoice()

   InvRecLib.InvRecMenuChoices(mchoice) ;************see call to library

 endIf

endMethod

C> in case you call another form from the form have the following at the
page level on the form:
method setFocus(var eventInfo Event)

InvRecLib.InvRecMenu()

if isToolbarshowing() then
 hidetoolbar()
endif
endMethod

D> the following is the applicable code in the library  called
InvRecVariables;

method InvRecMenu()
var
genMenu  Menu
sessionpop,wherepop,toolpop  popupmenu
tbar   toolbar
endvar

wherepop.addtext("Version")
genmenu.addpopup("Version",wherepop)

toolpop.addtext("Show Tool Bars")
genmenu.addpopup("Tools",toolpop)

genmenu.show()
if isToolbarshowing() then
 hidetoolbar()
endif
endMethod

;*****note the following just happens to be the menu choices i placed in the
application...these should be what you want

method InvRecMenuChoices(mchoice string)
var

userinput,pstring  string

endvar

 switch

;****the following code allows me to bring the standard Pdox menu back,
mainly used in development stage
  case mchoice= "Show Tool Bars":
   pstring="Enter Password"
   userinput=pstring
   userinput.view("Enter the password")

    if userinput="XXX" then
     removeMenu()
     showToolBar()
    endif

;****this is another standard menu item
  case mchoice="Version":

         InvRecVersionNbr()

  endswitch
endMethod

method InvRecVersionNbr()
 msgInfo("Version","3.00.00")
endMethod

if you interested in further explanation, feel free to contact me at

hope this helps

Quote:

>Hey There,

>I have built a custom menu bar and would like to add the MenuWorkGroupOpen
>function to the menu bar, but I'm not sure how.  Do I do it as an AddPopUp
>in the arrive method or do I do it in the menuaction method?  Does any one
>have some Example code?

>TIA
>Craig Kunzel



Mon, 10 Jun 2002 03:00:00 GMT
 Menu bar question
Thanks for the response,
I haven't tried your code yet but I was able to figure out how to add the
MenuWorkGroupOpen function.

var
    WindowPop popupmenu
    mainmenu menu
endvar

  WindowPop.addtext("",MenuNotChecked,menuaction(MenuWorkGroupOpen))
  mainmenu.addtext("E&xit")
  mainmenu.addpopup("&Window",windowpop)
  mainmenu.show()

Craig


Quote:
> i have done this type of thing before with the following code. This allows
> me to have a standard menu that replaces the Pdox menu and creates
> consistency through out the entire application. Each form in the
application
> has the same code. I change the library method InvRecMenuChoices() to add
> additional items to the application. Works like a charm for me. Developed
in
> Pdox7.0 and use it in Pdox9.0.

> I store the standard menu in a library. this code intializes the library
> where the menu options  are:

> A> At the form level have the following code;

> method init(var eventInfo Event)

> InvRecLib.open("InvRecVariables")
> InvRecLib.InvRecMenu() ;************* see method in the library

> if isToolbarshowing() then
>  hidetoolbar()
> endif
> endMethod

> B> on the form menaction have the following

> method menuAction(var eventInfo MenuEvent)
> const
> kKeepFormOpen=UserMenu
> endconst

> var
> mchoice     string
> userinput,pstring  string

> endvar
>  if eventInfo.isPreFilter() then
>   ;// This code executes for each object on the form

>  else
>   ;// This code executes only for the form

>   if eventinfo.id()=MenuChangingWork then
>    eventinfo.setErrorCode(kKeepFormOpen)
>   endif

>  mchoice = eventinfo.menuchoice()

>    InvRecLib.InvRecMenuChoices(mchoice) ;************see call to library

>  endIf

> endMethod

> C> in case you call another form from the form have the following at the
> page level on the form:
> method setFocus(var eventInfo Event)

> InvRecLib.InvRecMenu()

> if isToolbarshowing() then
>  hidetoolbar()
> endif
> endMethod

> D> the following is the applicable code in the library  called
> InvRecVariables;

> method InvRecMenu()
> var
> genMenu  Menu
> sessionpop,wherepop,toolpop  popupmenu
> tbar   toolbar
> endvar

> wherepop.addtext("Version")
> genmenu.addpopup("Version",wherepop)

> toolpop.addtext("Show Tool Bars")
> genmenu.addpopup("Tools",toolpop)

> genmenu.show()
> if isToolbarshowing() then
>  hidetoolbar()
> endif
> endMethod

> ;*****note the following just happens to be the menu choices i placed in
the
> application...these should be what you want

> method InvRecMenuChoices(mchoice string)
> var

> userinput,pstring  string

> endvar

>  switch

> ;****the following code allows me to bring the standard Pdox menu back,
> mainly used in development stage
>   case mchoice= "Show Tool Bars":
>    pstring="Enter Password"
>    userinput=pstring
>    userinput.view("Enter the password")

>     if userinput="XXX" then
>      removeMenu()
>      showToolBar()
>     endif

> ;****this is another standard menu item
>   case mchoice="Version":

>          InvRecVersionNbr()

>   endswitch
> endMethod

> method InvRecVersionNbr()
>  msgInfo("Version","3.00.00")
> endMethod

> if you interested in further explanation, feel free to contact me at

> hope this helps




- Show quoted text -

Quote:
> >Hey There,

> >I have built a custom menu bar and would like to add the
MenuWorkGroupOpen
> >function to the menu bar, but I'm not sure how.  Do I do it as an
AddPopUp
> >in the arrive method or do I do it in the menuaction method?  Does any
one
> >have some Example code?

> >TIA
> >Craig Kunzel



Mon, 17 Jun 2002 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Icon Menu bar question

2. Question on Menu Bar in FPD2.6A

3. DTS Task icons missing from Task bar and menu

4. Disabling Menu Bar Items

5. DTS : Menu bars missing

6. Menu Bars!

7. Menu bars

8. Cut, Copy and Paste in the menu bar

9. Trigger event from Menu Bar

10. Access key in menu bar in Visual basic

11. Expanded Menu Messages on the Status Bar.

12. Paradox 8 without menu bar


 
Powered by phpBB® Forum Software