Note that there are some explanatory texts on larger screens.

plurals
  1. PODelphi XE3 Firemonkey autosize/layout problems
    primarykey
    data
    text
    <p>Using Firemonkey I have a TVertScrollBox which contains a TPanel which gets dynamically populated with a number of the following TDisplayItem objects.</p> <p>The problem is that the TDisplayItem’s don’t size properly so the text on the various components is superimposed etc. </p> <p>I can fix this on the items that are in the visible area of the scrollbox by by getting the sizes of the component parts and making the containers that size etc. I’ve tried refreshing and application.ProcessMessages to get everything to resize as well as various alignment and warp options but to no avail. </p> <p>Hopefully I’ve missed a key factor in this and haven’t unearthed a Firemonkey limitation!</p> <p>Cheers,</p> <p>Martin.</p> <pre><code>Constructor TDisplayItem.Create(owner : TComponent); begin inherited Create(owner); Align := TAlignLayout.alTop; pnlLabels := TPanel.Create(nil); pnlLabels.Align := TAlignLayout.alTop; pnlLabels.Height := 50; pnlLabels.Parent := self; lblICAO := TLabel.Create(nil); lblICAO.Parent := pnlLabels; with lblICAO do begin text := 'ICAO'; Height := 30; Position.X := 10; align := TAlignLayout.alTop; TextAlign := TTextAlign.taCenter; Font.Size := 18; FontColor := $FF00D000 ; Visible := False; StyledSettings := [TStyledSetting.ssFamily];//, TStyledSetting.ssFontColor]; end; lblFrom := TLabel.Create(nil); lblFrom.Parent := pnlLabels; with lblFrom do begin text := 'From : '; Height := 30; Position.X := 10; Position.y := 2; width := 150; FontColor := $FFFF0000 ; StyledSettings := [TStyledSetting.ssFamily];//, TStyledSetting.ssFontColor]; end; lblTo := TLabel.Create(nil); lblTo.Parent := pnlLabels; with lblTo do begin text := 'To : '; Height := 30; Position.X := 170; Position.y := 2; width := 150; FontColor := $FFFF0000 ; StyledSettings := [TStyledSetting.ssFamily];//, TStyledSetting.ssFontColor]; end; lblStatus := TLabel.Create(nil); lblStatus.Parent := pnlLabels; with lblStatus do begin text := 'Status : '; Height := 30; Position.X := 330; Position.y := 2; width := 100; Font.Size := 10; FontColor := $FFFF0000 ; StyledSettings := [TStyledSetting.ssFamily];//, TStyledSetting.ssFontColor]; end; lblNonGeog := TLabel.Create(nil); with lblNonGeog do begin text := 'Non-Geog : '; Height := 30; Position.X := 440; Position.y := 2; width := 150; Font.Size := 10; FontColor := $FFFF0000 ; StyledSettings := [TStyledSetting.ssFamily];//, TStyledSetting.ssFontColor]; end; lblNonGeog.Parent := pnlLabels; memItem := TLabel.Create(nil); memItem.Parent := self; with memItemE do begin Align := TAlignLayout.alTop; DisableFocusEffect := False; AutoSize := True; WordWrap := True; end; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload