FormDesigner Menu Design mode issue

You need some new stunning features ? Tell us here.
dougmo52usr
User
User
Posts: 55
Joined: Mon Jul 18, 2016 6:43 pm

FormDesigner Menu Design mode issue

Post by dougmo52usr »

I used FormDesigner to create a menu. Something simple like:

MainMenu
SubMenu1
SubMenu1Item1
SubMenu1Item2
SubMenu2
SubMenu2Item1
SubMenu2Item2

When FormDesigner is building the menu, it shows it as expected in the GUI design. The code should look like:

Code: Select all

  CreateMenu(0, WindowID(Window_0))
  MenuTitle("MenuTitle")
  OpenSubMenu("SubMenu1")
  MenuItem(#MenuItem_3, "SubMenu1Item1")
  MenuItem(#MenuItem_4, "SubMenu1Item2")
  CloseSubMenu()
  OpenSubMenu("SubMenu2")
  MenuItem(#MenuItem_6, "SubMenu2Item1")
  MenuItem(#MenuItem_7, "SubMenu2Item2")
  CloseSubMenu()
But If I save the code and look at it, FormDesigner has make SubMenu2 a submenu under submenu1.

MainMenu
SubMenu1
SubMenu1Item1
SubMenu1Item2
SubMenu1SubMenu2
SubMenu2Item1
SubMenu2Item2

Code: Select all

  CreateMenu(0, WindowID(Window_0))
  MenuTitle("MenuTitle")
  OpenSubMenu("SubMenu1")
  MenuItem(#MenuItem_3, "SubMenu1Item1")
  MenuItem(#MenuItem_4, "SubMenu1Item2")
  OpenSubMenu("SubMenu2")
  MenuItem(#MenuItem_6, "SubMenu2Item1")
  MenuItem(#MenuItem_7, "SubMenu2Item2")
  CloseSubMenu()
  CloseSubMenu()
If in Code View I edit the code to put the CloseSubMenu() back in the correct place and switch to design view, the menu looks correct. But if I then switch back to Code View, the code is now incorrect. The next time I switch to Design View, the CloseSubMenu() is again in the wrong place.

I had to hand code the menus in my PB file because of the CloseSubMenu() misplacement.
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: FormDesigner Menu Design mode issue

Post by TI-994A »

dougmo52usr wrote:...in Code View I edit the code to put the CloseSubMenu() back in the correct place and switch to design view, the menu looks correct.
The code page of the Form Designer does not accept edits. It conforms strictly to the properties of the visual objects, and generates the code accordingly. Any changes must be made in the visual window.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
dougmo52usr
User
User
Posts: 55
Joined: Mon Jul 18, 2016 6:43 pm

Re: FormDesigner Menu Design mode issue

Post by dougmo52usr »

Here's a link to what I saw in FormDesigner during the menu design:
https://www.dropbox.com/s/533vkggb5twdd ... 1.png?dl=0

Now I went from Design to Code to Design viwe and the appearance changed without editing the pbf file:
https://www.dropbox.com/s/ldaerxgszdp7h ... 2.png?dl=0

FormDesigner broke the code by relocating the CloseSubMenu() call. It changed merely be changing FormDesigner views, but if I compile and run the app, it is also incorrect.
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: FormDesigner Menu Design mode issue

Post by TI-994A »

dougmo52usr wrote:FormDesigner broke the code by relocating the CloseSubMenu() call...
You're right; there appears to be some inconsistencies in Form Designer's menu builder.

Image
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
bfernhout
Enthusiast
Enthusiast
Posts: 123
Joined: Mon Feb 26, 2018 10:41 pm
Location: Netherlands
Contact:

Re: FormDesigner Menu Design mode issue

Post by bfernhout »

May i come here and say the problmen still exist. Its now version 5.72 and still this problem exist.
From my first self made computer till now I stil like computers.
dougmo52usr
User
User
Posts: 55
Joined: Mon Jul 18, 2016 6:43 pm

Re: FormDesigner Menu Design mode issue

Post by dougmo52usr »

Running PureBasic 6.04 LTS (Linux - x64).

1. The menu issue in Form Designer still exists. If I create a menu with submenus, the design looks good when I view the form. But If I go to view code, and back to view form, it moves the OpenSubMenu()'s around and breaks things. For now, I am creating the menu in my code because Form Designer can't get it right.

2. I can type an event handler in for a menu item. but it doesn't seem to declare it, or use it in the automatically generated Window_0_Events procedure.
Post Reply