Class: FX::WidgetTable

Inherits:
GroupBox
  • Object
show all
Defined in:
lib/libGUIb16.rb,
lib/libGUIb14.rb

Instance Method Summary collapse

Constructor Details

#initialize(p, opts = 0) ⇒ WidgetTable

Returns a new instance of WidgetTable.



995
996
997
998
999
1000
1001
1002
1003
1004
# File 'lib/libGUIb16.rb', line 995

def initialize(p, opts = 0)
  @c = {}
  @r = []
  @nc = 0
  super
  self.text = ""
  self.vSpacing = 0
  self.frameStyle = FRAME_NONE
  pad 2, 2, 2, 2
end

Instance Method Details

#add_colObject



1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/libGUIb16.rb', line 1017

def add_col
  @nc += 1
  @r.each_with_index { |r, y|
    VerticalFrame.new(r) { |f|
      @c[[@nc - 1, y]] = f
      f.pad 0, 0, 0, 0
    }
  }
end

#add_rowObject



1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
# File 'lib/libGUIb16.rb', line 1027

def add_row
  HorizontalFrame.new(self) { |h|
    h.frameStyle = FRAME_NONE
    h.pad 0, 0, 0, 0
    h.layoutHints = Fox::LAYOUT_FILL_X # |Fox::LAYOUT_FILL_Y
    @r << h
    @nc.times { |x|
      VerticalFrame.new(h) { |f|
        @c[[x, rows - 1]] = f
        f.pad 0, 0, 0, 0
      }
    }
  }
end

#cell(x, y) ⇒ Object



1042
1043
1044
# File 'lib/libGUIb16.rb', line 1042

def cell(x, y)
  @c[[x, y]]
end

#colsObject



1010
1011
1012
# File 'lib/libGUIb16.rb', line 1010

def cols
  @nc
end

#rowsObject



1006
1007
1008
# File 'lib/libGUIb16.rb', line 1006

def rows
  @r.size
end

#size=(w, h) ⇒ Object



1014
1015
# File 'lib/libGUIb16.rb', line 1014

def size=(w, h)
end