A Size is a useful data structure for graphics operations. It simply contains integer width and height members.
Size is used throughout Widgets as well as Point which, although almost equivalent to Size, has a different meaning: Point represents a position while Size – the size.
None
Size.new(Integer width, Integer height)
Creates a size object.
dec_to(Size size)
Decrements this object so that both of its dimensions are not greater than the corresponding dimensions of the size.
Boolean is_fully_specified()
Returns if neither of the size object components is equal to $-1$, which
is used as default for the size values in Widgets (hence the predefined
DefaultSize has both of its components equal to $-1$).
This method is typically used before calling set_defaults.
Integer get_width()
Gets the width member.
Integer get_height()
Gets the height member.
inc_to(Size size)
Increments this object so that both of its dimensions are not less than the corresponding dimensions of the size.
set(Integer width, Integer height)
Sets the width and height members.
set_defaults(Size sizeDefault)
Combine this size object with another one replacing the default (i.e. equal to $-1$) components of this object with those of the other. It is typically used like this:
if ( !size.IsFullySpecified() )
{
size.SetDefaults(GetDefaultSize());
}
set_height(Integer height)
Sets the height.
set_width(Integer width)
Sets the width.
operator $=$(Size sz)
Assignment operator.
[This page automatically generated from the Textile source at Thu May 01 00:50:43 +0100 2008]