Recent

Author Topic: Menu editor only works if component is visible  (Read 504 times)

stem

  • Jr. Member
  • **
  • Posts: 59
Menu editor only works if component is visible
« on: May 01, 2019, 10:30:06 pm »
Hi,

I have a form with many components. In order to keep a clear overview, I have moved some (at run-time invisible) components like image lists or menus out of the form. My form has a width of 950 pixels and I've moved them further away to the right.

Is it a bug or a "feature", that the menu editor does not work correctly if the corresponding component is out of the visible form range? I can select the menu object component in the object inspector and the menu editor opens, but I cannot use the menu editor (for example click on an existing menu item).

I can reproduce this behaviour with Windows 10 and Linux Mint 19.1 Xfce, both with Lazarus 2.0.2.


Thank you!

stem

wp

  • Hero Member
  • *****
  • Posts: 6495
Re: Menu editor only works if component is visible
« Reply #1 on: May 02, 2019, 12:50:50 am »
What do you do when you want to edit a menu item and the TMenu component is beyond the border of the form? When I double-click on the "MainMenu1: TMainMenu" node in the object tree above the object inspector the MenuEditor opens as usual and I can edit the menu items without issues.

A better way to get nonvisual components off of the form is to put them on a TDataModule. This works well for ImageLists, Dialogs, ActionsList, but you can even put a TMainMenu on it. To show the menu on the form set its property Menu to the one on the DataModule. If your program crashes because the form needs resources on the datamodule which is not yet created go to "Project options" > "Forms" and move the datamodule up to the first position. And if you have many forms, it is written nowhere that a project can have only a single datamodule.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

stem

  • Jr. Member
  • **
  • Posts: 59
Re: Menu editor only works if component is visible
« Reply #2 on: May 14, 2019, 10:13:09 pm »
Unfortunately - or fortunately  ;) - I cannot reproduce the bug any more (neither with Linux nor with Windows). The original error message in the menu editor title bar was something like "no menu selected" or "menu not found". Even the MenuItems were not visible in the object inspector.

Maybe the .lfm file had an error that was repaired automatically by saving with the newest Lazarus version ...

stem

ϻαϻɾΣɀО

  • Jr. Member
  • **
  • Posts: 54
  • MaMrEzO
Re: Menu editor only works if component is visible
« Reply #3 on: May 25, 2019, 02:22:14 pm »
Just imagine the the Object Inspector,
When you select a component it will show and able you to watch or modify the properties!

The MenuEditor is same as the Object Inspector, It's not a modal dialog but a normal window, As you select a MainMenu/PupupMenu it will show your selected menu!
See the attached Screenshots bellow...
Debio-Sql is a new brand of GUI Database tool for the Firebird RDBMS.
http://debio-sql.ariaian.com/