Class: CDK::CDKOBJS

Inherits:
Object
  • Object
show all
Includes:
Alignments, Bindings, Borders, Converters, ExitConditions, Focusable, HasScreen, HasTitle, Justifications, Movement, WindowHooks, WindowInput
Defined in:
lib/cdk/cdk_objs.rb

Constant Summary collapse

@@g_paste_buffer =
''

Instance Attribute Summary

Attributes included from HasTitle

#title_attrib

Attributes included from HasScreen

#is_visible, #screen, #screen_index

Attributes included from ExitConditions

#exit_type

Attributes included from Bindings

#binding_list

Attributes included from Focusable

#accepts_focus, #has_focus

Attributes included from Borders

#BXAttr, #HZChar, #LLChar, #LRChar, #ULChar, #URChar, #VTChar, #border_size, #box

Instance Method Summary collapse

Methods included from WindowHooks

#destroy, #draw, #erase, #refreshData, #saveData

Methods included from WindowInput

#getc, #getch, #inject, #setPostProcess, #setPreProcess

Methods included from HasTitle

#cleanTitle, #drawTitle, #init_title, #setTitle

Methods included from HasScreen

#SCREEN_XPOS, #SCREEN_YPOS, #init_screen, #wrefresh

Methods included from ExitConditions

#init_exit_conditions, #resetExitType, #setExitType

Methods included from Bindings

#bind, #bindableObject, #checkBind, #cleanBindings, #init_bindings, #isBind, #unbind

Methods included from Focusable

#focus, #init_focus, #unfocus

Methods included from Borders

#getBox, #init_borders, #setBXattr, #setBox, #setHZchar, #setLLchar, #setLRchar, #setULchar, #setURchar, #setVTchar

Methods included from Movement

#move, #move_specific, #position

Methods included from Converters

#char2Chtype, #charOf, #chtype2Char, #chtype2String, #decode_attribute, #encode_attribute

Methods included from Justifications

#justify_string

Methods included from Alignments

#alignxy

Constructor Details

#initializeCDKOBJS

Returns a new instance of CDKOBJS.



33
34
35
36
37
38
39
40
41
42
# File 'lib/cdk/cdk_objs.rb', line 33

def initialize
  CDK::ALL_OBJECTS << self

  init_title
  init_borders
  init_focus
  init_bindings
  init_exit_conditions
  init_screen
end

Instance Method Details

#object_typeObject



52
53
54
55
# File 'lib/cdk/cdk_objs.rb', line 52

def object_type
  # no type by default
  :NULL
end

#setBackgroundColor(color) ⇒ Object

This sets the background color of the widget.



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/cdk/cdk_objs.rb', line 73

def setBackgroundColor(color)
  return if color.nil? || color == ''

  junk1 = []
  junk2 = []
  
  # Convert the value of the environment variable to a chtype
  holder = char2Chtype(color, junk1, junk2)

  # Set the widget's background color
  self.setBKattr(holder[0])
end

#timeout(v) ⇒ Object



46
47
48
# File 'lib/cdk/cdk_objs.rb', line 46

def timeout(v)
  @input_window.timeout(v) if @input_window
end

#validCDKObjectObject



62
63
64
65
66
67
68
# File 'lib/cdk/cdk_objs.rb', line 62

def validCDKObject
  result = false
  if CDK::ALL_OBJECTS.include?(self)
    result = self.validObjType(self.object_type)
  end
  return result
end

#validObjType(type) ⇒ Object



57
58
59
60
# File 'lib/cdk/cdk_objs.rb', line 57

def validObjType(type)
  # dummy version for now
  true
end