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.
990 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 990 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.
1022 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1022 def cap(cap) end |
#colour(col) ⇒ Wx::GraphicsPenInfo
Sets the colour for the pen.
995 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 995 def colour(col) end |
#get_cap ⇒ Wx::PenCap
Returns the pen’s cap (i.e., end-point style).
1110 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1110 def get_cap; end |
#get_colour ⇒ Wx::Colour
Returns the pen’s colour.
1094 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1094 def get_colour; end |
#get_dash_count ⇒ Integer Also known as: dash_count
Returns the number of dashes in the pen’s dash pattern.
1114 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1114 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).
1163 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1163 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).
1168 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1168 def get_end_y; end |
#get_gradient_type ⇒ Wx::GradientType Also known as: gradient_type
Returns the pen’s gradient type.
1128 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1128 def get_gradient_type; end |
#get_join ⇒ Wx::PenJoin
Returns the pen’s joining method.
1106 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1106 def get_join; end |
#get_radius ⇒ Float Also known as: radius
Returns the radius of the radial gradient.
1173 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1173 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).
1153 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1153 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).
1158 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1158 def get_start_y; end |
#get_stipple ⇒ Wx::Bitmap
Returns the pen’s stipple bitmap.
1098 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1098 def get_stipple; end |
#get_stops ⇒ Wx::GraphicsGradientStops Also known as: stops
Returns the stops of the gradient.
1178 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1178 def get_stops; end |
#get_style ⇒ Wx::PenStyle
Returns the pen’s style.
1102 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1102 def get_style; end |
#get_width ⇒ Float
Returns the pen’s line width.
1124 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1124 def get_width; end |
#get_x1 ⇒ Float Also known as: x1
Returns the x coordinate of the starting point (if using a gradient).
1133 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1133 def get_x1; end |
#get_x2 ⇒ Float Also known as: x2
Returns the x coordinate of the ending point (if using a gradient).
1143 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1143 def get_x2; end |
#get_y1 ⇒ Float Also known as: y1
Returns the y coordinate of the starting point (if using a gradient).
1138 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1138 def get_y1; end |
#get_y2 ⇒ Float Also known as: y2
Returns the y coordinate of the ending point (if using a gradient).
1148 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1148 def get_y2; end |
#is_transparent ⇒ Boolean Also known as: transparent?
Returns whether the pen is transparent.
1119 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1119 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.
1017 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1017 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
1055 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1055 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
1090 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1090 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.
1012 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1012 def stipple(stipple) end |
#style(style) ⇒ Wx::GraphicsPenInfo
Sets the style for the pen.
1005 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1005 def style(style) end |
#width(width) ⇒ Wx::GraphicsPenInfo
Sets the line width for the pen.
1000 |
# File 'lib/wx/doc/gen/graphics_context.rb', line 1000 def width(width) end |