Package RASCAL.ToolboxTreeView

DescriptionToolboxTreeView related types and methods.
Authorbbracke
Date2005/11/21 20:14:33
Revision1.1
 

Clauses

Quick access : ClausesGenericsDefinitionsSubprograms


 
Context clauses
System
System.Unsigned_Types
RASCAL.Toolbox
RASCAL.OS
RASCAL.Sprite
 
Use clauses
System
System.Unsigned_Types
RASCAL.Toolbox
RASCAL.OS
RASCAL.Sprite
 

Basic Objects

Quick access : ClausesGenericsDefinitionsSubprograms


Basic Objects
Name Type Default
TreeView_AddNode_NoData2#0000000000000010#constant
Flags
TreeView_AddNode_AsChild2#0000000000000001#constant
TreeView_AddNode_AsSibling2#0000000000000000#constant
TreeView_NodeSelected_Selected2#0000000000000001#constant
TreeView_NodeSelected_Multiple2#0000000000000010#constant
TreeView_AllowVScroll2#0000000000000001#constant
TreeView_AllowHScroll2#0000000000000010#constant
TreeView_AutoUpdate2#0000000000000100#constant
TreeView_Show_CurrentNode2#0000000000001000#constant
TreeView_PlotLines2#0000000000010000#constant
TreeView_AllowSelection2#0000000000100000#constant
TreeView_NotifySelection2#0000000001000000#constant
TreeView_SelectChildren2#0000000010000000#constant
TreeView_AllowExpand2#0000000100000000#constant
TreeView_NotifyExpansion2#0000001000000000#constant
TreeView_ExpandByDefault2#0000010000000000#constant
TreeView_AllowRename2#0000100000000000#constant
TreeView_NotifyRename2#0001000000000000#constant
TreeView_AllowDrags2#0010000000000000#constant
TreeView_NotifyDragEnd2#0100000000000000#constant
TreeView_AllEvents2#1000000000000000#constant
TreeView_NodeExpanded_Expanded2#0000000000000001#constant
TreeView_NodeExpanded_NodeDragged_OutsideGadget2#0000000000000001#constant
 

Definitions

Quick access : ClausesGenericsDefinitionsSubprograms


Types
Name Declaration
Node_List_Typearray (natural) of Integer
Node_List_Pointeraccess Node_List_Type
Toolbox_TreeView_NodeSelected_Pointeraccess Toolbox_TreeView_NodeSelected
Toolbox_TreeView_NodeExpanded_Pointeraccess Toolbox_TreeView_NodeExpanded
Toolbox_TreeView_NodeRenamed_Pointeraccess Toolbox_TreeView_NodeRenamed
Toolbox_TreeView_NodeDataRequired_Pointeraccess Toolbox_TreeView_NodeDataRequired
Toolbox_TreeView_NodeDragged_Pointeraccess Toolbox_TreeView_NodeDragged
   
Toolbox_TreeView_NodeSelected record
Event which is sent when a node is selected or deselected.
Flag bit 0 is {/}set{/} for a selection and {/}unset{/} for a deselectio.
If the tree has the 'Select Children' flag set, and this selection caused more than one node to change selection state, flag bit 1 is set.
Component Type Default
NodeInteger
FlagsSystem.Unsigned_Types.unsigned
HeaderToolbox_Event_Header
   
ATEL_Toolbox_TreeView_NodeSelected abstract tagged record
inheritance from Toolbox_EventListener (Toolbox_Event_TreeViewNodeSelected, -1, -1)
Component Type Default
EventToolbox_TreeView_NodeSelected_Pointer
   
Toolbox_TreeView_NodeExpanded record
Event which is sent when a node is expanded or unexpanded.
Flag bit 0 is {/}set{/} if the node was expanded, and zero otherwise.
Component Type Default
NodeInteger
FlagsSystem.Unsigned_Types.unsigned
HeaderToolbox_Event_Header
   
