Class: Coopy::CombinedTable

Inherits:
Object
  • Object
show all
Defined in:
lib/lib/coopy/combined_table.rb

Instance Method Summary collapse

Constructor Details

#initialize(t) ⇒ CombinedTable

Returns a new instance of CombinedTable.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/lib/coopy/combined_table.rb', line 7

def initialize(t)
  @t = t
  @dx = 0
  @dy = 0
  @core = t
  @head = nil
  return if t.get_width < 1 || t.get_height < 1
  v = t.get_cell_view
  return if v.to_s(t.get_cell(0,0)) != "@@"
  @dx = 1
  @dy = 0
  begin
    _g1 = 0
    _g = t.get_height
    while(_g1 < _g) 
      y = _g1
      _g1+=1
      txt = v.to_s(t.get_cell(0,y))
      break if txt == nil || txt == "" || txt == "null"
      @dy+=1
    end
  end
  @head = ::Coopy::CombinedTableHead.new(self,@dx,@dy)
  @body = ::Coopy::CombinedTableBody.new(self,@dx,@dy)
  @core = @body
  @meta = ::Coopy::SimpleMeta.new(@head)
end

Instance Method Details

#allObject



47
48
49
# File 'lib/lib/coopy/combined_table.rb', line 47

def all 
  @t
end

#clearObject



92
93
94
# File 'lib/lib/coopy/combined_table.rb', line 92

def clear 
  @core.clear
end

#cloneObject



112
113
114
# File 'lib/lib/coopy/combined_table.rb', line 112

def clone 
  @core.clone
end

#createObject



116
117
118
# File 'lib/lib/coopy/combined_table.rb', line 116

def create 
  @t.create
end

#get_cell(x, y) ⇒ Object



68
69
70
# File 'lib/lib/coopy/combined_table.rb', line 68

def get_cell(x,y)
  @core.get_cell(x,y)
end

#get_cell_viewObject



80
81
82
# File 'lib/lib/coopy/combined_table.rb', line 80

def get_cell_view 
  @t.get_cell_view
end

#get_dataObject



108
109
110
# File 'lib/lib/coopy/combined_table.rb', line 108

def get_data 
  nil
end

#get_heightObject



64
65
66
# File 'lib/lib/coopy/combined_table.rb', line 64

def get_height 
  @core.get_height
end

#get_metaObject



120
121
122
# File 'lib/lib/coopy/combined_table.rb', line 120

def get_meta 
  @meta
end

#get_tableObject



51
52
53
# File 'lib/lib/coopy/combined_table.rb', line 51

def get_table 
  self
end

#get_widthObject



60
61
62
# File 'lib/lib/coopy/combined_table.rb', line 60

def get_width 
  @core.get_width
end

#heightObject



55
# File 'lib/lib/coopy/combined_table.rb', line 55

def height() get_height end

#height=(__v) ⇒ Object



56
# File 'lib/lib/coopy/combined_table.rb', line 56

def height=(__v) @height = __v end

#insert_or_delete_columns(fate, wfate) ⇒ Object



100
101
102
# File 'lib/lib/coopy/combined_table.rb', line 100

def insert_or_delete_columns(fate,wfate)
  @core.insert_or_delete_columns(fate,wfate)
end

#insert_or_delete_rows(fate, hfate) ⇒ Object



96
97
98
# File 'lib/lib/coopy/combined_table.rb', line 96

def insert_or_delete_rows(fate,hfate)
  @core.insert_or_delete_rows(fate,hfate)
end

#is_resizableObject



84
85
86
# File 'lib/lib/coopy/combined_table.rb', line 84

def is_resizable 
  @core.is_resizable
end

#resize(w, h) ⇒ Object



88
89
90
# File 'lib/lib/coopy/combined_table.rb', line 88

def resize(w,h)
  @core.resize(h,w)
end

#set_cell(x, y, c) ⇒ Object



72
73
74
# File 'lib/lib/coopy/combined_table.rb', line 72

def set_cell(x,y,c)
  @core.set_cell(x,y,c)
end

#to_sObject



76
77
78
# File 'lib/lib/coopy/combined_table.rb', line 76

def to_s 
  ::Coopy::SimpleTable.table_to_string(self)
end

#trim_blankObject



104
105
106
# File 'lib/lib/coopy/combined_table.rb', line 104

def trim_blank 
  @core.trim_blank
end

#widthObject



57
# File 'lib/lib/coopy/combined_table.rb', line 57

def width() get_width end

#width=(__v) ⇒ Object



58
# File 'lib/lib/coopy/combined_table.rb', line 58

def width=(__v) @width = __v end