2 Copyright © 2002, The AROS Development Team.
8 #define INTUITION_NO_INLINE_STDARG
10 #include <exec/types.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 easiey
31 #include <libraries/mui.h>
33 struct Library
*MUIMasterBase
;
34 struct Library
*ColorWheelBase
;
51 Object
*filename_string
;
55 Object
*drawer_iconlist
;
56 Object
*volume_iconlist
;
58 AROS_UFH0(void, repeat_function
)
62 printf("MUI_Timer\n");
67 AROS_UFH0(void, wheel_function
)
71 nnset(r_slider
,MUIA_Numeric_Value
, (XGET(wheel
,WHEEL_Red
) >> 24) & 0xff);
72 nnset(g_slider
,MUIA_Numeric_Value
, (XGET(wheel
,WHEEL_Green
) >> 24) & 0xff);
73 nnset(b_slider
,MUIA_Numeric_Value
, (XGET(wheel
,WHEEL_Blue
) >> 24) & 0xff);
78 AROS_UFH0(void, slider_function
)
82 struct ColorWheelRGB cw
;
83 ULONG red
= XGET(r_slider
,MUIA_Numeric_Value
);
84 ULONG green
= XGET(g_slider
,MUIA_Numeric_Value
);
85 ULONG blue
= XGET(b_slider
,MUIA_Numeric_Value
);
87 cw
.cw_Red
= (red
<<24)|(red
<<16)|(red
<<8)|red
;
88 cw
.cw_Green
= (green
<<24)|(green
<<16)|(green
<<8)|green
;
89 cw
.cw_Blue
= (blue
<<24)|(blue
<<16)|(blue
<<8)|blue
;
91 nnset(wheel
, WHEEL_RGB
, &cw
);
92 set(hue_gauge
, MUIA_Gauge_Current
, XGET(wheel
,WHEEL_Hue
));
97 AROS_UFH0(void, objects_function
)
101 Object
*new_obj
= MUI_MakeObject(MUIO_Button
,"Button");
104 DoMethod(group
, MUIM_Group_InitChange
);
105 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
106 DoMethod(group
, MUIM_Group_ExitChange
);
112 AROS_UFH0(void, about_function
)
116 static Object
*about_wnd
;
119 about_wnd
= AboutmuiObject
,
120 MUIA_Aboutmui_Application
, app
,
124 if (about_wnd
) set(about_wnd
,MUIA_Window_Open
,TRUE
);
129 AROS_UFH3(void, display_function
,
130 AROS_UFHA(struct Hook
*, h
, A0
),
131 AROS_UFHA(char **, strings
, A2
),
132 AROS_UFHA(struct list_entry
*, entry
, A1
))
136 static char buf
[100];
139 sprintf(buf
,"%ld", (LONG
) *(strings
-1));
141 strings
[1] = entry
->column1
;
142 strings
[2] = entry
->column2
;
145 strings
[0] = "Number";
146 strings
[1] = "Column 1";
147 strings
[2] = "Column 2";
153 AROS_UFH3(void, display2_function
,
154 AROS_UFHA(struct Hook
*, h
, A0
),
155 AROS_UFHA(char **, strings
, A2
),
156 AROS_UFHA(struct list_entry
*, entry
, A1
))
160 static char buf
[100];
163 sprintf(buf
,"line num: %ld id: %p", (LONG
) *(strings
-1), entry
);
167 strings
[0] = "Number";
173 AROS_UFH0(void, save_function
)
177 char *text
= (char*)XGET(editor_text
, MUIA_Text_Contents
);
178 char *filename
= (char*)XGET(filename_string
, MUIA_String_Contents
);
181 if (!strlen(filename
)) return;
183 if ((fh
= Open(filename
,MODE_NEWFILE
)))
185 Write(fh
,text
,strlen(text
));
194 AROS_UFH0(void, add_function
)
198 DoMethod(list2
,MUIM_List_InsertSingle
, id
++, MUIV_List_Insert_Bottom
);
203 AROS_UFH0(void, add_child_function
)
207 int act
= XGET(list2
,MUIA_List_Active
);
209 DoMethod(list2
,MUIM_List_InsertSingleAsTree
, id
++, act
/* parent */, MUIV_List_InsertSingleAsTree_Bottom
, 0);
214 /* IconList callbacks */
215 void volume_doubleclicked(void)
218 struct IconList_Entry
*ent
= (void*)MUIV_IconList_NextSelected_Start
;
219 DoMethod(volume_iconlist
, MUIM_IconList_NextSelected
, &ent
);
220 if ((int)ent
== MUIV_IconList_NextSelected_End
) return;
222 strcpy(buf
,ent
->label
);
224 set(drawer_iconlist
,MUIA_IconDrawerList_Drawer
,buf
);
227 void drawer_doubleclicked(void)
229 struct IconList_Entry
*ent
= (void*)MUIV_IconList_NextSelected_Start
;
231 DoMethod(drawer_iconlist
, MUIM_IconList_NextSelected
, &ent
);
232 if ((int)ent
== MUIV_IconList_NextSelected_End
) return;
233 set(drawer_iconlist
,MUIA_IconDrawerList_Drawer
,ent
->filename
);
236 static IPTR
create_balance_column(void)
238 return (IPTR
) VGroup
,
239 Child
, RectangleObject
, GaugeFrame
, End
,
240 Child
, BalanceObject
, End
,
241 Child
, RectangleObject
, GaugeFrame
, End
,
242 Child
, BalanceObject
, End
,
243 Child
, RectangleObject
, GaugeFrame
, End
,
244 Child
, BalanceObject
, End
,
245 Child
, RectangleObject
, GaugeFrame
, End
,
246 Child
, BalanceObject
, End
,
247 Child
, RectangleObject
, GaugeFrame
, End
,
251 /* The custom class */
260 struct Library
*KeymapBase
;
264 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
, register __a2 Object
*obj
, register __a1 Msg msg
)
266 AROS_UFH3S(IPTR
, dispatcher
,
267 AROS_UFHA(Class
*, cl
, A0
),
268 AROS_UFHA(Object
*, obj
, A2
),
269 AROS_UFHA(Msg
, msg
, A1
))
274 switch (msg
->MethodID
)
276 case MUIM_DragQuery
: return MUIV_DragQuery_Accept
;
279 struct DropText_Data
*data
= (struct DropText_Data
*)INST_DATA(cl
,obj
);
282 sprintf(buf
,"%ld times",data
->times
); /* no MUIM_SetAsString yet */
283 set(obj
,MUIA_Text_Contents
,buf
);
287 return DoSuperMethodA(cl
,obj
,(Msg
)msg
);
292 struct MUI_CustomClass
*CL_DropText
;
294 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
298 static struct Hook hook_standard
;
300 AROS_UFH3(void, hook_func_standard
,
301 AROS_UFHA(struct Hook
*, h
, A0
),
302 AROS_UFHA(void *, dummy
, A2
),
303 AROS_UFHA(void **, funcptr
, A1
))
307 void (*func
) (ULONG
*) = (void (*)(ULONG
*)) (*funcptr
);
309 if (func
) func((ULONG
*) funcptr
+ 1);
316 Object
*wnd
,*second_wnd
;
319 Object
*repeat_button
;
320 Object
*objects_button
;
321 Object
*about_item
, *quit_item
;
322 Object
*context_menu
;
323 Object
*popobject
, *listview
;
324 Object
*list_add_button
, *list_add_child_button
, *list_remove_button
, *list_clear_button
;
325 Object
*country_radio
[2];
327 static char *pages
[] = {"Groups","Colorwheel","Virtual Group","Edit","List","Gauges","Radio","Icon List","Balancing",NULL
};
328 static char **radio_entries1
= pages
;
329 static char *radio_entries2
[] = {"Paris","Pataya","London","New-York","Reykjavik",NULL
};
331 static struct list_entry entry1
= {"Testentry1","Col2: Entry1"};
332 static struct list_entry entry2
= {"Entry2","Col2: Entry2"};
333 static struct list_entry entry3
= {"Entry3","Col2: Entry3"};
334 static struct list_entry entry4
= {"Entry4","Col2: Entry4"};
335 static struct list_entry entry5
= {"Entry5","Col2: Entry5"};
336 static struct list_entry entry6
= {"Entry6","Col2: Entry6"};
338 static struct list_entry
*entries
[] =
339 {&entry1
,&entry2
,&entry3
,&entry4
,&entry5
,&entry6
,NULL
};
342 struct Hook hook_wheel
;
343 struct Hook hook_slider
;
344 struct Hook hook_objects
;
345 struct Hook hook_display
;
346 struct Hook hook_display2
;
348 hook_standard
.h_Entry
= (HOOKFUNC
)hook_func_standard
;
350 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library",0);
352 hook
.h_Entry
= (HOOKFUNC
)repeat_function
;
353 hook_wheel
.h_Entry
= (HOOKFUNC
)wheel_function
;
354 hook_slider
.h_Entry
= (HOOKFUNC
)slider_function
;
355 hook_objects
.h_Entry
= (HOOKFUNC
)objects_function
;
356 hook_display
.h_Entry
= (HOOKFUNC
)display_function
;
357 hook_display2
.h_Entry
= (HOOKFUNC
)display2_function
;
359 context_menu
= MenuitemObject
,
360 MUIA_Family_Child
, MenuitemObject
,
361 MUIA_Menuitem_Title
, "Menutest",
362 MUIA_Family_Child
, about_item
= MenuitemObject
, MUIA_Menuitem_Title
, "First Test Entry", End
,
363 MUIA_Family_Child
, quit_item
= MenuitemObject
, MUIA_Menuitem_Title
, "Second Test Entry", End
,
367 /* should check the result in a real program! */
368 CL_DropText
= MUI_CreateCustomClass(NULL
,MUIC_Text
,NULL
,sizeof(struct DropText_Data
), dispatcher
);
369 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget",0);
371 app
= ApplicationObject
,
372 MUIA_Application_Menustrip
, MenuitemObject
,
373 MUIA_Family_Child
, MenuitemObject
,
374 MUIA_Menuitem_Title
, "Project",
375 MUIA_Family_Child
, about_item
= MenuitemObject
, MUIA_Menuitem_Title
, "About...", MUIA_Menuitem_Shortcut
, "?", End
,
376 MUIA_Family_Child
, MenuitemObject
, MUIA_Menuitem_Title
, ~0, End
,
377 MUIA_Family_Child
, quit_item
= MenuitemObject
, MUIA_Menuitem_Title
, "Quit", MUIA_Menuitem_Shortcut
, "Q", End
,
380 SubWindow
, wnd
= WindowObject
,
381 MUIA_Window_Title
, "test",
382 MUIA_Window_Activate
, TRUE
,
384 WindowContents
, VGroup
,
385 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
,
386 Child
, popobject
= PopobjectObject
,
387 MUIA_Popstring_String
, MUI_MakeObject(MUIO_String
, NULL
, 200),
388 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
389 MUIA_Popobject_Object
, VGroup
,
390 Child
, TextObject
,MUIA_Text_Contents
,"test",End
,
391 Child
, listview
= ListviewObject
,
392 MUIA_Listview_List
, ListObject
,
394 MUIA_List_DisplayHook
, &hook_display
,
395 MUIA_List_Format
, ",,",
396 MUIA_List_SourceArray
, entries
,
397 MUIA_List_Title
, TRUE
,
402 Child
, RegisterGroup(pages
),
403 // MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
405 GroupFrameT("A horizontal group"),
407 GroupFrameT("A column group"),
408 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
,
409 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
,
410 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
,
411 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
,
412 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
,
413 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,
414 Child
, MUI_MakeObject(MUIO_Label
,"_Checkmark",0),
415 Child
, MUI_MakeObject(MUIO_Checkmark
,"_Checkmark"),
417 Child
, group
= VGroup
,
418 GroupFrameT("A vertical group"),
419 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
,
420 Child
, TextObject
, TextFrame
, MUIA_Background
, MUII_MARKHALFSHINE
, MUIA_CycleChain
, 1, MUIA_Text_PreParse
, "\33c", MUIA_Text_Contents
, "Pattern", End
,
421 Child
, ColoradjustObject
, End
,
424 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
428 Child
, wheel
= BoopsiObject
, /* MUI and Boopsi tags mixed */
430 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
431 MUIA_Boopsi_MinWidth
, 30, /* boopsi objects don't know */
432 MUIA_Boopsi_MinHeight
, 30, /* their sizes, so we help */
433 MUIA_Boopsi_Remember
, WHEEL_Saturation
, /* keep important values */
434 MUIA_Boopsi_Remember
, WHEEL_Hue
, /* during window resize */
435 MUIA_Boopsi_TagScreen
, WHEEL_Screen
, /* this magic fills in */
436 WHEEL_Screen
, NULL
, /* the screen pointer */
438 GA_Top
, 0, /* MUI will automatically */
439 GA_Width
, 0, /* fill in the correct values */
441 ICA_TARGET
, ICTARGET_IDCMP
, /* needed for notification */
442 WHEEL_Saturation
, 0, /* start in the center */
443 MUIA_FillArea
, TRUE
, /* use this because it defaults to FALSE
444 for boopsi gadgets but the colorwheel
445 doesnt bother about redrawing its backgorund */
448 Child
, r_slider
= SliderObject
, MUIA_Group_Horiz
, TRUE
, MUIA_Numeric_Min
, 0, MUIA_Numeric_Max
, 255, End
,
449 Child
, g_slider
= SliderObject
, MUIA_Group_Horiz
, TRUE
, MUIA_Numeric_Min
, 0, MUIA_Numeric_Max
, 255, End
,
450 Child
, b_slider
= SliderObject
, MUIA_Group_Horiz
, TRUE
, MUIA_Numeric_Min
, 0, MUIA_Numeric_Max
, 255, End
,
452 Child
, hue_gauge
= GaugeObject
, GaugeFrame
, MUIA_Gauge_Horiz
, TRUE
, MUIA_Gauge_Max
, 255, MUIA_Gauge_Divide
, 1<<24, MUIA_Gauge_InfoText
, "Hue: %ld",End
,
455 Child
, ScrollgroupObject
,
456 MUIA_Scrollgroup_Contents
, VGroupV
,
460 MUIA_Text_Contents
, "Line1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\nLine8\n\n\n\nLine9\nLine10\nLine11\n",
463 Child
, MUI_MakeObject(MUIO_Button
,"Button9"),
464 Child
, MUI_MakeObject(MUIO_Button
,"Button10"),
469 Child
, editor_text
= StringObject
,
471 MUIA_Text_Multiline
, TRUE
,
474 ASLFR_DoSaveMode
, TRUE
,
475 MUIA_Popstring_String
, filename_string
= MUI_MakeObject(MUIO_String
, NULL
, 200),
476 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
478 Child
, save_button
= MUI_MakeObject(MUIO_Button
, "Save"),
481 Child
, ListviewObject
,
482 MUIA_Listview_List
, list2
= ListObject
,
484 MUIA_List_DisplayHook
, &hook_display2
,
488 Child
, list_add_button
= MUI_MakeObject(MUIO_Button
,"_Add"),
489 Child
, list_add_child_button
= MUI_MakeObject(MUIO_Button
,"_Add Child"),
490 Child
, list_remove_button
= MUI_MakeObject(MUIO_Button
,"_Remove"),
491 Child
, list_clear_button
= MUI_MakeObject(MUIO_Button
,"_Clear"),
498 Child
, VGroup
, GroupFrame
,
499 Child
, GaugeObject
, GaugeFrame
, MUIA_Gauge_InfoText
, "%ld %%", MUIA_Gauge_Horiz
, TRUE
, MUIA_Gauge_Current
, 25, End
,
500 Child
, ScaleObject
, End
,
502 Child
, VGroup
, GroupFrame
,
503 Child
, GaugeObject
, GaugeFrame
, MUIA_Gauge_InfoText
, "%ld %%", MUIA_Gauge_Horiz
, TRUE
, MUIA_Gauge_Current
, 50, End
,
504 Child
, ScaleObject
, End
,
506 Child
, VGroup
, GroupFrame
,
507 Child
, GaugeObject
, GaugeFrame
, MUIA_Gauge_InfoText
, "%ld %%", MUIA_Gauge_Horiz
, TRUE
, MUIA_Gauge_Current
, 75, End
,
508 Child
, ScaleObject
, End
,
513 Child
, GaugeObject
, GaugeFrame
, MUIA_Gauge_InfoText
, "%ld %%", MUIA_Gauge_Current
, 25, End
,
514 Child
, GaugeObject
, GaugeFrame
, MUIA_Gauge_InfoText
, "%ld %%", MUIA_Gauge_Current
, 50, End
,
515 Child
, GaugeObject
, GaugeFrame
, MUIA_Gauge_InfoText
, "%ld %%", MUIA_Gauge_Current
, 75, End
,
523 Child
, RadioObject
, GroupFrame
, MUIA_Radio_Entries
, radio_entries1
, End
,
524 Child
, country_radio
[0] = RadioObject
, GroupFrame
, MUIA_Radio_Entries
, radio_entries2
, MUIA_Radio_Active
, 1, End
,
527 Child
, RadioObject
, GroupFrame
, MUIA_Radio_Entries
, radio_entries1
, End
,
528 Child
, country_radio
[1] = RadioObject
, GroupFrame
, MUIA_Radio_Entries
, radio_entries2
, MUIA_Radio_Active
, 1, End
,
533 Child
, volume_iconlist
= MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
, TAG_DONE
),
534 Child
, drawer_iconlist
= MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
, MUIA_IconDrawerList_Drawer
,"SYS:",TAG_DONE
),
539 Child
, create_balance_column(),
540 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(),
548 Child
, BalanceObject
, End
,
550 Child
, create_balance_column(),
555 Child
, RectangleObject
,
556 MUIA_VertWeight
,0, /* Seems to be not supported properly as orginal MUI doesn't allow to alter the height of the window */
557 MUIA_Rectangle_HBar
, TRUE
,
558 MUIA_Rectangle_BarTitle
,"Enter a string",
564 MUIA_String_AdvanceOnCR
, TRUE
,
569 MUIA_Cycle_Entries
, pages
,
571 Child
, ScrollbarObject
,
572 MUIA_Group_Horiz
, TRUE
,
573 MUIA_Prop_Visible
, 100,
574 MUIA_Prop_Entries
, 300,
579 Child
, quit_button
= TextObject
,
581 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
583 MUIA_Background
, MUII_ButtonBack
,
584 MUIA_ControlChar
, 'q',
585 MUIA_Text_HiChar
, 'q',
586 MUIA_Text_PreParse
, "\33c",
587 MUIA_Text_Contents
, "Quit",
592 SubWindow
, second_wnd
= WindowObject
,
593 MUIA_Window_Title
, "Second window",
595 WindowContents
, VGroup
,
596 Child
, DropTextObject
,
597 MUIA_Text_Contents
, "Drop here",
598 MUIA_Dropable
, TRUE
, End
,
607 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
608 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
609 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
610 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
611 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2, MUIM_CallHook
, &hook_objects
);
612 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
, app
, 2, MUIM_CallHook
, &hook
);
614 DoMethod(wheel
, MUIM_Notify
,WHEEL_Hue
, MUIV_EveryTime
, app
, 2, MUIM_CallHook
, &hook_wheel
);
615 DoMethod(wheel
, MUIM_Notify
,WHEEL_Saturation
, MUIV_EveryTime
, app
, 2, MUIM_CallHook
, &hook_wheel
);
616 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
, app
, 2, MUIM_CallHook
, &hook_slider
);
617 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
, app
, 2, MUIM_CallHook
, &hook_slider
);
618 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
, app
, 2, MUIM_CallHook
, &hook_slider
);
620 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3, MUIM_CallHook
, &hook_standard
, save_function
);
622 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
623 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
, about_function
);
625 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
, popobject
, 2, MUIM_Popstring_Close
, TRUE
);
627 /* The callbacks of the buttons within the list page */
628 DoMethod(list_add_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3, MUIM_CallHook
, &hook_standard
, add_function
);
629 DoMethod(list_add_child_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3, MUIM_CallHook
, &hook_standard
, add_child_function
);
630 DoMethod(list_remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, list2
, 2, MUIM_List_Remove
, MUIV_List_Remove_Active
);
631 DoMethod(list_clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, list2
, 1, MUIM_List_Clear
);
634 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
, MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
, MUIA_Radio_Active
, MUIV_TriggerValue
);
635 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
, MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
, MUIA_Radio_Active
, MUIV_TriggerValue
);
638 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
, TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
, volume_doubleclicked
);
639 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
, TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
, drawer_doubleclicked
);
641 set(wnd
,MUIA_Window_Open
,TRUE
);
642 set(wnd
,MUIA_Window_ScreenTitle
, "Zune Test application");
644 while((LONG
) DoMethod(app
, MUIM_Application_NewInput
, &sigs
) != MUIV_Application_ReturnID_Quit
)
648 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
649 if (sigs
& SIGBREAKF_CTRL_C
) break;
650 if (sigs
& SIGBREAKF_CTRL_D
) break;
654 MUI_DisposeObject(app
);
656 if (context_menu
) MUI_DisposeObject(context_menu
);
657 CloseLibrary(ColorWheelBase
);
658 MUI_DeleteCustomClass(CL_DropText
);
660 CloseLibrary(MUIMasterBase
);