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.


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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/watobo/gui/intercept_filter_dialog.rb', line 36

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


28
29
30
# File 'lib/watobo/gui/intercept_filter_dialog.rb', line 28

def getRequestFilter()
  @request_filter
end

#getResponseFilterObject


32
33
34
# File 'lib/watobo/gui/intercept_filter_dialog.rb', line 32

def getResponseFilter()
  @response_filter
end