Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "GadTools Library"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
Line 43: Line 43:
 
The following are brief descriptions of the Intuition functions discussed in this chapter. See the SDK for details on each function call.
 
The following are brief descriptions of the Intuition functions discussed in this chapter. See the SDK for details on each function call.
   
  +
{| class="wikitable"
<table>
 
  +
! Function
<tr class="header">
 
  +
! Description
<th align="left">'''Function'''</th>
 
  +
|-
<th align="left">'''Description'''</th>
 
  +
| CreateGadgetA()
</tr>
 
  +
| Allocate GadTools gadget, tag array form.
<tr class="odd">
 
  +
|-
<td align="left">CreateGadgetA()</td>
 
  +
| CreateGadget()
<td align="left">Allocate GadTools gadget, tag array form.</td>
 
  +
| Allocate GadTools gadget, varargs form.
</tr>
 
  +
|-
<tr class="even">
 
  +
| FreeGadgets()
<td align="left">CreateGadget()</td>
 
  +
| Free all GadTools gadgets.
<td align="left">Allocate GadTools gadget, varargs form.</td>
 
  +
|-
</tr>
 
  +
| GT_SetGadgetAttrsA()
<tr class="odd">
 
  +
| Update gadget, tag array form.
<td align="left">FreeGadgets()</td>
 
  +
|-
<td align="left">Free all GadTools gadgets.</td>
 
  +
| GT_SetGadgetAttrs()
</tr>
 
  +
| Update gadget, varargs form.
<tr class="even">
 
  +
|-
<td align="left">GT_SetGadgetAttrsA()</td>
 
  +
| CreateContext()
<td align="left">Update gadget, tag array form.</td>
 
  +
| Create a base for adding GadTools gadgets.
</tr>
 
  +
|-
<tr class="odd">
 
  +
| CreateMenusA()
<td align="left">GT_SetGadgetAttrs()</td>
 
  +
| Allocate GadTools menu structures, tag array form.
<td align="left">Update gadget, varargs form.</td>
 
  +
|-
</tr>
 
  +
| CreateMenus()
<tr class="even">
 
  +
| Allocate GadTools menu structures, varargs form.
<td align="left">CreateContext()</td>
 
  +
|-
<td align="left">Create a base for adding GadTools gadgets.</td>
 
  +
| FreeMenus()
</tr>
 
  +
| Free menus allocated with CreateMenus().
<tr class="odd">
 
  +
|-
<td align="left">CreateMenusA()</td>
 
  +
| LayoutMenuItemsA()
<td align="left">Allocate GadTools menu structures, tag array form.</td>
 
  +
| Format GadTools menu items, tag array form.
</tr>
 
  +
|-
<tr class="even">
 
  +
| LayoutMenuItems()
<td align="left">CreateMenus()</td>
 
<td align="left">Allocate GadTools menu structures, varargs form.</td>
+
| Format GadTools menu items, varargs form.
  +
|-
</tr>
 
  +
| LayoutMenusA()
<tr class="odd">
 
  +
| Format GadTools menus, tag array form.
<td align="left">FreeMenus()</td>
 
  +
|-
<td align="left">Free menus allocated with CreateMenus().</td>
 
  +
| LayoutMenus()
</tr>
 
  +
| Format GadTools menus, varargs form.
<tr class="even">
 
  +
|-
<td align="left">LayoutMenuItemsA()</td>
 
  +
| GT_GetIMsg()
<td align="left">Format GadTools menu items, tag array form.</td>
 
  +
| GadTools gadget compatible version of GetMsg().
</tr>
 
  +
|-
<tr class="odd">
 
  +
| GT_ReplyIMsg()
<td align="left">LayoutMenuItems()</td>
 
  +
| GadTools gadget compatible version of ReplyMsg().
<td align="left">Format GadTools menu items, varargs form.</td>
 
  +
|-
</tr>
 
  +
| GT_FilterIMsg()
<tr class="even">
 
  +
| Process GadTools gadgets with GetMsg()/ReplyMsg().
<td align="left">LayoutMenusA()</td>
 
  +
|-
<td align="left">Format GadTools menus, tag array form.</td>
 
  +
| GT_PostFilterIMsg()
</tr>
 
  +
| Process GadTools gadgets with GetMsg()/ReplyMsg().
<tr class="odd">
 
  +
|-
<td align="left">LayoutMenus()</td>
 
  +
| GT_RefreshWindow()
<td align="left">Format GadTools menus, varargs form.</td>
 
  +
| Display GadTools gadget imagery after creation.
</tr>
 
  +
|-
<tr class="even">
 
  +
| GT_BeginRefresh()
<td align="left">GT_GetIMsg()</td>
 
<td align="left">GadTools gadget compatible version of GetMsg().</td>
+
| GadTools gadget compatible version of BeginRefresh().
  +
|-
</tr>
 
  +
| GT_EndRefresh()
<tr class="odd">
 
  +
| GadTools gadget compatible version of EndRefresh().
<td align="left">GT_ReplyIMsg()</td>
 
  +
|-
<td align="left">GadTools gadget compatible version of ReplyMsg().</td>
 
  +
| DrawBevelBoxA()
</tr>
 
  +
| Draw a 3D box, tag array form.
<tr class="even">
 
  +
|-
<td align="left">GT_FilterIMsg()</td>
 
  +
| DrawBevelBox()
<td align="left">Process GadTools gadgets with GetMsg()/ReplyMsg().</td>
 
  +
| Draw a 3D box, varargs form.
</tr>
 
  +
|-
<tr class="odd">
 
  +
| GetVisualInfoA()
<td align="left">GT_PostFilterIMsg()</td>
 
  +
| Get drawing information for GadTools, tag array form.
<td align="left">Process GadTools gadgets with GetMsg()/ReplyMsg().</td>
 
  +
|-
</tr>
 
  +
| GetVisualInfo()
<tr class="even">
 
  +
| Get drawing information for GadTools, varargs form.
<td align="left">GT_RefreshWindow()</td>
 
  +
|-
<td align="left">Display GadTools gadget imagery after creation.</td>
 
  +
| FreeVisualInfo()
</tr>
 
  +
| Free drawing information for GadTools.
<tr class="odd">
 
  +
|}
<td align="left">GT_BeginRefresh()</td>
 
