Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-05

Anchoring with negative values

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Valdas Jankūnas

Hello,

on Form is placed Image, image at runtime can resize, image anchors to Form at horizontal center.
I want make border around Image with Bevel, border must adapt change of size of Image. So i think: "all sides of Bevel need anchor to corresponding sides of Image with BorderAround=-1", but i cant set Border size to negative values.
As workaround i use Image.OnResize to adjust size and position of Bevel.

Why Border size in BorderSpacing is restricted to only positive values?

Valdas Jank?nas

Reply by email

Mattias Gaertner
to Valdas Jankūnas
Show quoted text 13 lines
Hello, on Form is placed Image, image at runtime can resize, image anchors to Form at horizontal center. I want make border around Image with Bevel, border must adapt change of size of Image. So i think: "all sides of Bevel need anchor to corresponding sides of Image with BorderAround=-1", but i cant set Border size to negative values. As workaround i use Image.OnResize to adjust size and position of Bevel. Why Border size in BorderSpacing is restricted to only positive values?

To avoid overlapping.

If you want an image with a border, why not put the TImage into a TPanel or TGroupBox?

Mattias

Reply by email

Valdas Jankūnas
to Mattias Gaertner

Mattias Gaertner ra??:

Show quoted text 8 lines
> > Why Border size in BorderSpacing is restricted to only positive > values? To avoid overlapping. If you want an image with a border, why not put the TImage into a TPanel or TGroupBox?

I always try avoid use of TWinControl where i can (because of additional handle [i heard this rule somewhere from old days]).

If i place TImage (AutoSize=True) into Panel then which settings in OI i must change to let TPanel always accommodate TImage size?

Valdas Jank?nas

Reply by email

Mattias Gaertner
to Valdas Jankūnas
Show quoted text 12 lines
Mattias Gaertner ra??: >> >> Why Border size in BorderSpacing is restricted to only positive >> values? > > To avoid overlapping. > > If you want an image with a border, why not put the TImage into a > TPanel or TGroupBox? I always try avoid use of TWinControl where i can (because of additional handle [i heard this rule somewhere from old days]).

very old days.

If i place TImage (AutoSize=True) into Panel then which settings in OI i must change to let TPanel always accommodate TImage size?

AutoSize=true

Mattias

Reply by email

Valdas Jankūnas
to Mattias Gaertner

Mattias Gaertner ra??:

> If i place TImage (AutoSize=True) into Panel then which settings in > OI i must change to let TPanel always accommodate TImage size? AutoSize=true

How simple! :) Thanks

Valdas Jank?nas

Reply by email