home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / gadlay17.lha / gadlayout.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-25  |  7.5 KB  |  211 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_DupeHeight    GL_TagBase+39    /* Duplicate the height of another
  99.                                          * gadget.
  100.                                          */
  101. #define GL_HeightFactor    GL_TagBase+33    /* Make the gadget height a multiple
  102.                                          * of the font height.
  103.                                          */
  104. #define GL_AutoHeight    GL_TagBase+8    /* Set height according to height of
  105.                                          * text font + ti_Data.
  106.                                          */
  107. #define GL_AddHeight    GL_TagBase+9    /* Add some value to the total height
  108.                                          * calculation.
  109.                                          */
  110. #define GL_MinHeight    GL_TagBase+36    /* Make sure height is at least this */
  111. #define GL_MaxHeight    GL_TagBase+37    /* Make sure height is at most this */
  112.  
  113. /* Gadget top edge control.
  114.  */
  115. #define GL_Top            GL_TagBase+10    /* Absolute top edge. */
  116. #define GL_TopRel        GL_TagBase+11    /* Top edge relative to bottom edge of
  117.                                          * another gadget.
  118.                                          */
  119. #define GL_AdjustTop    GL_TagBase+12    /* ADD the height of the text font +
  120.                                          * ti_Data to the top edge.
  121.                                          */
  122. #define GL_AlignTop        GL_TagBase+41    /* Align the top edge of the gadget
  123.                                          * with the top edge of another.
  124.                                          */
  125. #define GL_AddTop        GL_TagBase+13    /* Add some value to the final top edge
  126.                                          * calculation.
  127.                                          */
  128. /* Gadget bottom edge control.
  129.  */
  130. #define GL_Bottom        GL_TagBase+14    /* Absolute bottom edge. */
  131. #define GL_BottomRel    GL_TagBase+15    /* Bottom edge relative to top edge of
  132.                                          * another gadget.
  133.                                          */
  134. #define GL_AlignBottom    GL_TagBase+40    /* Align the bottom edge of the gadget
  135.                                          * with the bottom edge of another.
  136.                                          */
  137. #define GL_AddBottom    GL_TagBase+16    /* Add some value to the final bottom
  138.                                          * edge calculation.
  139.                                          */
  140. /* Gadget left edge control.
  141.  */
  142. #define GL_Left            GL_TagBase+17    /* Absolute left edge. */
  143. #define GL_LeftRel        GL_TagBase+18    /* Left edge relative to right edge of
  144.                                          * another gadget.
  145.                                          */
  146. #define GL_AdjustLeft    GL_TagBase+19    /* ADD the width of the text label +
  147.                                          * ti_Data to the left edge.
  148.                                          */
  149. #define GL_AddLeft        GL_TagBase+20    /* Add some value to the final left
  150.                                          * edge calculation.
  151.                                          */
  152. #define GL_AlignLeft    GL_TagBase+32    /* Align the left edge of the gadget
  153.                                          * with the left edge of another.
  154.                                          */
  155. /* Gadget right edge control.
  156.  */
  157. #define GL_Right        GL_TagBase+21    /* Absolute right edge. */
  158. #define GL_RightRel        GL_TagBase+22    /* Right edge relative to left edge of
  159.                                          * another gadget.
  160.                                          */
  161. #define GL_AddRight        GL_TagBase+23    /* Add some value to the final right
  162.                                          * edge calculation.
  163.                                          */
  164. #define GL_AlignRight    GL_TagBase+31    /* Align the right edge of the gadget
  165.                                          * with the right edge of another.
  166.                                          */
  167.  
  168. /* Access to the other fields of the NewGadget structure.
  169.  */
  170. #define GL_GadgetText    GL_TagBase+24    /* Gadget label. */
  171. #define GL_TextAttr        GL_TagBase+25    /* Desired font for gadget label. */
  172. #define GL_Flags        GL_TagBase+27    /* Gadget flags. */
  173. #define GL_UserData        GL_TagBase+29    /* Gadget UserData. */
  174. #define GL_LocaleText    GL_TagBase+30    /* Gadget label taken from a locale. */
  175.  
  176. /* Tags for GadLayout's extended gadget kinds.
  177.  */
  178. #define GLIM_Image        GL_TagBase+200    /* Image structure for an image
  179.                                          * gadget.
  180.                                          */
  181. #define GLIM_ReadOnly    GL_TagBase+201    /* TRUE if read-only. */
  182. #define GLIM_Toggle        GL_TagBase+202    /* TRUE if a toggle gadget. */
  183. #define GLBD_Border        GL_TagBase+200    /* Border structure for an border
  184.                                          * gadget.
  185.                                          */
  186. #define GLBD_ReadOnly    GL_TagBase+201    /* TRUE if read-only. */
  187.  
  188.  
  189. /* Tags passed directly to LayoutGadgets.
  190.  */
  191. #define GL_RightExtreme    GL_TagBase+100    /* ti_Data is a pointer to a LONG to
  192.                                          * store the right-most point that a
  193.                                          * gadget will exist in.
  194.                                          */
  195. #define GL_LowerExtreme    GL_TagBase+101    /* ti_Data is a pointer to a LONG to
  196.                                          * store the lower-most point that a
  197.                                          * a gadget will exist in.
  198.                                          */
  199. #define GL_Catalog        GL_TagBase+102    /* Indicates locale for the gadgets. */
  200. #define GL_AppStrings    GL_TagBase+104    /* Application string table w/IDs. */
  201. #define GL_DefTextAttr    GL_TagBase+103    /* Specifies a default font for use
  202.                                          * with all gadgets, can still be
  203.                                          * over-ridden with GL_TextAttr.
  204.                                          */
  205. #define GL_BorderLeft    GL_TagBase+105    /* Size of window left border. */
  206. #define GL_BorderTop    GL_TagBase+106    /* Size of window top border. */
  207. #define GL_NoCreate     GL_TagBase+107    /* Don't actually create the gadgets. */
  208.  
  209. #endif /* GADLAYOUT_GADLAYOUT_H */
  210.  
  211.