Re: [Lazarus] Borderspacing property not working?

2021-02-12 Thread Vojtěch Čihák via lazarus

You probably do something wrong.
 
Here both
 
Button1.AnchorParallel(akLeft, 10, Form1);
 
or
 
Button1.BorderSpacing.Left:=10;
Button1.AnchorSide[akLeft].Control:=Form1;
Button1.Anchors:=[akLeft];
 
works well.
 
V .
 
__

Od: "Timothy Groves via lazarus" 
Komu: "Lazarus mailing list" 
Datum: 12.02.2021 20:25
Předmět: Re: [Lazarus] Borderspacing property not working?


Update:  Then I realized what had changed.  I attempted to clean up some of my 
other dynamically created page tabs, and problems persisted.  I ran some 
experiments, and determined the root problem.  So this problem is more properly 
expressed as:  When anchoring to Parent, border settings are ignored, 
regardless if they are set using a method (such as AnchorToNeighbour or 
AnchorParallel) or directly (by changing the BorderSpacing property).  Is this 
a known bug?  Or is it an undocumented feature?  If the latter, how do I anchor 
to a parent in a manner that respects border spacing?
On Fri, 12 Feb 2021 at 14:19, Timothy Groves > wrote:That worked.  Thanks.
On Fri, 12 Feb 2021 at 14:06, Vojtěch Čihák via lazarus > wrote:Try to add there AnchorParallel:
 
labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;
labSurface [0].AnchorSide [akTop].Side := asrBottom;
labSurface [0].AnchorSide [akLeft].Control := Parent;
labSurface [0].AnchorSide [akLeft].Side := asrRight;
labSurface[0].AnchorParallel(akLeft, 0, labSurfaceLocation);
for index := 1 to 8 do begin
labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];
labSurface [index].AnchorSide [akTop].Side := asrBottom;
labSurface [index].AnchorSide [akLeft].Control := Parent;
labSurface [index].AnchorSide [akLeft].Side := asrRight;
labSurface [index].AnchorParallel(akLeft, 0, labSurfaceLocation);
end;                     
 
__
> Od: "Timothy Groves via lazarus" >
> Komu: "Lazarus mailing list" >
> Datum: 12.02.2021 19:26
> Předmět: [Lazarus] Borderspacing property not working?
>
I have created several dynamic controls in my form, and setting the 
BorderSpacing property produces consistently incorrect results.  Dynamically 
created controls will exhibit borders between themselves, but not to the parent 
object.  What am I doing wrong?Here is a chunk of the offending code.  for 
index := 0 to 8 do begin
    labSurface [index] := tLabel.Create (Application);
    with (labSurface [index]) do begin
      parent := tabSurface;
      Caption := LocationNames [index];
      BorderSpacing.Around := 8;
      BorderSpacing.Left := 8;
      Anchors := [akTop, akLeft];
    end;
  end;

  labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;
  labSurface [0].AnchorSide [akTop].Side := asrBottom;
  labSurface [0].AnchorSide [akLeft].Control := Parent;
  labSurface [0].AnchorSide [akLeft].Side := asrRight;
  for index := 1 to 8 do begin
    labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];
    labSurface [index].AnchorSide [akTop].Side := asrBottom;
    labSurface [index].AnchorSide [akLeft].Control := Parent;
    labSurface [index].AnchorSide [akLeft].Side := asrRight;
  end;
--
"Cows fly like clouds, but are never quite successful." 
--Megahal


--

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org 
https://lists.lazarus-ide.org/listinfo/lazarus 
<https://lists.lazarus-ide.org/listinfo/lazarus>
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org 
https://lists.lazarus-ide.org/listinfo/lazarus 
<https://lists.lazarus-ide.org/listinfo/lazarus>
--
"Cows fly like clouds, but are never quite successful." 
--Megahal

--
"Cows fly like clouds, but are never quite successful." 
--Megahal


--

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus 
<https://lists.lazarus-ide.org/listinfo/lazarus>

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Borderspacing property not working?

2021-02-12 Thread Timothy Groves via lazarus
Update:  Then I realized what had changed.  I attempted to clean up some of
my other dynamically created page tabs, and problems persisted.  I ran some
experiments, and determined the root problem.  So this problem is more
properly expressed as:  When anchoring to Parent, border settings are
ignored, regardless if they are set using a method (such as
AnchorToNeighbour or AnchorParallel) or directly (by changing the
BorderSpacing property).  Is this a known bug?  Or is it an undocumented
feature?  If the latter, how do I anchor to a parent in a manner that
respects border spacing?

On Fri, 12 Feb 2021 at 14:19, Timothy Groves 
wrote:

