Class: Fox::FXTreeItem

Inherits:
FXObject show all
Includes:
Enumerable
Defined in:
rdoc-sources/FXTreeList.rb,
lib/fox16/core.rb,
lib/fox16/iterators.rb

Overview

Each item in an FXTreeList is an instance of FXTreeItem.

A tree item can contain zero or more child items, and those items are arranged as a linked list. The #first method returns the a reference to the first child item, if any, and the #last method returns a reference to the last child item.

Direct Known Subclasses

FXDirItem

Instance Method Summary collapse

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

#aboveObject

Return a reference to the item that is “logically” above this item.


120
# File 'rdoc-sources/FXTreeList.rb', line 120

def above; end

#belowObject

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.

Returns:

  • (Boolean)

125
# File 'rdoc-sources/FXTreeList.rb', line 125

def childOf?(item); end

#closedIconObject

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

#createObject

Create this tree item


144
# File 'rdoc-sources/FXTreeList.rb', line 144

def create; end

#dataObject

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

#destroyObject

Destroy this tree item


150
# File 'rdoc-sources/FXTreeList.rb', line 150

def destroy; end

#detachObject

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

Returns:

  • (Boolean)

86
# File 'rdoc-sources/FXTreeList.rb', line 86

def draggable? ; end

#eachObject

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

Returns:

  • (Boolean)

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 expanded=(ex); end

#expanded?Boolean

Returns true if this item is expanded

Returns:

  • (Boolean)

74
# File 'rdoc-sources/FXTreeList.rb', line 74

def expanded? ; end

#firstObject

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

Returns:

  • (Boolean)

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.

Returns:

  • (Boolean)

89
# File 'rdoc-sources/FXTreeList.rb', line 89

def hasItems?; end

#lastObject

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

#nextObject

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

#numChildrenObject

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

Returns:

  • (Boolean)

68
# File 'rdoc-sources/FXTreeList.rb', line 68

def opened? ; end

#openIconObject

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

#parentObject

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.

Returns:

  • (Boolean)

130
# File 'rdoc-sources/FXTreeList.rb', line 130

def parentOf?(item); end

#prevObject

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

Returns:

  • (Boolean)

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

#textObject

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_sObject

Returns the item's text


133
134
135
# File 'rdoc-sources/FXTreeList.rb', line 133

def to_s
  text
end