Class: FtpBrowserDialog

Inherits:
Fox::FXDialogBox
  • Object
show all
Includes:
Fox
Defined in:
lib/piggy-gui/ftp_browser_widget.rb

Instance Method Summary collapse

Constructor Details

#initialize(window, options = PiggyOptions.new) ⇒ FtpBrowserDialog

Returns a new instance of FtpBrowserDialog.



14
15
16
17
18
19
20
21
# File 'lib/piggy-gui/ftp_browser_widget.rb', line 14

def initialize(window, options = PiggyOptions.new)
  super(window, "Piggy FTP Client", DECOR_ALL)
  @frame = FXVerticalFrame.new(self)
  @frame.setLayoutHints(LAYOUT_FILL_X|LAYOUT_FILL_Y)
  @browser = FtpBrowserWidget.new(@frame, options)
  connect(SEL_CLOSE, method(:on_cmd_close))
  @browser.quitButton.connect(SEL_COMMAND, method(:on_quit_button))
end

Instance Method Details

#createObject



27
28
29
30
31
# File 'lib/piggy-gui/ftp_browser_widget.rb', line 27

def create
  resize(@browser.preferred_width + 20, 600)
  place(PIGGY_WINDOW_PLACEMENT)
  super
end

#on_cmd_close(sender, sel, ptr) ⇒ Object

Send whenever this window is about to close



34
35
36
37
# File 'lib/piggy-gui/ftp_browser_widget.rb', line 34

def on_cmd_close(sender, sel, ptr)
  @browser.prepare_closure
  return 0
end

#on_quit_button(sender, sel, ptr) ⇒ Object



39
40
41
# File 'lib/piggy-gui/ftp_browser_widget.rb', line 39

def on_quit_button(sender, sel, ptr)
  handle(sender, MKUINT(ID_ACCEPT, SEL_COMMAND), nil)
end

#optionsObject



23
24
25
# File 'lib/piggy-gui/ftp_browser_widget.rb', line 23

def options
  @browser.options
end