Class: Watobo::Gui::TableEditorFrame

Inherits:
FXVerticalFrame
  • Object
show all
Defined in:
lib/watobo/gui/table_editor.rb

Instance Method Summary collapse

Constructor Details

#initialize(owner, opts) ⇒ TableEditorFrame

Returns a new instance of TableEditorFrame.



435
436
437
438
439
440
441
442
443
# File 'lib/watobo/gui/table_editor.rb', line 435

def initialize(owner, opts)
  super(owner, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding => 0)
  #frame = FXVerticalFrame.new(frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding => 0)
  @req_line = FXText.new(self, :opts => LAYOUT_FILL_X|TEXT_FIXEDWRAP)
  @req_line.visibleRows = 1
  @req_line.backColor = @req_line.parent.backColor
  @req_line.disable
  @editor = TableEditor.new(self, :opts => FRAME_SUNKEN|TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL_X|LAYOUT_FILL_Y|TABLE_READONLY|LAYOUT_SIDE_TOP, :padding => 2)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



445
446
447
448
449
450
451
452
453
# File 'lib/watobo/gui/table_editor.rb', line 445

def method_missing(name, *args, &block)
    
    if @editor.respond_to? name.to_sym
      return @editor.send(name.to_sym, *args, &block)
    else
      super
    end
  
end

Instance Method Details

#setRequest(raw_request) ⇒ Object



420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/watobo/gui/table_editor.rb', line 420

def setRequest(raw_request)
  if raw_request.is_a? String
    request = Watobo::Utils.text2request(raw_request)
  elsif raw_request.respond_to? :copy
    request = raw_request.copy
  else
    request = Watobo::Request.new raw_request
  end
 

  @editor.setRequest request
  @req_line.text = request.first.strip

end

#subscribe(event, &callback) ⇒ Object



416
417
418
# File 'lib/watobo/gui/table_editor.rb', line 416

def subscribe(event, &callback)
  @editor.subscribe event, &callback
end