Class: Watobo::Gui::AddTableParmDialog

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

Instance Method Summary collapse

Constructor Details

#initialize(owner) ⇒ AddTableParmDialog

Returns a new instance of AddTableParmDialog.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/watobo/gui/table_editor.rb', line 38

def initialize(owner)
  #super(owner, "Edit Target Scope", DECOR_TITLE|DECOR_BORDER, :width => 300, :height => 425)
  super(owner, "Add Parameter", DECOR_ALL)

  @location = nil
  @pname = nil
  @pval = nil

  base_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
  frame = FXHorizontalFrame.new(base_frame, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)

  #  puts "create scopeframe with scope:"
  # @project.scope
  FXLabel.new(frame, "Method:")
  @location_combo = FXComboBox.new(frame, 5, nil, 0,
      COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
  %w( Post Url Cookie ).each do |loc|
    item = @location_combo.appendItem(loc)
    @location_combo.setItemData(item, loc)
  end

  @location_combo.numVisible = 3
  @location_combo.numColumns = 8
  @location_combo.currentItem = 0
  @location_combo.editable = false
  #  @location_combo.connect(SEL_COMMAND, method(:onLocationChanged))

  FXLabel.new(frame, "Parameter:")
  @parm_name_dt = FXDataTarget.new('')
  FXTextField.new(frame, 15,
  :target => @parm_name_dt, :selector => FXDataTarget::ID_VALUE,
  :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT)

  FXLabel.new(frame, "Value:")
  @parm_value_dt = FXDataTarget.new('')
  FXTextField.new(frame, 15,
  :target => @parm_value_dt, :selector => FXDataTarget::ID_VALUE,
  :opts => TEXTFIELD_NORMAL|LAYOUT_SIDE_RIGHT)

  buttons_frame = FXHorizontalFrame.new(base_frame,
  :opts => LAYOUT_FILL_X|LAYOUT_SIDE_TOP)

  @finishButton = FXButton.new(buttons_frame, "Accept" ,  nil, nil, :opts => BUTTON_NORMAL|LAYOUT_RIGHT)
  @finishButton.enable
  @finishButton.connect(SEL_COMMAND) do |sender, sel, item|
  #self.handle(self, FXSEL(SEL_COMMAND, ID_CANCEL), nil)
    self.handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), nil)
  end

  @cancelButton = FXButton.new(buttons_frame, "Cancel" ,
      :target => self, :selector => FXDialogBox::ID_CANCEL,
      :opts => BUTTON_NORMAL|LAYOUT_RIGHT)

end

Instance Method Details

#locationObject



26
27
28
# File 'lib/watobo/gui/table_editor.rb', line 26

def location()
  @location_combo.getItemData(@location_combo.currentItem)
end

#parmNameObject



30
31
32
# File 'lib/watobo/gui/table_editor.rb', line 30

def parmName()
  @parm_name_dt.value
end

#parmValueObject



34
35
36
# File 'lib/watobo/gui/table_editor.rb', line 34

def parmValue()
  @parm_value_dt.value
end