Class: Wads::HorizontalAxisLabel
Overview
Labels and tic marks for the horizontal axis on a plot
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
Attributes inherited from Widget
#base_z, #children, #gui_theme, #height, #is_selected, #layout, #overlay_widget, #override_color, #text_input_fields, #visible, #width, #x, #y
Instance Method Summary collapse
-
#initialize(x, y, label, color = nil) ⇒ HorizontalAxisLabel
constructor
A new instance of HorizontalAxisLabel.
- #render ⇒ Object
- #uses_layout ⇒ Object
- #widget_z ⇒ Object
Methods inherited from Widget
#add, #add_axis_lines, #add_button, #add_child, #add_delete_button, #add_document, #add_graph_display, #add_image, #add_multi_select_table, #add_overlay, #add_panel, #add_plot, #add_single_select_table, #add_table, #add_text, #border_color, #bottom_edge, #button_down, #button_up, #center_children, #center_x, #center_y, #clear_children, #contains_click, #debug, #disable_background, #disable_border, #draw, #draw_background, #draw_border, #enable_background, #enable_border, #error, #get_layout, #get_theme, #graphics_color, #handle_key_press, #handle_mouse_down, #handle_mouse_up, #handle_right_mouse, #handle_update, #info, #intercept_widget_event, #left_edge, #move_recursive_absolute, #move_recursive_delta, #overlaps_with, #relative_x, #relative_y, #relative_z_order, #remove_child, #remove_children, #remove_children_by_type, #right_edge, #selection_color, #set_absolute_position, #set_dimensions, #set_layout, #set_selected, #set_theme, #text_color, #top_edge, #unset_selected, #update, #warn, #x_pixel_to_screen, #y_pixel_to_screen, #z_order
Constructor Details
#initialize(x, y, label, color = nil) ⇒ HorizontalAxisLabel
Returns a new instance of HorizontalAxisLabel.
2212 2213 2214 2215 2216 2217 2218 2219 2220 |
# File 'lib/wads/widgets.rb', line 2212 def initialize(x, y, label, color = nil) super(x, y) @label = label @override_color = color text_pixel_width = @gui_theme.font.text_width(@label) add_text(@label, -(text_pixel_width / 2), 26) disable_border disable_background end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
2210 2211 2212 |
# File 'lib/wads/widgets.rb', line 2210 def label @label end |
Instance Method Details
#render ⇒ Object
2222 2223 2224 |
# File 'lib/wads/widgets.rb', line 2222 def render Gosu::draw_line @x, @y, graphics_color, @x, @y + 20, graphics_color, z_order end |
#uses_layout ⇒ Object
2230 2231 2232 |
# File 'lib/wads/widgets.rb', line 2230 def uses_layout false end |
#widget_z ⇒ Object
2226 2227 2228 |
# File 'lib/wads/widgets.rb', line 2226 def Z_ORDER_TEXT end |