wxRuby Documentation Home

Wx::Size

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.

Derived from

None

See also

Point, RealPoint

Methods

Size.new

Size.new(Integer width,  Integer height)

Creates a size object.

Size#dec_to

dec_to(Size size)

Decrements this object so that both of its dimensions are not greater than the corresponding dimensions of the size.

See also

inc_to

Size#is_fully_specified

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.

Size#get_width

Integer get_width()

Gets the width member.

Size#get_height

Integer get_height()

Gets the height member.

Size#inc_to

inc_to(Size size)

Increments this object so that both of its dimensions are not less than the corresponding dimensions of the size.

See also

dec_to

Size#set

set(Integer width,  Integer height)

Sets the width and height members.

Size#set_defaults

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());
}

See also

is_fully_specified

Size#set_height

set_height(Integer height)

Sets the height.

Size#set_width

set_width(Integer width)

Sets the width.

Size#=

operator $=$(Size sz)

Assignment operator.

[This page automatically generated from the Textile source at Thu May 01 00:50:43 +0100 2008]