Sage-ST ä

Ctrltree

Documentation

Global Declarations (Constants, Types, Variables)
AddItem ControlCommand CurrentControlID
CurrentDialogID DeleteItem DisableControl EnableControl
ExpandTheItem GetBmpIndex GetItemHandle GetItemInfo
GetSelectedItemInfo HideControl IsEnabled ModifyItem
ModifyItemBitmaps RedrawControl SelectItem SetBmpID
SetFocus SetRange ShowControl





  type ControlMessage is (Unknown,    -- Unknown command
                          FindItem,   -- Get the bitmapID for a user defined bmp

                          -- related procedures -> GetBmpIndex, SetBmpID
                          RangeMsg,   -- Get the # of user defined bitmaps

                          -- related procedures -> SetRange
                          SelectedChange,   -- The user has clicked on a new item

                          -- related procedures -> GetSelectedItemInfo
                          ExpandItem,     -- The item is being expanded
                          CollapseItem,   -- The item is being collapsed
                          HasFocus);      -- The control has gained focus

  type ExpandMethod is (Collapse,
                        CollapseReset,
                        Expand,
                        Toggle);

  type ItemRequestType is (Selected,
                           FirstChild,
                           DropTarget,
                           FirstVisible,
                           NextSibling,
                           NextVisible,
                           Parent,
                           PreviousSibling,
                           PreviousVisible,
                           Root);
  TreeRoot        : constant := WinSys.TVI_ROOT;
  TreeFirst       : constant := WinSys.TVI_FIRST;
  TreeLast        : constant := WinSys.TVI_LAST;
  TreeSort        : constant := WinSys.TVI_SORT;
  TreeNull        : constant := WinSys.NULL_HTREEITEM;




  function ControlCommand
            (msgType : in     DisplayW.DisplayMessageType;
             msgData : in     System.Address) return ControlMessage;

  --*
  --  ControlCommand - Retrieves a command which has been sent from control.
  --
  --
  --  This routine will retrieve a command which has been sent from the
  --  control to the ActionProc.
  --
  --  CALLING SEQUENCE -
  --
  --    command := ControlCommand (msgType, msgData)
  --
  --  ENTRY -
  --
  --    msgType : DisplayW.DisplayMessageType
  --      The msgType parameter which was passed into the ActionProc.
  --
  --    msgData : System.Address
  --      The msgData parameter which was passed into the ActionProc.
  --
  --  EXIT -
  --
  --    command : ControlMessage
  --      The command which has been sent.  Must be one of the Control
  --      Messages defined for the control receiving the command.  The
  --      command Unknown indicates an undefined command has been sent.
  --




  function CurrentDialogID
            (msgData : in     System.Address) return ModSys.S_Natural;

  --*
  --  CurrentDialogID - Retrieves the ID of a dialog to which a message was sent.
  --
  --
  --  This routine will retrieve a the ID of a dialog to which a message
  --  has been sent.
  --
  --  CALLING SEQUENCE -
  --
  --    DialogId := CurrentDialogID (msgData)
  --
  --  ENTRY -
  --
  --    msgData : System.Address
  --      The msgData parameter which was passed into the ActionProc.
  --
  --  EXIT -
  --
  --    DialogId : Modsys.S_Natural
  --      The ID of the dialog receiving a message.
  --




  function CurrentControlID
            (msgData : in     System.Address) return ModSys.S_Natural;

  --*
  --  CurrentControlID - Retrieves the ID of a control for which a message is intended.
  --
  --
  --  This routine will retrieve the ID of a control for which a message
  --  is intended.
  --
  --  CALLING SEQUENCE -
  --
  --    ControlId := CurrentControlID (msgData)
  --
  --  ENTRY -
  --
  --    msgData : System.Address
  --      The msgData parameter which was passed into the ActionProc.
  --
  --  EXIT -
  --
  --    ControlId : Modsys.S_Natural
  --      The ID of the control.
  --




  function IsEnabled
            (dialogID  : in     ModSys.S_Natural;
             controlID : in     ModSys.S_Natural) return boolean;

  --*
  --  IsEnabled - Checks to see if a control is enabled.
  --
  --
  --  This routine will determine whether a control is enabled or
  --  disabled (grayed).
  --
  --  CALLING SEQUENCE -
  --
  --    status := IsEnabled (DialogId, ControlId)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --          control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --  EXIT -
  --
  --    status : boolean
  --      TRUE if the control is enabled.
  --




  procedure EnableControl
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural);

  --*
  --  EnableControl - Enables a control.
  --
  --
  --  This routine will enable the specified control.
  --
  --  CALLING SEQUENCE -
  --
  --    EnableControl (DialogId, ControlId)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure DisableControl
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural);

  --*
  --  DisableControl - Disables a control.
  --
  --
  --  This routine will disable (gray) the specified control.
  --
  --  CALLING SEQUENCE -
  --
  --    DisableControl (DialogId, ControlId)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure HideControl
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural);

  --*
  --  HideControl - Hides a control.
  --
  --
  --  This routine will hide the specified control.
  --
  --  CALLING SEQUENCE -
  --
  --    HideControl (DialogId, ControlId)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure ShowControl
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural);

  --*
  --  ShowControl - Shows a control.
  --
  --
  --  This routine will show the specified control.
  --
  --  CALLING SEQUENCE -
  --
  --    ShowControl (DialogId, ControlId)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure SetFocus
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural);

  --*
  --  SetFocus - Sets to focus to a control.
  --
  --
  --  This routine will give the specified control focus.
  --
  --  CALLING SEQUENCE -
  --
  --    SetFocus (DialogId, ControlId)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure RedrawControl
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural);

  --*
  --  RedrawControl - Redraws a control.
  --
  --
  --  This routine will redraw the specified control.
  --
  --  CALLING SEQUENCE -
  --
  --    RedrawControl (DialogId, ControlId)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure AddItem
             (dialogID      : in     ModSys.S_Natural;
              controlID     : in     ModSys.S_Natural;
              Parent        : in     DisplayW.TreeItemHandle;
              insAfter      : in     DisplayW.TreeItemHandle;
              Value         : in     string;
              bitmapIndex   : in     ModSys.S_Natural;
              selectedIndex : in     ModSys.S_Natural;
              thisItem      : in out DisplayW.TreeItemHandle);

  --*
  --  AddItem - Adds an item to a SageTree.
  --
  --
  --  This routine will add an item to a SageTree.
  --
  --  CALLING SEQUENCE -
  --
  --    AddItem (DialogId, ControlId, parent, insAfter, value, bitmapIndex,
  --             thisItem)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --    parent : DisplayW.TreeItemHandle
  --      The handle of the parent of the item to add.  Set to NIL
  --      if adding an item to the root of the tree.
  --
  --    insAfter : DisplayW.TreeItemHandle
  --      The handle of the sibling prior to the item to add.  Mey be
  --      one of the following types -
  --
  --        TreeRoot  The start of the tree.
  --        TreeFirst The first item in the tree.
  --        TreeLast  The last item in the tree.
  --
  --    value : string
  --      The item text.
  --
  --    bitmapIndex : ModSys.S_Natural
  --      If the bitmap style in the resource is set to <user defined>,
  --      then set this to the List ID of the bitmap to show with the
  --      item.  Otherwise, set to 0.
  --
  --    selectedIndex : ModSys.S_Natural
  --      If the bitmap style in the resource is set to <user defined>,
  --      then set this to the List ID of the bitmap to show when the
  --      item is selected.  Otherwise, set to 0.
  --
  --  EXIT -
  --
  --    thisItem : DisplayW.TreeItemHandle
  --      The handle of the item which has been added.
  --




  procedure DeleteItem
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural;
              thisItem  : in     DisplayW.TreeItemHandle);

  --*
  --  DeleteItem - Deletes an item from a SageTree.
  --
  --
  --  This routine will delete an item from a SageTree.
  --
  --  CALLING SEQUENCE -
  --
  --    DeleteItem (DialogId, ControlId, thisItem)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --    thisItem : DisplayW.TreeItemHandle
  --      The handle of the item to delete.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  function GetBmpIndex
            (msgType : in     DisplayW.DisplayMessageType;
             msgData : in     System.Address) return ModSys.S_Natural;

  --*
  --  GetBmpIndex - Get the index position of bitmap requested by FindItem msg.
  --
  --
  --  The FindItem message is sent when the programmer has specified in
  --  the resource file that they wish to use user defined bitmaps.
  --  The SageTree will build a list of all the bitmaps to be used with
  --  the SageTree control.  This list will contain a list index (0..n-1)
  --  and its associated bitmap ID from the resource file.  The programmer
  --  will use the list index to refer to the bitmap when adding items
  --  to the tree.  The FindItem message is received once for each bitmap
  --  the programmer specified in the SetRange routine.  This routine is
  --  used to get the list index of the bitmap that the SageTree is
  --  requesting.  The programmer uses this index to determine which bitmap
  --  ID should be sent to the SageTree using the SetBmpID routine.  Bitmaps
  --  must be 16x16 in size.
  --
  --  CALLING SEQUENCE -
  --
  --    index := GetBmpIndex (msgType, msgData)
  --
  --  ENTRY -
  --
  --    msgType : DisplayW.DisplayMessageType
  --      The msgType parameter which was passed into the ActionProc.
  --
  --    msgData : System.Address
  --      The msgData parameter which was passed into the ActionProc.
  --
  --  EXIT -
  --
  --    index : ModSys.S_Natural
  --      The list index of the bitmap that the SageTree is requesting.
  --




  procedure GetItemHandle
             (dialogID    : in     ModSys.S_Natural;
              controlID   : in     ModSys.S_Natural;
              thisItem    : in     DisplayW.TreeItemHandle;
              itemRequest : in     ItemRequestType;
              returnItem  : in out DisplayW.TreeItemHandle);

  --*
  --  GetItemHandle - Gets the handle of the specified tree item.
  --
  --
  --  This routine provides the ability to retreive the handle to an item
  --  in the tree control.
  --
  --  CALLING SEQUENCE -
  --
  --    GetItemHandle (DialogId, ControlId, thisItem, itemRequest, returnItem)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --    thisItem : DisplayW.TreeItemHandle
  --      The handle to a tree item which may be used as a point of
  --      reference in performing the search requested by the
  --      itemRequest flag.
  --
  --    itemRequest : ItemRequestType
  --      Must be one of the following -
  --        Selected        - Returns the handle of the currently selected
  --                          tree item.
  --        FirstChild      - Returns the handle of the first child item.
  --        DropTarget      - Returns the handle of the item which is the target
  --                          of a drag and drop operation.
  --        FirstVisible    - Returns the handle of the first visible item.
  --        NextSibling     - Returns the handle of the next sibling of the
  --                          item identified by the thisItem handle.
  --        NextVisible     - Returns the handle of the next visible item
  --                          following the item specified by the thisItem
  --                          handle.
  --        Parent          - Returns the handle of the parent of the item
  --                          specified by the thisItem handle.
  --        PreviousSibling - Returns the handle of the previous sibling of
  --                          the item identified by the thisItem handle.
  --        PreviousVisible - Returns the handle of the visible item previous
  --                          to the item specified by the thisITem handle.
  --        Root            - Returns the handle of the topmost item in the
  --                          tree control.
  --
  --  EXIT -
  --
  --    returnItem : DisplayW.TreeItemHandle
  --      The handle of the requested tree item.
  --




  procedure GetItemInfo
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural;
              thisItem  : in     DisplayW.TreeItemHandle;
              Parent    : in out DisplayW.TreeItemHandle;
              insAfter  : in out DisplayW.TreeItemHandle;
              Value     : in out string);

  --*
  --  GetItemInfo - Get information about a SageTree item.
  --
  --
  --  This routine will return the parent, sibling, and value of an
  --  item in a SageTree.
  --
  --  CALLING SEQUENCE -
  --
  --    GetItemInfo (DialogId, ControlId, thisItem, parent, insAfter, value)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --    thisItem : DisplayW.TreeItemHandle
  --      The handle of the item to get information about.
  --
  --  EXIT -
  --
  --    parent : DisplayW.TreeItemHandle
  --      The handle of the parent of the item.
  --
  --    insAfter : DisplayW.TreeItemHandle
  --      The handle of the sibling prior to the item.
  --
  --    value : string
  --      The text string associated with the tree item.
  --




  procedure GetSelectedItemInfo
             (msgType       : in     DisplayW.DisplayMessageType;
              msgData       : in     System.Address;
              Parent        : in out DisplayW.TreeItemHandle;
              insAfter      : in out DisplayW.TreeItemHandle;
              thisItem      : in out DisplayW.TreeItemHandle;
              Value         : in out string;
              bitmapIndex   : in out ModSys.S_Natural;
              selectedIndex : in out ModSys.S_Natural);

  --*
  --  GetSelectedItemInfo - Get information about the selected SageTree item.
  --
  --
  --  The SelectedChange message is sent when the user has selected an
  --  item in the SageTree.  This routine can be used to get information
  --  about the item which has been selected.
  --
  --  CALLING SEQUENCE -
  --
  --    GetSelectedITemInfo (msgType, msgData, parent, insAfter, thisItem, value,
  --                         bitmapIndex)
  --
  --  ENTRY -
  --
  --    msgType : DisplayW.DisplayMessageType
  --      The msgType parameter which was passed into the ActionProc.
  --
  --    msgData : System.Address
  --      The msgData parameter which was passed into the ActionProc.
  --
  --  EXIT -
  --
  --    parent : DisplayW.TreeItemHandle
  --      The handle of the parent of the selected item.
  --
  --    insAfter : DisplayW.TreeItemHandle
  --      The handle of the sibling prior to the selected item.
  --
  --    thisItem : DisplayW.TreeItemHandle
  --      The handle of the selected item.
  --
  --    value : string
  --      The text string associated with the selected item.
  --
  --    bitmapIndex : ModSys.S_Natural
  --      The bitmap list index of the selected item.
  --
  --    selectedIndex : ModSys.S_Natural
  --      The bitmap list index of the bitmap used when the selected item is in the
  --      selected state.
  --




  procedure ModifyItemBitmaps
             (dialogID      : in     ModSys.S_Natural;
              controlID     : in     ModSys.S_Natural;
              thisItem      : in     DisplayW.TreeItemHandle;
              bitmapIndex   : in     ModSys.S_Natural;
              selectedIndex : in     ModSys.S_Natural);

  --*
  --  ModifyItemBitmaps - Modifies item bitmaps in a SageTree.
  --
  --
  --  This routine will replace the bitmaps in an item in
  --  a SageTree.
  --
  --  CALLING SEQUENCE -
  --
  --    ModifyItemBitmaps (DialogId, ControlId, thisItem, bitmapIndex, selectedIndex)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --    thisItem : TreeItemHandle
  --      The handle of the item to modify.
  --
  --    bitmapIndex : ModSys.S_Natural
  --      The bitmap list index of the item.
  --
  --    selectedIndex : ModSys.S_Natural
  --      The bitmap list index of the bitmap used when the item is in the
  --      selected state.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure ModifyItem
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural;
              thisItem  : in     DisplayW.TreeItemHandle;
              Value     : in     string);

  --*
  --  ModifyItem - Modifies an item in a SageTree.
  --
  --
  --  This routine will replace the text in an item in
  --  a SageTree.
  --
  --  CALLING SEQUENCE -
  --
  --    ModifyItem (DialogId, ControlId, thisItem, value)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --    thisItem : DisplayW.TreeItemHandle
  --      The handle of the item to modify.
  --
  --    value : string
  --      The text string to be associated with the tree item.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure SelectItem
             (dialogID  : in     ModSys.S_Natural;
              controlID : in     ModSys.S_Natural;
              thisItem  : in     DisplayW.TreeItemHandle);

  --*
  --  SelectItem - Selects an item from a SageTree.
  --
  --
  --  This routine will select an item in a SageTree.
  --
  --  CALLING SEQUENCE -
  --
  --    SelectItem (DialogId, ControlId, thisItem)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --    thisItem : DisplayW.TreeItemHandle
  --      The handle of the item to select.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure ExpandTheItem
             (dialogID   : in     ModSys.S_Natural;
              controlID  : in     ModSys.S_Natural;
              thisItem   : in     DisplayW.TreeItemHandle;
              expandType : in     ExpandMethod);

  --*
  --  ExpandTheItem - Expands or collapse the specified item in a SageTree.
  --
  --
  --  This routine will expand the specified item in a SageTree.
  --
  --  CALLING SEQUENCE -
  --
  --    ExpandTheItem (DialogId, ControlId, thisItem, expandType)
  --
  --  ENTRY -
  --
  --    DialogId : Modsys.S_Natural
  --      The number of the dialog box or window containing the
  --      control.
  --
  --    ControlId : Modsys.S_Natural
  --      The control resource identifier.
  --
  --    thisItem : TreeItemHandle
  --      The handle of the item to select.
  --
  --    expandType : ExpandMethod
  --      The method to be used to expand/collapse the tree.
  --      If expandType is "Collapse" then the item is collapsed.
  --      If expandType is "CollapseReset" then the item is collapsed and children removed.
  --      If expandType is "Expand" then the item is expanded.
  --      If expandType is "Toggle" then the item is toggled.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure SetBmpID
             (msgType   : in     DisplayW.DisplayMessageType;
              msgData   : in     System.Address;
              userBmpID : in     ModSys.S_Natural);

  --*
  --  SetBmpID - Set the bitmap ID of the bitmap requested by FindItem msg.
  --
  --
  --  The FindItem message is sent when the programmer has specified in
  --  the resource file that they wish to use user defined bitmaps.
  --  The SageTree will build a list of all the bitmaps to be used with
  --  the SageTree control.  This list will contain a list index (0..n-1)
  --  and their associated bitmap IDs from the resource file.  The
  --  programmer will use the list index to refer to the bitmap when
  --  adding items to the tree.  The FindItem message is received once
  --  for each bitmap the programmer specified in the SetRange routine.
  --  This routine is used to set the bitmap ID at the list position
  --  specified by the return value of the routine GetBmpIndex.
  --
  --  CALLING SEQUENCE -
  --
  --    SetBmpIndex (msgType, msgData, userBmpID)
  --
  --  ENTRY -
  --
  --    msgType : DisplayW.DisplayMessageType
  --      The msgType parameter which was passed into the ActionProc.
  --
  --    msgData : System.Address
  --      The msgData parameter which was passed into the ActionProc.
  --
  --    userBmpID : ModSys.S_Natural
  --      The resource ID of the bitmap to be placed in the bitmap list
  --      at the position indicated by GetBmpIndex.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




  procedure SetRange
             (msgType      : in     DisplayW.DisplayMessageType;
              msgData      : in     System.Address;
              userBmpTotal : in     ModSys.S_Natural);

  --*
  --  SetRange - Set number of user defined bitmaps to be used with a tree.
  --
  --
  --  The Range message is sent when the programmer has specified in the
  --  resource file that they wish to use user defined bitmaps.  This
  --  routine is used to return the number of bitmaps that they plan to use
  --  for the SageTree.
  --
  --  CALLING SEQUENCE -
  --
  --    SetRange (msgType, msgData, userBMPTotal)
  --
  --  ENTRY -
  --
  --    msgType : DisplayW.DisplayMessageType
  --      The msgType parameter which was passed into the ActionProc.
  --
  --    msgData : System.Address
  --      The msgData parameter which was passed into the ActionProc.
  --
  --    userBMPTotal : ModSys.S_Natural
  --      The number of user defined bitmaps that will be used with the
  --      SageTree.
  --
  --  EXIT -
  --
  --    None
  --      N/A
  --




Send mail to   warren.merrill@inl.gov with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance