[Lazarus] Design time and runtime positions differ

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed Apr 1 14:11:08 CEST 2015


Hi,

I have a form that is not resizeable at runtime. During design time I
position 4 Panels at the bottom of the form to fake a statusbar (to
replace the broken StatusBar of LCL).

Yet when I run the program the panels are in a slightly higher position
than what they were at design time. Resizing the form even by just 1px
magically makes the panel position correctly.

The problem is, in my actual application, the main form is not resizeable.

1.  So how can I tell LCL to correctly position my panels at runtime,
    as if I resized the form (but without actually resizing the form).

2.  Why did LCL decide to move the panels in the first place?


See the attached screenshots to show what I mean.

Here is the LFM code for the "fake statusbar"

===============================================
  object FakeStatusBar: TPanel
    Left = 0
    Height = 25
    Top = 296
    Width = 639
    Align = alBottom
    BevelOuter = bvNone
    ClientHeight = 25
    ClientWidth = 639
    TabOrder = 0
    object Panel1: TPanel
      Left = 2
      Height = 25
      Top = 0
      Width = 169
      Anchors = [akLeft, akBottom]
      BevelOuter = bvLowered
      Caption = 'Panel1'
      TabOrder = 0
    end
    object Panel2: TPanel
      AnchorSideLeft.Control = Panel1
      AnchorSideLeft.Side = asrBottom
      AnchorSideRight.Control = Panel3
      Left = 173
      Height = 25
      Top = 0
      Width = 292
      Anchors = [akLeft, akRight, akBottom]
      BorderSpacing.Around = 2
      BevelOuter = bvLowered
      Caption = 'Panel2'
      TabOrder = 1
    end
    object Panel3: TPanel
      Left = 467
      Height = 25
      Top = 0
      Width = 170
      Anchors = [akRight, akBottom]
      BevelOuter = bvLowered
      Caption = 'Panel3'
      TabOrder = 2
    end
  end
===============================================


I'm using Lazarus 1.3 r45395 FPC 2.6.4 x86_64-linux-gtk 2.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 001_design.png
Type: image/png
Size: 1842 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150401/2a6d633b/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 002_runtime.png
Type: image/png
Size: 1594 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150401/2a6d633b/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 003_resized.png
Type: image/png
Size: 1630 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150401/2a6d633b/attachment-0008.png>


More information about the Lazarus mailing list