Class: PathSelector
- Inherits:
-
Object
- Object
- PathSelector
- Defined in:
- lib/libGUIb16.rb,
lib/libGUIb16.rb,
lib/libGUIb14.rb,
lib/libGUIb14.rb
Instance Attribute Summary collapse
-
#__foxGUIb__last__ ⇒ Object
Returns the value of attribute __foxGUIb__last__.
-
#browse ⇒ Object
Returns the value of attribute browse.
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#label ⇒ Object
Returns the value of attribute label.
-
#PathSelector ⇒ Object
Returns the value of attribute PathSelector.
-
#relative_path ⇒ Object
Returns the value of attribute relative_path.
-
#textfield ⇒ Object
Returns the value of attribute textfield.
-
#title ⇒ Object
Returns the value of attribute title.
-
#topwin ⇒ Object
Returns the value of attribute topwin.
Instance Method Summary collapse
- #construct_widget_tree(parent) ⇒ Object
- #description ⇒ Object
- #description=(text) ⇒ Object
- #init ⇒ Object
-
#initialize(parent) ⇒ PathSelector
constructor
A new instance of PathSelector.
- #onBrowse(*args) ⇒ Object
- #update(path) ⇒ Object
Constructor Details
#initialize(parent) ⇒ PathSelector
Returns a new instance of PathSelector.
1209 1210 1211 1212 |
# File 'lib/libGUIb16.rb', line 1209 def initialize(parent) (parent) init if respond_to? :init end |
Instance Attribute Details
#__foxGUIb__last__ ⇒ Object
Returns the value of attribute __foxGUIb__last__.
1248 1249 1250 |
# File 'lib/libGUIb16.rb', line 1248 def __foxGUIb__last__ @__foxGUIb__last__ end |
#browse ⇒ Object
Returns the value of attribute browse.
1248 1249 1250 |
# File 'lib/libGUIb16.rb', line 1248 def browse @browse end |
#directory ⇒ Object
Returns the value of attribute directory.
1589 1590 1591 |
# File 'lib/libGUIb16.rb', line 1589 def directory @directory end |
#filename ⇒ Object
Returns the value of attribute filename.
1589 1590 1591 |
# File 'lib/libGUIb16.rb', line 1589 def filename @filename end |
#label ⇒ Object
Returns the value of attribute label.
1248 1249 1250 |
# File 'lib/libGUIb16.rb', line 1248 def label @label end |
#PathSelector ⇒ Object
Returns the value of attribute PathSelector.
1248 1249 1250 |
# File 'lib/libGUIb16.rb', line 1248 def PathSelector @PathSelector end |
#relative_path ⇒ Object
Returns the value of attribute relative_path.
1589 1590 1591 |
# File 'lib/libGUIb16.rb', line 1589 def relative_path @relative_path end |
#textfield ⇒ Object
Returns the value of attribute textfield.
1248 1249 1250 |
# File 'lib/libGUIb16.rb', line 1248 def textfield @textfield end |
#title ⇒ Object
Returns the value of attribute title.
1589 1590 1591 |
# File 'lib/libGUIb16.rb', line 1589 def title @title end |
#topwin ⇒ Object
Returns the value of attribute topwin.
1248 1249 1250 |
# File 'lib/libGUIb16.rb', line 1248 def topwin @topwin end |
Instance Method Details
#construct_widget_tree(parent) ⇒ Object
1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 |
# File 'lib/libGUIb16.rb', line 1214 def (parent) @topwin = FX::HorizontalFrame.new(parent) { |w| @PathSelector = w w.padLeft = 0 w.frameStyle = 0 w.padRight = 0 w.hSpacing = 2 w.height = 21 w.layoutHints = 1024 FX::Label.new(@PathSelector) { |w| @label = w w.text = "Path:" w.width = 30 w.x = 0 } FX::TextField.new(@PathSelector) { |w| @textfield = w w.width = 291 w.y = 0 w.layoutHints = 1024 w.x = 32 } FX::Button.new(@PathSelector) { |w| @browse = w w.text = "Browse..." w.padLeft = 4 w.width = 59 w.padRight = 4 w.y = 0 w.x = 325 } } end |
#description ⇒ Object
1594 1595 1596 |
# File 'lib/libGUIb16.rb', line 1594 def description @label.text end |
#description=(text) ⇒ Object
1590 1591 1592 |
# File 'lib/libGUIb16.rb', line 1590 def description=text @label.text = text end |
#init ⇒ Object
1581 1582 1583 1584 1585 1586 1587 1588 |
# File 'lib/libGUIb16.rb', line 1581 def init @title = "Directory Dialog" @relative_path = false @directory = Dir.getwd update(@directory) @dialog = FXDirDialog.new(@topwin, @title) @browse.connect(SEL_COMMAND, method(:onBrowse)) end |
#onBrowse(*args) ⇒ Object
1598 1599 1600 1601 1602 1603 1604 |
# File 'lib/libGUIb16.rb', line 1598 def onBrowse(*args) @dialog.title = @title @dialog.directory = @directory if @dialog.execute != 0 update(@dialog.directory) end end |
#update(path) ⇒ Object
1606 1607 1608 1609 1610 1611 1612 |
# File 'lib/libGUIb16.rb', line 1606 def update(path) @directory = @textfield.text = if @relative_path rel_path(Dir.getwd, path) else path end end |