Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread TSizerHorizontal - height property
Thu, Apr 13 2017 11:08 AMPermanent Link

thomh

Hi,

I am unable to set the TSizerHorizontal.Height property. Seems to be stuck on 6.

// Thom
Thu, Apr 13 2017 1:40 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Thom,

<< I am unable to set the TSizerHorizontal.Height property. Seems to be stuck on 6. >>

This happens when the TSizer.Orientation property is applied initially at run-time.  Without it, changing the orientation would keep the same dimensions, which would be a pain to constantly adjust.

A work-around is to modify the size in the form's OnCreate event handler:

procedure TForm1.Form1Create(Sender: TObject);
begin
  Sizer1.Height:=20;
end;

Meanwhile, I'll see if I can come up with a solution.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Apr 13 2017 1:48 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Thom,

Okay, here's the fix.  Change the TSizer declaration in the interface section to this:

WebSizer unit:

  TSizer = class(TSizerControl)
     protected
        function GetInterfaceClassName: String; override;
     published
        { This must come *before* the Top, Left, Height, Width, and Layout property !!! }
        property Orientation;
        property Top;
        property Left;
        property Height;
        property Width;
....

That will preserve the design-time dimensions at run-time.

However, after doing this, you will need to:

1) Rebuild the component library (or just restart the IDE).

2) Modify your form that contains the sizer (doesn't matter how, you just need to be able to save the form).

3) Save the form.

4) Modify the TSizer again so that it matches your desired dimensions (it should get reset after step 1).

I've moved this fix into the component library for 2.06 B2.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Apr 13 2017 4:40 PMPermanent Link

thomh

Hi Tim,

Seem when Orientation = soHorizontal I cannot set Height < 6.
Tried at design time and in the OnCreate event to set it to 3 and it defaults to 6.

Orientation = soVertical with Width < 6.

// Thom
Fri, Apr 14 2017 9:31 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Thom,

<< Seem when Orientation = soHorizontal I cannot set Height < 6.
Tried at design time and in the OnCreate event to set it to 3 and it defaults to 6. >>

It's the padding in the control interfaces - they're set to a padding of 4, and the browser then draws the background fill color using the border+padding.  Just set the Padding values to 0 for the TSizer control on your form, and that should fix it.  I've fixed the control interfaces for 2.06 B2.

Unfortunately, there aren't any settings in CSS that provide for the condition that we want to use: clip the background at the outside of the border, and don't allow the padding to affect how the background is painted. CSS is just full of weird painting behaviors like this.

Tim Young
Elevate Software
www.elevatesoft.com
Image