2 Copyright © 1999, David Le Corfec.
3 Copyright © 2002, The AROS Development Team.
9 #include <exec/types.h>
12 //#include <libraries/mui.h>
13 #include <proto/exec.h>
14 #include <proto/intuition.h>
15 #include <proto/muimaster.h>
17 #include <libraries/mui.h>
19 #include <clib/alib_protos.h>
22 struct Library
*MUIMasterBase
;
29 /* On AmigaOS we build a fake library base, because it's not compiled as sharedlibrary yet */
30 #include "muimaster_intern.h"
32 int openmuimaster(void)
34 static struct MUIMasterBase_intern MUIMasterBase_instance
;
35 MUIMasterBase
= (struct Library
*)&MUIMasterBase_instance
;
37 MUIMasterBase_instance
.sysbase
= *((struct ExecBase
**)4);
38 MUIMasterBase_instance
.dosbase
= OpenLibrary("dos.library",37);
39 MUIMasterBase_instance
.utilitybase
= OpenLibrary("utility.library",37);
40 MUIMasterBase_instance
.aslbase
= OpenLibrary("asl.library",37);
41 MUIMasterBase_instance
.gfxbase
= OpenLibrary("graphics.library",37);
42 MUIMasterBase_instance
.layersbase
= OpenLibrary("layers.library",37);
43 MUIMasterBase_instance
.intuibase
= OpenLibrary("intuition.library",37);
44 MUIMasterBase_instance
.cxbase
= OpenLibrary("commodities.library",37);
45 MUIMasterBase_instance
.keymapbase
= OpenLibrary("keymap.library",37);
46 __zune_prefs_init(&__zprefs
);
51 void closemuimaster(void)
57 int openmuimaster(void)
59 if ((MUIMasterBase
= OpenLibrary("muimaster.library", 0))) return 1;
63 void closemuimaster(void)
65 if (MUIMasterBase
) CloseLibrary(MUIMasterBase
);
70 int main (int argc
, char **argv
)
79 if (!openmuimaster()) return 20;
81 app
= ApplicationObject
,
82 SubWindow
, mainWin
= WindowObject
,
83 MUIA_Window_Title
, "Pages",
84 WindowContents
, VGroup
,
88 Child
, stepb
[0] = RectangleObject
,
89 MUIA_Rectangle_BarTitle
, "prev",
90 MUIA_CycleChain
, TRUE
,
93 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
94 MUIA_Background
, MUII_ButtonBack
,
97 Child
, stepb
[1] = RectangleObject
,
98 MUIA_Rectangle_BarTitle
, "next",
99 MUIA_CycleChain
, TRUE
,
101 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
102 MUIA_Background
, MUII_ButtonBack
,
107 Child
, MUI_MakeObject(MUIO_HBar
, 4),
109 Child
, b
[0] = RectangleObject
,
110 MUIA_Rectangle_BarTitle
, "1",
111 MUIA_CycleChain
, TRUE
,
112 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
114 MUIA_Background
, MUII_ButtonBack
,
117 Child
, b
[1] = RectangleObject
,
118 MUIA_Rectangle_BarTitle
, "2",
119 MUIA_CycleChain
, TRUE
,
120 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
122 MUIA_Background
, MUII_ButtonBack
,
125 Child
, b
[2] = RectangleObject
,
126 MUIA_Rectangle_BarTitle
, "3",
127 MUIA_CycleChain
, TRUE
,
128 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
130 MUIA_Background
, MUII_ButtonBack
,
135 Child
, pages
= HGroup
,
136 MUIA_Group_PageMode
, TRUE
,
138 MUIA_Background
, MUII_PageBack
,
139 Child
, RectangleObject
,
141 MUIA_Background
, MUII_SHADOW
,
142 MUIA_Rectangle_BarTitle
, "Rect1",
144 Child
, RectangleObject
,
147 MUIA_Background
, MUII_SHINE
,
148 MUIA_Rectangle_BarTitle
, "Rect2",
150 Child
, RectangleObject
,
152 MUIA_Background
, MUII_FILL
,
153 MUIA_Rectangle_BarTitle
, "Rect3",
162 fprintf(stderr
, "can't create application object.\n");
166 DoMethod(mainWin
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
168 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
170 DoMethod(stepb
[0], MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
171 (IPTR
)pages
, 3, MUIM_Set
,
172 MUIA_Group_ActivePage
, MUIV_Group_ActivePage_Prev
);
174 DoMethod(stepb
[1], MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
175 (IPTR
)pages
, 3, MUIM_Set
,
176 MUIA_Group_ActivePage
, MUIV_Group_ActivePage_Next
);
178 for (i
= 0; i
< 3; i
++)
180 DoMethod(b
[i
], MUIM_Notify
, MUIA_Pressed
, FALSE
,
181 (IPTR
)pages
, 3, MUIM_Set
, MUIA_Group_ActivePage
, i
);
184 * Open window and ALWAYS check.
186 set(mainWin
, MUIA_Window_Open
, TRUE
);
187 if (!XGET(mainWin
, MUIA_Window_Open
))
189 MUI_DisposeObject(app
);
190 fprintf(stderr
, "can't open main window.\n");
197 while (DoMethod(app
, MUIM_Application_NewInput
, (IPTR
)&sigs
)
198 != MUIV_Application_ReturnID_Quit
)
202 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
);
203 if (sigs
& SIGBREAKF_CTRL_C
) break;
208 set(mainWin
, MUIA_Window_Open
, FALSE
);
209 MUI_DisposeObject(app
);