home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / fish / 911-930 / ff911 / gadlayout / gadlayout.h < prev    next >
C/C++ Source or Header  |  1994-05-04  |  7KB  |  201 lines

  1. #ifndef GADLAYOUT_GADLAYOUT_H
  2. #define GADLAYOUT_GADLAYOUT_H
  3. /*
  4. **    $Filename: gadlayout/gadlayout.h $
  5. **    $Release: 1.6 $
  6. **    $Revision: 36.9 $
  7. **    $Date: 93/05/06 $
  8. **
  9. **    GadLayout definitions, a dynamic gadget layout system.
  10. **
  11. **    (C) Copyright 1992, 1993 by Timothy J. Aston
  12. **    All Rights Reserved
  13. */
  14.  
  15. /*------------------------------------------------------------------------*/
  16.  
  17. #ifndef EXEC_TYPES_H
  18. #include <exec/types.h>
  19. #endif
  20.  
  21. #ifndef UTILITY_TAGITEM_H
  22. #include <utility/tagitem.h>
  23. #endif
  24.  
  25. #ifndef INTUITION_INTUITION_H
  26. #include <intuition/intuition.h>
  27. #endif
  28.  
  29. /*------------------------------------------------------------------------*/
  30.  
  31. /* Extended gadget types available in GadLayout.
  32.  */
  33. #define IMAGEBUTTON_KIND 50
  34. #define BORDERBUTTON_KIND 51                /* Not implemented */
  35. #define DRAWER_KIND 52
  36. #define FILE_KIND 53
  37.  
  38. #define IMAGE_KIND IMAGEBUTTON_KIND        /* Obsolete! */
  39. #define BORDER_KIND BORDERBUTTON_KIND        /* Obsolete! */
  40.  
  41. /*------------------------------------------------------------------------*/
  42.  
  43. /* This is the structure that actually holds the definition of a single
  44.  * gadget.  It contains the new layout tags defined below, as well as the
  45.  * normal GadTools tags.  You setup all the gadgets in a window by
  46.  * making an array of this structure and passing it to LayoutGadgets().
  47.  */
  48. struct LayoutGadget
  49. {
  50.     WORD lg_GadgetID;
  51.     struct TagItem *lg_LayoutTags;
  52.     struct TagItem *lg_GadToolsTags;
  53.     struct Gadget *lg_Gadget;
  54. };
  55.  
  56. /*------------------------------------------------------------------------*/
  57.  
  58. /* GadLayout is basically an extension to the GadTools gadget toolbox.
  59.  * It adds to GadTools the ability to dynamically layout gadgets according
  60.  * to the positions of other gadgets, font size, locale, etc.  The goal in
  61.  * designing this was to create a system so that programmers could easily
  62.  * create a GUI that automatically adjusted to a user's environment.
  63.  *
  64.  * Every gadget is now defined as a TagList, there is no more need to
  65.  * make use of the NewGadget structure as this taglist allows you to
  66.  * access all fields used in that structure.  An array of the TagLists for
  67.  * all your window's gadgets is then passed to LayoutGadgets() and your
  68.  * gadget list is created.
  69.  */
  70.  
  71. #define GL_TagBase         TAG_USER + 0x50000
  72.  
  73. /* Define which kind of gadget we are going to have.
  74.  */
  75. #define GL_GadgetKind    GL_TagBase+1    /* Which kind of gadget to make. */
  76.  
  77. /* Gadget width control.
  78.  */
  79. #define GL_Width        GL_TagBase+3    /* Absolute gadget width. */
  80. #define GL_DupeWidth    GL_TagBase+4    /* Duplicate the width of another
  81.                                          * gadget.
  82.                                          */
  83. #define GL_AutoWidth    GL_TagBase+5    /* Set width according to length of
  84.                                          * text label + ti_Data.
  85.                                          */
  86. #define GL_Columns        GL_TagBase+38    /* Set width so that approximately
  87.                                          * ti_Data columns will fit.
  88.                                          */
  89. #define GL_AddWidth        GL_TagBase+6    /* Add some value to the total width
  90.                                          * calculation.
  91.                                          */
  92. #define GL_MinWidth        GL_TagBase+34    /* Make sure width is at least this */
  93. #define GL_MaxWidth        GL_TagBase+35    /* Make sure width is at most this */
  94.  
  95. /* Gadget height control.
  96.  */
  97. #define GL_Height        GL_TagBase+7    /* Absolute gadget height. */
  98. #define GL_HeightFactor    GL_TagBase+33    /* Make the gadget height a multiple
  99.                                          * of the font height.
  100.                                          */
  101. #define GL_AutoHeight    GL_TagBase+8    /* Set height according to height of
  102.                                          * text font + ti_Data.
  103.                                          */
  104. #define GL_AddHeight    GL_TagBase+9    /* Add some value to the total height
  105.                                          * calculation.
  106.                                          */
  107. #define GL_MinHeight    GL_TagBase+36    /* Make sure height is at least this */
  108. #define GL_MaxHeight    GL_TagBase+37    /* Make sure height is at most this */
  109.  
  110. /* Gadget top edge control.
  111.  */
  112. #define GL_Top            GL_TagBase+10    /* Absolute top edge. */
  113. #define GL_TopRel        GL_TagBase+11    /* Top edge relative to bottom edge of
  114.                                          * another gadget.
  115.                                          */
  116. #define GL_AdjustTop    GL_TagBase+12    /* ADD the height of the text font +
  117.                                          * ti_Data to the top edge.
  118.                                          */
  119. #define GL_AddTop        GL_TagBase+13    /* Add some value to the final top edge
  120.                                          * calculation.
  121.                                          */
  122. /* Gadget bottom edge control.
  123.  */
  124. #define GL_Bottom        GL_TagBase+14    /* Absolute bottom edge. */
  125. #define GL_BottomRel    GL_TagBase+15    /* Bottom edge relative to top edge of
  126.                                          * another gadget.
  127.                                          */
  128. #define GL_AddBottom    GL_TagBase+16    /* Add some value to the final bottom
  129.                                          * edge calculation.
  130.                                          */
  131. /* Gadget left edge control.
  132.  */
  133. #define GL_Left            GL_TagBase+17    /* Absolute left edge. */
  134. #define GL_LeftRel        GL_TagBase+18    /* Left edge relative to right edge of
  135.                                          * another gadget.
  136.                                          */
  137. #define GL_AdjustLeft    GL_TagBase+19    /* ADD the width of the text label +
  138.                                          * ti_Data to the left edge.
  139.                                          */
  140. #define GL_AddLeft        GL_TagBase+20    /* Add some value to the final left
  141.                                          * edge calculation.
  142.                                          */
  143. #define GL_AlignLeft    GL_TagBase+32    /* Align the left edge of the gadget
  144.                                          * with the left edge of another.
  145.                                          */
  146. /* Gadget right edge control.
  147.  */
  148. #define GL_Right        GL_TagBase+21    /* Absolute right edge. */
  149. #define GL_RightRel        GL_TagBase+22    /* Right edge relative to left edge of
  150.                                          * another gadget.
  151.                                          */
  152. #define GL_AddRight        GL_TagBase+23    /* Add some value to the final right
  153.                                          * edge calculation.
  154.                                          */
  155. #define GL_AlignRight    GL_TagBase+31    /* Align the right edge of the gadget
  156.                                          * with the right edge of another.
  157.                                          */
  158.  
  159. /* Access to the other fields of the NewGadget structure.
  160.  */
  161. #define GL_GadgetText    GL_TagBase+24    /* Gadget label. */
  162. #define GL_TextAttr        GL_TagBase+25    /* Desired font for gadget label. */
  163. #define GL_Flags        GL_TagBase+27    /* Gadget flags. */
  164. #define GL_UserData        GL_TagBase+29    /* Gadget UserData. */
  165. #define GL_LocaleText    GL_TagBase+30    /* Gadget label taken from a locale. */
  166.  
  167. /* Tags for GadLayout's extended gadget kinds.
  168.  */
  169. #define GLIM_Image        GL_TagBase+200    /* Image structure for an image
  170.                                          * gadget.
  171.                                          */
  172. #define GLIM_ReadOnly    GL_TagBase+201    /* TRUE if read-only. */
  173. #define GLBD_Border        GL_TagBase+200    /* Border structure for an border
  174.                                          * gadget.
  175.                                          */
  176. #define GLBD_ReadOnly    GL_TagBase+201    /* TRUE if read-only. */
  177.  
  178.  
  179. /* Tags passed directly to LayoutGadgets.
  180.  */
  181. #define GL_RightExtreme    GL_TagBase+100    /* ti_Data is a pointer to a LONG to
  182.                                          * store the right-most point that a
  183.                                          * gadget will exist in.
  184.                                          */
  185. #define GL_LowerExtreme    GL_TagBase+101    /* ti_Data is a pointer to a LONG to
  186.                                          * store the lower-most point that a
  187.                                          * a gadget will exist in.
  188.                                          */
  189. #define GL_Catalog        GL_TagBase+102    /* Indicates locale for the gadgets. */
  190. #define GL_AppStrings    GL_TagBase+104    /* Application string table w/IDs. */
  191. #define GL_DefTextAttr    GL_TagBase+103    /* Specifies a default font for use
  192.                                          * with all gadgets, can still be
  193.                                          * over-ridden with GL_TextAttr.
  194.                                          */
  195. #define GL_BorderLeft    GL_TagBase+105    /* Size of window left border. */
  196. #define GL_BorderTop    GL_TagBase+106    /* Size of window top border. */
  197. #define GL_NoCreate     GL_TagBase+107    /* Don't actually create the gadgets. */
  198.  
  199. #endif /* GADLAYOUT_GADLAYOUT_H */
  200.  
  201.