[lazarus] Major modifications added to CVS
Michael Van Canneyt
michael.vancanneyt at wisa.be
Mon Jul 19 08:48:16 EDT 1999
On Mon, 19 Jul 1999, Michael A. Hess wrote:
> Michael Van Canneyt wrote:
> >
> > In principle, all other Position/Size stuff should call SetBounds in
> > the end. This way you only need 1 call to be ported when going to a
> > new toolkit;
> > namely setbounds.
>
> Actually they all call the same routine as far as porting goes. It is
> just that when you do something like
>
> Left := 100;
>
> it calls the appropriate gtk routines to adjust the component which then
> fires a resize event. If you have to set all 4 coordinates it does the
> whole process 4 times, somewhat wasteful. By using SetBounds it sets all
> the coordinates with just the one gtk call and resize event. Just
> somewhat more effecient.
What I meant whas that you could implement it like
Procedure TControl.SetLeft (Value : Integer);
begin
SetBounds(Value,FTop,FRight,FBottom);
FLeft:=Value;
end;
This way the code is reduced to a minimum. In the event GTK changes, or
you go to a new toolkit, You only have to adjust SetBounds.
Michael.
More information about the Lazarus
mailing list