Recent

Author Topic: TMainMenu : Move main item to subitem  (Read 2937 times)

Zath

  • Sr. Member
  • ****
  • Posts: 391
TMainMenu : Move main item to subitem
« on: January 04, 2020, 07:18:34 pm »
TMainMenu : Move main item to subitem

Is it possible to move a menu item down from being a main item and into a sub item of another main item ?

I have tried to drag but can't get it to take.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: TMainMenu : Move main item to subitem
« Reply #1 on: January 04, 2020, 08:24:17 pm »
At present this is not possible in the menu designer using drag-and-drop.
It is a ToDo that has not been done.
I'm sure a patch to add this functionality would be accepted.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8550
Re: TMainMenu : Move main item to subitem
« Reply #2 on: January 04, 2020, 09:10:21 pm »
s/accepted/appreciated/ :-)
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: TMainMenu : Move main item to subitem
« Reply #3 on: January 04, 2020, 10:25:55 pm »
If memory serves correctly the old menu editor (present in versions up to 1.6, I think) did have a drag-and-drop capability.
You could fire up (or build) an earlier version of Lazarus and probably do what you want with the menus.

I don't remember if it allowed you to promote submenus to become main menus (or demote main menus to become submenus), but I would have expected it to do this.
The complexity involved in such operations is the principal reason it has remained a ToDo until now. AFAIK no one has asked for this until now.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8550
Re: TMainMenu : Move main item to subitem
« Reply #4 on: January 04, 2020, 10:34:33 pm »
I've got 1.0.14 runnable, I'll check in the morning.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: TMainMenu : Move main item to subitem
« Reply #5 on: January 05, 2020, 12:40:24 am »
Thanks howardpc for the detailed reply.

Also thanks MarkMLI for seeing if it works.


Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: TMainMenu : Move main item to subitem
« Reply #6 on: January 05, 2020, 12:53:26 am »
I have just opened Delphi Community Edition. 10.3
It allows drag to reorder main menu items across the top level.
It doesn't allow a top menu item to be dragged into another to become a subset.
It does allow the dragging of individual sub items across into other top items lists.


wp

  • Hero Member
  • *****
  • Posts: 13408
Re: TMainMenu : Move main item to subitem
« Reply #7 on: January 05, 2020, 01:09:29 am »
If there is complex menu it may make sense to edit the lfm file - simply drag the items to be relocated under their new top level item. In the attached screenshot the "Cut", "Copy", "Paste" items have been incidentally added under the "File" menu (enclosed by a red rectangle). In order to get them into the "Edit" menu drag then rectangle text block to the position indicated by the dashed line.

Of course, editing the lfm file is risky - you can damage the form easily. Therefore, do this only after making a backup copy of the lfm file!

MarkMLl

  • Hero Member
  • *****
  • Posts: 8550
Re: TMainMenu : Move main item to subitem
« Reply #8 on: January 05, 2020, 11:41:24 am »
1.0.14 has menu editing driven by right-clicks and while it has insert before/after, move up/down and create submenu it doesn't have any obvious drag-and-drop.

1.6.4 has a similar UI but does appear to have drag-and-drop which allows a misplaced top-level item to be relocated.

1.8.0 has the new-style menu editor without D&D.

I don't currently have intervening versions.

I'd have thought that this should be supported as an analogue of the "Change Parent..." right-click item for components.

MarkMLl
« Last Edit: January 05, 2020, 12:01:53 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: TMainMenu : Move main item to subitem
« Reply #9 on: January 05, 2020, 12:33:11 pm »
Thanks for all that effort MarkMLI.

I decided to edit the lfm directly, as was also suggested above and I had originally considered.
It worked perfectly.
That said, I assume there might be problems if some sub items had similar names etc.

Another option I have just thought of would be to use third party menu components that might have the facility.


MarkMLl

  • Hero Member
  • *****
  • Posts: 8550
Re: TMainMenu : Move main item to subitem
« Reply #10 on: January 05, 2020, 12:56:33 pm »
Thanks for all that effort MarkMLI.

No signifcant effort I assure you, I've got binaries of the major releases plus the required FPC version ready to run.

Another option I have just thought of would be to use third party menu components that might have the facility.

Problem there is that a menu is a specialised attribute of a form, it only /looks/ like a standard component. This is really an IDE issue, not a component one.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018