2 Copyright © 2002-2016, 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
35 #include <libraries/mui.h>
36 #if defined(TEST_ICONLIST)
37 #include "../../workbench/system/Wanderer/Classes/iconlist_attributes.h"
38 #include "../../workbench/system/Wanderer/Classes/iconlist.h"
41 #define STRING_COUNT 6
43 #define MULTI_LIST_COUNT 2
46 #define NUMERIC_MAX 100
48 static const TEXT digits
[] = "-0123456789";
49 static const TEXT default_accept_chars
[] = "aeiou?.";
50 static const TEXT default_reject_chars
[] = "*?";
51 static const ULONG default_color
[] = {155 << 24, 180 << 24, 255 << 24};
52 static const struct MUI_PenSpec default_penspec
= {"m0"};
53 static const char *fruits
[] = {"Strawberry", "Apple", "Banana", "Orange",
54 "Grapefruit", "Kumquat", "Plum", "Raspberry", "Apricot", "Grape",
55 "Peach", "Lemon", "Lime", "Date", "Pineapple", "Blueberry", "Papaya",
56 "Cranberry", "Gooseberry", "Pear", "Fig", "Coconut", "Melon",
58 static const char *empty
[] = {"", "", "", "", "", NULL
};
59 static const LONG list_active_positions
[] =
62 MUIV_List_Active_Bottom
,
67 static const CONST_STRPTR list_move1_modes
[] =
68 {"Index", "Top", "Active", "Bottom", NULL
};
69 static const CONST_STRPTR list_move2_modes
[] =
70 {"Index", "Top", "Active", "Bottom", "Next", "Previous", NULL
};
71 static const CONST_STRPTR list_jump_modes
[] =
72 {"Index", "Top", "Active", "Bottom", "Down", "Up", NULL
};
73 static const CONST_STRPTR list_insert_modes
[] =
74 {"Index", "Top", "Active", "Sorted", "Bottom", NULL
};
75 static const CONST_STRPTR list_remove_modes
[] =
76 {"Index", "First", "Active", "Last", "Selected", "Unsafe Loop",
78 static const CONST_STRPTR list_activate_modes
[] =
79 {"Index", "Top", "Bottom", "Up", "Down", "Page Up", "Page Down", NULL
};
80 static const CONST_STRPTR list_select_modes
[] =
81 {"Index", "Active", "All", NULL
};
82 static const TEXT list_format
[] = "BAR,BAR,";
99 struct Library
*MUIMasterBase
;
100 struct Library
*ColorWheelBase
;
112 Object
*strings
[STRING_COUNT
],
122 *standard_hook_check
,
130 Object
*lists
[LIST_COUNT
],
153 *insert_single_button
,
154 *insert_multiple_button
,
159 *showdropmarks_check
,
167 *multi_lists
[MULTI_LIST_COUNT
],
173 LONG quiet
[LIST_COUNT
];
177 static Object
*wheel
;
178 static Object
*r_slider
;
179 static Object
*g_slider
;
180 static Object
*b_slider
;
181 static Object
*hue_gauge
;
182 static Object
*colorfield
, *colorfield2
, *colorfield_reset_button
,
184 static Object
*coloradjust
;
185 static Object
*pendisplay
, *pendisplay2
, *pendisplay_pen
, *pendisplay_spec
,
186 *reference_check
, *shine_button
, *shadow_button
, *yellow_button
, *poppen
;
187 static Object
*group
;
188 static Object
*editor_text
;
189 static Object
*filename_string
;
190 static Object
*save_button
;
192 #if defined(TEST_ICONLIST)
193 static Object
*drawer_iconlist
;
194 static Object
*volume_iconlist
;
197 AROS_UFH0(void, repeat_function
)
201 printf("MUI_Timer\n");
206 AROS_UFH0(void, wheel_function
)
210 nnset(r_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
211 WHEEL_Red
) >> 24) & 0xff);
212 nnset(g_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
213 WHEEL_Green
) >> 24) & 0xff);
214 nnset(b_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
215 WHEEL_Blue
) >> 24) & 0xff);
220 AROS_UFH0(void, slider_function
)
224 struct ColorWheelRGB cw
;
225 ULONG red
= XGET(r_slider
, MUIA_Numeric_Value
);
226 ULONG green
= XGET(g_slider
, MUIA_Numeric_Value
);
227 ULONG blue
= XGET(b_slider
, MUIA_Numeric_Value
);
229 cw
.cw_Red
= (red
<< 24) | (red
<< 16) | (red
<< 8) | red
;
230 cw
.cw_Green
= (green
<< 24) | (green
<< 16) | (green
<< 8) | green
;
231 cw
.cw_Blue
= (blue
<< 24) | (blue
<< 16) | (blue
<< 8) | blue
;
233 nnset(wheel
, WHEEL_RGB
, &cw
);
234 set(hue_gauge
, MUIA_Gauge_Current
, XGET(wheel
, WHEEL_Hue
));
239 AROS_UFH0(void, objects_function
)
243 Object
*new_obj
= MUI_MakeObject(MUIO_Button
, "Button");
246 DoMethod(group
, MUIM_Group_InitChange
);
247 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
248 DoMethod(group
, MUIM_Group_ExitChange
);
254 static void About(void)
256 static Object
*about_wnd
;
260 about_wnd
= AboutmuiObject
, MUIA_Aboutmui_Application
, app
, End
;
264 set(about_wnd
, MUIA_Window_Open
, TRUE
);
267 static void ChangeStringAccept(void)
269 STRPTR accept_chars
= NULL
, reject_chars
= NULL
;
273 accept_all
= XGET(string
.accept_all_check
, MUIA_Selected
);
274 SET(string
.accept_string
, MUIA_Disabled
, accept_all
);
275 SET(string
.reject_string
, MUIA_Disabled
, accept_all
);
279 GET(string
.accept_string
, MUIA_String_Contents
, &accept_chars
);
280 GET(string
.reject_string
, MUIA_String_Contents
, &reject_chars
);
283 for (i
= 0; i
< STRING_COUNT
; i
++)
285 SET(string
.strings
[i
], MUIA_String_Accept
, accept_chars
);
286 SET(string
.strings
[i
], MUIA_String_Reject
, reject_chars
);
290 static void ChangePen(void)
294 GET(colorfield_pen
, MUIA_String_Integer
, &pen
);
296 SET(colorfield
, MUIA_Colorfield_Pen
, pen
);
299 static void ChangePendisplayPen(void)
301 DoMethod(pendisplay
, MUIM_Pendisplay_SetColormap
,
302 XGET(pendisplay_pen
, MUIA_String_Integer
));
305 static void ChangeListTitle(void)
310 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
312 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
315 GET(list
.title_string
, MUIA_String_Contents
, &title
);
316 if (title
[0] == '\0')
319 title
= StrDup(title
);
321 SET(list
.lists
[i
], MUIA_List_Title
, title
);
324 static void UpdateListInfo(void)
330 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
332 GET(list
.lists
[i
], MUIA_List_DragSortable
, &value
);
333 NNSET(list
.dragsortable_check
, MUIA_Selected
, value
);
334 GET(list
.lists
[i
], MUIA_List_ShowDropMarks
, &value
);
335 NNSET(list
.showdropmarks_check
, MUIA_Selected
, value
);
336 value
= list
.quiet
[i
]; // MUIA_List_Quiet is not gettable!
337 NNSET(list
.quiet_check
, MUIA_Selected
, value
);
338 GET(list
.lists
[i
], MUIA_List_AutoVisible
, &value
);
339 NNSET(list
.autovisible_check
, MUIA_Selected
, value
);
341 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
342 NNSET(list
.title_string
, MUIA_String_Contents
, title
);
344 GET(list
.lists
[i
], MUIA_List_Entries
, &value
);
345 DoMethod(list
.entries_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
347 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
348 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
350 GET(list
.lists
[i
], MUIA_List_First
, &value
);
351 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
353 GET(list
.lists
[i
], MUIA_List_InsertPosition
, &value
);
354 DoMethod(list
.insert_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
356 GET(list
.lists
[i
], MUIA_List_Active
, &value
);
357 if (value
== MUIV_List_Active_Off
)
358 SET(list
.active_text
, MUIA_Text_Contents
, "N/A");
360 DoMethod(list
.active_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
364 static void ListGetVisible(void)
369 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
371 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
372 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
376 static void ListGetFirst(void)
381 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
383 GET(list
.lists
[i
], MUIA_List_First
, &value
);
384 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
388 static void ListSetDragSortable(void)
393 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
395 GET(list
.dragsortable_check
, MUIA_Selected
, &value
);
396 SET(list
.lists
[i
], MUIA_List_DragSortable
, value
);
399 static void ListSetShowDropMarks(void)
404 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
406 GET(list
.showdropmarks_check
, MUIA_Selected
, &value
);
407 SET(list
.lists
[i
], MUIA_List_ShowDropMarks
, value
);
410 static void ListSetQuiet(void)
415 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
417 GET(list
.quiet_check
, MUIA_Selected
, &value
);
418 SET(list
.lists
[i
], MUIA_List_Quiet
, value
);
419 list
.quiet
[i
] = value
;
422 static void ListSetAutoVisible(void)
427 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
429 GET(list
.autovisible_check
, MUIA_Selected
, &value
);
430 SET(list
.lists
[i
], MUIA_List_AutoVisible
, value
);
433 static void ListReset(void)
437 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
439 SET(list
.lists
[i
], MUIA_List_Active
, list_active_positions
[i
]);
442 static void ListMove(void)
444 LONG mode
, pos1
, pos2
;
447 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
449 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
452 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
456 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
459 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
463 DoMethod(list
.lists
[i
], MUIM_List_Move
, pos1
, pos2
);
466 static void ListSort(void)
470 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
472 DoMethod(list
.lists
[i
], MUIM_List_Sort
);
475 static void ListEnable(void)
479 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
481 SET(list
.lists
[i
], MUIA_Disabled
, FALSE
);
484 static void ListExchange(void)
486 LONG mode
, pos1
, pos2
;
489 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
491 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
494 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
498 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
501 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
505 DoMethod(list
.lists
[i
], MUIM_List_Exchange
, pos1
, pos2
);
508 static void ListJump(void)
513 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
515 mode
= XGET(list
.jump_cycle
, MUIA_Cycle_Active
);
518 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
522 DoMethod(list
.lists
[i
], MUIM_List_Jump
, pos
);
525 static void ListSelect(void)
530 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
532 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
535 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
539 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_On
,
543 static void ListDeselect(void)
548 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
550 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
553 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
557 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_Off
,
561 static void ListToggle(void)
566 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
568 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
571 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
575 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
,
576 MUIV_List_Select_Toggle
, NULL
);
579 static void ListRedraw(void)
584 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
586 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
589 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
593 DoMethod(list
.lists
[i
], MUIM_List_Redraw
, pos
);
596 static void ListInsertSingle(void)
601 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
603 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
606 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
610 DoMethod(list
.lists
[i
], MUIM_List_InsertSingle
, "Tomato", pos
);
613 static void ListInsert(void)
618 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
620 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
623 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
627 DoMethod(list
.lists
[i
], MUIM_List_Insert
, fruits
, -1, pos
);
630 static void ListRemove(void)
632 LONG mode
, pos
, count
, j
, *selections
;
635 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
637 mode
= XGET(list
.remove_cycle
, MUIA_Cycle_Active
);
641 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
642 This doesn't work as expected in MUI or Zune */
643 pos
= MUIV_List_NextSelected_Start
- 1;
644 while (pos
!= MUIV_List_NextSelected_End
)
646 if (pos
== MUIV_List_NextSelected_Start
- 1)
648 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
649 if (pos
!= MUIV_List_NextSelected_End
)
650 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
655 /* Remove selected entries safely by first retrieving them with
656 MUIM_List_NextSelected and then removing them one by one */
657 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
658 MUIV_List_Select_Ask
, &count
);
659 selections
= AllocVec(sizeof(LONG
) * count
, MEMF_ANY
);
660 if (selections
!= NULL
)
662 pos
= MUIV_List_NextSelected_Start
;
663 for (j
= 0; j
< count
; j
++)
665 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
669 /* We must remove the entries in reverse order; otherwise the
670 later indices will become invalid */
672 DoMethod(list
.lists
[i
], MUIM_List_Remove
, selections
[--count
]);
679 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
682 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
686 static void ListClear(void)
690 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
692 DoMethod(list
.lists
[i
], MUIM_List_Clear
);
695 static void ListActivate(void)
700 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
702 mode
= XGET(list
.activate_cycle
, MUIA_Cycle_Active
);
705 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
709 SET(list
.lists
[i
], MUIA_List_Active
, pos
);
712 static void ListDeactivate(void)
716 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
718 SET(list
.lists
[i
], MUIA_List_Active
, MUIV_List_Active_Off
);
721 AROS_UFH3(static void, display_function
,
722 AROS_UFHA(struct Hook
*, h
, A0
),
723 AROS_UFHA(char **, strings
, A2
),
724 AROS_UFHA(struct list_entry
*, entry
, A1
))
728 static char buf
[100];
732 sprintf(buf
, "%ld", (long)*(strings
- 1));
734 strings
[1] = entry
->column1
;
735 strings
[2] = entry
->column2
;
739 strings
[0] = "Number";
740 strings
[1] = "Column 1";
741 strings
[2] = "Column 2";
747 static void Save(void)
749 char *text
= (char *)XGET(editor_text
, MUIA_String_Contents
);
750 char *filename
= (char *)XGET(filename_string
, MUIA_String_Contents
);
753 if (!strlen(filename
))
756 if ((fh
= Open(filename
, MODE_NEWFILE
)))
758 Write(fh
, text
, strlen(text
));
763 #if defined(TEST_ICONLIST)
764 /* IconList callbacks */
765 static void volume_doubleclicked(void)
768 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
770 DoMethod(volume_iconlist
, MUIM_IconList_NextIcon
,
771 MUIV_IconList_NextIcon_Selected
, &ent
);
772 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
775 strcpy(buf
, ent
->label
);
779 static void drawer_doubleclicked(void)
781 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
783 DoMethod(drawer_iconlist
, MUIM_IconList_NextIcon
,
784 MUIV_IconList_NextIcon_Selected
, &ent
);
785 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
787 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
,
788 ent
->ile_IconEntry
->ie_IconNode
.ln_Name
);
792 static IPTR
create_balance_column(void)
794 return (IPTR
) VGroup
,
795 Child
, RectangleObject
,
798 Child
, BalanceObject
,
800 Child
, RectangleObject
,
803 Child
, BalanceObject
,
805 Child
, RectangleObject
,
808 Child
, BalanceObject
,
810 Child
, RectangleObject
,
813 Child
, BalanceObject
,
815 Child
, RectangleObject
,
821 /* The custom class */
830 struct Library
*KeymapBase
;
834 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
,
835 register __a2 Object
*obj
, register __a1 Msg msg
)
837 AROS_UFH3S(IPTR
, dispatcher
,
838 AROS_UFHA(Class
*, cl
, A0
),
839 AROS_UFHA(Object
*, obj
, A2
), AROS_UFHA(Msg
, msg
, A1
))
844 switch (msg
->MethodID
)
847 return MUIV_DragQuery_Accept
;
850 struct DropText_Data
*data
=
851 (struct DropText_Data
*)INST_DATA(cl
, obj
);
854 sprintf(buf
, "%ld times", (long)data
->times
);
855 set(obj
, MUIA_Text_Contents
, buf
);
859 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
864 static struct MUI_CustomClass
*CL_DropText
;
866 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
870 static struct Hook hook_standard
;
872 AROS_UFH3S(void, hook_func_standard
,
873 AROS_UFHA(struct Hook
*, h
, A0
),
874 AROS_UFHA(void *, dummy
, A2
), AROS_UFHA(void **, funcptr
, A1
))
878 void (*func
) (ULONG
*) = (void (*)(ULONG
*))(*funcptr
);
881 func((ULONG
*) funcptr
+ 1);
889 Object
*wnd
, *second_wnd
;
891 Object
*about_button
;
893 Object
*repeat_button
;
894 Object
*objects_button
;
895 Object
*about_item
, *quit_item
;
896 Object
*context_menu
;
897 Object
*popobject
, *listview
;
898 Object
*numerics
[NUMERIC_COUNT
];
899 Object
*min_string
, *max_string
;
900 Object
*slider_button
;
901 Object
*country_radio
[2];
906 static char *pages
[] =
907 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
909 #if defined(TEST_ICONLIST)
913 static char *text_pages
[] =
914 {"Text", "String", NULL
};
915 static char *color_pages
[] =
916 {"Palette", "Colors", "Pens", NULL
};
917 static char *list_pages
[] =
918 {"Single Column", "Multicolumn", NULL
};
919 static char **radio_entries1
= pages
;
920 static char *radio_entries2
[] =
921 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL
};
923 static struct list_entry entry1
= {"Testentry1", "Col2: Entry1"};
924 static struct list_entry entry2
= {"Entry2", "Col2: Entry2"};
925 static struct list_entry entry3
= {"Entry3", "Col2: Entry3"};
926 static struct list_entry entry4
= {"Entry4", "Col2: Entry4"};
927 static struct list_entry entry5
= {"Entry5", "Col2: Entry5"};
928 static struct list_entry entry6
= {"Entry6", "Col2: Entry6"};
930 static struct list_entry
*entries
[] =
931 {&entry1
, &entry2
, &entry3
, &entry4
, &entry5
, &entry6
, NULL
};
934 struct Hook hook_wheel
;
935 struct Hook hook_slider
;
936 struct Hook hook_objects
;
937 struct Hook hook_display
;
939 hook_standard
.h_Entry
= (HOOKFUNC
) hook_func_standard
;
941 pool
= CreatePool(MEMF_ANY
, 4096, 4096);
943 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library", 0);
945 hook
.h_Entry
= (HOOKFUNC
) repeat_function
;
946 hook_wheel
.h_Entry
= (HOOKFUNC
) wheel_function
;
947 hook_slider
.h_Entry
= (HOOKFUNC
) slider_function
;
948 hook_objects
.h_Entry
= (HOOKFUNC
) objects_function
;
949 hook_display
.h_Entry
= (HOOKFUNC
) display_function
;
951 context_menu
= MenustripObject
,
952 MUIA_Family_Child
, MenuObject
,
953 MUIA_Menu_Title
, "Menutest",
954 MUIA_Family_Child
, about_item
= MenuitemObject
,
955 MUIA_Menuitem_Title
, "First Test Entry", End
,
956 MUIA_Family_Child
, quit_item
= MenuitemObject
,
957 MUIA_Menuitem_Title
, "Second Test Entry", End
,
961 /* should check the result in a real program! */
962 CL_DropText
= MUI_CreateCustomClass(NULL
, MUIC_Text
, NULL
,
963 sizeof(struct DropText_Data
), dispatcher
);
964 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget", 0);
966 pendisplay
= PendisplayObject
, MUIA_Pendisplay_Spec
, &default_penspec
, End
;
968 title
= StrDup("Fruits");
969 list
.lists
[0] = ListviewObject
,
973 MUIA_List_Title
, title
,
974 MUIA_List_SourceArray
, fruits
,
975 MUIA_List_Active
, MUIV_List_Active_Top
,
976 MUIA_List_PoolThreshSize
, 256,
977 MUIA_List_DragSortable
, TRUE
,
978 MUIA_ShortHelp
, "Default scroller\nTop entry active",
980 MUIA_Listview_MultiSelect
,
981 MUIV_Listview_MultiSelect_None
,
984 list
.lists
[1] = ListviewObject
,
988 MUIA_List_SourceArray
, fruits
,
989 MUIA_List_Active
, MUIV_List_Active_Bottom
,
990 MUIA_List_PoolPuddleSize
, 512,
991 MUIA_ShortHelp
, "Left scroller\nBottom entry active",
993 MUIA_Listview_ScrollerPos
,
994 MUIV_Listview_ScrollerPos_Left
,
997 list
.lists
[2] = ListviewObject
,
1001 MUIA_List_SourceArray
, fruits
,
1002 MUIA_List_Active
, MUIV_List_Active_Off
,
1003 MUIA_List_Pool
, pool
,
1004 MUIA_ShortHelp
, "Right scroller\nNo active entry",
1006 MUIA_Listview_MultiSelect
,
1007 MUIV_Listview_MultiSelect_Shifted
,
1008 MUIA_Listview_ScrollerPos
,
1009 MUIV_Listview_ScrollerPos_Right
,
1012 list
.lists
[3] = ListviewObject
,
1016 MUIA_List_SourceArray
, fruits
,
1017 MUIA_List_Pool
, NULL
,
1018 MUIA_ShortHelp
, "No scroller\nDefault active entry",
1020 MUIA_Listview_MultiSelect
,
1021 MUIV_Listview_MultiSelect_Always
,
1022 MUIA_Listview_ScrollerPos
,
1023 MUIV_Listview_ScrollerPos_None
,
1026 list
.lists
[4] = ListviewObject
,
1030 MUIA_List_SourceArray
, fruits
,
1031 MUIA_List_MinLineHeight
, 20,
1032 MUIA_ShortHelp
, "Default scroller\nDefault active entry",
1034 MUIA_Listview_Input
, FALSE
,
1038 app
= ApplicationObject
,
1039 MUIA_Application_Menustrip
, MenustripObject
,
1040 MUIA_Family_Child
, MenuObject
,
1041 MUIA_Menu_Title
, "Project",
1042 MUIA_Family_Child
, about_item
= MenuitemObject
,
1043 MUIA_Menuitem_Title
, "About...",
1044 MUIA_Menuitem_Shortcut
, "?",
1046 MUIA_Family_Child
, MenuitemObject
,
1047 MUIA_Menuitem_Title
, (SIPTR
)-1,
1049 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1050 MUIA_Menuitem_Title
, "Quit",
1051 MUIA_Menuitem_Shortcut
, "Q",
1056 SubWindow
, wnd
= WindowObject
,
1057 MUIA_Window_Title
, "test",
1058 MUIA_Window_Activate
, TRUE
,
1060 WindowContents
, VGroup
,
1061 Child
, RegisterGroup(pages
),
1062 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1067 GroupFrameT("A horizontal group"),
1069 GroupFrameT("A column group"),
1070 Child
, repeat_button
= TextObject
,
1073 MUIA_Background
, MUII_ButtonBack
,
1074 MUIA_Text_PreParse
, "\33c",
1075 MUIA_Text_Contents
, "Repeat",
1076 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1081 MUIA_Background
, MUII_ButtonBack
,
1082 MUIA_Text_PreParse
, "\33c",
1083 MUIA_Text_Contents
, "Drag Me",
1084 MUIA_Draggable
, TRUE
,
1085 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1087 Child
, open_button
= TextObject
,
1090 MUIA_Background
, MUII_ButtonBack
,
1091 MUIA_Text_PreParse
, "\33c",
1092 MUIA_Text_Contents
, "Open Window",
1093 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1096 MUIA_ContextMenu
, context_menu
,
1099 MUIA_Background
, MUII_ButtonBack
,
1100 MUIA_Text_PreParse
, "\33c",
1101 MUIA_Text_Contents
, "Press Right",
1102 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1104 Child
, objects_button
= TextObject
,
1107 MUIA_Background
, MUII_ButtonBack
,
1108 MUIA_Text_PreParse
, "\33c",
1109 MUIA_Text_Contents
, "Add Objects",
1110 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1115 Child
, MUI_MakeObject(MUIO_Checkmark
,
1119 Child
, MUI_MakeObject(MUIO_Label
,
1126 Child
, group
= VGroup
,
1127 GroupFrameT("A vertical group"),
1128 Child
, DropTextObject
,
1129 MUIA_Dropable
, TRUE
,
1132 MUIA_Background
, MUII_ButtonBack
,
1133 MUIA_Text_PreParse
, "\33c",
1134 MUIA_Text_Contents
, "Drop Here",
1135 MUIA_Dropable
, TRUE
,
1136 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1140 MUIA_Background
, MUII_MARKHALFSHINE
,
1142 MUIA_Text_PreParse
, "\33c",
1143 MUIA_Text_Contents
, "Pattern",
1145 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
1147 Child
, ScrollgroupObject
,
1148 GroupFrameT("A scroll group"),
1149 MUIA_Scrollgroup_Contents
, VGroupV
,
1154 "Line1\nLine2\nLine3\nLine4\n"
1155 "Line5\nLine6\nLine7\nLine8\n"
1157 "Line9\nLine10\nLine11\n",
1160 Child
, MUI_MakeObject(MUIO_Button
,
1162 Child
, MUI_MakeObject(MUIO_Button
,
1168 Child
, popobject
= PopobjectObject
,
1169 MUIA_Popstring_String
,
1170 MUI_MakeObject(MUIO_String
, NULL
, 200),
1171 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
1172 MUIA_Popobject_Object
, VGroup
,
1174 MUIA_Text_Contents
, "test",
1176 Child
, listview
= ListviewObject
,
1177 MUIA_Listview_List
, ListObject
,
1179 MUIA_List_DisplayHook
, &hook_display
,
1180 MUIA_List_Format
, ",,",
1181 MUIA_List_SourceArray
, entries
,
1182 MUIA_List_Title
, TRUE
,
1189 MUIA_Cycle_Entries
, pages
,
1191 Child
, ScrollbarObject
,
1192 MUIA_Group_Horiz
, TRUE
,
1193 MUIA_Prop_Visible
, 100,
1194 MUIA_Prop_Entries
, 300,
1195 MUIA_Prop_First
, 50,
1200 Child
, RegisterGroup(text_pages
),
1204 MUIA_Background
, "2:cfffffff,cfffffff,10000000",
1206 MUIA_Text_Contents
, "\33cHello World!\n"
1207 "This is a text object\n\33lLeft \33bbold\33n\n"
1212 /* Test for a bug with pen specifications as reported here:
1213 https://sourceforge.net/p/aros/bugs/487/
1215 MUIA_Text_Contents
, "This is a \33P[3]text \33P[]object \33P[1]with pen specifications",
1217 Child
, RectangleObject
,
1219 /* Seems to be not supported properly as orginal MUI
1220 doesn't allow to alter the height of the window */
1221 MUIA_Rectangle_HBar
, TRUE
,
1222 MUIA_Rectangle_BarTitle
,"Enter a string",
1224 Child
, StringObject
,
1227 MUIA_String_AdvanceOnCR
, TRUE
,
1235 Child
, VGroup
, GroupFrameT("Default Alignment"),
1236 Child
, string
.strings
[0] = StringObject
,
1239 (IPTR
)default_accept_chars
,
1241 (IPTR
)default_reject_chars
,
1242 MUIA_String_AdvanceOnCR
, TRUE
,
1243 MUIA_String_MaxLen
, 9,
1245 MUIA_String_AttachedList
, list
.lists
[0],
1248 Child
, VGroup
, GroupFrameT("Left Aligned"),
1249 Child
, string
.strings
[1] = StringObject
,
1252 (IPTR
)default_accept_chars
,
1254 (IPTR
)default_reject_chars
,
1256 MUIV_String_Format_Left
,
1257 MUIA_String_AdvanceOnCR
, TRUE
,
1258 MUIA_String_MaxLen
, 9,
1260 MUIA_String_Contents
,
1261 (IPTR
)default_accept_chars
,
1262 MUIA_String_BufferPos
, 3,
1263 MUIA_String_AttachedList
, list
.lists
[0],
1266 Child
, VGroup
, GroupFrameT("Right Aligned"),
1267 Child
, string
.strings
[2] = StringObject
,
1270 (IPTR
)default_accept_chars
,
1272 (IPTR
)default_reject_chars
,
1274 MUIV_String_Format_Right
,
1275 MUIA_String_AdvanceOnCR
, TRUE
,
1276 MUIA_String_MaxLen
, 9,
1278 MUIA_String_AttachedList
, list
.lists
[0],
1281 Child
, VGroup
, GroupFrameT("Centered"),
1282 Child
, string
.strings
[3] = StringObject
,
1285 (IPTR
)default_accept_chars
,
1287 (IPTR
)default_reject_chars
,
1289 MUIV_String_Format_Center
,
1290 MUIA_String_AdvanceOnCR
, TRUE
,
1291 MUIA_String_MaxLen
, 9,
1293 MUIA_String_Integer
, 123,
1294 MUIA_String_AttachedList
, list
.lists
[0],
1297 Child
, VGroup
, GroupFrameT("Secret"),
1298 Child
, string
.strings
[4] = StringObject
,
1301 (IPTR
)default_accept_chars
,
1303 (IPTR
)default_reject_chars
,
1305 MUIV_String_Format_Center
,
1306 MUIA_String_Secret
, TRUE
,
1307 MUIA_String_AdvanceOnCR
, TRUE
,
1308 MUIA_String_MaxLen
, 9,
1310 MUIA_String_AttachedList
, list
.lists
[0],
1313 Child
, HGroup
, GroupFrameT("Narrow"),
1315 Child
, string
.strings
[5] = StringObject
,
1318 (IPTR
)default_accept_chars
,
1320 (IPTR
)default_reject_chars
,
1322 MUIV_String_Format_Center
,
1323 MUIA_String_AdvanceOnCR
, TRUE
,
1325 MUIA_String_MaxLen
, 9,
1327 MUIA_String_AttachedList
, list
.lists
[0],
1333 Child
, VGroup
, GroupFrameT("Controls"),
1335 Child
, string
.accept_all_check
=
1336 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1337 Child
, MUI_MakeObject(MUIO_Label
,
1338 "Accept all characters", 0),
1342 Child
, MUI_MakeObject(MUIO_Label
,
1343 "Acceptable characters:", 0),
1344 Child
, string
.accept_string
= StringObject
,
1346 MUIA_String_Contents
,
1347 (IPTR
)default_accept_chars
,
1349 Child
, MUI_MakeObject(MUIO_Label
,
1350 "Unacceptable characters:", 0),
1351 Child
, string
.reject_string
= StringObject
,
1354 Child
, MUI_MakeObject(MUIO_Label
,
1355 "Cursor position:", 0),
1356 Child
, string
.cursor_pos_slider
=
1358 MUIA_Group_Horiz
, TRUE
,
1359 MUIA_Numeric_Min
, 0,
1361 Child
, MUI_MakeObject(MUIO_Label
,
1362 "Display position:", 0),
1363 Child
, string
.display_pos_slider
=
1365 MUIA_Group_Horiz
, TRUE
,
1366 MUIA_Numeric_Min
, 0,
1368 Child
, MUI_MakeObject(MUIO_Label
,
1369 "Integer value:", 0),
1370 Child
, string
.integer_string
=
1373 MUIA_String_Accept
, (IPTR
)digits
,
1375 Child
, MUI_MakeObject(MUIO_Label
,
1377 Child
, string
.plaintext_string
=
1381 Child
, MUI_MakeObject(MUIO_Label
,
1382 "Maximum string length:", 0),
1383 Child
, string
.max_len_text
= TextObject
,
1385 MUIA_Text_Contents
, "Unknown",
1390 Child
, string
.cr_advance_check
=
1391 MUI_MakeObject(MUIO_Checkmark
,
1393 Child
, MUI_MakeObject(MUIO_Label
,
1394 "Advance on CR", 0),
1398 Child
, string
.attach_list_check
=
1399 MUI_MakeObject(MUIO_Checkmark
,
1401 Child
, MUI_MakeObject(MUIO_Label
,
1407 Child
, string
.standard_hook_check
=
1408 MUI_MakeObject(MUIO_Checkmark
,
1410 Child
, MUI_MakeObject(MUIO_Label
,
1411 "Use standard edit hook", 0),
1415 Child
, string
.custom_hook_check
=
1416 MUI_MakeObject(MUIO_Checkmark
,
1418 Child
, MUI_MakeObject(MUIO_Label
,
1419 "Use custom edit hook", 0),
1432 Child
, wheel
= BoopsiObject
, /* MUI/Boopsi tags mixed */
1434 /* boopsi objects don't know */
1435 /* their sizes, so we help */
1436 /* keep important values */
1437 /* during window resize */
1438 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
1439 MUIA_Boopsi_MinWidth
, 30,
1440 MUIA_Boopsi_MinHeight
, 30,
1441 MUIA_Boopsi_Remember
, WHEEL_Saturation
,
1442 MUIA_Boopsi_Remember
, WHEEL_Hue
,
1443 /* this magic fills in the screen pointer */
1444 MUIA_Boopsi_TagScreen
, WHEEL_Screen
,
1447 GA_Top
, 0, /* MUI will automatically */
1448 GA_Width
, 0, /* fill in the correct values */
1450 ICA_TARGET
, ICTARGET_IDCMP
,
1451 /* needed for notification */
1452 WHEEL_Saturation
, 0, /* start in the center */
1453 MUIA_FillArea
, TRUE
,
1454 /* use this because it defaults to FALSE
1455 for boopsi gadgets but the colorwheel
1456 doesn't bother about redrawing its
1460 Child
, r_slider
= SliderObject
,
1461 MUIA_Group_Horiz
, TRUE
,
1462 MUIA_Numeric_Min
, 0,
1463 MUIA_Numeric_Max
, 255,
1465 Child
, g_slider
= SliderObject
,
1466 MUIA_Group_Horiz
, TRUE
,
1467 MUIA_Numeric_Min
, 0,
1468 MUIA_Numeric_Max
, 255,
1470 Child
, b_slider
= SliderObject
,
1471 MUIA_Group_Horiz
, TRUE
,
1472 MUIA_Numeric_Min
, 0,
1473 MUIA_Numeric_Max
, 255,
1475 Child
, hue_gauge
= GaugeObject
,
1477 MUIA_Gauge_Horiz
, TRUE
,
1478 MUIA_Gauge_Max
, 255,
1479 MUIA_Gauge_Divide
, 1<<24,
1480 MUIA_Gauge_InfoText
, "Hue: %ld",
1485 Child
, RegisterGroup(color_pages
),
1486 Child
, VGroup
, GroupFrameT("Palette"),
1487 Child
, PaletteObject
,
1491 Child
, VGroup
, GroupFrameT("Colorfield"),
1494 Child
, colorfield
= ColorfieldObject
,
1495 MUIA_Colorfield_RGB
, default_color
,
1496 MUIA_Colorfield_Pen
, 253,
1498 Child
, colorfield2
= ColorfieldObject
,
1499 MUIA_Colorfield_Red
, default_color
[0],
1500 MUIA_Colorfield_Green
, default_color
[1],
1501 MUIA_Colorfield_Blue
, default_color
[2],
1504 Child
, colorfield_reset_button
=
1505 MUI_MakeObject(MUIO_Button
,
1509 MUI_MakeObject(MUIO_Label
, "Pen:", 0),
1510 Child
, colorfield_pen
= StringObject
,
1515 Child
, VGroup
, GroupFrameT("Coloradjust"),
1516 Child
, coloradjust
= ColoradjustObject
,
1517 MUIA_Coloradjust_RGB
, default_color
,
1523 Child
, VGroup
, GroupFrameT("Pendisplay"),
1526 Child
, pendisplay2
= PendisplayObject
,
1527 MUIA_Pendisplay_RGBcolor
,
1534 MUIO_Label
, "Pen:", 0),
1536 Child
, pendisplay_pen
=
1537 StringObject
, StringFrame
,
1540 Child
, reference_check
=
1541 MUI_MakeObject(MUIO_Checkmark
,
1543 Child
, MUI_MakeObject(MUIO_Label
,
1548 MUIO_Label
, "Penspec:", 0),
1549 Child
, pendisplay_spec
= StringObject
,
1554 Child
, shine_button
=
1555 MUI_MakeObject(MUIO_Button
,
1557 Child
, shadow_button
=
1558 MUI_MakeObject(MUIO_Button
,
1560 Child
, yellow_button
=
1561 MUI_MakeObject(MUIO_Button
,
1565 Child
, VGroup
, GroupFrameT("Poppen"),
1566 Child
, poppen
= PoppenObject
,
1570 Child
, VGroup
, GroupFrameT("Penadjust"),
1571 Child
, PenadjustObject
,
1579 Child
, editor_text
= StringObject
,
1582 Child
, PopaslObject
,
1583 ASLFR_DoSaveMode
, TRUE
,
1584 MUIA_Popstring_String
, filename_string
=
1585 MUI_MakeObject(MUIO_String
, NULL
, 200),
1586 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
1588 Child
, save_button
=
1589 MUI_MakeObject(MUIO_Button
, "Save"),
1593 Child
, RegisterGroup(list_pages
),
1595 Child
, ColGroup(LIST_COUNT
),
1596 Child
, VGroup
, GroupFrameT("No Multiselect"),
1597 Child
, list
.lists
[0],
1600 GroupFrameT("Default Multiselect"),
1601 Child
, list
.lists
[1],
1604 GroupFrameT("Shifted Multiselect"),
1605 Child
, list
.lists
[2],
1608 GroupFrameT("Unconditional Multiselect"),
1609 Child
, list
.lists
[3],
1612 GroupFrameT("Read Only"),
1613 Child
, list
.lists
[4],
1617 MUIA_Group_HorizSpacing
, 0,
1618 Child
, RectangleObject
,
1619 MUIA_HorizWeight
, 1,
1621 Child
, list
.list_radios
= RadioObject
,
1622 MUIA_Radio_Entries
, empty
,
1623 MUIA_Group_Horiz
, TRUE
,
1624 MUIA_HorizWeight
, 1000,
1626 Child
, RectangleObject
,
1627 MUIA_HorizWeight
, 1,
1630 Child
, RectangleObject
,
1632 MUIA_Rectangle_HBar
, TRUE
,
1633 MUIA_Rectangle_BarTitle
, "List Controls",
1636 Child
, MUI_MakeObject(MUIO_Label
,
1637 "Affected index 1:", 0),
1638 Child
, list
.index1_string
=
1641 MUIA_String_Accept
, (IPTR
)digits
,
1642 MUIA_String_Integer
, 0,
1645 Child
, list
.dragsortable_check
=
1646 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1647 Child
, MUI_MakeObject(MUIO_Label
,
1648 "Drag sortable", 0),
1652 Child
, list
.showdropmarks_check
=
1653 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1654 Child
, MUI_MakeObject(MUIO_Label
,
1655 "Show drop marks", 0),
1661 Child
, MUI_MakeObject(MUIO_Label
,
1662 "Affected index 2:", 0),
1663 Child
, list
.index2_string
=
1666 MUIA_String_Accept
, (IPTR
)digits
,
1667 MUIA_String_Integer
, 0,
1670 Child
, list
.quiet_check
=
1671 MUI_MakeObject(MUIO_Checkmark
,NULL
),
1672 Child
, MUI_MakeObject(MUIO_Label
,
1677 Child
, list
.autovisible_check
=
1678 MUI_MakeObject(MUIO_Checkmark
,NULL
),
1679 Child
, MUI_MakeObject(MUIO_Label
,
1683 Child
, list
.reset_button
=
1684 MUI_MakeObject(MUIO_Button
, "Reset"),
1687 Child
, MUI_MakeObject(MUIO_Label
,
1688 "Move/exchange mode 1:", 0),
1689 Child
, list
.move1_cycle
= CycleObject
,
1691 MUIA_Cycle_Entries
, list_move1_modes
,
1693 Child
, list
.move_button
=
1694 MUI_MakeObject(MUIO_Button
, "Move"),
1695 Child
, list
.sort_button
=
1696 MUI_MakeObject(MUIO_Button
, "Sort"),
1697 Child
, list
.enable_button
=
1698 MUI_MakeObject(MUIO_Button
, "Enable"),
1701 Child
, MUI_MakeObject(MUIO_Label
,
1702 "Move/exchange mode 2:", 0),
1703 Child
, list
.move2_cycle
= CycleObject
,
1705 MUIA_Cycle_Entries
, list_move2_modes
,
1707 Child
, list
.exchange_button
=
1708 MUI_MakeObject(MUIO_Button
, "Exchange"),
1709 Child
, list
.redraw_button
=
1710 MUI_MakeObject(MUIO_Button
, "Redraw"),
1711 Child
, MUI_MakeObject(MUIO_Label
,
1713 Child
, list
.title_string
=
1718 Child
, MUI_MakeObject(MUIO_Label
,
1720 Child
, list
.jump_cycle
= CycleObject
,
1722 MUIA_Cycle_Entries
, list_jump_modes
,
1724 Child
, list
.jump_button
=
1725 MUI_MakeObject(MUIO_Button
, "Jump"),
1726 Child
, list
.toggle_button
=
1727 MUI_MakeObject(MUIO_Button
, "Toggle"),
1728 Child
, MUI_MakeObject(MUIO_Label
,
1730 Child
, list
.entries_text
= TextObject
,
1732 MUIA_Text_Contents
, "N/A",
1735 Child
, MUI_MakeObject(MUIO_Label
,
1736 "Select/redraw mode:", 0),
1737 Child
, list
.select_cycle
= CycleObject
,
1739 MUIA_Cycle_Entries
, list_select_modes
,
1741 Child
, list
.select_button
=
1742 MUI_MakeObject(MUIO_Button
, "Select"),
1743 Child
, list
.deselect_button
=
1744 MUI_MakeObject(MUIO_Button
, "Deselect"),
1745 Child
, MUI_MakeObject(MUIO_Label
,
1746 "Visible entries:", 0),
1747 Child
, list
.visible_text
= TextObject
,
1749 MUIA_Text_Contents
, "N/A",
1752 Child
, MUI_MakeObject(MUIO_Label
,
1754 Child
, list
.insert_cycle
= CycleObject
,
1756 MUIA_Cycle_Entries
, list_insert_modes
,
1758 Child
, list
.insert_single_button
=
1759 MUI_MakeObject(MUIO_Button
, "Insert Single"),
1760 Child
, list
.insert_multiple_button
=
1761 MUI_MakeObject(MUIO_Button
, "Insert Multiple"),
1762 Child
, MUI_MakeObject(MUIO_Label
,
1763 "First visible index:", 0),
1764 Child
, list
.first_text
= TextObject
,
1766 MUIA_Text_Contents
, "N/A",
1769 Child
, MUI_MakeObject(MUIO_Label
,
1771 Child
, list
.remove_cycle
= CycleObject
,
1773 MUIA_Cycle_Entries
, list_remove_modes
,
1775 Child
, list
.remove_button
=
1776 MUI_MakeObject(MUIO_Button
, "Remove"),
1777 Child
, list
.clear_button
=
1778 MUI_MakeObject(MUIO_Button
, "Clear"),
1779 Child
, MUI_MakeObject(MUIO_Label
,
1780 "Last insertion index:", 0),
1781 Child
, list
.insert_text
= TextObject
,
1783 MUIA_Text_Contents
, "N/A",
1786 Child
, MUI_MakeObject(MUIO_Label
,
1787 "Activate mode:", 0),
1788 Child
, list
.activate_cycle
= CycleObject
,
1790 MUIA_Cycle_Entries
, list_activate_modes
,
1792 Child
, list
.activate_button
=
1793 MUI_MakeObject(MUIO_Button
, "Activate"),
1794 Child
, list
.deactivate_button
=
1795 MUI_MakeObject(MUIO_Button
, "Deactivate"),
1796 Child
, MUI_MakeObject(MUIO_Label
,
1797 "Active index:", 0),
1798 Child
, list
.active_text
= TextObject
,
1800 MUIA_Text_Contents
, "N/A",
1805 Child
, ColGroup(LIST_COUNT
/ 2),
1806 Child
, VGroup
, GroupFrameT("Standard Format"),
1807 Child
, list
.multi_lists
[0] = ListviewObject
,
1811 MUIA_List_DisplayHook
,
1813 MUIA_List_Format
, list_format
,
1814 MUIA_List_SourceArray
, entries
,
1815 MUIA_List_Title
, TRUE
,
1817 MUIA_Listview_MultiSelect
,
1818 MUIV_Listview_MultiSelect_None
,
1819 MUIA_Listview_DefClickColumn
, 1,
1823 Child
, VGroup
, GroupFrameT("Custom Format"),
1824 Child
, list
.multi_lists
[1] = ListviewObject
,
1828 MUIA_List_DisplayHook
,
1830 MUIA_List_Format
, list_format
,
1831 MUIA_List_SourceArray
, entries
,
1832 MUIA_List_Title
, TRUE
,
1834 MUIA_Listview_MultiSelect
,
1835 MUIV_Listview_MultiSelect_None
,
1840 Child
, RectangleObject
,
1842 MUIA_Rectangle_HBar
, TRUE
,
1843 MUIA_Rectangle_BarTitle
, "List Controls",
1846 Child
, MUI_MakeObject(MUIO_Label
, "Format:", 0),
1847 Child
, list
.format_string
= StringObject
,
1851 Child
, list
.showheadings_check
=
1852 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1853 Child
, MUI_MakeObject(MUIO_Label
,
1854 "Show column headings", 0),
1857 Child
, MUI_MakeObject(MUIO_Label
,
1858 "Default clicked column:", 0),
1859 Child
, list
.def_column_string
= StringObject
,
1861 MUIA_String_Accept
, (IPTR
)digits
,
1862 MUIA_String_Integer
, -1,
1865 Child
, MUI_MakeObject(MUIO_Label
,
1866 "Clicked column:", 0),
1867 Child
, list
.column_string
= StringObject
,
1870 Child
, list
.column_text
= TextObject
,
1872 MUIA_Text_Contents
, "N/A",
1885 MUIA_Gauge_InfoText
, "%ld %%",
1886 MUIA_Gauge_Horiz
, TRUE
,
1887 MUIA_Gauge_Current
, 25,
1896 MUIA_Gauge_InfoText
, "%ld %%",
1897 MUIA_Gauge_Horiz
, TRUE
,
1898 MUIA_Gauge_Current
, 50,
1907 MUIA_Gauge_InfoText
, "%ld %%",
1908 MUIA_Gauge_Horiz
, TRUE
,
1909 MUIA_Gauge_Current
, 75,
1919 MUIA_Gauge_InfoText
, "%ld %%",
1920 MUIA_Gauge_Current
, 25,
1924 MUIA_Gauge_InfoText
, "%ld %%",
1925 MUIA_Gauge_Current
, 50,
1929 MUIA_Gauge_InfoText
, "%ld %%",
1930 MUIA_Gauge_Current
, 75,
1939 GroupFrameT("Horizontal Sliders"),
1940 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
1941 Child
, numerics
[HNSLIDER
] = SliderObject
,
1942 MUIA_Slider_Horiz
, TRUE
,
1943 MUIA_Numeric_Min
, NUMERIC_MIN
,
1944 MUIA_Numeric_Max
, NUMERIC_MAX
,
1947 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
1948 Child
, numerics
[HRSLIDER
] = SliderObject
,
1949 MUIA_Numeric_Reverse
, TRUE
,
1950 MUIA_Numeric_Min
, NUMERIC_MIN
,
1951 MUIA_Numeric_Max
, NUMERIC_MAX
,
1954 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
1955 Child
, numerics
[HQSLIDER
] = SliderObject
,
1956 MUIA_Slider_Quiet
, TRUE
,
1957 MUIA_Numeric_Min
, NUMERIC_MIN
,
1958 MUIA_Numeric_Max
, NUMERIC_MAX
,
1963 GroupFrameT("Vertical Sliders"),
1964 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
1965 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
1966 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
1967 Child
, numerics
[VNSLIDER
] = SliderObject
,
1968 MUIA_Slider_Horiz
, FALSE
,
1969 MUIA_Numeric_Min
, NUMERIC_MIN
,
1970 MUIA_Numeric_Max
, NUMERIC_MAX
,
1973 Child
, numerics
[VRSLIDER
] = SliderObject
,
1974 MUIA_Slider_Horiz
, FALSE
,
1975 MUIA_Numeric_Reverse
, TRUE
,
1976 MUIA_Numeric_Min
, NUMERIC_MIN
,
1977 MUIA_Numeric_Max
, NUMERIC_MAX
,
1980 Child
, numerics
[VQSLIDER
] = SliderObject
,
1981 MUIA_Slider_Horiz
, FALSE
,
1982 MUIA_Slider_Quiet
, TRUE
,
1983 MUIA_Numeric_Min
, NUMERIC_MIN
,
1984 MUIA_Numeric_Max
, NUMERIC_MAX
,
1989 GroupFrameT("Numeric Buttons"),
1990 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
1991 Child
, numerics
[NNUMERICBUTTON
] =
1992 NumericbuttonObject
,
1993 MUIA_Numeric_Min
, NUMERIC_MIN
,
1994 MUIA_Numeric_Max
, NUMERIC_MAX
,
1997 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
1998 Child
, numerics
[RNUMERICBUTTON
] =
1999 NumericbuttonObject
,
2000 MUIA_Numeric_Reverse
, TRUE
,
2001 MUIA_Numeric_Min
, NUMERIC_MIN
,
2002 MUIA_Numeric_Max
, NUMERIC_MAX
,
2007 GroupFrameT("Knobs"),
2008 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2009 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2010 Child
, numerics
[NKNOB
] = KnobObject
,
2011 MUIA_Numeric_Min
, NUMERIC_MIN
,
2012 MUIA_Numeric_Max
, NUMERIC_MAX
,
2015 Child
, numerics
[RKNOB
] = KnobObject
,
2016 MUIA_Numeric_Reverse
, TRUE
,
2017 MUIA_Numeric_Min
, NUMERIC_MIN
,
2018 MUIA_Numeric_Max
, NUMERIC_MAX
,
2023 Child
, MUI_MakeObject(MUIO_Label
,
2024 "Minimum Value:", 0),
2025 Child
, min_string
= (Object
*)StringObject
,
2027 MUIA_String_Accept
, (IPTR
)digits
,
2028 MUIA_String_Integer
, NUMERIC_MIN
,
2031 Child
, MUI_MakeObject(MUIO_Label
,
2032 "Maximum Value:", 0),
2033 Child
, max_string
= (Object
*)StringObject
,
2035 MUIA_String_Accept
, (IPTR
)digits
,
2036 MUIA_String_Integer
, NUMERIC_MAX
,
2039 Child
, slider_button
= TextObject
,
2041 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2043 MUIA_Background
, MUII_ButtonBack
,
2044 MUIA_Text_PreParse
, "\33c",
2046 "Change Slider Orientations",
2048 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
2057 MUIA_Radio_Entries
, radio_entries1
,
2059 Child
, country_radio
[0] = RadioObject
,
2061 MUIA_Radio_Entries
, radio_entries2
,
2062 MUIA_Radio_Active
, 1,
2068 MUIA_Radio_Entries
, radio_entries1
,
2070 Child
, country_radio
[1] = RadioObject
,
2072 MUIA_Radio_Entries
, radio_entries2
,
2073 MUIA_Radio_Active
, 1,
2078 #if defined(TEST_ICONLIST)
2081 Child
, volume_iconlist
=
2082 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
2084 Child
, drawer_iconlist
=
2085 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
2086 MUIA_IconDrawerList_Drawer
, "SYS:",
2093 Child
, create_balance_column(),
2094 Child
, BalanceObject
,
2097 Child
, create_balance_column(),
2098 Child
, BalanceObject
,
2101 Child
, create_balance_column(),
2102 Child
, BalanceObject
,
2105 Child
, create_balance_column(),
2106 Child
, BalanceObject
,
2109 Child
, create_balance_column(),
2116 Child
, about_button
= TextObject
,
2118 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2120 MUIA_Background
, MUII_ButtonBack
,
2121 MUIA_Text_PreParse
, "\33c",
2122 MUIA_Text_Contents
, "About",
2124 Child
, quit_button
= TextObject
,
2126 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2128 MUIA_Background
, MUII_ButtonBack
,
2129 MUIA_ControlChar
, 'q',
2130 MUIA_Text_HiChar
, 'q',
2131 MUIA_Text_PreParse
, "\33c",
2132 MUIA_Text_Contents
, "Quit",
2138 SubWindow
, second_wnd
= WindowObject
,
2139 MUIA_Window_Title
, "Second window",
2140 WindowContents
, VGroup
,
2141 Child
, DropTextObject
,
2142 MUIA_Text_Contents
, "Drop here",
2143 MUIA_Dropable
, TRUE
,
2154 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
2155 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2156 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
2157 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
2158 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
,
2159 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
2160 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2161 MUIM_Application_AboutMUI
, NULL
);
2162 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2163 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2164 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2165 MUIM_CallHook
, &hook_objects
);
2166 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
2167 app
, 2, MUIM_CallHook
, &hook
);
2169 /* Notifications and set-up for string objects */
2170 DoMethod(string
.max_len_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
2171 "%ld", XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2172 set(string
.cursor_pos_slider
, MUIA_Numeric_Max
,
2173 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2174 set(string
.display_pos_slider
, MUIA_Numeric_Max
,
2175 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2176 set(string
.cr_advance_check
, MUIA_Selected
, TRUE
);
2177 set(string
.attach_list_check
, MUIA_Selected
, TRUE
);
2178 set(string
.strings
[1], MUIA_Disabled
,
2179 XGET(string
.strings
[1], MUIA_String_Format
)
2180 != MUIV_String_Format_Left
);
2181 set(string
.strings
[2], MUIA_Disabled
,
2182 XGET(string
.strings
[2], MUIA_String_Format
)
2183 != MUIV_String_Format_Right
);
2184 set(string
.strings
[3], MUIA_Disabled
,
2185 XGET(string
.strings
[3], MUIA_String_Format
)
2186 != MUIV_String_Format_Center
);
2187 set(string
.strings
[4], MUIA_Disabled
,
2188 !XGET(string
.strings
[4], MUIA_String_Secret
));
2189 set(string
.strings
[0], MUIA_String_MaxLen
, 100);
2190 set(string
.reject_string
, MUIA_String_Contents
,
2191 (IPTR
)default_reject_chars
);
2193 for (i
= 0; i
< STRING_COUNT
; i
++)
2197 DoMethod(string
.accept_string
, MUIM_Notify
,
2198 MUIA_String_Contents
, MUIV_EveryTime
, string
.strings
[i
],
2199 3, MUIM_Set
, MUIA_String_Accept
, MUIV_TriggerValue
);
2200 DoMethod(string
.cr_advance_check
, MUIM_Notify
, MUIA_Selected
,
2201 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2202 MUIA_String_AdvanceOnCR
, MUIV_TriggerValue
);
2203 DoMethod(string
.cursor_pos_slider
, MUIM_Notify
,
2204 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2205 MUIM_Set
, MUIA_String_BufferPos
, MUIV_TriggerValue
);
2206 DoMethod(string
.display_pos_slider
, MUIM_Notify
,
2207 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2208 MUIM_Set
, MUIA_String_DisplayPos
, MUIV_TriggerValue
);
2209 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2210 TRUE
, string
.strings
[i
], 3, MUIM_Set
,
2211 MUIA_String_AttachedList
, list
.lists
[0]);
2212 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2213 FALSE
, string
.strings
[i
], 3, MUIM_Set
,
2214 MUIA_String_AttachedList
, NULL
);
2218 DoMethod(string
.strings
[0], MUIM_Notify
, MUIA_String_Accept
,
2219 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2220 MUIA_String_Accept
, MUIV_TriggerValue
);
2221 DoMethod(string
.strings
[0], MUIM_Notify
,
2222 MUIA_String_AdvanceOnCR
, MUIV_EveryTime
,
2223 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_AdvanceOnCR
,
2225 DoMethod(string
.strings
[0], MUIM_Notify
,
2226 MUIA_String_BufferPos
, MUIV_EveryTime
,
2227 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_BufferPos
,
2229 DoMethod(string
.strings
[0], MUIM_Notify
,
2230 MUIA_String_DisplayPos
, MUIV_EveryTime
,
2231 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_DisplayPos
,
2233 DoMethod(string
.strings
[0], MUIM_Notify
,
2234 MUIA_String_AttachedList
, MUIV_EveryTime
,
2235 string
.strings
[i
], 3, MUIM_Set
,
2236 MUIA_String_AttachedList
, MUIV_TriggerValue
);
2238 DoMethod(string
.reject_string
, MUIM_Notify
, MUIA_String_Contents
,
2239 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2240 MUIA_String_Reject
, MUIV_TriggerValue
);
2241 DoMethod(string
.strings
[i
], MUIM_Notify
, MUIA_String_Integer
,
2242 MUIV_EveryTime
, string
.integer_string
, 3, MUIM_NoNotifySet
,
2243 MUIA_String_Integer
, MUIV_TriggerValue
);
2244 DoMethod(string
.integer_string
, MUIM_Notify
, MUIA_String_Integer
,
2245 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_NoNotifySet
,
2246 MUIA_String_Integer
, MUIV_TriggerValue
);
2248 DoMethod(string
.accept_all_check
, MUIM_Notify
, MUIA_Selected
,
2249 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2250 ChangeStringAccept
);
2251 DoMethod(string
.strings
[4], MUIM_Notify
, MUIA_String_Acknowledge
,
2252 MUIV_EveryTime
, string
.plaintext_string
, 3, MUIM_NoNotifySet
,
2253 MUIA_String_Contents
, MUIV_TriggerValue
);
2254 DoMethod(string
.plaintext_string
, MUIM_Notify
,
2255 MUIA_String_Acknowledge
, MUIV_EveryTime
, string
.strings
[4], 3,
2256 MUIM_NoNotifySet
, MUIA_String_Contents
, MUIV_TriggerValue
);
2258 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
2259 MUIM_CallHook
, &hook_wheel
);
2260 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
2261 2, MUIM_CallHook
, &hook_wheel
);
2262 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2263 app
, 2, MUIM_CallHook
, &hook_slider
);
2264 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2265 app
, 2, MUIM_CallHook
, &hook_slider
);
2266 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2267 app
, 2, MUIM_CallHook
, &hook_slider
);
2269 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
2270 MUIM_CallHook
, &hook_standard
, Save
);
2272 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2273 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
2274 MUIV_Application_ReturnID_Quit
);
2275 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2276 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2279 /* Notifications for color objects */
2280 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Red
,
2281 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2283 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Green
,
2284 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2286 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Blue
,
2287 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2289 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Red
,
2290 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2292 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Green
,
2293 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2295 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Blue
,
2296 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2298 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Pen
,
2299 MUIV_EveryTime
, colorfield_pen
, 3, MUIM_Set
,
2300 MUIA_String_Integer
, MUIV_TriggerValue
);
2301 DoMethod(colorfield_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2302 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2304 DoMethod(colorfield_reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2305 colorfield
, 3, MUIM_Set
, MUIA_Colorfield_RGB
, default_color
);
2307 /* Notifications for pen objects */
2308 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Pen
,
2309 MUIV_EveryTime
, pendisplay_pen
, 3, MUIM_NoNotifySet
,
2310 MUIA_String_Integer
, MUIV_TriggerValue
);
2311 DoMethod(pendisplay_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2312 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2313 ChangePendisplayPen
);
2314 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Spec
,
2315 MUIV_EveryTime
, pendisplay_spec
, 3, MUIM_Set
,
2316 MUIA_String_Contents
, MUIV_TriggerValue
);
2317 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_RGB
,
2318 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
,
2319 MUIA_Pendisplay_RGBcolor
, MUIV_TriggerValue
);
2320 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_RGBcolor
,
2321 MUIV_EveryTime
, poppen
, 3, MUIM_Set
, MUIA_Pendisplay_RGBcolor
,
2323 DoMethod(pendisplay_spec
, MUIM_Notify
, MUIA_String_Contents
,
2324 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
, MUIA_Pendisplay_Spec
,
2326 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, TRUE
,
2327 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, pendisplay
);
2328 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, FALSE
,
2329 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, NULL
);
2330 DoMethod(shine_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2331 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHINE
);
2332 DoMethod(shadow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2333 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHADOW
);
2334 DoMethod(yellow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2335 4, MUIM_Pendisplay_SetRGB
, 0xffffffff, 0xffffffff, 0);
2337 /* Notifications and set-up for list objects */
2338 set(list
.showdropmarks_check
, MUIA_Selected
, TRUE
);
2340 for (i
= 0; i
< LIST_COUNT
; i
++)
2342 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2343 MUIV_EveryTime
, list
.lists
[i
], 3, MUIM_Set
, MUIA_Disabled
,
2345 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Entries
,
2346 MUIV_EveryTime
, list
.entries_text
, 4, MUIM_SetAsString
,
2347 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2348 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Visible
,
2349 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2351 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_First
,
2352 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2354 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_InsertPosition
,
2355 MUIV_EveryTime
, list
.insert_text
, 4, MUIM_SetAsString
,
2356 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2357 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Active
,
2358 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2361 DoMethod(list
.dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
2362 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2363 ListSetDragSortable
);
2364 DoMethod(list
.showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
2365 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2366 ListSetShowDropMarks
);
2367 DoMethod(list
.quiet_check
, MUIM_Notify
, MUIA_Selected
,
2368 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2370 DoMethod(list
.autovisible_check
, MUIM_Notify
, MUIA_Selected
,
2371 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2372 ListSetAutoVisible
);
2373 DoMethod(list
.reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2374 app
, 3, MUIM_CallHook
, &hook_standard
, ListReset
);
2375 DoMethod(list
.move_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2376 app
, 3, MUIM_CallHook
, &hook_standard
, ListMove
);
2377 DoMethod(list
.sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2378 app
, 3, MUIM_CallHook
, &hook_standard
, ListSort
);
2379 DoMethod(list
.enable_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2380 app
, 3, MUIM_CallHook
, &hook_standard
, ListEnable
);
2381 DoMethod(list
.exchange_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2382 app
, 3, MUIM_CallHook
, &hook_standard
, ListExchange
);
2383 DoMethod(list
.jump_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2384 app
, 3, MUIM_CallHook
, &hook_standard
, ListJump
);
2385 DoMethod(list
.select_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2386 app
, 3, MUIM_CallHook
, &hook_standard
, ListSelect
);
2387 DoMethod(list
.deselect_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2388 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeselect
);
2389 DoMethod(list
.toggle_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2390 app
, 3, MUIM_CallHook
, &hook_standard
, ListToggle
);
2391 DoMethod(list
.redraw_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2392 app
, 3, MUIM_CallHook
, &hook_standard
, ListRedraw
);
2393 DoMethod(list
.insert_single_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2394 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsertSingle
);
2395 DoMethod(list
.insert_multiple_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2396 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsert
);
2397 DoMethod(list
.remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2398 app
, 3, MUIM_CallHook
, &hook_standard
, ListRemove
);
2399 DoMethod(list
.clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2400 app
, 3, MUIM_CallHook
, &hook_standard
, ListClear
);
2401 DoMethod(list
.activate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2402 app
, 3, MUIM_CallHook
, &hook_standard
, ListActivate
);
2403 DoMethod(list
.deactivate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2404 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeactivate
);
2405 DoMethod(list
.title_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2406 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2408 DoMethod(list
.list_radios
, MUIM_Notify
, MUIA_Radio_Active
,
2409 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2412 SET(list
.showheadings_check
, MUIA_Selected
,
2413 XGET(list
.multi_lists
[0], MUIA_List_Title
));
2414 SET(list
.format_string
, MUIA_String_Contents
,
2415 XGET(list
.multi_lists
[1], MUIA_List_Format
));
2416 SET(list
.def_column_string
, MUIA_String_Integer
,
2417 XGET(list
.multi_lists
[0], MUIA_Listview_DefClickColumn
));
2418 DoMethod(list
.format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2419 MUIV_EveryTime
, list
.multi_lists
[1], 3, MUIM_Set
,
2420 MUIA_List_Format
, MUIV_TriggerValue
);
2421 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_List_Format
,
2422 MUIV_EveryTime
, wnd
, 3, MUIM_Set
,
2423 MUIA_Window_ActiveObject
, list
.format_string
);
2424 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
2426 DoMethod(list
.showheadings_check
, MUIM_Notify
, MUIA_Selected
,
2427 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2428 MUIA_List_Title
, MUIV_TriggerValue
);
2429 DoMethod(list
.def_column_string
, MUIM_Notify
,
2430 MUIA_String_Integer
,
2431 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2432 MUIA_Listview_DefClickColumn
, MUIV_TriggerValue
);
2433 DoMethod(list
.multi_lists
[i
], MUIM_Notify
,
2434 MUIA_Listview_ClickColumn
, MUIV_EveryTime
,
2435 list
.column_string
, 3, MUIM_Set
, MUIA_String_Integer
,
2438 DoMethod(list
.column_string
, MUIM_Notify
, MUIA_String_Contents
,
2439 MUIV_EveryTime
, list
.column_text
, 3, MUIM_Set
, MUIA_Text_Contents
,
2442 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
2443 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
2446 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
2448 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
2449 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
2451 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
2452 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
2455 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2456 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
2459 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
2460 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
2461 MUIA_Radio_Active
, MUIV_TriggerValue
);
2462 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
2463 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
2464 MUIA_Radio_Active
, MUIV_TriggerValue
);
2466 #if defined(TEST_ICONLIST)
2468 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2469 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2470 volume_doubleclicked
);
2471 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2472 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2473 drawer_doubleclicked
);
2476 /* automatic tests */
2477 get(list
.lists
[0], MUIA_List_Visible
, &value
);
2479 printf("MUIA_List_Visible equals %ld before display,"
2480 " but it should be -1.\n", (long)value
);
2482 set(wnd
, MUIA_Window_Open
, TRUE
);
2483 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test application");
2485 /* Set pen fields */
2486 set(colorfield_pen
, MUIA_String_Integer
,
2487 XGET(colorfield
, MUIA_Colorfield_Pen
));
2490 nnset(pendisplay_pen
, MUIA_String_Integer
,
2491 XGET(pendisplay
, MUIA_Pendisplay_Pen
));
2493 struct MUI_PenSpec
*pen_spec
= NULL
;
2494 GET(pendisplay
, MUIA_Pendisplay_Spec
, &pen_spec
);
2495 strncpy(pen_str
, pen_spec
->buf
, 10);
2496 set(pendisplay_spec
, MUIA_String_Contents
, pen_str
);
2498 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
2499 &sigs
) != MUIV_Application_ReturnID_Quit
)
2503 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
2504 if (sigs
& SIGBREAKF_CTRL_C
)
2506 if (sigs
& SIGBREAKF_CTRL_D
)
2511 MUI_DisposeObject(app
);
2514 MUI_DisposeObject(context_menu
);
2515 CloseLibrary(ColorWheelBase
);
2516 MUI_DeleteCustomClass(CL_DropText
);
2518 CloseLibrary(MUIMasterBase
);