Class: Watobo::Gui::TestGui::TreeDlg

Inherits:
FXDialogBox
  • Object
show all
Includes:
Responder
Defined in:
lib/watobo/gui/checkboxtree.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent, project = nil, prefs = {}) ⇒ TreeDlg

Returns a new instance of TreeDlg.



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/watobo/gui/checkboxtree.rb', line 283

def initialize(parent, project=nil, prefs={} )
  super(parent, "CheckBox Dialog", DECOR_ALL, :width => 300, :height => 400)
  FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)
  frame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
  elements = []
  num_root_nodes = 4
  max_child_nodes = 4
  num_root_nodes.times do |ri|
    max_child_nodes.times do |si|
      name = "root#{ri}|sub#{si}"
      data = name + "-data"
      e = { :name => name, :enabled => false, :data => data }
      elements << e
    end
  end
  @cbtree = CheckBoxTreeList.new(frame)
  @cbtree.elements = elements

end