home *** CD-ROM | disk | FTP | other *** search
-
- INTRODUCTION
-
- This document describes OpalPaint's Build_Request function which is
- available to all OpalPaint modules. Build_Request provides a simple way of
- generating requesters while keeping a consistent OpalPaint style interface
- for the user.
-
- Build_Request is the requester function used to build all of OpalPaint's
- requesters. Build_Request provides a consistent interface through all of
- the requesters, providing functions such as double click on gadgets to
- close requesters, keyboard equivalents for OK and CANCEL, requester
- dragging and help. It is STRONGLY suggested that you use this function for
- all requesters, if however you need more control for an interface such as
- the ChromaCTRL draw mode the pointers to OpalPaints screen and window are
- provided to most OpalPaint modules.
-
- Build_Request can be called recursively, for example, a gadget on one
- requester can cause another requester to be displayed without removing the
- first.
-
- There are 2 versions of Build_Request available, the best one to use is
- Build_Req_Tags, which takes its parameters as a standard AmigaDOS 2.0
- taglist. The Build_Request function takes its parameters on the stack and
- is provided for backward compatibility, it should however be considered as
- obselete.
-
-
- OpalPaint/Build_Req_Tags
-
- SYNOPSIS
- Res = Build_Req_Tags (struct TagItem *TagList);
-
-
- INPUTS
- Pointer to a standard 2.0 taglist.
-
- RETURNS
- TRUE if the user hit the OK gadget.
- FALSE if the user hit the CANCEL gadget.
-
-
- FUNCTION
-
- TagItem descriptions:
-
- OPBR_Width
- Specifies the requester width in pixels.
-
- OPBR_Height
- Specifies the requester height in pixels.
-
- OPBR_Flags
- Various flags to specify the requirement for the requester:
-
- BRF_CANCEL Include a Cancel gadget in the requester.
- BRF_RETURN Don't handle messages, return after building
- requester (user only if absolutely necessary).
- BRF_MBUTTONS Call GadgetFunc when SELECTUP messages are received.
- BRF_NOOK Don't include an OK gadget in requester.
- BRF_MEDGADS Use Medium size OK & Cancel gadgets
- BRF_BIGGADS Use larger OK & Cancel gadgets
- BRF_GADHELP Gadget dynamic help text is being used.
- BRF_FORCETOP Make sure requester is above menu bar if possible.
- BRF_DRAGABLE Requester can be dragged by the user.
- BRF_AMIGAGUIDE Enable Online help.
-
- OPBR_IText
- Pointer to an IntuiText structure to be displayed in the requester.
- This can be a linked list of structures to specify headings and
- other text in the requester which are not part of a gadget structure.
-
- OPBR_Gadgets
- Pointer to a gadget list structure of the gadgets to be displayed
- in the requester (NOTE: the REQGADGET flags must be set on all
- gadgets). See below for a description of gadget functions.
-
- OPBR_GadFunc
- Pointer to a function which will be called when a gadget is hit.
- See below for a description.
-
- OPBR_InitFunc
- Pointer to a function which will be called shortly after the
- requester is displayed, this function can be used for custom
- rendering into the requester. See below for a desciption.
-
- OPBR_MouseMoveFunc
- Pointer to a function which will be called when a MOUSEMOVE
- message is received. This function is useful for giving
- dynamic feedback with propgadgets. See below for description.
-
- OPBR_HelpX
- Left edge of region to display gadget dynamic help text. This
- edge must be specified in pixels relative to the requester
- left edge. See below for a description of dynamic help.
-
- OPBR_HelpY
- Top edge of region to display gadget dynamic help text. This
- edge must be specified in pixels relative to the requester
- top edge. See below for a description of dynamic help.
-
- OPBR_AGuideName
- Pointer to the name of the AmigaGuide file for online help.
- See below for a description of online help.
-
- OPBR_Context
- Pointer to a context structure for online help. See below
- for a description of online help.
-
-
- OpalPaint will center the requester within the main screen. Requester
- positioning is important as OpalPaint's screen size will vary depending on
- whether the machine is PAL or NTSC and the amount of chip ram available.
-
-
- GADGETS IN REQUESTERS
-
- Build_Request will always add an OK Gadget to the requester (unless the
- BRF_NOOK flag is specified) and will add a Cancel gadget if the BRF_CANCEL
- flag is specified.
-
- Gadget ID 1 is used for the OK gadget and ID 2 is used for the Cancel
- gadget, gadget ID's should start from 3. If the GadgetID is <100 and the
- gadget is double clicked on by the user, the requester will automatically
- be closed.
-
- Build_Request also handles mutual exclusion automatically. The first 32
- gadgets can take part in mutual exclusion. Bits 1&2 correspond to OK and
- Cancel gadgets, bit 3 corresponds to the first gadget in the specified
- list. Whenever a gadget is selected who's MutualExclude field is non-zero,
- Build_Request will check each of the first 32 gadgets in the requester one
- at a time, if the bit corresponding to a gadget is set, and that gadget is
- selected, it will be deselected and refreshed. Also, Build_Request will
- not allow the user to deselect a gadget if its had a non-zero MutualExclude
- field, the only way it can be deselected is by selecting another gadget
- which will exclude it.
-
- CALLBACK FUNCTIONS
-
- To provide complete control over the requester, OpalPaint allows CallBack
- functions to be used to pass control back to your program at different
- times during the life of the requester. You must be aware that these
- functions will be called under OpalPaint's context (even for LSIModules) so
- you must be careful that the data segment register is correctly
- initialised. This can be done by using FAR code or by using the 'saveds'
- option in SAS/C. You must also disable stack checking.
-
- You should also note that the callback functions are called using standard
- C conventions (i.e. parameters on the stack).
-
- The requester can be closed during CallBack functions using the
- OPEndRequest function.
-
-
- INITFUNC
-
- Synopsis:
- void InitFunc (struct RastPort *ReqRP,struct Requester *Req),
-
-
- This is a pointer to a function which will be called immediately after the
- requester has been built. This function can be used to do your own custom
- rendering into the requester, to render borders etc. InitFunc is passed a
- pointer to the Requester structure, as well as the Requester's RastPort.
- You may want to save these pointers to perform rendering in the 'MMFunc' or
- 'GadgetFunc' functions.
-
- NOTE: Whenever the requester is dragged, this requester will be closed and
- then reopened at the new location, and InitFunc will then be called again.
- It is important that InitFunc can be called mulitiple times without any
- side effects. For example problems will occur if you assume that InitFunc
- will only be called once, and perform and AddGList() function without
- checking the gadget list, this will cause an invalid gadget list structure
- if the gadgets are added more than once.
-
-
- GADGETFUNC
-
- Synopsis:
- void GadgetFunc (struct Gadget *Gad, BOOL DClick, BOOL RMB, BOOL Tick)
-
- GadgetFunc is executed whenever a gadget has been hit and, if the
- BRF_MBUTTONS flag is specified, when a SELECTUP message is received. The
- point at which this function is called when a gadget is selected by the
- user will depend on the settings of the RELVERIFY and GADGIMMEDIATE flags
- in the gadget structure.
-
- 'GadgetFunc' is passed a pointer to the gadget structure for the gadget
- that has been selected, as well as the DClick, RMB and TICK flags. DClick
- is TRUE if a gadget has been double clicked on, if the GadgetID is less
- than 100, the requester will be closed down immediatelty after GadgetFunc
- had been called. RMB is TRUE if the gadget was selected using the right
- mouse button instead of the left mouse button.
-
- If you wish a gadget to Auto-Repeat, such as an arrow gadget associated
- with a prop gadget, then you can enable INTUITICK messages from the
- GadgetFunc when the GADGETDOWN message is received, whenever Build_Request
- receives an INTUITICK message, it will call GadgetFunc with 'Tick' set to
- TRUE.
-
- If the BRF_MBUTTONS flag is set and a SELECTUP message is received,
- Build_Request will call GadgetFunc with the Gadget parameter set to NULL.
-
- MMFUNC
-
- Synopsis:
- void MMFunc (struct Gadget *Gad)
-
- MMFunc is a pointer to a function which will get called whenever a
- MOUSEMOVE message, or a GADGETDOWN message on a propgadget, is received.
- This can be used to dynamically update text in a requester whenever a
- propgadget is moved. Note that the FOLLOWMOUSE flag must be set in the
- gadget structure.
-
-
- HELP IN REQUESTERS
-
- Build_Request provides two types of help within the requesters. The first
- is called 'Dynamic Help' and is used to display help text within the
- requester whenever the user moves the mouse pointer over a gadget with help
- text associated with it.
-
- The second form of help is called 'OnLine Help', this uses the standard
- AmigaDOS 2.0 AmigGuide interface to bring up a seperate help screen
- whenever the user hits the HELP key when within the requester.
-
- DYNAMIC HELP
-
- Build_Request also supports dynamic help. To use this feature set the
- BRF_GADHELP Flag and set OPBR_HelpX and OPBR_HelpY to specify the
- top-lefthand edge of a region used to display help text. For each gadget
- which has help text, set the UserData field in the gadget structure to
- point to a help string. This help string can contain multiple lines of
- null (0) terminated string, and is finally terminated with 2 nulls. If a
- line of text starts with 0xFA, the line will be printed in Blue, else it
- will be white.
-
- To see dynamic help in action see the Brush Manipulation menu in OpalPaint
- (Right mouse button on the 'B1' gadget).
-
-
- ONLINE HELP
-
- Online help will display a standard AmigaGuide window whenever the user
- hits the HELP key within a requester. This help is context sensitive in
- that if the user poisitions the mouse pointer over a gadget it will jump to
- the correct page for that gadget, if the user is not over a gadget then a
- page giving a general description of the requester should be displayed.
-
- To use online help, you must set the BRF_AMIGAGUIDE flags and specify the
- name of the AmigaGuide file contains the HyperText format help using the
- OPBR_AGuideName (within OpalPaint itself, this field is always
- 'OpalPaint:Help/OpalPaint.guide').
-
- A context structure must also be passed using OPBR_Context, this is a
- standard context structure used by the amigaguide.library. Basically this
- is an array of string pointers pointing to the node names associated with
- each gadget. The first entry should be the node containing a general
- description of the requester. The following nodes will be indexed by the
- GadgetID of the gadget under the mouse pointer when HELP was pressed. The
- first GadgetID should be 3, so GadgetID-2 is used as the index. If the
- GadgetID is greater than 100 (disabling the double click feature) then 100
- will be subtracted from the ID.
-
- Therefore some thought has to go into the assignment of GadgetID's. For
- example lets say you have 4 gadgets in the requester, the first two will
- close the requester when double clicked, and the second two won't, then
- assign the GadgetID's 3,4 to the first two and 105,106 to the second two
- gadgets. The following context structure will then be indexed correctly
- using those ID's:
-
- STRPTR MyReq_Context[] =
- { "General_Info", /* General description of requester */
- "Gad1_Help", /* Help for GadgetID 3 */
- "Gad2_Help", /* Help for GadgetID 4 */
- "Gad3_Help", /* Help for GadgetID 105 (note: ID-100) */
- "Gad4_Help" /* Help for GadgetID 106 (note: ID-100) */
- };
-
-
- Build_Request will display the standard OpalPaint help for the OK and
- Cancel gadgets (GadgetID's 1&2).
-
-
-
-
- OpalPaint/OPEndRequest
-
- SYNOPSIS
- void OPEndRequest(void)
-
- INPUTS
- None
-
- RESULTS
- None
-
- FUNCTION
-
- This function will end a requester created with Build_Request. This can be
- used within any of the callback functions (such as GadgetFunc) to end the
- requester without the user hiting OK or CANCEL. This function MUST be used
- if you wish to close the requester DO NOT use the intuition function
- EndRequest as OpalPaint needs to do its own cleaning up.
-
-
-
-
- Martin Boyd, Opal Technology.
-
-
- If you have any questions I am contactable at (in order of preference):
-
- OpalVision BBS +1 310 793 7142 'MartinB'
- Internet: Martin_David_Boyd@cup.portal.com
- Bix: mboyd
-