Recent

Author Topic: TMainMenu.Visible is needed  (Read 1985 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
TMainMenu.Visible is needed
« on: March 06, 2018, 05:02:32 pm »
/Visible/ is needed in many apps which want the option /Hide menu bar/. My app CudaText wants it too. Hiding of menubar

a) makes window more themed (main menu not themed),
b) makes more space in text editor.

I tried to set mainmenu1.Parent:=nil, menu hides but cannot show (Parent:= Self).

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: TMainMenu.Visible is needed
« Reply #1 on: March 06, 2018, 05:45:20 pm »
I have good experience with this (works in Qt, GTk2 and Wine); here checkbox controls menu appearance:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.CheckBox1Change(Sender: TObject);
  2. begin
  3.   if TCheckBox(Sender).Checked
  4.     then Form1.Menu:=MainMenu1
  5.     else Form1.Menu:=nil;
  6. end;
IMO it's enough, no need new property, let's keep LCL as small as possible.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
Re: TMainMenu.Visible is needed
« Reply #2 on: March 07, 2018, 10:36:33 am »
Thanks for this hint. I think it's solved.

 

TinyPortal © 2005-2018