Class: Watobo::Gui::RulesTableCtrl

Inherits:
FXHorizontalFrame
  • Object
show all
Defined in:
lib/watobo/gui/rewrite_rules_dialog.rb

Direct Known Subclasses

RequestRulesCtrl, ResponseRulesCtrl

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, target = nil, opts) ⇒ RulesTableCtrl

Returns a new instance of RulesTableCtrl.



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
34
35
36
37
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
# File 'lib/watobo/gui/rewrite_rules_dialog.rb', line 7

def initialize(owner,target = nil, opts)
  @target = target
  super owner, opts
  matrix = FXMatrix.new(self, 4, :opts => MATRIX_BY_COLUMNS|LAYOUT_FILL_X|LAYOUT_FILL_Y)
  
  %w( Action Location Pattern Content).each do |l|
    FXLabel.new(matrix, l)
  end
  
  @actions_combo = FXComboBox.new(matrix, 10, nil, 0, COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK)
  #@filterCombo.width =200

  @actions_combo.numVisible = 0
  @actions_combo.numColumns = 10
  @actions_combo.editable = false
  @actions_combo.connect(SEL_COMMAND){}
  
  @locations_combo = FXComboBox.new(matrix, 10, nil, 0, COMBOBOX_STATIC|FRAME_SUNKEN|FRAME_THICK)
  #@filterCombo.width =200

  @locations_combo.numVisible = 0
  @locations_combo.numColumns = 10
  @locations_combo.editable = false
  @locations_combo.connect(SEL_COMMAND){}
  
  @pattern_txt = FXTextField.new(matrix, 20, nil, 0, :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN)
   @content_txt = FXTextField.new(matrix, 20, nil, 0, :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_COLUMN)
   
   frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
   top_btn_frame = FXHorizontalFrame.new(frame,:opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)

  @del_btn = FXButton.new(top_btn_frame, "Del" ,  nil, nil)
  @del_btn.enable
  @del_btn.connect(SEL_COMMAND){ delete_rule }

     #   @edit_btn = FXButton.new(top_btn_frame, "Edit ..." ,  nil, nil)
     #   @edit_btn.enable
     #   @edit_btn.connect(SEL_COMMAND){ delete_rule }

  @up_btn = FXButton.new(top_btn_frame, "Up" ,  nil, nil)
  @up_btn.enable

  @down_btn = FXButton.new(top_btn_frame, "Down" ,  nil, nil)
  @down_btn.enable
  
   @filter_btn = FXButton.new(top_btn_frame, "Filter" ,  nil, nil)
  @filter_btn.enable
  @filter_btn.connect(SEL_COMMAND){ open_filter_dialog }
  
  
  add_btn_frame = FXHorizontalFrame.new(frame,:opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
  @add_btn = FXButton.new(add_btn_frame, "Add ..." ,  nil, nil, )
  @add_btn.enable
  @add_btn.connect(SEL_COMMAND){ add_rule }

end

Instance Attribute Details

#targetObject

Returns the value of attribute target.



5
6
7
# File 'lib/watobo/gui/rewrite_rules_dialog.rb', line 5

def target
  @target
end