Class: Wx::Size
- Inherits:
-
Object
- Object
- Wx::Size
- Defined in:
- lib/wx/doc/gen/gdi_common.rb,
lib/wx/doc/gdi_common.rb
Overview
This class is untracked and should not be derived from nor instances extended!
A Size is a useful data structure for graphics operations.
It simply contains integer x and y members. Note that the width and height stored inside a Size object may be negative and that Size functions do not perform any check against negative values (this is used to e.g. store the special -1 value in DEFAULT_SIZE instance). See also #is_fully_specified and #set_defaults for utility functions regarding the special -1 value. Size is used throughout wxWidgets as well as Point which, although almost equivalent to Size, has a different meaning: Point represents a position while Size represents the size.
Category: Data Structures Predefined objects/pointers: DEFAULT_SIZE
Instance Method Summary collapse
-
#*(num) ⇒ Wx::Size
Return a new Wx::Size with the width and height values both multiplied by parameter
num
, which should be a Numeric. -
#+(arg) ⇒ Wx::Size
Return a new Wx::Size with the width and height parameters both increased by parameter
arg
. -
#-(arg) ⇒ Wx::Size
Return a new Wx::Size with the width and height parameters both reduced by parameter
arg
. -
#/(num) ⇒ Wx::Size
Return a new Wx::Size with the width and height values both divided by parameter
num
, which should be a Numeric. -
#==(other) ⇒ Boolean
Compare size values (Wx::Size or size array).
-
#assign(sz) ⇒ self
Set this size to the given size’s width,height values.
- #dec_by(*args) ⇒ Object
-
#dec_to(size) ⇒ void
Decrements this object so that both of its dimensions are not greater than the corresponding dimensions of the size.
-
#dec_to_if_specified(size) ⇒ void
Decrements this object to be not bigger than the given size ignoring non-specified components.
-
#eql?(other) ⇒ Boolean
Compare sizes.
-
#get_height ⇒ Integer
(also: #height)
Gets the height member.
-
#get_width ⇒ Integer
(also: #width)
Gets the width member.
- #get_x ⇒ Object
- #get_y ⇒ Object
- #inc_by(*args) ⇒ Object
-
#inc_to(size) ⇒ void
Increments this object so that both of its dimensions are not less than the corresponding dimensions of the size.
-
#initialize(*args) ⇒ Size
constructor
A new instance of Size.
-
#is_fully_specified ⇒ Boolean
(also: #fully_specified?)
Returns true if neither of the size object components is equal to -1, which is used as default for the size values in wxWidgets (hence the predefined DEFAULT_SIZE has both of its components equal to -1).
-
#scale(xscale, yscale) ⇒ Wx::Size
Scales the dimensions of this object by the given factors.
-
#set(width, height) ⇒ void
Sets the width and height members.
-
#set_defaults(sizeDefault) ⇒ void
(also: #defaults=)
Combine this size object with another one replacing the default (i.e. equal to -1) components of this object with those of the other.
-
#set_height(height) ⇒ void
(also: #height=)
Sets the height.
-
#set_width(width) ⇒ void
(also: #width=)
Sets the width.
- #set_x ⇒ Object
- #set_y ⇒ Object
-
#to_ary ⇒ Array(Integer,Integer)
Returns size array (
[width, height]
). -
#to_size ⇒ self
Returns self.
- #x ⇒ Object
- #x= ⇒ Object
- #y ⇒ Object
- #y= ⇒ Object
Constructor Details
Instance Method Details
#*(num) ⇒ Wx::Size
Return a new Wx::Size with the width and height values both multiplied by parameter num
, which should be a Numeric
42 |
# File 'lib/wx/doc/gdi_common.rb', line 42 def *(num) end |
#+(arg) ⇒ Wx::Size
Return a new Wx::Size with the width and height parameters both increased by parameter arg
. If arg
is another Wx::Size (or 2-element array), increase width by the other’s width and height by the other’s height; if arg
is a numeric value, increase both width and height by that value.
60 |
# File 'lib/wx/doc/gdi_common.rb', line 60 def +(arg) end |
#-(arg) ⇒ Wx::Size
Return a new Wx::Size with the width and height parameters both reduced by parameter arg
. If arg
is another Wx::Size (or 2-element array), reduce width by the other’s width and height by the other’s height; if arg
is a numeric value, reduce both width and height by that value.
51 |
# File 'lib/wx/doc/gdi_common.rb', line 51 def -(arg) end |
#/(num) ⇒ Wx::Size
Return a new Wx::Size with the width and height values both divided by parameter num
, which should be a Numeric
36 |
# File 'lib/wx/doc/gdi_common.rb', line 36 def /(num) end |
#==(other) ⇒ Boolean
Compare size values (Wx::Size or size array). Throws exception if incompatible.
25 |
# File 'lib/wx/doc/gdi_common.rb', line 25 def ==(other)end |
#assign(sz) ⇒ self
Set this size to the given size’s width,height values
74 |
# File 'lib/wx/doc/gdi_common.rb', line 74 def assign(sz) end |
#dec_by(pt) ⇒ void #dec_by(size) ⇒ void #dec_by(dx, dy) ⇒ void #dec_by(d) ⇒ void
502 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 502 def dec_by(*args) end |
#dec_to(size) ⇒ void
This method returns an undefined value.
Decrements this object so that both of its dimensions are not greater than the corresponding dimensions of the size.
551 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 551 def dec_to(size) end |
#dec_to_if_specified(size) ⇒ void
This method returns an undefined value.
Decrements this object to be not bigger than the given size ignoring non-specified components.
This is similar to #dec_to but doesn’t do anything for x or y component if the same component of size is not specified, i.e. set to DEFAULT_COORD.
558 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 558 def dec_to_if_specified(size) end |
#eql?(other) ⇒ Boolean
Compare sizes.
30 |
# File 'lib/wx/doc/gdi_common.rb', line 30 def eql?(other)end |
#get_height ⇒ Integer Also known as: height
Gets the height member.
562 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 562 def get_height; end |
#get_width ⇒ Integer Also known as: width
Gets the width member.
567 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 567 def get_width; end |
#get_x ⇒ Object
62 |
# File 'lib/wx/doc/gdi_common.rb', line 62 alias :get_x :get_width |
#get_y ⇒ Object
66 |
# File 'lib/wx/doc/gdi_common.rb', line 66 alias :get_y :get_height |
#inc_by(pt) ⇒ void #inc_by(size) ⇒ void #inc_by(dx, dy) ⇒ void #inc_by(d) ⇒ void
533 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 533 def inc_by(*args) end |
#inc_to(size) ⇒ void
This method returns an undefined value.
Increments this object so that both of its dimensions are not less than the corresponding dimensions of the size.
576 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 576 def inc_to(size) end |
#is_fully_specified ⇒ Boolean Also known as: fully_specified?
Returns true if neither of the size object components is equal to -1, which is used as default for the size values in wxWidgets (hence the predefined DEFAULT_SIZE has both of its components equal to -1).
This method is typically used before calling #set_defaults.
582 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 582 def is_fully_specified; end |
#scale(xscale, yscale) ⇒ Wx::Size
Scales the dimensions of this object by the given factors.
If you want to scale both dimensions by the same factor you can also use operator*=(). A reference to this object (so that you can concatenate other operations in the same line).
592 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 592 def scale(xscale, yscale) end |
#set(width, height) ⇒ void
This method returns an undefined value.
Sets the width and height members.
598 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 598 def set(width, height) end |
#set_defaults(sizeDefault) ⇒ void Also known as: defaults=
This method returns an undefined value.
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.is_fully_specified
size.set_defaults(get_default_size)
end
612 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 612 def set_defaults(sizeDefault) end |
#set_height(height) ⇒ void Also known as: height=
This method returns an undefined value.
Sets the height.
618 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 618 def set_height(height) end |
#set_width(width) ⇒ void Also known as: width=
This method returns an undefined value.
Sets the width.
624 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 624 def set_width(width) end |
#set_x ⇒ Object
64 |
# File 'lib/wx/doc/gdi_common.rb', line 64 alias :set_x :set_width |
#set_y ⇒ Object
68 |
# File 'lib/wx/doc/gdi_common.rb', line 68 alias :set_y :set_height |
#to_ary ⇒ Array(Integer,Integer)
Returns size array ([width, height]
)
20 |
# File 'lib/wx/doc/gdi_common.rb', line 20 def to_ary; end |
#to_size ⇒ self
Returns self.
78 |
# File 'lib/wx/doc/gdi_common.rb', line 78 def to_size; end |
#x ⇒ Object
63 |
# File 'lib/wx/doc/gdi_common.rb', line 63 alias :x :get_width |
#x= ⇒ Object
65 |
# File 'lib/wx/doc/gdi_common.rb', line 65 alias :x= :set_width |
#y ⇒ Object
67 |
# File 'lib/wx/doc/gdi_common.rb', line 67 alias :y :get_height |
#y= ⇒ Object
69 |
# File 'lib/wx/doc/gdi_common.rb', line 69 alias :y= :set_height |