Re: [Lazarus] AlignControls

2013-02-03 Thread Juha Manninen
On Fri, Feb 1, 2013 at 1:47 PM, Mattias Gaertner
nc-gaert...@netcologne.de wrote:
 Well, your AlignControls should move them anyway, so that would be sufficient.

Thanks Mattias, I got it working.


 You can set
 Child.ControlStyle:=Child.ControlStyle+[csDesignFixedBounds];

This had no effect in my tests. The control could still be moved.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] AlignControls

2013-02-03 Thread Mattias Gaertner
On Sun, 3 Feb 2013 13:17:22 +0200
Juha Manninen juha.mannine...@gmail.com wrote:

 On Fri, Feb 1, 2013 at 1:47 PM, Mattias Gaertner
 nc-gaert...@netcologne.de wrote:
  Well, your AlignControls should move them anyway, so that would be 
  sufficient.
 
 Thanks Mattias, I got it working.
 
 
  You can set
  Child.ControlStyle:=Child.ControlStyle+[csDesignFixedBounds];
 
 This had no effect in my tests. The control could still be moved.

Fixed.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] AlignControls

2013-02-01 Thread Juha Manninen
I am trying to figure out how AlignControls works.
The signature is:

  procedure AlignControls(aControl: TControl; var aRect: TRect); override;

What exactly is aControl for? Delphi's documentation says:
AControl specifies the control that takes precedence in alignment when
other controls have the same Align value. AControl can be nil

Does it mean AControl is Nil when all controls have Align = alNone?
The base method TWinControl.AlignControls is huge, over 700 lines,
made by ask.

There is an error in wiki page:
 http://wiki.freepascal.org/Autosize_/_Layout
which says:
The layout is applied in the method TWinControl.AlignControls which
can be overridden. For example TToolBar overrides that and defines a
flow layout where controls that do not fit are put into subsequent
lines.

However, TToolBar does not have such method.
There are only 2 components with overridden AlignControls,
TScrollingWinControl where it only updates scrollbars, and TControlBar
where is does nothing yet.

I am thinking how to use it in TControlBar and maybe in TCoolBar.
As you can see I am not very experienced component writer.

Regards,
Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] AlignControls

2013-02-01 Thread Juha Manninen
A related question:
How can I prevent a user from moving controls associated with CoolBar
bands at design-time?
I guess I can set the locations of all controls in AlignControls but
is there any better way?

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] AlignControls

2013-02-01 Thread Mattias Gaertner

Juha Manninen juha.mannine...@gmail.com hat am 1. Februar 2013 um 11:56
geschrieben:
 I am trying to figure out how AlignControls works.

It's complicated.


 The signature is:

 procedure AlignControls(aControl: TControl; var aRect: TRect); override;

 What exactly is aControl for? Delphi's documentation says:
 AControl specifies the control that takes precedence in alignment when
 other controls have the same Align value. AControl can be nil

 Does it mean AControl is Nil when all controls have Align = alNone?

No.

http://wiki.lazarus.freepascal.org/Autosize_/_Layout#TWinControl.AlignControls


 The base method TWinControl.AlignControls is huge, over 700 lines,
 made by ask.

 There is an error in wiki page:
 http://wiki.freepascal.org/Autosize_/_Layout
 which says:
 The layout is applied in the method TWinControl.AlignControls which
 can be overridden. For example TToolBar overrides that and defines a
 flow layout where controls that do not fit are put into subsequent
 lines.

 However, TToolBar does not have such method.
 There are only 2 components with overridden AlignControls,
 TScrollingWinControl where it only updates scrollbars, and TControlBar
 where is does nothing yet.

I updated the entry.


 I am thinking how to use it in TControlBar and maybe in TCoolBar.
 As you can see I am not very experienced component writer.

You are working on an unusual one.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] AlignControls

2013-02-01 Thread Mattias Gaertner

Juha Manninen juha.mannine...@gmail.com hat am 1. Februar 2013 um 12:30
geschrieben:
 A related question:
 How can I prevent a user from moving controls associated with CoolBar
 bands at design-time?
 I guess I can set the locations of all controls in AlignControls but
 is there any better way?

Well, your AlignControls should move them anyway, so that would be sufficient.

You can set

Child.ControlStyle:=Child.ControlStyle+[csDesignFixedBounds];


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus