Subject Re: MENUBAR
From Andy Taylor <andy.taylor@which.net>
Date Mon, 21 Aug 2017 04:28:07 -0400
Newsgroups dbase.getting-started

Mustansir,

On my system you have to click Files->Open for the test.wfm to open.
When pushbutton1 is pressed the form closes and the test.mnu remains as the menu.
The IDE menu only comes back when I choose Files->Exit and I then click on the Navigator window.
Which presumably is what you intended...

I know that's not going to help...

Andy

> Dear All
>
> Sometimes it becomes a real test when program is not responding the way we want.
>
> Below I have 3 files. When I run start.prg attaches test menu to _app.framewin. In the menu bar when I click Files it opens test.wfm form. When I click pushbutton in test form. I closes the form. Here I expect on App.framewin test menubar to remain. But it does NOT. Instead IDE menubar returns. And from here everything goes hayway.
>
> Can anybody look in below code to see where I have made an error.
>
> Assistance is appreciated.
>
> Thanks
> Mustansir
>
>
> 1. Start.prg
>
> set procedure to test.mnu additive
> _app.rootMenu = new testMenu( _app.framewin, "Root" )
> shell( false, true )
>
>
> 2. test.mnu
> ** END HEADER -- do not remove this line
> //
> // Generated on 08/19/2017
> //
> parameter formObj
> new TESTMENU(formObj, "root")
>
> class TESTMENU(formObj, name) of MENUBAR(formObj, name)
>    this.MENU1 = new MENU(this)
>    with (this.MENU1)
>       text = "Files"
>    endwith
>
>    this.MENU1.MENU2 = new MENU(this.MENU1)
>    with (this.MENU1.MENU2)
>       onClick = {;do test.wfm}
>       text = "Open"
>    endwith
>
>    this.MENU1.MENU3 = new MENU(this.MENU1)
>    with (this.MENU1.MENU3)
>       onClick = {;shell( true, true );_app.framewin.root.release()}
>       text = "Exit"
>    endwith
>
>
> endclass
>
>
> 3. test.wfm
>
> ** END HEADER -- do not remove this line
> //
> // Generated on 08/20/2017
> //
> parameter bModal
> local f
> f = new testForm()
> if (bModal)
>    f.mdi = false // ensure not MDI
>    f.readModal()
> else
>    f.open()
> endif
>
> class testForm of FORM
>    with (this)
>       height = 16.0
>       left = 21.5714
>       top = 5.0
>       width = 95.4286
>       text = ""
>    endwith
>
>    this.PUSHBUTTON1 = new PUSHBUTTON(this)
>    with (this.PUSHBUTTON1)
>       onClick = {;form.close()}
>       height = 2.5
>       left = 32.0
>       top = 7.0
>       width = 16.0
>       text = "Pushbutton1"
>    endwith
>
>
> endclass
>
>