<td align="left">GadTools gadget compatible version of BeginRefresh().</td>
 
</tr>
 
<tr class="even">
 
<td align="left">GT_EndRefresh()</td>
 
<td align="left">GadTools gadget compatible version of EndRefresh().</td>
 
</tr>
 
<tr class="odd">
 
<td align="left">DrawBevelBoxA()</td>
 
<td align="left">Draw a 3D box, tag array form.</td>
 
</tr>
 
<tr class="even">
 
<td align="left">DrawBevelBox()</td>
 
<td align="left">Draw a 3D box, varargs form.</td>
 
</tr>
 
<tr class="odd">
 
<td align="left">GetVisualInfoA()</td>
 
<td align="left">Get drawing information for GadTools, tag array form.</td>
 
</tr>
 
<tr class="even">
 
<td align="left">GetVisualInfo()</td>
 
<td align="left">Get drawing information for GadTools, varargs form.</td>
 
</tr>
 
<tr class="odd">
 
<td align="left">FreeVisualInfo()</td>
 
<td align="left">Free drawing information for GadTools.</td>
 
</tr>
 
</table>
 

Revision as of 19:15, 24 May 2013

GadTools Library

GadTools is designed to simplify the task of creating user interfaces with Intuition. GadTools offers a flexible and varied selection of gadgets and menus to help programmers through what used to be a difficult chore.

Intuition, the Amiga's graphical user interface, is a powerful and flexible environment. It allows a software designer a great degree of flexibility in creating dynamic and powerful user interfaces. However, the drawback of this flexibility is that programming even straightforward user interfaces can be complicated, and certainly difficult for first-time Intuition programmers.

What the Gadget Toolkit (GadTools) attempts to do is harness the power of Intuition by providing easy-to-use, high-level chunks of user interface. GadTools doesn't pretend to answer all possible user interface needs of every application but by meeting the user interface needs of most applications, GadTools greatly simplifies the problem of designing user-friendly software on the Amiga.

For applications with special needs, custom solutions can be created with Intuition's already-familiar gadgets or its new BOOPSI object-oriented custom gadget system; GadTools is compatible with these.

