Re-enabled use of AROS.Boot file due to lack of general enthusiasm for
[tangerine.git] / test / Zune / test.c
blobc87d1b56ac7ab20174801ca3718f78a674a5e312
1 /*
2 Copyright © 2002-2008, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #define INTUITION_NO_INLINE_STDARG
10 #include <exec/types.h>
11 #include <stdlib.h>
12 #include <stdio.h>
13 #include <string.h>
15 #include <clib/alib_protos.h>
16 #include <intuition/gadgetclass.h>
17 #include <intuition/icclass.h>
18 #include <libraries/asl.h>
19 #include <gadgets/colorwheel.h>
20 #include <proto/exec.h>
21 #include <proto/intuition.h>
22 #include <proto/dos.h>
23 #include <proto/muimaster.h>
24 #include <proto/graphics.h>
25 #include <aros/debug.h>
27 /* the following should go in a single include file which then only
28 ** constits of the public constants and members. Actually this is easy
31 #define TEST_ICONLIST
33 #include <libraries/mui.h>
34 #if defined(TEST_ICONLIST)
35 #include "../../workbench/system/Wanderer/Classes/iconlist_attributes.h"
36 #include "../../workbench/system/Wanderer/Classes/iconlist.h"
37 #endif
39 struct Library *MUIMasterBase;
40 struct Library *ColorWheelBase;
42 struct list_entry
44 char *column1;
45 char *column2;
48 Object *app;
50 Object *wheel;
51 Object *r_slider;
52 Object *g_slider;
53 Object *b_slider;
54 Object *hue_gauge;
55 Object *group;
56 Object *editor_text;
57 Object *filename_string;
58 Object *save_button;
59 Object *list2;
61 Object *drawer_iconlist;
62 Object *volume_iconlist;
64 AROS_UFH0(void, repeat_function)
66 AROS_USERFUNC_INIT
68 printf("MUI_Timer\n");
70 AROS_USERFUNC_EXIT
73 AROS_UFH0(void, wheel_function)
75 AROS_USERFUNC_INIT
77 nnset(r_slider,MUIA_Numeric_Value, (XGET(wheel,WHEEL_Red) >> 24) & 0xff);
78 nnset(g_slider,MUIA_Numeric_Value, (XGET(wheel,WHEEL_Green) >> 24) & 0xff);
79 nnset(b_slider,MUIA_Numeric_Value, (XGET(wheel,WHEEL_Blue) >> 24) & 0xff);
81 AROS_USERFUNC_EXIT
84 AROS_UFH0(void, slider_function)
86 AROS_USERFUNC_INIT
88 struct ColorWheelRGB cw;
89 ULONG red = XGET(r_slider,MUIA_Numeric_Value);
90 ULONG green = XGET(g_slider,MUIA_Numeric_Value);
91 ULONG blue = XGET(b_slider,MUIA_Numeric_Value);
93 cw.cw_Red = (red<<24)|(red<<16)|(red<<8)|red;
94 cw.cw_Green = (green<<24)|(green<<16)|(green<<8)|green;
95 cw.cw_Blue = (blue<<24)|(blue<<16)|(blue<<8)|blue;
97 nnset(wheel, WHEEL_RGB, &cw);
98 set(hue_gauge, MUIA_Gauge_Current, XGET(wheel,WHEEL_Hue));
100 AROS_USERFUNC_EXIT
103 AROS_UFH0(void, objects_function)
105 AROS_USERFUNC_INIT
107 Object *new_obj = MUI_MakeObject(MUIO_Button,"Button");
108 if (new_obj)
110 DoMethod(group, MUIM_Group_InitChange);
111 DoMethod(group, OM_ADDMEMBER, new_obj);
112 DoMethod(group, MUIM_Group_ExitChange);
115 AROS_USERFUNC_EXIT
118 AROS_UFH0(void, about_function)
120 AROS_USERFUNC_INIT
122 static Object *about_wnd;
123 if (!about_wnd)
125 about_wnd = AboutmuiObject,
126 MUIA_Aboutmui_Application, app,
127 End;
130 if (about_wnd) set(about_wnd,MUIA_Window_Open,TRUE);
132 AROS_USERFUNC_EXIT
135 AROS_UFH3(void, display_function,
136 AROS_UFHA(struct Hook *, h, A0),
137 AROS_UFHA(char **, strings, A2),
138 AROS_UFHA(struct list_entry *, entry, A1))
140 AROS_USERFUNC_INIT
142 static char buf[100];
143 if (entry)
145 sprintf(buf,"%ld", (LONG) *(strings-1));
146 strings[0] = buf;
147 strings[1] = entry->column1;
148 strings[2] = entry->column2;
149 } else
151 strings[0] = "Number";
152 strings[1] = "Column 1";
153 strings[2] = "Column 2";
156 AROS_USERFUNC_EXIT
159 AROS_UFH3(void, display2_function,
160 AROS_UFHA(struct Hook *, h, A0),
161 AROS_UFHA(char **, strings, A2),
162 AROS_UFHA(struct list_entry *, entry, A1))
164 AROS_USERFUNC_INIT
166 static char buf[100];
167 if (entry)
169 sprintf(buf,"line num: %ld id: %p", (LONG) *(strings-1), entry);
170 strings[0] = buf;
171 } else
173 strings[0] = "Number";
176 AROS_USERFUNC_EXIT
179 AROS_UFH0(void, save_function)
181 AROS_USERFUNC_INIT
183 char *text = (char*)XGET(editor_text, MUIA_Text_Contents);
184 char *filename = (char*)XGET(filename_string, MUIA_String_Contents);
185 BPTR fh;
187 if (!strlen(filename)) return;
189 if ((fh = Open(filename,MODE_NEWFILE)))
191 Write(fh,text,strlen(text));
192 Close(fh);
195 AROS_USERFUNC_EXIT
198 static int id = 1;
200 AROS_UFH0(void, add_function)
202 AROS_USERFUNC_INIT
204 DoMethod(list2,MUIM_List_InsertSingle, id++, MUIV_List_Insert_Bottom);
206 AROS_USERFUNC_EXIT
209 #if defined(TEST_ICONLIST)
210 /* IconList callbacks */
211 void volume_doubleclicked(void)
213 char buf[200];
214 struct IconList_Entry *ent = (void*)MUIV_IconList_NextIcon_Start;
215 DoMethod(volume_iconlist, MUIM_IconList_NextIcon, MUIV_IconList_NextIcon_Selected, &ent);
216 if ((int)ent == MUIV_IconList_NextIcon_End) return;
218 strcpy(buf,ent->label);
219 strcat(buf,":");
220 set(drawer_iconlist,MUIA_IconDrawerList_Drawer,buf);
223 void drawer_doubleclicked(void)
225 struct IconList_Entry *ent = (void*)MUIV_IconList_NextIcon_Start;
227 DoMethod(drawer_iconlist, MUIM_IconList_NextIcon, MUIV_IconList_NextIcon_Selected, &ent);
228 if ((int)ent == MUIV_IconList_NextIcon_End) return;
229 set(drawer_iconlist,MUIA_IconDrawerList_Drawer,ent->filename);
231 #endif
233 static IPTR create_balance_column(void)
235 return (IPTR) VGroup,
236 Child, RectangleObject, GaugeFrame, End,
237 Child, BalanceObject, End,
238 Child, RectangleObject, GaugeFrame, End,
239 Child, BalanceObject, End,
240 Child, RectangleObject, GaugeFrame, End,
241 Child, BalanceObject, End,
242 Child, RectangleObject, GaugeFrame, End,
243 Child, BalanceObject, End,
244 Child, RectangleObject, GaugeFrame, End,
245 End;
248 /* The custom class */
250 struct DropText_Data
252 ULONG times;
255 #ifdef __MAXON__
256 #undef KeymapBase
257 struct Library *KeymapBase;
258 #endif
260 #ifndef __AROS__
261 __saveds __asm IPTR dispatcher(register __a0 struct IClass *cl, register __a2 Object *obj, register __a1 Msg msg)
262 #else
263 AROS_UFH3S(IPTR, dispatcher,
264 AROS_UFHA(Class *, cl, A0),
265 AROS_UFHA(Object *, obj, A2),
266 AROS_UFHA(Msg , msg, A1))
267 #endif
269 AROS_USERFUNC_INIT
271 switch (msg->MethodID)
273 case MUIM_DragQuery: return MUIV_DragQuery_Accept;
274 case MUIM_DragDrop:
276 struct DropText_Data *data = (struct DropText_Data*)INST_DATA(cl,obj);
277 char buf[100];
278 data->times++;
279 sprintf(buf,"%ld times",data->times); /* no MUIM_SetAsString yet */
280 set(obj,MUIA_Text_Contents,buf);
284 return DoSuperMethodA(cl,obj,(Msg)msg);
286 AROS_USERFUNC_EXIT
289 struct MUI_CustomClass *CL_DropText;
291 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
293 /* Main prog */
295 static struct Hook hook_standard;
297 AROS_UFH3(void, hook_func_standard,
298 AROS_UFHA(struct Hook *, h, A0),
299 AROS_UFHA(void *, dummy, A2),
300 AROS_UFHA(void **, funcptr, A1))
302 AROS_USERFUNC_INIT
304 void (*func) (ULONG *) = (void (*)(ULONG *)) (*funcptr);
306 if (func) func((ULONG *) funcptr + 1);
308 AROS_USERFUNC_EXIT
311 int main(void)
313 Object *wnd,*second_wnd;
314 Object *open_button;
315 Object *quit_button;
316 Object *repeat_button;
317 Object *objects_button;
318 Object *about_item, *quit_item;
319 Object *context_menu;
320 Object *popobject, *listview;
321 Object *list_add_button, *list_remove_button, *list_clear_button;
322 Object *country_radio[2];
324 static char *pages[] = {"Groups","Colorwheel","Virtual Group","Edit","List","Gauges","Radio","Icon List","Balancing",NULL};
325 static char **radio_entries1 = pages;
326 static char *radio_entries2[] = {"Paris","Pataya","London","New-York","Reykjavik",NULL};
328 static struct list_entry entry1 = {"Testentry1","Col2: Entry1"};
329 static struct list_entry entry2 = {"Entry2","Col2: Entry2"};
330 static struct list_entry entry3 = {"Entry3","Col2: Entry3"};
331 static struct list_entry entry4 = {"Entry4","Col2: Entry4"};
332 static struct list_entry entry5 = {"Entry5","Col2: Entry5"};
333 static struct list_entry entry6 = {"Entry6","Col2: Entry6"};
335 static struct list_entry *entries[] =
336 {&entry1,&entry2,&entry3,&entry4,&entry5,&entry6,NULL};
338 struct Hook hook;
339 struct Hook hook_wheel;
340 struct Hook hook_slider;
341 struct Hook hook_objects;
342 struct Hook hook_display;
343 struct Hook hook_display2;
345 hook_standard.h_Entry = (HOOKFUNC)hook_func_standard;
347 MUIMasterBase = (struct Library*)OpenLibrary("muimaster.library",0);
349 hook.h_Entry = (HOOKFUNC)repeat_function;
350 hook_wheel.h_Entry = (HOOKFUNC)wheel_function;
351 hook_slider.h_Entry = (HOOKFUNC)slider_function;
352 hook_objects.h_Entry = (HOOKFUNC)objects_function;
353 hook_display.h_Entry = (HOOKFUNC)display_function;
354 hook_display2.h_Entry = (HOOKFUNC)display2_function;
356 context_menu = MenuitemObject,
357 MUIA_Family_Child, MenuitemObject,
358 MUIA_Menuitem_Title, "Menutest",
359 MUIA_Family_Child, about_item = MenuitemObject, MUIA_Menuitem_Title, "First Test Entry", End,
360 MUIA_Family_Child, quit_item = MenuitemObject, MUIA_Menuitem_Title, "Second Test Entry", End,
361 End,
362 End;
364 /* should check the result in a real program! */
365 CL_DropText = MUI_CreateCustomClass(NULL,MUIC_Text,NULL,sizeof(struct DropText_Data), dispatcher);
366 ColorWheelBase = OpenLibrary("gadgets/colorwheel.gadget",0);
368 app = ApplicationObject,
369 MUIA_Application_Menustrip, MenuitemObject,
370 MUIA_Family_Child, MenuitemObject,
371 MUIA_Menuitem_Title, "Project",
372 MUIA_Family_Child, about_item = MenuitemObject, MUIA_Menuitem_Title, "About...", MUIA_Menuitem_Shortcut, "?", End,
373 MUIA_Family_Child, MenuitemObject, MUIA_Menuitem_Title, ~0, End,
374 MUIA_Family_Child, quit_item = MenuitemObject, MUIA_Menuitem_Title, "Quit", MUIA_Menuitem_Shortcut, "Q", End,
375 End,
376 End,
377 SubWindow, wnd = WindowObject,
378 MUIA_Window_Title, "test",
379 MUIA_Window_Activate, TRUE,
381 WindowContents, VGroup,
382 Child, TextObject, MUIA_Background, "2:cfffffff,cfffffff,10000000", TextFrame, MUIA_Text_Contents, "\33cHello World!!\nThis is a text object\n\33lLeft \33bbold\33n\n\33rRight",End,
383 Child, popobject = PopobjectObject,
384 MUIA_Popstring_String, MUI_MakeObject(MUIO_String, NULL, 200),
385 MUIA_Popstring_Button, PopButton(MUII_PopUp),
386 MUIA_Popobject_Object, VGroup,
387 Child, TextObject,MUIA_Text_Contents,"test",End,
388 Child, listview = ListviewObject,
389 MUIA_Listview_List, ListObject,
390 InputListFrame,
391 MUIA_List_DisplayHook, &hook_display,
392 MUIA_List_Format, ",,",
393 MUIA_List_SourceArray, entries,
394 MUIA_List_Title, TRUE,
395 End,
396 End,
397 End,
398 End,
399 Child, RegisterGroup(pages),
400 // MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
401 Child, HGroup,
402 GroupFrameT("A horizontal group"),
403 Child, ColGroup(2),
404 GroupFrameT("A column group"),
405 Child, repeat_button = TextObject, MUIA_CycleChain, 1, ButtonFrame, MUIA_Background, MUII_ButtonBack, MUIA_Text_PreParse, "\33c", MUIA_Text_Contents, "Repeat", MUIA_InputMode, MUIV_InputMode_RelVerify, End,
406 Child, TextObject, MUIA_CycleChain, 1, ButtonFrame, MUIA_Background, MUII_ButtonBack, MUIA_Text_PreParse, "\33c", MUIA_Text_Contents, "Drag Me", MUIA_Draggable, TRUE, MUIA_InputMode, MUIV_InputMode_RelVerify, End,
407 Child, open_button = TextObject, MUIA_CycleChain, 1, ButtonFrame, MUIA_Background, MUII_ButtonBack, MUIA_Text_PreParse, "\33c", MUIA_Text_Contents, "Open Window", MUIA_InputMode, MUIV_InputMode_RelVerify, End,
408 Child, TextObject, MUIA_ContextMenu, context_menu, MUIA_CycleChain, 1, ButtonFrame, MUIA_Background, MUII_ButtonBack, MUIA_Text_PreParse, "\33c", MUIA_Text_Contents, "Press Right", MUIA_InputMode, MUIV_InputMode_RelVerify, End,
409 Child, objects_button = TextObject, MUIA_CycleChain, 1, ButtonFrame, MUIA_Background, MUII_ButtonBack, MUIA_Text_PreParse, "\33c", MUIA_Text_Contents, "Add Objects", MUIA_InputMode, MUIV_InputMode_RelVerify, End,
410 Child, HVSpace, //TextObject, MUIA_CycleChain, 1, ButtonFrame, MUIA_Background, MUII_ButtonBack, MUIA_Text_PreParse, "\33c", MUIA_Text_Contents, "Button6", MUIA_InputMode, MUIV_InputMode_RelVerify, End,
411 Child, MUI_MakeObject(MUIO_Label,"_Checkmark",0),
412 Child, MUI_MakeObject(MUIO_Checkmark,"_Checkmark"),
413 End,
414 Child, group = VGroup,
415 GroupFrameT("A vertical group"),
416 Child, DropTextObject, MUIA_Dropable, TRUE, MUIA_CycleChain, 1, ButtonFrame, MUIA_Background, MUII_ButtonBack, MUIA_Text_PreParse, "\33c", MUIA_Text_Contents, "Drop Here", MUIA_Dropable, TRUE, MUIA_InputMode, MUIV_InputMode_RelVerify, End,
417 Child, TextObject, TextFrame, MUIA_Background, MUII_MARKHALFSHINE, MUIA_CycleChain, 1, MUIA_Text_PreParse, "\33c", MUIA_Text_Contents, "Pattern", End,
418 Child, ColoradjustObject, End,
420 End,
421 Child, MUI_NewObject(MUIC_Popimage, TAG_DONE),
422 End,
424 Child, VGroup,
425 Child, wheel = BoopsiObject, /* MUI and Boopsi tags mixed */
426 GroupFrame,
427 MUIA_Boopsi_ClassID , "colorwheel.gadget",
428 MUIA_Boopsi_MinWidth , 30, /* boopsi objects don't know */
429 MUIA_Boopsi_MinHeight, 30, /* their sizes, so we help */
430 MUIA_Boopsi_Remember , WHEEL_Saturation, /* keep important values */
431 MUIA_Boopsi_Remember , WHEEL_Hue, /* during window resize */
432 MUIA_Boopsi_TagScreen, WHEEL_Screen, /* this magic fills in */
433 WHEEL_Screen , NULL, /* the screen pointer */
434 GA_Left , 0,
435 GA_Top , 0, /* MUI will automatically */
436 GA_Width , 0, /* fill in the correct values */
437 GA_Height , 0,
438 ICA_TARGET , ICTARGET_IDCMP, /* needed for notification */
439 WHEEL_Saturation, 0, /* start in the center */
440 MUIA_FillArea, TRUE, /* use this because it defaults to FALSE
441 for boopsi gadgets but the colorwheel
442 doesnt bother about redrawing its backgorund */
443 End,
445 Child, r_slider = SliderObject, MUIA_Group_Horiz, TRUE, MUIA_Numeric_Min, 0, MUIA_Numeric_Max, 255, End,
446 Child, g_slider = SliderObject, MUIA_Group_Horiz, TRUE, MUIA_Numeric_Min, 0, MUIA_Numeric_Max, 255, End,
447 Child, b_slider = SliderObject, MUIA_Group_Horiz, TRUE, MUIA_Numeric_Min, 0, MUIA_Numeric_Max, 255, End,
449 Child, hue_gauge = GaugeObject, GaugeFrame, MUIA_Gauge_Horiz, TRUE, MUIA_Gauge_Max, 255, MUIA_Gauge_Divide, 1<<24, MUIA_Gauge_InfoText, "Hue: %ld",End,
450 End,
452 Child, ScrollgroupObject,
453 MUIA_Scrollgroup_Contents, VGroupV,
454 VirtualFrame,
455 Child, TextObject,
456 TextFrame,
457 MUIA_Text_Contents, "Line1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\nLine8\n\n\n\nLine9\nLine10\nLine11\n",
458 End,
459 Child, HGroup,
460 Child, MUI_MakeObject(MUIO_Button,"Button9"),
461 Child, MUI_MakeObject(MUIO_Button,"Button10"),
462 End,
463 End,
464 End,
465 Child, VGroup,
466 Child, editor_text = StringObject,
467 StringFrame,
468 MUIA_Text_Multiline, TRUE,
469 End,
470 Child, PopaslObject,
471 ASLFR_DoSaveMode, TRUE,
472 MUIA_Popstring_String, filename_string = MUI_MakeObject(MUIO_String, NULL, 200),
473 MUIA_Popstring_Button, PopButton(MUII_PopFile),
474 End,
475 Child, save_button = MUI_MakeObject(MUIO_Button, "Save"),
476 End,
477 Child, VGroup,
478 Child, ListviewObject,
479 MUIA_Listview_List, list2 = ListObject,
480 InputListFrame,
481 MUIA_List_DisplayHook, &hook_display2,
482 End,
483 End,
484 Child, HGroup,
485 Child, list_add_button = MUI_MakeObject(MUIO_Button,"_Add"),
486 Child, list_remove_button = MUI_MakeObject(MUIO_Button,"_Remove"),
487 Child, list_clear_button = MUI_MakeObject(MUIO_Button,"_Clear"),
488 End,
489 End,
491 /* gauges */
492 Child, HGroup,
493 Child, VGroup,
494 Child, VGroup, GroupFrame,
495 Child, GaugeObject, GaugeFrame, MUIA_Gauge_InfoText, "%ld %%", MUIA_Gauge_Horiz, TRUE, MUIA_Gauge_Current, 25, End,
496 Child, ScaleObject, End,
497 End,
498 Child, VGroup, GroupFrame,
499 Child, GaugeObject, GaugeFrame, MUIA_Gauge_InfoText, "%ld %%", MUIA_Gauge_Horiz, TRUE, MUIA_Gauge_Current, 50, End,
500 Child, ScaleObject, End,
501 End,
502 Child, VGroup, GroupFrame,
503 Child, GaugeObject, GaugeFrame, MUIA_Gauge_InfoText, "%ld %%", MUIA_Gauge_Horiz, TRUE, MUIA_Gauge_Current, 75, End,
504 Child, ScaleObject, End,
505 End,
506 End,
507 Child, HGroup,
508 Child, HVSpace,
509 Child, GaugeObject, GaugeFrame, MUIA_Gauge_InfoText, "%ld %%", MUIA_Gauge_Current, 25, End,
510 Child, GaugeObject, GaugeFrame, MUIA_Gauge_InfoText, "%ld %%", MUIA_Gauge_Current, 50, End,
511 Child, GaugeObject, GaugeFrame, MUIA_Gauge_InfoText, "%ld %%", MUIA_Gauge_Current, 75, End,
512 Child, HVSpace,
513 End,
514 End,
516 /* radios */
517 Child, HGroup,
518 Child, VGroup,
519 Child, RadioObject, GroupFrame, MUIA_Radio_Entries, radio_entries1, End,
520 Child, country_radio[0] = RadioObject, GroupFrame, MUIA_Radio_Entries, radio_entries2, MUIA_Radio_Active, 1, End,
521 End,
522 Child, HGroup,
523 Child, RadioObject, GroupFrame, MUIA_Radio_Entries, radio_entries1, End,
524 Child, country_radio[1] = RadioObject, GroupFrame, MUIA_Radio_Entries, radio_entries2, MUIA_Radio_Active, 1, End,
525 End,
526 End,
527 #if defined(TEST_ICONLIST)
528 /* iconlist */
529 Child, HGroup,
530 Child, volume_iconlist = MUI_NewObject(MUIC_IconVolumeList, GroupFrame, TAG_DONE),
531 Child, drawer_iconlist = MUI_NewObject(MUIC_IconDrawerList, GroupFrame, MUIA_IconDrawerList_Drawer,"SYS:",TAG_DONE),
532 End,
533 #endif
534 Child,HGroup,
536 Child, create_balance_column(),
537 Child, BalanceObject, End,
538 Child, create_balance_column(),
539 Child, BalanceObject, End,
541 Child, create_balance_column(),
542 Child, BalanceObject, End,
544 Child, create_balance_column(),
545 Child, BalanceObject, End,
547 Child, create_balance_column(),
549 End,
550 End,
552 Child, RectangleObject,
553 MUIA_VertWeight,0, /* Seems to be not supported properly as orginal MUI doesn't allow to alter the height of the window */
554 MUIA_Rectangle_HBar, TRUE,
555 MUIA_Rectangle_BarTitle,"Enter a string",
556 End,
558 Child, StringObject,
559 StringFrame,
560 MUIA_CycleChain,1,
561 MUIA_String_AdvanceOnCR, TRUE,
562 End,
564 Child, CycleObject,
565 ButtonFrame,
566 MUIA_Cycle_Entries, pages,
567 End,
568 Child, ScrollbarObject,
569 MUIA_Group_Horiz, TRUE,
570 MUIA_Prop_Visible, 100,
571 MUIA_Prop_Entries, 300,
572 MUIA_Prop_First, 50,
573 End,
575 Child, HGroup,
576 Child, quit_button = TextObject,
577 ButtonFrame,
578 MUIA_InputMode, MUIV_InputMode_RelVerify,
579 MUIA_CycleChain, 1,
580 MUIA_Background, MUII_ButtonBack,
581 MUIA_ControlChar, 'q',
582 MUIA_Text_HiChar, 'q',
583 MUIA_Text_PreParse, "\33c",
584 MUIA_Text_Contents, "Quit",
585 End,
586 End,
587 End,
588 End,
589 SubWindow, second_wnd = WindowObject,
590 MUIA_Window_Title, "Second window",
592 WindowContents, VGroup,
593 Child, DropTextObject,
594 MUIA_Text_Contents, "Drop here",
595 MUIA_Dropable, TRUE, End,
596 End,
597 End,
598 End;
600 if (app)
602 ULONG sigs = 0;
604 DoMethod(wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
605 DoMethod(second_wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, second_wnd, 3, MUIM_Set, MUIA_Window_Open, FALSE);
606 DoMethod(open_button, MUIM_Notify, MUIA_Pressed, FALSE, second_wnd, 3, MUIM_Set, MUIA_Window_Open, TRUE);
607 DoMethod(quit_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
608 DoMethod(objects_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2, MUIM_CallHook, &hook_objects);
609 DoMethod(repeat_button, MUIM_Notify, MUIA_Timer, MUIV_EveryTime, app, 2, MUIM_CallHook, &hook);
611 DoMethod(wheel, MUIM_Notify,WHEEL_Hue , MUIV_EveryTime, app, 2, MUIM_CallHook, &hook_wheel);
612 DoMethod(wheel, MUIM_Notify,WHEEL_Saturation, MUIV_EveryTime, app, 2, MUIM_CallHook, &hook_wheel);
613 DoMethod(r_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, app, 2, MUIM_CallHook, &hook_slider);
614 DoMethod(g_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, app, 2, MUIM_CallHook, &hook_slider);
615 DoMethod(b_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, app, 2, MUIM_CallHook, &hook_slider);
617 DoMethod(save_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 3, MUIM_CallHook, &hook_standard, save_function);
619 DoMethod(quit_item, MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
620 DoMethod(about_item, MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard, about_function);
622 DoMethod(listview, MUIM_Notify, MUIA_Listview_DoubleClick, TRUE, popobject, 2, MUIM_Popstring_Close, TRUE);
624 /* The callbacks of the buttons within the list page */
625 DoMethod(list_add_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 3, MUIM_CallHook, &hook_standard, add_function);
626 DoMethod(list_remove_button, MUIM_Notify, MUIA_Pressed, FALSE, list2, 2, MUIM_List_Remove, MUIV_List_Remove_Active);
627 DoMethod(list_clear_button, MUIM_Notify, MUIA_Pressed, FALSE, list2, 1, MUIM_List_Clear);
629 /* radio */
630 DoMethod(country_radio[0], MUIM_Notify, MUIA_Radio_Active, MUIV_EveryTime, country_radio[1], 3, MUIM_NoNotifySet, MUIA_Radio_Active, MUIV_TriggerValue);
631 DoMethod(country_radio[1], MUIM_Notify, MUIA_Radio_Active, MUIV_EveryTime, country_radio[0], 3, MUIM_NoNotifySet, MUIA_Radio_Active, MUIV_TriggerValue);
633 #if defined(TEST_ICONLIST)
634 /* iconlist */
635 DoMethod(volume_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick, TRUE, volume_iconlist, 3, MUIM_CallHook, &hook_standard, volume_doubleclicked);
636 DoMethod(drawer_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick, TRUE, drawer_iconlist, 3, MUIM_CallHook, &hook_standard, drawer_doubleclicked);
637 #endif
639 set(wnd,MUIA_Window_Open,TRUE);
640 set(wnd,MUIA_Window_ScreenTitle, "Zune Test application");
642 while((LONG) DoMethod(app, MUIM_Application_NewInput, &sigs) != MUIV_Application_ReturnID_Quit)
644 if (sigs)
646 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
647 if (sigs & SIGBREAKF_CTRL_C) break;
648 if (sigs & SIGBREAKF_CTRL_D) break;
652 MUI_DisposeObject(app);
654 if (context_menu) MUI_DisposeObject(context_menu);
655 CloseLibrary(ColorWheelBase);
656 MUI_DeleteCustomClass(CL_DropText);
658 CloseLibrary(MUIMasterBase);
659 return 0;