tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / test / Zune / test.c
blob1fc586cb4d9e20532e848d28761773ff065856aa
1 /*
2 Copyright © 2002-2016, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #define INTUITION_NO_INLINE_STDARG
10 #include <exec/types.h>
11 #include <stdlib.h>
12 #include <stdio.h>
13 #include <string.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
31 #if 0
32 #define TEST_ICONLIST
33 #endif
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"
39 #endif
41 #define STRING_COUNT 6
42 #define LIST_COUNT 5
43 #define MULTI_LIST_COUNT 2
45 #define NUMERIC_MIN 0
46 #define NUMERIC_MAX 100
48 static const TEXT digits[] = "-0123456789";
49 static const TEXT vowels[] = "aeiou";
50 static const TEXT default_accept_chars[] = "aeiou?.";
51 static const TEXT default_reject_chars[] = "*?";
52 static const ULONG default_color[] = {155 << 24, 180 << 24, 255 << 24};
53 static const struct MUI_PenSpec default_penspec = {"m0"};
54 static const char *fruits[] = {"Strawberry", "Apple", "Banana", "Orange",
55 "Grapefruit", "Kumquat", "Plum", "Raspberry", "Apricot", "Grape",
56 "Peach", "Lemon", "Lime", "Date", "Pineapple", "Blueberry", "Papaya",
57 "Cranberry", "Gooseberry", "Pear", "Fig", "Coconut", "Melon",
58 "Pumpkin", NULL};
59 static const char *empty[] = {"", "", "", "", "", NULL};
60 static const LONG list_active_positions[] =
62 MUIV_List_Active_Top,
63 MUIV_List_Active_Bottom,
64 MUIV_List_Active_Off,
65 MUIV_List_Active_Off,
66 MUIV_List_Active_Off
68 static const CONST_STRPTR list_move1_modes[] =
69 {"Index", "Top", "Active", "Bottom", NULL};
70 static const CONST_STRPTR list_move2_modes[] =
71 {"Index", "Top", "Active", "Bottom", "Next", "Previous", NULL};
72 static const CONST_STRPTR list_jump_modes[] =
73 {"Index", "Top", "Active", "Bottom", "Down", "Up", NULL};
74 static const CONST_STRPTR list_insert_modes[] =
75 {"Index", "Top", "Active", "Sorted", "Bottom", NULL};
76 static const CONST_STRPTR list_remove_modes[] =
77 {"Index", "First", "Active", "Last", "Selected", "Unsafe Loop",
78 "Safe Loop", NULL};
79 static const CONST_STRPTR list_activate_modes[] =
80 {"Index", "Top", "Bottom", "Up", "Down", "Page Up", "Page Down", NULL};
81 static const CONST_STRPTR list_select_modes[] =
82 {"Index", "Active", "All", NULL};
83 static const TEXT list_format[] = "BAR,BAR,";
85 enum
87 HNSLIDER,
88 HRSLIDER,
89 HQSLIDER,
90 VNSLIDER,
91 VRSLIDER,
92 VQSLIDER,
93 NNUMERICBUTTON,
94 RNUMERICBUTTON,
95 NKNOB,
96 RKNOB,
97 NUMERIC_COUNT
100 struct Library *MUIMasterBase;
101 struct Library *ColorWheelBase;
103 struct list_entry
105 char *column1;
106 char *column2;
109 Object *app, *wnd;
111 static struct
113 Object *strings[STRING_COUNT],
114 *accept_string,
115 *reject_string,
116 *cursor_pos_slider,
117 *display_pos_slider,
118 *integer_string,
119 *plaintext_string,
120 *max_len_text,
121 *cr_advance_check,
122 *attach_list_check,
123 *standard_hook_check,
124 *custom_hook_check,
125 *accept_all_check;
127 string;
129 static struct
131 Object *lists[LIST_COUNT],
132 *list_radios,
133 *index1_string,
134 *index2_string,
135 *title_string,
136 *move1_cycle,
137 *move2_cycle,
138 *jump_cycle,
139 *select_cycle,
140 *insert_cycle,
141 *remove_cycle,
142 *activate_cycle,
143 *sort_button,
144 *clear_button,
145 *enable_button,
146 *reset_button,
147 *select_button,
148 *deselect_button,
149 *toggle_button,
150 *move_button,
151 *exchange_button,
152 *jump_button,
153 *redraw_button,
154 *insert_single_button,
155 *insert_multiple_button,
156 *remove_button,
157 *activate_button,
158 *deactivate_button,
159 *draggable_check,
160 *showdropmarks_check,
161 *multitest_check,
162 *quiet_check,
163 *dragsortable_check,
164 *autovisible_check,
165 *entries_text,
166 *visible_text,
167 *first_text,
168 *insert_text,
169 *active_text,
170 *drop_text,
171 *multi_lists[MULTI_LIST_COUNT],
172 *colorfield,
173 *format_string,
174 *column_string,
175 *column_text,
176 *def_column_string,
177 *showheadings_check,
178 *showimage_check;
179 LONG quiet[LIST_COUNT],
180 destruct_count,
181 has_multitest[LIST_COUNT];
182 IPTR image;
184 list;
186 static Object *wheel;
187 static Object *r_slider;
188 static Object *g_slider;
189 static Object *b_slider;
190 static Object *hue_gauge;
191 static Object *colorfield, *colorfield2, *colorfield_reset_button,
192 *colorfield_pen;
193 static Object *coloradjust;
194 static Object *pendisplay, *pendisplay2, *pendisplay_pen, *pendisplay_spec,
195 *reference_check, *shine_button, *shadow_button, *yellow_button, *poppen;
196 static Object *group;
197 static Object *editor_text;
198 static Object *filename_string;
199 static Object *save_button;
200 static struct Hook hook_standard;
201 static struct Hook hook;
202 static struct Hook hook_wheel;
203 static struct Hook hook_slider;
204 static struct Hook hook_objects;
205 static struct Hook hook_compare, hook_multitest;
206 static struct Hook hook_construct, hook_destruct, hook_display;
207 static struct Hook hook_objstr;
209 #if defined(TEST_ICONLIST)
210 static Object *drawer_iconlist;
211 static Object *volume_iconlist;
212 #endif
214 AROS_UFH0(void, repeat_function)
216 AROS_USERFUNC_INIT
218 printf("MUI_Timer\n");
220 AROS_USERFUNC_EXIT
223 AROS_UFH0(void, wheel_function)
225 AROS_USERFUNC_INIT
227 nnset(r_slider, MUIA_Numeric_Value, (XGET(wheel,
228 WHEEL_Red) >> 24) & 0xff);
229 nnset(g_slider, MUIA_Numeric_Value, (XGET(wheel,
230 WHEEL_Green) >> 24) & 0xff);
231 nnset(b_slider, MUIA_Numeric_Value, (XGET(wheel,
232 WHEEL_Blue) >> 24) & 0xff);
234 AROS_USERFUNC_EXIT
237 AROS_UFH0(void, slider_function)
239 AROS_USERFUNC_INIT
241 struct ColorWheelRGB cw;
242 ULONG red = XGET(r_slider, MUIA_Numeric_Value);
243 ULONG green = XGET(g_slider, MUIA_Numeric_Value);
244 ULONG blue = XGET(b_slider, MUIA_Numeric_Value);
246 cw.cw_Red = (red << 24) | (red << 16) | (red << 8) | red;
247 cw.cw_Green = (green << 24) | (green << 16) | (green << 8) | green;
248 cw.cw_Blue = (blue << 24) | (blue << 16) | (blue << 8) | blue;
250 nnset(wheel, WHEEL_RGB, &cw);
251 set(hue_gauge, MUIA_Gauge_Current, XGET(wheel, WHEEL_Hue));
253 AROS_USERFUNC_EXIT
256 AROS_UFH0(void, objects_function)
258 AROS_USERFUNC_INIT
260 Object *new_obj = MUI_MakeObject(MUIO_Button, "Button");
261 if (new_obj)
263 DoMethod(group, MUIM_Group_InitChange);
264 DoMethod(group, OM_ADDMEMBER, new_obj);
265 DoMethod(group, MUIM_Group_ExitChange);
268 AROS_USERFUNC_EXIT
271 static void About(void)
273 static Object *about_wnd;
275 if (!about_wnd)
277 about_wnd = AboutmuiObject, MUIA_Aboutmui_Application, app, End;
280 if (about_wnd)
281 set(about_wnd, MUIA_Window_Open, TRUE);
284 AROS_UFH3(static void, ObjStrHook,
285 AROS_UFHA(struct Hook *, h, A0),
286 AROS_UFHA(Object *, group, A2),
287 AROS_UFHA(Object *, str, A1))
289 AROS_USERFUNC_INIT
291 struct List *child_list = NULL;
292 Object *child, *list;
293 struct list_entry *entry;
295 /* Find the listview object within its group */
296 GET(group, MUIA_Group_ChildList, &child_list);
297 child = (APTR)child_list->lh_Head;
298 NextObject(&child);
299 list = NextObject(&child);
301 /* Copy one of the selected entry's fields to the string gadget */
302 DoMethod(list, MUIM_List_GetEntry, MUIV_List_GetEntry_Active, &entry);
303 SET(str, MUIA_String_Contents, entry->column1);
305 AROS_USERFUNC_EXIT
308 static void ChangeStringAccept(void)
310 STRPTR accept_chars = NULL, reject_chars = NULL;
311 BOOL accept_all;
312 UWORD i;
314 accept_all = XGET(string.accept_all_check, MUIA_Selected);
315 SET(string.accept_string, MUIA_Disabled, accept_all);
316 SET(string.reject_string, MUIA_Disabled, accept_all);
318 if (!accept_all)
320 GET(string.accept_string, MUIA_String_Contents, &accept_chars);
321 GET(string.reject_string, MUIA_String_Contents, &reject_chars);
324 for (i = 0; i < STRING_COUNT; i++)
326 SET(string.strings[i], MUIA_String_Accept, accept_chars);
327 SET(string.strings[i], MUIA_String_Reject, reject_chars);
331 static void ChangePen(void)
333 SIPTR pen = -1;
335 GET(colorfield_pen, MUIA_String_Integer, &pen);
336 if (pen >= 0)
337 SET(colorfield, MUIA_Colorfield_Pen, pen);
340 static void ChangePendisplayPen(void)
342 DoMethod(pendisplay, MUIM_Pendisplay_SetColormap,
343 XGET(pendisplay_pen, MUIA_String_Integer));
346 AROS_UFH3(static IPTR, ListCompareHook,
347 AROS_UFHA(struct Hook *, h, A0),
348 AROS_UFHA(CONST_STRPTR, str1, A2),
349 AROS_UFHA(CONST_STRPTR, str2, A1))
351 AROS_USERFUNC_INIT
353 IPTR len1, len2;
355 len1 = strlen(str1);
356 len2 = strlen(str2);
358 /* Indicate which string is shorter */
359 return len2 - len1;
361 AROS_USERFUNC_EXIT
364 AROS_UFH3(static IPTR, ListMultiTestHook,
365 AROS_UFHA(struct Hook *, h, A0),
366 AROS_UFHA(APTR, unused, A2),
367 AROS_UFHA(CONST_STRPTR, str, A1))
369 AROS_USERFUNC_INIT
371 /* Indicate whether the string doesn't begin with a vowel */
372 return strchr(vowels, tolower(str[0])) == NULL;
374 AROS_USERFUNC_EXIT
377 static void ChangeListTitle(void)
379 STRPTR title = NULL;
380 UWORD i;
382 i = XGET(list.list_radios, MUIA_Radio_Active);
384 GET(list.lists[i], MUIA_List_Title, &title);
385 FreeVec(title);
387 GET(list.title_string, MUIA_String_Contents, &title);
388 if (title[0] == '\0')
389 title = NULL;
391 title = StrDup(title);
393 SET(list.lists[i], MUIA_List_Title, title);
396 static void UpdateListInfo(void)
398 STRPTR title = NULL;
399 UWORD i;
400 LONG value = 0;
402 i = XGET(list.list_radios, MUIA_Radio_Active);
404 GET(list.lists[i], MUIA_Listview_DragType, &value);
405 NNSET(list.draggable_check, MUIA_Selected,
406 value != MUIV_Listview_DragType_None);
407 NNSET(list.dragsortable_check, MUIA_Disabled,
408 value == MUIV_Listview_DragType_None);
409 if (value == MUIV_Listview_DragType_None)
410 value = FALSE;
411 else
412 GET(list.lists[i], MUIA_List_DragSortable, &value);
413 NNSET(list.dragsortable_check, MUIA_Selected, value);
414 GET(list.lists[i], MUIA_List_ShowDropMarks, &value);
415 NNSET(list.showdropmarks_check, MUIA_Selected, value);
416 value = list.has_multitest[i]; // MUIA_List_MultiTestHook isn't gettable!
417 NNSET(list.multitest_check, MUIA_Selected, value);
418 value = list.quiet[i]; // MUIA_List_Quiet is not gettable!
419 NNSET(list.quiet_check, MUIA_Selected, value);
420 GET(list.lists[i], MUIA_List_AutoVisible, &value);
421 NNSET(list.autovisible_check, MUIA_Selected, value);
423 GET(list.lists[i], MUIA_List_Title, &title);
424 NNSET(list.title_string, MUIA_String_Contents, title);
426 GET(list.lists[i], MUIA_List_Entries, &value);
427 DoMethod(list.entries_text, MUIM_SetAsString, MUIA_Text_Contents,
428 "%ld", value);
429 GET(list.lists[i], MUIA_List_Visible, &value);
430 DoMethod(list.visible_text, MUIM_SetAsString, MUIA_Text_Contents,
431 "%ld", value);
432 GET(list.lists[i], MUIA_List_First, &value);
433 DoMethod(list.first_text, MUIM_SetAsString, MUIA_Text_Contents,
434 "%ld", value);
435 GET(list.lists[i], MUIA_List_InsertPosition, &value);
436 DoMethod(list.insert_text, MUIM_SetAsString, MUIA_Text_Contents,
437 "%ld", value);
438 GET(list.lists[i], MUIA_List_Active, &value);
439 if (value == MUIV_List_Active_Off)
440 SET(list.active_text, MUIA_Text_Contents, "N/A");
441 else
442 DoMethod(list.active_text, MUIM_SetAsString, MUIA_Text_Contents,
443 "%ld", value);
444 GET(list.lists[i], MUIA_List_DropMark, &value);
445 DoMethod(list.drop_text, MUIM_SetAsString, MUIA_Text_Contents,
446 "%ld", value);
449 static void ListGetVisible(void)
451 UWORD i;
452 LONG value = 0;
454 i = XGET(list.list_radios, MUIA_Radio_Active);
456 GET(list.lists[i], MUIA_List_Visible, &value);
457 DoMethod(list.visible_text, MUIM_SetAsString, MUIA_Text_Contents,
458 "%ld", value);
461 static void ListGetFirst(void)
463 UWORD i;
464 LONG value = 0;
465 Object *real_list;
467 i = XGET(list.list_radios, MUIA_Radio_Active);
469 /* We fetch the Listview's list here to provide test coverage for that
470 attribute. Please don't optimise */
471 real_list = (Object *)XGET(list.lists[i], MUIA_Listview_List);
472 GET(real_list, MUIA_List_First, &value);
473 DoMethod(list.first_text, MUIM_SetAsString, MUIA_Text_Contents,
474 "%ld", value);
477 static void ListSetDraggable(void)
479 UWORD i;
480 LONG value = 0;
482 i = XGET(list.list_radios, MUIA_Radio_Active);
484 GET(list.draggable_check, MUIA_Selected, &value);
485 SET(list.lists[i], MUIA_Listview_DragType, value ?
486 MUIV_Listview_DragType_Immediate : MUIV_Listview_DragType_None);
489 static void ListSetShowDropMarks(void)
491 UWORD i;
492 LONG value = 0;
494 i = XGET(list.list_radios, MUIA_Radio_Active);
496 GET(list.showdropmarks_check, MUIA_Selected, &value);
497 SET(list.lists[i], MUIA_List_ShowDropMarks, value);
500 static void ListSetMultiTest(void)
502 UWORD i;
503 LONG value = 0;
505 i = XGET(list.list_radios, MUIA_Radio_Active);
507 GET(list.multitest_check, MUIA_Selected, &value);
508 SET(list.lists[i], MUIA_List_MultiTestHook, value ? &hook_multitest : NULL);
509 list.has_multitest[i] = value;
512 static void ListSetQuiet(void)
514 UWORD i;
515 LONG value = 0;
517 i = XGET(list.list_radios, MUIA_Radio_Active);
519 GET(list.quiet_check, MUIA_Selected, &value);
520 SET(list.lists[i], MUIA_List_Quiet, value);
521 list.quiet[i] = value;
524 static void ListSetDragSortable(void)
526 UWORD i;
527 LONG value = 0;
529 i = XGET(list.list_radios, MUIA_Radio_Active);
531 GET(list.dragsortable_check, MUIA_Selected, &value);
532 SET(list.lists[i], MUIA_List_DragSortable, value);
535 static void ListSetAutoVisible(void)
537 UWORD i;
538 LONG value = 0;
540 i = XGET(list.list_radios, MUIA_Radio_Active);
542 GET(list.autovisible_check, MUIA_Selected, &value);
543 SET(list.lists[i], MUIA_List_AutoVisible, value);
546 static void ListReset(void)
548 UWORD i;
550 i = XGET(list.list_radios, MUIA_Radio_Active);
552 SET(list.lists[i], MUIA_List_Active, list_active_positions[i]);
555 static void ListMove(void)
557 LONG mode, pos1, pos2;
558 UWORD i;
560 i = XGET(list.list_radios, MUIA_Radio_Active);
562 mode = XGET(list.move1_cycle, MUIA_Cycle_Active);
564 if (mode == 0)
565 pos1 = XGET(list.index1_string, MUIA_String_Integer);
566 else
567 pos1 = 1 - mode;
569 mode = XGET(list.move2_cycle, MUIA_Cycle_Active);
571 if (mode == 0)
572 pos2 = XGET(list.index2_string, MUIA_String_Integer);
573 else
574 pos2 = 1 - mode;
576 DoMethod(list.lists[i], MUIM_List_Move, pos1, pos2);
579 static void ListSort(void)
581 UWORD i;
583 i = XGET(list.list_radios, MUIA_Radio_Active);
585 DoMethod(list.lists[i], MUIM_List_Sort);
588 static void ListEnable(void)
590 UWORD i;
592 i = XGET(list.list_radios, MUIA_Radio_Active);
594 SET(list.lists[i], MUIA_Disabled, FALSE);
597 static void ListExchange(void)
599 LONG mode, pos1, pos2;
600 UWORD i;
602 i = XGET(list.list_radios, MUIA_Radio_Active);
604 mode = XGET(list.move1_cycle, MUIA_Cycle_Active);
606 if (mode == 0)
607 pos1 = XGET(list.index1_string, MUIA_String_Integer);
608 else
609 pos1 = 1 - mode;
611 mode = XGET(list.move2_cycle, MUIA_Cycle_Active);
613 if (mode == 0)
614 pos2 = XGET(list.index2_string, MUIA_String_Integer);
615 else
616 pos2 = 1 - mode;
618 DoMethod(list.lists[i], MUIM_List_Exchange, pos1, pos2);
621 static void ListJump(void)
623 LONG mode, pos;
624 UWORD i;
626 i = XGET(list.list_radios, MUIA_Radio_Active);
628 mode = XGET(list.jump_cycle, MUIA_Cycle_Active);
630 if (mode == 0)
631 pos = XGET(list.index1_string, MUIA_String_Integer);
632 else
633 pos = 1 - mode;
635 DoMethod(list.lists[i], MUIM_List_Jump, pos);
638 static void ListSelect(void)
640 LONG mode, pos;
641 UWORD i;
643 i = XGET(list.list_radios, MUIA_Radio_Active);
645 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
647 if (mode == 0)
648 pos = XGET(list.index1_string, MUIA_String_Integer);
649 else
650 pos = 0 - mode;
652 DoMethod(list.lists[i], MUIM_List_Select, pos, MUIV_List_Select_On,
653 NULL);
656 static void ListDeselect(void)
658 LONG mode, pos;
659 UWORD i;
661 i = XGET(list.list_radios, MUIA_Radio_Active);
663 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
665 if (mode == 0)
666 pos = XGET(list.index1_string, MUIA_String_Integer);
667 else
668 pos = 0 - mode;
670 DoMethod(list.lists[i], MUIM_List_Select, pos, MUIV_List_Select_Off,
671 NULL);
674 static void ListToggle(void)
676 LONG mode, pos;
677 UWORD i;
679 i = XGET(list.list_radios, MUIA_Radio_Active);
681 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
683 if (mode == 0)
684 pos = XGET(list.index1_string, MUIA_String_Integer);
685 else
686 pos = 0 - mode;
688 DoMethod(list.lists[i], MUIM_List_Select, pos,
689 MUIV_List_Select_Toggle, NULL);
692 static void ListRedraw(void)
694 LONG mode, pos;
695 UWORD i;
697 i = XGET(list.list_radios, MUIA_Radio_Active);
699 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
701 if (mode == 0)
702 pos = XGET(list.index1_string, MUIA_String_Integer);
703 else
704 pos = 0 - mode;
706 DoMethod(list.lists[i], MUIM_List_Redraw, pos);
709 static void ListInsertSingle(void)
711 LONG mode, pos;
712 UWORD i;
714 i = XGET(list.list_radios, MUIA_Radio_Active);
716 mode = XGET(list.insert_cycle, MUIA_Cycle_Active);
718 if (mode == 0)
719 pos = XGET(list.index1_string, MUIA_String_Integer);
720 else
721 pos = 1 - mode;
723 DoMethod(list.lists[i], MUIM_List_InsertSingle, "Tomato", pos);
726 static void ListInsert(void)
728 LONG mode, pos;
729 UWORD i;
731 i = XGET(list.list_radios, MUIA_Radio_Active);
733 mode = XGET(list.insert_cycle, MUIA_Cycle_Active);
735 if (mode == 0)
736 pos = XGET(list.index1_string, MUIA_String_Integer);
737 else
738 pos = 1 - mode;
740 DoMethod(list.lists[i], MUIM_List_Insert, fruits, -1, pos);
743 static void ListRemove(void)
745 LONG mode, pos, count, j, *selections;
746 UWORD i;
748 i = XGET(list.list_radios, MUIA_Radio_Active);
750 mode = XGET(list.remove_cycle, MUIA_Cycle_Active);
752 if (mode == 5)
754 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
755 This doesn't work as expected in MUI or Zune */
756 pos = MUIV_List_NextSelected_Start - 1;
757 while (pos != MUIV_List_NextSelected_End)
759 if (pos == MUIV_List_NextSelected_Start - 1)
760 pos++;
761 DoMethod(list.lists[i], MUIM_List_NextSelected, (IPTR) &pos);
762 if (pos != MUIV_List_NextSelected_End)
763 DoMethod(list.lists[i], MUIM_List_Remove, pos);
766 else if (mode == 6)
768 /* Remove selected entries safely by first retrieving them with
769 MUIM_List_NextSelected and then removing them one by one */
770 DoMethod(list.lists[i], MUIM_List_Select, MUIV_List_Select_All,
771 MUIV_List_Select_Ask, &count);
772 if (count == 0)
773 count = 1; /* There may still be an active entry */
774 selections = AllocVec(sizeof(LONG) * count, MEMF_ANY);
775 if (selections != NULL)
777 pos = MUIV_List_NextSelected_Start;
778 for (j = 0; j < count; j++)
780 DoMethod(list.lists[i], MUIM_List_NextSelected, (IPTR) &pos);
781 selections[j] = pos;
784 /* We must remove the entries in reverse order; otherwise the
785 later indices will become invalid */
786 while (count > 0)
787 DoMethod(list.lists[i], MUIM_List_Remove, selections[--count]);
788 FreeVec(selections);
791 else
793 if (mode == 0)
794 pos = XGET(list.index1_string, MUIA_String_Integer);
795 else
796 pos = 1 - mode;
797 DoMethod(list.lists[i], MUIM_List_Remove, pos);
801 static void ListClear(void)
803 UWORD i;
805 i = XGET(list.list_radios, MUIA_Radio_Active);
807 DoMethod(list.lists[i], MUIM_List_Clear);
810 static void ListActivate(void)
812 LONG mode, pos;
813 UWORD i;
815 i = XGET(list.list_radios, MUIA_Radio_Active);
817 mode = XGET(list.activate_cycle, MUIA_Cycle_Active);
819 if (mode == 0)
820 pos = XGET(list.index1_string, MUIA_String_Integer);
821 else
822 pos = -1 - mode;
824 SET(list.lists[i], MUIA_List_Active, pos);
827 static void ListDeactivate(void)
829 UWORD i;
831 i = XGET(list.list_radios, MUIA_Radio_Active);
833 SET(list.lists[i], MUIA_List_Active, MUIV_List_Active_Off);
836 static void CheckListDoubleClick(void)
838 LONG value = -1;
840 GET(list.multi_lists[1], MUIA_Listview_DoubleClick, &value);
841 MUI_Request(app, wnd, 0, "Test", "OK",
842 "MUIA_Listview_Doubleclick = %ld", value);
845 AROS_UFH3(static APTR, ListConstructHook,
846 AROS_UFHA(struct Hook *, h, A0),
847 AROS_UFHA(APTR, pool, A2),
848 AROS_UFHA(IPTR, n, A1))
850 AROS_USERFUNC_INIT
852 struct list_entry *entry;
854 entry = AllocPooled(pool, sizeof(struct list_entry) + 40);
856 if (entry != NULL)
858 entry->column1 = (char *)(entry + 1);
859 entry->column2 = entry->column1 + 20;
860 sprintf(entry->column1, "Entry%ld", (long)n);
861 sprintf(entry->column2, "Col2: Entry%ld", (long)n);
864 return entry;
866 AROS_USERFUNC_EXIT
869 AROS_UFH3(static void, ListDestructHook,
870 AROS_UFHA(struct Hook *, h, A0),
871 AROS_UFHA(APTR, pool, A2),
872 AROS_UFHA(struct list_entry *, entry, A1))
874 AROS_USERFUNC_INIT
876 FreePooled(pool, entry, sizeof(struct list_entry) + 40);
877 list.destruct_count++;
879 AROS_USERFUNC_EXIT
882 AROS_UFH3(static void, display_function,
883 AROS_UFHA(struct Hook *, h, A0),
884 AROS_UFHA(char **, strings, A2),
885 AROS_UFHA(struct list_entry *, entry, A1))
887 AROS_USERFUNC_INIT
889 static char buf[100];
891 if (entry)
893 if (XGET(list.showimage_check, MUIA_Selected))
894 sprintf(buf, "%ld \33O[%08lx]", (long)*(strings - 1),
895 (long)list.image);
896 else
897 sprintf(buf, "%ld", (long)*(strings - 1));
898 strings[0] = buf;
899 strings[1] = entry->column1;
900 strings[2] = entry->column2;
902 else
904 strings[0] = "Number";
905 strings[1] = "Column 1";
906 strings[2] = "Column 2";
909 AROS_USERFUNC_EXIT
912 static void Save(void)
914 char *text = (char *)XGET(editor_text, MUIA_String_Contents);
915 char *filename = (char *)XGET(filename_string, MUIA_String_Contents);
916 BPTR fh;
918 if (!strlen(filename))
919 return;
921 if ((fh = Open(filename, MODE_NEWFILE)))
923 Write(fh, text, strlen(text));
924 Close(fh);
928 #if defined(TEST_ICONLIST)
929 /* IconList callbacks */
930 static void volume_doubleclicked(void)
932 char buf[200];
933 struct IconList_Entry *ent = (void *)MUIV_IconList_NextIcon_Start;
935 DoMethod(volume_iconlist, MUIM_IconList_NextIcon,
936 MUIV_IconList_NextIcon_Selected, &ent);
937 if ((IPTR) ent == MUIV_IconList_NextIcon_End)
938 return;
940 strcpy(buf, ent->label);
941 strcat(buf, ":");
944 static void drawer_doubleclicked(void)
946 struct IconList_Entry *ent = (void *)MUIV_IconList_NextIcon_Start;
948 DoMethod(drawer_iconlist, MUIM_IconList_NextIcon,
949 MUIV_IconList_NextIcon_Selected, &ent);
950 if ((IPTR) ent == MUIV_IconList_NextIcon_End)
951 return;
952 set(drawer_iconlist, MUIA_IconDrawerList_Drawer,
953 ent->ile_IconEntry->ie_IconNode.ln_Name);
955 #endif
957 static IPTR create_balance_column(void)
959 return (IPTR) VGroup,
960 Child, RectangleObject,
961 GaugeFrame,
962 End,
963 Child, BalanceObject,
964 End,
965 Child, RectangleObject,
966 GaugeFrame,
967 End,
968 Child, BalanceObject,
969 End,
970 Child, RectangleObject,
971 GaugeFrame,
972 End,
973 Child, BalanceObject,
974 End,
975 Child, RectangleObject,
976 GaugeFrame,
977 End,
978 Child, BalanceObject,
979 End,
980 Child, RectangleObject,
981 GaugeFrame,
982 End,
983 End;
986 /* The custom class */
988 struct DropText_Data
990 ULONG times;
993 #ifdef __MAXON__
994 #undef KeymapBase
995 struct Library *KeymapBase;
996 #endif
998 #ifndef __AROS__
999 __saveds __asm IPTR dispatcher(register __a0 struct IClass *cl,
1000 register __a2 Object *obj, register __a1 Msg msg)
1001 #else
1002 AROS_UFH3S(IPTR, dispatcher,
1003 AROS_UFHA(Class *, cl, A0),
1004 AROS_UFHA(Object *, obj, A2), AROS_UFHA(Msg, msg, A1))
1005 #endif
1007 AROS_USERFUNC_INIT
1009 switch (msg->MethodID)
1011 case MUIM_DragQuery:
1012 return MUIV_DragQuery_Accept;
1013 case MUIM_DragDrop:
1015 struct DropText_Data *data =
1016 (struct DropText_Data *)INST_DATA(cl, obj);
1017 char buf[100];
1018 data->times++;
1019 sprintf(buf, "%ld times", (long)data->times);
1020 set(obj, MUIA_Text_Contents, buf);
1024 return DoSuperMethodA(cl, obj, (Msg) msg);
1026 AROS_USERFUNC_EXIT
1029 static struct MUI_CustomClass *CL_DropText;
1031 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
1033 /* Main prog */
1035 AROS_UFH3S(void, hook_func_standard,
1036 AROS_UFHA(struct Hook *, h, A0),
1037 AROS_UFHA(void *, dummy, A2), AROS_UFHA(void **, funcptr, A1))
1039 AROS_USERFUNC_INIT
1041 void (*func) (ULONG *) = (void (*)(ULONG *))(*funcptr);
1043 if (func)
1044 func((ULONG *) funcptr + 1);
1046 AROS_USERFUNC_EXIT
1049 int main(void)
1051 APTR pool;
1052 Object *second_wnd;
1053 Object *open_button;
1054 Object *about_button;
1055 Object *quit_button;
1056 Object *repeat_button;
1057 Object *objects_button;
1058 Object *about_item, *quit_item;
1059 Object *context_menu;
1060 Object *popobject, *listview;
1061 Object *numerics[NUMERIC_COUNT];
1062 Object *min_string, *max_string;
1063 Object *slider_button;
1064 Object *country_radio[2];
1065 CONST_STRPTR title;
1066 UWORD i;
1067 LONG value = 0;
1069 static char *pages[] =
1070 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
1071 "Numeric", "Radio",
1072 #if defined(TEST_ICONLIST)
1073 "Icon List",
1074 #endif
1075 "Balancing", NULL};
1076 static char *text_pages[] =
1077 {"Text", "String", NULL};
1078 static char *color_pages[] =
1079 {"Palette", "Colors", "Pens", NULL};
1080 static char *list_pages[] =
1081 {"Single Column", "Multicolumn", NULL};
1082 static char **radio_entries1 = pages;
1083 static char *radio_entries2[] =
1084 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL};
1086 static IPTR entries[] = {1, 2, 3, 4, 5, 6, (IPTR)NULL};
1088 hook_standard.h_Entry = (HOOKFUNC) hook_func_standard;
1089 hook_objstr.h_Entry = (HOOKFUNC) ObjStrHook;
1091 pool = CreatePool(MEMF_ANY, 4096, 4096);
1093 MUIMasterBase = (struct Library *)OpenLibrary("muimaster.library", 0);
1095 hook.h_Entry = (HOOKFUNC) repeat_function;
1096 hook_wheel.h_Entry = (HOOKFUNC) wheel_function;
1097 hook_slider.h_Entry = (HOOKFUNC) slider_function;
1098 hook_objects.h_Entry = (HOOKFUNC) objects_function;
1099 hook_compare.h_Entry = (HOOKFUNC) ListCompareHook;
1100 hook_multitest.h_Entry = (HOOKFUNC) ListMultiTestHook;
1101 hook_construct.h_Entry = (HOOKFUNC) ListConstructHook;
1102 hook_destruct.h_Entry = (HOOKFUNC) ListDestructHook;
1103 hook_display.h_Entry = (HOOKFUNC) display_function;
1104 list.destruct_count = 0;
1105 list.has_multitest[3] = TRUE;
1107 context_menu = MenustripObject,
1108 MUIA_Family_Child, MenuObject,
1109 MUIA_Menu_Title, "Menutest",
1110 MUIA_Family_Child, about_item = MenuitemObject,
1111 MUIA_Menuitem_Title, "First Test Entry", End,
1112 MUIA_Family_Child, quit_item = MenuitemObject,
1113 MUIA_Menuitem_Title, "Second Test Entry", End,
1114 End,
1115 End;
1117 /* should check the result in a real program! */
1118 CL_DropText = MUI_CreateCustomClass(NULL, MUIC_Text, NULL,
1119 sizeof(struct DropText_Data), dispatcher);
1120 ColorWheelBase = OpenLibrary("gadgets/colorwheel.gadget", 0);
1122 pendisplay = PendisplayObject, MUIA_Pendisplay_Spec, &default_penspec, End;
1124 title = StrDup("Fruits");
1125 list.lists[0] = ListviewObject,
1126 MUIA_Listview_List,
1127 ListObject,
1128 InputListFrame,
1129 MUIA_List_Title, title,
1130 MUIA_List_SourceArray, fruits,
1131 MUIA_List_Active, MUIV_List_Active_Top,
1132 MUIA_List_PoolThreshSize, 256,
1133 MUIA_List_DragSortable, TRUE,
1134 MUIA_List_CompareHook, &hook_compare,
1135 MUIA_ShortHelp,
1136 "Default scroller\nTop entry active\nSorted by length",
1137 End,
1138 MUIA_Listview_MultiSelect,
1139 MUIV_Listview_MultiSelect_None,
1140 MUIA_Listview_DragType, MUIV_Listview_DragType_Immediate,
1141 MUIA_Listview_DoubleClick, TRUE,
1142 MUIA_CycleChain, 1,
1143 End;
1144 list.lists[1] = ListviewObject,
1145 MUIA_Listview_List,
1146 ListObject,
1147 InputListFrame,
1148 MUIA_List_SourceArray, fruits,
1149 MUIA_List_Active, MUIV_List_Active_Bottom,
1150 MUIA_List_PoolPuddleSize, 512,
1151 MUIA_List_AutoVisible, TRUE,
1152 MUIA_ShortHelp,
1153 "Left scroller\nBottom entry active\nSorted alphabetically",
1154 End,
1155 MUIA_Listview_ScrollerPos,
1156 MUIV_Listview_ScrollerPos_Left,
1157 MUIA_Listview_DragType, MUIV_Listview_DragType_None,
1158 MUIA_CycleChain, 1,
1159 End;
1160 list.lists[2] = ListviewObject,
1161 MUIA_Listview_List,
1162 ListObject,
1163 InputListFrame,
1164 MUIA_List_SourceArray, fruits,
1165 MUIA_List_Active, MUIV_List_Active_Off,
1166 MUIA_List_Pool, pool,
1167 MUIA_ShortHelp,
1168 "Right scroller\nNo active entry\nSorted alphabetically",
1169 End,
1170 MUIA_Listview_MultiSelect,
1171 MUIV_Listview_MultiSelect_Shifted,
1172 MUIA_Listview_ScrollerPos,
1173 MUIV_Listview_ScrollerPos_Right,
1174 MUIA_CycleChain, 1,
1175 End;
1176 list.lists[3] = ListviewObject,
1177 MUIA_Listview_List,
1178 ListObject,
1179 InputListFrame,
1180 MUIA_List_SourceArray, fruits,
1181 MUIA_List_Pool, NULL,
1182 MUIA_List_MultiTestHook, &hook_multitest,
1183 MUIA_ShortHelp,
1184 "No scroller\nDefault active entry\nSorted alphabetically",
1185 End,
1186 MUIA_Listview_MultiSelect,
1187 MUIV_Listview_MultiSelect_Always,
1188 MUIA_Listview_ScrollerPos,
1189 MUIV_Listview_ScrollerPos_None,
1190 MUIA_CycleChain, 1,
1191 End;
1192 list.lists[4] = ListviewObject,
1193 MUIA_Listview_List,
1194 ListObject,
1195 ReadListFrame,
1196 MUIA_List_SourceArray, fruits,
1197 MUIA_List_Active, MUIV_List_Active_Bottom,
1198 MUIA_List_MinLineHeight, 20,
1199 MUIA_ShortHelp,
1200 "Default scroller\nBottom entry active\nSorted by length",
1201 End,
1202 MUIA_Listview_Input, FALSE,
1203 MUIA_CycleChain, 1,
1204 End;
1206 list.colorfield = ColorfieldObject,
1207 MUIA_Colorfield_RGB, default_color,
1208 End;
1210 app = ApplicationObject,
1211 MUIA_Application_Menustrip, MenustripObject,
1212 MUIA_Family_Child, MenuObject,
1213 MUIA_Menu_Title, "Project",
1214 MUIA_Family_Child, about_item = MenuitemObject,
1215 MUIA_Menuitem_Title, "About...",
1216 MUIA_Menuitem_Shortcut, "?",
1217 End,
1218 MUIA_Family_Child, MenuitemObject,
1219 MUIA_Menuitem_Title, (SIPTR)-1,
1220 End,
1221 MUIA_Family_Child, quit_item = MenuitemObject,
1222 MUIA_Menuitem_Title, "Quit",
1223 MUIA_Menuitem_Shortcut, "Q",
1224 End,
1225 End,
1226 End,
1228 SubWindow, wnd = WindowObject,
1229 MUIA_Window_Title, "test",
1230 MUIA_Window_Activate, TRUE,
1232 WindowContents, VGroup,
1233 Child, RegisterGroup(pages),
1234 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1236 /* general */
1237 Child, VGroup,
1238 Child, HGroup,
1239 GroupFrameT("A horizontal group"),
1240 Child, ColGroup(2),
1241 GroupFrameT("A column group"),
1242 Child, repeat_button = TextObject,
1243 MUIA_CycleChain, 1,
1244 ButtonFrame,
1245 MUIA_Background, MUII_ButtonBack,
1246 MUIA_Text_PreParse, "\33c",
1247 MUIA_Text_Contents, "Repeat",
1248 MUIA_InputMode, MUIV_InputMode_RelVerify,
1249 End,
1250 Child, TextObject,
1251 MUIA_CycleChain, 1,
1252 ButtonFrame,
1253 MUIA_Background, MUII_ButtonBack,
1254 MUIA_Text_PreParse, "\33c",
1255 MUIA_Text_Contents, "Drag Me",
1256 MUIA_Draggable, TRUE,
1257 MUIA_InputMode, MUIV_InputMode_RelVerify,
1258 End,
1259 Child, open_button = TextObject,
1260 MUIA_CycleChain, 1,
1261 ButtonFrame,
1262 MUIA_Background, MUII_ButtonBack,
1263 MUIA_Text_PreParse, "\33c",
1264 MUIA_Text_Contents, "Open Window",
1265 MUIA_InputMode, MUIV_InputMode_RelVerify,
1266 End,
1267 Child, TextObject,
1268 MUIA_ContextMenu, context_menu,
1269 MUIA_CycleChain, 1,
1270 ButtonFrame,
1271 MUIA_Background, MUII_ButtonBack,
1272 MUIA_Text_PreParse, "\33c",
1273 MUIA_Text_Contents, "Press Right",
1274 MUIA_InputMode, MUIV_InputMode_RelVerify,
1275 End,
1276 Child, objects_button = TextObject,
1277 MUIA_CycleChain, 1,
1278 ButtonFrame,
1279 MUIA_Background, MUII_ButtonBack,
1280 MUIA_Text_PreParse, "\33c",
1281 MUIA_Text_Contents, "Add Objects",
1282 MUIA_InputMode, MUIV_InputMode_RelVerify,
1283 End,
1284 Child, HVSpace,
1285 Child, HGroup,
1286 Child, HVSpace,
1287 Child, MUI_MakeObject(MUIO_Checkmark,
1288 "_Checkmark"),
1289 End,
1290 Child, HGroup,
1291 Child, MUI_MakeObject(MUIO_Label,
1292 "_Checkmark", 0),
1293 Child, HVSpace,
1294 End,
1295 Child, HVSpace,
1296 Child, HVSpace,
1297 End,
1298 Child, group = VGroup,
1299 GroupFrameT("A vertical group"),
1300 Child, DropTextObject,
1301 MUIA_Dropable, TRUE,
1302 MUIA_CycleChain, 1,
1303 ButtonFrame,
1304 MUIA_Background, MUII_ButtonBack,
1305 MUIA_Text_PreParse, "\33c",
1306 MUIA_Text_Contents, "Drop Here",
1307 MUIA_Dropable, TRUE,
1308 MUIA_InputMode, MUIV_InputMode_RelVerify,
1309 End,
1310 Child, TextObject,
1311 TextFrame,
1312 MUIA_Background, MUII_MARKHALFSHINE,
1313 MUIA_CycleChain, 1,
1314 MUIA_Text_PreParse, "\33c",
1315 MUIA_Text_Contents, "Pattern",
1316 End,
1317 Child, MUI_NewObject(MUIC_Popimage, TAG_DONE),
1318 End,
1319 Child, ScrollgroupObject,
1320 GroupFrameT("A scroll group"),
1321 MUIA_Scrollgroup_Contents, VGroupV,
1322 VirtualFrame,
1323 Child, TextObject,
1324 TextFrame,
1325 MUIA_Text_Contents,
1326 "Line1\nLine2\nLine3\nLine4\n"
1327 "Line5\nLine6\nLine7\nLine8\n"
1328 "\n\n\n"
1329 "Line9\nLine10\nLine11\n",
1330 End,
1331 Child, HGroup,
1332 Child, MUI_MakeObject(MUIO_Button,
1333 "Button9"),
1334 Child, MUI_MakeObject(MUIO_Button,
1335 "Button10"),
1336 End,
1337 End,
1338 End,
1339 End,
1340 Child, popobject = PopobjectObject,
1341 MUIA_Popstring_String,
1342 MUI_MakeObject(MUIO_String, NULL, 200),
1343 MUIA_Popstring_Button, PopButton(MUII_PopUp),
1344 MUIA_Popobject_Object, VGroup,
1345 Child, TextObject,
1346 MUIA_Text_Contents, "test",
1347 End,
1348 Child, listview = ListviewObject,
1349 MUIA_Listview_List, ListObject,
1350 InputListFrame,
1351 MUIA_List_ConstructHook,
1352 &hook_construct,
1353 MUIA_List_DestructHook,
1354 &hook_destruct,
1355 MUIA_List_DisplayHook, &hook_display,
1356 MUIA_List_Format, ",,",
1357 MUIA_List_SourceArray, entries,
1358 MUIA_List_Title, TRUE,
1359 End,
1360 End,
1361 End,
1362 MUIA_Popobject_ObjStrHook, &hook_objstr,
1363 End,
1364 Child, CycleObject,
1365 ButtonFrame,
1366 MUIA_Cycle_Entries, pages,
1367 End,
1368 Child, ScrollbarObject,
1369 MUIA_Group_Horiz, TRUE,
1370 MUIA_Prop_Visible, 100,
1371 MUIA_Prop_Entries, 300,
1372 MUIA_Prop_First, 50,
1373 End,
1374 End,
1376 /* text */
1377 Child, RegisterGroup(text_pages),
1379 Child, VGroup,
1380 Child, TextObject,
1381 MUIA_Background, "2:cfffffff,cfffffff,10000000",
1382 TextFrame,
1383 MUIA_Text_Contents, "\33cHello World!\n"
1384 "This is a text object\n\33lLeft \33bbold\33n\n"
1385 "\33rRight",
1386 End,
1387 Child, TextObject,
1388 TextFrame,
1389 /* Test for a bug with pen specifications as reported here:
1390 https://sourceforge.net/p/aros/bugs/487/
1392 MUIA_Text_Contents, "This is a \33P[3]text \33P[]object \33P[1]with pen specifications",
1393 End,
1394 Child, RectangleObject,
1395 MUIA_VertWeight, 0,
1396 /* Seems to be not supported properly as orginal MUI
1397 doesn't allow to alter the height of the window */
1398 MUIA_Rectangle_HBar, TRUE,
1399 MUIA_Rectangle_BarTitle,"Enter a string",
1400 End,
1401 Child, StringObject,
1402 StringFrame,
1403 MUIA_CycleChain,1,
1404 MUIA_String_AdvanceOnCR, TRUE,
1405 End,
1406 Child, HVSpace,
1407 End,
1409 /* string */
1410 Child, HGroup,
1411 Child, VGroup,
1412 Child, VGroup, GroupFrameT("Default Alignment"),
1413 Child, string.strings[0] = StringObject,
1414 StringFrame,
1415 MUIA_String_Accept,
1416 (IPTR)default_accept_chars,
1417 MUIA_String_Reject,
1418 (IPTR)default_reject_chars,
1419 MUIA_String_AdvanceOnCR, TRUE,
1420 MUIA_String_MaxLen, 9,
1421 MUIA_CycleChain, 1,
1422 MUIA_String_AttachedList, list.lists[0],
1423 End,
1424 End,
1425 Child, VGroup, GroupFrameT("Left Aligned"),
1426 Child, string.strings[1] = StringObject,
1427 StringFrame,
1428 MUIA_String_Accept,
1429 (IPTR)default_accept_chars,
1430 MUIA_String_Reject,
1431 (IPTR)default_reject_chars,
1432 MUIA_String_Format,
1433 MUIV_String_Format_Left,
1434 MUIA_String_AdvanceOnCR, TRUE,
1435 MUIA_String_MaxLen, 9,
1436 MUIA_CycleChain, 1,
1437 MUIA_String_Contents,
1438 (IPTR)default_accept_chars,
1439 MUIA_String_BufferPos, 3,
1440 MUIA_String_AttachedList, list.lists[0],
1441 End,
1442 End,
1443 Child, VGroup, GroupFrameT("Right Aligned"),
1444 Child, string.strings[2] = StringObject,
1445 StringFrame,
1446 MUIA_String_Accept,
1447 (IPTR)default_accept_chars,
1448 MUIA_String_Reject,
1449 (IPTR)default_reject_chars,
1450 MUIA_String_Format,
1451 MUIV_String_Format_Right,
1452 MUIA_String_AdvanceOnCR, TRUE,
1453 MUIA_String_MaxLen, 9,
1454 MUIA_CycleChain, 1,
1455 MUIA_String_AttachedList, list.lists[0],
1456 End,
1457 End,
1458 Child, VGroup, GroupFrameT("Centered"),
1459 Child, string.strings[3] = StringObject,
1460 StringFrame,
1461 MUIA_String_Accept,
1462 (IPTR)default_accept_chars,
1463 MUIA_String_Reject,
1464 (IPTR)default_reject_chars,
1465 MUIA_String_Format,
1466 MUIV_String_Format_Center,
1467 MUIA_String_AdvanceOnCR, TRUE,
1468 MUIA_String_MaxLen, 9,
1469 MUIA_CycleChain, 1,
1470 MUIA_String_Integer, 123,
1471 MUIA_String_AttachedList, list.lists[0],
1472 End,
1473 End,
1474 Child, VGroup, GroupFrameT("Secret"),
1475 Child, string.strings[4] = StringObject,
1476 StringFrame,
1477 MUIA_String_Accept,
1478 (IPTR)default_accept_chars,
1479 MUIA_String_Reject,
1480 (IPTR)default_reject_chars,
1481 MUIA_String_Format,
1482 MUIV_String_Format_Center,
1483 MUIA_String_Secret, TRUE,
1484 MUIA_String_AdvanceOnCR, TRUE,
1485 MUIA_String_MaxLen, 9,
1486 MUIA_CycleChain, 1,
1487 MUIA_String_AttachedList, list.lists[0],
1488 End,
1489 End,
1490 Child, HGroup, GroupFrameT("Narrow"),
1491 Child, HVSpace,
1492 Child, string.strings[5] = StringObject,
1493 StringFrame,
1494 MUIA_String_Accept,
1495 (IPTR)default_accept_chars,
1496 MUIA_String_Reject,
1497 (IPTR)default_reject_chars,
1498 MUIA_String_Format,
1499 MUIV_String_Format_Center,
1500 MUIA_String_AdvanceOnCR, TRUE,
1501 MUIA_MaxWidth, 20,
1502 MUIA_String_MaxLen, 9,
1503 MUIA_CycleChain, 1,
1504 MUIA_String_AttachedList, list.lists[0],
1505 End,
1506 Child, HVSpace,
1507 End,
1508 Child, HVSpace,
1509 End,
1510 Child, VGroup, GroupFrameT("Controls"),
1511 Child, HGroup,
1512 Child, string.accept_all_check =
1513 MUI_MakeObject(MUIO_Checkmark, NULL),
1514 Child, MUI_MakeObject(MUIO_Label,
1515 "Accept all characters", 0),
1516 Child, HVSpace,
1517 End,
1518 Child, ColGroup(2),
1519 Child, MUI_MakeObject(MUIO_Label,
1520 "Acceptable characters:", 0),
1521 Child, string.accept_string = StringObject,
1522 StringFrame,
1523 MUIA_String_Contents,
1524 (IPTR)default_accept_chars,
1525 End,
1526 Child, MUI_MakeObject(MUIO_Label,
1527 "Unacceptable characters:", 0),
1528 Child, string.reject_string = StringObject,
1529 StringFrame,
1530 End,
1531 Child, MUI_MakeObject(MUIO_Label,
1532 "Cursor position:", 0),
1533 Child, string.cursor_pos_slider =
1534 SliderObject,
1535 MUIA_Group_Horiz, TRUE,
1536 MUIA_Numeric_Min, 0,
1537 End,
1538 Child, MUI_MakeObject(MUIO_Label,
1539 "Display position:", 0),
1540 Child, string.display_pos_slider =
1541 SliderObject,
1542 MUIA_Group_Horiz, TRUE,
1543 MUIA_Numeric_Min, 0,
1544 End,
1545 Child, MUI_MakeObject(MUIO_Label,
1546 "Integer value:", 0),
1547 Child, string.integer_string =
1548 StringObject,
1549 StringFrame,
1550 MUIA_String_Accept, (IPTR)digits,
1551 End,
1552 Child, MUI_MakeObject(MUIO_Label,
1553 "Plaintext:", 0),
1554 Child, string.plaintext_string =
1555 StringObject,
1556 StringFrame,
1557 End,
1558 Child, MUI_MakeObject(MUIO_Label,
1559 "Maximum string length:", 0),
1560 Child, string.max_len_text = TextObject,
1561 TextFrame,
1562 MUIA_Text_Contents, "Unknown",
1563 End,
1564 End,
1565 Child, VGroup,
1566 Child, HGroup,
1567 Child, string.cr_advance_check =
1568 MUI_MakeObject(MUIO_Checkmark,
1569 NULL),
1570 Child, MUI_MakeObject(MUIO_Label,
1571 "Advance on CR", 0),
1572 Child, HVSpace,
1573 End,
1574 Child, HGroup,
1575 Child, string.attach_list_check =
1576 MUI_MakeObject(MUIO_Checkmark,
1577 NULL),
1578 Child, MUI_MakeObject(MUIO_Label,
1579 "Attach list", 0),
1580 Child, HVSpace,
1581 End,
1582 #if 0
1583 Child, HGroup,
1584 Child, string.standard_hook_check =
1585 MUI_MakeObject(MUIO_Checkmark,
1586 NULL),
1587 Child, MUI_MakeObject(MUIO_Label,
1588 "Use standard edit hook", 0),
1589 Child, HVSpace,
1590 End,
1591 Child, HGroup,
1592 Child, string.custom_hook_check =
1593 MUI_MakeObject(MUIO_Checkmark,
1594 NULL),
1595 Child, MUI_MakeObject(MUIO_Label,
1596 "Use custom edit hook", 0),
1597 Child, HVSpace,
1598 End,
1599 #endif
1600 End,
1601 Child, HVSpace,
1602 End,
1604 End,
1605 End,
1607 /* boopsi */
1608 Child, VGroup,
1609 Child, wheel = BoopsiObject, /* MUI/Boopsi tags mixed */
1610 GroupFrame,
1611 /* boopsi objects don't know */
1612 /* their sizes, so we help */
1613 /* keep important values */
1614 /* during window resize */
1615 MUIA_Boopsi_ClassID, "colorwheel.gadget",
1616 MUIA_Boopsi_MinWidth , 30,
1617 MUIA_Boopsi_MinHeight, 30,
1618 MUIA_Boopsi_Remember , WHEEL_Saturation,
1619 MUIA_Boopsi_Remember , WHEEL_Hue,
1620 /* this magic fills in the screen pointer */
1621 MUIA_Boopsi_TagScreen, WHEEL_Screen,
1622 WHEEL_Screen, NULL,
1623 GA_Left, 0,
1624 GA_Top, 0, /* MUI will automatically */
1625 GA_Width, 0, /* fill in the correct values */
1626 GA_Height, 0,
1627 ICA_TARGET, ICTARGET_IDCMP,
1628 /* needed for notification */
1629 WHEEL_Saturation, 0, /* start in the center */
1630 MUIA_FillArea, TRUE,
1631 /* use this because it defaults to FALSE
1632 for boopsi gadgets but the colorwheel
1633 doesn't bother about redrawing its
1634 background */
1635 End,
1637 Child, r_slider = SliderObject,
1638 MUIA_Group_Horiz, TRUE,
1639 MUIA_Numeric_Min, 0,
1640 MUIA_Numeric_Max, 255,
1641 End,
1642 Child, g_slider = SliderObject,
1643 MUIA_Group_Horiz, TRUE,
1644 MUIA_Numeric_Min, 0,
1645 MUIA_Numeric_Max, 255,
1646 End,
1647 Child, b_slider = SliderObject,
1648 MUIA_Group_Horiz, TRUE,
1649 MUIA_Numeric_Min, 0,
1650 MUIA_Numeric_Max, 255,
1651 End,
1652 Child, hue_gauge = GaugeObject,
1653 GaugeFrame,
1654 MUIA_Gauge_Horiz, TRUE,
1655 MUIA_Gauge_Max, 255,
1656 MUIA_Gauge_Divide, 1<<24,
1657 MUIA_Gauge_InfoText, "Hue: %ld",
1658 End,
1659 End,
1661 /* color */
1662 Child, RegisterGroup(color_pages),
1663 Child, VGroup, GroupFrameT("Palette"),
1664 Child, PaletteObject,
1665 End,
1666 End,
1667 Child, HGroup,
1668 Child, VGroup, GroupFrameT("Colorfield"),
1670 Child, HGroup,
1671 Child, colorfield = ColorfieldObject,
1672 MUIA_Colorfield_RGB, default_color,
1673 MUIA_Colorfield_Pen, 253,
1674 End,
1675 Child, colorfield2 = ColorfieldObject,
1676 MUIA_Colorfield_Red, default_color[0],
1677 MUIA_Colorfield_Green, default_color[1],
1678 MUIA_Colorfield_Blue, default_color[2],
1679 End,
1680 End,
1681 Child, colorfield_reset_button =
1682 MUI_MakeObject(MUIO_Button,
1683 "Reset"),
1684 Child, HGroup,
1685 Child,
1686 MUI_MakeObject(MUIO_Label, "Pen:", 0),
1687 Child, colorfield_pen = StringObject,
1688 StringFrame,
1689 End,
1690 End,
1691 End,
1692 Child, VGroup, GroupFrameT("Coloradjust"),
1693 Child, coloradjust = ColoradjustObject,
1694 MUIA_Coloradjust_RGB, default_color,
1695 End,
1696 End,
1697 End,
1698 Child, HGroup,
1699 Child, VGroup,
1700 Child, VGroup, GroupFrameT("Pendisplay"),
1701 Child, HGroup,
1702 Child, pendisplay,
1703 Child, pendisplay2 = PendisplayObject,
1704 MUIA_Pendisplay_RGBcolor,
1705 default_color,
1706 End,
1707 End,
1708 Child, ColGroup(2),
1709 Child,
1710 MUI_MakeObject(
1711 MUIO_Label, "Pen:", 0),
1712 Child, HGroup,
1713 Child, pendisplay_pen =
1714 StringObject, StringFrame,
1715 End,
1716 Child, HVSpace,
1717 Child, reference_check =
1718 MUI_MakeObject(MUIO_Checkmark,
1719 NULL),
1720 Child, MUI_MakeObject(MUIO_Label,
1721 "Reference", 0),
1722 End,
1723 Child,
1724 MUI_MakeObject(
1725 MUIO_Label, "Penspec:", 0),
1726 Child, pendisplay_spec = StringObject,
1727 StringFrame,
1728 End,
1729 End,
1730 Child, HGroup,
1731 Child, shine_button =
1732 MUI_MakeObject(MUIO_Button,
1733 "Shine"),
1734 Child, shadow_button =
1735 MUI_MakeObject(MUIO_Button,
1736 "Shadow"),
1737 Child, yellow_button =
1738 MUI_MakeObject(MUIO_Button,
1739 "Yellow"),
1740 End,
1741 End,
1742 Child, VGroup, GroupFrameT("Poppen"),
1743 Child, poppen = PoppenObject,
1744 End,
1745 End,
1746 End,
1747 Child, VGroup, GroupFrameT("Penadjust"),
1748 Child, PenadjustObject,
1749 End,
1750 End,
1751 End,
1752 End,
1754 /* edit */
1755 Child, VGroup,
1756 Child, editor_text = StringObject,
1757 StringFrame,
1758 End,
1759 Child, PopaslObject,
1760 ASLFR_DoSaveMode, TRUE,
1761 MUIA_Popstring_String, filename_string =
1762 MUI_MakeObject(MUIO_String, NULL, 200),
1763 MUIA_Popstring_Button, PopButton(MUII_PopFile),
1764 End,
1765 Child, save_button =
1766 MUI_MakeObject(MUIO_Button, "Save"),
1767 End,
1769 /* lists */
1770 Child, RegisterGroup(list_pages),
1771 Child, VGroup,
1772 Child, ColGroup(LIST_COUNT),
1773 Child, VGroup, GroupFrameT("No Multiselect"),
1774 Child, list.lists[0],
1775 End,
1776 Child, VGroup,
1777 GroupFrameT("Default Multiselect"),
1778 Child, list.lists[1],
1779 End,
1780 Child, VGroup,
1781 GroupFrameT("Shifted Multiselect"),
1782 Child, list.lists[2],
1783 End,
1784 Child, VGroup,
1785 GroupFrameT("Unconditional Multiselect"),
1786 Child, list.lists[3],
1787 End,
1788 Child, VGroup,
1789 GroupFrameT("Read Only"),
1790 Child, list.lists[4],
1791 End,
1792 End,
1793 Child, HGroup,
1794 MUIA_Group_HorizSpacing, 0,
1795 Child, RectangleObject,
1796 MUIA_HorizWeight, 1,
1797 End,
1798 Child, list.list_radios = RadioObject,
1799 MUIA_Radio_Entries, empty,
1800 MUIA_Group_Horiz, TRUE,
1801 MUIA_HorizWeight, 1000,
1802 End,
1803 Child, RectangleObject,
1804 MUIA_HorizWeight, 1,
1805 End,
1806 End,
1807 Child, RectangleObject,
1808 MUIA_VertWeight, 0,
1809 MUIA_Rectangle_HBar, TRUE,
1810 MUIA_Rectangle_BarTitle, "List Controls",
1811 End,
1812 Child, ColGroup(6),
1813 Child, MUI_MakeObject(MUIO_Label,
1814 "Affected index 1:", 0),
1815 Child, list.index1_string =
1816 StringObject,
1817 StringFrame,
1818 MUIA_String_Accept, (IPTR)digits,
1819 MUIA_String_Integer, 0,
1820 End,
1821 Child, HGroup,
1822 Child, list.draggable_check =
1823 MUI_MakeObject(MUIO_Checkmark, NULL),
1824 Child, MUI_MakeObject(MUIO_Label,
1825 "Draggable", 0),
1826 Child, HVSpace,
1827 End,
1828 Child, HGroup,
1829 Child, list.showdropmarks_check =
1830 MUI_MakeObject(MUIO_Checkmark, NULL),
1831 Child, MUI_MakeObject(MUIO_Label,
1832 "Show drop marks", 0),
1833 Child, HVSpace,
1834 End,
1835 Child, HGroup,
1836 Child, list.autovisible_check =
1837 MUI_MakeObject(MUIO_Checkmark, NULL),
1838 Child, MUI_MakeObject(MUIO_Label,
1839 "Auto visible", 0),
1840 Child, HVSpace,
1841 End,
1842 Child, list.reset_button =
1843 MUI_MakeObject(MUIO_Button, "Reset"),
1845 Child, MUI_MakeObject(MUIO_Label,
1846 "Affected index 2:", 0),
1847 Child, list.index2_string =
1848 StringObject,
1849 StringFrame,
1850 MUIA_String_Accept, (IPTR)digits,
1851 MUIA_String_Integer, 0,
1852 End,
1853 Child, HGroup,
1854 Child, list.dragsortable_check =
1855 MUI_MakeObject(MUIO_Checkmark, NULL),
1856 Child, MUI_MakeObject(MUIO_Label,
1857 "Drag sortable", 0),
1858 Child, HVSpace,
1859 End,
1860 Child, HGroup,
1861 Child, list.multitest_check =
1862 MUI_MakeObject(MUIO_Checkmark, NULL),
1863 Child, MUI_MakeObject(MUIO_Label,
1864 "Filter multiselect", 0),
1865 Child, HVSpace,
1866 End,
1867 Child, HGroup,
1868 Child, list.quiet_check =
1869 MUI_MakeObject(MUIO_Checkmark, NULL),
1870 Child, MUI_MakeObject(MUIO_Label,
1871 "Quiet", 0),
1872 Child, HVSpace,
1873 End,
1874 Child, list.enable_button =
1875 MUI_MakeObject(MUIO_Button, "Enable"),
1877 Child, MUI_MakeObject(MUIO_Label,
1878 "Move/exchange mode 1:", 0),
1879 Child, list.move1_cycle = CycleObject,
1880 ButtonFrame,
1881 MUIA_Cycle_Entries, list_move1_modes,
1882 End,
1883 Child, list.move_button =
1884 MUI_MakeObject(MUIO_Button, "Move"),
1885 Child, list.sort_button =
1886 MUI_MakeObject(MUIO_Button, "Sort"),
1887 Child, MUI_MakeObject(MUIO_Label,
1888 "Title:", 0),
1889 Child, list.title_string =
1890 StringObject,
1891 StringFrame,
1892 End,
1894 Child, MUI_MakeObject(MUIO_Label,
1895 "Move/exchange mode 2:", 0),
1896 Child, list.move2_cycle = CycleObject,
1897 ButtonFrame,
1898 MUIA_Cycle_Entries, list_move2_modes,
1899 End,
1900 Child, list.exchange_button =
1901 MUI_MakeObject(MUIO_Button, "Exchange"),
1902 Child, list.redraw_button =
1903 MUI_MakeObject(MUIO_Button, "Redraw"),
1904 Child, MUI_MakeObject(MUIO_Label,
1905 "Entries:", 0),
1906 Child, list.entries_text = TextObject,
1907 TextFrame,
1908 MUIA_Text_Contents, "N/A",
1909 End,
1911 Child, MUI_MakeObject(MUIO_Label,
1912 "Jump mode:", 0),
1913 Child, list.jump_cycle = CycleObject,
1914 ButtonFrame,
1915 MUIA_Cycle_Entries, list_jump_modes,
1916 End,
1917 Child, list.jump_button =
1918 MUI_MakeObject(MUIO_Button, "Jump"),
1919 Child, list.toggle_button =
1920 MUI_MakeObject(MUIO_Button, "Toggle"),
1921 Child, MUI_MakeObject(MUIO_Label,
1922 "Visible entries:", 0),
1923 Child, list.visible_text = TextObject,
1924 TextFrame,
1925 MUIA_Text_Contents, "N/A",
1926 End,
1928 Child, MUI_MakeObject(MUIO_Label,
1929 "Select/redraw mode:", 0),
1930 Child, list.select_cycle = CycleObject,
1931 ButtonFrame,
1932 MUIA_Cycle_Entries, list_select_modes,
1933 End,
1934 Child, list.select_button =
1935 MUI_MakeObject(MUIO_Button, "Select"),
1936 Child, list.deselect_button =
1937 MUI_MakeObject(MUIO_Button, "Deselect"),
1938 Child, MUI_MakeObject(MUIO_Label,
1939 "First visible index:", 0),
1940 Child, list.first_text = TextObject,
1941 TextFrame,
1942 MUIA_Text_Contents, "N/A",
1943 End,
1945 Child, MUI_MakeObject(MUIO_Label,
1946 "Insert mode:", 0),
1947 Child, list.insert_cycle = CycleObject,
1948 ButtonFrame,
1949 MUIA_Cycle_Entries, list_insert_modes,
1950 End,
1951 Child, list.insert_single_button =
1952 MUI_MakeObject(MUIO_Button,
1953 "Insert Single"),
1954 Child, list.insert_multiple_button =
1955 MUI_MakeObject(MUIO_Button,
1956 "Insert Multiple"),
1957 Child, MUI_MakeObject(MUIO_Label,
1958 "Last insertion index:", 0),
1959 Child, list.insert_text = TextObject,
1960 TextFrame,
1961 MUIA_Text_Contents, "N/A",
1962 End,
1964 Child, MUI_MakeObject(MUIO_Label,
1965 "Remove mode:", 0),
1966 Child, list.remove_cycle = CycleObject,
1967 ButtonFrame,
1968 MUIA_Cycle_Entries, list_remove_modes,
1969 End,
1970 Child, list.remove_button =
1971 MUI_MakeObject(MUIO_Button, "Remove"),
1972 Child, list.clear_button =
1973 MUI_MakeObject(MUIO_Button, "Clear"),
1974 Child, MUI_MakeObject(MUIO_Label,
1975 "Active index:", 0),
1976 Child, list.active_text = TextObject,
1977 TextFrame,
1978 MUIA_Text_Contents, "N/A",
1979 End,
1981 Child, MUI_MakeObject(MUIO_Label,
1982 "Activate mode:", 0),
1983 Child, list.activate_cycle = CycleObject,
1984 ButtonFrame,
1985 MUIA_Cycle_Entries, list_activate_modes,
1986 End,
1987 Child, list.activate_button =
1988 MUI_MakeObject(MUIO_Button, "Activate"),
1989 Child, list.deactivate_button =
1990 MUI_MakeObject(MUIO_Button, "Deactivate"),
1991 Child, MUI_MakeObject(MUIO_Label,
1992 "Last drop index:", 0),
1993 Child, list.drop_text = TextObject,
1994 TextFrame,
1995 MUIA_Text_Contents, "N/A",
1996 End,
1997 End,
1998 End,
1999 Child, VGroup,
2000 Child, ColGroup(LIST_COUNT / 2),
2001 Child, VGroup, GroupFrameT("Standard Format"),
2002 Child, list.multi_lists[0] = ListviewObject,
2003 MUIA_Listview_List,
2004 ListObject,
2005 InputListFrame,
2006 MUIA_List_ConstructHook,
2007 &hook_construct,
2008 MUIA_List_DestructHook,
2009 &hook_destruct,
2010 MUIA_List_DisplayHook,
2011 &hook_display,
2012 MUIA_List_Format, list_format,
2013 MUIA_List_SourceArray, entries,
2014 MUIA_List_Title, TRUE,
2015 MUIA_List_AdjustWidth, TRUE,
2016 End,
2017 MUIA_Listview_MultiSelect,
2018 MUIV_Listview_MultiSelect_None,
2019 MUIA_Listview_DefClickColumn, 1,
2020 MUIA_CycleChain, 1,
2021 End,
2022 End,
2023 Child, VGroup, GroupFrameT("Custom Format"),
2024 Child, list.multi_lists[1] = ListviewObject,
2025 MUIA_Listview_List,
2026 ListObject,
2027 InputListFrame,
2028 MUIA_List_Format, list_format,
2029 MUIA_List_Title, TRUE,
2030 MUIA_List_AdjustHeight, TRUE,
2031 End,
2032 MUIA_Listview_MultiSelect,
2033 MUIV_Listview_MultiSelect_None,
2034 MUIA_CycleChain, 1,
2035 End,
2036 Child, HVSpace,
2037 End,
2038 End,
2039 Child, RectangleObject,
2040 MUIA_VertWeight, 0,
2041 MUIA_Rectangle_HBar, TRUE,
2042 MUIA_Rectangle_BarTitle, "List Controls",
2043 End,
2044 Child, HGroup,
2045 Child, MUI_MakeObject(MUIO_Label, "Format:", 0),
2046 Child, list.format_string = StringObject,
2047 StringFrame,
2048 MUIA_CycleChain, 1,
2049 End,
2050 Child, list.showheadings_check =
2051 MUI_MakeObject(MUIO_Checkmark, NULL),
2052 Child, MUI_MakeObject(MUIO_Label,
2053 "Show column headings", 0),
2054 Child, list.showimage_check =
2055 MUI_MakeObject(MUIO_Checkmark, NULL),
2056 Child, MUI_MakeObject(MUIO_Label,
2057 "Show image", 0),
2058 End,
2059 Child, HGroup,
2060 Child, MUI_MakeObject(MUIO_Label,
2061 "Default clicked column:", 0),
2062 Child, list.def_column_string = StringObject,
2063 StringFrame,
2064 MUIA_String_Accept, (IPTR)digits,
2065 MUIA_String_Integer, -1,
2066 MUIA_CycleChain, 1,
2067 End,
2068 Child, MUI_MakeObject(MUIO_Label,
2069 "Clicked column:", 0),
2070 Child, list.column_string = StringObject,
2071 MUIA_ShowMe, FALSE,
2072 End,
2073 Child, list.column_text = TextObject,
2074 TextFrame,
2075 MUIA_Text_Contents, "N/A",
2076 End,
2077 End,
2078 End,
2079 End,
2081 /* gauges */
2082 Child, HGroup,
2083 Child, VGroup,
2084 Child, VGroup,
2085 GroupFrame,
2086 Child, GaugeObject,
2087 GaugeFrame,
2088 MUIA_Gauge_InfoText, "%ld %%",
2089 MUIA_Gauge_Horiz, TRUE,
2090 MUIA_Gauge_Current, 25,
2091 End,
2092 Child, ScaleObject,
2093 End,
2094 End,
2095 Child, VGroup,
2096 GroupFrame,
2097 Child, GaugeObject,
2098 GaugeFrame,
2099 MUIA_Gauge_InfoText, "%ld %%",
2100 MUIA_Gauge_Horiz, TRUE,
2101 MUIA_Gauge_Current, 50,
2102 End,
2103 Child, ScaleObject,
2104 End,
2105 End,
2106 Child, VGroup,
2107 GroupFrame,
2108 Child, GaugeObject,
2109 GaugeFrame,
2110 MUIA_Gauge_InfoText, "%ld %%",
2111 MUIA_Gauge_Horiz, TRUE,
2112 MUIA_Gauge_Current, 75,
2113 End,
2114 Child, ScaleObject,
2115 End,
2116 End,
2117 End,
2118 Child, HGroup,
2119 Child, HVSpace,
2120 Child, GaugeObject,
2121 GaugeFrame,
2122 MUIA_Gauge_InfoText, "%ld %%",
2123 MUIA_Gauge_Current, 25,
2124 End,
2125 Child, GaugeObject,
2126 GaugeFrame,
2127 MUIA_Gauge_InfoText, "%ld %%",
2128 MUIA_Gauge_Current, 50,
2129 End,
2130 Child, GaugeObject,
2131 GaugeFrame,
2132 MUIA_Gauge_InfoText, "%ld %%",
2133 MUIA_Gauge_Current, 75,
2134 End,
2135 Child, HVSpace,
2136 End,
2137 End,
2139 /* numeric */
2140 Child, HGroup,
2141 Child, ColGroup(2),
2142 GroupFrameT("Horizontal Sliders"),
2143 Child, MUI_MakeObject(MUIO_Label, "Normal:", 0),
2144 Child, numerics[HNSLIDER] = SliderObject,
2145 MUIA_Slider_Horiz, TRUE,
2146 MUIA_Numeric_Min, NUMERIC_MIN,
2147 MUIA_Numeric_Max, NUMERIC_MAX,
2148 MUIA_CycleChain, 1,
2149 End,
2150 Child, MUI_MakeObject(MUIO_Label, "Reverse:", 0),
2151 Child, numerics[HRSLIDER] = SliderObject,
2152 MUIA_Numeric_Reverse, TRUE,
2153 MUIA_Numeric_Min, NUMERIC_MIN,
2154 MUIA_Numeric_Max, NUMERIC_MAX,
2155 MUIA_CycleChain, 1,
2156 End,
2157 Child, MUI_MakeObject(MUIO_Label, "Quiet:", 0),
2158 Child, numerics[HQSLIDER] = SliderObject,
2159 MUIA_Slider_Quiet, TRUE,
2160 MUIA_Numeric_Min, NUMERIC_MIN,
2161 MUIA_Numeric_Max, NUMERIC_MAX,
2162 MUIA_CycleChain, 1,
2163 End,
2164 End,
2165 Child, ColGroup(3),
2166 GroupFrameT("Vertical Sliders"),
2167 Child, MUI_MakeObject(MUIO_Label, "Normal", 0),
2168 Child, MUI_MakeObject(MUIO_Label, "Reverse", 0),
2169 Child, MUI_MakeObject(MUIO_Label, "Quiet", 0),
2170 Child, numerics[VNSLIDER] = SliderObject,
2171 MUIA_Slider_Horiz, FALSE,
2172 MUIA_Numeric_Min, NUMERIC_MIN,
2173 MUIA_Numeric_Max, NUMERIC_MAX,
2174 MUIA_CycleChain, 1,
2175 End,
2176 Child, numerics[VRSLIDER] = SliderObject,
2177 MUIA_Slider_Horiz, FALSE,
2178 MUIA_Numeric_Reverse, TRUE,
2179 MUIA_Numeric_Min, NUMERIC_MIN,
2180 MUIA_Numeric_Max, NUMERIC_MAX,
2181 MUIA_CycleChain, 1,
2182 End,
2183 Child, numerics[VQSLIDER] = SliderObject,
2184 MUIA_Slider_Horiz, FALSE,
2185 MUIA_Slider_Quiet, TRUE,
2186 MUIA_Numeric_Min, NUMERIC_MIN,
2187 MUIA_Numeric_Max, NUMERIC_MAX,
2188 MUIA_CycleChain, 1,
2189 End,
2190 End,
2191 Child, ColGroup(2),
2192 GroupFrameT("Numeric Buttons"),
2193 Child, MUI_MakeObject(MUIO_Label, "Normal:", 0),
2194 Child, numerics[NNUMERICBUTTON] =
2195 NumericbuttonObject,
2196 MUIA_Numeric_Min, NUMERIC_MIN,
2197 MUIA_Numeric_Max, NUMERIC_MAX,
2198 MUIA_CycleChain, 1,
2199 End,
2200 Child, MUI_MakeObject(MUIO_Label, "Reverse:", 0),
2201 Child, numerics[RNUMERICBUTTON] =
2202 NumericbuttonObject,
2203 MUIA_Numeric_Reverse, TRUE,
2204 MUIA_Numeric_Min, NUMERIC_MIN,
2205 MUIA_Numeric_Max, NUMERIC_MAX,
2206 MUIA_CycleChain, 1,
2207 End,
2208 End,
2209 Child, ColGroup(2),
2210 GroupFrameT("Knobs"),
2211 Child, MUI_MakeObject(MUIO_Label, "Normal", 0),
2212 Child, MUI_MakeObject(MUIO_Label, "Reverse", 0),
2213 Child, numerics[NKNOB] = KnobObject,
2214 MUIA_Numeric_Min, NUMERIC_MIN,
2215 MUIA_Numeric_Max, NUMERIC_MAX,
2216 MUIA_CycleChain, 1,
2217 End,
2218 Child, numerics[RKNOB] = KnobObject,
2219 MUIA_Numeric_Reverse, TRUE,
2220 MUIA_Numeric_Min, NUMERIC_MIN,
2221 MUIA_Numeric_Max, NUMERIC_MAX,
2222 MUIA_CycleChain, 1,
2223 End,
2224 End,
2225 Child, ColGroup(2),
2226 Child, MUI_MakeObject(MUIO_Label,
2227 "Minimum Value:", 0),
2228 Child, min_string = (Object *)StringObject,
2229 StringFrame,
2230 MUIA_String_Accept, (IPTR)digits,
2231 MUIA_String_Integer, NUMERIC_MIN,
2232 MUIA_CycleChain, 1,
2233 End,
2234 Child, MUI_MakeObject(MUIO_Label,
2235 "Maximum Value:", 0),
2236 Child, max_string = (Object *)StringObject,
2237 StringFrame,
2238 MUIA_String_Accept, (IPTR)digits,
2239 MUIA_String_Integer, NUMERIC_MAX,
2240 MUIA_CycleChain, 1,
2241 End,
2242 Child, slider_button = TextObject,
2243 ButtonFrame,
2244 MUIA_InputMode, MUIV_InputMode_RelVerify,
2245 MUIA_CycleChain, 1,
2246 MUIA_Background, MUII_ButtonBack,
2247 MUIA_Text_PreParse, "\33c",
2248 MUIA_Text_Contents,
2249 "Change Slider Orientations",
2250 End,
2251 Child, MUI_MakeObject(MUIO_Label, "", 0),
2252 End,
2253 End,
2255 /* radios */
2256 Child, HGroup,
2257 Child, VGroup,
2258 Child, RadioObject,
2259 GroupFrame,
2260 MUIA_Radio_Entries, radio_entries1,
2261 End,
2262 Child, country_radio[0] = RadioObject,
2263 GroupFrame,
2264 MUIA_Radio_Entries, radio_entries2,
2265 MUIA_Radio_Active, 1,
2266 End,
2267 End,
2268 Child, HGroup,
2269 Child, RadioObject,
2270 GroupFrame,
2271 MUIA_Radio_Entries, radio_entries1,
2272 End,
2273 Child, country_radio[1] = RadioObject,
2274 GroupFrame,
2275 MUIA_Radio_Entries, radio_entries2,
2276 MUIA_Radio_Active, 1,
2277 End,
2278 End,
2279 End,
2281 #if defined(TEST_ICONLIST)
2282 /* iconlist */
2283 Child, HGroup,
2284 Child, volume_iconlist =
2285 MUI_NewObject(MUIC_IconVolumeList, GroupFrame,
2286 TAG_DONE),
2287 Child, drawer_iconlist =
2288 MUI_NewObject(MUIC_IconDrawerList, GroupFrame,
2289 MUIA_IconDrawerList_Drawer, "SYS:",
2290 TAG_DONE),
2291 End,
2292 #endif
2294 /* balancing */
2295 Child, HGroup,
2296 Child, create_balance_column(),
2297 Child, BalanceObject,
2298 End,
2300 Child, create_balance_column(),
2301 Child, BalanceObject,
2302 End,
2304 Child, create_balance_column(),
2305 Child, BalanceObject,
2306 End,
2308 Child, create_balance_column(),
2309 Child, BalanceObject,
2310 End,
2312 Child, create_balance_column(),
2314 End,
2316 End,
2318 Child, HGroup,
2319 Child, about_button = TextObject,
2320 ButtonFrame,
2321 MUIA_InputMode, MUIV_InputMode_RelVerify,
2322 MUIA_CycleChain, 1,
2323 MUIA_Background, MUII_ButtonBack,
2324 MUIA_Text_PreParse, "\33c",
2325 MUIA_Text_Contents, "About",
2326 End,
2327 Child, quit_button = TextObject,
2328 ButtonFrame,
2329 MUIA_InputMode, MUIV_InputMode_RelVerify,
2330 MUIA_CycleChain, 1,
2331 MUIA_Background, MUII_ButtonBack,
2332 MUIA_ControlChar, 'q',
2333 MUIA_Text_HiChar, 'q',
2334 MUIA_Text_PreParse, "\33c",
2335 MUIA_Text_Contents, "Quit",
2336 End,
2337 End,
2338 End,
2339 End,
2341 SubWindow, second_wnd = WindowObject,
2342 MUIA_Window_Title, "Second window",
2343 WindowContents, VGroup,
2344 Child, DropTextObject,
2345 MUIA_Text_Contents, "Drop here",
2346 MUIA_Dropable, TRUE,
2347 End,
2348 End,
2349 End,
2351 End;
2353 if (app)
2355 ULONG sigs = 0;
2357 DoMethod(wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2,
2358 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
2359 DoMethod(second_wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
2360 second_wnd, 3, MUIM_Set, MUIA_Window_Open, FALSE);
2361 DoMethod(open_button, MUIM_Notify, MUIA_Pressed, FALSE, second_wnd,
2362 3, MUIM_Set, MUIA_Window_Open, TRUE);
2363 DoMethod(about_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
2364 MUIM_Application_AboutMUI, NULL);
2365 DoMethod(quit_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
2366 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
2367 DoMethod(objects_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
2368 MUIM_CallHook, &hook_objects);
2369 DoMethod(repeat_button, MUIM_Notify, MUIA_Timer, MUIV_EveryTime,
2370 app, 2, MUIM_CallHook, &hook);
2372 /* Notifications and set-up for string objects */
2373 DoMethod(string.max_len_text, MUIM_SetAsString, MUIA_Text_Contents,
2374 "%ld", XGET(string.strings[0], MUIA_String_MaxLen) - 1);
2375 set(string.cursor_pos_slider, MUIA_Numeric_Max,
2376 XGET(string.strings[0], MUIA_String_MaxLen) - 1);
2377 set(string.display_pos_slider, MUIA_Numeric_Max,
2378 XGET(string.strings[0], MUIA_String_MaxLen) - 1);
2379 set(string.cr_advance_check, MUIA_Selected, TRUE);
2380 set(string.attach_list_check, MUIA_Selected, TRUE);
2381 set(string.strings[1], MUIA_Disabled,
2382 XGET(string.strings[1], MUIA_String_Format)
2383 != MUIV_String_Format_Left);
2384 set(string.strings[2], MUIA_Disabled,
2385 XGET(string.strings[2], MUIA_String_Format)
2386 != MUIV_String_Format_Right);
2387 set(string.strings[3], MUIA_Disabled,
2388 XGET(string.strings[3], MUIA_String_Format)
2389 != MUIV_String_Format_Center);
2390 set(string.strings[4], MUIA_Disabled,
2391 !XGET(string.strings[4], MUIA_String_Secret));
2392 set(string.strings[0], MUIA_String_MaxLen, 100);
2393 set(string.reject_string, MUIA_String_Contents,
2394 (IPTR)default_reject_chars);
2396 for (i = 0; i < STRING_COUNT; i++)
2398 if (i == 0)
2400 DoMethod(string.accept_string, MUIM_Notify,
2401 MUIA_String_Contents, MUIV_EveryTime, string.strings[i],
2402 3, MUIM_Set, MUIA_String_Accept, MUIV_TriggerValue);
2403 DoMethod(string.cr_advance_check, MUIM_Notify, MUIA_Selected,
2404 MUIV_EveryTime, string.strings[i], 3, MUIM_Set,
2405 MUIA_String_AdvanceOnCR, MUIV_TriggerValue);
2406 DoMethod(string.cursor_pos_slider, MUIM_Notify,
2407 MUIA_Numeric_Value, MUIV_EveryTime, string.strings[i], 3,
2408 MUIM_Set, MUIA_String_BufferPos, MUIV_TriggerValue);
2409 DoMethod(string.display_pos_slider, MUIM_Notify,
2410 MUIA_Numeric_Value, MUIV_EveryTime, string.strings[i], 3,
2411 MUIM_Set, MUIA_String_DisplayPos, MUIV_TriggerValue);
2412 DoMethod(string.attach_list_check, MUIM_Notify, MUIA_Selected,
2413 TRUE, string.strings[i], 3, MUIM_Set,
2414 MUIA_String_AttachedList, list.lists[0]);
2415 DoMethod(string.attach_list_check, MUIM_Notify, MUIA_Selected,
2416 FALSE, string.strings[i], 3, MUIM_Set,
2417 MUIA_String_AttachedList, NULL);
2419 else
2421 DoMethod(string.strings[0], MUIM_Notify, MUIA_String_Accept,
2422 MUIV_EveryTime, string.strings[i], 3, MUIM_Set,
2423 MUIA_String_Accept, MUIV_TriggerValue);
2424 DoMethod(string.strings[0], MUIM_Notify,
2425 MUIA_String_AdvanceOnCR, MUIV_EveryTime,
2426 string.strings[i], 3, MUIM_Set, MUIA_String_AdvanceOnCR,
2427 MUIV_TriggerValue);
2428 DoMethod(string.strings[0], MUIM_Notify,
2429 MUIA_String_BufferPos, MUIV_EveryTime,
2430 string.strings[i], 3, MUIM_Set, MUIA_String_BufferPos,
2431 MUIV_TriggerValue);
2432 DoMethod(string.strings[0], MUIM_Notify,
2433 MUIA_String_DisplayPos, MUIV_EveryTime,
2434 string.strings[i], 3, MUIM_Set, MUIA_String_DisplayPos,
2435 MUIV_TriggerValue);
2436 DoMethod(string.strings[0], MUIM_Notify,
2437 MUIA_String_AttachedList, MUIV_EveryTime,
2438 string.strings[i], 3, MUIM_Set,
2439 MUIA_String_AttachedList, MUIV_TriggerValue);
2441 DoMethod(string.reject_string, MUIM_Notify, MUIA_String_Contents,
2442 MUIV_EveryTime, string.strings[i], 3, MUIM_Set,
2443 MUIA_String_Reject, MUIV_TriggerValue);
2444 DoMethod(string.strings[i], MUIM_Notify, MUIA_String_Integer,
2445 MUIV_EveryTime, string.integer_string, 3, MUIM_NoNotifySet,
2446 MUIA_String_Integer, MUIV_TriggerValue);
2447 DoMethod(string.integer_string, MUIM_Notify, MUIA_String_Integer,
2448 MUIV_EveryTime, string.strings[i], 3, MUIM_NoNotifySet,
2449 MUIA_String_Integer, MUIV_TriggerValue);
2451 DoMethod(string.accept_all_check, MUIM_Notify, MUIA_Selected,
2452 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2453 ChangeStringAccept);
2454 DoMethod(string.strings[4], MUIM_Notify, MUIA_String_Acknowledge,
2455 MUIV_EveryTime, string.plaintext_string, 3, MUIM_NoNotifySet,
2456 MUIA_String_Contents, MUIV_TriggerValue);
2457 DoMethod(string.plaintext_string, MUIM_Notify,
2458 MUIA_String_Acknowledge, MUIV_EveryTime, string.strings[4], 3,
2459 MUIM_NoNotifySet, MUIA_String_Contents, MUIV_TriggerValue);
2461 DoMethod(wheel, MUIM_Notify, WHEEL_Hue, MUIV_EveryTime, app, 2,
2462 MUIM_CallHook, &hook_wheel);
2463 DoMethod(wheel, MUIM_Notify, WHEEL_Saturation, MUIV_EveryTime, app,
2464 2, MUIM_CallHook, &hook_wheel);
2465 DoMethod(r_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
2466 app, 2, MUIM_CallHook, &hook_slider);
2467 DoMethod(g_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
2468 app, 2, MUIM_CallHook, &hook_slider);
2469 DoMethod(b_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
2470 app, 2, MUIM_CallHook, &hook_slider);
2472 DoMethod(save_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 3,
2473 MUIM_CallHook, &hook_standard, Save);
2475 DoMethod(quit_item, MUIM_Notify, MUIA_Menuitem_Trigger,
2476 MUIV_EveryTime, app, 2, MUIM_Application_ReturnID,
2477 MUIV_Application_ReturnID_Quit);
2478 DoMethod(about_item, MUIM_Notify, MUIA_Menuitem_Trigger,
2479 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2480 About);
2482 /* Notifications for color objects */
2483 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Red,
2484 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Red,
2485 MUIV_TriggerValue);
2486 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Green,
2487 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Green,
2488 MUIV_TriggerValue);
2489 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Blue,
2490 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Blue,
2491 MUIV_TriggerValue);
2492 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Red,
2493 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Red,
2494 MUIV_TriggerValue);
2495 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Green,
2496 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Green,
2497 MUIV_TriggerValue);
2498 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Blue,
2499 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Blue,
2500 MUIV_TriggerValue);
2501 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Pen,
2502 MUIV_EveryTime, colorfield_pen, 3, MUIM_Set,
2503 MUIA_String_Integer, MUIV_TriggerValue);
2504 DoMethod(colorfield_pen, MUIM_Notify, MUIA_String_Acknowledge,
2505 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2506 ChangePen);
2507 DoMethod(colorfield_reset_button, MUIM_Notify, MUIA_Pressed, FALSE,
2508 colorfield, 3, MUIM_Set, MUIA_Colorfield_RGB, default_color);
2510 /* Notifications for pen objects */
2511 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_Pen,
2512 MUIV_EveryTime, pendisplay_pen, 3, MUIM_NoNotifySet,
2513 MUIA_String_Integer, MUIV_TriggerValue);
2514 DoMethod(pendisplay_pen, MUIM_Notify, MUIA_String_Acknowledge,
2515 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2516 ChangePendisplayPen);
2517 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_Spec,
2518 MUIV_EveryTime, pendisplay_spec, 3, MUIM_Set,
2519 MUIA_String_Contents, MUIV_TriggerValue);
2520 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_RGB,
2521 MUIV_EveryTime, pendisplay, 3, MUIM_Set,
2522 MUIA_Pendisplay_RGBcolor, MUIV_TriggerValue);
2523 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_RGBcolor,
2524 MUIV_EveryTime, poppen, 3, MUIM_Set, MUIA_Pendisplay_RGBcolor,
2525 MUIV_TriggerValue);
2526 DoMethod(pendisplay_spec, MUIM_Notify, MUIA_String_Contents,
2527 MUIV_EveryTime, pendisplay, 3, MUIM_Set, MUIA_Pendisplay_Spec,
2528 MUIV_TriggerValue);
2529 DoMethod(reference_check, MUIM_Notify, MUIA_Selected, TRUE,
2530 pendisplay2, 3, MUIM_Set, MUIA_Pendisplay_Reference, pendisplay);
2531 DoMethod(reference_check, MUIM_Notify, MUIA_Selected, FALSE,
2532 pendisplay2, 3, MUIM_Set, MUIA_Pendisplay_Reference, NULL);
2533 DoMethod(shine_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
2534 2, MUIM_Pendisplay_SetMUIPen, MPEN_SHINE);
2535 DoMethod(shadow_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
2536 2, MUIM_Pendisplay_SetMUIPen, MPEN_SHADOW);
2537 DoMethod(yellow_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
2538 4, MUIM_Pendisplay_SetRGB, 0xffffffff, 0xffffffff, 0);
2540 /* Notifications and set-up for list objects */
2541 set(list.showdropmarks_check, MUIA_Selected, TRUE);
2542 UpdateListInfo();
2543 for (i = 0; i < LIST_COUNT; i++)
2545 DoMethod(list.lists[i], MUIM_Notify, MUIA_Listview_DoubleClick,
2546 MUIV_EveryTime, list.lists[i], 3, MUIM_Set, MUIA_Disabled,
2547 TRUE);
2548 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Entries,
2549 MUIV_EveryTime, list.entries_text, 4, MUIM_SetAsString,
2550 MUIA_Text_Contents, "%ld", MUIV_TriggerValue);
2551 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Visible,
2552 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2553 ListGetVisible);
2554 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_First,
2555 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2556 ListGetFirst);
2557 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_InsertPosition,
2558 MUIV_EveryTime, list.insert_text, 4, MUIM_SetAsString,
2559 MUIA_Text_Contents, "%ld", MUIV_TriggerValue);
2560 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Active,
2561 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2562 UpdateListInfo);
2564 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2565 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2566 ListSetDraggable);
2567 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2568 MUIV_EveryTime, list.dragsortable_check, 3, MUIM_Set,
2569 MUIA_Disabled, MUIV_NotTriggerValue);
2570 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2571 FALSE, list.dragsortable_check, 3, MUIM_Set,
2572 MUIA_Selected, FALSE);
2573 DoMethod(list.showdropmarks_check, MUIM_Notify, MUIA_Selected,
2574 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2575 ListSetShowDropMarks);
2576 DoMethod(list.multitest_check, MUIM_Notify, MUIA_Selected,
2577 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2578 ListSetMultiTest);
2579 DoMethod(list.quiet_check, MUIM_Notify, MUIA_Selected,
2580 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2581 ListSetQuiet);
2582 DoMethod(list.dragsortable_check, MUIM_Notify, MUIA_Selected,
2583 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2584 ListSetDragSortable);
2585 DoMethod(list.autovisible_check, MUIM_Notify, MUIA_Selected,
2586 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2587 ListSetAutoVisible);
2588 DoMethod(list.reset_button, MUIM_Notify, MUIA_Pressed, FALSE,
2589 app, 3, MUIM_CallHook, &hook_standard, ListReset);
2590 DoMethod(list.move_button, MUIM_Notify, MUIA_Pressed, FALSE,
2591 app, 3, MUIM_CallHook, &hook_standard, ListMove);
2592 DoMethod(list.sort_button, MUIM_Notify, MUIA_Pressed, FALSE,
2593 app, 3, MUIM_CallHook, &hook_standard, ListSort);
2594 DoMethod(list.enable_button, MUIM_Notify, MUIA_Pressed, FALSE,
2595 app, 3, MUIM_CallHook, &hook_standard, ListEnable);
2596 DoMethod(list.exchange_button, MUIM_Notify, MUIA_Pressed, FALSE,
2597 app, 3, MUIM_CallHook, &hook_standard, ListExchange);
2598 DoMethod(list.jump_button, MUIM_Notify, MUIA_Pressed, FALSE,
2599 app, 3, MUIM_CallHook, &hook_standard, ListJump);
2600 DoMethod(list.select_button, MUIM_Notify, MUIA_Pressed, FALSE,
2601 app, 3, MUIM_CallHook, &hook_standard, ListSelect);
2602 DoMethod(list.deselect_button, MUIM_Notify, MUIA_Pressed, FALSE,
2603 app, 3, MUIM_CallHook, &hook_standard, ListDeselect);
2604 DoMethod(list.toggle_button, MUIM_Notify, MUIA_Pressed, FALSE,
2605 app, 3, MUIM_CallHook, &hook_standard, ListToggle);
2606 DoMethod(list.redraw_button, MUIM_Notify, MUIA_Pressed, FALSE,
2607 app, 3, MUIM_CallHook, &hook_standard, ListRedraw);
2608 DoMethod(list.insert_single_button, MUIM_Notify, MUIA_Pressed, FALSE,
2609 app, 3, MUIM_CallHook, &hook_standard, ListInsertSingle);
2610 DoMethod(list.insert_multiple_button, MUIM_Notify, MUIA_Pressed, FALSE,
2611 app, 3, MUIM_CallHook, &hook_standard, ListInsert);
2612 DoMethod(list.remove_button, MUIM_Notify, MUIA_Pressed, FALSE,
2613 app, 3, MUIM_CallHook, &hook_standard, ListRemove);
2614 DoMethod(list.clear_button, MUIM_Notify, MUIA_Pressed, FALSE,
2615 app, 3, MUIM_CallHook, &hook_standard, ListClear);
2616 DoMethod(list.activate_button, MUIM_Notify, MUIA_Pressed, FALSE,
2617 app, 3, MUIM_CallHook, &hook_standard, ListActivate);
2618 DoMethod(list.deactivate_button, MUIM_Notify, MUIA_Pressed, FALSE,
2619 app, 3, MUIM_CallHook, &hook_standard, ListDeactivate);
2620 DoMethod(list.title_string, MUIM_Notify, MUIA_String_Acknowledge,
2621 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2622 ChangeListTitle);
2623 DoMethod(list.list_radios, MUIM_Notify, MUIA_Radio_Active,
2624 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2625 UpdateListInfo);
2626 SET(list.lists[4], MUIA_List_CompareHook, &hook_compare);
2627 SET(list.lists[4], MUIA_List_AutoVisible, TRUE);
2629 SET(list.showheadings_check, MUIA_Selected,
2630 XGET(list.multi_lists[0], MUIA_List_Title));
2631 SET(list.format_string, MUIA_String_Contents,
2632 XGET(list.multi_lists[1], MUIA_List_Format));
2633 SET(list.def_column_string, MUIA_String_Integer,
2634 XGET(list.multi_lists[0], MUIA_Listview_DefClickColumn));
2635 DoMethod(list.format_string, MUIM_Notify, MUIA_String_Acknowledge,
2636 MUIV_EveryTime, list.multi_lists[1], 3, MUIM_Set,
2637 MUIA_List_Format, MUIV_TriggerValue);
2638 DoMethod(list.multi_lists[1], MUIM_Notify, MUIA_List_Format,
2639 MUIV_EveryTime, wnd, 3, MUIM_Set,
2640 MUIA_Window_ActiveObject, list.format_string);
2641 for (i = 0; i < MULTI_LIST_COUNT; i++)
2643 DoMethod(list.showheadings_check, MUIM_Notify, MUIA_Selected,
2644 MUIV_EveryTime, list.multi_lists[i], 3, MUIM_Set,
2645 MUIA_List_Title, MUIV_TriggerValue);
2646 DoMethod(list.showimage_check, MUIM_Notify, MUIA_Selected,
2647 MUIV_EveryTime, list.multi_lists[i], 2, MUIM_List_Redraw,
2648 MUIV_List_Redraw_All);
2649 DoMethod(list.def_column_string, MUIM_Notify,
2650 MUIA_String_Integer,
2651 MUIV_EveryTime, list.multi_lists[i], 3, MUIM_Set,
2652 MUIA_Listview_DefClickColumn, MUIV_TriggerValue);
2653 DoMethod(list.multi_lists[i], MUIM_Notify,
2654 MUIA_Listview_ClickColumn, MUIV_EveryTime,
2655 list.column_string, 3, MUIM_Set, MUIA_String_Integer,
2656 MUIV_TriggerValue);
2658 DoMethod(list.column_string, MUIM_Notify, MUIA_String_Contents,
2659 MUIV_EveryTime, list.column_text, 3, MUIM_Set, MUIA_Text_Contents,
2660 MUIV_TriggerValue);
2661 DoMethod(list.multi_lists[1], MUIM_Notify, MUIA_Listview_DoubleClick,
2662 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2663 CheckListDoubleClick);
2664 SET(list.multi_lists[1], MUIA_List_ConstructHook, &hook_construct);
2665 SET(list.multi_lists[1], MUIA_List_DestructHook, &hook_destruct);
2666 SET(list.multi_lists[1], MUIA_List_DisplayHook, &hook_display);
2667 DoMethod(list.multi_lists[1], MUIM_List_Insert, entries, -1,
2668 MUIV_List_Insert_Top);
2670 DoMethod(listview, MUIM_Notify, MUIA_Listview_DoubleClick, TRUE,
2671 popobject, 2, MUIM_Popstring_Close, TRUE);
2673 /* numeric */
2674 for (i = 0; i < NUMERIC_COUNT; i++)
2676 DoMethod(min_string, MUIM_Notify, MUIA_String_Integer,
2677 MUIV_EveryTime, numerics[i], 3, MUIM_Set, MUIA_Numeric_Min,
2678 MUIV_TriggerValue);
2679 DoMethod(max_string, MUIM_Notify, MUIA_String_Integer,
2680 MUIV_EveryTime, numerics[i], 3, MUIM_Set, MUIA_Numeric_Max,
2681 MUIV_TriggerValue);
2683 DoMethod(slider_button, MUIM_Notify, MUIA_Pressed, FALSE,
2684 numerics[HRSLIDER], 3, MUIM_Set, MUIA_Slider_Horiz, FALSE);
2686 /* radio */
2687 DoMethod(country_radio[0], MUIM_Notify, MUIA_Radio_Active,
2688 MUIV_EveryTime, country_radio[1], 3, MUIM_NoNotifySet,
2689 MUIA_Radio_Active, MUIV_TriggerValue);
2690 DoMethod(country_radio[1], MUIM_Notify, MUIA_Radio_Active,
2691 MUIV_EveryTime, country_radio[0], 3, MUIM_NoNotifySet,
2692 MUIA_Radio_Active, MUIV_TriggerValue);
2694 #if defined(TEST_ICONLIST)
2695 /* iconlist */
2696 DoMethod(volume_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick,
2697 TRUE, volume_iconlist, 3, MUIM_CallHook, &hook_standard,
2698 volume_doubleclicked);
2699 DoMethod(drawer_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick,
2700 TRUE, drawer_iconlist, 3, MUIM_CallHook, &hook_standard,
2701 drawer_doubleclicked);
2702 #endif
2704 /* automatic tests */
2705 get(list.lists[0], MUIA_List_Visible, &value);
2706 if (value != -1)
2707 printf("MUIA_List_Visible equals %ld before display,"
2708 " but it should be -1.\n", (long)value);
2709 get(list.multi_lists[0], MUIA_Listview_ClickColumn, &value);
2710 if (value != 0)
2711 printf("MUIA_Listview_ClickColumn equals %ld before display,"
2712 " but it should be 0.\n", (long)value);
2713 get(list.lists[0], MUIA_Listview_DoubleClick, &value);
2714 if (value != 0)
2715 printf("MUIA_Listview_DoubleClick equals %ld before display,"
2716 " but it should be 0.\n", (long)value);
2718 set(wnd, MUIA_Window_Open, TRUE);
2719 set(wnd, MUIA_Window_ScreenTitle, "Zune Test Application");
2721 list.image = DoMethod(list.multi_lists[0], MUIM_List_CreateImage,
2722 list.colorfield, 0);
2724 /* Set pen fields */
2725 set(colorfield_pen, MUIA_String_Integer,
2726 XGET(colorfield, MUIA_Colorfield_Pen));
2728 char pen_str[10];
2729 nnset(pendisplay_pen, MUIA_String_Integer,
2730 XGET(pendisplay, MUIA_Pendisplay_Pen));
2732 struct MUI_PenSpec *pen_spec = NULL;
2733 GET(pendisplay, MUIA_Pendisplay_Spec, &pen_spec);
2734 strncpy(pen_str, pen_spec->buf, 10);
2735 set(pendisplay_spec, MUIA_String_Contents, pen_str);
2737 while ((LONG) DoMethod(app, MUIM_Application_NewInput,
2738 &sigs) != MUIV_Application_ReturnID_Quit)
2740 if (sigs)
2742 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
2743 if (sigs & SIGBREAKF_CTRL_C)
2744 break;
2745 if (sigs & SIGBREAKF_CTRL_D)
2746 break;
2750 DoMethod(list.multi_lists[0], MUIM_List_DeleteImage, list.image);
2751 MUI_DisposeObject(app);
2753 if (context_menu)
2754 MUI_DisposeObject(context_menu);
2755 CloseLibrary(ColorWheelBase);
2756 MUI_DeleteCustomClass(CL_DropText);
2758 /* automatic tests */
2759 if (list.destruct_count != 18)
2760 printf("The hook installed through MUIA_List_DestructHook has been"
2761 " called %ld times, but should have been called 18 times.\n",
2762 (long)list.destruct_count);
2764 CloseLibrary(MUIMasterBase);
2766 DeletePool(pool);
2768 return 0;