Class: Watobo::Gui::InterceptFilterDialog

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

Instance Method Summary collapse

Constructor Details

#initialize(owner, settings = {}) ⇒ InterceptFilterDialog

Returns a new instance of InterceptFilterDialog.



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
# File 'lib/watobo/gui/intercept_filter_dialog.rb', line 15

def initialize(owner, settings = {} )
  super(owner, "Rewrite Settings", DECOR_ALL, :width => 300, :height => 425)

  @request_filter = { }

  @response_filter = { }

  @request_filter.update settings[:request_filter_settings]
  @response_filter.update settings[:response_filter_settings]

  FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)

  base_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
  @tabbook = FXTabBook.new(base_frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT)
  buttons_frame = FXHorizontalFrame.new(base_frame, :opts => LAYOUT_FILL_X)
  @req_opt_tab = FXTabItem.new(@tabbook, "Request Options", nil)
  frame = FXVerticalFrame.new(@tabbook, :opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_FILL_Y)
  scroll_window = FXScrollWindow.new(frame, SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
  @req_opt_frame = FXVerticalFrame.new(scroll_window, :opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_FILL_Y)

  @resp_opt_tab = FXTabItem.new(@tabbook, "Response Options", nil)
  frame= FXVerticalFrame.new(@tabbook, :opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_FILL_Y)
  scroll_window = FXScrollWindow.new(frame, SCROLLERS_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y)
  @resp_opt_frame = FXVerticalFrame.new(scroll_window, :opts => FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_FILL_Y)

  initRequestFilterFrame()
  updateRequestFilterFrame()

  initResponseFilterFrame()
  updateResponseFilterFrame()

  @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

#getRequestFilterObject



7
8
9
# File 'lib/watobo/gui/intercept_filter_dialog.rb', line 7

def getRequestFilter()
  @request_filter
end

#getResponseFilterObject



11
12
13
# File 'lib/watobo/gui/intercept_filter_dialog.rb', line 11

def getResponseFilter()
  @response_filter
end