* * *

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

Alextp

  • Hero Member
  • *****
  • Posts: 633
    • 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: 2540
  • 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 1.9.0 r57500 FPC 3.0.4 x86_64-linux-qt Chakra, Qt 4.8.7, Plasma 5.11.4
Lazarus 1.8.0 r56594 FPC 3.0.4 i386-win32-win32/win64 Wine 3.2

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

Alextp

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