* * *

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

Alextp

  • Hero Member
  • *****
  • Posts: 654
    • 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: 2606
  • 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.1.0 r59015M FPC 3.3.1 r39660 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.1, Plasma 5.13.4
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

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

Alextp

  • Hero Member
  • *****
  • Posts: 654
    • 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.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus