Class: Wads::DeleteButton
Overview
A subclass of button that renders a red X instead of label text
Instance Attribute Summary
Attributes inherited from Button
#action_code, #is_pressed, #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, args = {}) ⇒ DeleteButton
constructor
A new instance of DeleteButton.
- #render ⇒ Object
Methods inherited from Button
#handle_mouse_down, #handle_update, #set_action, #widget_z
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, #uses_layout, #warn, #widget_z, #x_pixel_to_screen, #y_pixel_to_screen, #z_order
Constructor Details
#initialize(x, y, args = {}) ⇒ DeleteButton
Returns a new instance of DeleteButton.
1966 1967 1968 1969 1970 1971 |
# File 'lib/wads/widgets.rb', line 1966 def initialize(x, y, args = {}) super(x, y, "ignore", {ARG_DESIRED_WIDTH => 50}.merge(args)) set_dimensions(14, 14) add_child(Line.new(@x, @y, right_edge, bottom_edge, COLOR_ERROR_CODE_RED)) add_child(Line.new(@x, bottom_edge, right_edge, @y, COLOR_ERROR_CODE_RED)) end |
Instance Method Details
#render ⇒ Object
1973 1974 1975 |
# File 'lib/wads/widgets.rb', line 1973 def render # do nothing, just override the parent so we don't draw a label end |