1 #include <proto/exec.h>
2 #include <proto/intuition.h>
3 #include <exec/memory.h>
4 #include <intuition/gadgetclass.h>
6 #include <aros/debug.h>
9 #include "bootmenu_intern.h"
13 #define GfxBase bootmenubase->GfxBase
14 #define IntuitionBase bootmenubase->IntuitionBase
16 struct ButtonGadget
*createButton
18 ULONG left
, ULONG top
, ULONG width
, ULONG height
,
22 struct BootMenuBase
*bootmenubase
25 struct TagItem tags
[] =
27 {GA_Left
, left
}, /* 0 */
28 {GA_Top
, top
}, /* 1 */
29 {GA_Height
, height
}, /* 2 */
30 {GA_Width
, width
}, /* 3 */
31 {GA_Border
, NULL
}, /* 4 */
32 {GA_SelectRender
, NULL
}, /* 5 */
33 {GA_Previous
, (IPTR
)prev
}, /* 6 */
34 {GA_Text
, (IPTR
)name
}, /* 7 */
35 {GA_ID
, (IPTR
)id
}, /* 8 */
40 struct ButtonGadget
*button
;
42 button
= AllocMem(sizeof(struct ButtonGadget
), MEMF_PUBLIC
| MEMF_CLEAR
);
45 tags
[4].ti_Data
= (IPTR
)&button
->uborder2
;
46 tags
[5].ti_Data
= (IPTR
)&button
->sborder2
;
47 button
->XY1
[1] = height
;
48 button
->XY1
[4] = width
;
49 button
->XY2
[0] = width
;
50 button
->XY2
[2] = width
;
51 button
->XY2
[3] = height
;
52 button
->XY2
[5] = height
;
53 button
->uborder1
.FrontPen
= 1;
54 button
->uborder1
.DrawMode
= JAM1
;
55 button
->uborder1
.Count
= 3;
56 button
->uborder1
.XY
= button
->XY2
;
57 button
->uborder2
.FrontPen
= 2;
58 button
->uborder2
.DrawMode
= JAM1
;
59 button
->uborder2
.Count
= 3;
60 button
->uborder2
.XY
= button
->XY1
;
61 button
->uborder2
.NextBorder
= &button
->uborder1
;
62 button
->sborder1
.FrontPen
= 2;
63 button
->sborder1
.DrawMode
= JAM1
;
64 button
->sborder1
.Count
= 3;
65 button
->sborder1
.XY
= button
->XY2
;
66 button
->sborder2
.FrontPen
= 1;
67 button
->sborder2
.DrawMode
= JAM1
;
68 button
->sborder2
.Count
= 3;
69 button
->sborder2
.XY
= button
->XY1
;
70 button
->sborder2
.NextBorder
= &button
->sborder1
;
71 button
->button
= NewObjectA(NULL
, FRBUTTONCLASS
, tags
);
74 button
->gadget
= prev
->NextGadget
;
75 button
->gadget
->NextGadget
= NULL
;
78 FreeMem(button
, sizeof(struct ButtonGadget
));
83 void freeButtonGadget(struct ButtonGadget
*button
, struct BootMenuBase
*bootmenubase
) {
85 DisposeObject(button
->button
);
86 FreeMem(button
, sizeof(struct ButtonGadget
));