2 Copyright © 2002-2015, 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
, *enable_button
;
381 Object
*multi_lists
[MULTI_LIST_COUNT
];
382 Object
*format_string
;
383 Object
*column_string
;
385 Object
*showheadings_check
;
386 Object
*numerics
[NUMERIC_COUNT
];
387 Object
*min_string
, *max_string
;
388 Object
*slider_button
;
389 Object
*country_radio
[2];
392 static char *pages
[] =
393 {"General", "Text", "Colorwheel", "Color", "Edit", "List", "Gauges",
394 "Numeric", "Radio", "Icon List", "Balancing", NULL
};
395 static char *list_pages
[] =
396 {"Single Column (1)", "Single Column (2)", "Multicolumn", NULL
};
397 static char **radio_entries1
= pages
;
398 static char *radio_entries2
[] =
399 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL
};
400 static char *fruits
[] = {"Strawberry", "Apple", "Banana", "Orange",
401 "Grapefruit", "Kumquat", "Plum", "Raspberry", "Apricot", "Grape",
402 "Peach", "Lemon", "Lime", "Date", "Pineapple", "Blueberry", "Papaya",
403 "Cranberry", "Gooseberry", "Pear", "Fig", "Coconut", "Melon",
406 static struct list_entry entry1
= {"Testentry1", "Col2: Entry1"};
407 static struct list_entry entry2
= {"Entry2", "Col2: Entry2"};
408 static struct list_entry entry3
= {"Entry3", "Col2: Entry3"};
409 static struct list_entry entry4
= {"Entry4", "Col2: Entry4"};
410 static struct list_entry entry5
= {"Entry5", "Col2: Entry5"};
411 static struct list_entry entry6
= {"Entry6", "Col2: Entry6"};
413 static struct list_entry
*entries
[] =
414 {&entry1
, &entry2
, &entry3
, &entry4
, &entry5
, &entry6
, NULL
};
417 struct Hook hook_wheel
;
418 struct Hook hook_slider
;
419 struct Hook hook_objects
;
420 struct Hook hook_display
;
421 struct Hook hook_display2
;
423 hook_standard
.h_Entry
= (HOOKFUNC
) hook_func_standard
;
425 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library", 0);
427 hook
.h_Entry
= (HOOKFUNC
) repeat_function
;
428 hook_wheel
.h_Entry
= (HOOKFUNC
) wheel_function
;
429 hook_slider
.h_Entry
= (HOOKFUNC
) slider_function
;
430 hook_objects
.h_Entry
= (HOOKFUNC
) objects_function
;
431 hook_display
.h_Entry
= (HOOKFUNC
) display_function
;
432 hook_display2
.h_Entry
= (HOOKFUNC
) display2_function
;
434 context_menu
= MenuitemObject
,
435 MUIA_Family_Child
, MenuitemObject
,
436 MUIA_Menuitem_Title
, "Menutest",
437 MUIA_Family_Child
, about_item
= MenuitemObject
,
438 MUIA_Menuitem_Title
, "First Test Entry", End
,
439 MUIA_Family_Child
, quit_item
= MenuitemObject
,
440 MUIA_Menuitem_Title
, "Second Test Entry", End
,
444 /* should check the result in a real program! */
445 CL_DropText
= MUI_CreateCustomClass(NULL
, MUIC_Text
, NULL
,
446 sizeof(struct DropText_Data
), dispatcher
);
447 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget", 0);
449 app
= ApplicationObject
,
450 MUIA_Application_Menustrip
, MenuitemObject
,
451 MUIA_Family_Child
, MenuitemObject
,
452 MUIA_Menuitem_Title
, "Project",
453 MUIA_Family_Child
, about_item
= MenuitemObject
,
454 MUIA_Menuitem_Title
, "About...",
455 MUIA_Menuitem_Shortcut
, "?",
457 MUIA_Family_Child
, MenuitemObject
,
458 MUIA_Menuitem_Title
, (SIPTR
)-1,
460 MUIA_Family_Child
, quit_item
= MenuitemObject
,
461 MUIA_Menuitem_Title
, "Quit",
462 MUIA_Menuitem_Shortcut
, "Q",
467 SubWindow
, wnd
= WindowObject
,
468 MUIA_Window_Title
, "test",
469 MUIA_Window_Activate
, TRUE
,
471 WindowContents
, VGroup
,
472 Child
, RegisterGroup(pages
),
473 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
478 GroupFrameT("A horizontal group"),
480 GroupFrameT("A column group"),
481 Child
, repeat_button
= TextObject
,
484 MUIA_Background
, MUII_ButtonBack
,
485 MUIA_Text_PreParse
, "\33c",
486 MUIA_Text_Contents
, "Repeat",
487 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
492 MUIA_Background
, MUII_ButtonBack
,
493 MUIA_Text_PreParse
, "\33c",
494 MUIA_Text_Contents
, "Drag Me",
495 MUIA_Draggable
, TRUE
,
496 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
498 Child
, open_button
= TextObject
,
501 MUIA_Background
, MUII_ButtonBack
,
502 MUIA_Text_PreParse
, "\33c",
503 MUIA_Text_Contents
, "Open Window",
504 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
507 MUIA_ContextMenu
, context_menu
,
510 MUIA_Background
, MUII_ButtonBack
,
511 MUIA_Text_PreParse
, "\33c",
512 MUIA_Text_Contents
, "Press Right",
513 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
515 Child
, objects_button
= TextObject
,
518 MUIA_Background
, MUII_ButtonBack
,
519 MUIA_Text_PreParse
, "\33c",
520 MUIA_Text_Contents
, "Add Objects",
521 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
526 Child
, MUI_MakeObject(MUIO_Checkmark
,
530 Child
, MUI_MakeObject(MUIO_Label
,
537 Child
, group
= VGroup
,
538 GroupFrameT("A vertical group"),
539 Child
, DropTextObject
,
543 MUIA_Background
, MUII_ButtonBack
,
544 MUIA_Text_PreParse
, "\33c",
545 MUIA_Text_Contents
, "Drop Here",
547 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
551 MUIA_Background
, MUII_MARKHALFSHINE
,
553 MUIA_Text_PreParse
, "\33c",
554 MUIA_Text_Contents
, "Pattern",
556 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
558 Child
, ScrollgroupObject
,
559 GroupFrameT("A scroll group"),
560 MUIA_Scrollgroup_Contents
, VGroupV
,
565 "Line1\nLine2\nLine3\nLine4\n"
566 "Line5\nLine6\nLine7\nLine8\n"
568 "Line9\nLine10\nLine11\n",
571 Child
, MUI_MakeObject(MUIO_Button
,
573 Child
, MUI_MakeObject(MUIO_Button
,
579 Child
, popobject
= PopobjectObject
,
580 MUIA_Popstring_String
,
581 MUI_MakeObject(MUIO_String
, NULL
, 200),
582 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
583 MUIA_Popobject_Object
, VGroup
,
585 MUIA_Text_Contents
, "test",
587 Child
, listview
= ListviewObject
,
588 MUIA_Listview_List
, ListObject
,
590 MUIA_List_DisplayHook
, &hook_display
,
591 MUIA_List_Format
, ",,",
592 MUIA_List_SourceArray
, entries
,
593 MUIA_List_Title
, TRUE
,
600 MUIA_Cycle_Entries
, pages
,
602 Child
, ScrollbarObject
,
603 MUIA_Group_Horiz
, TRUE
,
604 MUIA_Prop_Visible
, 100,
605 MUIA_Prop_Entries
, 300,
613 MUIA_Background
, "2:cfffffff,cfffffff,10000000",
615 MUIA_Text_Contents
, "\33cHello World!\n"
616 "This is a text object\n\33lLeft \33bbold\33n\n"
619 Child
, RectangleObject
,
621 /* Seems to be not supported properly as orginal MUI
622 doesn't allow to alter the height of the window */
623 MUIA_Rectangle_HBar
, TRUE
,
624 MUIA_Rectangle_BarTitle
,"Enter a string",
629 MUIA_String_AdvanceOnCR
, TRUE
,
636 Child
, wheel
= BoopsiObject
, /* MUI/Boopsi tags mixed */
638 /* boopsi objects don't know */
639 /* their sizes, so we help */
640 /* keep important values */
641 /* during window resize */
642 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
643 MUIA_Boopsi_MinWidth
, 30,
644 MUIA_Boopsi_MinHeight
, 30,
645 MUIA_Boopsi_Remember
, WHEEL_Saturation
,
646 MUIA_Boopsi_Remember
, WHEEL_Hue
,
647 /* this magic fills in the screen pointer */
648 MUIA_Boopsi_TagScreen
, WHEEL_Screen
,
651 GA_Top
, 0, /* MUI will automatically */
652 GA_Width
, 0, /* fill in the correct values */
654 ICA_TARGET
, ICTARGET_IDCMP
,
655 /* needed for notification */
656 WHEEL_Saturation
, 0, /* start in the center */
658 /* use this because it defaults to FALSE
659 for boopsi gadgets but the colorwheel
660 doesn't bother about redrawing its
664 Child
, r_slider
= SliderObject
,
665 MUIA_Group_Horiz
, TRUE
,
667 MUIA_Numeric_Max
, 255,
669 Child
, g_slider
= SliderObject
,
670 MUIA_Group_Horiz
, TRUE
,
672 MUIA_Numeric_Max
, 255,
674 Child
, b_slider
= SliderObject
,
675 MUIA_Group_Horiz
, TRUE
,
677 MUIA_Numeric_Max
, 255,
679 Child
, hue_gauge
= GaugeObject
,
681 MUIA_Gauge_Horiz
, TRUE
,
683 MUIA_Gauge_Divide
, 1<<24,
684 MUIA_Gauge_InfoText
, "Hue: %ld",
689 Child
, VGroup
, GroupFrameT("Palette"),
690 Child
, PaletteObject
,
696 Child
, editor_text
= StringObject
,
700 ASLFR_DoSaveMode
, TRUE
,
701 MUIA_Popstring_String
, filename_string
=
702 MUI_MakeObject(MUIO_String
, NULL
, 200),
703 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
706 MUI_MakeObject(MUIO_Button
, "Save"),
710 Child
, RegisterGroup(list_pages
),
712 Child
, ColGroup(LIST_COUNT
),
713 Child
, VGroup
, GroupFrameT("No Multiselect"),
714 Child
, lists
[0] = ListviewObject
,
718 MUIA_List_Title
, "Fruits",
719 MUIA_List_SourceArray
, fruits
,
720 MUIA_ShortHelp
, "Default scroller",
722 MUIA_Listview_MultiSelect
,
723 MUIV_Listview_MultiSelect_None
,
728 GroupFrameT("Default Multiselect"),
729 Child
, lists
[1] = ListviewObject
,
733 MUIA_List_SourceArray
, fruits
,
734 MUIA_ShortHelp
, "Left scroller",
736 MUIA_Listview_ScrollerPos
,
737 MUIV_Listview_ScrollerPos_Left
,
742 GroupFrameT("Shifted Multiselect"),
743 Child
, lists
[2] = ListviewObject
,
747 MUIA_List_SourceArray
, fruits
,
748 MUIA_ShortHelp
, "Right scroller",
750 MUIA_Listview_MultiSelect
,
751 MUIV_Listview_MultiSelect_Shifted
,
752 MUIA_Listview_ScrollerPos
,
753 MUIV_Listview_ScrollerPos_Right
,
758 GroupFrameT("Unconditional Multiselect"),
759 Child
, lists
[3] = ListviewObject
,
763 MUIA_List_SourceArray
, fruits
,
764 MUIA_ShortHelp
, "No scroller",
766 MUIA_Listview_MultiSelect
,
767 MUIV_Listview_MultiSelect_Always
,
768 MUIA_Listview_ScrollerPos
,
769 MUIV_Listview_ScrollerPos_None
,
774 GroupFrameT("Read Only"),
775 Child
, lists
[4] = ListviewObject
,
779 MUIA_List_SourceArray
, fruits
,
780 MUIA_ShortHelp
, "Default scroller",
782 MUIA_Listview_Input
, FALSE
,
787 Child
, RectangleObject
,
789 MUIA_Rectangle_HBar
, TRUE
,
790 MUIA_Rectangle_BarTitle
, "List Controls",
794 MUI_MakeObject(MUIO_Button
, "Sort"),
795 Child
, clear_button
=
796 MUI_MakeObject(MUIO_Button
, "Clear"),
798 MUI_MakeObject(MUIO_Button
, "Fill"),
799 Child
, enable_button
=
800 MUI_MakeObject(MUIO_Button
, "Enable"),
804 Child
, dragsortable_check
=
805 MUI_MakeObject(MUIO_Checkmark
, NULL
),
806 Child
, MUI_MakeObject(MUIO_Label
,
811 Child
, showdropmarks_check
=
812 MUI_MakeObject(MUIO_Checkmark
, NULL
),
813 Child
, MUI_MakeObject(MUIO_Label
,
814 "Show drop marks", 0),
819 MUI_MakeObject(MUIO_Checkmark
,NULL
),
820 Child
, MUI_MakeObject(MUIO_Label
,
827 Child
, ListviewObject
,
828 MUIA_Listview_List
, list2
= ListObject
,
830 MUIA_List_DisplayHook
, &hook_display2
,
834 Child
, list_add_button
=
835 MUI_MakeObject(MUIO_Button
,"_Add"),
836 Child
, list_remove_button
=
837 MUI_MakeObject(MUIO_Button
,"_Remove"),
838 Child
, list_clear_button
=
839 MUI_MakeObject(MUIO_Button
,"_Clear"),
843 Child
, ColGroup(LIST_COUNT
/ 2),
844 Child
, VGroup
, GroupFrameT("Standard Format"),
845 Child
, multi_lists
[0] = ListviewObject
,
849 MUIA_List_DisplayHook
,
851 MUIA_List_Format
, list_format
,
852 MUIA_List_SourceArray
, entries
,
853 MUIA_List_Title
, TRUE
,
855 MUIA_Listview_MultiSelect
,
856 MUIV_Listview_MultiSelect_None
,
860 Child
, VGroup
, GroupFrameT("Custom Format"),
861 Child
, multi_lists
[1] = ListviewObject
,
865 MUIA_List_DisplayHook
,
867 MUIA_List_Format
, list_format
,
868 MUIA_List_SourceArray
, entries
,
869 MUIA_List_Title
, TRUE
,
871 MUIA_Listview_MultiSelect
,
872 MUIV_Listview_MultiSelect_None
,
877 Child
, RectangleObject
,
879 MUIA_Rectangle_HBar
, TRUE
,
880 MUIA_Rectangle_BarTitle
, "List Controls",
883 Child
, MUI_MakeObject(MUIO_Label
, "Format:", 0),
884 Child
, format_string
= StringObject
,
886 MUIA_String_Contents
, list_format
,
889 Child
, showheadings_check
=
890 MUI_MakeObject(MUIO_Checkmark
, NULL
),
891 Child
, MUI_MakeObject(MUIO_Label
,
892 "Show column headings", 0),
895 Child
, MUI_MakeObject(MUIO_Label
,
896 "Clicked column:", 0),
897 Child
, column_string
= StringObject
,
900 Child
, column_text
= TextObject
,
902 MUIA_Text_Contents
, "N/A",
915 MUIA_Gauge_InfoText
, "%ld %%",
916 MUIA_Gauge_Horiz
, TRUE
,
917 MUIA_Gauge_Current
, 25,
926 MUIA_Gauge_InfoText
, "%ld %%",
927 MUIA_Gauge_Horiz
, TRUE
,
928 MUIA_Gauge_Current
, 50,
937 MUIA_Gauge_InfoText
, "%ld %%",
938 MUIA_Gauge_Horiz
, TRUE
,
939 MUIA_Gauge_Current
, 75,
949 MUIA_Gauge_InfoText
, "%ld %%",
950 MUIA_Gauge_Current
, 25,
954 MUIA_Gauge_InfoText
, "%ld %%",
955 MUIA_Gauge_Current
, 50,
959 MUIA_Gauge_InfoText
, "%ld %%",
960 MUIA_Gauge_Current
, 75,
969 GroupFrameT("Horizontal Sliders"),
970 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
971 Child
, numerics
[HNSLIDER
] = SliderObject
,
972 MUIA_Slider_Horiz
, TRUE
,
973 MUIA_Numeric_Min
, NUMERIC_MIN
,
974 MUIA_Numeric_Max
, NUMERIC_MAX
,
977 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
978 Child
, numerics
[HRSLIDER
] = SliderObject
,
979 MUIA_Numeric_Reverse
, TRUE
,
980 MUIA_Numeric_Min
, NUMERIC_MIN
,
981 MUIA_Numeric_Max
, NUMERIC_MAX
,
984 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
985 Child
, numerics
[HQSLIDER
] = SliderObject
,
986 MUIA_Slider_Quiet
, TRUE
,
987 MUIA_Numeric_Min
, NUMERIC_MIN
,
988 MUIA_Numeric_Max
, NUMERIC_MAX
,
993 GroupFrameT("Vertical Sliders"),
994 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
995 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
996 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
997 Child
, numerics
[VNSLIDER
] = SliderObject
,
998 MUIA_Slider_Horiz
, FALSE
,
999 MUIA_Numeric_Min
, NUMERIC_MIN
,
1000 MUIA_Numeric_Max
, NUMERIC_MAX
,
1003 Child
, numerics
[VRSLIDER
] = SliderObject
,
1004 MUIA_Slider_Horiz
, FALSE
,
1005 MUIA_Numeric_Reverse
, TRUE
,
1006 MUIA_Numeric_Min
, NUMERIC_MIN
,
1007 MUIA_Numeric_Max
, NUMERIC_MAX
,
1010 Child
, numerics
[VQSLIDER
] = SliderObject
,
1011 MUIA_Slider_Horiz
, FALSE
,
1012 MUIA_Slider_Quiet
, TRUE
,
1013 MUIA_Numeric_Min
, NUMERIC_MIN
,
1014 MUIA_Numeric_Max
, NUMERIC_MAX
,
1019 GroupFrameT("Numeric Buttons"),
1020 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
1021 Child
, numerics
[NNUMERICBUTTON
] =
1022 NumericbuttonObject
,
1023 MUIA_Numeric_Min
, NUMERIC_MIN
,
1024 MUIA_Numeric_Max
, NUMERIC_MAX
,
1027 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
1028 Child
, numerics
[RNUMERICBUTTON
] =
1029 NumericbuttonObject
,
1030 MUIA_Numeric_Reverse
, TRUE
,
1031 MUIA_Numeric_Min
, NUMERIC_MIN
,
1032 MUIA_Numeric_Max
, NUMERIC_MAX
,
1037 GroupFrameT("Knobs"),
1038 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
1039 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
1040 Child
, numerics
[NKNOB
] = KnobObject
,
1041 MUIA_Numeric_Min
, NUMERIC_MIN
,
1042 MUIA_Numeric_Max
, NUMERIC_MAX
,
1045 Child
, numerics
[RKNOB
] = KnobObject
,
1046 MUIA_Numeric_Reverse
, TRUE
,
1047 MUIA_Numeric_Min
, NUMERIC_MIN
,
1048 MUIA_Numeric_Max
, NUMERIC_MAX
,
1053 Child
, MUI_MakeObject(MUIO_Label
,
1054 "Minimum Value:", 0),
1055 Child
, min_string
= (Object
*)StringObject
,
1057 MUIA_String_Accept
, (IPTR
)"-0123456789",
1058 MUIA_String_Integer
, NUMERIC_MIN
,
1061 Child
, MUI_MakeObject(MUIO_Label
,
1062 "Maximum Value:", 0),
1063 Child
, max_string
= (Object
*)StringObject
,
1065 MUIA_String_Accept
, (IPTR
)"-0123456789",
1066 MUIA_String_Integer
, NUMERIC_MAX
,
1069 Child
, slider_button
= TextObject
,
1071 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1073 MUIA_Background
, MUII_ButtonBack
,
1074 MUIA_Text_PreParse
, "\33c",
1076 "Change Slider Orientations",
1078 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
1087 MUIA_Radio_Entries
, radio_entries1
,
1089 Child
, country_radio
[0] = RadioObject
,
1091 MUIA_Radio_Entries
, radio_entries2
,
1092 MUIA_Radio_Active
, 1,
1098 MUIA_Radio_Entries
, radio_entries1
,
1100 Child
, country_radio
[1] = RadioObject
,
1102 MUIA_Radio_Entries
, radio_entries2
,
1103 MUIA_Radio_Active
, 1,
1108 #if defined(TEST_ICONLIST)
1111 Child
, volume_iconlist
=
1112 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
1114 Child
, drawer_iconlist
=
1115 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
1116 MUIA_IconDrawerList_Drawer
, "SYS:",
1123 Child
, create_balance_column(),
1124 Child
, BalanceObject
,
1127 Child
, create_balance_column(),
1128 Child
, BalanceObject
,
1131 Child
, create_balance_column(),
1132 Child
, BalanceObject
,
1135 Child
, create_balance_column(),
1136 Child
, BalanceObject
,
1139 Child
, create_balance_column(),
1146 Child
, about_button
= TextObject
,
1148 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1150 MUIA_Background
, MUII_ButtonBack
,
1151 MUIA_Text_PreParse
, "\33c",
1152 MUIA_Text_Contents
, "About",
1154 Child
, quit_button
= TextObject
,
1156 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1158 MUIA_Background
, MUII_ButtonBack
,
1159 MUIA_ControlChar
, 'q',
1160 MUIA_Text_HiChar
, 'q',
1161 MUIA_Text_PreParse
, "\33c",
1162 MUIA_Text_Contents
, "Quit",
1168 SubWindow
, second_wnd
= WindowObject
,
1169 MUIA_Window_Title
, "Second window",
1170 WindowContents
, VGroup
,
1171 Child
, DropTextObject
,
1172 MUIA_Text_Contents
, "Drop here",
1173 MUIA_Dropable
, TRUE
,
1184 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
1185 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
1186 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
1187 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
1188 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
,
1189 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
1190 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1191 MUIM_Application_AboutMUI
, NULL
);
1192 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1193 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
1194 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1195 MUIM_CallHook
, &hook_objects
);
1196 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
1197 app
, 2, MUIM_CallHook
, &hook
);
1199 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
1200 MUIM_CallHook
, &hook_wheel
);
1201 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
1202 2, MUIM_CallHook
, &hook_wheel
);
1203 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1204 app
, 2, MUIM_CallHook
, &hook_slider
);
1205 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1206 app
, 2, MUIM_CallHook
, &hook_slider
);
1207 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
1208 app
, 2, MUIM_CallHook
, &hook_slider
);
1210 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
1211 MUIM_CallHook
, &hook_standard
, save_function
);
1213 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
1214 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
1215 MUIV_Application_ReturnID_Quit
);
1216 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
1217 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
1221 set(showdropmarks_check
, MUIA_Selected
, TRUE
);
1222 for (i
= 0; i
< LIST_COUNT
; i
++)
1224 DoMethod(lists
[i
], MUIM_Notify
, MUIA_Listview_DoubleClick
,
1225 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
, MUIA_Disabled
, TRUE
);
1226 DoMethod(sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1227 lists
[i
], 1, MUIM_List_Sort
);
1228 DoMethod(clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1229 lists
[i
], 1, MUIM_List_Clear
);
1230 DoMethod(fill_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1231 lists
[i
], 4, MUIM_List_Insert
, fruits
, -1,
1232 MUIV_List_Insert_Bottom
);
1233 DoMethod(enable_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1234 lists
[i
], 3, MUIM_Set
, MUIA_Disabled
, FALSE
);
1235 DoMethod(dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
1236 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
,
1237 MUIA_List_DragSortable
, MUIV_TriggerValue
);
1238 DoMethod(showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
1239 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
,
1240 MUIA_List_ShowDropMarks
, MUIV_TriggerValue
);
1241 DoMethod(quiet_check
, MUIM_Notify
, MUIA_Selected
,
1242 MUIV_EveryTime
, lists
[i
], 3, MUIM_Set
, MUIA_List_Quiet
,
1246 set(showheadings_check
, MUIA_Selected
, TRUE
);
1247 DoMethod(format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
1248 MUIV_EveryTime
, multi_lists
[1], 3, MUIM_Set
, MUIA_List_Format
,
1250 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
1252 DoMethod(showheadings_check
, MUIM_Notify
, MUIA_Selected
,
1253 MUIV_EveryTime
, multi_lists
[i
], 3, MUIM_Set
,
1254 MUIA_List_Title
, MUIV_TriggerValue
);
1255 DoMethod(multi_lists
[i
], MUIM_Notify
, MUIA_Listview_ClickColumn
,
1256 MUIV_EveryTime
, column_string
, 3, MUIM_Set
,
1257 MUIA_String_Integer
, MUIV_TriggerValue
);
1259 DoMethod(column_string
, MUIM_Notify
, MUIA_String_Contents
,
1260 MUIV_EveryTime
, column_text
, 3, MUIM_Set
, MUIA_Text_Contents
,
1263 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
1264 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
1266 /* The callbacks of the buttons within the list page */
1267 DoMethod(list_add_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
1268 MUIM_CallHook
, &hook_standard
, add_function
);
1269 DoMethod(list_remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1270 list2
, 2, MUIM_List_Remove
, MUIV_List_Remove_Active
);
1271 DoMethod(list_clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, list2
,
1272 1, MUIM_List_Clear
);
1275 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
1277 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
1278 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
1280 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
1281 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
1284 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1285 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
1288 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
1289 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
1290 MUIA_Radio_Active
, MUIV_TriggerValue
);
1291 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
1292 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
1293 MUIA_Radio_Active
, MUIV_TriggerValue
);
1295 #if defined(TEST_ICONLIST)
1297 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
1298 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
1299 volume_doubleclicked
);
1300 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
1301 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
1302 drawer_doubleclicked
);
1305 set(wnd
, MUIA_Window_Open
, TRUE
);
1306 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test application");
1308 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
1309 &sigs
) != MUIV_Application_ReturnID_Quit
)
1313 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
1314 if (sigs
& SIGBREAKF_CTRL_C
)
1316 if (sigs
& SIGBREAKF_CTRL_D
)
1321 MUI_DisposeObject(app
);
1324 MUI_DisposeObject(context_menu
);
1325 CloseLibrary(ColorWheelBase
);
1326 MUI_DeleteCustomClass(CL_DropText
);
1328 CloseLibrary(MUIMasterBase
);