home *** CD-ROM | disk | FTP | other *** search
- unit GadTools;
-
- INTERFACE
- uses Exec, Graphics, Intuition, Utility;
-
-
- type
- pNewGadget = ^tNewGadget;
- tNewGadget = record
- ng_LeftEdge: integer;
- ng_TopEdge: integer;
- ng_Width: integer;
- ng_Height: integer;
- ng_GadgetText: pbyte;
- ng_TextAttr: pTextAttr;
- ng_GadgetID: word;
- ng_Flags: long;
- ng_VisualInfo: pointer;
- ng_UserData: pointer;
- end;
-
- pNewMenu = ^tNewMenu;
- tNewMenu = record
- nm_Type: byte;
- nm_Label: STRPTR;
- nm_CommKey: STRPTR;
- nm_Flags: word;
- nm_MutualExclude: longint;
- nm_UserData: pointer;
- end;
-
- ppGadget = ^pGadget;
-
-
- var
- GadToolsBase: pLibrary;
-
-
- const
- GTMX_Labels = $80080009;
- GTCY_Active = $8008000F;
- GTSC_Top = $80080015;
- GTNW_Labels = $8008000E;
- GTNM_Border = $8008003A;
- GTMN_FullMenu = $8008003E;
- NWAY_KIND = 7;
- GTPA_IndicatorHeight = $80080014;
- GTMN_Menu = $8008003C;
- GT_TagBase = $80080000;
- GTSL_Level = $80080028;
- NUM_KINDS = $E;
- GTMN_FrontPen = $80080032;
- INTEGER_KIND = 3;
- GTPA_ColorOffset = $80080012;
- NM_BARLABEL = $FFFFFFFF;
- PALETTE_KIND = 8;
- TEXT_KIND = $D;
- GTSC_Total = $80080016;
- GTSC_Visible = $80080017;
- SLIDERIDCMP = $70;
- GTIN_Number = $8008002F;
- GTMX_Active = $8008000A;
- GTLV_Selected = $80080036;
- GTNW_Active = $8008000F;
- LISTVIEW_KIND = 4;
- NM_ITEMDISABLED = $10;
- GTLV_Top = $80080005;
- GTNM_Number = $8008000D;
- GTMX_Spacing = $8008003D;
- GADTOOLMASK = $FFFF7FFF;
- NUMBERIDCMP = 0;
- GTPA_IndicatorWidth = $80080013;
- GTSL_LevelFormat = $8008002A;
- NM_MENUDISABLED = 1;
- GTSC_Overlap = $80080018;
- GTTX_Border = $80080039;
- INTERHEIGHT = 4;
- PLACETEXT_IN = $10;
- GT_Private0 = $80080003;
- GT_Reserved0 = $80080037;
- GT_Reserved1 = $80080038;
- GTLV_ShowSelected = $80080035;
- NM_FLAGMASK = $FFFFFF39;
- MXIDCMP = $20;
- GTMN_TextAttr = $80080031;
- CYCLEIDCMP = $40;
- GTVI_NewWindow = $80080001;
- STRINGIDCMP = $40;
- GTSC_Arrows = $8008003B;
- NM_TITLE = 1;
- GTMENU_NOMEM = 3;
- PLACETEXT_ABOVE = 4;
- SLIDER_KIND = $B;
- GTLV_ScrollWidth = $80080008;
- BUTTONIDCMP = $40;
- GTTX_Text = $8008000B;
- NUMBER_KIND = 6;
- GADTOOLBIT = $8000;
- GTST_String = $8008002D;
- CHECKBOXIDCMP = $40;
- GTTX_CopyText = $8008000C;
- PLACETEXT_BELOW = 8;
- IM_ITEM = $82;
- GTMN_SecondaryError = $8008003F;
- PLACETEXT_RIGHT = 2;
- NM_ITEM = 2;
- MX_KIND = 5;
- CYCLE_KIND = 7;
- STRING_KIND = $C;
- MENU_IMAGE = $80;
- GTCB_Checked = $80080004;
- ARROWIDCMP = $400068;
- BUTTON_KIND = 1;
- NM_END = 0;
- GT_VisualInfo = $80080034;
- CHECKBOX_KIND = 2;
- INTERWIDTH = 8;
- GTVI_NWTags = $80080002;
- PLACETEXT_LEFT = 1;
- GTMENU_INVALID = 2;
- SCROLLERIDCMP = $70;
- IM_SUB = $83;
- NG_HIGHLABEL = $20;
- NWAYIDCMP = $40;
- GTMENU_TRIMMED = 1;
- NM_SUB = 3;
- GTSL_MaxLevelLen = $80080029;
- GTIN_MaxChars = $80080030;
- INTEGERIDCMP = $40;
- PALETTEIDCMP = $40;
- TEXTIDCMP = 0;
- GTSL_LevelPlace = $8008002B;
- GTBB_Recessed = $80080033;
- LISTVIEWIDCMP = $400078;
- GTPA_Depth = $80080010;
- GT_Underscore = $80080040;
- GENERIC_KIND = 0;
- GTCY_Labels = $8008000E;
- SCROLLER_KIND = 9;
- GTSL_DispFunc = $8008002C;
- GTSL_Min = $80080026;
- GTSL_Max = $80080027;
- GTST_MaxChars = $8008002E;
- GTST_EditHook = $80080037;
- GTLV_Labels = $80080006;
- GTPA_Color = $80080011;
- GTLV_ReadOnly = $80080007;
-
-
- function CreateGadgetA
- (kind: long;
- gad: pGadget;
- ng: pNewGadget;
- taglist: pTagItem): pGadget;
-
- procedure FreeGadgets (gad: pGadget);
- procedure GT_SetGadgetAttrsA
- (gad: pGadget;
- win: pWindow;
- req: pRequester;
- taglist: pTagItem);
-
- function CreateMenusA
- (newmenu: pNewMenu;
- taglist: pTagItem): pMenu;
-
- procedure FreeMenus (menu: pMenu);
- function LayoutMenuItemsA
- (firstitem: pMenuItem;
- vi: pointer;
- taglist: pTagItem): boolean;
-
- function LayoutMenusA
- (firstmenu: pMenu;
- vi: pointer;
- taglist: pTagItem): boolean;
-
- function GT_GetIMsg (iport: pMsgPort): pIntuiMessage;
- procedure GT_ReplyIMsg (imsg: pIntuiMessage);
- procedure GT_RefreshWindow
- (win: pWindow;
- req: pRequester);
-
- procedure GT_BeginRefresh (win: pWindow);
- procedure GT_EndRefresh
- (win: pWindow;
- complete: boolean);
-
- function GT_FilterIMsg (imsg: pIntuiMessage): pIntuiMessage;
- function GT_PostFilterIMsg (imsg: pIntuiMessage): pIntuiMessage;
- function CreateContext (glistptr: ppGadget): pGadget;
- procedure DrawBevelBoxA
- (rport: pRastPort;
- left: integer;
- top: integer;
- width: integer;
- height: integer;
- taglist: pTagItem);
-
- function GetVisualInfoA
- (screen: pScreen;
- taglist: pTagItem): pointer;
-
- procedure FreeVisualInfo (vi: pointer);
-
-
- function GTMENU_USERDATA (menu: pMenu): pointer;
- function GTMENUITEM_USERDATA (menuitem: pMenuItem): pointer;
-
-
- IMPLEMENTATION
- function GTMENU_USERDATA; xassembler;
- asm
- move.l 4(sp),a0
- move.l 30(a0),8(sp)
- end;
-
- function GTMENUITEM_USERDATA; xassembler;
- asm
- move.l 4(sp),a0
- move.l 34(a0),8(sp)
- end;
-
- function CreateGadgetA; xassembler;
- asm
- movem.l a2/a6,-(sp)
- lea $C(sp),a6
- move.l (a6)+,a2
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l (a6)+,d0
- move.l GadToolsBase,a6
- jsr -$1E(a6)
- move.l d0,$1C(sp)
- movem.l (sp)+,a2/a6
- end;
-
- procedure FreeGadgets; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l GadToolsBase,a6
- jsr -$24(a6)
- move.l (sp)+,a6
- end;
-
- procedure GT_SetGadgetAttrsA; xassembler;
- asm
- movem.l a2-a3/a6,-(sp)
- lea $10(sp),a6
- move.l (a6)+,a3
- move.l (a6)+,a2
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l GadToolsBase,a6
- jsr -$2A(a6)
- movem.l (sp)+,a2-a3/a6
- end;
-
- function CreateMenusA; xassembler;
- asm
- move.l a6,-(sp)
- lea 8(sp),a6
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l GadToolsBase,a6
- jsr -$30(a6)
- move.l d0,$10(sp)
- move.l (sp)+,a6
- end;
-
- procedure FreeMenus; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l GadToolsBase,a6
- jsr -$36(a6)
- move.l (sp)+,a6
- end;
-
- function LayoutMenuItemsA; xassembler;
- asm
- movem.l a2/a6,-(sp)
- lea $C(sp),a6
- move.l (a6)+,a2
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l GadToolsBase,a6
- jsr -$3C(a6)
- tst.l d0
- sne d0
- neg.b d0
- move.b d0,$18(sp)
- movem.l (sp)+,a2/a6
- end;
-
- function LayoutMenusA; xassembler;
- asm
- movem.l a2/a6,-(sp)
- lea $C(sp),a6
- move.l (a6)+,a2
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l GadToolsBase,a6
- jsr -$42(a6)
- tst.l d0
- sne d0
- neg.b d0
- move.b d0,$18(sp)
- movem.l (sp)+,a2/a6
- end;
-
- function GT_GetIMsg; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l GadToolsBase,a6
- jsr -$48(a6)
- move.l d0,$C(sp)
- move.l (sp)+,a6
- end;
-
- procedure GT_ReplyIMsg; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a1
- move.l GadToolsBase,a6
- jsr -$4E(a6)
- move.l (sp)+,a6
- end;
-
- procedure GT_RefreshWindow; xassembler;
- asm
- move.l a6,-(sp)
- lea 8(sp),a6
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l GadToolsBase,a6
- jsr -$54(a6)
- move.l (sp)+,a6
- end;
-
- procedure GT_BeginRefresh; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l GadToolsBase,a6
- jsr -$5A(a6)
- move.l (sp)+,a6
- end;
-
- procedure GT_EndRefresh; xassembler;
- asm
- move.l a6,-(sp)
- moveq #0,d0
- move.b 8(sp),d0
- move.l $A(sp),a0
- move.l GadToolsBase,a6
- jsr -$60(a6)
- move.l (sp)+,a6
- end;
-
- function GT_FilterIMsg; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a1
- move.l GadToolsBase,a6
- jsr -$66(a6)
- move.l d0,$C(sp)
- move.l (sp)+,a6
- end;
-
- function GT_PostFilterIMsg; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a1
- move.l GadToolsBase,a6
- jsr -$6C(a6)
- move.l d0,$C(sp)
- move.l (sp)+,a6
- end;
-
- function CreateContext; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l GadToolsBase,a6
- jsr -$72(a6)
- move.l d0,$C(sp)
- move.l (sp)+,a6
- end;
-
- procedure DrawBevelBoxA; xassembler;
- asm
- movem.l d3/a6,-(sp)
- lea $C(sp),a6
- move.l (a6)+,a1
- move.w (a6)+,d3
- move.w (a6)+,d2
- move.w (a6)+,d1
- move.w (a6)+,d0
- move.l (a6)+,a0
- move.l GadToolsBase,a6
- jsr -$78(a6)
- movem.l (sp)+,d3/a6
- end;
-
- function GetVisualInfoA; xassembler;
- asm
- move.l a6,-(sp)
- lea 8(sp),a6
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l GadToolsBase,a6
- jsr -$7E(a6)
- move.l d0,$10(sp)
- move.l (sp)+,a6
- end;
-
- procedure FreeVisualInfo; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l GadToolsBase,a6
- jsr -$84(a6)
- move.l (sp)+,a6
- end;
-
- end.
-