Class: Canis::Box

Inherits:
Widget show all
Includes:
BorderTitle
Defined in:
lib/canis/core/widgets/box.rb

Overview

Since:

  • 1.4.1 UNTESTED

Instance Attribute Summary

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 included from BorderTitle

#bordertitle_init, #print_borders, #print_title

Methods inherited from Widget

#action_manager, #bgcolor, #color, #color_pair, #command, #destroy, #focus, #focusable, #focusable?, #getvalue, #getvalue_for_paint, #handle_key, #hide, #init_vars, #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

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

Returns a new instance of Box.

Since:

  • 1.4.1 UNTESTED



29
30
31
32
33
34
35
36
37
38
# File 'lib/canis/core/widgets/box.rb', line 29

def initialize form, config={}, &block

  bordertitle_init
  super
  @window = form.window if @form
  @editable = false
  @focusable = false
  #@height += 1 # for that silly -1 that happens
  @repaint_required = true
end

Instance Method Details

#repaintObject

repaint the scrollbar

Since:

  • 1.4.1 UNTESTED



42
43
44
45
46
47
48
49
50
51
# File 'lib/canis/core/widgets/box.rb', line 42

def repaint
  return unless @repaint_required
  bc = $datacolor
  bordercolor = @border_color || bc
  borderatt = @border_attrib || Ncurses::A_NORMAL
  @window.print_border row, col, height, width, bordercolor, borderatt
  #print_borders
  print_title
  @repaint_required = false
end