On Wed, 26 Apr 2006 10:54:33 +0200
Mattias Gaertner <[EMAIL PROTECTED]> wrote:

> On Wed, 26 Apr 2006 10:16:37 +0200
> "Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:
> 
> > Hi,
> > 
> > Has anybody thought of creating a Java like GridBag component or even
> > better a Gtk+ like GtkTable, GtkVBox, GtkHBox components for Lazarus.
> > 
> > I know Lazarus is at least better than Delphi in this sense, as I can
> > use Anchors or one component aligned/anchored to another or component
> > AutoSize, but I still find I somethings need to write OnResize event
> > handlers for complex forms.
> > 
> > Look at "Compiler Options" -> "Code" tab as an example.  Making that
> > tab work on different screen resolutions with different dpi settings
> > and different fonts sizes (translated languages also have different
> > length captions) and allowing the user to resize the form and keep all
> > components aligned correctly is a nightmare.
> > 
> > I tried to reproduce the "Compiler Options" -> "Code" screen using
> > only the form designer and allow the user to resize the form, and all
> > components resize accordingly, but couldn't get it working 100%. 
> > Anybody else want to give that screen a go.
> > 
> > I am thinking of creating GtkTable, GtkVBox, GtkHBox like components,
> > but thought I would ask first about the current form designer.  Maybe
> > there is another hidden feature I didn't know about (like align
> > component to component).
> 
> Align can be replaced by Anchors. 
> http://wiki.lazarus.freepascal.org/index.php/Anchor_Sides
> 
> And for GtkTable, GtkVBox, GtkHBox there are the ChildSizing and
> BorderSpacing properties. 
> I setup the groupboxes of the code page with ChildSizing, and removed the
> fixed coordinates of the CheckBoxes.
> See the comments in controls.pp above TControlChildSizing for an
> explanation of the properties.

If you still want to create a HBox, do the following:

TCustomHBox = class(TCustomPanel)

And in the constructor set:

BevelOuter:=bvNone;
BevelWidth:=0;
ChildSizing.Layout:=cclTopToBottomThenLeftToRight;

Although I think, it is overhead to create a new control, just to set 3
properties.
Maybe instead add menu items to the designer:
'Make Horizontal Box', 'Make Vertical Box'.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to