> That worked.  Thanks.
>
> On Fri, 12 Feb 2021 at 14:06, Vojtěch Čihák via lazarus <
> lazarus@lists.lazarus-ide.org> wrote:
>
>> Try to add there AnchorParallel:
>>
>>
>>
>> labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;
>>
>> labSurface [0].AnchorSide [akTop].Side := asrBottom;
>>
>> labSurface [0].AnchorSide [akLeft].Control := Parent;
>>
>> labSurface [0].AnchorSide [akLeft].Side := asrRight;
>>
>> labSurface[0].AnchorParallel(akLeft, 0, labSurfaceLocation);
>>
>> for index := 1 to 8 do begin
>>
>> labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];
>>
>> labSurface [index].AnchorSide [akTop].Side := asrBottom;
>>
>> labSurface [index].AnchorSide [akLeft].Control := Parent;
>>
>> labSurface [index].AnchorSide [akLeft].Side := asrRight;
>>
>> labSurface [index].AnchorParallel(akLeft, 0, labSurfaceLocation);
>>
>> end;
>>
>>
>>
>> __________
>> > Od: "Timothy Groves via lazarus" 
>> > Komu: "Lazarus mailing list" 
>> > Datum: 12.02.2021 19:26
>> > Předmět: [Lazarus] Borderspacing property not working?
>> >
>> I have created several dynamic controls in my form, and setting the
>> BorderSpacing property produces consistently incorrect results.
>> Dynamically created controls will exhibit borders between themselves, but
>> not to the parent object.  What am I doing wrong?
>> Here is a chunk of the offending code.
>>   for index := 0 to 8 do begin
>> labSurface [index] := tLabel.Create (Application);
>> with (labSurface [index]) do begin
>>   parent := tabSurface;
>>   Caption := LocationNames [index];
>>   BorderSpacing.Around := 8;
>>   BorderSpacing.Left := 8;
>>   Anchors := [akTop, akLeft];
>> end;
>>   end;
>>
>>   labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;
>>   labSurface [0].AnchorSide [akTop].Side := asrBottom;
>>   labSurface [0].AnchorSide [akLeft].Control := Parent;
>>   labSurface [0].AnchorSide [akLeft].Side := asrRight;
>>   for index := 1 to 8 do begin
>> labSurface [index].AnchorSide [akTop].Control := labSurface [index -
>> 1];
>> labSurface [index].AnchorSide [akTop].Side := asrBottom;
>> labSurface [index].AnchorSide [akLeft].Control := Parent;
>> labSurface [index].AnchorSide [akLeft].Side := asrRight;
>>   end;
>> --
>> "Cows fly like clouds, but are never quite successful."
>> --Megahal
>>
>>
>> --
>>
>> --
>> ___
>> lazarus mailing list
>> lazarus@lists.lazarus-ide.org
>> https://lists.lazarus-ide.org/listinfo/lazarus
>> --
>> ___
>> lazarus mailing list
>> lazarus@lists.lazarus-ide.org
>> https://lists.lazarus-ide.org/listinfo/lazarus
>>
>
>
> --
> "Cows fly like clouds, but are never quite successful."
> --Megahal
>


-- 
"Cows fly like clouds, but are never quite successful."
--Megahal
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Borderspacing property not working?

2021-02-12 Thread Timothy Groves via lazarus
That worked.  Thanks.

On Fri, 12 Feb 2021 at 14:06, Vojtěch Čihák via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> Try to add there AnchorParallel:
>
>
>
> labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;
>
> labSurface [0].AnchorSide [akTop].Side := asrBottom;
>
> labSurface [0].AnchorSide [akLeft].Control := Parent;
>
> labSurface [0].AnchorSide [akLeft].Side := asrRight;
>
> labSurface[0].AnchorParallel(akLeft, 0, labSurfaceLocation);
>
> for index := 1 to 8 do begin
>
> labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];
>
> labSurface [index].AnchorSide [akTop].Side := asrBottom;
>
> labSurface [index].AnchorSide [akLeft].Control := Parent;
>
> labSurface [index].AnchorSide [akLeft].Side := asrRight;
>
> labSurface [index].AnchorParallel(akLeft, 0, labSurfaceLocation);
>
> end;
>
>
>
> __
> > Od: "Timothy Groves via lazarus" 
> > Komu: "Lazarus mailing list" 
> > Datum: 12.02.2021 19:26
> > Předmět: [Lazarus] Borderspacing property not working?
> >
> I have created several dynamic controls in my form, and setting the
> BorderSpacing property produces consistently incorrect results.
> Dynamically created controls will exhibit borders between themselves, but
> not to the parent object.  What am I doing wrong?
> Here is a chunk of the offending code.
>   for index := 0 to 8 do begin
> labSurface [index] := tLabel.Create (Application);
> with (labSurface [index]) do begin
>   parent := tabSurface;
>   Caption := LocationNames [index];
>   BorderSpacing.Around := 8;
>   BorderSpacing.Left := 8;
>   Anchors := [akTop, akLeft];
> end;
>   end;
>
>   labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;
>   labSurface [0].AnchorSide [akTop].Side := asrBottom;
>   labSurface [0].AnchorSide [akLeft].Control := Parent;
>   labSurface [0].AnchorSide [akLeft].Side := asrRight;
>   for index := 1 to 8 do begin
> labSurface [index].AnchorSide [akTop].Control := labSurface [index -
> 1];
> labSurface [index].AnchorSide [akTop].Side := asrBottom;
> labSurface [index].AnchorSide [akLeft].Control := Parent;
> labSurface [index].AnchorSide [akLeft].Side := asrRight;
>   end;
> --
> "Cows fly like clouds, but are never quite successful."
> --Megahal
>
>
> --
>
> --
> ___
> lazarus mailing list
> lazarus@lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
> --
> ___
> lazarus mailing list
> lazarus@lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
>


