Class: Watobo::Gui::RequestFilterDialog

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

Instance Method Summary collapse

Constructor Details

#initialize(owner, rule, settings = {}) ⇒ RequestFilterDialog

Returns a new instance of RequestFilterDialog.


340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/watobo/gui/rewrite_filters_dialog.rb', line 340

def initialize(owner, rule, settings = {} )
  super(owner, "Request Rule Filter", DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE, :width => 650, :height => 300)

  FXMAPFUNC(SEL_COMMAND, ID_ACCEPT, :onAccept)

  @main_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y, :padding => 0)
 
  @table = FilterTable.new(@main_frame, rule.filters)       
  @table_ctrl = RequestFilterCtrl.new(@main_frame, @table, :opts => LAYOUT_FILL_X|FRAME_SUNKEN|FRAME_THICK)

  buttons_frame = FXHorizontalFrame.new(@main_frame, :opts => LAYOUT_FILL_X|LAYOUT_BOTTOM)
  @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

#filterObject


334
335
336
337
338
# File 'lib/watobo/gui/rewrite_filters_dialog.rb', line 334

def filter
  f = Watobo::Interceptor::FilterChain.new
  f.set_filters @table.filters
  f
end