Class: Fox::FXTreeItem
- Includes:
- Enumerable
- Defined in:
- rdoc-sources/FXTreeList.rb,
lib/fox16/core.rb,
lib/fox16/iterators.rb
Overview
Direct Known Subclasses
Instance Method Summary collapse
- #<=>(otherItem) ⇒ Object
-
#above ⇒ Object
Return a reference to the item that is “logically” above this item.
-
#below ⇒ Object
Return a reference to the item that is “logically” below this item.
-
#childOf?(item) ⇒ Boolean
Return
true
if this item is a descendant of item. -
#closedIcon ⇒ Object
Return a reference to the closed-state icon (an FXIcon instance) for this tree item, or
nil
if none was specified. -
#create ⇒ Object
Create this tree item.
-
#data ⇒ Object
Return a reference to the user data for this tree item, or
nil
if no user data has been associated with this tree item. -
#data=(dt) ⇒ Object
Set the user data (a reference to any kind of object) for this tree item, or
nil
if no user data needs to be associated with this item. -
#destroy ⇒ Object
Destroy this tree item.
-
#detach ⇒ Object
Detach this tree item.
-
#draggable=(dr) ⇒ Object
Set this item’s “draggable” state to
true
orfalse
. -
#draggable? ⇒ Boolean
Returns
true
if this item is draggable. -
#each ⇒ Object
Calls block once for each child of this tree item, passing a reference to that child item as a parameter.
-
#enabled=(en) ⇒ Object
Set this item’s enabled state to
true
orfalse
. -
#enabled? ⇒ Boolean
Returns
true
if this item is enabled. -
#expanded=(ex) ⇒ Object
Set this item’s expanded state to
true
orfalse
. -
#expanded? ⇒ Boolean
Returns
true
if this item is expanded. -
#first ⇒ Object
Return a reference to the first child item for this tree item, or
nil
if this tree item has no child items. -
#getHeight(treeList) ⇒ Object
Get the height of this item.
-
#getWidth(treeList) ⇒ Object
Get the width of this item.
-
#hasFocus? ⇒ Boolean
Returns
true
if this item has the focus. -
#hasItems=(flag) ⇒ Object
Change has items flag to
true
orfalse
. -
#hasItems? ⇒ Boolean
Return
true
if this items has subitems, real or imagined. -
#initialize(text, openIcon = nil, closedIcon = nil, data = nil) ⇒ FXTreeItem
constructor
Return a new FXTreeItem instance, initialized with the specified text, open-state icon, closed-state icon and user data.
-
#last ⇒ Object
Return a reference to the last child item for this tree item, or
nil
if this tree item has no child items. -
#next ⇒ Object
Return a reference to the next sibling item for this tree item, or
nil
if this is the last item in the parent item’s list of child items. -
#numChildren ⇒ Object
Return the number of child items for this tree item.
-
#opened=(op) ⇒ Object
Set this item’s “opened” state to
true
orfalse
. -
#opened? ⇒ Boolean
Returns
true
if this item is opened. -
#openIcon ⇒ Object
Return a reference to the opened-state icon (an FXIcon instance) for this tree item, or
nil
if none was specified. -
#parent ⇒ Object
Return a reference to the parent item for this tree item, or
nil
if this is a root-level item. -
#parentOf?(item) ⇒ Boolean
Return
true
if this item is an ancestor of item. -
#prev ⇒ Object
Return a reference to the previous sibling item for this tree item, or
nil
if this is the first item in the parent item’s list of child items. -
#selected=(sel) ⇒ Object
Set this item’s selected state to
true
orfalse
. -
#selected? ⇒ Boolean
Returns
true
if this item is selected. -
#setClosedIcon(ci, owned = false) ⇒ Object
Set the closed-state icon (an FXIcon instance) for this tree item, or
nil
if no icon should be used. -
#setFocus(focus) ⇒ Object
Set the focus on this tree item (focus is either
true
orfalse
). -
#setOpenIcon(oi, owned = false) ⇒ Object
Set the opened-state icon (an FXIcon instance) for this tree item, or
nil
if no icon should be used. -
#text ⇒ Object
Return the item text (a string) for this tree item.
-
#text=(txt) ⇒ Object
Set the item text for this tree item.
-
#to_s ⇒ Object
Returns the item’s text.
Methods inherited from FXObject
#bind, #handle, #load, #save, subclasses
Constructor Details
#initialize(text, openIcon = nil, closedIcon = nil, data = nil) ⇒ FXTreeItem
Return a new FXTreeItem instance, initialized with the specified text, open-state icon, closed-state icon and user data.
16 17 |
# File 'rdoc-sources/FXTreeList.rb', line 16 def initialize(text, openIcon=nil, closedIcon=nil, data=nil) # :yields: theItem end |
Instance Method Details
#<=>(otherItem) ⇒ Object
16 17 18 |
# File 'lib/fox16/core.rb', line 16 def <=>(otherItem) text <=> otherItem.text end |
#above ⇒ Object
Return a reference to the item that is “logically” above this item.
120 |
# File 'rdoc-sources/FXTreeList.rb', line 120 def above; end |
#below ⇒ Object
Return a reference to the item that is “logically” below this item.
117 |
# File 'rdoc-sources/FXTreeList.rb', line 117 def below; end |
#childOf?(item) ⇒ Boolean
Return true
if this item is a descendant of item.
125 |
# File 'rdoc-sources/FXTreeList.rb', line 125 def childOf?(item); end |
#closedIcon ⇒ Object
Return a reference to the closed-state icon (an FXIcon instance) for this tree item, or nil
if none was specified.
38 |
# File 'rdoc-sources/FXTreeList.rb', line 38 def closedIcon; end |
#create ⇒ Object
Create this tree item
144 |
# File 'rdoc-sources/FXTreeList.rb', line 144 def create; end |
#data ⇒ Object
Return a reference to the user data for this tree item, or nil
if no user data has been associated with this tree item.
46 |
# File 'rdoc-sources/FXTreeList.rb', line 46 def data; end |
#data=(dt) ⇒ Object
Set the user data (a reference to any kind of object) for this tree item, or nil
if no user data needs to be associated with this item.
50 |
# File 'rdoc-sources/FXTreeList.rb', line 50 def data=(dt); end |
#destroy ⇒ Object
Destroy this tree item
150 |
# File 'rdoc-sources/FXTreeList.rb', line 150 def destroy; end |
#detach ⇒ Object
Detach this tree item
147 |
# File 'rdoc-sources/FXTreeList.rb', line 147 def detach; end |
#draggable=(dr) ⇒ Object
Set this item’s “draggable” state to true
or false
.
83 |
# File 'rdoc-sources/FXTreeList.rb', line 83 def draggable=(dr); end |
#draggable? ⇒ Boolean
Returns true
if this item is draggable
86 |
# File 'rdoc-sources/FXTreeList.rb', line 86 def draggable? ; end |
#each ⇒ Object
Calls block once for each child of this tree item, passing a reference to that child item as a parameter.
201 202 203 204 205 206 207 208 209 |
# File 'lib/fox16/iterators.rb', line 201 def each # :yields: aTreeItem current = first while current != nil next_current = current.next yield current current = next_current end self end |
#enabled=(en) ⇒ Object
Set this item’s enabled state to true
or false
.
77 |
# File 'rdoc-sources/FXTreeList.rb', line 77 def enabled=(en); end |
#enabled? ⇒ Boolean
Returns true
if this item is enabled
80 |
# File 'rdoc-sources/FXTreeList.rb', line 80 def enabled? ; end |
#expanded=(ex) ⇒ Object
Set this item’s expanded state to true
or false
.
71 |
# File 'rdoc-sources/FXTreeList.rb', line 71 def (ex); end |
#expanded? ⇒ Boolean
Returns true
if this item is expanded
74 |
# File 'rdoc-sources/FXTreeList.rb', line 74 def ; end |
#first ⇒ Object
Return a reference to the first child item for this tree item, or nil
if this tree item has no child items.
100 |
# File 'rdoc-sources/FXTreeList.rb', line 100 def first; end |
#getHeight(treeList) ⇒ Object
Get the height of this item
141 |
# File 'rdoc-sources/FXTreeList.rb', line 141 def getHeight(treeList) ; end |
#getWidth(treeList) ⇒ Object
Get the width of this item
138 |
# File 'rdoc-sources/FXTreeList.rb', line 138 def getWidth(treeList) ; end |
#hasFocus? ⇒ Boolean
Returns true
if this item has the focus
56 |
# File 'rdoc-sources/FXTreeList.rb', line 56 def hasFocus? ; end |
#hasItems=(flag) ⇒ Object
Change has items flag to true
or false
.
92 |
# File 'rdoc-sources/FXTreeList.rb', line 92 def hasItems=(flag); end |
#hasItems? ⇒ Boolean
Return true
if this items has subitems, real or imagined.
89 |
# File 'rdoc-sources/FXTreeList.rb', line 89 def hasItems?; end |
#last ⇒ Object
Return a reference to the last child item for this tree item, or nil
if this tree item has no child items.
104 |
# File 'rdoc-sources/FXTreeList.rb', line 104 def last; end |
#next ⇒ Object
Return a reference to the next sibling item for this tree item, or nil
if this is the last item in the parent item’s list of child items.
109 |
# File 'rdoc-sources/FXTreeList.rb', line 109 def next; end |
#numChildren ⇒ Object
Return the number of child items for this tree item.
20 |
# File 'rdoc-sources/FXTreeList.rb', line 20 def numChildren; end |
#opened=(op) ⇒ Object
Set this item’s “opened” state to true
or false
.
65 |
# File 'rdoc-sources/FXTreeList.rb', line 65 def opened=(op); end |
#opened? ⇒ Boolean
Returns true
if this item is opened
68 |
# File 'rdoc-sources/FXTreeList.rb', line 68 def opened? ; end |
#openIcon ⇒ Object
Return a reference to the opened-state icon (an FXIcon instance) for this tree item, or nil
if none was specified.
30 |
# File 'rdoc-sources/FXTreeList.rb', line 30 def openIcon; end |
#parent ⇒ Object
Return a reference to the parent item for this tree item, or nil
if this is a root-level item.
96 |
# File 'rdoc-sources/FXTreeList.rb', line 96 def parent; end |
#parentOf?(item) ⇒ Boolean
Return true
if this item is an ancestor of item.
130 |
# File 'rdoc-sources/FXTreeList.rb', line 130 def parentOf?(item); end |
#prev ⇒ Object
Return a reference to the previous sibling item for this tree item, or nil
if this is the first item in the parent item’s list of child items.
114 |
# File 'rdoc-sources/FXTreeList.rb', line 114 def prev; end |
#selected=(sel) ⇒ Object
Set this item’s selected state to true
or false
.
59 |
# File 'rdoc-sources/FXTreeList.rb', line 59 def selected=(sel); end |
#selected? ⇒ Boolean
Returns true
if this item is selected
62 |
# File 'rdoc-sources/FXTreeList.rb', line 62 def selected? ; end |
#setClosedIcon(ci, owned = false) ⇒ Object
Set the closed-state icon (an FXIcon instance) for this tree item, or nil
if no icon should be used.
42 |
# File 'rdoc-sources/FXTreeList.rb', line 42 def setClosedIcon(ci, owned=false); end |
#setFocus(focus) ⇒ Object
Set the focus on this tree item (focus is either true
or false
)
53 |
# File 'rdoc-sources/FXTreeList.rb', line 53 def setFocus(focus) ; end |
#setOpenIcon(oi, owned = false) ⇒ Object
Set the opened-state icon (an FXIcon instance) for this tree item, or nil
if no icon should be used.
34 |
# File 'rdoc-sources/FXTreeList.rb', line 34 def setOpenIcon(oi, owned=false); end |
#text ⇒ Object
Return the item text (a string) for this tree item.
23 |
# File 'rdoc-sources/FXTreeList.rb', line 23 def text; end |
#text=(txt) ⇒ Object
Set the item text for this tree item.
26 |
# File 'rdoc-sources/FXTreeList.rb', line 26 def text=(txt); end |
#to_s ⇒ Object
Returns the item’s text
133 134 135 |
# File 'rdoc-sources/FXTreeList.rb', line 133 def to_s text end |