-- 
"Cows fly like clouds, but are never quite successful."
--Megahal
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Borderspacing property not working?

2021-02-12 Thread Vojtěch Čihák via lazarus

Try to add there AnchorParallel:
 
labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;
labSurface [0].AnchorSide [akTop].Side := asrBottom;
labSurface [0].AnchorSide [akLeft].Control := Parent;
labSurface [0].AnchorSide [akLeft].Side := asrRight;
labSurface[0].AnchorParallel(akLeft, 0, labSurfaceLocation);
for index := 1 to 8 do begin
labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];
labSurface [index].AnchorSide [akTop].Side := asrBottom;
labSurface [index].AnchorSide [akLeft].Control := Parent;
labSurface [index].AnchorSide [akLeft].Side := asrRight;
labSurface [index].AnchorParallel(akLeft, 0, labSurfaceLocation);
end;                     
 
__

Od: "Timothy Groves via lazarus" 
Komu: "Lazarus mailing list" 
Datum: 12.02.2021 19:26
Předmět: [Lazarus] Borderspacing property not working?


I have created several dynamic controls in my form, and setting the 
BorderSpacing property produces consistently incorrect results.  Dynamically 
created controls will exhibit borders between themselves, but not to the parent 
object.  What am I doing wrong?Here is a chunk of the offending code.  for 
index := 0 to 8 do begin
    labSurface [index] := tLabel.Create (Application);
    with (labSurface [index]) do begin
      parent := tabSurface;
      Caption := LocationNames [index];
      BorderSpacing.Around := 8;
      BorderSpacing.Left := 8;
      Anchors := [akTop, akLeft];
    end;
  end;

  labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;
  labSurface [0].AnchorSide [akTop].Side := asrBottom;
  labSurface [0].AnchorSide [akLeft].Control := Parent;
  labSurface [0].AnchorSide [akLeft].Side := asrRight;
  for index := 1 to 8 do begin
    labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];
    labSurface [index].AnchorSide [akTop].Side := asrBottom;
    labSurface [index].AnchorSide [akLeft].Control := Parent;
    labSurface [index].AnchorSide [akLeft].Side := asrRight;
  end;
--
"Cows fly like clouds, but are never quite successful." 
--Megahal


--

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus 
<https://lists.lazarus-ide.org/listinfo/lazarus>

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Borderspacing property not working?

2021-02-12 Thread Timothy Groves via lazarus
I have created several dynamic controls in my form, and setting the
BorderSpacing property produces consistently incorrect results.
Dynamically created controls will exhibit borders between themselves, but
not to the parent object.  What am I doing wrong?

Here is a chunk of the offending code.

  for index := 0 to 8 do begin
labSurface [index] := tLabel.Create (Application);
with (labSurface [index]) do begin
  parent := tabSurface;
  Caption := LocationNames [index];
  BorderSpacing.Around := 8;
  BorderSpacing.Left := 8;
  Anchors := [akTop, akLeft];
end;
  end;

  labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;
  labSurface [0].AnchorSide [akTop].Side := asrBottom;
  labSurface [0].AnchorSide [akLeft].Control := Parent;
  labSurface [0].AnchorSide [akLeft].Side := asrRight;
  for index := 1 to 8 do begin
labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];
labSurface [index].AnchorSide [akTop].Side := asrBottom;
labSurface [index].AnchorSide [akLeft].Control := Parent;
labSurface [index].AnchorSide [akLeft].Side := asrRight;
  end;

-- 
"Cows fly like clouds, but are never quite successful."
--Megahal
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus