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#dec_to
- Size#is_fully_specified
- Size#get_width
- Size#get_height
- Size#inc_to
- Size#set
- Size#set_defaults
- Size#set_height
- Size#set_width

### Size.new

Size.new(%(arg-type)Integer% width, Integer height)

Creates a size object.

### Size#dec_to

dec_to(%(arg-type)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(%(arg-type)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(%(arg-type)Integer% width, Integer height)

Sets the width and height members.

### Size#set_defaults

set_defaults(%(arg-type)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(%(arg-type)Integer% height)

Sets the height.

### Size#set_width

set_width(%(arg-type)Integer% width)

Sets the width.

### Size#=

operator $=$(%(arg-type)Size% sz)

Assignment operator.

[This page automatically generated from the Textile source at 2023-06-09 00:45:27 +0000]