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
,
698 ASLFR_DoSaveMode
, TRUE
,
699 MUIA_Popstring_String
, filename_string
=
700 MUI_MakeObject(MUIO_String
, NULL
, 200),
701 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
704 MUI_MakeObject(MUIO_Button
, "Save"),
708 Child
, RegisterGroup(list_pages
),
710 Child
, ColGroup(LIST_COUNT
),
711 Child
, VGroup
, GroupFrameT("No Multiselect"),
712 Child
, ListviewObject
,
714 lists
[0] = ListObject
,
716 MUIA_List_Title
, "Fruits",
717 MUIA_List_SourceArray
, fruits
,
719 MUIA_Listview_MultiSelect
,
720 MUIV_Listview_MultiSelect_None
,
725 GroupFrameT("Default Multiselect"),
726 Child
, ListviewObject
,
728 lists
[1] = ListObject
,
730 MUIA_List_SourceArray
, fruits
,
732 MUIA_Listview_ScrollerPos
,
733 MUIV_Listview_ScrollerPos_Left
,
738 GroupFrameT("Shifted Multiselect"),
739 Child
, ListviewObject
,
741 lists
[2] = ListObject
,
743 MUIA_List_SourceArray
, fruits
,
745 MUIA_Listview_MultiSelect
,
746 MUIV_Listview_MultiSelect_Shifted
,
747 MUIA_Listview_ScrollerPos
,
748 MUIV_Listview_ScrollerPos_Right
,
753 GroupFrameT("Unconditional Multiselect"),
754 Child
, ListviewObject
,
756 lists
[3] = ListObject
,
758 MUIA_List_SourceArray
, fruits
,
760 MUIA_Listview_MultiSelect
,
761 MUIV_Listview_MultiSelect_Always
,
762 MUIA_Listview_ScrollerPos
,
763 MUIV_Listview_ScrollerPos_None
,
768 GroupFrameT("Read Only"),
769 Child
, ListviewObject
,
771 lists
[4] = ListObject
,
773 MUIA_List_SourceArray
, fruits
,
775 MUIA_Listview_Input
, FALSE
,
780 Child
, RectangleObject
,
782 MUIA_Rectangle_HBar
, TRUE
,
783 MUIA_Rectangle_BarTitle
, "List Controls",
787 MUI_MakeObject(MUIO_Button
, "Sort"),
788 Child
, clear_button
=
789 MUI_MakeObject(MUIO_Button
, "Clear"),
791 MUI_MakeObject(MUIO_Button
, "Fill"),
793 Child
, dragsortable_check
=
794 MUI_MakeObject(MUIO_Checkmark
, NULL
),
795 Child
, MUI_MakeObject(MUIO_Label
,
800 Child
, showdropmarks_check
=
801 MUI_MakeObject(MUIO_Checkmark
, NULL
),
802 Child
, MUI_MakeObject(MUIO_Label
,
803 "Show drop marks", 0),
808 MUI_MakeObject(MUIO_Checkmark
,NULL
),
809 Child
, MUI_MakeObject(MUIO_Label
,
816 Child
, ListviewObject
,
817 MUIA_Listview_List
, list2
= ListObject
,
819 MUIA_List_DisplayHook
, &hook_display2
,
823 Child
, list_add_button
=
824 MUI_MakeObject(MUIO_Button
,"_Add"),
825 Child
, list_remove_button
=
826 MUI_MakeObject(MUIO_Button
,"_Remove"),
827 Child
, list_clear_button
=
828 MUI_MakeObject(MUIO_Button
,"_Clear"),
832 Child
, ColGroup(LIST_COUNT
/ 2),
833 Child
, VGroup
, GroupFrameT("Standard Format"),
834 Child
, ListviewObject
,
836 multi_lists
[0] = ListObject
,
838 MUIA_List_DisplayHook
,
840 MUIA_List_Format
, list_format
,
841 MUIA_List_SourceArray
, entries
,
842 MUIA_List_Title
, TRUE
,
844 MUIA_Listview_MultiSelect
,
845 MUIV_Listview_MultiSelect_None
,
849 Child
, VGroup
, GroupFrameT("Custom Format"),
850 Child
, ListviewObject
,
852 multi_lists
[1] = ListObject
,
854 MUIA_List_DisplayHook
,
856 MUIA_List_Format
, list_format
,
857 MUIA_List_SourceArray
, entries
,
858 MUIA_List_Title
, TRUE
,
860 MUIA_Listview_MultiSelect
,
861 MUIV_Listview_MultiSelect_None
,
866 Child
, RectangleObject
,
868 MUIA_Rectangle_HBar
, TRUE
,
869 MUIA_Rectangle_BarTitle
, "List Controls",
872 Child
, MUI_MakeObject(MUIO_Label
, "Format:", 0),
873 Child
, format_string
= StringObject
,
875 MUIA_String_Contents
, list_format
,
878 Child
, showheadings_check
=
879 MUI_MakeObject(MUIO_Checkmark
, NULL
),
880 Child
, MUI_MakeObject(MUIO_Label
,
881 "Show column headings", 0),
893 MUIA_Gauge_InfoText
, "%ld %%",
894 MUIA_Gauge_Horiz
, TRUE
,
895 MUIA_Gauge_Current
, 25,
904 MUIA_Gauge_InfoText
, "%ld %%",
905 MUIA_Gauge_Horiz
, TRUE
,
906 MUIA_Gauge_Current
, 50,
915 MUIA_Gauge_InfoText
, "%ld %%",
916 MUIA_Gauge_Horiz
, TRUE
,
917 MUIA_Gauge_Current
, 75,
927 MUIA_Gauge_InfoText
, "%ld %%",
928 MUIA_Gauge_Current
, 25,
932 MUIA_Gauge_InfoText
, "%ld %%",
933 MUIA_Gauge_Current
, 50,
937 MUIA_Gauge_InfoText
, "%ld %%",
938 MUIA_Gauge_Current
, 75,
947 GroupFrameT("Horizontal Sliders"),
948 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
949 Child
, numerics
[HNSLIDER
] = SliderObject
,
950 MUIA_Slider_Horiz
, TRUE
,
951 MUIA_Numeric_Min
, NUMERIC_MIN
,
952 MUIA_Numeric_Max
, NUMERIC_MAX
,
955 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
956 Child
, numerics
[HRSLIDER
] = SliderObject
,
957 MUIA_Numeric_Reverse
, TRUE
,
958 MUIA_Numeric_Min
, NUMERIC_MIN
,
959 MUIA_Numeric_Max
, NUMERIC_MAX
,
962 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
963 Child
, numerics
[HQSLIDER
] = SliderObject
,
964 MUIA_Slider_Quiet
, TRUE
,
965 MUIA_Numeric_Min
, NUMERIC_MIN
,
966 MUIA_Numeric_Max
, NUMERIC_MAX
,
971 GroupFrameT("Vertical Sliders"),
972 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
973 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
974 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
975 Child
, numerics
[VNSLIDER
] = SliderObject
,
976 MUIA_Slider_Horiz
, FALSE
,
977 MUIA_Numeric_Min
, NUMERIC_MIN
,
978 MUIA_Numeric_Max
, NUMERIC_MAX
,
981 Child
, numerics
[VRSLIDER
] = SliderObject
,
982 MUIA_Slider_Horiz
, FALSE
,
983 MUIA_Numeric_Reverse
, TRUE
,
984 MUIA_Numeric_Min
, NUMERIC_MIN
,
985 MUIA_Numeric_Max
, NUMERIC_MAX
,
988 Child
, numerics
[VQSLIDER
] = SliderObject
,
989 MUIA_Slider_Horiz
, FALSE
,
990 MUIA_Slider_Quiet
, TRUE
,
991 MUIA_Numeric_Min
, NUMERIC_MIN
,
992 MUIA_Numeric_Max
, NUMERIC_MAX
,
997 GroupFrameT("Numeric Buttons"),
998 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
999 Child
, numerics
[NNUMERICBUTTON
] =
1000 NumericbuttonObject
,
1001 MUIA_Numeric_Min
, NUMERIC_MIN
,
1002 MUIA_Numeric_Max
, NUMERIC_MAX
,
1005 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
1006 Child
, numerics
[RNUMERICBUTTON
] =
1007 NumericbuttonObject
,
1008 MUIA_Numeric_Reverse
, TRUE
,
1009 MUIA_Numeric_Min
, NUMERIC_MIN
,
1010 MUIA_Numeric_Max
, NUMERIC_MAX
,
1015 GroupFrameT("Knobs"),
1016 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
1017 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
1018 Child
, numerics
[NKNOB
] = KnobObject
,
1019 MUIA_Numeric_Min
, NUMERIC_MIN
,
1020 MUIA_Numeric_Max
, NUMERIC_MAX
,
1023 Child
, numerics
[RKNOB
] = KnobObject
,
1024 MUIA_Numeric_Reverse
, TRUE
,
1025 MUIA_Numeric_Min
, NUMERIC_MIN
,
1026 MUIA_Numeric_Max
, NUMERIC_MAX
,
1031 Child
, MUI_MakeObject(MUIO_Label
,
1032 "Minimum Value:", 0),
1033 Child
, min_string
= (Object
*)StringObject
,
1035 MUIA_String_Accept
, (IPTR
)"-0123456789",
1036 MUIA_String_Integer
, NUMERIC_MIN
,
1039 Child
, MUI_MakeObject(MUIO_Label
,
1040 "Maximum Value:", 0),
1041 Child
, max_string
= (Object
*)StringObject
,
1043 MUIA_String_Accept
, (IPTR
)"-0123456789",
1044 MUIA_String_Integer
, NUMERIC_MAX
,
1047 Child
, slider_button
= TextObject
,
1049 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1051 MUIA_Background
, MUII_ButtonBack
,
1052 MUIA_Text_PreParse
, "\33c",
1054 "Change Slider Orientations",
1056 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
1065 MUIA_Radio_Entries
, radio_entries1
,
1067 Child
, country_radio
[0] = RadioObject
,
1069 MUIA_Radio_Entries
, radio_entries2
,
1070 MUIA_Radio_Active
, 1,
1076 MUIA_Radio_Entries
, radio_entries1
,
1078 Child
, country_radio
[1] = RadioObject
,
1080 MUIA_Radio_Entries
, radio_entries2
,
1081 MUIA_Radio_Active
, 1,
1086 #if defined(TEST_ICONLIST)
1089 Child
, volume_iconlist
=
1090 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
1092 Child
, drawer_iconlist
=
1093 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
1094 MUIA_IconDrawerList_Drawer
, "SYS:",
1101 Child
, create_balance_column(),
1102 Child
, BalanceObject
,
1105 Child
, create_balance_column(),
1106 Child
, BalanceObject
,
1109 Child
, create_balance_column(),
1110 Child
, BalanceObject
,
1113 Child
, create_balance_column(),
1114 Child
, BalanceObject
,
1117 Child
, create_balance_column(),
1124 Child
, about_button
= TextObject
,
1126 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1128 MUIA_Background
, MUII_ButtonBack
,
1129 MUIA_Text_PreParse
, "\33c",
1130 MUIA_Text_Contents
, "About",
1132 Child
, quit_button
= TextObject
,
1134 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1136 MUIA_Background
, MUII_ButtonBack
,
1137 MUIA_ControlChar
, 'q',
1138 MUIA_Text_HiChar
, 'q',
1139 MUIA_Text_PreParse
, "\33c",
1140 MUIA_Text_Contents
, "Quit",
1146 SubWindow
, second_wnd
= WindowObject
,
1147 MUIA_Window_Title
, "Second window",
1148 WindowContents
, VGroup
,
1149 Child
, DropTextObject
,
1150 MUIA_Text_Contents
, "Drop here",
1151 MUIA_Dropable
, TRUE
,
1162 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
1163 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
1164 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
1165 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
1166 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
,
1167 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
1168 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1169 MUIM_Application_AboutMUI
, NULL
);
1170 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1171 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
1172 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1173 MUIM_CallHook
, &hook_objects
);
1174 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
1175 app
, 2, MUIM_CallHook
, &hook
);
1177 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
1178 MUIM_CallHook
, &hook_wheel
);
1179 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
1180 2, MUIM_CallHook
, &hook_wheel
);
1181 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1182 app
, 2, MUIM_CallHook
, &hook_slider
);
1183 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1184 app
, 2, MUIM_CallHook
, &hook_slider
);
1185 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1186 app
, 2, MUIM_CallHook
, &hook_slider
);
1188 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
1189 MUIM_CallHook
, &hook_standard
, save_function
);
1191 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
1192 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
1193 MUIV_Application_ReturnID_Quit
);
1194 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
1195 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
1199 set(showdropmarks_check
, MUIA_Selected
, TRUE
);
1200 for (i
= 0; i
< LIST_COUNT
; i
++)
1202 DoMethod(sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1203 lists
[i
], 1, MUIM_List_Sort
);
1204 DoMethod(clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1205 lists
[i
], 1, MUIM_List_Clear
);
1206 DoMethod(fill_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1207 lists
[i
], 4, MUIM_List_Insert
, fruits
, -1,
1208 MUIV_List_Insert_Bottom
);
1209 DoMethod(dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
1210 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
,
1211 MUIA_List_DragSortable
, MUIV_TriggerValue
);
1212 DoMethod(showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
1213 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
,
1214 MUIA_List_ShowDropMarks
, MUIV_TriggerValue
);
1215 DoMethod(quiet_check
, MUIM_Notify
, MUIA_Selected
,
1216 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
, MUIA_List_Quiet
,
1220 set(showheadings_check
, MUIA_Selected
, TRUE
);
1221 DoMethod(format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
1222 MUIV_EveryTime
, multi_lists
[1], 3, MUIM_Set
, MUIA_List_Format
,
1224 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
1226 DoMethod(showheadings_check
, MUIM_Notify
, MUIA_Selected
,
1227 MUIV_EveryTime
, multi_lists
[i
], 3, MUIM_Set
,
1228 MUIA_List_Title
, MUIV_TriggerValue
);
1231 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
1232 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
1234 /* The callbacks of the buttons within the list page */
1235 DoMethod(list_add_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
1236 MUIM_CallHook
, &hook_standard
, add_function
);
1237 DoMethod(list_remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1238 list2
, 2, MUIM_List_Remove
, MUIV_List_Remove_Active
);
1239 DoMethod(list_clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, list2
,
1240 1, MUIM_List_Clear
);
1243 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
1245 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
1246 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
1248 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
1249 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
1252 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1253 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
1256 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
1257 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
1258 MUIA_Radio_Active
, MUIV_TriggerValue
);
1259 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
1260 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
1261 MUIA_Radio_Active
, MUIV_TriggerValue
);
1263 #if defined(TEST_ICONLIST)
1265 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
1266 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
1267 volume_doubleclicked
);
1268 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
1269 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
1270 drawer_doubleclicked
);
1273 set(wnd
, MUIA_Window_Open
, TRUE
);
1274 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test application");
1276 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
1277 &sigs
) != MUIV_Application_ReturnID_Quit
)
1281 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
1282 if (sigs
& SIGBREAKF_CTRL_C
)
1284 if (sigs
& SIGBREAKF_CTRL_D
)
1289 MUI_DisposeObject(app
);
1292 MUI_DisposeObject(context_menu
);
1293 CloseLibrary(ColorWheelBase
);
1294 MUI_DeleteCustomClass(CL_DropText
);
1296 CloseLibrary(MUIMasterBase
);