Elements of GadTools

GadTools is the easy way to program gadgets and menus. With GadTools, the system handles the detail work required to control gadgets and menus so the application uses less code and simpler data structures.

Another key benefit of GadTools is its standardized and elegant look. All applications that use GadTools will share a similar appearance and behavior. Users will appreciate a sense of instant familiarity even the first time they use a product.

GadTools provides a significant degree of visual consistency across multiple applications that use it. There is also internal consistency between different elements of GadTools; the look is clean and orderly. Depth is used not just for visual embellishment, but as an important cue. For instance, the user is free to select symbols that appear inside a "raised" area, but "recessed" areas are informational only, and clicking in them has no effect.

GadTools is not amenable to creative post-processing or hacking by programmers looking to achieve a result other than what GadTools currently offers. Software developers whose needs extend beyond the standard features of GadTools should create custom gadgets that share the look and feel of GadTools by using either BOOPSI or by directly programming gadgets at a lower level. See Intuition Gadgets and BOOPSI for more information. Follow the GadTools rules. Only in this way may GadTools grow and improve without hindrance, even allowing new features to automatically appear in future software when reasonable.

GadTools Tags

Many of the GadTools functions use TagItem arrays or tag lists to pass information across the function interface. These tag-based functions come in two types, one that takes a pointer to an array of tag items and one that takes a variable number of tag item arguments directly in the function call. In general, the second form, often called the varargs form because the call takes a variable number of arguments, is provided for convenience and is internally converted to the first form. When looking through the Autodocs or other Amiga reference material, the documentation for both forms is usually available in the array-based function description.

All GadTools tags begin with a leading "GT". In general, they also have a two-letter mnemonic for the kind of gadget in question. For example, slider gadgets recognize tags such as "GTSL_Level". The GadTools tags are defined in <libraries/gadtools.h>. Certain GadTools gadgets also recognize other Intuition tags such as GA_Disabled and PGA_Freedom, which can be found in <intuition/gadgetclass.h>.

For more information on tags and tag-based functions, be sure to see the Utility Library.

GadTools Menus

GadTools menus are the preferred way to manage menus on AmigaOS.

See GadTools Menus for more information on how to use them.

GadTools Gadgets

GadTools gadgets are largely superseded by BOOPSI-based GUI systems are to be avoided.

See GadTools Gadgets for more information about this obsolete GUI system.

Function Reference

The following are brief descriptions of the Intuition functions discussed in this chapter. See the SDK for details on each function call.

Function Description
CreateGadgetA() Allocate GadTools gadget, tag array form.
CreateGadget() Allocate GadTools gadget, varargs form.
FreeGadgets() Free all GadTools gadgets.
GT_SetGadgetAttrsA() Update gadget, tag array form.
GT_SetGadgetAttrs() Update gadget, varargs form.
CreateContext() Create a base for adding GadTools gadgets.
CreateMenusA() Allocate GadTools menu structures, tag array form.
CreateMenus() Allocate GadTools menu structures, varargs form.
FreeMenus() Free menus allocated with CreateMenus().
LayoutMenuItemsA() Format GadTools menu items, tag array form.
LayoutMenuItems() Format GadTools menu items, varargs form.
LayoutMenusA() Format GadTools menus, tag array form.
LayoutMenus() Format GadTools menus, varargs form.
GT_GetIMsg() GadTools gadget compatible version of GetMsg().
GT_ReplyIMsg() GadTools gadget compatible version of ReplyMsg().
GT_FilterIMsg() Process GadTools gadgets with GetMsg()/ReplyMsg().
GT_PostFilterIMsg() Process GadTools gadgets with GetMsg()/ReplyMsg().
GT_RefreshWindow() Display GadTools gadget imagery after creation.
GT_BeginRefresh() GadTools gadget compatible version of BeginRefresh().
GT_EndRefresh() GadTools gadget compatible version of EndRefresh().
DrawBevelBoxA() Draw a 3D box, tag array form.
DrawBevelBox() Draw a 3D box, varargs form.
GetVisualInfoA() Get drawing information for GadTools, tag array form.
GetVisualInfo() Get drawing information for GadTools, varargs form.
FreeVisualInfo() Free drawing information for GadTools.