Class: Wx::GraphicsPenInfo
- Inherits:
-
Object
- Object
- Wx::GraphicsPenInfo
- Defined in:
- lib/wx/doc/gen/graphics_context.rb,
lib/wx/doc/graphics_context.rb
Overview
This class is untracked and should not be derived from nor instances extended!
This class is a helper used for GraphicsPen creation using the named parameter idiom: it allows specifying various GraphicsPen attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to GraphicsPen constructors.
Typically, you would use GraphicsPenInfo with a GraphicsContext. For example, to start drawing with a dotted blue pen slightly wider than normal you could, write the following:
ctx = Wx::GraphicsContext.create(dc)
ctx.set_pen(Wx::GraphicsPenInfo.new(Wx::BLUE).width(1.25).style(Wx::PENSTYLE_DOT))
Instance Method Summary collapse
-
#cap(cap) ⇒ Wx::GraphicsPenInfo
Sets the cap (i.e., the end point) for the pen.
-
#colour(col) ⇒ Wx::GraphicsPenInfo
Sets the colour for the pen.
-
#get_cap ⇒ Wx::PenCap
Returns the pen’s cap (i.e., end-point style).
-
#get_colour ⇒ Wx::Colour
Returns the pen’s colour.
-
#get_dash_count ⇒ Integer
(also: #dash_count)
Returns the number of dashes in the pen’s dash pattern.
- #get_dashes ⇒ Array<Integer> (also: #dashes)
-
#get_end_x ⇒ Float
(also: #end_x)
Returns the x coordinate of the ending point (if using a gradient).
-
#get_end_y ⇒ Float
(also: #end_y)
Returns the y coordinate of the ending point (if using a gradient).
-
#get_gradient_type ⇒ Wx::GradientType
(also: #gradient_type)
Returns the pen’s gradient type.
-
#get_join ⇒ Wx::PenJoin
Returns the pen’s joining method.
-
#get_radius ⇒ Float
(also: #radius)
Returns the radius of the radial gradient.
-
#get_start_x ⇒ Float
(also: #start_x)
Returns the x coordinate of the starting point (if using a gradient).
-
#get_start_y ⇒ Float
(also: #start_y)
Returns the y coordinate of the starting point (if using a gradient).
-
#get_stipple ⇒ Wx::Bitmap
Returns the pen’s stipple bitmap.
-
#get_stops ⇒ Wx::GraphicsGradientStops
(also: #stops)
Returns the stops of the gradient.
-
#get_style ⇒ Wx::PenStyle
Returns the pen’s style.
-
#get_width ⇒ Float
Returns the pen’s line width.
-
#get_x1 ⇒ Float
(also: #x1)
Returns the x coordinate of the starting point (if using a gradient).
-
#get_x2 ⇒ Float
(also: #x2)
Returns the x coordinate of the ending point (if using a gradient).
-
#get_y1 ⇒ Float
(also: #y1)
Returns the y coordinate of the starting point (if using a gradient).
-
#get_y2 ⇒ Float
(also: #y2)
Returns the y coordinate of the ending point (if using a gradient).
-
#initialize(colour = (Wx::Colour.new()), width = 1.0, style = Wx::PenStyle::PENSTYLE_SOLID) ⇒ Wx::GraphicsPenInfo
constructor
Constructor, which can set the colour, width and style for the pen.
-
#is_transparent ⇒ Boolean
(also: #transparent?)
Returns whether the pen is transparent.
-
#join(join) ⇒ Wx::GraphicsPenInfo
Sets the join for the pen, which is the appearance of where two lines meet or overlap.
- #linear_gradient(*args) ⇒ Object
- #radial_gradient(*args) ⇒ Object
-
#stipple(stipple) ⇒ Wx::GraphicsPenInfo
Sets the bitmap used for stippling.
-
#style(style) ⇒ Wx::GraphicsPenInfo
Sets the style for the pen.
-
#width(width) ⇒ Wx::GraphicsPenInfo
Sets the line width for the pen.
Constructor Details
#initialize(colour = (Wx::Colour.new()), width = 1.0, style = Wx::PenStyle::PENSTYLE_SOLID) ⇒ Wx::GraphicsPenInfo
Constructor, which can set the colour, width and style for the pen.
984 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 984 def initialize(colour=(Wx::Colour.new()), width=1.0, style=Wx::PenStyle::PENSTYLE_SOLID) end |
Instance Method Details
#cap(cap) ⇒ Wx::GraphicsPenInfo
Sets the cap (i.e., the end point) for the pen.
1016 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1016 def cap(cap) end |
#colour(col) ⇒ Wx::GraphicsPenInfo
Sets the colour for the pen.
989 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 989 def colour(col) end |
#get_cap ⇒ Wx::PenCap
Returns the pen’s cap (i.e., end-point style).
1104 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1104 def get_cap; end |
#get_colour ⇒ Wx::Colour
Returns the pen’s colour.
1088 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1088 def get_colour; end |
#get_dash_count ⇒ Integer Also known as: dash_count
Returns the number of dashes in the pen’s dash pattern.
1108 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1108 def get_dash_count; end |
#get_dashes ⇒ Array<Integer> Also known as: dashes
76 |
# File 'lib/wx/doc/graphics_context.rb', line 76 def get_dashes; end |
#get_end_x ⇒ Float Also known as: end_x
Returns the x coordinate of the ending point (if using a gradient).
1157 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1157 def get_end_x; end |
#get_end_y ⇒ Float Also known as: end_y
Returns the y coordinate of the ending point (if using a gradient).
1162 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1162 def get_end_y; end |
#get_gradient_type ⇒ Wx::GradientType Also known as: gradient_type
Returns the pen’s gradient type.
1122 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1122 def get_gradient_type; end |
#get_join ⇒ Wx::PenJoin
Returns the pen’s joining method.
1100 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1100 def get_join; end |
#get_radius ⇒ Float Also known as: radius
Returns the radius of the radial gradient.
1167 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1167 def get_radius; end |
#get_start_x ⇒ Float Also known as: start_x
Returns the x coordinate of the starting point (if using a gradient).
1147 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1147 def get_start_x; end |
#get_start_y ⇒ Float Also known as: start_y
Returns the y coordinate of the starting point (if using a gradient).
1152 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1152 def get_start_y; end |
#get_stipple ⇒ Wx::Bitmap
Returns the pen’s stipple bitmap.
1092 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1092 def get_stipple; end |
#get_stops ⇒ Wx::GraphicsGradientStops Also known as: stops
Returns the stops of the gradient.
1172 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1172 def get_stops; end |
#get_style ⇒ Wx::PenStyle
Returns the pen’s style.
1096 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1096 def get_style; end |
#get_width ⇒ Float
Returns the pen’s line width.
1118 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1118 def get_width; end |
#get_x1 ⇒ Float Also known as: x1
Returns the x coordinate of the starting point (if using a gradient).
1127 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1127 def get_x1; end |
#get_x2 ⇒ Float Also known as: x2
Returns the x coordinate of the ending point (if using a gradient).
1137 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1137 def get_x2; end |
#get_y1 ⇒ Float Also known as: y1
Returns the y coordinate of the starting point (if using a gradient).
1132 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1132 def get_y1; end |
#get_y2 ⇒ Float Also known as: y2
Returns the y coordinate of the ending point (if using a gradient).
1142 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1142 def get_y2; end |
#is_transparent ⇒ Boolean Also known as: transparent?
Returns whether the pen is transparent.
1113 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1113 def is_transparent; end |
#join(join) ⇒ Wx::GraphicsPenInfo
Sets the join for the pen, which is the appearance of where two lines meet or overlap.
1011 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1011 def join(join) end |
#linear_gradient(x1, y1, x2, y2, c1, c2, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo #linear_gradient(x1, y1, x2, y2, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo
1049 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1049 def linear_gradient(*args) end |
#radial_gradient(startX, startY, endX, endY, radius, oColor, cColor, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo #radial_gradient(startX, startY, endX, endY, radius, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo
1084 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1084 def radial_gradient(*args) end |
#stipple(stipple) ⇒ Wx::GraphicsPenInfo
Sets the bitmap used for stippling.
When the pen is used, a repeating pattern of this bitmap will be drawn.
1006 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1006 def stipple(stipple) end |
#style(style) ⇒ Wx::GraphicsPenInfo
Sets the style for the pen.
999 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 999 def style(style) end |
#width(width) ⇒ Wx::GraphicsPenInfo
Sets the line width for the pen.
994 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 994 def width(width) end |