2 Copyright © 2002-2008, 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 easy
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"
39 struct Library
*MUIMasterBase
;
40 struct Library
*ColorWheelBase
;
57 Object
*filename_string
;
61 Object
*drawer_iconlist
;
62 Object
*volume_iconlist
;
64 AROS_UFH0(void, repeat_function
)
68 printf("MUI_Timer\n");
73 AROS_UFH0(void, wheel_function
)
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);
84 AROS_UFH0(void, slider_function
)
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
));
103 AROS_UFH0(void, objects_function
)
107 Object
*new_obj
= MUI_MakeObject(MUIO_Button
,"Button");
110 DoMethod(group
, MUIM_Group_InitChange
);
111 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
112 DoMethod(group
, MUIM_Group_ExitChange
);
118 AROS_UFH0(void, about_function
)
122 static Object
*about_wnd
;
125 about_wnd
= AboutmuiObject
,
126 MUIA_Aboutmui_Application
, app
,
130 if (about_wnd
) set(about_wnd
,MUIA_Window_Open
,TRUE
);
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
))
142 static char buf
[100];
145 sprintf(buf
,"%ld", (LONG
) *(strings
-1));
147 strings
[1] = entry
->column1
;
148 strings
[2] = entry
->column2
;
151 strings
[0] = "Number";
152 strings
[1] = "Column 1";
153 strings
[2] = "Column 2";
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
))
166 static char buf
[100];
169 sprintf(buf
,"line num: %ld id: %p", (LONG
) *(strings
-1), entry
);
173 strings
[0] = "Number";
179 AROS_UFH0(void, save_function
)
183 char *text
= (char*)XGET(editor_text
, MUIA_Text_Contents
);
184 char *filename
= (char*)XGET(filename_string
, MUIA_String_Contents
);
187 if (!strlen(filename
)) return;
189 if ((fh
= Open(filename
,MODE_NEWFILE
)))
191 Write(fh
,text
,strlen(text
));
200 AROS_UFH0(void, add_function
)
204 DoMethod(list2
,MUIM_List_InsertSingle
, id
++, MUIV_List_Insert_Bottom
);
209 #if defined(TEST_ICONLIST)
210 /* IconList callbacks */
211 void volume_doubleclicked(void)
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
);
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
);
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
,
248 /* The custom class */
257 struct Library
*KeymapBase
;
261 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
, register __a2 Object
*obj
, register __a1 Msg msg
)
263 AROS_UFH3S(IPTR
, dispatcher
,
264 AROS_UFHA(Class
*, cl
, A0
),
265 AROS_UFHA(Object
*, obj
, A2
),
266 AROS_UFHA(Msg
, msg
, A1
))
271 switch (msg
->MethodID
)
273 case MUIM_DragQuery
: return MUIV_DragQuery_Accept
;
276 struct DropText_Data
*data
= (struct DropText_Data
*)INST_DATA(cl
,obj
);
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
);
289 struct MUI_CustomClass
*CL_DropText
;
291 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
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
))
304 void (*func
) (ULONG
*) = (void (*)(ULONG
*)) (*funcptr
);
306 if (func
) func((ULONG
*) funcptr
+ 1);
313 Object
*wnd
,*second_wnd
;
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
};
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
,
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
,
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
,
391 MUIA_List_DisplayHook
, &hook_display
,
392 MUIA_List_Format
, ",,",
393 MUIA_List_SourceArray
, entries
,
394 MUIA_List_Title
, TRUE
,
399 Child
, RegisterGroup(pages
),
400 // MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
402 GroupFrameT("A horizontal group"),
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"),
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
,
421 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
425 Child
, wheel
= BoopsiObject
, /* MUI and Boopsi tags mixed */
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 */
435 GA_Top
, 0, /* MUI will automatically */
436 GA_Width
, 0, /* fill in the correct values */
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 */
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
,
452 Child
, ScrollgroupObject
,
453 MUIA_Scrollgroup_Contents
, VGroupV
,
457 MUIA_Text_Contents
, "Line1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\nLine8\n\n\n\nLine9\nLine10\nLine11\n",
460 Child
, MUI_MakeObject(MUIO_Button
,"Button9"),
461 Child
, MUI_MakeObject(MUIO_Button
,"Button10"),
466 Child
, editor_text
= StringObject
,
468 MUIA_Text_Multiline
, TRUE
,
471 ASLFR_DoSaveMode
, TRUE
,
472 MUIA_Popstring_String
, filename_string
= MUI_MakeObject(MUIO_String
, NULL
, 200),
473 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
475 Child
, save_button
= MUI_MakeObject(MUIO_Button
, "Save"),
478 Child
, ListviewObject
,
479 MUIA_Listview_List
, list2
= ListObject
,
481 MUIA_List_DisplayHook
, &hook_display2
,
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"),
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
,
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
,
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
,
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
,
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
,
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
,
527 #if defined(TEST_ICONLIST)
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
),
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(),
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",
561 MUIA_String_AdvanceOnCR
, TRUE
,
566 MUIA_Cycle_Entries
, pages
,
568 Child
, ScrollbarObject
,
569 MUIA_Group_Horiz
, TRUE
,
570 MUIA_Prop_Visible
, 100,
571 MUIA_Prop_Entries
, 300,
576 Child
, quit_button
= TextObject
,
578 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
580 MUIA_Background
, MUII_ButtonBack
,
581 MUIA_ControlChar
, 'q',
582 MUIA_Text_HiChar
, 'q',
583 MUIA_Text_PreParse
, "\33c",
584 MUIA_Text_Contents
, "Quit",
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
,
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
);
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)
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
);
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
)
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
);