home *** CD-ROM | disk | FTP | other *** search
/ Amiga Inside! / Amiga FD Inside (1995)(Ultramax).iso / berndspd / devtools / intuigen / doc / gtrequest.txt < prev    next >
Encoding:
Text File  |  1995-04-21  |  47.7 KB  |  1,517 lines

  1. GTRequest.txt doc
  2.  
  3. (C) Copyright 1993 Justin Miller
  4.       This file may be freely distributed with IntuiGen 2.0.
  5.       All Other Rights Reserved.
  6.       The Author makes no warranties, express or implied, as to
  7.     the accuracy or suitability of the material contained herein.
  8.  
  9. What is GTRequest
  10. GTRequest refers to the set of functions found in the GTRequest.c file
  11. which manage an IntuiGen generated requester under GadTools.  This file
  12. documents these functions, their use, and the structures that drive them.
  13.  
  14.  
  15.  
  16. GTRequest
  17. GTRequest is a function in the GTRequest.c file which opens your window,
  18. displays your IntuiGen generated requester, handles user input, calls
  19. user-defined functions, copies values between the requester gadgets and a
  20. structure, implements keyboard commands, and more.  To use GTRequest,
  21. simply set up your requester in IntuiGen, generate code for it using the
  22. GadTools Code and IG/GTRequest code options, (you may want to generate a
  23. window listing too), and then call GTRequest from within your program
  24. somewhere, like this:
  25.  
  26. main()
  27. {
  28.     LONG x;
  29.     ...
  30.     x=GTRequest(&MyRequest);
  31.     /*
  32.         if x=0 GTRequest failed due to inadequate or unavailable
  33.         system resources
  34.  
  35.         Otherwise x=MyRequest.Terminate
  36.         if x>0, then the associated data structure was filled from the
  37.             user-entered info in the gadgets
  38.         if x<0, then the data structure was not filled
  39.         >0 usually corresponds to OK-type ending
  40.         <0 usually corresponds to Cancel-type ending
  41.     */
  42.     ...
  43. }
  44.  
  45.  
  46.  
  47. Simulating User Input
  48. GTRequest includes several functions that can be called while a GTRequest
  49. is active which simulate User Input.  These functions are:
  50.  
  51. __far void SetControlAttrs (GTRequest *req,struct GTControl *gtc,Tag
  52.     tag1,...);
  53.  
  54. __far BOOL GTKeyClick (struct GTRequest *req,UBYTE *keyinfo,UBYTE key);
  55.  
  56. __far void SetIntControl (struct GTRequest *req,struct GTControl *gtc,LONG
  57.     number);
  58.  
  59. __far void SetStringControl (struct GTRequest *req,struct GTControl
  60.     *gtc,UBYTE *string);
  61.  
  62. __far BOOL GTGadgetClick (struct GTRequest *req,struct Gadget *gadg);
  63.  
  64. #define GTControlClick(r,g) GTGadgetClick(r,(g)->Gadget)
  65.  
  66.  
  67.  
  68. GTBlock/UnBlockInput
  69. GTBlockInput Function opens an blank intuition requester on top
  70. of an GTRequest, thereby blocking it from receiving input, making all
  71. of its Gadgets/Controls unselectable and unusable.
  72.  
  73. __far void GTBlockInput(struct GTRequest *req);
  74.  
  75. GTUnBlockInput closes blank requester opened by GTBlockInput, thereby
  76. permitting messages to come through again.  Calls to GTBlock/UnBlockIGInput
  77. can be nested; a nesting depth count is kept.  Only when the number of
  78. calls to GTUnBlockInput equal the number of calls to GTBlockInput will the
  79. requester be unblocked.
  80.  
  81. __far void GTUnBlockInput(struct GTRequest *req);
  82.  
  83.  
  84.  
  85. InitFunctions
  86. In the GTRequest structure is a field called InitFunction.  This field
  87. points to a function to be called as soon as the requester is open, and its
  88. imagery displayed, immediately before message processing begins.  If you
  89. need to algorithmically draw any additional imagery, initialize any lists,
  90. Remember keys, etc. that couldn't be initialized before GTRequest or
  91. ProcessReqSet was called, you can do this in the InitFunction.    To set up
  92. an InitFunction, simply write a function which uses the following
  93. prototype:
  94.  
  95.     void   (*InitFunction) (struct GTRequest *);
  96.  
  97. After doing this, enter the functions name in the InitFunction field in the
  98. GTRequest structure.  Your function will then be called when the requester
  99. is run.
  100.  
  101.  
  102.  
  103. Simultaneous Requests
  104. There may be times when you wish to have several GTRequests open at once.
  105. There are two ways that these requesters could behave.
  106.  
  107. The first way is that the second requester is a sub-requester of the first,
  108. and all input to the first request is blocked until the second request is
  109. ended.    To do this, use a code segment as per below:
  110.  
  111. main()
  112. {
  113.     ...
  114.     GTRequest(&MyRequest1);
  115.     /* MyRequest1 contains a gadget called SomeGadget which has
  116. been
  117.         linked to the function SomeGagdetGUpFunc();
  118.     */
  119.     ...
  120. }
  121.  
  122. SomeGadgetGUpFunc(struct GTRequest *req, struct IntuiMessage *msg,
  123.     struct GTControl *gtc, struct MessageHandler *mh)
  124. {
  125.     ...
  126.     GTBlockInput(req);
  127.     GTRequest(&MyRequest2);
  128.     GTUnBlockInput(req);
  129.     ...
  130. }
  131.  
  132. The second way that the two requesters could behave is as if they belonged
  133. to two separate tasks, each one interacting with the user independently of
  134. the other, with the user free to switch back and forth at will.  Though
  135. these requester may behave as if they belonged to two separate tasks, they
  136. really don't.  An example of this is the Workbench.  You can open several
  137. windows, and then click in any of them you choose and have Workbench
  138. respond to your mouseclick.  To set this up, write code as per below:
  139.  
  140. main()
  141. {
  142.     struct GTReqSet reqset;
  143.     ...
  144.  
  145.     InitReqSet(&reqset);
  146.  
  147.     AddGTRequest(&reqset,&MyRequest1);
  148.     AddGTRequest(&reqset,&MyRequest2);
  149.  
  150.     ProcessReqSet(&reqset);
  151.     ...
  152. }
  153.  
  154. Note that regardless of which of the two methods you use for your
  155. requesters, you cannot display the same requester more than once
  156. simultaneously.  If you would like to open several identical requesters
  157. using either of the above methods, use the DuplicateRequest function to
  158. create a new requester identical to the first.
  159.  
  160.  
  161.  
  162.  
  163. Creating New MessageClasses
  164. If you would like to establish a new MessageClass to which MessageHandlers
  165. can belong for your requester, you must do the following things:
  166.  
  167. 1) Write an IsType function.  The IsType function should use the following
  168.     argument template:
  169.  
  170.      BOOL  (*IsType) (struct GTRequest *,struct IntuiMessage *,
  171.         struct GTControl *,struct MessageHandler *mh);
  172.  
  173. If struct GTControl * is NULL, then IsType should determine whether the
  174. message has taken place in the requester or for any of the requesters
  175. controls.  If GTControl * is not NULL, then IsType should determine whether
  176. the message kind has taken place for the specific control.  IsType should
  177. return 1 if the message has taken place, otherwise it should return 0.
  178.  
  179. 2)  Establish a class name for this message class.  The class name can be
  180. any string; note that class names are case sensitive.
  181.  
  182. 3)  Create a NULL-terminated MessageClass array for your requester.  This
  183. array will look like this:
  184.  
  185.     struct MessageClass MyClassList[] = {
  186.         { MyIsType1, "MyClassName1" },
  187.         { MyIsType2, "MyClassName2" },
  188.         { 0, 0 }
  189.     };
  190.  
  191. 4)  Finally, you need to set the LocalMsgClassList field of your IGRequest
  192. structure to point to the above array.
  193.  
  194. Any MessageHandler in your GTRequest can now use the new
  195. MessageClass, simply by specifying the MessageClass's name.
  196.  
  197. Before creating a MessageClass, you should check to insure that:
  198.     1)  The class you intend to create isn't already available in the
  199.         GTRequest.c global class list (used by default for all
  200.         requesters).
  201.     2)  The name for you class doesn't conflict with the names of
  202.         any global MessageClass, or any of your other message
  203.         classes.
  204.  
  205.  
  206.  
  207.  
  208. Linking Toggle Buttons To Structures
  209. Often, you will have a series of on/off type options which lend themselves
  210. to CheckBox_Kind or Toggle Button controls.  You can link CheckBox_Kind
  211. buttons to any field in your structure through IntuiGen, but what if you
  212. want to link them to a particular bit of a field.  In this case, use the
  213. BOOLBIT field type from within IntuiGen.  You will then have to manually
  214. specify the bit of the field to which the control is to be linked, as will
  215. be described shortly.
  216.  
  217. There are no provisions in IntuiGen for linking Toggle buttons to fields,
  218. much less bits of a field.  This must be done manually.
  219.  
  220. To link Toggle buttons to a bit of a given field follow these steps.  To
  221. link CheckBox_Kind buttons to a bit of a given field, if you specified the
  222. field name and BOOLBIT field type in IntuiGen, start at step 3.  Otherwise
  223. start at step 1.  Note that when using the BOOLBIT field type, the field in
  224. which the bit that you are linking to exists must be of type ULONG.
  225.  
  226. 1)  Enter FLD_BOOLBIT in the FieldType field of the Control
  227.  
  228. 2)  Enter offsetof(struct StructureTypeNameHere, FieldNameHere) in the
  229.      FieldOffset field of the Control
  230.  
  231. 3)  Enter the bit number (between 0 and 31) of the bit to use in the FieldBit
  232.      field of the Control
  233.  
  234.  
  235.  
  236. CloseWindow Messages
  237. To have a user-defined function called on receipt of a CloseWindow message,
  238. enter the following MessageHandler:
  239.  
  240.     struct MessageHandler MyRequestCloseWindowMH = {
  241.         NULL,
  242.         "CloseWindow",
  243.         NULL,
  244.         MyCloseWindowFunction
  245.     };
  246.  
  247. You will then have to append this MessageHandler to you GTRequest's
  248. MessageHandler list.  To do this, find the last MessageHandler in the list
  249. (the first one reading from top to bottom in the code) which is connected
  250. to your GTRequest (comes after all GTControl structures and before the
  251. GTRequest structure).  Change the first field in this structure to read
  252. &MyRequestCloseWindowMH.  If you can't find any request MessageHandlers,
  253. look at the MsgHandlerList field of your GTRequest structure.  If this
  254. field is NULL, there currently aren't any request MessageHandlers.  In this
  255. case, enter &MyRequestCloseWindowMH into this field.
  256.  
  257. MyCloseWindowFunction will now be called when the user closes the window.
  258.  
  259.  
  260.  
  261. Global Message Classes
  262. The following is a list of all the global message classes you can use in
  263. your programs.    All but the last five correspond to IDCMP messages of
  264. similar names.
  265.  
  266.     GadgetUp
  267.     GadgetDown
  268.     MouseButtons
  269.     MouseMove
  270.     DeltaMove
  271.     RawKey
  272.     IntuiTicks
  273.     DiskInserted
  274.     DiskRemoved
  275.     MenuVerify
  276.     MenuPick
  277.     SizeVerify
  278.     NewSize
  279.     ReqVerify
  280.     ReqSet
  281.     ReqClear
  282.     ActiveWindow
  283.     InactiveWindow
  284.     RefreshWindow
  285.     NewPrefs
  286.     CloseWindow
  287.  
  288. These last five classes are unique to GTRequest and therefore warrant
  289. explanation.
  290.     EndGadgetUp
  291.         If you use this message class for a Gadget,
  292.         if that gadget receives a GadgetUp message, EndGTRequest
  293.         will automatically be called with a termination value of -1
  294.         before the HandlerFunction, if any, is called.
  295.  
  296.     EndFillGadgetUp
  297.         Identical to above, except Terminate = 1
  298.  
  299.     LimitStringContents
  300.         Use this message Handler to limit string contents to those
  301.         characters not contained in the string associated with the
  302.         GTCT_STRING_INVALIDCHARS control tag.
  303.  
  304.     VerifyIntLimits
  305.         Use this message handler to limit a string or integer
  306.         Gadget's contents to the digits 0-9, negative sign, and a
  307.         decimal point. Further, allows restrictions to be placed on
  308.         the entered number specifying that it falls within a
  309.         certain range.    The restrictions are set with the tags
  310.         GTCT_INT_MIN and GTCT_INT_MAX.
  311.  
  312.     StringDSelected
  313.         This message is sent to string gadgets and integer gadgets
  314.         any time the user clicks on another gadget, or hits return.
  315.         Like GadgetUp for strings, but always takes place.
  316.  
  317.  
  318.  
  319.  
  320. Pseudokinds
  321. Below are the pseudokinds included with GTRequest.  But for the EditList
  322. kind, these can all be used without adding a pseudokind class list to your
  323. GTRequest (the other kinds are in the default pseudokind class list and are
  324. always linked in).  As EditList is in a separate file, and the additional
  325. code it requires is not always linked in, you must add a pseudokind class
  326. list entry to any GTRequest structure which makes use of it.  To learn how
  327. to do this, click the EditList button.
  328.  
  329. ToggleSelect
  330.     This class creates a BUTTON_KIND-like gadget, except it is
  331.     ToggleSelect.  Supports all the tags BUTTON_KIND supports
  332.     and adds GTPK_Toggled.
  333.  
  334. ImageButton
  335.     This class creates a Boolean gadget, optionally ToggleSelect,
  336.     which is based on Images.  Uses the following tags with it:
  337.  
  338.     GTPK_Image
  339.     ti_Data = struct Image *
  340.     GTPK_Toggleselect
  341.     ti_Data = T/F
  342.     GTPK_SelectedImage
  343.     ti_Data = struct Image *
  344.         If not specified, GADGHCOMP used
  345.     GTPK_Toggled
  346.     ti_Data = T/F
  347.  
  348. EditList
  349.     An EditList is a list with an Editable ShowSelect STRING_KIND gadget, and
  350.     Add and Remove gadgets so that additional entries may be added to the list
  351.     by the user.  It uses the following tags, of which the first two MUST be
  352.     specified:
  353.  
  354.     GTPK_Remember
  355.     ti_Data = struct Remember **
  356.         All user-added list entries are allocated on this key
  357.         You must free it
  358.     GTPK_List
  359.     ti_Data = struct List *
  360.         This is the list which is displayed and to which entries
  361.         are added.  GTLV_Labels is an acceptable synonym
  362.         for this.
  363.     GTPK_Alpha
  364.     ti_Data = T/F
  365.         Keep the list alphabetized?
  366.  
  367.     GTPK_NodeSize
  368.     ti_Data = ULONG
  369.         This is the size of each list node to be allocated. Defaults
  370.         to sizeof(struct Node).  If your nodes are custom
  371.         structures, you must set this.
  372.  
  373.     GTPK_SetList
  374.     ti_Data = void (*SetList) (GTRequest *, GTControl *, List *);
  375.  
  376.         This function should Attach/disattach list to all controls
  377.         associated with this list, so changes will showup in all
  378.         ListView gadgets.  Need only be set if the list is being
  379.         used by several ListView Gadgets at once.
  380.  
  381. An edit list has a custom set of messages that it will send out, for which
  382. you can establish MessageHandlers.  The name of the message is the class to
  383. use in the MessageHandler's name.
  384.  
  385. ChangedEntry
  386.     msg->IAddress = ENTRY (a struct Node *)
  387.     Sent when a Node is changed.
  388.  
  389. AddedEntry
  390.     msg->IAddress = NEWENTRY (a struct Node *)
  391.     Sent when an entry is added.
  392.  
  393. ChangedList
  394.     msg->IAddress = LIST
  395.     Sent when the list or one of its nodes is changed in any way.
  396.  
  397. DeletedEntry
  398.     msg->IAddress = DELETEDENTRY
  399.     Sent when an entry is deleted.    Note that deleted entries are
  400.     Not freed; they remain allocated on your Remember key and
  401.     are freed with all the other entries when you free the Remember
  402.     key.
  403.  
  404. GadgetUp
  405.     msg->Code = Entry's ord. #
  406.     msg->IAddress = ENTRY
  407.     Sent when the user selects an entry (just like a LISTVIEW_KIND).
  408.     Note that standard LISTVIEW_KINDs don't place the selected
  409.     node's address in msg->IAddress.
  410.  
  411.  
  412.  
  413. EditLists
  414. For an explanation of what an EditList is, see Pseudokinds.  For pointers
  415. on how to use IntuiGen to ease the process of creating the necessary
  416. structures for an EditList, click on the IntuiGen button.  This section
  417. describes what files must be compiled and linked into the program to use
  418. EditLists, and how to set up a Pseudokind class list allowing EditLists to
  419. be used in a particular request.
  420.  
  421. To use EditLists, you will have to compile and link in the following files:
  422.     GTRequest.c
  423.     EditList.c
  424.     ListViewKind.c
  425.  
  426. You will then have to define a Pseudokind class list.  Your pseudokind
  427. class list will look something like this:
  428.  
  429. struct GTPKind MyPKindList[] = {
  430.     { "EditList",CreateEditListKind,0 },
  431.     { 0,0,0 }
  432. };
  433.  
  434. You will then have to link this class list into your GTRequest structure by
  435. typing MyPKindList into the GTRequest's LocalPKindClassList field.  You can
  436. now use EditList controls in this requester.
  437.  
  438.  
  439.  
  440. Bit Field Macros
  441. These are defined in GTRequest.h:
  442.  
  443. #define FLAGOFF(x,flag) ((x)&=0xffffffff^(flag))
  444. #define FLAGON(x,flag) ((x)|=(flag))
  445.  
  446. #define SETFLAG(x,flag,onoff) (onoff ? ((x)|=(flag)) : ((x)&=0xffffffff^(flag)) )
  447.  
  448. #define ISFLAGON(x,flag) ((x) & (flag))
  449. #define ISFLAGOFF(x,flag) (!((x) & (flag)))
  450. #define GETFLAG(x,flag) ((x) & flag)
  451.  
  452.  
  453.  
  454. GTRequest Tags
  455. These are defined in GTRequest.h:
  456.  
  457. /**************************************************************************/
  458. /*           GTRequest/Control Tags                  */
  459. /**************************************************************************/
  460.  
  461. #define TAG_GTR_BASE (TAG_USER | (1<<16))
  462.  
  463. /**************************************************************************/
  464. /*            Prefixes for Tags                  */
  465. /**************************************************************************/
  466. /* GTRT is a Request Tag                          */
  467. /*    It should be placed in list pointed to by Request->RequestTags      */
  468. /*                                      */
  469. /* GTCT is a Control Tag                          */
  470. /*    It should be placed in list pointed to by Control->ControlTags      */
  471. /*                                      */
  472. /* GTPK is a Gadget Tag for pseudo kind                   */
  473. /*    It should be placed in list pointed to by Control->GadgetTags      */
  474. /*                                      */
  475. /* GTGT is a Gadget Tag for GadTools kind which is intercepted by
  476. GTRequest */
  477. /*    It should be placed in list pointed to by Control->GadgetTags      */
  478. /**************************************************************************/
  479.  
  480.  
  481. /**************************************************************************/
  482. /*    These tags are for String_Kind controls               */
  483. /*      They are used to set minimum, maximum limits, and illegal chars */
  484. /**************************************************************************/
  485.  
  486. #define GTCT_INT_MIN (TAG_GTR_BASE + 1)
  487. #define GTCT_INT_MAX (TAG_GTR_BASE + 2)
  488. #define GTCT_STRING_INVALIDCHARS (TAG_GTR_BASE + 3)
  489.  
  490. /**************************************************************************/
  491. /*        Don't use these next two                                  */
  492. /**************************************************************************/
  493.  
  494. #define GTCT_TOGGLED (TAG_GTR_BASE + 4)  /* These 2 really aren't control
  495. tags */
  496. #define GTCT_NEXTDATATOGADGETADDRESS (TAG_GTR_BASE +4) /* use
  497. synonyms def'd
  498.                                 below */
  499.  
  500. /**************************************************************************/
  501. /* If the ti_Data for a tag should be the Gadget Address of a created      */
  502. /*  GadTools Gadget (i.e. To get an editable ListView ShowSelected        */
  503. /*  String_Kind, you have to pass it the address of an already created      */
  504. /*  String_Kind), use GTGT_NEXTDATATOGADGETADDRESS.  The data value of
  505. */
  506. /*  the next tag is assumed to be a pointer to a GTControl.  This      */
  507. /*  GTControl is created first, and the address of the resulting gadget   */
  508. /*  returned by GadTools is placed in place of the GTControl pointer.      */
  509. /*  The GTGT_NEXTDATATOGADGETADDRESS tag is turned into a
  510. TAG_IGNORE.      */
  511. /*  These changes are actually performed on a duplicate of the TagList,   */
  512. /*  so the original taglist is unmodified for future calls to GTRequest.  */
  513. /**************************************************************************/
  514.  
  515. #define GTGT_NEXTDATATOGADGETADDRESS
  516. GTCT_NEXTDATATOGADGETADDRESS
  517.  
  518. /**************************************************************************/
  519. /*  For ImageButton PseudoKind                          */
  520. /**************************************************************************/
  521.  
  522. #define GTPK_Image (TAG_GTR_BASE + 5)         /* Arg = struct Image * */
  523. #define GTPK_Toggleselect (TAG_GTR_BASE + 6)  /* Arg = T/F */
  524. #define GTPK_SelectedImage (TAG_GTR_BASE + 7) /* Arg = struct Image * */
  525.                           /* If not specified, GADGHCOMP
  526.                             used */
  527. #define GTPK_Toggled GTCT_TOGGLED          /* Arg = T/F */
  528.  
  529.  
  530. /************************************************************************/
  531. /****               Info for EditList PseudoKind          ****/
  532. /************************************************************************/
  533.  
  534. #define GTPK_Remember (TAG_GTR_BASE + 5) /* Arg = struct Remember **
  535. */
  536. #define GTPK_List     GTLV_Labels     /* Arg = struct List * */
  537. #define GTPK_Alpha    (TAG_GTR_BASE + 7) /* Arg = T/F */
  538. #define GTPK_NodeSize (TAG_GTR_BASE + 8) /* Arg = ULONG */
  539. #define GTPK_SetList  (TAG_GTR_BASE * 9) /* Arg =
  540.                         void (*SetList)
  541.                             (GTRequest *,
  542.                              GTControl *,
  543.                              List *);
  544.  
  545.                         This should Attach/disattach
  546.                         list to all controls associated
  547.                         with list, so changes will show
  548.                         up in all ListView gadgets.
  549.                       */
  550.  
  551.  
  552.  
  553. Control Flags
  554. These are defined in GTRequest.h:
  555.  
  556. /**************************************************************************/
  557. /*        These are flags for Control->Flags                  */
  558. /**************************************************************************/
  559.  
  560. #define GTC_ATTROVERRIDESSTRING 8
  561.     /* This indicates that control->Attribute should be used
  562.     instead of converting the contents of a string gadgets
  563.     buffer to the appropriate type and using this value.
  564.     */
  565. #define GTC_PSEUDOKIND 16
  566.     /* Specify this, and the control is assumed to be of a user type.
  567.        GTControl->Kind should point to a string which gives the class
  568.        of this control.  The local custom control class list, and then
  569.        the global list are searched to find the function to create this
  570.        type.  See struct {"GTPKind" LINK GTPKindStructure} for more info.
  571.     */
  572.  
  573.  
  574. #define GTC_INTERNALCONTROL 32         /* If Pseudo controls need to
  575. add
  576.                           other controls to the requester
  577.                           They should call AllocControl
  578.                           to do so and then set one of these
  579.                           2 flags.    The first marks
  580.                           this as a pseudo control which
  581.                           will be removed from the control
  582.                           list when the request is ended
  583.                           and freed.
  584.                           The second indicates the same
  585.                           thing, but in addition tells
  586.                           GTRequest not to take any action
  587.                           to initialize this control.
  588.                           (It's Gadget will not be
  589.                            created; it is assumed to have
  590.                            already been created)
  591.                         */
  592. #define GTC_INTERNALCONTROLIGNORE 64
  593.  
  594.  
  595. #define GTC_INITFROMDATA 2
  596. #define GTC_STOREDATA 4
  597.  
  598.  
  599.  
  600. Request Flags
  601. These are defined in GTRequest.h:
  602.  
  603. /**************************************************************************/
  604. /*        These flags are for use in Request->Flags          */
  605. /**************************************************************************/
  606.  
  607. #define GT_INITFROMDATA 2
  608. #define GT_STOREDATA    4
  609.  
  610.  
  611. /**************************************************************************/
  612. /*        Synonyms for above flags, can be used in either       */
  613. /*            Control->Flags or Request->Flags              */
  614. /**************************************************************************/
  615.  
  616. #define INITFROMDATA GT_INITFROMDATA
  617. #define STOREDATA GT_STOREDATA
  618.  
  619.  
  620.  
  621. Control Field Types
  622. These are defined in GTRequest.h:
  623.  
  624. /**************************************************************************/
  625. /* These are the data types that can be copied between struct fields and
  626. */
  627. /*        Controls.                              */
  628. /**************************************************************************/
  629.  
  630. #define FLD_NONE  0  /* No data is copied to or from structure */
  631. #define FLD_SHORT 1
  632. #define FLD_LONG 2
  633. #define FLD_FLOAT 3  /* This uses GTFLOAT typedef, must be 4 bytes in length
  634. */
  635.              /* It is assumed you are using a STRING_KIND control for
  636.             adjusting floats.  If you are not, you will need to
  637.             override default setting/reading code in the particular
  638.             control
  639.              */
  640. #define FLD_BYTE   4
  641. #define FLD_POINTER 5
  642.  
  643. /* The Bit field storage types require that the field given be of type
  644.     ULONG!!
  645. */
  646. #define FLD_BOOLBIT 6 /* SETFLAG(field,1<<control->Bit,control->Attribute) */
  647. #define FLD_ATTRBIT 7 /* field=1<<control->Attribute */
  648.               /* The above (ATTRBIT) is especially useful for
  649.              LISTVIEWS, MX_KINDS, etc, where you are given
  650.              an ordinal position and you wish to encode it
  651.              a ULONG
  652.               */
  653.  
  654. /*  These next 2 can be written into the data structure,
  655.     but they can't be written into the gadgets without special code
  656.     specified for the appropriate control.  You probably won't use them.   */
  657.  
  658. #define FLD_ORATTR  8 /* field|=control->Attribute */
  659. #define FLD_ORATTRBIT 9 /* field|=1<<control->Attribute */
  660.  
  661.  
  662. #define FLD_STRINGINSTRUCT 10 /* if your structure looks like this:
  663.                     struct mystruct {
  664.                     type1 field1;
  665.                     type2 field2;
  666.                     ...
  667.                     UBYTE TheField[X];
  668.                     type3 field4;
  669.                     type4 field5;
  670.                     ...
  671.                     };
  672.                   Then use this flag to store data in
  673.                   TheField
  674.                    */
  675.  
  676. #define FLD_STRINGPOINTEDTOINSTRUCT 11 /* if your structure looks like this:
  677.                           struct mystruct {
  678.                           type1 field1;
  679.                           ...
  680.                           UBYTE *TheField;
  681.                           typeX FieldX;
  682.                           ...
  683.                           };
  684.                        Then use this flag to copy the
  685.                        string to the buffer pointed to
  686.                        by TheField
  687.                        */
  688.  
  689. #define FLD_STRINGPTR 12  /* if your structure looks like the one above
  690.                  (for STRINGPOINTEDTOINSTRUCT) and you
  691.                  want to set TheField=control->Attribute
  692.                  (without performing a strcpy)
  693.                  use this.
  694.               */
  695.  
  696.  
  697.  
  698. MessageClass Structure
  699. This is defined in GTRequest.h:
  700.  
  701. /**************************************************************************/
  702. /*            MessageClass structure                  */
  703. /**************************************************************************/
  704. /*  Use this to set up handling routines for classes of messages or      */
  705. /*  sequences of messages not supported by IGRequest.  (Shift Click,      */
  706. /*  Triple Click, etc.)                           */
  707. /**************************************************************************/
  708.  
  709. struct MessageClass {
  710.     UBYTE *Name; /* Name of this message class, case significant */
  711.     BOOL  (*IsType) (struct GTRequest *,struct IntuiMessage *,struct GTControl
  712. *,struct MessageHandler *mh);
  713.     /* Called on every message.  Should return 1 if the message
  714.         constitutes the correct type, 0 otherwise */
  715. };
  716.  
  717.  
  718.  
  719. MessageHandler Structure
  720. This is defined in GTRequest.h:
  721.  
  722. /**************************************************************************/
  723. /*            MessageHandler structure                  */
  724. /**************************************************************************/
  725.  
  726. struct MessageHandler {
  727.     struct MessageHandler *Next;
  728.     UBYTE *Name; /* Name of class to which this handler belongs. */
  729.  
  730.     BOOL (*IsType) (struct GTRequest *,struct IntuiMessage *,
  731.             struct GTControl *,struct MessageHandler *);
  732.  
  733.     /* if this is a member of a class (Name!=NULL) and GTRequest can find
  734.         the MessageClass struct for this class, (either in its global list,
  735.         or its GTRequest list) this will be initialized; hence it can be
  736.         left NULL.    If this Handler is unique, and doesn't belong to
  737.         a class, or you would like to override the class default IsType
  738.         function, enter a function pointer here.
  739.     */
  740.  
  741.     void (*HandlerFunction) (struct GTRequest *,struct IntuiMessage *,
  742.                   struct GTControl *,struct MessageHandler *);
  743.     /* If IsType () returns 1, this is called */
  744.  
  745.     /* The address of this structure is passed to the HandlerFunction.
  746.        Hence, you can make custom structures embedding this one
  747.        to pass additional data to this function if you like
  748.     */
  749. };
  750.  
  751.  
  752.  
  753. GTControl Structure
  754. This is defined in GTRequest.h:
  755.  
  756. /**************************************************************************/
  757. /*            GTControl structure                   */
  758. /**************************************************************************/
  759.  
  760. struct GTControl {
  761.     struct GTControl *Next;
  762.     ULONG  Kind;
  763.     ULONG  Flags;
  764.     struct TagList *GadgetTags;
  765.     struct TagList *ControlTags;
  766.     struct NewGadget *NewGadget;
  767.     struct Gadget    *Gadget;
  768.     struct MessageHandler *MsgHandlerList;
  769.  
  770.     USHORT  ASCIICommand;   /* do not use qualified characters here */
  771.                 /* use Qualifier below  */
  772.  
  773.     USHORT  RawKeyCommand;  /* Will automatically be filled in (using
  774. current
  775.                 keymap) if ASCIICommand is filled in */
  776.     USHORT  Qualifier;
  777.     UBYTE   Pad1;
  778.     UBYTE   Pad2;
  779.  
  780.     BOOL (*HandleKeyCommand) (struct GTRequest *,struct GTControl
  781. *,struct IntuiMessage *);
  782.     /*  If this is non-zero, it is called everytime a RAWKEY message is
  783.         received to check if the RAWKEY message is a keyboard command
  784.         for this control, and if so to take whatever action is necessary.
  785.         If it is not present, default processing is done based on the
  786.         above vaules.
  787.         Return True if this was a valid Keyboard command for your control,
  788.         False otherwise.
  789.     */
  790.  
  791.     USHORT  FieldOffset;
  792.     USHORT  FieldType;
  793.     USHORT  FieldSize;
  794.     UBYTE   FieldBit;
  795.     UBYTE   Pad3;
  796.     ULONG   Attribute; /* Except for Kinds STRING_KIND and INTEGER_KIND
  797.                message processing functions
  798.                Should Cause this to contain the value
  799.                of the GTGadget to be stored to the data structure */
  800.  
  801.     ULONG   AttributeTag; /* Used in setting Gadget Attribute from data struct
  802. info */
  803.  
  804.     void (*SetGadgetFromData) (struct GTRequest *,struct GTControl *,APTR);
  805.     /*  If this is non-NULL, it is called to initialize the control from
  806.         information given in GTRequest->DataStruct.  APTR points to the
  807.         field within DataStruct which this control is associated with.
  808.         If not specified (NULL), default processing is used (assuming
  809.         INITFROMDATA flag is set) */
  810.  
  811.     void (*SetDataFromGadget) (struct GTRequest *,struct GTControl *,APTR);
  812.     /* If this is non-NULL, it is called to copy the data represented
  813.        by the control into the data structure.  The arguments are the
  814.        same as above.  Again, if not specified, default processing is
  815.        used (assuming STOREDATA flag is set)
  816.     */
  817.  
  818.     void (*GUpUpdateControl) (struct GTRequest *,struct GTControl *,struct
  819. IntuiMessage *);
  820.     void (*GDownUpdateControl) (struct GTRequest *,struct GTControl *,struct
  821. IntuiMessage *);
  822.        /* If either of these is non-null, they will be called every time
  823.           this control recieves either a GadgetUp or GadgetDown message.
  824.           They should update the GTControl->Attribute field as required
  825.           by the contents of the passed message.  If these values are null,
  826.           defaults are supplied for:
  827.             CHECKBOX_KIND, MX_KIND, CYCLE_KIND, SCROLLER_KIND,
  828.             SLIDER_KIND, LISTVIEW_KIND, PALETTE_KIND,
  829.             STRING_KIND, and INTEGER_KIND
  830.           If these values are 0xffffffff (-1L) no function is called
  831.           at all for this control.
  832.         */
  833.  
  834.     void (*SetAttrs) (struct GTRequest *,struct GTControl *,struct TagItem *);
  835.     /* If this is Non-Null this is called instead of GT_SetGadgetAttrs
  836.        to set an attribute.  It will (and should) usually pass its
  837.        data on to GT_SetGadgetAttrs. Particularly useful for pseudo-
  838.        controls.
  839.     */
  840.     APTR   UserData;
  841. };
  842.  
  843.  
  844.  
  845. GTPKind Structure
  846. This is defined in GTRequest.h:
  847.  
  848. /**************************************************************************/
  849. /*            GTPKind structure                      */
  850. /*            Used for setting up additional pseudokinds      */
  851. /**************************************************************************/
  852.  
  853. struct GTPKind {
  854.     UBYTE *Name;
  855.     struct Gadget * (*Create) (struct GTPKind *,struct Gadget *,struct
  856. GTControl *,struct GTRequest *,struct VisualInfo *);
  857.     void (*Destroy) (struct GTPKind *,struct GTControl *,struct GTRequest *);
  858. };
  859.  
  860.  
  861.  
  862. GTMenuInfo Structure
  863. This is defined in GTRequest.h:
  864.  
  865. /**************************************************************************/
  866. /*          GTMenuInfo structure                      */
  867. /*           Used for linking menu events to functions to be called */
  868. /**************************************************************************/
  869.  
  870. struct GTMenuInfo {
  871.     USHORT Code;
  872.     void (*Function) (struct GTRequest *,struct IntuiMessage *);
  873. };
  874.  
  875.  
  876.  
  877. GTReqSet Structure
  878. This is defined in GTRequest.h:
  879.  
  880. /**************************************************************************/
  881. /*            GTReqSet structure                  */
  882. /*              Used for opening many requesters simultaneously */
  883. /**************************************************************************/
  884.  
  885. struct GTReqSet {
  886.     struct List List;
  887.     struct MsgPort *MsgPort;
  888. };
  889.  
  890.  
  891.  
  892. GTRequest Structure
  893. This is defined in GTRequest.h:
  894.  
  895. /**************************************************************************/
  896. /*            GTRequest structure                   */
  897. /* This is the top level structure which contains pointers to all the      */
  898. /*  others' lists.  A pointer to one of these structures is passed to     */
  899. /*  GTRequest.                                  */
  900. /**************************************************************************/
  901.  
  902. struct GTRequest {
  903.     struct TagList *NewWindowTags; /* pointer to NewWindow to open */
  904.                  /* pointer to opened window will be
  905.                     placed in IGRequest->Window field */
  906.     struct Window *Window; /* Pointer to already opened window
  907.                    If you would like GTRequest to use a window
  908.                 you open, place a pointer to it here,
  909.                 and leave NewWindowTags NULL
  910.                */
  911.     struct NewMenu *Menus;
  912.     struct GTMenuInfo *MenuInfo;
  913.     struct GTControl *Controls; /* pointer to first control in requester to use */
  914.     ULONG Flags;
  915.     struct TagItem *RequestTags;
  916.     struct Border *Borders;  /* pointer to Border list to draw into window */
  917.     struct Image *Images;    /* pointer to Image list to draw into window */
  918.     struct IntuiText *ITexts; /* pointer to IntuiText list to write into window */
  919.     void   (*InitFunction) (struct IGRequest *); /* function to call when
  920. requester first opened */
  921.  
  922.     LONG Terminate; /* Can be set by outside routines to */
  923.          /* force request to end, >0==FillStruct, <0==!FillStruct */
  924.  
  925.     struct MsgPort *IComPort; /* Internal use only.  Initialize to 0 */
  926.  
  927.     APTR DataStruct;
  928.     void (*EndFunction) (struct IGRequest *,struct IntuiMessage *);
  929.      /* To be called when requester ends.
  930.       * This is called after any EndList EndFunction */
  931.  
  932.     void (*LoopFunction) (struct IGRequest *);
  933.                  /* This function is called repeatedly
  934.                   * while there is not a message at the
  935.                   * Window port and while CallLoop!=0
  936.                  */
  937.  
  938.     ULONG CallLoop;
  939.     ULONG LoopBitsUsed;
  940.  
  941.     ULONG AdditionalSignals; /* Additional signals to Wait on */
  942.     BOOL  (*SignalFunction) (struct GTRequest *,ULONG);
  943.  
  944.     /* Called before IGRequest goes into wait state.  Use this to test
  945.         Ports that you are waiting on through AdditionalSignals for messages.
  946.         Process one message at a time.  Return 0 if IGRequest can go
  947.         into a wait state, 1 if you require further processing time,
  948.         in which case your function will be called again (after checking
  949.         the window port, calling the loopfunction, etc.)
  950.  
  951.  
  952.          SignalFunction (IGRequest,Signals);
  953.     */
  954.  
  955.  
  956.     struct MessageClass *LocalMsgClassList; /* Must be NULL terminated array
  957. */
  958.     struct GTPKind *LocalPKindClassList; /* Must be NULL terminated array */
  959.  
  960.     struct MessageHandler *MsgHandlerList;
  961.  
  962.     ULONG  AppIDCMP; /* Internal use only! */
  963.     struct IntuiMessage *LastGadgetEvent;  /* For use by GTRequest, Message
  964. Handlers */
  965.     struct IntuiMessage *BeforeLastGadgetEvent;
  966.     struct Remember *GTKey; /* Internal use. Do not free (will be freed
  967.                     on exit from GTRequest) */
  968.     struct GTControl *ActiveControl;
  969.     APTR InternalData; /* Internal use only, init to zero */
  970.     struct GTControl *EndControl; /* Pointer to control that caused requester
  971.                     to terminate */
  972.     struct MessageHandler *EndMsgHandler; /* Pointer to MsgHandler that
  973.                         caused requester to
  974.                         terminate
  975.                       */
  976.     APTR UserData;
  977. };
  978.  
  979.  
  980.  
  981. EndGTRequest Function
  982. This is defined in GTRequest.c and prototyped in GTRequest.h:
  983.  
  984. /*  Call this to end requester */
  985.  
  986. __far void EndGTRequest(struct GTRequest *req,LONG terminate,
  987.            struct MessageHandler *mh,struct GTControl *gtc);
  988.  
  989.  
  990.  
  991. GTSendIntuiMsg Function
  992. This is defined in GTRequest.c and prototyped in GTRequest.h:
  993.  
  994. /*
  995.    This function sends a simulated IntuiMessage to a GTRequest.
  996.     GTRequest will normally take care of freeing the message.
  997. */
  998.  
  999. __far BOOL GTSendIntuiMsg (struct GTRequest *req,ULONG Class,ULONG
  1000. Code,
  1001.             USHORT Qualifier,APTR IAddress);
  1002.  
  1003. #define FreeIntuiMsg(x) FreeMem(x,sizeof(struct IntuiMessage))
  1004.  
  1005.  
  1006.  
  1007. GTKeyClickFunction
  1008. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1009.  
  1010. /*
  1011.    This function simulates a user keypress to the requester
  1012. */
  1013.  
  1014. __far BOOL GTKeyClick (struct GTRequest *req,UBYTE *keyinfo,UBYTE key);
  1015.  
  1016.  
  1017.  
  1018. SetIntControl Function
  1019. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1020.  
  1021. /*
  1022.    This function will set an Integer_Kind control to the given number,
  1023.     and will simulate appropriate messages, making it appear to the program
  1024.     as if the user entered the new number
  1025. */
  1026.  
  1027. __far void SetIntControl (struct GTRequest *req,struct GTControl *gtc,LONG
  1028. number);
  1029.  
  1030.  
  1031.  
  1032. SetStringControl Function
  1033. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1034.  
  1035. /*
  1036.    This function will set a String_Kind control to the given string,
  1037.     and will simulate appropriate messages, making it appear to the program
  1038.     as if the user entered the new string
  1039. */
  1040.  
  1041. __far void SetStringControl (struct GTRequest *req,struct GTControl
  1042. *gtc,UBYTE *string);
  1043.  
  1044.  
  1045.  
  1046. GTGadgetClickFunction
  1047. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1048.  
  1049. /*
  1050.    This function will simulate a user mouse press over the given gadget
  1051.     The corresponding macro simulates a user mouse press over a control
  1052. */
  1053.  
  1054. __far BOOL GTGadgetClick(struct GTRequest *req,struct Gadget *gadg);
  1055.  
  1056. #define GTControlClick(r,g) GTGadgetClick(r,(g)->Gadget)
  1057.  
  1058.  
  1059.  
  1060. GTBlockInput Function
  1061. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1062.  
  1063. /*
  1064.     GTBlockInput Function opens an blank intuition requester on top
  1065.     of an IGRequest, thereby blocking it from receiving input
  1066. */
  1067. __far void GTBlockInput(struct GTRequest *req);
  1068.  
  1069.  
  1070.  
  1071. GTUnBlockInput Function
  1072. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1073.  
  1074. /*
  1075.     GTUnBlockInput closes blank requester opened by GTBlockInput, thereby
  1076.     permitting messages to come through again
  1077.     Calls to GTBlock/UnBlockIGInput can be nested; a nesting depth count
  1078.                             is kept
  1079. */
  1080. __far void GTUnBlockInput(struct GTRequest *req);
  1081.  
  1082.  
  1083.  
  1084. GTReqModifyIDCMP Function
  1085. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1086.  
  1087. /* You must use this instead of ModifyIDCMP!! */
  1088.  
  1089. __far void GTReqModifyIDCMP(struct GTRequest *req,ULONG IDCMP);
  1090.  
  1091.  
  1092.  
  1093. SetControlAttrsA Function
  1094. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1095.  
  1096. /* You must use this instead of GT_SetGadgetAttrsA */
  1097.  
  1098. __far void SetControlAttrsA (struct GTRequest *req,struct GTControl
  1099. *gtc,struct TagItem *ti);
  1100.  
  1101.  
  1102.  
  1103. SetControlAttrs Function
  1104. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1105.  
  1106. /* You must use this instead of GT_SetGadgetAttrsA */
  1107.  
  1108. __far void SetControlAttrs(struct GTRequest *req,struct GTControl *gtc,Tag
  1109. tag1,...);
  1110.  
  1111.  
  1112.  
  1113. SendMessageToControl Function
  1114. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1115.  
  1116. /*
  1117.     This function searches through a GTControl's MessageHandler list
  1118.     for a MessageHandler of the given class, and then calls that
  1119.     MessageHandler's HandlerFunction.  IsType isn't called;
  1120.     the message is by definition of the given type.
  1121.     This allows you to set up additional classes of messages
  1122.     for controls and Pseudocontrols, as a class can be named
  1123.     anything you would like.  The EditList pseudokind uses
  1124.     this stategy.
  1125. */
  1126.  
  1127. __far void SendMessageToControl(struct GTRequest *req,struct GTControl
  1128. *gtc,struct IntuiMessage *msg, UBYTE *class);
  1129.  
  1130.  
  1131.  
  1132. AddInternalControl Function
  1133. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1134.  
  1135. /*
  1136.     This function adds an internal Control to a GTRequest's control list.
  1137.     An internal control is one that is created by a pseudokind and is removed
  1138.     from the list when the requester is terminated.  EditList kind uses this
  1139.     function.
  1140. */
  1141.  
  1142. __far void AddInternalControl(struct GTRequest *req,struct GTControl
  1143. *parent,struct GTControl *gtc,ULONG type);
  1144.  
  1145.  
  1146.  
  1147. AllocNewGadgetFunction
  1148. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1149.  
  1150. /*
  1151.     This function allocates a NewGadget structure on the Request's ReqKey,
  1152.     which is automatically freed.  Used for creating internal controls.
  1153.     Used by EditList PKind.
  1154. */
  1155.  
  1156. __far struct NewGadget *AllocNewGadget(struct GTRequest *req,struct
  1157. NewGadget *sg,
  1158.                         LONG x,LONG y,LONG w,LONG h);
  1159.  
  1160.  
  1161.  
  1162. Termination Info Macros
  1163. These are defined in GTRequest.h:
  1164.  
  1165. #define GetTerminate(req) ((req)->Terminate)
  1166. #define GetEndControl(req) ((req)->EndControl)
  1167. #define GetEndMsgHandler(req) ((req)->EndMsgHandler)
  1168.  
  1169.  
  1170.  
  1171. FindGadgetControl Function
  1172. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1173.  
  1174. /*
  1175.     Takes pointer to linked list of controls, and finds and returns
  1176.     the one that is related to the given gadget
  1177. */
  1178. __far struct GTControl *FindGadgetControl(struct GTControl *gtc,struct
  1179. Gadget *g);
  1180.  
  1181.  
  1182.  
  1183. RawKeyToAscii Function
  1184. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1185.  
  1186. /*
  1187.   Takes RAWKEY code and qualifier (from an IntuiMessage) and returns
  1188.    ASCII equivalent
  1189. */
  1190. __far UBYTE RawKeyToAscii (USHORT code,USHORT qual);
  1191.  
  1192.  
  1193.  
  1194. ASCIIToRawKey Function
  1195. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1196.  
  1197. /* Takes ASCII char and returns Rawkey code.  ASCII code must correspond
  1198. to
  1199.    letter painted on keyboard keycap (the unqualified value).  Qualifier
  1200.    must be determined as follows (Under IGRequest which does not
  1201.    differentiate between right and left):
  1202.  
  1203.     SHIFT =  1
  1204.     ALT   = 16
  1205.     CTRL  =  8
  1206.     AMIGA = 64
  1207.  
  1208.    Returns -1 error.
  1209. */
  1210.  
  1211. __far SHORT ASCIIToRawKey (char c);
  1212.  
  1213.  
  1214.  
  1215. ClearWindow Function
  1216. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1217.  
  1218. /*
  1219.     ClearWindow Function, clears inside of window to background (0)
  1220.     Used by GTRequest on exit if it doesn't close the window.
  1221. */
  1222. __far void ClearWindow (struct Window *w);
  1223.  
  1224.  
  1225.  
  1226. FirstItem Function
  1227. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1228.  
  1229. /*
  1230.     This function returns a pointer to the first item in an exec list,
  1231.     or NULL if the list is empty
  1232. */
  1233.  
  1234. struct Node *FirstItem(struct List *l);
  1235.  
  1236.  
  1237.  
  1238. NextItem Function
  1239. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1240.  
  1241. /*
  1242.     This function returns a pointer to the next node in an exec list,
  1243.     or NULL if the given node is the last valid node
  1244. */
  1245. struct Node *NextItem(struct Node *n);
  1246.  
  1247.  
  1248.  
  1249. NodeValid Macro
  1250. This is defined in GTRequest.h:
  1251.  
  1252. /*
  1253.     This macro determines whether a node is valid (contains data or is
  1254.     part of the ListHead structure)
  1255. */
  1256. #define NodeValid(n) ((n)->ln_Succ->ln_Succ)
  1257.  
  1258.  
  1259.  
  1260. cismember Function
  1261. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1262.  
  1263. /*
  1264.     This function returns the ordinal position +1 of c in set.
  1265.      If c isn't in set, it returns 0.  set is a string (NULL delimited).
  1266. */
  1267. __far int cismember (char c,char *set);
  1268.  
  1269.  
  1270.  
  1271. delchars Function
  1272. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1273.  
  1274. /* deletes n chars starting at position p from string s */
  1275.  
  1276. __far void delchars (char *s,USHORT p,USHORT n);
  1277.  
  1278.  
  1279.  
  1280. strelim Function
  1281. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1282.  
  1283. /*
  1284.    when k is true, only chars in elim allowed, otherwise,
  1285.     only chars not in elim allowed
  1286. */
  1287. __far BOOL strelim (char *s,char *elim,BOOL k);
  1288.  
  1289.  
  1290.  
  1291. MakeBox Function
  1292. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1293.  
  1294. /*
  1295.   Generates the necessary structures and SHORT values for a two pixel thick,
  1296.    two color box.  Returns pointer to first of two Border structures.  All
  1297.    information is allocated on the Remember key
  1298. */
  1299.  
  1300. __far struct Border *MakeBox (USHORT w,USHORT h,UBYTE c1,UBYTE c2,struct
  1301. Remember **key);
  1302.  
  1303.  
  1304.  
  1305. DetachUserPort Function
  1306. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1307.  
  1308. /*
  1309.     This function will detach the UserPort from a window so that
  1310.     the window may be closed without closing the UserPort,
  1311.     important if several windows are sharing a UserPort.
  1312. */
  1313.  
  1314. void DetachUserPort(struct Window *win);
  1315.  
  1316.  
  1317.  
  1318. GTAllocCLBit Function
  1319. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1320.  
  1321. /* Allocates and returns a CallLoop Bit for a GTRequester */
  1322. BYTE GTAllocCLBit (struct GTRequest *req);
  1323.  
  1324.  
  1325.  
  1326. GTFreeCLBit Function
  1327. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1328.  
  1329. /* Frees a CallLoop Bit for a GTRequester */
  1330. void GTFreeCLBit (struct GTRequest *req,UBYTE bit);
  1331.  
  1332.  
  1333.  
  1334. InitReqSet Function
  1335. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1336.  
  1337. /*
  1338.     This function initializes a ReqSet structure.  It must be called
  1339.     before any requests are added to the ReqSet.
  1340. */
  1341.  
  1342. void InitReqSet(struct GTReqSet *rs);
  1343.  
  1344.  
  1345.  
  1346. EndAllRequests Function
  1347. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1348.  
  1349. /*
  1350.     This function calls EndGTRequest for each requester in a ReqSet,
  1351.     Causing them all to end as soon as ProcessReqSet is called/returned to
  1352. */
  1353.  
  1354. void EndAllRequests(struct GTReqSet *rs,LONG terminate,struct
  1355. MessageHandler *mh, struct GTControl *gtc);
  1356.  
  1357.  
  1358.  
  1359. AddGTRequest Function
  1360. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1361.  
  1362. /*
  1363.     This function opens a requester, allocates the gadgets, displays imagery,
  1364.     etc, and adds the requester to the ReqSet
  1365. */
  1366.  
  1367. LONG AddGTRequest(struct GTReqSet *rs,struct GTRequest *gtr);
  1368.  
  1369.  
  1370.  
  1371. ProcessReqSet Function
  1372. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1373.  
  1374. /*
  1375.     Call This function to process messages sent to all requesters in
  1376.     the given ReqSet.  Each requester will work just as if it
  1377.     had been opened by GTRequest and was running by itself.
  1378.     More requesters can be added to the set while ProcessReqSet is
  1379.     running.  ProcessReqSet returns only when all requesters in the
  1380.     ReqSet have terminated.
  1381. */
  1382. __far void ProcessReqSet (struct GTReqSet *set);
  1383.  
  1384.  
  1385.  
  1386. DuplicateRequest Function
  1387. This is defined in GTRequest.c and prototyped in GTRequest.h:
  1388.  
  1389. /*
  1390.     You cannot call AddGTRequest and add the same requester to a ReqSet
  1391.     twice.    You must duplicate the Requester and add the duplicate
  1392.     to the ReqSet.    The below function does this.  When the request
  1393.     is finished, free the key to recover memory.
  1394. */
  1395.  
  1396. struct Request *DuplicateRequest (struct Remember **key,struct GTRequest
  1397. *req);
  1398.  
  1399.  
  1400.  
  1401. CreateEditListKind Function
  1402. /***********************************************************************/
  1403. /*  Set a GTPKind's Create field to this function to establish a       */
  1404. /*  Edit List pseudokind.                           */
  1405. /***********************************************************************/
  1406.  
  1407. __far struct Gadget *CreateEditListKind(struct GTPKind *kclass,struct Gadget *gad,
  1408.                   struct GTControl *gtc,struct GTRequest *req,
  1409.                   struct VisualInfo *vinfo);
  1410.  
  1411.  
  1412.  
  1413. AddNodeAlpha Function
  1414. /***********************************************************************/
  1415. /*  This function adds a node to a list in alphabetical order by       */
  1416. /*  Node->ln_Name.  If NODUPLICATES flag is specified, node will not   */
  1417. /*  be added if another node with the same name is already in the      */
  1418. /*  list.  1 is returned if the node is added, 0 otherwise.           */
  1419. /***********************************************************************/
  1420.  
  1421. #define NODUPLICATES 1
  1422. LONG AddNodeAlpha(struct List *l,struct Node *n,ULONG flags);
  1423.  
  1424.  
  1425.  
  1426.  
  1427. CountNodesInList Function
  1428. /***********************************************************************/
  1429. /* CountNodesInList returns the number of nodes in the given list.     */
  1430. /***********************************************************************/
  1431.  
  1432. ULONG CountNodesInList(struct List *l);
  1433.  
  1434.  
  1435.  
  1436.  
  1437. AddNamedNodeToList Function
  1438. /***********************************************************************/
  1439. /* AddNamedNodeToList allocates a node on the given key, allocates a   */
  1440. /* string big enough for the given name on the given key, and adds the */
  1441. /* new node to the list.  If the ALPHA flag is specified the Node is   */
  1442. /* added in alphabetical order                           */
  1443. /***********************************************************************/
  1444.  
  1445. #define ALPHA 1
  1446. struct Node *AddNamedNodeToList(struct Remember **key,struct List *l,UBYTE *name,
  1447.     ULONG size,ULONG flags);
  1448.  
  1449.  
  1450.  
  1451.  
  1452. ChangeNodesName Function
  1453. /***********************************************************************/
  1454. /* ChangeNodesName allocates enough room on the given key for the      */
  1455. /* new name, and assigns the node->ln_Name to the newly allocated      */
  1456. /* memory.  It then copies the given name into the newly allocated     */
  1457. /* memory.                                   */
  1458. /***********************************************************************/
  1459.  
  1460. UBYTE ChangeNodesName(struct Remember **key,struct GTRequest *req,
  1461.     struct GTControl *gtc,struct List *l,struct Node *n,UBYTE *newname);
  1462.  
  1463.  
  1464.  
  1465.  
  1466. AddEntryToListBox Function
  1467. /***********************************************************************/
  1468. /* AddEntryToListBox calls AddNamedNodeToList to add a node with the   */
  1469. /* given name to a list box.  It also detaches the list from the list  */
  1470. /* box before beginning, and reattaches it when its done.           */
  1471. /***********************************************************************/
  1472.  
  1473. struct Node *AddEntryToListBox(struct Remember **key,struct GTRequest *req,
  1474.     struct GTControl *gtc,struct List *l,UBYTE *name,ULONG size,ULONG flags);
  1475.  
  1476.  
  1477.  
  1478.  
  1479. RemoveEntryFromListBox Function
  1480. /***********************************************************************/
  1481. /*  RemoveEntryFromListBox detaches the given list from the list box,  */
  1482. /*  removes the given node from the list, and reattaches the list to   */
  1483. /*  the list box.  It does not free the node.                   */
  1484. /***********************************************************************/
  1485.  
  1486. UBYTE RemoveEntryFromListBox(struct GTRequest *req,struct GTControl *gtc,
  1487.     struct List *l,struct Node *n);
  1488.  
  1489.  
  1490.  
  1491.  
  1492. NodeToOrd Function
  1493. /***********************************************************************/
  1494. /*  NodeToOrd returns a node's ordinal position in the list.  The      */
  1495. /*  first node in the list is 0, the second 1, and so on.           */
  1496. /*  Convenient if you want to set a ListBox's selected attribute to    */
  1497. /*  a given node, but know only a node address and not its ordinal     */
  1498. /*  position, which Intuition requires.                    */
  1499. /***********************************************************************/
  1500.  
  1501. ULONG NodeToOrd(struct List *l,struct Node *n);
  1502.  
  1503.  
  1504.  
  1505.  
  1506. OrdToNode Function
  1507. /***********************************************************************/
  1508. /*  OrdToNode returns a node address from an ordinal position in the   */
  1509. /*  list (like what you get out of msg->Code or Control->Attribute     */
  1510. /*  when dealing with a ListView_Kind).                    */
  1511. /***********************************************************************/
  1512.  
  1513. struct Node *OrdToNode(struct List *l,ULONG ord);
  1514.  
  1515.  
  1516.  
  1517.