home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 114 / af114sub.adf / GadToolsBox3.lzx / GadToolsBox3 / Developers / listview.gadget / include / gadgets / listview.h
Encoding:
C/C++ Source or Header  |  1997-12-24  |  2.0 KB  |  77 lines

  1. #ifndef GADGETS_LISTVIEW_H
  2. #define GADGETS_LISTVIEW_H
  3. /*
  4. **    $VER: listview.h 37.0 (13.2.96)
  5. **
  6. **    Definitions for the listview BOOPSI class
  7. **
  8. **    (C) Copyright 1997 Tomasz Muszynski.
  9. **    All Rights Reserved
  10. */
  11.  
  12. /*****************************************************************************/
  13.  
  14.  
  15. #ifndef UTILITY_TAGITEM_H
  16. #include <utility/tagitem.h>
  17. #endif
  18.  
  19.  
  20. /*****************************************************************************/
  21.  
  22. #define LISTVIEWNAME "gadgets/listview.gadget"
  23. #define LISTVIEWVERSION 37
  24.  
  25. /* ListView structures - compatible with system lists & nodes */
  26. struct LVList
  27. {
  28.     struct LVNode *lh_Head;
  29.     struct LVNode *lh_Tail;
  30.     struct LVNode *lh_TailPred;
  31. };
  32.  
  33. struct LVNode
  34. {
  35.     struct LVNode *ln_Succ;        // Link list (left leaf)
  36.     struct LVNode *ln_Pred;        // Link list (prev node/parent)
  37.     UWORD ln_Flags;                        // See below
  38.     STRPTR ln_Name;                        // PTR node name
  39.     struct LVNode *ln_Sub;        // Sub list (right leaf) - for tree list view
  40.     struct LVNode *ln_Parent;    // Parent Node
  41.     UBYTE ln_Indent;                    // Sub Node Indent
  42. }; /* Note: Word aligned */
  43.  
  44. /* defines for tree compatibility */
  45. #define ln_Left ln_Succ
  46. #define ln_Right ln_Sub
  47.  
  48. #define Tree_IsListEmpty(x) \
  49.     ( ((x)->lh_TailPred) == (struct LVNode *)(x) )
  50.  
  51. /* ln_Flags */
  52. #define LV_SELECT (1<<0)    // Node is selected
  53. #define LV_OPEN    (1<<1)        // Node is opened
  54.  
  55. /* tags */
  56. #define LIST_Dummy        (TAG_USER+0x00001000)
  57. #define LIST_Top    (LIST_Dummy+1)
  58. #define LIST_MakeVisible (LIST_Dummy+2)
  59. #define LIST_Labels (LIST_Dummy+3)
  60. #define LIST_ReadOnly (LIST_Dummy+4)
  61. #define LIST_Border (LIST_Dummy+5)
  62. #define LIST_Selected (LIST_Dummy+6)
  63. #define LIST_Columns (LIST_Dummy+7)
  64. #define LIST_MultiSelect (LIST_Dummy+8)
  65. #define LIST_TextFont (LIST_Dummy+9)
  66. #define LIST_ShowTreeLines (LIST_Dummy+10)
  67. #define LIST_TabChar (LIST_Dummy+11)
  68. #define LIST_Format (LIST_Dummy+12)
  69. #define LIST_ShowSelected (LIST_Dummy+13)
  70. #define LIST_Visible (LIST_Dummy+14)
  71. #define LIST_Total (LIST_Dummy+15)
  72. #define LIST_IsTree (LIST_Dummy+16)
  73.  
  74. /*****************************************************************************/
  75.  
  76. #endif /* GADGETS_LISTVIEW_H */
  77.