Recent

Author Topic: [Resolved] Toolbar vanishes after showing and closing a form  (Read 614 times)

Wilko500

  • Full Member
  • ***
  • Posts: 180
[Resolved] Toolbar vanishes after showing and closing a form
« on: August 30, 2025, 07:21:38 pm »
My application contains a toolbar at the top of the main form.  The rest of the main form is made up of many panels containing controls all held together by anchor docking.
One of the toolbar items opens a form using show modal.  Upon closing the form the toolbar vanished and everything else on the form moves up into the toolbar space. 
Clicking the green button to maximise the application makes the toolbar visible. Clicking the green button a second time restores the application to its initial state.

A similar issue was discussed https://forum.lazarus.freepascal.org/index.php?topic=41930.0 but that was in 2018!  I would hope that this has been fixed since then.

Attaching my code is not practicable due to size and other complications.  I imagine that a test can be made to demonstrate the issue but before I do that perhaps someone has knowledge of any outcome from the previous post I referred to.

LazFPC 4.3/3.2.3 runing on MacOs Sequoia 15.6.1
« Last Edit: August 31, 2025, 12:15:33 am by Wilko500 »
MacBook Pro mid 2015 with OS Monterey 12.7.6
FPC 3.2.3 Lazarus 3.7
FPC 3.2.2 Lazarus 3.4

Wilko500

  • Full Member
  • ***
  • Posts: 180
Re: Toolbar vanishes after showing and closing a form
« Reply #1 on: August 31, 2025, 12:15:13 am »
Update:  Cause found, maybe.  I discovered that closing the form with the red button on the form does NOT cause the toolbar to vanish.  Thus I looked at the code used by my form exit button and there I had added
Code: Pascal  [Select][+][-]
  1.   frmMain.Height := Screen.Height;
  2.   frmMain.Width := Screen.Width;
Those two lines were added in an attempt to prevent the toolbar vanishing, a suggestion from a post I read but I can't recall the source although I think it was on the Lazarus forum so it seems that the problem had manifested itself before I attempted the fix.

I am adding a number of forms and units from another "working" program and that has been fraught with unexpected problems.  Naive perhaps but I expected that forms and units from a working program would work without problem when imported.  Anyway the good news is that my application is now working as seems to be stable so I'll mark this one as resolved.

MacBook Pro mid 2015 with OS Monterey 12.7.6
FPC 3.2.3 Lazarus 3.7
FPC 3.2.2 Lazarus 3.4

 

TinyPortal © 2005-2018