Class: Canis::LabeledField

Inherits:
Field show all
Defined in:
lib/canis/core/widgets/rwidget.rb

Overview

trying to take out the label thing from field to keep it as simple as possible. 2014-07-09

Since:

  • 1.2.0

Direct Known Subclasses

ComboBox

Instance Attribute Summary

Attributes inherited from Field

#above, #below, #buffer, #datatype, #field_col, #original_value, #overwrite_mode

Attributes inherited from Widget

#_object_created, #col_offset, #config, #curpos, #focussed, #form, #handler, #id, #key_label, #parent_component, #row_offset, #state

Instance Method Summary collapse

Methods inherited from Field

#_set_buffer, #addcol, #cursor_backward, #cursor_end, #cursor_forward, #cursor_home, #delete_at, #delete_curr_char, #delete_eol, #delete_prev_char, #getvalue, #handle_key, #in_range?, #init_vars, #initialize, #label, #map_keys, #modified?, #on_enter, #on_leave, #position_label, #putc, #putch, #restore_original_value, #set_focusable, #set_form_col, #set_label, #text, #text=, #type, #undo_delete_eol

Methods inherited from Widget

#action_manager, #bgcolor, #color, #color_pair, #command, #destroy, #focus, #focusable, #focusable?, #getvalue, #getvalue_for_paint, #handle_key, #hide, #init_vars, #initialize, #modified?, #move, #on_enter, #on_leave, #override_graphic, #process_key, #property_set, #remove, #repaint_all, #repaint_required, #rowcol, #set_form, #set_form_col, #set_form_row, #set_modified, #setformrowcol, #setrowcol, #show, #unbind_key

Methods included from Io

#__create_footer_window, #clear_this, #get_file, #print_this, #rb_getchar, #rb_gets, #rb_getstr, #warn

Methods included from Utils

#ORIG_process_key, #ORIGbind_key, #ORIGkeycode_tos, #_process_key, #bind_composite_mapping, #bind_key, #bind_keys, #check_composite_mapping, #create_logger, #define_key, #define_prefix_command, #execute_mapping, #get_attrib, #get_color, #key, #key_tos, #print_key_bindings, #repeatm, #run_command, #shell_out, #shell_output, #suspend, #view, #xxxbind_composite_mapping

Methods included from ConfigSetup

#config_setup, #variable_set

Methods included from EventHandler

#bind, #event?, #event_list, #fire_handler, #fire_property_change, #register_events

Constructor Details

This class inherits a constructor from Canis::Field

Instance Method Details

#repaintObject

Since:

  • 1.2.0



2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
# File 'lib/canis/core/widgets/rwidget.rb', line 2819

def repaint
  return unless @repaint_required
  _lrow = @lrow || @row
  # the next was nice, but in some cases this goes out of screen. and the container
  # only sets row and col for whatever is added, it does not know that lcol has to be 
  # taken into account
  #_lcol = @lcol || (@col - @label.length  - 2)
  unless @lcol
    @lcol = @col
    @col = @lcol + @label.length + 2
  end
  _lcol = @lcol
  @graphic = @form.window if @graphic.nil?
  lcolor = @label_color_pair || $datacolor # this should be the same color as window bg XXX
  lattr = @label_attr || NORMAL
  @graphic.printstring _lrow, _lcol, @label, lcolor, lattr
  ##c += @label.length + 2
  #@col_offset = c-@col            # required so cursor lands in right place
  super
end