Class: Wx::Point
- Inherits:
-
Object
- Object
- Wx::Point
- Includes:
- Comparable
- 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 Point is a useful data structure for graphics operations.
It contains integer x and y members. See RealPoint for a floating point version. Note that the width and height stored inside a Point object may be negative and that Point functions do not perform any check against negative values (this is used to e.g. store the special -1 value in DEFAULT_POSITION instance).
Category: Data Structures Predefined objects/pointers: DEFAULT_POSITION
Instance Method Summary collapse
-
#*(num) ⇒ Wx::Point
Return a new Wx::Point with the x and y values both multiplied by parameter
num
, which should be a Numeric. -
#+(arg) ⇒ Wx::Point
Return a new Wx::Point with the x and y values both increased by parameter
arg
. -
#-(arg) ⇒ Wx::Point
Return a new Wx::Point with the x and y values both reduced by parameter
arg
. -
#/(num) ⇒ Wx::Point
Return a new Wx::Point with the x and y parameters both divided by parameter
num
, which should be a Numeric. -
#<=>(other) ⇒ Boolean?
Compare point values (Wx::Point or point array).
-
#assign(pt) ⇒ self
Set this point to the given point’s x,y values.
-
#eql?(other) ⇒ Boolean
Compare points.
-
#hash ⇒ Object
Returns hash for point.
-
#initialize(*args) ⇒ Point
constructor
A new instance of Point.
-
#is_fully_specified ⇒ Boolean
(also: #fully_specified?)
Returns true if neither of the point components is equal to DEFAULT_COORD.
-
#set_defaults(pt) ⇒ void
(also: #defaults=)
Combine this object with another one replacing the uninitialized values.
-
#to_ary ⇒ Array(Integer,Integer)
Returns point array (
[x, y]
). -
#to_point ⇒ self
Returns self.
-
#to_real_point ⇒ Wx::RealPoint
(also: #to_real)
Converts point to Wx::RealPoint.
-
#x ⇒ Integer
x member.
-
#x=(val) ⇒ void
x member.
-
#y ⇒ Integer
y member.
-
#y=(val) ⇒ void
y member.
Constructor Details
Instance Method Details
#*(num) ⇒ Wx::Point
Return a new Wx::Point with the x and y values both multiplied by parameter num
, which should be a Numeric
115 |
# File 'lib/wx/doc/gdi_common.rb', line 115 def *(num) end |
#+(arg) ⇒ Wx::Point
Return a new Wx::Point with the x and y values both increased by parameter arg
. If arg
is another Wx::Point (or Wx::Size or 2-element array), increase x by the other’s x (or width) and y by the other’s y (or height); if arg
is a numeric value, increase both x and y by that value.
131 |
# File 'lib/wx/doc/gdi_common.rb', line 131 def +(arg) end |
#-(arg) ⇒ Wx::Point
Return a new Wx::Point with the x and y values both reduced by parameter arg
. If arg
is another Wx::Point (or Wx::Size or 2-element array), reduce x by the other’s x (or width) and y by the other’s y (or height); if arg
is a numeric value, reduce x and y both by that value.
123 |
# File 'lib/wx/doc/gdi_common.rb', line 123 def -(arg) end |
#/(num) ⇒ Wx::Point
Return a new Wx::Point with the x and y parameters both divided by parameter num
, which should be a Numeric
109 |
# File 'lib/wx/doc/gdi_common.rb', line 109 def /(num) end |
#<=>(other) ⇒ Boolean?
Compare point values (Wx::Point or point array). Returns -1,0 or 1 to indicate if this point is smaller, equal or greater than other (comparing xy
with other.xother.y
). Returns nil if incompatible.
95 |
# File 'lib/wx/doc/gdi_common.rb', line 95 def <=>(other)end |
#assign(pt) ⇒ self
Set this point to the given point’s x,y values
145 |
# File 'lib/wx/doc/gdi_common.rb', line 145 def assign(pt) end |
#eql?(other) ⇒ Boolean
Compare points.
100 |
# File 'lib/wx/doc/gdi_common.rb', line 100 def eql?(other)end |
#is_fully_specified ⇒ Boolean Also known as: fully_specified?
Returns true if neither of the point components is equal to DEFAULT_COORD.
This method is typically used before calling #set_defaults.
391 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 391 def is_fully_specified; end |
#set_defaults(pt) ⇒ void Also known as: defaults=
This method returns an undefined value.
Combine this object with another one replacing the uninitialized values.
It is typically used like this:
if !pos.is_fully_specified
pos.set_defaults(get_default_position)
end
406 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 406 def set_defaults(pt) end |
#to_ary ⇒ Array(Integer,Integer)
Returns point array ([x, y]
)
88 |
# File 'lib/wx/doc/gdi_common.rb', line 88 def to_ary; end |
#to_point ⇒ self
Returns self.
140 |
# File 'lib/wx/doc/gdi_common.rb', line 140 def to_point; end |
#to_real_point ⇒ Wx::RealPoint Also known as: to_real
Converts point to Wx::RealPoint
135 |
# File 'lib/wx/doc/gdi_common.rb', line 135 def to_real_point; end |
#x ⇒ Integer
x member.
413 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 413 def x; end |
#x=(val) ⇒ void
This method returns an undefined value.
x member.
419 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 419 def x=(val); end |
#y ⇒ Integer
y member.
425 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 425 def y; end |
#y=(val) ⇒ void
This method returns an undefined value.
y member.
431 |
# File 'lib/wx/doc/gen/gdi_common.rb', line 431 def y=(val); end |