home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- RTGGadTools/RGAddGadget
- RTGGadTools/RGDisposeAnchor
- RTGGadTools/RGDisposeGadget
- RTGGadTools/RGDoGadgets
- RTGGadTools/RGGadgetState
- RTGGadTools/RGNewAnchor
- RTGGadTools/RGNewGadget
- RTGGadTools/RGRefreshGList
- RTGGadTools/RGRemGadget
- RTGGadTools/RGAddGadget RTGGadTools/RGAddGadget
-
- NAME
- RGAddGadget -- Add a gadget to an anchor list
-
- SYNOPSIS
- err=RGAddGadget(anchor, gadget, pos);
- D0 A0 A1 D0
- BOOL RGAddGadget(APTR, RGGadget, LONG);
-
- FUNCTION
- Add a given gadget to an achor list. Gadgets in the anchor
- list are considered "active", and thus get rendered/used
- within a RGDoGadget() call.
-
- INPUTS
- anchor - Gadget anchor.
- gadget - The gadget to be added.
- pos - the position where the gadget should be added.
- see notes.
-
- RESULT
- err - Boolean value representing success (TRUE) or
- failuer (error)
-
- EXAMPLE
- see example programs
-
- NOTES
- The position you specify should be either a positive integer
- representing the position where the gadget should be added,
- zero if you want to add to the beginning of the list (fastest)
- and -1 if you want to add to the end. Normally there shouldn't
- be a reason not to use zero.
-
- BUGS
- none known
-
- SEE ALSO
- RGDoGadget(), RGRemGadget(), RGDisposeGadget(), RGNewAnchor()
-
- RTGGadTools/RGDisposeAnchor RTGGadTools/RGDisposeAnchor
-
- NAME
- RGDisposeAnchor -- Delete an Anchor structure (V1)
-
- SYNOPSIS
- RGDisposeAnchor(anchor);
- A0
- void RGDisposeAnchor(APTR);
-
- FUNCTION
- Dispose an Anchor created by RGNewAnchor()
-
- INPUTS
- anchor - the anchor to be disposed
-
- RESULT
- none
-
- EXAMPLE
- see example programs
-
- NOTES
- If there are still gadgets attached to the anchor, they get
- deleted along with it. If you do not want this behavior, you
- will have to remove the gadgets manually.
-
- BUGS
- none known
-
- SEE ALSO
- RGNewAnchor()
-
- RTGGadTools/RGDisposeGadget RTGGadTools/RGDisposeGadget
-
- NAME
- RGDisposeGadget -- Delete a RGGadget (V1)
-
- SYNOPSIS
- RGDisposeGadget(gad);
- A0
- RGDiposeGadget(RGGadget);
-
- FUNCTION
- Dispose the gadget created by RGNewGadget()
-
- INPUTS
- gad - pointer to a RGGadget
-
- RESULT
- none
-
- EXAMPLE
- see example programs
-
- NOTES
- Don't pass an invalid pointer. NULL pointers will be dealt
- with correctly, but anything else may be lethal.
-
- BUGS
- None known.
-
- SEE ALSO
- RGNewGadget
-
- RTGGadTools/RGDoGadgets RTGGadTools/RGDoGadgets
-
- NAME
- RGDoGadgets -- Do the gadget man (V1)
-
- SYNOPSIS
- ret=RGDoGadgets(anchor,msg);
- D0 A0 A1
- LONG RGDoGadgets(APTR,APTR);
-
- FUNCTION
- This is the core of the gadgets system. This routine should be
- called each time in your applications main loop, with the current
- RDCMP message, even if this is NULL.
-
- INPUTS
- anchor - the anchor structure
- msg - the current RDCMP message
-
- RESULT
- ret - NULL if no gadget was used. Otherwise, returns
- the number specified in UpAction/DownAction if this
- wasn't a hook function.
-
- EXAMPLE
- see the example programs
-
- NOTES
- Calling this function with a msg value of -1 will just render
- the complete list of gadgets.
-
- BUGS
- none known
-
- SEE ALSO
- RGNewGadget(), RGAddGadget()
-
- RTGGadTools/RGGadgetState RTGGadTools/RGGadgetState
-
- NAME
- RGGadgetState -- Change the state of a gadget (V1)
-
- SYNOPSIS
- RGGadgetState(gadget, state);
- A0 D0
- void RGGadgetState(RGGadget, ULONG);
-
- FUNCTION
- This function enables or disables a gadget. This is nothing
- more than setting the gadgets RGF_Disabled field, depending
- on the value of state.
-
- INPUTS
- gadget - The gadget to manipulate
- state - one of the following:
- RGS_Disable : Disable the gadget for input
- RGS_Enable : Enable the gadget for input
- RGS_Toggle : Toggle the enable/disable state
-
- RESULT
- This function does not have a return value
-
- EXAMPLE
- see example programs
-
- NOTES
- Disabled gadgets are no longer active for input. They are,
- however, still a part of the anchor and as such are redrawn
- whenever parts of the list get refreshed containing the gadget.
-
- BUGS
- none known.
-
- SEE ALSO
- RGNewGadget()
-
- RTGGadTools/RGNewAnchor RTGGadTools/RGNewAnchor
-
- NAME
- RGNewAnchor -- Create an Anchor structure (V1)
-
- SYNOPSIS
- anchor=RGNewAnchor(screen, buffers, colormodel);
- D0 A0 D0 D1
- APTR RGNewAnchor(APTR, ULONG, BOOL);
-
- FUNCTION
- Create a new anchor structure. An Anchor structure is used as a
- reference for active gadgets. This is a blackbox structure, should
- not be read directly.
-
- INPUTS
- screen - The RTGScreen you want the gadgets to appear on.
- This is needed when RTGGadTools wants to render it's
- gadgets automatically.
- buffers - The number of buffers you opened this screen with
- colormodel - A boolean indicating wether this screen is a
- Direct-Color screen with more than 256 colors (TRUE)
- or a color-mapped screen (FALSE).
-
- RESULT
- An Anchor structure or NULL on failure.
-
- EXAMPLE
- see examples programs
-
- NOTES
- THe Anchor structure should not be accessed directly. Apart from
- that, there isn't anything it it you really want to see...
-
- The Color model is required since RTGGadTools must select the
- appropriate functions when using the default rendering method.
-
- BUGS
- none known.
-
- SEE ALSO
- RGDoGadgets(), RGAddGadget(), RGRemGadget()
-
- RTGGadTools/RGNewGadget RTGGadTools/RGNewGadget
-
- NAME
- RGNewGadget -- Create a new RTGGadTools Gadget (V1)
-
- SYNOPSIS
- gadget = RGNewGadget(tags);
- D0 A0
- RGGadget RGNewGadget(struct TagItem *);
-
- gadget = RGNewGadgetTags(tag1...);
- RGGadget RGNewGadget(Tag ...);
-
- FUNCTION
- This function creates a new gadget with the parameters given
- in the taglist. The gadget's parameters must be passed via a
- taglist. Ommitted parameters will be given default values.
-
- INPUTS
- This functions accepts the following tag items:
-
- RGG_LeftEdge
- RGG_TopEdge
- RGG_Width
- RGG_Height (ULONG)
- The Obvious. If you don't specify LeftEdge or TopEdge,
- zero will be assumed. Width and Height are calculated to
- the best of knowledge when the gadget is created, but
- this is very likely to break. Better specify everything.
-
- RGG_RenderText (STRPTR)
- Gives a text string that should be rendered inside the
- gadget
-
- RGG_RenderImage (APTR)
- The rectangular area pointed to by his tag value is to be
- used as the source for a WritePixelArray/WritePixelRGBArray
- when rendering this gadget. Note that you *MUST* specify
- Width and Height if you want to use this feature. See
- also RGG_SelectRender
-
- RGG_SelectRender (APTR)
- Gives a pointer to an alternate image to be drawn when the
- button is pressed. Only valid if a RGG_RenderImage was given,
- will be ignored otherwise. Images should match in size, or
- you will get artefacts from improper deleting images.
-
- RGG_UpAction (function or ULONG)
- Depending on the flags value, the value of this tag item
- is interpreted either as a function which is to be called
- when the gadget is pressed (if the RGF_UpAction flag is set)
- or an ULONG which is returned by RGDoGadgets(). This function
- is called with a pointer to the gadget structure in register
- a0.
-
- RGG_DownAction (function or ULONG)
- Same as RGG_UpAction when the gadget is released...
-
- RGG_RenderHook (function pointer)
- When this TagItem is given, the value is interpreted as a
- function that gets called whenever the gadget needs to be
- rendered. The function is called with these parameters:
-
- A0: Pointer to the gadget structure
-
- It is completely up to you what this function does. You should
- however examine the flags word in the gadget structure and
- take care of the RGF_Selected and RGF_Disabled flags when
- rendering...
-
- RGG_HitTest (function pointer)
- If you need arbitrarily shaped gadgets, you can insert your
- own hittest here. Normally, gadgets assume they are hit
- if their HitBox got clicked. If you want parts of your gadget
- to react different, supply this method. The function gets
- called with these parameters:
-
- A0: Pointer to the gadget structure
- D0/D1: X/Y coords of mouse hit.
-
- The coordinates you receive are absolute screen coordinates,
- and there's no guarantee that they are within you bounding
- box. This means that you could (theoretically) create gadgets
- with hit areas bigger than their bounding box. This is, however,
- considered bad behaviour.
-
- You should clear D0 on return to indicate your gadget has
- been missed, or TRUE otherwise.
-
- RGG_Flags (ULONG)
- One of the #define'd flags. See rtggadtools.h
-
- RGG_HiPen
- RGG_LoPen
- RGG_TextPen (UWORD)
- A pen value (i.e. 0..2^depth) for the "highlighted" edges of
- the 3D frame, "shadowed edges" and the text color, respectively
-
-
- RESULT
- gadget - NULL in case an error occured during creation.
- otherwise an RGGadget.
-
- EXAMPLE
- see examples programs provieded with this package
-
- NOTES
- The RGGadget structure is read_only. You may not directly modify
- the values, use RGSetAttr().
-
- BUGS
- Many, probably.
-
- SEE ALSO
- RGDoGadgets(), RGSetAttrs()
-
- RTGGadTools/RGRefreshGList RTGGadTools/RGRefreshGList
-
- NAME
- RGRefreshGList -- Redraw a list of gadgets (V1)
-
- SYNOPSIS
- RGRefreshGList(anchor, gadget, num);
- A0 A1 D0
- void RGRefreshGList(APTR, RGGadget, LONG);
-
- FUNCTION
- Refresh a number of gadgets (redraw them), starting from gadget
- in anchor, drawing num gadgets. The gadgets are drawn in every
- available buffer to fix problems with double buffering.
-
- INPUTS
- anchor - A valid Anchor structure
- gadget - A gadget within this anchor, or NULL for all gadgets
- num - Number of gadgets to draw. May be -1 to redraw all
- gadgets after gadget.
-
- RESULT
- This function does not have a return value.
-
- EXAMPLE
- see example programs
-
- NOTES
- Handling gadgets consistantly on multi-buffered screens is a
- bit of a problem with the minimal control RTGGadTools has
- over the screen switching process. Therefore, every time a
- gadget is redrawn, it is redrawn in every buffer. This should
- not pose too much overhead, since gadgets are usually small.
- This behavior might change in future version.
-
-
- BUGS
- None known.
-
- SEE ALSO
- RGNewAnchor(), RGDoGadgets(), RGNewGadget()
-
- RTGGadTools/RGRemGadget RTGGadTools/RGRemGadget
-
- NAME
- RGRemGadget -- Remove a gadget from the active list (V1)
-
- SYNOPSIS
- gad=RGRemGadget(anchor, gadget);
- D0 A0 A1
- RGGadget RGRemGadget(APTR, RGGadget);
-
- FUNCTION
- Remove the gadget from the anchor's list.
-
- INPUTS
- anchor - The Gadget Anchor
- gadget - Gadget to remove
-
- RESULT
- gad - Pointer to the removed gadget or NULL on failure
-
- EXAMPLE
- see example programs
-
- NOTES
- Gadgets removed from the list will not be handled anymore by
- RGDoGadgets().
-
- BUGS
- None known.
-
- SEE ALSO
- RGDoGadget(), RGAddGadget();
-
-