ATEL_Toolbox_TreeView_NodeExpanded abstract tagged record
inheritance from Toolbox_EventListener (Toolbox_Event_TreeViewNodeExpanded, -1, -1)
Component Type Default
EventToolbox_TreeView_NodeExpanded_Pointer
   
Toolbox_TreeView_NodeRenamed record
Component Type Default
NodeInteger
FlagsSystem.Unsigned_Types.unsigned
HeaderToolbox_Event_Header
   
ATEL_Toolbox_TreeView_NodeRenamed abstract tagged record
inheritance from Toolbox_EventListener (Toolbox_Event_TreeViewNodeRenamed, -1, -1)
Component Type Default
EventToolbox_TreeView_NodeRenamed_Pointer
   
Toolbox_TreeView_NodeDataRequired record
Component Type Default
NodeInteger
FlagsSystem.Unsigned_Types.unsigned
HeaderToolbox_Event_Header
   
ATEL_Toolbox_TreeView_NodeDataRequired abstract tagged record
inheritance from Toolbox_EventListener (Toolbox_Event_TreeViewNodeDataRequired, -1, -1)
Component Type Default
EventToolbox_TreeView_NodeDataRequired_Pointer
   
Toolbox_TreeView_NodeDragged record
Sent when a node is dragged (if the 'Notify Drag' flag is set).
Bit 0 of the flags word is set if the drag ended outside the TreeView gadget, otherwise it is zero.
{/}Destination_Node{/} is the node handle that the drag ended on if it ended inside the gadget. If the drag didn't end on a node, this is Zero.
Component Type Default
PointerAddress
Destination_NodeInteger
NodeInteger
FlagsSystem.Unsigned_Types.unsigned
HeaderToolbox_Event_Header
   
ATEL_Toolbox_TreeView_NodeDragged abstract tagged record
inheritance from Toolbox_EventListener (Toolbox_Event_TreeViewNodeDragged, -1, -1)
Component Type Default
EventToolbox_TreeView_NodeDragged_Pointer
  
Exceptions
Empty_Tree
  
Pragmas
Convention(C, Toolbox_TreeView_NodeSelected)
Convention(C, Toolbox_TreeView_NodeExpanded)
Convention(C, Toolbox_TreeView_NodeRenamed)
Convention(C, Toolbox_TreeView_NodeDataRequired)
Convention(C, Toolbox_TreeView_NodeDragged)
 

Subprograms

Quick access : ClausesGenericsDefinitionsSubprograms


  
Set_State procedure
Sets the TreeView_Flags.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
StateSystem.Unsigned_Types.unsignedin
FlagsSystem.Unsigned_Types.unsignedin0
  
Get_State function
ReturnSystem.Unsigned_Types.unsigned
Returns the current TreeView_Flags.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Add_Node function
Returninteger
Adds a new node after the current one.
If the TreeView_AutoUpdate flag is not set, changes will not be visible until TreeView_UpdateDisplay is called.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
TextStringin
FlagsSystem.Unsigned_Types.unsignedin0
  
Get_NodeID function
Returninteger
Returns a unique 32 bit handle for the current node.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Set_NodeText procedure
Sets the text for the current node. You can set it to NULL (0) for no text.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
TextStringin
FlagsSystem.Unsigned_Types.unsignedin0
  
Set_NodeSprite procedure
Specifies a sprite to use for a node in the tree.
You can use a sprite in your own area in which case supply the sprite area pointer, or a sprite in the wimp pool in which case supply a sprite area pointer of 1.
The expanded sprite is the sprite used when the node has an expanded child. Supply NULL in this parameter if you don't want an expanded sprite.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
NameStringin
Exp_NameStringin""
Sprite_AreaSprite_Area_Ptrinnull
FlagsSystem.Unsigned_Types.unsignedin0
  
Set_NodePrivateWord procedure
Sets the private word of the current node. This is a 32 bit value that you can use to signify anything you like. It is not used by the TreeView.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
Wordintegerin
FlagsSystem.Unsigned_Types.unsignedin0
  
