2 Copyright © 2002-2014, 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 ** consists 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"
40 #define MULTI_LIST_COUNT 2
43 #define NUMERIC_MAX 100
45 static const TEXT list_format
[] = "BAR,BAR,";
62 struct Library
*MUIMasterBase
;
63 struct Library
*ColorWheelBase
;
80 Object
*filename_string
;
84 Object
*drawer_iconlist
;
85 Object
*volume_iconlist
;
87 AROS_UFH0(void, repeat_function
)
91 printf("MUI_Timer\n");
96 AROS_UFH0(void, wheel_function
)
100 nnset(r_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
101 WHEEL_Red
) >> 24) & 0xff);
102 nnset(g_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
103 WHEEL_Green
) >> 24) & 0xff);
104 nnset(b_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
105 WHEEL_Blue
) >> 24) & 0xff);
110 AROS_UFH0(void, slider_function
)
114 struct ColorWheelRGB cw
;
115 ULONG red
= XGET(r_slider
, MUIA_Numeric_Value
);
116 ULONG green
= XGET(g_slider
, MUIA_Numeric_Value
);
117 ULONG blue
= XGET(b_slider
, MUIA_Numeric_Value
);
119 cw
.cw_Red
= (red
<< 24) | (red
<< 16) | (red
<< 8) | red
;
120 cw
.cw_Green
= (green
<< 24) | (green
<< 16) | (green
<< 8) | green
;
121 cw
.cw_Blue
= (blue
<< 24) | (blue
<< 16) | (blue
<< 8) | blue
;
123 nnset(wheel
, WHEEL_RGB
, &cw
);
124 set(hue_gauge
, MUIA_Gauge_Current
, XGET(wheel
, WHEEL_Hue
));
129 AROS_UFH0(void, objects_function
)
133 Object
*new_obj
= MUI_MakeObject(MUIO_Button
, "Button");
136 DoMethod(group
, MUIM_Group_InitChange
);
137 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
138 DoMethod(group
, MUIM_Group_ExitChange
);
144 AROS_UFH0(void, about_function
)
148 static Object
*about_wnd
;
152 about_wnd
= AboutmuiObject
, MUIA_Aboutmui_Application
, app
, End
;
156 set(about_wnd
, MUIA_Window_Open
, TRUE
);
161 AROS_UFH3(void, display_function
,
162 AROS_UFHA(struct Hook
*, h
, A0
),
163 AROS_UFHA(char **, strings
, A2
),
164 AROS_UFHA(struct list_entry
*, entry
, A1
))
168 static char buf
[100];
172 sprintf(buf
, "%ld", (long)*(strings
- 1));
174 strings
[1] = entry
->column1
;
175 strings
[2] = entry
->column2
;
179 strings
[0] = "Number";
180 strings
[1] = "Column 1";
181 strings
[2] = "Column 2";
187 AROS_UFH3(void, display2_function
,
188 AROS_UFHA(struct Hook
*, h
, A0
),
189 AROS_UFHA(char **, strings
, A2
),
190 AROS_UFHA(struct list_entry
*, entry
, A1
))
194 static char buf
[100];
198 sprintf(buf
, "line num: %ld id: %p", (long)*(strings
- 1), entry
);
203 strings
[0] = "Number";
209 AROS_UFH0(void, save_function
)
213 char *text
= (char *)XGET(editor_text
, MUIA_String_Contents
);
214 char *filename
= (char *)XGET(filename_string
, MUIA_String_Contents
);
217 if (!strlen(filename
))
220 if ((fh
= Open(filename
, MODE_NEWFILE
)))
222 Write(fh
, text
, strlen(text
));
231 AROS_UFH0(void, add_function
)
235 DoMethod(list2
, MUIM_List_InsertSingle
, id
++,
236 MUIV_List_Insert_Bottom
);
241 #if defined(TEST_ICONLIST)
242 /* IconList callbacks */
243 void volume_doubleclicked(void)
246 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
248 DoMethod(volume_iconlist
, MUIM_IconList_NextIcon
,
249 MUIV_IconList_NextIcon_Selected
, &ent
);
250 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
253 strcpy(buf
, ent
->label
);
255 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
, buf
);
258 void drawer_doubleclicked(void)
260 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
262 DoMethod(drawer_iconlist
, MUIM_IconList_NextIcon
,
263 MUIV_IconList_NextIcon_Selected
, &ent
);
264 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
266 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
,
267 ent
->ile_IconEntry
->ie_IconNode
.ln_Name
);
271 static IPTR
create_balance_column(void)
273 return (IPTR
) VGroup
,
274 Child
, RectangleObject
,
277 Child
, BalanceObject
,
279 Child
, RectangleObject
,
282 Child
, BalanceObject
,
284 Child
, RectangleObject
,
287 Child
, BalanceObject
,
289 Child
, RectangleObject
,
292 Child
, BalanceObject
,
294 Child
, RectangleObject
,
300 /* The custom class */
309 struct Library
*KeymapBase
;
313 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
,
314 register __a2 Object
*obj
, register __a1 Msg msg
)
316 AROS_UFH3S(IPTR
, dispatcher
,
317 AROS_UFHA(Class
*, cl
, A0
),
318 AROS_UFHA(Object
*, obj
, A2
), AROS_UFHA(Msg
, msg
, A1
))
323 switch (msg
->MethodID
)
326 return MUIV_DragQuery_Accept
;
329 struct DropText_Data
*data
=
330 (struct DropText_Data
*)INST_DATA(cl
, obj
);
333 sprintf(buf
, "%ld times", (long)data
->times
);
334 /* no MUIM_SetAsString yet */
335 set(obj
, MUIA_Text_Contents
, buf
);
339 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
344 struct MUI_CustomClass
*CL_DropText
;
346 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
350 static struct Hook hook_standard
;
352 AROS_UFH3(void, hook_func_standard
,
353 AROS_UFHA(struct Hook
*, h
, A0
),
354 AROS_UFHA(void *, dummy
, A2
), AROS_UFHA(void **, funcptr
, A1
))
358 void (*func
) (ULONG
*) = (void (*)(ULONG
*))(*funcptr
);
361 func((ULONG
*) funcptr
+ 1);
368 Object
*wnd
, *second_wnd
;
370 Object
*about_button
;
372 Object
*repeat_button
;
373 Object
*objects_button
;
374 Object
*about_item
, *quit_item
;
375 Object
*context_menu
;
376 Object
*popobject
, *listview
;
377 Object
*lists
[LIST_COUNT
];
378 Object
*list_add_button
, *list_remove_button
, *list_clear_button
;
379 Object
*dragsortable_check
, *showdropmarks_check
, *quiet_check
;
380 Object
*sort_button
, *clear_button
, *fill_button
;
381 Object
*multi_lists
[MULTI_LIST_COUNT
];
382 Object
*format_string
;
383 Object
*showheadings_check
;
384 Object
*numerics
[NUMERIC_COUNT
];
385 Object
*min_string
, *max_string
;
386 Object
*slider_button
;
387 Object
*country_radio
[2];
390 static char *pages
[] =
391 {"General", "Text", "Colorwheel", "Color", "Edit", "List", "Gauges",
392 "Numeric", "Radio", "Icon List", "Balancing", NULL
};
393 static char *list_pages
[] =
394 {"Single Column (1)", "Single Column (2)", "Multicolumn", NULL
};
395 static char **radio_entries1
= pages
;
396 static char *radio_entries2
[] =
397 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL
};
398 static char *fruits
[] = {"Strawberry", "Apple", "Banana", "Orange",
399 "Grapefruit", "Kumquat", "Plum", "Raspberry", "Apricot", "Grape",
400 "Peach", "Lemon", "Lime", "Date", "Pineapple", "Blueberry", "Papaya",
401 "Cranberry", "Gooseberry", "Pear", "Fig", "Coconut", "Melon",
404 static struct list_entry entry1
= {"Testentry1", "Col2: Entry1"};
405 static struct list_entry entry2
= {"Entry2", "Col2: Entry2"};
406 static struct list_entry entry3
= {"Entry3", "Col2: Entry3"};
407 static struct list_entry entry4
= {"Entry4", "Col2: Entry4"};
408 static struct list_entry entry5
= {"Entry5", "Col2: Entry5"};
409 static struct list_entry entry6
= {"Entry6", "Col2: Entry6"};
411 static struct list_entry
*entries
[] =
412 {&entry1
, &entry2
, &entry3
, &entry4
, &entry5
, &entry6
, NULL
};
415 struct Hook hook_wheel
;
416 struct Hook hook_slider
;
417 struct Hook hook_objects
;
418 struct Hook hook_display
;
419 struct Hook hook_display2
;
421 hook_standard
.h_Entry
= (HOOKFUNC
) hook_func_standard
;
423 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library", 0);
425 hook
.h_Entry
= (HOOKFUNC
) repeat_function
;
426 hook_wheel
.h_Entry
= (HOOKFUNC
) wheel_function
;
427 hook_slider
.h_Entry
= (HOOKFUNC
) slider_function
;
428 hook_objects
.h_Entry
= (HOOKFUNC
) objects_function
;
429 hook_display
.h_Entry
= (HOOKFUNC
) display_function
;
430 hook_display2
.h_Entry
= (HOOKFUNC
) display2_function
;
432 context_menu
= MenuitemObject
,
433 MUIA_Family_Child
, MenuitemObject
,
434 MUIA_Menuitem_Title
, "Menutest",
435 MUIA_Family_Child
, about_item
= MenuitemObject
,
436 MUIA_Menuitem_Title
, "First Test Entry", End
,
437 MUIA_Family_Child
, quit_item
= MenuitemObject
,
438 MUIA_Menuitem_Title
, "Second Test Entry", End
,
442 /* should check the result in a real program! */
443 CL_DropText
= MUI_CreateCustomClass(NULL
, MUIC_Text
, NULL
,
444 sizeof(struct DropText_Data
), dispatcher
);
445 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget", 0);
447 app
= ApplicationObject
,
448 MUIA_Application_Menustrip
, MenuitemObject
,
449 MUIA_Family_Child
, MenuitemObject
,
450 MUIA_Menuitem_Title
, "Project",
451 MUIA_Family_Child
, about_item
= MenuitemObject
,
452 MUIA_Menuitem_Title
, "About...",
453 MUIA_Menuitem_Shortcut
, "?",
455 MUIA_Family_Child
, MenuitemObject
,
456 MUIA_Menuitem_Title
, (SIPTR
)-1,
458 MUIA_Family_Child
, quit_item
= MenuitemObject
,
459 MUIA_Menuitem_Title
, "Quit",
460 MUIA_Menuitem_Shortcut
, "Q",
465 SubWindow
, wnd
= WindowObject
,
466 MUIA_Window_Title
, "test",
467 MUIA_Window_Activate
, TRUE
,
469 WindowContents
, VGroup
,
470 Child
, RegisterGroup(pages
),
471 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
476 GroupFrameT("A horizontal group"),
478 GroupFrameT("A column group"),
479 Child
, repeat_button
= TextObject
,
482 MUIA_Background
, MUII_ButtonBack
,
483 MUIA_Text_PreParse
, "\33c",
484 MUIA_Text_Contents
, "Repeat",
485 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
490 MUIA_Background
, MUII_ButtonBack
,
491 MUIA_Text_PreParse
, "\33c",
492 MUIA_Text_Contents
, "Drag Me",
493 MUIA_Draggable
, TRUE
,
494 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
496 Child
, open_button
= TextObject
,
499 MUIA_Background
, MUII_ButtonBack
,
500 MUIA_Text_PreParse
, "\33c",
501 MUIA_Text_Contents
, "Open Window",
502 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
505 MUIA_ContextMenu
, context_menu
,
508 MUIA_Background
, MUII_ButtonBack
,
509 MUIA_Text_PreParse
, "\33c",
510 MUIA_Text_Contents
, "Press Right",
511 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
513 Child
, objects_button
= TextObject
,
516 MUIA_Background
, MUII_ButtonBack
,
517 MUIA_Text_PreParse
, "\33c",
518 MUIA_Text_Contents
, "Add Objects",
519 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
524 Child
, MUI_MakeObject(MUIO_Checkmark
,
528 Child
, MUI_MakeObject(MUIO_Label
,
535 Child
, group
= VGroup
,
536 GroupFrameT("A vertical group"),
537 Child
, DropTextObject
,
541 MUIA_Background
, MUII_ButtonBack
,
542 MUIA_Text_PreParse
, "\33c",
543 MUIA_Text_Contents
, "Drop Here",
545 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
549 MUIA_Background
, MUII_MARKHALFSHINE
,
551 MUIA_Text_PreParse
, "\33c",
552 MUIA_Text_Contents
, "Pattern",
554 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
556 Child
, ScrollgroupObject
,
557 GroupFrameT("A scroll group"),
558 MUIA_Scrollgroup_Contents
, VGroupV
,
563 "Line1\nLine2\nLine3\nLine4\n"
564 "Line5\nLine6\nLine7\nLine8\n"
566 "Line9\nLine10\nLine11\n",
569 Child
, MUI_MakeObject(MUIO_Button
,
571 Child
, MUI_MakeObject(MUIO_Button
,
577 Child
, popobject
= PopobjectObject
,
578 MUIA_Popstring_String
,
579 MUI_MakeObject(MUIO_String
, NULL
, 200),
580 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
581 MUIA_Popobject_Object
, VGroup
,
583 MUIA_Text_Contents
, "test",
585 Child
, listview
= ListviewObject
,
586 MUIA_Listview_List
, ListObject
,
588 MUIA_List_DisplayHook
, &hook_display
,
589 MUIA_List_Format
, ",,",
590 MUIA_List_SourceArray
, entries
,
591 MUIA_List_Title
, TRUE
,
598 MUIA_Cycle_Entries
, pages
,
600 Child
, ScrollbarObject
,
601 MUIA_Group_Horiz
, TRUE
,
602 MUIA_Prop_Visible
, 100,
603 MUIA_Prop_Entries
, 300,
611 MUIA_Background
, "2:cfffffff,cfffffff,10000000",
613 MUIA_Text_Contents
, "\33cHello World!\n"
614 "This is a text object\n\33lLeft \33bbold\33n\n"
617 Child
, RectangleObject
,
619 /* Seems to be not supported properly as orginal MUI
620 doesn't allow to alter the height of the window */
621 MUIA_Rectangle_HBar
, TRUE
,
622 MUIA_Rectangle_BarTitle
,"Enter a string",
627 MUIA_String_AdvanceOnCR
, TRUE
,
634 Child
, wheel
= BoopsiObject
, /* MUI/Boopsi tags mixed */
636 /* boopsi objects don't know */
637 /* their sizes, so we help */
638 /* keep important values */
639 /* during window resize */
640 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
641 MUIA_Boopsi_MinWidth
, 30,
642 MUIA_Boopsi_MinHeight
, 30,
643 MUIA_Boopsi_Remember
, WHEEL_Saturation
,
644 MUIA_Boopsi_Remember
, WHEEL_Hue
,
645 /* this magic fills in the screen pointer */
646 MUIA_Boopsi_TagScreen
, WHEEL_Screen
,
649 GA_Top
, 0, /* MUI will automatically */
650 GA_Width
, 0, /* fill in the correct values */
652 ICA_TARGET
, ICTARGET_IDCMP
,
653 /* needed for notification */
654 WHEEL_Saturation
, 0, /* start in the center */
656 /* use this because it defaults to FALSE
657 for boopsi gadgets but the colorwheel
658 doesn't bother about redrawing its
662 Child
, r_slider
= SliderObject
,
663 MUIA_Group_Horiz
, TRUE
,
665 MUIA_Numeric_Max
, 255,
667 Child
, g_slider
= SliderObject
,
668 MUIA_Group_Horiz
, TRUE
,
670 MUIA_Numeric_Max
, 255,
672 Child
, b_slider
= SliderObject
,
673 MUIA_Group_Horiz
, TRUE
,
675 MUIA_Numeric_Max
, 255,
677 Child
, hue_gauge
= GaugeObject
,
679 MUIA_Gauge_Horiz
, TRUE
,
681 MUIA_Gauge_Divide
, 1<<24,
682 MUIA_Gauge_InfoText
, "Hue: %ld",
687 Child
, VGroup
, GroupFrameT("Palette"),
688 Child
, PaletteObject
,
694 Child
, editor_text
= StringObject
,
696 MUIA_Text_Multiline
, TRUE
,
699 ASLFR_DoSaveMode
, TRUE
,
700 MUIA_Popstring_String
, filename_string
=
701 MUI_MakeObject(MUIO_String
, NULL
, 200),
702 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
705 MUI_MakeObject(MUIO_Button
, "Save"),
709 Child
, RegisterGroup(list_pages
),
711 Child
, ColGroup(LIST_COUNT
),
712 Child
, VGroup
, GroupFrameT("No Multiselect"),
713 Child
, ListviewObject
,
715 lists
[0] = ListObject
,
717 MUIA_List_Title
, "Fruits",
718 MUIA_List_SourceArray
, fruits
,
720 MUIA_Listview_MultiSelect
,
721 MUIV_Listview_MultiSelect_None
,
726 GroupFrameT("Default Multiselect"),
727 Child
, ListviewObject
,
729 lists
[1] = ListObject
,
731 MUIA_List_SourceArray
, fruits
,
733 MUIA_Listview_ScrollerPos
,
734 MUIV_Listview_ScrollerPos_Left
,
739 GroupFrameT("Shifted Multiselect"),
740 Child
, ListviewObject
,
742 lists
[2] = ListObject
,
744 MUIA_List_SourceArray
, fruits
,
746 MUIA_Listview_MultiSelect
,
747 MUIV_Listview_MultiSelect_Shifted
,
748 MUIA_Listview_ScrollerPos
,
749 MUIV_Listview_ScrollerPos_Right
,
754 GroupFrameT("Unconditional Multiselect"),
755 Child
, ListviewObject
,
757 lists
[3] = ListObject
,
759 MUIA_List_SourceArray
, fruits
,
761 MUIA_Listview_MultiSelect
,
762 MUIV_Listview_MultiSelect_Always
,
763 MUIA_Listview_ScrollerPos
,
764 MUIV_Listview_ScrollerPos_None
,
769 GroupFrameT("Read Only"),
770 Child
, ListviewObject
,
772 lists
[4] = ListObject
,
774 MUIA_List_SourceArray
, fruits
,
776 MUIA_Listview_Input
, FALSE
,
781 Child
, RectangleObject
,
783 MUIA_Rectangle_HBar
, TRUE
,
784 MUIA_Rectangle_BarTitle
, "List Controls",
788 MUI_MakeObject(MUIO_Button
, "Sort"),
789 Child
, clear_button
=
790 MUI_MakeObject(MUIO_Button
, "Clear"),
792 MUI_MakeObject(MUIO_Button
, "Fill"),
794 Child
, dragsortable_check
=
795 MUI_MakeObject(MUIO_Checkmark
, NULL
),
796 Child
, MUI_MakeObject(MUIO_Label
,
801 Child
, showdropmarks_check
=
802 MUI_MakeObject(MUIO_Checkmark
, NULL
),
803 Child
, MUI_MakeObject(MUIO_Label
,
804 "Show drop marks", 0),
809 MUI_MakeObject(MUIO_Checkmark
,NULL
),
810 Child
, MUI_MakeObject(MUIO_Label
,
817 Child
, ListviewObject
,
818 MUIA_Listview_List
, list2
= ListObject
,
820 MUIA_List_DisplayHook
, &hook_display2
,
824 Child
, list_add_button
=
825 MUI_MakeObject(MUIO_Button
,"_Add"),
826 Child
, list_remove_button
=
827 MUI_MakeObject(MUIO_Button
,"_Remove"),
828 Child
, list_clear_button
=
829 MUI_MakeObject(MUIO_Button
,"_Clear"),
833 Child
, ColGroup(LIST_COUNT
/ 2),
834 Child
, VGroup
, GroupFrameT("Standard Format"),
835 Child
, ListviewObject
,
837 multi_lists
[0] = ListObject
,
839 MUIA_List_DisplayHook
,
841 MUIA_List_Format
, list_format
,
842 MUIA_List_SourceArray
, entries
,
843 MUIA_List_Title
, TRUE
,
845 MUIA_Listview_MultiSelect
,
846 MUIV_Listview_MultiSelect_None
,
850 Child
, VGroup
, GroupFrameT("Custom Format"),
851 Child
, ListviewObject
,
853 multi_lists
[1] = ListObject
,
855 MUIA_List_DisplayHook
,
857 MUIA_List_Format
, list_format
,
858 MUIA_List_SourceArray
, entries
,
859 MUIA_List_Title
, TRUE
,
861 MUIA_Listview_MultiSelect
,
862 MUIV_Listview_MultiSelect_None
,
867 Child
, RectangleObject
,
869 MUIA_Rectangle_HBar
, TRUE
,
870 MUIA_Rectangle_BarTitle
, "List Controls",
873 Child
, MUI_MakeObject(MUIO_Label
, "Format:", 0),
874 Child
, format_string
= StringObject
,
876 MUIA_String_Contents
, list_format
,
879 Child
, showheadings_check
=
880 MUI_MakeObject(MUIO_Checkmark
, NULL
),
881 Child
, MUI_MakeObject(MUIO_Label
,
882 "Show column headings", 0),
894 MUIA_Gauge_InfoText
, "%ld %%",
895 MUIA_Gauge_Horiz
, TRUE
,
896 MUIA_Gauge_Current
, 25,
905 MUIA_Gauge_InfoText
, "%ld %%",
906 MUIA_Gauge_Horiz
, TRUE
,
907 MUIA_Gauge_Current
, 50,
916 MUIA_Gauge_InfoText
, "%ld %%",
917 MUIA_Gauge_Horiz
, TRUE
,
918 MUIA_Gauge_Current
, 75,
928 MUIA_Gauge_InfoText
, "%ld %%",
929 MUIA_Gauge_Current
, 25,
933 MUIA_Gauge_InfoText
, "%ld %%",
934 MUIA_Gauge_Current
, 50,
938 MUIA_Gauge_InfoText
, "%ld %%",
939 MUIA_Gauge_Current
, 75,
948 GroupFrameT("Horizontal Sliders"),
949 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
950 Child
, numerics
[HNSLIDER
] = SliderObject
,
951 MUIA_Slider_Horiz
, TRUE
,
952 MUIA_Numeric_Min
, NUMERIC_MIN
,
953 MUIA_Numeric_Max
, NUMERIC_MAX
,
956 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
957 Child
, numerics
[HRSLIDER
] = SliderObject
,
958 MUIA_Numeric_Reverse
, TRUE
,
959 MUIA_Numeric_Min
, NUMERIC_MIN
,
960 MUIA_Numeric_Max
, NUMERIC_MAX
,
963 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
964 Child
, numerics
[HQSLIDER
] = SliderObject
,
965 MUIA_Slider_Quiet
, TRUE
,
966 MUIA_Numeric_Min
, NUMERIC_MIN
,
967 MUIA_Numeric_Max
, NUMERIC_MAX
,
972 GroupFrameT("Vertical Sliders"),
973 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
974 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
975 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
976 Child
, numerics
[VNSLIDER
] = SliderObject
,
977 MUIA_Slider_Horiz
, FALSE
,
978 MUIA_Numeric_Min
, NUMERIC_MIN
,
979 MUIA_Numeric_Max
, NUMERIC_MAX
,
982 Child
, numerics
[VRSLIDER
] = SliderObject
,
983 MUIA_Slider_Horiz
, FALSE
,
984 MUIA_Numeric_Reverse
, TRUE
,
985 MUIA_Numeric_Min
, NUMERIC_MIN
,
986 MUIA_Numeric_Max
, NUMERIC_MAX
,
989 Child
, numerics
[VQSLIDER
] = SliderObject
,
990 MUIA_Slider_Horiz
, FALSE
,
991 MUIA_Slider_Quiet
, TRUE
,
992 MUIA_Numeric_Min
, NUMERIC_MIN
,
993 MUIA_Numeric_Max
, NUMERIC_MAX
,
998 GroupFrameT("Numeric Buttons"),
999 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
1000 Child
, numerics
[NNUMERICBUTTON
] =
1001 NumericbuttonObject
,
1002 MUIA_Numeric_Min
, NUMERIC_MIN
,
1003 MUIA_Numeric_Max
, NUMERIC_MAX
,
1006 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
1007 Child
, numerics
[RNUMERICBUTTON
] =
1008 NumericbuttonObject
,
1009 MUIA_Numeric_Reverse
, TRUE
,
1010 MUIA_Numeric_Min
, NUMERIC_MIN
,
1011 MUIA_Numeric_Max
, NUMERIC_MAX
,
1016 GroupFrameT("Knobs"),
1017 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
1018 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
1019 Child
, numerics
[NKNOB
] = KnobObject
,
1020 MUIA_Numeric_Min
, NUMERIC_MIN
,
1021 MUIA_Numeric_Max
, NUMERIC_MAX
,
1024 Child
, numerics
[RKNOB
] = KnobObject
,
1025 MUIA_Numeric_Reverse
, TRUE
,
1026 MUIA_Numeric_Min
, NUMERIC_MIN
,
1027 MUIA_Numeric_Max
, NUMERIC_MAX
,
1032 Child
, MUI_MakeObject(MUIO_Label
,
1033 "Minimum Value:", 0),
1034 Child
, min_string
= (Object
*)StringObject
,
1036 MUIA_String_Accept
, (IPTR
)"-0123456789",
1037 MUIA_String_Integer
, NUMERIC_MIN
,
1040 Child
, MUI_MakeObject(MUIO_Label
,
1041 "Maximum Value:", 0),
1042 Child
, max_string
= (Object
*)StringObject
,
1044 MUIA_String_Accept
, (IPTR
)"-0123456789",
1045 MUIA_String_Integer
, NUMERIC_MAX
,
1048 Child
, slider_button
= TextObject
,
1050 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1052 MUIA_Background
, MUII_ButtonBack
,
1053 MUIA_Text_PreParse
, "\33c",
1055 "Change Slider Orientations",
1057 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
1066 MUIA_Radio_Entries
, radio_entries1
,
1068 Child
, country_radio
[0] = RadioObject
,
1070 MUIA_Radio_Entries
, radio_entries2
,
1071 MUIA_Radio_Active
, 1,
1077 MUIA_Radio_Entries
, radio_entries1
,
1079 Child
, country_radio
[1] = RadioObject
,
1081 MUIA_Radio_Entries
, radio_entries2
,
1082 MUIA_Radio_Active
, 1,
1087 #if defined(TEST_ICONLIST)
1090 Child
, volume_iconlist
=
1091 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
1093 Child
, drawer_iconlist
=
1094 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
1095 MUIA_IconDrawerList_Drawer
, "SYS:",
1102 Child
, create_balance_column(),
1103 Child
, BalanceObject
,
1106 Child
, create_balance_column(),
1107 Child
, BalanceObject
,
1110 Child
, create_balance_column(),
1111 Child
, BalanceObject
,
1114 Child
, create_balance_column(),
1115 Child
, BalanceObject
,
1118 Child
, create_balance_column(),
1125 Child
, about_button
= TextObject
,
1127 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1129 MUIA_Background
, MUII_ButtonBack
,
1130 MUIA_Text_PreParse
, "\33c",
1131 MUIA_Text_Contents
, "About",
1133 Child
, quit_button
= TextObject
,
1135 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1137 MUIA_Background
, MUII_ButtonBack
,
1138 MUIA_ControlChar
, 'q',
1139 MUIA_Text_HiChar
, 'q',
1140 MUIA_Text_PreParse
, "\33c",
1141 MUIA_Text_Contents
, "Quit",
1147 SubWindow
, second_wnd
= WindowObject
,
1148 MUIA_Window_Title
, "Second window",
1149 WindowContents
, VGroup
,
1150 Child
, DropTextObject
,
1151 MUIA_Text_Contents
, "Drop here",
1152 MUIA_Dropable
, TRUE
,
1163 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
1164 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
1165 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
1166 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
1167 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
,
1168 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
1169 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1170 MUIM_Application_AboutMUI
, NULL
);
1171 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1172 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
1173 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1174 MUIM_CallHook
, &hook_objects
);
1175 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
1176 app
, 2, MUIM_CallHook
, &hook
);
1178 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
1179 MUIM_CallHook
, &hook_wheel
);
1180 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
1181 2, MUIM_CallHook
, &hook_wheel
);
1182 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1183 app
, 2, MUIM_CallHook
, &hook_slider
);
1184 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1185 app
, 2, MUIM_CallHook
, &hook_slider
);
1186 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1187 app
, 2, MUIM_CallHook
, &hook_slider
);
1189 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
1190 MUIM_CallHook
, &hook_standard
, save_function
);
1192 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
1193 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
1194 MUIV_Application_ReturnID_Quit
);
1195 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
1196 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
1200 set(showdropmarks_check
, MUIA_Selected
, TRUE
);
1201 for (i
= 0; i
< LIST_COUNT
; i
++)
1203 DoMethod(sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1204 lists
[i
], 1, MUIM_List_Sort
);
1205 DoMethod(clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1206 lists
[i
], 1, MUIM_List_Clear
);
1207 DoMethod(fill_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1208 lists
[i
], 4, MUIM_List_Insert
, fruits
, -1,
1209 MUIV_List_Insert_Bottom
);
1210 DoMethod(dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
1211 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
,
1212 MUIA_List_DragSortable
, MUIV_TriggerValue
);
1213 DoMethod(showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
1214 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
,
1215 MUIA_List_ShowDropMarks
, MUIV_TriggerValue
);
1216 DoMethod(quiet_check
, MUIM_Notify
, MUIA_Selected
,
1217 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
, MUIA_List_Quiet
,
1221 set(showheadings_check
, MUIA_Selected
, TRUE
);
1222 DoMethod(format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
1223 MUIV_EveryTime
, multi_lists
[1], 3, MUIM_Set
, MUIA_List_Format
,
1225 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
1227 DoMethod(showheadings_check
, MUIM_Notify
, MUIA_Selected
,
1228 MUIV_EveryTime
, multi_lists
[i
], 3, MUIM_Set
,
1229 MUIA_List_Title
, MUIV_TriggerValue
);
1232 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
1233 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
1235 /* The callbacks of the buttons within the list page */
1236 DoMethod(list_add_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
1237 MUIM_CallHook
, &hook_standard
, add_function
);
1238 DoMethod(list_remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1239 list2
, 2, MUIM_List_Remove
, MUIV_List_Remove_Active
);
1240 DoMethod(list_clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, list2
,
1241 1, MUIM_List_Clear
);
1244 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
1246 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
1247 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
1249 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
1250 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
1253 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1254 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
1257 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
1258 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
1259 MUIA_Radio_Active
, MUIV_TriggerValue
);
1260 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
1261 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
1262 MUIA_Radio_Active
, MUIV_TriggerValue
);
1264 #if defined(TEST_ICONLIST)
1266 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
1267 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
1268 volume_doubleclicked
);
1269 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
1270 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
1271 drawer_doubleclicked
);
1274 set(wnd
, MUIA_Window_Open
, TRUE
);
1275 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test application");
1277 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
1278 &sigs
) != MUIV_Application_ReturnID_Quit
)
1282 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
1283 if (sigs
& SIGBREAKF_CTRL_C
)
1285 if (sigs
& SIGBREAKF_CTRL_D
)
1290 MUI_DisposeObject(app
);
1293 MUI_DisposeObject(context_menu
);
1294 CloseLibrary(ColorWheelBase
);
1295 MUI_DeleteCustomClass(CL_DropText
);
1297 CloseLibrary(MUIMasterBase
);