Recent

Author Topic: Menu assignment has lot of unneeded LCL code  (Read 1440 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Menu assignment has lot of unneeded LCL code
« on: April 02, 2019, 11:36:00 am »
Form1.Menu:= MainMenu1;
has lot of code: some destroying of menus, some validating handles... Imho at least on Win32 it should be simple code:

Windows.SetMenu(Form1.Handle, Menu1.Handle); //or 0 if to hide

Agree?

ASerge

  • Hero Member
  • *****
  • Posts: 2242
Re: Menu assignment has lot of unneeded LCL code
« Reply #1 on: April 02, 2019, 07:34:15 pm »
Form1.Menu:= MainMenu1;
has lot of code: some destroying of menus, some validating handles... Imho at least on Win32 it should be simple code:
TMenuItem is a separate wrapper objects around the system menu items. Therefore, they should be removed if menu items are not used.

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: Menu assignment has lot of unneeded LCL code
« Reply #2 on: April 11, 2019, 08:13:37 pm »
Sorry for noise, I see that all LCL code is needed.

 

TinyPortal © 2005-2018