Get_NodeText function
ReturnString
Copies the current node's text into a buffer, or if the pointer to the buffer passed to the method is NULL, returns the size of buffer required to hold the node's text.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Get_NodeSprite function
ReturnString
Copies the current node's sprite name into a buffer. If flag bit 0 is set the expanded sprite name is copied, otherwise the normal one is.
If the supplied buffer pointer is NULL, the size of buffer required to hold the sprite name is returned.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Get_NodePrivateWord function
Returninteger
Returns the current node's private word.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Move_To procedure
Sets the current node to the one specified by the unique handle. This is the handle as returned from TreeView_GetNodeID.
WARNING - trying to move to a non existant node is not yet fully trapped.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
NodeIntegerin
FlagsSystem.Unsigned_Types.unsignedin0
  
Move_Next function
Returninteger
Sets the current node to its next sibling. If there is no next node, an error is returned and the current node does not change.
The returned value is the unique id of the new current node.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Move_Previous function
Returninteger
Sets the current node to its previous sibling. If there is no previous node, an error is returned and the current node does not change.
The returned value is the unique id of the new current node.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Move_Child function
Returninteger
Sets the current node to the current node's child. If the current node has no child, an error (-1) is returned and the current node does not change.
The returned value is the unique id of the new current node.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Move_Parent function
Returninteger
Sets the current node to the current node's parent. Note that all nodes have a parent.
The parent of the root node of a tree is itself. The returned value is the unique id of the new current node.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Delete_Node function
Returninteger
Deletes the current node, and any descendants it has ({/}ie{/} its child and any nodes connected to the child).
If the {/}TreeView_AutoUpdate{/} flag is not set, changes will not be visible until TreeView_UpdateDisplay is called.
The returned value is the unique id of the new current node.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Delete_All procedure
Deletes the entire tree.
If the {/}TreeView_AutoUpdate{/} flag is not set, changes will not be visible until TreeView_UpdateDisplay is called.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Update_Display procedure
Ensures the gadget's display is up to date.
If the {/}TreeView_AutoUpdate{/} flag is set, the gadget will update itself after every change.
However this could be {/}really slow{/} if you are adding large numbers of nodes all at once.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Move_FirstSelected function
Returninteger
Moves the current node to the first selected node. Returns an error if there is no selection.
This call in combination with TreeView_MoveNextSelected allows you to enumerate through all the selected nodes in a tree.
The returned value is the unique id of the new current node.
Note that the "first" selected node is not necessarily the node nearest to the top of the tree.
The only guarantee is that enumerating through the selected nodes using this call will visit each selected node exactly once.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Move_NextSelected function
Returninteger
Moves the current node to the next selected node.
Returns an error if there is no such node, otherwise returns the unique id of the new current node.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Is_Empty function
Returnboolean
Return true if the tree is empty.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Is_Selection function
ReturnBoolean
Has any item been selected ? Preserves current node setting.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Count_Selections function
ReturnInteger
Returns the number of currently selected nodes. Current node setting is preserved.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Get_Selections function
ReturnNode_list_Type
Returns an array containing the id numbers of all selected nodes. Current node setting is preserved.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.unsignedin0
  
Count_Children function
ReturnInteger
Returns the number of nodes in a tree. Current node setting is preserved.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
NodeIntegerin
FlagsSystem.Unsigned_Types.unsignedin0
  
Get_Children function
ReturnNode_List_Type
Returns an array with ids for all nodes in a tree. Current node setting is preserved.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
NodeIntegerin
FlagsSystem.Unsigned_Types.unsignedin0
  
Get_Root function
ReturnInteger
Returns the node id of the root which also becomes the current node.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.Unsignedin0
  
Is_Root function
ReturnBoolean
Returns true if the current node is the root of the tree. It remains current root even if its not the root.
Parameter name Type Mode Default
WindowObject_IDin
ComponentComponent_IDin
FlagsSystem.Unsigned_Types.Unsignedin0