Class: Watobo::Gui::StatusBar
- Inherits:
-
FXHorizontalFrame
- Object
- FXHorizontalFrame
- Watobo::Gui::StatusBar
- Defined in:
- lib/watobo/gui/status_bar.rb
Instance Method Summary collapse
- #bindAddress=(bind_addr) ⇒ Object
- #forwardingProxy=(forward_proxy) ⇒ Object
-
#initialize(owner, opts) ⇒ StatusBar
constructor
A new instance of StatusBar.
- #portNumber=(port_number) ⇒ Object
- #projectName=(project_name) ⇒ Object
- #sessionName=(session_name) ⇒ Object
- #setStatusInfo(prefs = {}) ⇒ Object
- #statusInfoText=(new_text) ⇒ Object
- #update_proxy_mode ⇒ Object
Constructor Details
#initialize(owner, opts) ⇒ StatusBar
Returns a new instance of StatusBar.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/watobo/gui/status_bar.rb', line 59 def initialize(owner, opts) super(owner, opts) frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0) FXLabel.new(frame, "Status: ") @statusInfo = FXLabel.new(frame, "- no project started -") frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0) FXLabel.new(frame, "Project: ") @projectName = FXLabel.new(frame, " - ") frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0) FXLabel.new(frame, "Session: ") @sessionName = FXLabel.new(frame, " - ") frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0) #@bind_label = FXLabel.new(frame, "BindAddr: ") @bind_addr_label = FXLabel.new(frame, "Bind-Addr: - ") frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0) @port_label = FXLabel.new(frame, "Port: ") # @port_label.connect(SEL_RIGHTBUTTONPRESS) { switch_proxy_mode } @portNumber = FXLabel.new(frame, " - ") # @portNumber.connect(SEL_RIGHTBUTTONPRESS) { switch_proxy_mode } frame = FXHorizontalFrame.new(self, :opts => FRAME_SUNKEN, :padding => 0) FXLabel.new(frame, "Forwarding Proxy: ") @forwardingProxy = FXLabel.new(frame, " - ") end |
Instance Method Details
#bindAddress=(bind_addr) ⇒ Object
55 56 57 |
# File 'lib/watobo/gui/status_bar.rb', line 55 def bindAddress=(bind_addr) @bind_addr_label.text = "Bind-Addr: #{bind_addr} " end |
#forwardingProxy=(forward_proxy) ⇒ Object
51 52 53 |
# File 'lib/watobo/gui/status_bar.rb', line 51 def forwardingProxy=(forward_proxy) @forwardingProxy.text = forward_proxy end |
#portNumber=(port_number) ⇒ Object
47 48 49 |
# File 'lib/watobo/gui/status_bar.rb', line 47 def portNumber=(port_number) @portNumber.text = port_number end |
#projectName=(project_name) ⇒ Object
39 40 41 |
# File 'lib/watobo/gui/status_bar.rb', line 39 def projectName=(project_name) @projectName.text = project_name end |
#sessionName=(session_name) ⇒ Object
43 44 45 |
# File 'lib/watobo/gui/status_bar.rb', line 43 def sessionName=(session_name) @sessionName.text = session_name end |
#setStatusInfo(prefs = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/watobo/gui/status_bar.rb', line 5 def setStatusInfo( prefs={} ) cprefs = { :color => self.parent.backColor, :text => '' } cprefs.update prefs unless prefs.nil? @statusInfo.text = cprefs[:text] unless cprefs[:color].nil? @statusInfo.backColor = cprefs[:color] end end |
#statusInfoText=(new_text) ⇒ Object
34 35 36 37 |
# File 'lib/watobo/gui/status_bar.rb', line 34 def statusInfoText=( new_text ) @statusInfo.text = new_text @statusInfo.backColor = self.parent.backColor end |
#update_proxy_mode ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/watobo/gui/status_bar.rb', line 21 def update_proxy_mode # puts "Update Proxy Mode ..." if Watobo::Conf::Interceptor.proxy_mode == Watobo::Interceptor::MODE_REGULAR # puts "REGULAR MODE" @portNumber.backColor = @portNumber.parent.backColor @port_label.backColor = @port_label.parent.backColor else # puts "TRANSPARENT MODE" @portNumber.backColor = FXColor::Red @port_label.backColor = FXColor::Red end end |