Name

Left, Right, Top, Bottom, HCenter, VCenter, HVCenter — Layout alignment

Synopsis

Left ( term  child ,
  boolean  enabled );
Right ( term  child ,
  boolean  enabled );
Top ( term  child ,
  boolean  enabled );
Bottom ( term  child ,
  boolean  enabled );
HCenter ( term  child ,
  boolean  enabled );
VCenter ( term  child ,
  boolean  enabled );
HVCenter ( term  child ,
  boolean  enabled );

Parameters

term child

The contained child widget

Optional Arguments

boolean enabled

true if ...

Description

The Alignment widgets are used to control the layout of a dialog. They are useful in situations, where to a widget is assigned more space than it can use. For example if you have a VBox containing four CheckBoxes, the width of the VBox is determined by the CheckBox with the longest label. The other CheckBoxes are centered per default.

With `Left( widget ) you tell widget that it should be layouted leftmost of the space that is available to it. Right, Top and Bottom are working accordingly. The other three widgets center their child widget horizontally, vertically or in both directions.

The important fact for all alignment widgets is, that they make their child widget stretchable in the dimension it is aligned.

Usage

 	`Left( `CheckBox( "Crash every five minutes" ) )

Examples

          {
    UI::OpenDialog(
	       `VBox(
		     `Label("This is a long label which makes space"),
		     `HBox(
			   `Label("A"),
			   `HCenter(`Label("B")),
			   `Label("C")
			   )
		     )
	       );
    UI::UserInput();
    UI::CloseDialog();
}

        
          {
    UI::OpenDialog(
	       `VBox(
		     `Label("This is a very long label that makes space"),
		     `HBox(
			   `PushButton("Normal"),
			   `HCenter(`PushButton("HCenter"))
			   )
		     )
	       );
    UI::UserInput();
    UI::CloseDialog();
}


        
          {
    UI::OpenDialog(`opt(`defaultsize),
	       `VBox(
		     `VCenter(`PushButton(`opt(`vstretch), "Button 1")),
		     `VCenter(`PushButton(`opt(`vstretch), "Button 2")),
		     `VCenter(`PushButton(`opt(`vstretch), "Button 3"))
		     )
	       );
    UI::UserInput();
    UI::CloseDialog();
}

	       

        
          {
    UI::OpenDialog(
	       `VBox(
		     `PushButton("This is a very long button - it reserves extra space for the label."),
		     `HBox(
			   `PushButton(`opt(`hstretch), "Stretchable button"),
			   `ReplacePoint(`id(`rp), `Label("Label"))
			   )
		     )
	       );
    UI::UserInput();
    
    UI::ReplaceWidget(`id(`rp), `Left(`Label("Left")));
    UI::UserInput();
    
    UI::ReplaceWidget(`id(`rp), `Right(`Label("Right")));
    UI::UserInput();
    
    UI::ReplaceWidget(`id(`rp), `HCenter(`Label("HCenter")));
    UI::UserInput();
}