Class: RubyCurses::Link

Inherits:
Button show all
Defined in:
lib/rbcurse/extras/rlink.rb

Direct Known Subclasses

MenuLink

Constant Summary

Constants included from Io

Io::ERROR_COLOR_PAIR, Io::FOOTER_COLOR_PAIR, Io::LINEONE, Io::MAIN_WINDOW_COLOR_PAIR

Instance Attribute Summary

Attributes inherited from Widget

#_object_created, #col_offset, #cols_panned, #config, #curpos, #focussed, #form, #id, #parent_component, #row_offset, #rows_panned, #state

Instance Method Summary collapse

Methods inherited from Button

#action, #bind_hotkey, button_layout, #command, #getvalue, #handle_key, #mnemonic, #repaint, #text

Methods inherited from Widget

#changed, #click, #destroy, #enter, #event_list, #focus, #get_preferred_size, #getvalue, #handle_key, #height, #height=, #hide, #init_vars, #leave, #modified?, #move, #on_enter, #on_leave, #override_graphic, #printstring, #process_key, #remove, #repaint, #repaint_all, #repaint_required, #rowcol, #set_buffer_modified, #set_buffering, #set_form, #set_form_col, #set_form_row, #set_modified, #setformrowcol, #setrowcol, #show, #text_variable, #unbind_key, #width, #width=

Methods included from Io

#askchoice, #askyesno, #askyesnocancel, #clear_error, #clear_this, #get_string, #newaskyesno, #old_print_header, #old_print_top_right, #print_action, #print_error, #print_footer_help, #print_header, #print_headers, #print_help, #print_help_page, #print_in_middle, #print_key_labels, #print_key_labels_row, #print_screen_labels, #print_status, #print_this, #print_top_right, #rbgetstr, #warn

Methods included from Utils

#_process_key, #bind_key, #clean_string!, #get_color, #keycode_tos, #repeatm, #view, #wrap_text

Methods included from ConfigSetup

#cget, #config_setup, #configure, #variable_set

Methods included from EventHandler

#bind, #fire_handler, #fire_property_change

Constructor Details

#initialize(form, config = {}, &block) ⇒ Link

Returns a new instance of Link.



8
9
10
11
12
13
14
15
16
17
# File 'lib/rbcurse/extras/rlink.rb', line 8

def initialize form, config={}, &block
  super
  @text_offset = 0
  # haha we've never done this, pin the cursor up on 0,0
  @col_offset = -1 
  if @mnemonic
    form.bind_key(@mnemonic.downcase, self){ self.fire }
  end
  @display_length = config[:width]
end

Instance Method Details

#fireObject



18
19
20
21
# File 'lib/rbcurse/extras/rlink.rb', line 18

def fire
  super
  self.focus
end

#getvalue_for_paintObject



22
23
24
# File 'lib/rbcurse/extras/rlink.rb', line 22

def getvalue_for_paint
  getvalue()
end