move the tests under the debug folder
[AROS.git] / debug / test / Zune / test.c
blob958e5923e4abbc4f8183276b1a9f3cf36005da07
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 <proto/utility.h>
26 #include <aros/debug.h>
28 /* the following should go in a single include file which then only
29 ** consists of the public constants and members. Actually this is easy
32 #if 0
33 #define TEST_ICONLIST
34 #endif
36 #include <libraries/mui.h>
37 #if defined(TEST_ICONLIST)
38 #include "../../workbench/system/Wanderer/Classes/iconlist_attributes.h"
39 #include "../../workbench/system/Wanderer/Classes/iconlist.h"
40 #endif
42 #define STRING_COUNT 6
43 #define LIST_COUNT 5
44 #define MULTI_LIST_COUNT 2
46 #define NUMERIC_MIN 0
47 #define NUMERIC_MAX 100
49 static const TEXT digits[] = "-0123456789";
50 static const TEXT vowels[] = "aeiou";
51 static const TEXT default_accept_chars[] = "aeiou?.";
52 static const TEXT default_reject_chars[] = "*?";
53 static const ULONG default_color[] = {155 << 24, 180 << 24, 255 << 24};
54 static const struct MUI_PenSpec default_penspec = {"m0"};
55 static const char *fruits[] = {"Strawberry", "Apple", "Banana", "Orange",
56 "Grapefruit", "Kumquat", "Plum", "Raspberry", "Apricot", "Grape",
57 "Peach", "Lemon", "Lime", "Date", "Pineapple", "Blueberry", "Papaya",
58 "Cranberry", "Gooseberry", "Pear", "Fig", "Coconut", "Melon",
59 "Pumpkin", NULL};
60 static const char *empty[] = {"", "", "", "", "", NULL};
61 static const LONG list_active_positions[] =
63 MUIV_List_Active_Top,
64 MUIV_List_Active_Bottom,
65 MUIV_List_Active_Off,
66 MUIV_List_Active_Off,
67 MUIV_List_Active_Off
69 static const CONST_STRPTR list_move1_modes[] =
70 {"Index", "Top", "Active", "Bottom", NULL};
71 static const CONST_STRPTR list_move2_modes[] =
72 {"Index", "Top", "Active", "Bottom", "Next", "Previous", NULL};
73 static const CONST_STRPTR list_jump_modes[] =
74 {"Index", "Top", "Active", "Bottom", "Down", "Up", NULL};
75 static const CONST_STRPTR list_insert_modes[] =
76 {"Index", "Top", "Active", "Sorted", "Bottom", NULL};
77 static const CONST_STRPTR list_remove_modes[] =
78 {"Index", "First", "Active", "Last", "Selected", "Unsafe Loop",
79 "Safe Loop", NULL};
80 static const CONST_STRPTR list_activate_modes[] =
81 {"Index", "Top", "Bottom", "Up", "Down", "Page Up", "Page Down", NULL};
82 static const CONST_STRPTR list_select_modes[] =
83 {"Index", "Active", "All", NULL};
84 static const TEXT list_format[] = "BAR,BAR,";
86 enum
88 HNSLIDER,
89 HRSLIDER,
90 HQSLIDER,
91 VNSLIDER,
92 VRSLIDER,
93 VQSLIDER,
94 NNUMERICBUTTON,
95 RNUMERICBUTTON,
96 NKNOB,
97 RKNOB,
98 NUMERIC_COUNT
101 struct Library *MUIMasterBase;
102 struct Library *ColorWheelBase;
104 struct list_entry
106 char *column1;
107 char *column2;
110 Object *app, *wnd;
112 static struct
114 Object *open_button;
116 general;
118 static struct
120 Object *strings[STRING_COUNT],
121 *accept_string,
122 *reject_string,
123 *cursor_pos_slider,
124 *display_pos_slider,
125 *integer_string,
126 *plaintext_string,
127 *max_len_text,
128 *cr_advance_check,
129 *attach_list_check,
130 *standard_hook_check,
131 *custom_hook_check,
132 *accept_all_check;
134 string;
136 static struct
138 Object *lists[LIST_COUNT],
139 *list_radios,
140 *index1_string,
141 *index2_string,
142 *title_string,
143 *move1_cycle,
144 *move2_cycle,
145 *jump_cycle,
146 *select_cycle,
147 *insert_cycle,
148 *remove_cycle,
149 *activate_cycle,
150 *sort_button,
151 *clear_button,
152 *enable_button,
153 *reset_button,
154 *select_button,
155 *deselect_button,
156 *toggle_button,
157 *move_button,
158 *exchange_button,
159 *jump_button,
160 *redraw_button,
161 *insert_single_button,
162 *insert_multiple_button,
163 *remove_button,
164 *activate_button,
165 *deactivate_button,
166 *draggable_check,
167 *showdropmarks_check,
168 *multitest_check,
169 *quiet_check,
170 *dragsortable_check,
171 *autovisible_check,
172 *entries_text,
173 *visible_text,
174 *first_text,
175 *insert_text,
176 *active_text,
177 *drop_text,
178 *selected_text,
179 *multi_lists[MULTI_LIST_COUNT],
180 *colorfield,
181 *format_string,
182 *column_string,
183 *column_text,
184 *def_column_string,
185 *showheadings_check,
186 *showimage_check;
187 LONG quiet[LIST_COUNT],
188 destruct_count,
189 has_multitest[LIST_COUNT];
190 IPTR image;
192 list;
194 static Object *wheel;
195 static Object *r_slider;
196 static Object *g_slider;
197 static Object *b_slider;
198 static Object *hue_gauge;
199 static Object *colorfield, *colorfield2, *colorfield_reset_button,
200 *colorfield_pen;
201 static Object *coloradjust;
202 static Object *pendisplay, *pendisplay2, *pendisplay_pen, *pendisplay_spec,
203 *reference_check, *shine_button, *shadow_button, *yellow_button, *poppen;
204 static Object *group;
205 static Object *editor_text;
206 static Object *filename_string;
207 static Object *save_button;
208 static struct Hook hook_standard;
209 static struct Hook hook;
210 static struct Hook hook_wheel;
211 static struct Hook hook_slider;
212 static struct Hook hook_objects;
213 static struct Hook hook_compare, hook_multitest;
214 static struct Hook hook_construct, hook_destruct, hook_display;
215 static struct Hook hook_objstr;
217 #if defined(TEST_ICONLIST)
218 static Object *drawer_iconlist;
219 static Object *volume_iconlist;
220 #endif
222 AROS_UFH0(void, repeat_function)
224 AROS_USERFUNC_INIT
226 printf("MUI_Timer\n");
228 AROS_USERFUNC_EXIT
231 AROS_UFH0(void, wheel_function)
233 AROS_USERFUNC_INIT
235 nnset(r_slider, MUIA_Numeric_Value, (XGET(wheel,
236 WHEEL_Red) >> 24) & 0xff);
237 nnset(g_slider, MUIA_Numeric_Value, (XGET(wheel,
238 WHEEL_Green) >> 24) & 0xff);
239 nnset(b_slider, MUIA_Numeric_Value, (XGET(wheel,
240 WHEEL_Blue) >> 24) & 0xff);
242 AROS_USERFUNC_EXIT
245 AROS_UFH0(void, slider_function)
247 AROS_USERFUNC_INIT
249 struct ColorWheelRGB cw;
250 ULONG red = XGET(r_slider, MUIA_Numeric_Value);
251 ULONG green = XGET(g_slider, MUIA_Numeric_Value);
252 ULONG blue = XGET(b_slider, MUIA_Numeric_Value);
254 cw.cw_Red = (red << 24) | (red << 16) | (red << 8) | red;
255 cw.cw_Green = (green << 24) | (green << 16) | (green << 8) | green;
256 cw.cw_Blue = (blue << 24) | (blue << 16) | (blue << 8) | blue;
258 nnset(wheel, WHEEL_RGB, &cw);
259 set(hue_gauge, MUIA_Gauge_Current, XGET(wheel, WHEEL_Hue));
261 AROS_USERFUNC_EXIT
264 AROS_UFH0(void, objects_function)
266 AROS_USERFUNC_INIT
268 Object *new_obj = MUI_MakeObject(MUIO_Button, "Button");
269 if (new_obj)
271 DoMethod(group, MUIM_Group_InitChange);
272 DoMethod(group, OM_ADDMEMBER, new_obj);
273 DoMethod(group, MUIM_Group_ExitChange);
276 AROS_USERFUNC_EXIT
279 static void About(void)
281 static Object *about_wnd;
283 if (!about_wnd)
285 about_wnd = AboutmuiObject, MUIA_Aboutmui_Application, app, End;
288 if (about_wnd)
289 set(about_wnd, MUIA_Window_Open, TRUE);
292 AROS_UFH3(static void, ObjStrHook,
293 AROS_UFHA(struct Hook *, h, A0),
294 AROS_UFHA(Object *, group, A2),
295 AROS_UFHA(Object *, str, A1))
297 AROS_USERFUNC_INIT
299 struct List *child_list = NULL;
300 Object *child, *list;
301 struct list_entry *entry;
303 /* Find the listview object within its group */
304 GET(group, MUIA_Group_ChildList, &child_list);
305 child = (APTR)child_list->lh_Head;
306 NextObject(&child);
307 list = NextObject(&child);
309 /* Copy one of the selected entry's fields to the string gadget */
310 DoMethod(list, MUIM_List_GetEntry, MUIV_List_GetEntry_Active, &entry);
311 SET(str, MUIA_String_Contents, entry->column1);
313 AROS_USERFUNC_EXIT
316 static void ChangeStringAccept(void)
318 STRPTR accept_chars = NULL, reject_chars = NULL;
319 BOOL accept_all;
320 UWORD i;
322 accept_all = XGET(string.accept_all_check, MUIA_Selected);
323 SET(string.accept_string, MUIA_Disabled, accept_all);
324 SET(string.reject_string, MUIA_Disabled, accept_all);
326 if (!accept_all)
328 GET(string.accept_string, MUIA_String_Contents, &accept_chars);
329 GET(string.reject_string, MUIA_String_Contents, &reject_chars);
332 for (i = 0; i < STRING_COUNT; i++)
334 SET(string.strings[i], MUIA_String_Accept, accept_chars);
335 SET(string.strings[i], MUIA_String_Reject, reject_chars);
339 static void ChangePen(void)
341 SIPTR pen = -1;
343 GET(colorfield_pen, MUIA_String_Integer, &pen);
344 if (pen >= 0)
345 SET(colorfield, MUIA_Colorfield_Pen, pen);
348 static void ChangePendisplayPen(void)
350 DoMethod(pendisplay, MUIM_Pendisplay_SetColormap,
351 XGET(pendisplay_pen, MUIA_String_Integer));
354 AROS_UFH3(static IPTR, ListCompareHook,
355 AROS_UFHA(struct Hook *, h, A0),
356 AROS_UFHA(CONST_STRPTR, str1, A2),
357 AROS_UFHA(CONST_STRPTR, str2, A1))
359 AROS_USERFUNC_INIT
361 IPTR len1, len2;
363 len1 = strlen(str1);
364 len2 = strlen(str2);
366 /* Indicate which string is shorter */
367 return len2 - len1;
369 AROS_USERFUNC_EXIT
372 AROS_UFH3(static IPTR, ListMultiTestHook,
373 AROS_UFHA(struct Hook *, h, A0),
374 AROS_UFHA(APTR, unused, A2),
375 AROS_UFHA(CONST_STRPTR, str, A1))
377 AROS_USERFUNC_INIT
379 /* Indicate whether the string doesn't begin with a vowel */
380 return strchr(vowels, tolower(str[0])) == NULL;
382 AROS_USERFUNC_EXIT
385 static void ChangeListTitle(void)
387 STRPTR title = NULL;
388 UWORD i;
390 i = XGET(list.list_radios, MUIA_Radio_Active);
392 GET(list.lists[i], MUIA_List_Title, &title);
393 FreeVec(title);
395 GET(list.title_string, MUIA_String_Contents, &title);
396 if (title[0] == '\0')
397 title = NULL;
399 title = StrDup(title);
401 SET(list.lists[i], MUIA_List_Title, title);
404 static void UpdateListInfo(void)
406 STRPTR title = NULL;
407 UWORD i;
408 LONG value = 0;
410 i = XGET(list.list_radios, MUIA_Radio_Active);
412 GET(list.lists[i], MUIA_Listview_DragType, &value);
413 NNSET(list.draggable_check, MUIA_Selected,
414 value != MUIV_Listview_DragType_None);
415 NNSET(list.dragsortable_check, MUIA_Disabled,
416 value == MUIV_Listview_DragType_None);
417 if (value == MUIV_Listview_DragType_None)
418 value = FALSE;
419 else
420 GET(list.lists[i], MUIA_List_DragSortable, &value);
421 NNSET(list.dragsortable_check, MUIA_Selected, value);
422 GET(list.lists[i], MUIA_List_ShowDropMarks, &value);
423 NNSET(list.showdropmarks_check, MUIA_Selected, value);
424 value = list.has_multitest[i]; // MUIA_List_MultiTestHook isn't gettable!
425 NNSET(list.multitest_check, MUIA_Selected, value);
426 value = list.quiet[i]; // MUIA_List_Quiet is not gettable!
427 NNSET(list.quiet_check, MUIA_Selected, value);
428 GET(list.lists[i], MUIA_List_AutoVisible, &value);
429 NNSET(list.autovisible_check, MUIA_Selected, value);
431 GET(list.lists[i], MUIA_List_Title, &title);
432 NNSET(list.title_string, MUIA_String_Contents, title);
434 GET(list.lists[i], MUIA_List_Entries, &value);
435 DoMethod(list.entries_text, MUIM_SetAsString, MUIA_Text_Contents,
436 "%ld", value);
437 GET(list.lists[i], MUIA_List_Visible, &value);
438 DoMethod(list.visible_text, MUIM_SetAsString, MUIA_Text_Contents,
439 "%ld", value);
440 GET(list.lists[i], MUIA_List_First, &value);
441 DoMethod(list.first_text, MUIM_SetAsString, MUIA_Text_Contents,
442 "%ld", value);
443 GET(list.lists[i], MUIA_List_InsertPosition, &value);
444 DoMethod(list.insert_text, MUIM_SetAsString, MUIA_Text_Contents,
445 "%ld", value);
446 GET(list.lists[i], MUIA_List_Active, &value);
447 if (value == MUIV_List_Active_Off)
448 SET(list.active_text, MUIA_Text_Contents, "N/A");
449 else
450 DoMethod(list.active_text, MUIM_SetAsString, MUIA_Text_Contents,
451 "%ld", value);
452 DoMethod(list.lists[i], MUIM_List_Select, MUIV_List_Select_All,
453 MUIV_List_Select_Ask, (IPTR) &value);
454 DoMethod(list.selected_text, MUIM_SetAsString, MUIA_Text_Contents,
455 "%ld", value);
456 GET(list.lists[i], MUIA_List_DropMark, &value);
457 DoMethod(list.drop_text, MUIM_SetAsString, MUIA_Text_Contents,
458 "%ld", value);
461 static void ListGetVisible(void)
463 UWORD i;
464 LONG value = 0;
466 i = XGET(list.list_radios, MUIA_Radio_Active);
468 GET(list.lists[i], MUIA_List_Visible, &value);
469 DoMethod(list.visible_text, MUIM_SetAsString, MUIA_Text_Contents,
470 "%ld", value);
473 static void ListGetFirst(void)
475 UWORD i;
476 LONG value = 0;
477 Object *real_list;
479 i = XGET(list.list_radios, MUIA_Radio_Active);
481 /* We fetch the Listview's list here to provide test coverage for that
482 attribute. Please don't optimise */
483 real_list = (Object *)XGET(list.lists[i], MUIA_Listview_List);
484 GET(real_list, MUIA_List_First, &value);
485 DoMethod(list.first_text, MUIM_SetAsString, MUIA_Text_Contents,
486 "%ld", value);
489 static void ListGetSelected(void)
491 UWORD i;
492 LONG value = 0;
494 i = XGET(list.list_radios, MUIA_Radio_Active);
496 DoMethod(list.lists[i], MUIM_List_Select, MUIV_List_Select_All,
497 MUIV_List_Select_Ask, (IPTR) &value);
498 DoMethod(list.selected_text, MUIM_SetAsString, MUIA_Text_Contents,
499 "%ld", value);
502 static void ListSetDraggable(void)
504 UWORD i;
505 LONG value = 0;
507 i = XGET(list.list_radios, MUIA_Radio_Active);
509 GET(list.draggable_check, MUIA_Selected, &value);
510 SET(list.lists[i], MUIA_Listview_DragType, value ?
511 MUIV_Listview_DragType_Immediate : MUIV_Listview_DragType_None);
514 static void ListSetShowDropMarks(void)
516 UWORD i;
517 LONG value = 0;
519 i = XGET(list.list_radios, MUIA_Radio_Active);
521 GET(list.showdropmarks_check, MUIA_Selected, &value);
522 SET(list.lists[i], MUIA_List_ShowDropMarks, value);
525 static void ListSetMultiTest(void)
527 UWORD i;
528 LONG value = 0;
530 i = XGET(list.list_radios, MUIA_Radio_Active);
532 GET(list.multitest_check, MUIA_Selected, &value);
533 SET(list.lists[i], MUIA_List_MultiTestHook, value ? &hook_multitest : NULL);
534 list.has_multitest[i] = value;
537 static void ListSetQuiet(void)
539 UWORD i;
540 LONG value = 0;
542 i = XGET(list.list_radios, MUIA_Radio_Active);
544 GET(list.quiet_check, MUIA_Selected, &value);
545 SET(list.lists[i], MUIA_List_Quiet, value);
546 list.quiet[i] = value;
549 static void ListSetDragSortable(void)
551 UWORD i;
552 LONG value = 0;
554 i = XGET(list.list_radios, MUIA_Radio_Active);
556 GET(list.dragsortable_check, MUIA_Selected, &value);
557 SET(list.lists[i], MUIA_List_DragSortable, value);
560 static void ListSetAutoVisible(void)
562 UWORD i;
563 LONG value = 0;
565 i = XGET(list.list_radios, MUIA_Radio_Active);
567 GET(list.autovisible_check, MUIA_Selected, &value);
568 SET(list.lists[i], MUIA_List_AutoVisible, value);
571 static void ListReset(void)
573 UWORD i;
575 i = XGET(list.list_radios, MUIA_Radio_Active);
577 SET(list.lists[i], MUIA_List_Active, list_active_positions[i]);
580 static void ListMove(void)
582 LONG mode, pos1, pos2;
583 UWORD i;
585 i = XGET(list.list_radios, MUIA_Radio_Active);
587 mode = XGET(list.move1_cycle, MUIA_Cycle_Active);
589 if (mode == 0)
590 pos1 = XGET(list.index1_string, MUIA_String_Integer);
591 else
592 pos1 = 1 - mode;
594 mode = XGET(list.move2_cycle, MUIA_Cycle_Active);
596 if (mode == 0)
597 pos2 = XGET(list.index2_string, MUIA_String_Integer);
598 else
599 pos2 = 1 - mode;
601 DoMethod(list.lists[i], MUIM_List_Move, pos1, pos2);
604 static void ListSort(void)
606 UWORD i;
608 i = XGET(list.list_radios, MUIA_Radio_Active);
610 DoMethod(list.lists[i], MUIM_List_Sort);
613 static void ListEnable(void)
615 UWORD i;
617 i = XGET(list.list_radios, MUIA_Radio_Active);
619 SET(list.lists[i], MUIA_Disabled, FALSE);
622 static void ListExchange(void)
624 LONG mode, pos1, pos2;
625 UWORD i;
627 i = XGET(list.list_radios, MUIA_Radio_Active);
629 mode = XGET(list.move1_cycle, MUIA_Cycle_Active);
631 if (mode == 0)
632 pos1 = XGET(list.index1_string, MUIA_String_Integer);
633 else
634 pos1 = 1 - mode;
636 mode = XGET(list.move2_cycle, MUIA_Cycle_Active);
638 if (mode == 0)
639 pos2 = XGET(list.index2_string, MUIA_String_Integer);
640 else
641 pos2 = 1 - mode;
643 DoMethod(list.lists[i], MUIM_List_Exchange, pos1, pos2);
646 static void ListJump(void)
648 LONG mode, pos;
649 UWORD i;
651 i = XGET(list.list_radios, MUIA_Radio_Active);
653 mode = XGET(list.jump_cycle, MUIA_Cycle_Active);
655 if (mode == 0)
656 pos = XGET(list.index1_string, MUIA_String_Integer);
657 else
658 pos = 1 - mode;
660 DoMethod(list.lists[i], MUIM_List_Jump, pos);
663 static void ListSelect(void)
665 LONG mode, pos;
666 UWORD i;
668 i = XGET(list.list_radios, MUIA_Radio_Active);
670 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
672 if (mode == 0)
673 pos = XGET(list.index1_string, MUIA_String_Integer);
674 else
675 pos = 0 - mode;
677 DoMethod(list.lists[i], MUIM_List_Select, pos, MUIV_List_Select_On,
678 NULL);
681 static void ListDeselect(void)
683 LONG mode, pos;
684 UWORD i;
686 i = XGET(list.list_radios, MUIA_Radio_Active);
688 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
690 if (mode == 0)
691 pos = XGET(list.index1_string, MUIA_String_Integer);
692 else
693 pos = 0 - mode;
695 DoMethod(list.lists[i], MUIM_List_Select, pos, MUIV_List_Select_Off,
696 NULL);
699 static void ListToggle(void)
701 LONG mode, pos;
702 UWORD i;
704 i = XGET(list.list_radios, MUIA_Radio_Active);
706 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
708 if (mode == 0)
709 pos = XGET(list.index1_string, MUIA_String_Integer);
710 else
711 pos = 0 - mode;
713 DoMethod(list.lists[i], MUIM_List_Select, pos,
714 MUIV_List_Select_Toggle, NULL);
717 static void ListRedraw(void)
719 LONG mode, pos;
720 UWORD i;
722 i = XGET(list.list_radios, MUIA_Radio_Active);
724 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
726 if (mode == 0)
727 pos = XGET(list.index1_string, MUIA_String_Integer);
728 else
729 pos = 0 - mode;
731 DoMethod(list.lists[i], MUIM_List_Redraw, pos);
734 static void ListInsertSingle(void)
736 LONG mode, pos;
737 UWORD i;
739 i = XGET(list.list_radios, MUIA_Radio_Active);
741 mode = XGET(list.insert_cycle, MUIA_Cycle_Active);
743 if (mode == 0)
744 pos = XGET(list.index1_string, MUIA_String_Integer);
745 else
746 pos = 1 - mode;
748 DoMethod(list.lists[i], MUIM_List_InsertSingle, "Tomato", pos);
751 static void ListInsert(void)
753 LONG mode, pos;
754 UWORD i;
756 i = XGET(list.list_radios, MUIA_Radio_Active);
758 mode = XGET(list.insert_cycle, MUIA_Cycle_Active);
760 if (mode == 0)
761 pos = XGET(list.index1_string, MUIA_String_Integer);
762 else
763 pos = 1 - mode;
765 DoMethod(list.lists[i], MUIM_List_Insert, fruits, -1, pos);
768 static void ListRemove(void)
770 LONG mode, pos, count, j, *selections;
771 UWORD i;
773 i = XGET(list.list_radios, MUIA_Radio_Active);
775 mode = XGET(list.remove_cycle, MUIA_Cycle_Active);
777 if (mode == 5)
779 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
780 This doesn't work as expected in MUI or Zune */
781 pos = MUIV_List_NextSelected_Start - 1;
782 while (pos != MUIV_List_NextSelected_End)
784 if (pos == MUIV_List_NextSelected_Start - 1)
785 pos++;
786 DoMethod(list.lists[i], MUIM_List_NextSelected, (IPTR) &pos);
787 if (pos != MUIV_List_NextSelected_End)
788 DoMethod(list.lists[i], MUIM_List_Remove, pos);
791 else if (mode == 6)
793 /* Remove selected entries safely by first retrieving them with
794 MUIM_List_NextSelected and then removing them one by one */
795 DoMethod(list.lists[i], MUIM_List_Select, MUIV_List_Select_All,
796 MUIV_List_Select_Ask, &count);
797 if (count == 0)
798 count = 1; /* There may still be an active entry */
799 selections = AllocVec(sizeof(LONG) * count, MEMF_ANY);
800 if (selections != NULL)
802 pos = MUIV_List_NextSelected_Start;
803 for (j = 0; j < count; j++)
805 DoMethod(list.lists[i], MUIM_List_NextSelected, (IPTR) &pos);
806 selections[j] = pos;
809 /* We must remove the entries in reverse order; otherwise the
810 later indices will become invalid */
811 while (count > 0)
812 DoMethod(list.lists[i], MUIM_List_Remove, selections[--count]);
813 FreeVec(selections);
816 else
818 if (mode == 0)
819 pos = XGET(list.index1_string, MUIA_String_Integer);
820 else
821 pos = 1 - mode;
822 DoMethod(list.lists[i], MUIM_List_Remove, pos);
826 static void ListClear(void)
828 UWORD i;
830 i = XGET(list.list_radios, MUIA_Radio_Active);
832 DoMethod(list.lists[i], MUIM_List_Clear);
835 static void ListActivate(void)
837 LONG mode, pos;
838 UWORD i;
840 i = XGET(list.list_radios, MUIA_Radio_Active);
842 mode = XGET(list.activate_cycle, MUIA_Cycle_Active);
844 if (mode == 0)
845 pos = XGET(list.index1_string, MUIA_String_Integer);
846 else
847 pos = -1 - mode;
849 SET(list.lists[i], MUIA_List_Active, pos);
852 static void ListDeactivate(void)
854 UWORD i;
856 i = XGET(list.list_radios, MUIA_Radio_Active);
858 SET(list.lists[i], MUIA_List_Active, MUIV_List_Active_Off);
861 static void CheckListDoubleClick(void)
863 LONG value = -1;
865 GET(list.multi_lists[1], MUIA_Listview_DoubleClick, &value);
866 MUI_Request(app, wnd, 0, "Test", "OK",
867 "MUIA_Listview_Doubleclick = %ld", value);
870 AROS_UFH3(static APTR, ListConstructHook,
871 AROS_UFHA(struct Hook *, h, A0),
872 AROS_UFHA(APTR, pool, A2),
873 AROS_UFHA(IPTR, n, A1))
875 AROS_USERFUNC_INIT
877 struct list_entry *entry;
879 entry = AllocPooled(pool, sizeof(struct list_entry) + 40);
881 if (entry != NULL)
883 entry->column1 = (char *)(entry + 1);
884 entry->column2 = entry->column1 + 20;
885 sprintf(entry->column1, "Entry%ld", (long)n);
886 sprintf(entry->column2, "Col2: Entry%ld", (long)n);
889 return entry;
891 AROS_USERFUNC_EXIT
894 AROS_UFH3(static void, ListDestructHook,
895 AROS_UFHA(struct Hook *, h, A0),
896 AROS_UFHA(APTR, pool, A2),
897 AROS_UFHA(struct list_entry *, entry, A1))
899 AROS_USERFUNC_INIT
901 FreePooled(pool, entry, sizeof(struct list_entry) + 40);
902 list.destruct_count++;
904 AROS_USERFUNC_EXIT
907 AROS_UFH3(static void, display_function,
908 AROS_UFHA(struct Hook *, h, A0),
909 AROS_UFHA(char **, strings, A2),
910 AROS_UFHA(struct list_entry *, entry, A1))
912 AROS_USERFUNC_INIT
914 static char buf[100];
916 if (entry)
918 if (XGET(list.showimage_check, MUIA_Selected))
919 sprintf(buf, "%ld \33O[%08lx]", (long)*(strings - 1),
920 (long)list.image);
921 else
922 sprintf(buf, "%ld", (long)*(strings - 1));
923 strings[0] = buf;
924 strings[1] = entry->column1;
925 strings[2] = entry->column2;
927 else
929 strings[0] = "Number";
930 strings[1] = "Column 1";
931 strings[2] = "Column 2";
934 AROS_USERFUNC_EXIT
937 static void Save(void)
939 char *text = (char *)XGET(editor_text, MUIA_String_Contents);
940 char *filename = (char *)XGET(filename_string, MUIA_String_Contents);
941 BPTR fh;
943 if (!strlen(filename))
944 return;
946 if ((fh = Open(filename, MODE_NEWFILE)))
948 Write(fh, text, strlen(text));
949 Close(fh);
953 #if defined(TEST_ICONLIST)
954 /* IconList callbacks */
955 static void volume_doubleclicked(void)
957 char buf[200];
958 struct IconList_Entry *ent = (void *)MUIV_IconList_NextIcon_Start;
960 DoMethod(volume_iconlist, MUIM_IconList_NextIcon,
961 MUIV_IconList_NextIcon_Selected, &ent);
962 if ((IPTR) ent == MUIV_IconList_NextIcon_End)
963 return;
965 strcpy(buf, ent->label);
966 strcat(buf, ":");
969 static void drawer_doubleclicked(void)
971 struct IconList_Entry *ent = (void *)MUIV_IconList_NextIcon_Start;
973 DoMethod(drawer_iconlist, MUIM_IconList_NextIcon,
974 MUIV_IconList_NextIcon_Selected, &ent);
975 if ((IPTR) ent == MUIV_IconList_NextIcon_End)
976 return;
977 set(drawer_iconlist, MUIA_IconDrawerList_Drawer,
978 ent->ile_IconEntry->ie_IconNode.ln_Name);
980 #endif
982 static IPTR create_balance_column(void)
984 return (IPTR) VGroup,
985 Child, RectangleObject,
986 GaugeFrame,
987 End,
988 Child, BalanceObject,
989 End,
990 Child, RectangleObject,
991 GaugeFrame,
992 End,
993 Child, BalanceObject,
994 End,
995 Child, RectangleObject,
996 GaugeFrame,
997 End,
998 Child, BalanceObject,
999 End,
1000 Child, RectangleObject,
1001 GaugeFrame,
1002 End,
1003 Child, BalanceObject,
1004 End,
1005 Child, RectangleObject,
1006 GaugeFrame,
1007 End,
1008 End;
1011 /* The custom class */
1013 struct DropText_Data
1015 ULONG times;
1018 #ifdef __MAXON__
1019 #undef KeymapBase
1020 struct Library *KeymapBase;
1021 #endif
1023 #ifndef __AROS__
1024 __saveds __asm IPTR dispatcher(register __a0 struct IClass *cl,
1025 register __a2 Object *obj, register __a1 Msg msg)
1026 #else
1027 AROS_UFH3S(IPTR, dispatcher,
1028 AROS_UFHA(Class *, cl, A0),
1029 AROS_UFHA(Object *, obj, A2), AROS_UFHA(Msg, msg, A1))
1030 #endif
1032 AROS_USERFUNC_INIT
1034 switch (msg->MethodID)
1036 case MUIM_DragQuery:
1037 return MUIV_DragQuery_Accept;
1038 case MUIM_DragDrop:
1040 struct DropText_Data *data =
1041 (struct DropText_Data *)INST_DATA(cl, obj);
1042 char buf[100];
1043 data->times++;
1044 sprintf(buf, "%ld times", (long)data->times);
1045 set(obj, MUIA_Text_Contents, buf);
1049 return DoSuperMethodA(cl, obj, (Msg) msg);
1051 AROS_USERFUNC_EXIT
1054 static struct MUI_CustomClass *CL_DropText;
1056 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
1058 /* Custom Window subclass */
1060 struct TestWindowData
1062 ULONG x;
1065 IPTR TestWindow__OM_SET(struct IClass *cl, Object *obj,
1066 struct opSet *msg)
1068 struct TagItem *tags;
1069 struct TagItem *tag;
1071 for (tags = msg->ops_AttrList; (tag = NextTagItem(&tags));)
1073 switch (tag->ti_Tag)
1075 case MUIA_Window_Open:
1076 if (tag->ti_Data)
1077 SET(obj, MUIA_Window_ActiveObject, general.open_button);
1078 break;
1082 return DoSuperMethodA(cl, obj, (Msg) msg);
1085 AROS_UFH3S(IPTR, TestWindowDispatcher,
1086 AROS_UFHA(Class *, cl, A0),
1087 AROS_UFHA(Object *, obj, A2),
1088 AROS_UFHA(Msg, msg, A1))
1090 AROS_USERFUNC_INIT
1092 switch (msg->MethodID)
1094 case OM_SET:
1095 return TestWindow__OM_SET(cl, obj, (struct opSet *)msg);
1096 default:
1097 return DoSuperMethodA(cl, obj, (Msg) msg);
1100 AROS_USERFUNC_EXIT
1103 static struct MUI_CustomClass *test_window_class;
1105 #define TestWindowObject BOOPSIOBJMACRO_START(test_window_class->mcc_Class)
1107 /* Main prog */
1109 AROS_UFH3S(void, hook_func_standard,
1110 AROS_UFHA(struct Hook *, h, A0),
1111 AROS_UFHA(void *, dummy, A2), AROS_UFHA(void **, funcptr, A1))
1113 AROS_USERFUNC_INIT
1115 void (*func) (ULONG *) = (void (*)(ULONG *))(*funcptr);
1117 if (func)
1118 func((ULONG *) funcptr + 1);
1120 AROS_USERFUNC_EXIT
1123 int main(void)
1125 LONG result = RETURN_OK;
1126 APTR pool;
1127 Object *second_wnd;
1128 Object *about_button;
1129 Object *quit_button;
1130 Object *repeat_button;
1131 Object *objects_button;
1132 Object *about_item, *quit_item;
1133 Object *context_menu;
1134 Object *popobject, *listview;
1135 Object *numerics[NUMERIC_COUNT];
1136 Object *min_string, *max_string;
1137 Object *slider_button;
1138 Object *country_radio[2];
1139 CONST_STRPTR title;
1140 UWORD i;
1141 LONG value = 0;
1143 static char *pages[] =
1144 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
1145 "Numeric", "Radio",
1146 #if defined(TEST_ICONLIST)
1147 "Icon List",
1148 #endif
1149 "Balancing", NULL};
1150 static char *text_pages[] =
1151 {"Text", "String", NULL};
1152 static char *color_pages[] =
1153 {"Palette", "Colors", "Pens", NULL};
1154 static char *list_pages[] =
1155 {"Single Column", "Multicolumn", NULL};
1156 static char **radio_entries1 = pages;
1157 static char *radio_entries2[] =
1158 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL};
1160 static IPTR entries[] = {1, 2, 3, 4, 5, 6, (IPTR)NULL};
1162 hook_standard.h_Entry = (HOOKFUNC) hook_func_standard;
1163 hook_objstr.h_Entry = (HOOKFUNC) ObjStrHook;
1165 pool = CreatePool(MEMF_ANY, 4096, 4096);
1167 MUIMasterBase = (struct Library *)OpenLibrary("muimaster.library", 0);
1169 hook.h_Entry = (HOOKFUNC) repeat_function;
1170 hook_wheel.h_Entry = (HOOKFUNC) wheel_function;
1171 hook_slider.h_Entry = (HOOKFUNC) slider_function;
1172 hook_objects.h_Entry = (HOOKFUNC) objects_function;
1173 hook_compare.h_Entry = (HOOKFUNC) ListCompareHook;
1174 hook_multitest.h_Entry = (HOOKFUNC) ListMultiTestHook;
1175 hook_construct.h_Entry = (HOOKFUNC) ListConstructHook;
1176 hook_destruct.h_Entry = (HOOKFUNC) ListDestructHook;
1177 hook_display.h_Entry = (HOOKFUNC) display_function;
1178 list.destruct_count = 0;
1179 list.has_multitest[3] = TRUE;
1181 context_menu = MenustripObject,
1182 MUIA_Family_Child, MenuObject,
1183 MUIA_Menu_Title, "Menutest",
1184 MUIA_Family_Child, about_item = MenuitemObject,
1185 MUIA_Menuitem_Title, "First Test Entry", End,
1186 MUIA_Family_Child, quit_item = MenuitemObject,
1187 MUIA_Menuitem_Title, "Second Test Entry", End,
1188 End,
1189 End;
1191 /* should check the result in a real program! */
1192 CL_DropText = MUI_CreateCustomClass(NULL, MUIC_Text, NULL,
1193 sizeof(struct DropText_Data), dispatcher);
1194 test_window_class = MUI_CreateCustomClass(NULL, MUIC_Window, NULL,
1195 sizeof(struct TestWindowData), TestWindowDispatcher);
1196 ColorWheelBase = OpenLibrary("gadgets/colorwheel.gadget", 0);
1198 pendisplay = PendisplayObject, MUIA_Pendisplay_Spec, &default_penspec, End;
1200 title = StrDup("Fruits");
1201 list.lists[0] = ListviewObject,
1202 MUIA_Listview_List,
1203 ListObject,
1204 InputListFrame,
1205 MUIA_List_Title, title,
1206 MUIA_List_SourceArray, fruits,
1207 MUIA_List_Active, MUIV_List_Active_Top,
1208 MUIA_List_PoolThreshSize, 256,
1209 MUIA_List_DragSortable, TRUE,
1210 MUIA_List_CompareHook, &hook_compare,
1211 MUIA_ShortHelp,
1212 "Default scroller\nTop entry active\nSorted by length",
1213 End,
1214 MUIA_Listview_MultiSelect,
1215 MUIV_Listview_MultiSelect_None,
1216 MUIA_Listview_DragType, MUIV_Listview_DragType_Immediate,
1217 MUIA_Listview_DoubleClick, TRUE,
1218 MUIA_CycleChain, 1,
1219 End;
1220 list.lists[1] = ListviewObject,
1221 MUIA_Listview_List,
1222 ListObject,
1223 InputListFrame,
1224 MUIA_List_SourceArray, fruits,
1225 MUIA_List_Active, MUIV_List_Active_Bottom,
1226 MUIA_List_PoolPuddleSize, 512,
1227 MUIA_List_AutoVisible, TRUE,
1228 MUIA_ShortHelp,
1229 "Left scroller\nBottom entry active\nSorted alphabetically",
1230 End,
1231 MUIA_Listview_ScrollerPos,
1232 MUIV_Listview_ScrollerPos_Left,
1233 MUIA_Listview_DragType, MUIV_Listview_DragType_None,
1234 MUIA_CycleChain, 1,
1235 End;
1236 list.lists[2] = ListviewObject,
1237 MUIA_Listview_List,
1238 ListObject,
1239 InputListFrame,
1240 MUIA_List_SourceArray, fruits,
1241 MUIA_List_Active, MUIV_List_Active_Off,
1242 MUIA_List_Pool, pool,
1243 MUIA_ShortHelp,
1244 "Right scroller\nNo active entry\nSorted alphabetically",
1245 End,
1246 MUIA_Listview_MultiSelect,
1247 MUIV_Listview_MultiSelect_Shifted,
1248 MUIA_Listview_ScrollerPos,
1249 MUIV_Listview_ScrollerPos_Right,
1250 MUIA_CycleChain, 1,
1251 End;
1252 list.lists[3] = ListviewObject,
1253 MUIA_Listview_List,
1254 ListObject,
1255 InputListFrame,
1256 MUIA_List_SourceArray, fruits,
1257 MUIA_List_Pool, NULL,
1258 MUIA_List_MultiTestHook, &hook_multitest,
1259 MUIA_ShortHelp,
1260 "No scroller\nDefault active entry\nSorted alphabetically",
1261 End,
1262 MUIA_Listview_MultiSelect,
1263 MUIV_Listview_MultiSelect_Always,
1264 MUIA_Listview_ScrollerPos,
1265 MUIV_Listview_ScrollerPos_None,
1266 MUIA_CycleChain, 1,
1267 End;
1268 list.lists[4] = ListviewObject,
1269 MUIA_Listview_List,
1270 ListObject,
1271 ReadListFrame,
1272 MUIA_List_SourceArray, fruits,
1273 MUIA_List_Active, MUIV_List_Active_Bottom,
1274 MUIA_List_MinLineHeight, 20,
1275 MUIA_ShortHelp,
1276 "Default scroller\nBottom entry active\nSorted by length",
1277 End,
1278 MUIA_Listview_Input, FALSE,
1279 MUIA_CycleChain, 1,
1280 End;
1282 list.colorfield = ColorfieldObject,
1283 MUIA_Colorfield_RGB, default_color,
1284 End;
1286 if (CL_DropText == NULL || test_window_class == NULL)
1287 result = RETURN_FAIL;
1289 if (result == RETURN_OK)
1291 app = ApplicationObject,
1292 MUIA_Application_Menustrip, MenustripObject,
1293 MUIA_Family_Child, MenuObject,
1294 MUIA_Menu_Title, "Project",
1295 MUIA_Family_Child, about_item = MenuitemObject,
1296 MUIA_Menuitem_Title, "About...",
1297 MUIA_Menuitem_Shortcut, "?",
1298 End,
1299 MUIA_Family_Child, MenuitemObject,
1300 MUIA_Menuitem_Title, (SIPTR)-1,
1301 End,
1302 MUIA_Family_Child, quit_item = MenuitemObject,
1303 MUIA_Menuitem_Title, "Quit",
1304 MUIA_Menuitem_Shortcut, "Q",
1305 End,
1306 End,
1307 End,
1309 SubWindow, wnd = TestWindowObject,
1310 MUIA_Window_Title, "test",
1311 MUIA_Window_Activate, TRUE,
1313 WindowContents, VGroup,
1314 Child, RegisterGroup(pages),
1315 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1317 /* general */
1318 Child, VGroup,
1319 Child, HGroup,
1320 GroupFrameT("A horizontal group"),
1321 Child, ColGroup(2),
1322 GroupFrameT("A column group"),
1323 Child, repeat_button = TextObject,
1324 MUIA_CycleChain, 1,
1325 ButtonFrame,
1326 MUIA_Background, MUII_ButtonBack,
1327 MUIA_Text_PreParse, "\33c",
1328 MUIA_Text_Contents, "Repeat",
1329 MUIA_InputMode,
1330 MUIV_InputMode_RelVerify,
1331 End,
1332 Child, TextObject,
1333 MUIA_CycleChain, 1,
1334 ButtonFrame,
1335 MUIA_Background, MUII_ButtonBack,
1336 MUIA_Text_PreParse, "\33c",
1337 MUIA_Text_Contents, "Drag Me",
1338 MUIA_Draggable, TRUE,
1339 MUIA_InputMode,
1340 MUIV_InputMode_RelVerify,
1341 End,
1342 Child, general.open_button = TextObject,
1343 MUIA_CycleChain, 1,
1344 ButtonFrame,
1345 MUIA_Background, MUII_ButtonBack,
1346 MUIA_Text_PreParse, "\33c",
1347 MUIA_Text_Contents, "Open Window",
1348 MUIA_InputMode,
1349 MUIV_InputMode_RelVerify,
1350 End,
1351 Child, TextObject,
1352 MUIA_ContextMenu, context_menu,
1353 MUIA_CycleChain, 1,
1354 ButtonFrame,
1355 MUIA_Background, MUII_ButtonBack,
1356 MUIA_Text_PreParse, "\33c",
1357 MUIA_Text_Contents, "Press Right",
1358 MUIA_InputMode,
1359 MUIV_InputMode_RelVerify,
1360 End,
1361 Child, objects_button = TextObject,
1362 MUIA_CycleChain, 1,
1363 ButtonFrame,
1364 MUIA_Background, MUII_ButtonBack,
1365 MUIA_Text_PreParse, "\33c",
1366 MUIA_Text_Contents, "Add Objects",
1367 MUIA_InputMode,
1368 MUIV_InputMode_RelVerify,
1369 End,
1370 Child, HVSpace,
1371 Child, HGroup,
1372 Child, HVSpace,
1373 Child, MUI_MakeObject(MUIO_Checkmark,
1374 "_Checkmark"),
1375 End,
1376 Child, HGroup,
1377 Child, MUI_MakeObject(MUIO_Label,
1378 "_Checkmark", 0),
1379 Child, HVSpace,
1380 End,
1381 Child, HVSpace,
1382 Child, HVSpace,
1383 End,
1384 Child, group = VGroup,
1385 GroupFrameT("A vertical group"),
1386 Child, DropTextObject,
1387 MUIA_Dropable, TRUE,
1388 MUIA_CycleChain, 1,
1389 ButtonFrame,
1390 MUIA_Background, MUII_ButtonBack,
1391 MUIA_Text_PreParse, "\33c",
1392 MUIA_Text_Contents, "Drop Here",
1393 MUIA_Dropable, TRUE,
1394 MUIA_InputMode,
1395 MUIV_InputMode_RelVerify,
1396 End,
1397 Child, TextObject,
1398 TextFrame,
1399 MUIA_Background, MUII_MARKHALFSHINE,
1400 MUIA_CycleChain, 1,
1401 MUIA_Text_PreParse, "\33c",
1402 MUIA_Text_Contents, "Pattern",
1403 End,
1404 Child,
1405 MUI_NewObject(MUIC_Popimage, TAG_DONE),
1406 End,
1407 Child, ScrollgroupObject,
1408 GroupFrameT("A scroll group"),
1409 MUIA_Scrollgroup_Contents, VGroupV,
1410 VirtualFrame,
1411 Child, TextObject,
1412 TextFrame,
1413 MUIA_Text_Contents,
1414 "Line1\nLine2\nLine3\nLine4\n"
1415 "Line5\nLine6\nLine7\nLine8\n"
1416 "\n\n\n"
1417 "Line9\nLine10\nLine11\n",
1418 End,
1419 Child, HGroup,
1420 Child, MUI_MakeObject(MUIO_Button,
1421 "Button9"),
1422 Child, MUI_MakeObject(MUIO_Button,
1423 "Button10"),
1424 End,
1425 End,
1426 End,
1427 End,
1428 Child, popobject = PopobjectObject,
1429 MUIA_Popstring_String,
1430 MUI_MakeObject(MUIO_String, NULL, 200),
1431 MUIA_Popstring_Button, PopButton(MUII_PopUp),
1432 MUIA_Popobject_Object, VGroup,
1433 Child, TextObject,
1434 MUIA_Text_Contents, "test",
1435 End,
1436 Child, listview = ListviewObject,
1437 MUIA_Listview_List, ListObject,
1438 InputListFrame,
1439 MUIA_List_ConstructHook,
1440 &hook_construct,
1441 MUIA_List_DestructHook,
1442 &hook_destruct,
1443 MUIA_List_DisplayHook,
1444 &hook_display,
1445 MUIA_List_Format, ",,",
1446 MUIA_List_SourceArray, entries,
1447 MUIA_List_Title, TRUE,
1448 End,
1449 End,
1450 End,
1451 MUIA_Popobject_ObjStrHook, &hook_objstr,
1452 End,
1453 Child, CycleObject,
1454 ButtonFrame,
1455 MUIA_Cycle_Entries, pages,
1456 End,
1457 Child, ScrollbarObject,
1458 MUIA_Group_Horiz, TRUE,
1459 MUIA_Prop_Visible, 100,
1460 MUIA_Prop_Entries, 300,
1461 MUIA_Prop_First, 50,
1462 End,
1463 End,
1465 /* text */
1466 Child, RegisterGroup(text_pages),
1468 Child, VGroup,
1469 Child, TextObject,
1470 MUIA_Background, "2:cfffffff,cfffffff,10000000",
1471 TextFrame,
1472 MUIA_Text_Contents, "\33cHello World!\n"
1473 "This is a text object\n\33lLeft "
1474 "\33bbold\33n\n"
1475 "\33rRight",
1476 End,
1477 Child, TextObject,
1478 TextFrame,
1479 /* Test for a bug with pen specifications as
1480 reported here:
1481 https://sourceforge.net/p/aros/bugs/487/
1483 MUIA_Text_Contents,
1484 "This is a \33P[3]text \33P[]object "
1485 "\33P[1]with pen specifications",
1486 End,
1487 Child, RectangleObject,
1488 MUIA_VertWeight, 0,
1489 /* Seems to be not supported properly as
1490 orginal MUI doesn't allow to alter the
1491 height of the window */
1492 MUIA_Rectangle_HBar, TRUE,
1493 MUIA_Rectangle_BarTitle,"Enter a string",
1494 End,
1495 Child, StringObject,
1496 StringFrame,
1497 MUIA_CycleChain,1,
1498 MUIA_String_AdvanceOnCR, TRUE,
1499 End,
1500 Child, HVSpace,
1501 End,
1503 /* string */
1504 Child, HGroup,
1505 Child, VGroup,
1506 Child, VGroup,
1507 GroupFrameT("Default Alignment"),
1508 Child, string.strings[0] = StringObject,
1509 StringFrame,
1510 MUIA_String_Accept,
1511 (IPTR)default_accept_chars,
1512 MUIA_String_Reject,
1513 (IPTR)default_reject_chars,
1514 MUIA_String_AdvanceOnCR, TRUE,
1515 MUIA_String_MaxLen, 9,
1516 MUIA_CycleChain, 1,
1517 MUIA_String_AttachedList,
1518 list.lists[0],
1519 End,
1520 End,
1521 Child, VGroup, GroupFrameT("Left Aligned"),
1522 Child, string.strings[1] = StringObject,
1523 StringFrame,
1524 MUIA_String_Accept,
1525 (IPTR)default_accept_chars,
1526 MUIA_String_Reject,
1527 (IPTR)default_reject_chars,
1528 MUIA_String_Format,
1529 MUIV_String_Format_Left,
1530 MUIA_String_AdvanceOnCR, TRUE,
1531 MUIA_String_MaxLen, 9,
1532 MUIA_CycleChain, 1,
1533 MUIA_String_Contents,
1534 (IPTR)default_accept_chars,
1535 MUIA_String_BufferPos, 3,
1536 MUIA_String_AttachedList,
1537 list.lists[0],
1538 End,
1539 End,
1540 Child, VGroup, GroupFrameT("Right Aligned"),
1541 Child, string.strings[2] = StringObject,
1542 StringFrame,
1543 MUIA_String_Accept,
1544 (IPTR)default_accept_chars,
1545 MUIA_String_Reject,
1546 (IPTR)default_reject_chars,
1547 MUIA_String_Format,
1548 MUIV_String_Format_Right,
1549 MUIA_String_AdvanceOnCR, TRUE,
1550 MUIA_String_MaxLen, 9,
1551 MUIA_CycleChain, 1,
1552 MUIA_String_AttachedList,
1553 list.lists[0],
1554 End,
1555 End,
1556 Child, VGroup, GroupFrameT("Centered"),
1557 Child, string.strings[3] = StringObject,
1558 StringFrame,
1559 MUIA_String_Accept,
1560 (IPTR)default_accept_chars,
1561 MUIA_String_Reject,
1562 (IPTR)default_reject_chars,
1563 MUIA_String_Format,
1564 MUIV_String_Format_Center,
1565 MUIA_String_AdvanceOnCR, TRUE,
1566 MUIA_String_MaxLen, 9,
1567 MUIA_CycleChain, 1,
1568 MUIA_String_Integer, 123,
1569 MUIA_String_AttachedList,
1570 list.lists[0],
1571 End,
1572 End,
1573 Child, VGroup, GroupFrameT("Secret"),
1574 Child, string.strings[4] = StringObject,
1575 StringFrame,
1576 MUIA_String_Accept,
1577 (IPTR)default_accept_chars,
1578 MUIA_String_Reject,
1579 (IPTR)default_reject_chars,
1580 MUIA_String_Format,
1581 MUIV_String_Format_Center,
1582 MUIA_String_Secret, TRUE,
1583 MUIA_String_AdvanceOnCR, TRUE,
1584 MUIA_String_MaxLen, 9,
1585 MUIA_CycleChain, 1,
1586 MUIA_String_AttachedList,
1587 list.lists[0],
1588 End,
1589 End,
1590 Child, HGroup, GroupFrameT("Narrow"),
1591 Child, HVSpace,
1592 Child, string.strings[5] = StringObject,
1593 StringFrame,
1594 MUIA_String_Accept,
1595 (IPTR)default_accept_chars,
1596 MUIA_String_Reject,
1597 (IPTR)default_reject_chars,
1598 MUIA_String_Format,
1599 MUIV_String_Format_Center,
1600 MUIA_String_AdvanceOnCR, TRUE,
1601 MUIA_MaxWidth, 20,
1602 MUIA_String_MaxLen, 9,
1603 MUIA_CycleChain, 1,
1604 MUIA_String_AttachedList,
1605 list.lists[0],
1606 End,
1607 Child, HVSpace,
1608 End,
1609 Child, HVSpace,
1610 End,
1611 Child, VGroup, GroupFrameT("Controls"),
1612 Child, HGroup,
1613 Child, string.accept_all_check =
1614 MUI_MakeObject(MUIO_Checkmark, NULL),
1615 Child, MUI_MakeObject(MUIO_Label,
1616 "Accept all characters", 0),
1617 Child, HVSpace,
1618 End,
1619 Child, ColGroup(2),
1620 Child, MUI_MakeObject(MUIO_Label,
1621 "Acceptable characters:", 0),
1622 Child, string.accept_string =
1623 StringObject,
1624 StringFrame,
1625 MUIA_String_Contents,
1626 (IPTR)default_accept_chars,
1627 End,
1628 Child, MUI_MakeObject(MUIO_Label,
1629 "Unacceptable characters:", 0),
1630 Child, string.reject_string =
1631 StringObject,
1632 StringFrame,
1633 End,
1634 Child, MUI_MakeObject(MUIO_Label,
1635 "Cursor position:", 0),
1636 Child, string.cursor_pos_slider =
1637 SliderObject,
1638 MUIA_Group_Horiz, TRUE,
1639 MUIA_Numeric_Min, 0,
1640 End,
1641 Child, MUI_MakeObject(MUIO_Label,
1642 "Display position:", 0),
1643 Child, string.display_pos_slider =
1644 SliderObject,
1645 MUIA_Group_Horiz, TRUE,
1646 MUIA_Numeric_Min, 0,
1647 End,
1648 Child, MUI_MakeObject(MUIO_Label,
1649 "Integer value:", 0),
1650 Child, string.integer_string =
1651 StringObject,
1652 StringFrame,
1653 MUIA_String_Accept, (IPTR)digits,
1654 End,
1655 Child, MUI_MakeObject(MUIO_Label,
1656 "Plaintext:", 0),
1657 Child, string.plaintext_string =
1658 StringObject,
1659 StringFrame,
1660 End,
1661 Child, MUI_MakeObject(MUIO_Label,
1662 "Maximum string length:", 0),
1663 Child, string.max_len_text = TextObject,
1664 TextFrame,
1665 MUIA_Text_Contents, "Unknown",
1666 End,
1667 End,
1668 Child, VGroup,
1669 Child, HGroup,
1670 Child, string.cr_advance_check =
1671 MUI_MakeObject(MUIO_Checkmark,
1672 NULL),
1673 Child, MUI_MakeObject(MUIO_Label,
1674 "Advance on CR", 0),
1675 Child, HVSpace,
1676 End,
1677 Child, HGroup,
1678 Child, string.attach_list_check =
1679 MUI_MakeObject(MUIO_Checkmark,
1680 NULL),
1681 Child, MUI_MakeObject(MUIO_Label,
1682 "Attach list", 0),
1683 Child, HVSpace,
1684 End,
1685 #if 0
1686 Child, HGroup,
1687 Child, string.standard_hook_check =
1688 MUI_MakeObject(MUIO_Checkmark,
1689 NULL),
1690 Child, MUI_MakeObject(MUIO_Label,
1691 "Use standard edit hook", 0),
1692 Child, HVSpace,
1693 End,
1694 Child, HGroup,
1695 Child, string.custom_hook_check =
1696 MUI_MakeObject(MUIO_Checkmark,
1697 NULL),
1698 Child, MUI_MakeObject(MUIO_Label,
1699 "Use custom edit hook", 0),
1700 Child, HVSpace,
1701 End,
1702 #endif
1703 End,
1704 Child, HVSpace,
1705 End,
1707 End,
1708 End,
1710 /* boopsi */
1711 Child, VGroup,
1712 Child, wheel = BoopsiObject,
1713 /* MUI/Boopsi tags mixed */
1714 GroupFrame,
1715 /* boopsi objects don't know */
1716 /* their sizes, so we help */
1717 /* keep important values */
1718 /* during window resize */
1719 MUIA_Boopsi_ClassID, "colorwheel.gadget",
1720 MUIA_Boopsi_MinWidth , 30,
1721 MUIA_Boopsi_MinHeight, 30,
1722 MUIA_Boopsi_Remember , WHEEL_Saturation,
1723 MUIA_Boopsi_Remember , WHEEL_Hue,
1724 /* this magic fills in the screen pointer */
1725 MUIA_Boopsi_TagScreen, WHEEL_Screen,
1726 WHEEL_Screen, NULL,
1727 GA_Left, 0,
1728 GA_Top, 0, /* MUI will automatically */
1729 GA_Width, 0, /* fill in the correct values */
1730 GA_Height, 0,
1731 ICA_TARGET, ICTARGET_IDCMP,
1732 /* needed for notification */
1733 WHEEL_Saturation, 0, /* start in the center */
1734 MUIA_FillArea, TRUE,
1735 /* use this because it defaults to FALSE
1736 for boopsi gadgets but the colorwheel
1737 doesn't bother about redrawing its
1738 background */
1739 End,
1741 Child, r_slider = SliderObject,
1742 MUIA_Group_Horiz, TRUE,
1743 MUIA_Numeric_Min, 0,
1744 MUIA_Numeric_Max, 255,
1745 End,
1746 Child, g_slider = SliderObject,
1747 MUIA_Group_Horiz, TRUE,
1748 MUIA_Numeric_Min, 0,
1749 MUIA_Numeric_Max, 255,
1750 End,
1751 Child, b_slider = SliderObject,
1752 MUIA_Group_Horiz, TRUE,
1753 MUIA_Numeric_Min, 0,
1754 MUIA_Numeric_Max, 255,
1755 End,
1756 Child, hue_gauge = GaugeObject,
1757 GaugeFrame,
1758 MUIA_Gauge_Horiz, TRUE,
1759 MUIA_Gauge_Max, 255,
1760 MUIA_Gauge_Divide, 1<<24,
1761 MUIA_Gauge_InfoText, "Hue: %ld",
1762 End,
1763 End,
1765 /* color */
1766 Child, RegisterGroup(color_pages),
1767 Child, VGroup, GroupFrameT("Palette"),
1768 Child, PaletteObject,
1769 End,
1770 End,
1771 Child, HGroup,
1772 Child, VGroup, GroupFrameT("Colorfield"),
1774 Child, HGroup,
1775 Child, colorfield = ColorfieldObject,
1776 MUIA_Colorfield_RGB, default_color,
1777 MUIA_Colorfield_Pen, 253,
1778 End,
1779 Child, colorfield2 = ColorfieldObject,
1780 MUIA_Colorfield_Red,
1781 default_color[0],
1782 MUIA_Colorfield_Green,
1783 default_color[1],
1784 MUIA_Colorfield_Blue,
1785 default_color[2],
1786 End,
1787 End,
1788 Child, colorfield_reset_button =
1789 MUI_MakeObject(MUIO_Button,
1790 "Reset"),
1791 Child, HGroup,
1792 Child,
1793 MUI_MakeObject(
1794 MUIO_Label, "Pen:", 0),
1795 Child, colorfield_pen = StringObject,
1796 StringFrame,
1797 End,
1798 End,
1799 End,
1800 Child, VGroup, GroupFrameT("Coloradjust"),
1801 Child, coloradjust = ColoradjustObject,
1802 MUIA_Coloradjust_RGB, default_color,
1803 End,
1804 End,
1805 End,
1806 Child, HGroup,
1807 Child, VGroup,
1808 Child, VGroup, GroupFrameT("Pendisplay"),
1809 Child, HGroup,
1810 Child, pendisplay,
1811 Child, pendisplay2 =
1812 PendisplayObject,
1813 MUIA_Pendisplay_RGBcolor,
1814 default_color,
1815 End,
1816 End,
1817 Child, ColGroup(2),
1818 Child,
1819 MUI_MakeObject(
1820 MUIO_Label, "Pen:", 0),
1821 Child, HGroup,
1822 Child, pendisplay_pen =
1823 StringObject, StringFrame,
1824 End,
1825 Child, HVSpace,
1826 Child, reference_check =
1827 MUI_MakeObject(
1828 MUIO_Checkmark, NULL),
1829 Child, MUI_MakeObject(MUIO_Label,
1830 "Reference", 0),
1831 End,
1832 Child,
1833 MUI_MakeObject(
1834 MUIO_Label, "Penspec:", 0),
1835 Child, pendisplay_spec =
1836 StringObject,
1837 StringFrame,
1838 End,
1839 End,
1840 Child, HGroup,
1841 Child, shine_button =
1842 MUI_MakeObject(MUIO_Button,
1843 "Shine"),
1844 Child, shadow_button =
1845 MUI_MakeObject(MUIO_Button,
1846 "Shadow"),
1847 Child, yellow_button =
1848 MUI_MakeObject(MUIO_Button,
1849 "Yellow"),
1850 End,
1851 End,
1852 Child, VGroup, GroupFrameT("Poppen"),
1853 Child, poppen = PoppenObject,
1854 End,
1855 End,
1856 End,
1857 Child, VGroup, GroupFrameT("Penadjust"),
1858 Child, PenadjustObject,
1859 End,
1860 End,
1861 End,
1862 End,
1864 /* edit */
1865 Child, VGroup,
1866 Child, editor_text = StringObject,
1867 StringFrame,
1868 End,
1869 Child, PopaslObject,
1870 ASLFR_DoSaveMode, TRUE,
1871 MUIA_Popstring_String, filename_string =
1872 MUI_MakeObject(MUIO_String, NULL, 200),
1873 MUIA_Popstring_Button, PopButton(MUII_PopFile),
1874 End,
1875 Child, save_button =
1876 MUI_MakeObject(MUIO_Button, "Save"),
1877 End,
1879 /* lists */
1880 Child, RegisterGroup(list_pages),
1881 Child, VGroup,
1882 Child, ColGroup(LIST_COUNT),
1883 Child, VGroup,
1884 GroupFrameT("No Multiselect"),
1885 Child, list.lists[0],
1886 End,
1887 Child, VGroup,
1888 GroupFrameT("Default Multiselect"),
1889 Child, list.lists[1],
1890 End,
1891 Child, VGroup,
1892 GroupFrameT("Shifted Multiselect"),
1893 Child, list.lists[2],
1894 End,
1895 Child, VGroup,
1896 GroupFrameT(
1897 "Unconditional Multiselect"),
1898 Child, list.lists[3],
1899 End,
1900 Child, VGroup,
1901 GroupFrameT("Read Only"),
1902 Child, list.lists[4],
1903 End,
1904 End,
1905 Child, HGroup,
1906 MUIA_Group_HorizSpacing, 0,
1907 Child, RectangleObject,
1908 MUIA_HorizWeight, 1,
1909 End,
1910 Child, list.list_radios = RadioObject,
1911 MUIA_Radio_Entries, empty,
1912 MUIA_Group_Horiz, TRUE,
1913 MUIA_HorizWeight, 1000,
1914 End,
1915 Child, RectangleObject,
1916 MUIA_HorizWeight, 1,
1917 End,
1918 End,
1919 Child, RectangleObject,
1920 MUIA_VertWeight, 0,
1921 MUIA_Rectangle_HBar, TRUE,
1922 MUIA_Rectangle_BarTitle, "List Controls",
1923 End,
1924 Child, ColGroup(6),
1925 Child, MUI_MakeObject(MUIO_Label,
1926 "Affected index 1:", 0),
1927 Child, list.index1_string =
1928 StringObject,
1929 StringFrame,
1930 MUIA_String_Accept, (IPTR)digits,
1931 MUIA_String_Integer, 0,
1932 End,
1933 Child, HGroup,
1934 Child, list.draggable_check =
1935 MUI_MakeObject(
1936 MUIO_Checkmark, NULL),
1937 Child, MUI_MakeObject(MUIO_Label,
1938 "Draggable", 0),
1939 Child, HVSpace,
1940 End,
1941 Child, HGroup,
1942 Child, list.showdropmarks_check =
1943 MUI_MakeObject(
1944 MUIO_Checkmark, NULL),
1945 Child, MUI_MakeObject(MUIO_Label,
1946 "Show drop marks", 0),
1947 Child, HVSpace,
1948 End,
1949 Child, HGroup,
1950 Child, list.autovisible_check =
1951 MUI_MakeObject(
1952 MUIO_Checkmark, NULL),
1953 Child, MUI_MakeObject(MUIO_Label,
1954 "Auto visible", 0),
1955 Child, HVSpace,
1956 End,
1957 Child, list.reset_button =
1958 MUI_MakeObject(MUIO_Button, "Reset"),
1960 Child, MUI_MakeObject(MUIO_Label,
1961 "Affected index 2:", 0),
1962 Child, list.index2_string =
1963 StringObject,
1964 StringFrame,
1965 MUIA_String_Accept, (IPTR)digits,
1966 MUIA_String_Integer, 0,
1967 End,
1968 Child, HGroup,
1969 Child, list.dragsortable_check =
1970 MUI_MakeObject(
1971 MUIO_Checkmark, NULL),
1972 Child, MUI_MakeObject(MUIO_Label,
1973 "Drag sortable", 0),
1974 Child, HVSpace,
1975 End,
1976 Child, HGroup,
1977 Child, list.multitest_check =
1978 MUI_MakeObject(
1979 MUIO_Checkmark, NULL),
1980 Child, MUI_MakeObject(MUIO_Label,
1981 "Filter multiselect", 0),
1982 Child, HVSpace,
1983 End,
1984 Child, HGroup,
1985 Child, list.quiet_check =
1986 MUI_MakeObject(
1987 MUIO_Checkmark, NULL),
1988 Child, MUI_MakeObject(MUIO_Label,
1989 "Quiet", 0),
1990 Child, HVSpace,
1991 End,
1992 Child, list.enable_button =
1993 MUI_MakeObject(MUIO_Button, "Enable"),
1995 Child, MUI_MakeObject(MUIO_Label,
1996 "Move/exchange mode 1:", 0),
1997 Child, list.move1_cycle = CycleObject,
1998 ButtonFrame,
1999 MUIA_Cycle_Entries, list_move1_modes,
2000 End,
2001 Child, list.move_button =
2002 MUI_MakeObject(MUIO_Button, "Move"),
2003 Child, list.sort_button =
2004 MUI_MakeObject(MUIO_Button, "Sort"),
2005 Child, MUI_MakeObject(MUIO_Label,
2006 "Title:", 0),
2007 Child, list.title_string =
2008 StringObject,
2009 StringFrame,
2010 End,
2012 Child, MUI_MakeObject(MUIO_Label,
2013 "Move/exchange mode 2:", 0),
2014 Child, list.move2_cycle = CycleObject,
2015 ButtonFrame,
2016 MUIA_Cycle_Entries, list_move2_modes,
2017 End,
2018 Child, list.exchange_button =
2019 MUI_MakeObject(MUIO_Button, "Exchange"),
2020 Child, list.redraw_button =
2021 MUI_MakeObject(MUIO_Button, "Redraw"),
2022 Child, MUI_MakeObject(MUIO_Label,
2023 "Entries:", 0),
2024 Child, list.entries_text = TextObject,
2025 TextFrame,
2026 MUIA_Text_Contents, "N/A",
2027 End,
2029 Child, MUI_MakeObject(MUIO_Label,
2030 "Jump mode:", 0),
2031 Child, list.jump_cycle = CycleObject,
2032 ButtonFrame,
2033 MUIA_Cycle_Entries, list_jump_modes,
2034 End,
2035 Child, list.jump_button =
2036 MUI_MakeObject(MUIO_Button, "Jump"),
2037 Child, list.toggle_button =
2038 MUI_MakeObject(MUIO_Button, "Toggle"),
2039 Child, MUI_MakeObject(MUIO_Label,
2040 "Visible entries:", 0),
2041 Child, list.visible_text = TextObject,
2042 TextFrame,
2043 MUIA_Text_Contents, "N/A",
2044 End,
2046 Child, MUI_MakeObject(MUIO_Label,
2047 "Select/redraw mode:", 0),
2048 Child, list.select_cycle = CycleObject,
2049 ButtonFrame,
2050 MUIA_Cycle_Entries, list_select_modes,
2051 End,
2052 Child, list.select_button =
2053 MUI_MakeObject(MUIO_Button, "Select"),
2054 Child, list.deselect_button =
2055 MUI_MakeObject(MUIO_Button, "Deselect"),
2056 Child, MUI_MakeObject(MUIO_Label,
2057 "First visible index:", 0),
2058 Child, list.first_text = TextObject,
2059 TextFrame,
2060 MUIA_Text_Contents, "N/A",
2061 End,
2063 Child, MUI_MakeObject(MUIO_Label,
2064 "Insert mode:", 0),
2065 Child, list.insert_cycle = CycleObject,
2066 ButtonFrame,
2067 MUIA_Cycle_Entries, list_insert_modes,
2068 End,
2069 Child, list.insert_single_button =
2070 MUI_MakeObject(MUIO_Button,
2071 "Insert Single"),
2072 Child, list.insert_multiple_button =
2073 MUI_MakeObject(MUIO_Button,
2074 "Insert Multiple"),
2075 Child, MUI_MakeObject(MUIO_Label,
2076 "Last insertion index:", 0),
2077 Child, list.insert_text = TextObject,
2078 TextFrame,
2079 MUIA_Text_Contents, "N/A",
2080 End,
2082 Child, MUI_MakeObject(MUIO_Label,
2083 "Remove mode:", 0),
2084 Child, list.remove_cycle = CycleObject,
2085 ButtonFrame,
2086 MUIA_Cycle_Entries, list_remove_modes,
2087 End,
2088 Child, list.remove_button =
2089 MUI_MakeObject(MUIO_Button, "Remove"),
2090 Child, list.clear_button =
2091 MUI_MakeObject(MUIO_Button, "Clear"),
2092 Child, MUI_MakeObject(MUIO_Label,
2093 "Active index:", 0),
2094 Child, list.active_text = TextObject,
2095 TextFrame,
2096 MUIA_Text_Contents, "N/A",
2097 End,
2099 Child, MUI_MakeObject(MUIO_Label,
2100 "Activate mode:", 0),
2101 Child, list.activate_cycle = CycleObject,
2102 ButtonFrame,
2103 MUIA_Cycle_Entries, list_activate_modes,
2104 End,
2105 Child, list.activate_button =
2106 MUI_MakeObject(MUIO_Button, "Activate"),
2107 Child, list.deactivate_button =
2108 MUI_MakeObject(
2109 MUIO_Button, "Deactivate"),
2110 Child, MUI_MakeObject(MUIO_Label,
2111 "Selected entries:", 0),
2112 Child, list.selected_text = TextObject,
2113 TextFrame,
2114 MUIA_Text_Contents, "N/A",
2115 End,
2117 Child, HVSpace,
2118 Child, HVSpace,
2119 Child, HVSpace,
2120 Child, HVSpace,
2121 Child, MUI_MakeObject(MUIO_Label,
2122 "Last drop index:", 0),
2123 Child, list.drop_text = TextObject,
2124 TextFrame,
2125 MUIA_Text_Contents, "N/A",
2126 End,
2127 End,
2128 End,
2129 Child, VGroup,
2130 Child, ColGroup(MULTI_LIST_COUNT),
2131 Child, VGroup,
2132 GroupFrameT("Standard Format"),
2133 Child, list.multi_lists[0] =
2134 ListviewObject,
2135 MUIA_Listview_List,
2136 ListObject,
2137 InputListFrame,
2138 MUIA_List_ConstructHook,
2139 &hook_construct,
2140 MUIA_List_DestructHook,
2141 &hook_destruct,
2142 MUIA_List_DisplayHook,
2143 &hook_display,
2144 MUIA_List_Format, list_format,
2145 MUIA_List_SourceArray, entries,
2146 MUIA_List_Title, TRUE,
2147 MUIA_List_AdjustWidth, TRUE,
2148 End,
2149 MUIA_Listview_MultiSelect,
2150 MUIV_Listview_MultiSelect_None,
2151 MUIA_Listview_DefClickColumn, 1,
2152 MUIA_CycleChain, 1,
2153 End,
2154 End,
2155 Child, VGroup, GroupFrameT("Custom Format"),
2156 Child, list.multi_lists[1] =
2157 ListviewObject,
2158 MUIA_Listview_List,
2159 ListObject,
2160 InputListFrame,
2161 MUIA_List_Format, list_format,
2162 MUIA_List_Title, TRUE,
2163 MUIA_List_AdjustHeight, TRUE,
2164 End,
2165 MUIA_Listview_MultiSelect,
2166 MUIV_Listview_MultiSelect_None,
2167 MUIA_CycleChain, 1,
2168 End,
2169 Child, HVSpace,
2170 End,
2171 End,
2172 Child, RectangleObject,
2173 MUIA_VertWeight, 0,
2174 MUIA_Rectangle_HBar, TRUE,
2175 MUIA_Rectangle_BarTitle, "List Controls",
2176 End,
2177 Child, HGroup,
2178 Child, MUI_MakeObject(
2179 MUIO_Label, "Format:", 0),
2180 Child, list.format_string = StringObject,
2181 StringFrame,
2182 MUIA_CycleChain, 1,
2183 End,
2184 Child, list.showheadings_check =
2185 MUI_MakeObject(MUIO_Checkmark, NULL),
2186 Child, MUI_MakeObject(MUIO_Label,
2187 "Show column headings", 0),
2188 Child, list.showimage_check =
2189 MUI_MakeObject(MUIO_Checkmark, NULL),
2190 Child, MUI_MakeObject(MUIO_Label,
2191 "Show image", 0),
2192 End,
2193 Child, HGroup,
2194 Child, MUI_MakeObject(MUIO_Label,
2195 "Default clicked column:", 0),
2196 Child, list.def_column_string =
2197 StringObject,
2198 StringFrame,
2199 MUIA_String_Accept, (IPTR)digits,
2200 MUIA_String_Integer, -1,
2201 MUIA_CycleChain, 1,
2202 End,
2203 Child, MUI_MakeObject(MUIO_Label,
2204 "Clicked column:", 0),
2205 Child, list.column_string = StringObject,
2206 MUIA_ShowMe, FALSE,
2207 End,
2208 Child, list.column_text = TextObject,
2209 TextFrame,
2210 MUIA_Text_Contents, "N/A",
2211 End,
2212 End,
2213 End,
2214 End,
2216 /* gauges */
2217 Child, HGroup,
2218 Child, VGroup,
2219 Child, VGroup,
2220 GroupFrame,
2221 Child, GaugeObject,
2222 GaugeFrame,
2223 MUIA_Gauge_InfoText, "%ld %%",
2224 MUIA_Gauge_Horiz, TRUE,
2225 MUIA_Gauge_Current, 25,
2226 End,
2227 Child, ScaleObject,
2228 End,
2229 End,
2230 Child, VGroup,
2231 GroupFrame,
2232 Child, GaugeObject,
2233 GaugeFrame,
2234 MUIA_Gauge_InfoText, "%ld %%",
2235 MUIA_Gauge_Horiz, TRUE,
2236 MUIA_Gauge_Current, 50,
2237 End,
2238 Child, ScaleObject,
2239 End,
2240 End,
2241 Child, VGroup,
2242 GroupFrame,
2243 Child, GaugeObject,
2244 GaugeFrame,
2245 MUIA_Gauge_InfoText, "%ld %%",
2246 MUIA_Gauge_Horiz, TRUE,
2247 MUIA_Gauge_Current, 75,
2248 End,
2249 Child, ScaleObject,
2250 End,
2251 End,
2252 End,
2253 Child, HGroup,
2254 Child, HVSpace,
2255 Child, GaugeObject,
2256 GaugeFrame,
2257 MUIA_Gauge_InfoText, "%ld %%",
2258 MUIA_Gauge_Current, 25,
2259 End,
2260 Child, GaugeObject,
2261 GaugeFrame,
2262 MUIA_Gauge_InfoText, "%ld %%",
2263 MUIA_Gauge_Current, 50,
2264 End,
2265 Child, GaugeObject,
2266 GaugeFrame,
2267 MUIA_Gauge_InfoText, "%ld %%",
2268 MUIA_Gauge_Current, 75,
2269 End,
2270 Child, HVSpace,
2271 End,
2272 End,
2274 /* numeric */
2275 Child, HGroup,
2276 Child, ColGroup(2),
2277 GroupFrameT("Horizontal Sliders"),
2278 Child, MUI_MakeObject(MUIO_Label, "Normal:", 0),
2279 Child, numerics[HNSLIDER] = SliderObject,
2280 MUIA_Slider_Horiz, TRUE,
2281 MUIA_Numeric_Min, NUMERIC_MIN,
2282 MUIA_Numeric_Max, NUMERIC_MAX,
2283 MUIA_CycleChain, 1,
2284 End,
2285 Child, MUI_MakeObject(
2286 MUIO_Label, "Reverse:", 0),
2287 Child, numerics[HRSLIDER] = SliderObject,
2288 MUIA_Numeric_Reverse, TRUE,
2289 MUIA_Numeric_Min, NUMERIC_MIN,
2290 MUIA_Numeric_Max, NUMERIC_MAX,
2291 MUIA_CycleChain, 1,
2292 End,
2293 Child, MUI_MakeObject(MUIO_Label, "Quiet:", 0),
2294 Child, numerics[HQSLIDER] = SliderObject,
2295 MUIA_Slider_Quiet, TRUE,
2296 MUIA_Numeric_Min, NUMERIC_MIN,
2297 MUIA_Numeric_Max, NUMERIC_MAX,
2298 MUIA_CycleChain, 1,
2299 End,
2300 End,
2301 Child, ColGroup(3),
2302 GroupFrameT("Vertical Sliders"),
2303 Child, MUI_MakeObject(MUIO_Label, "Normal", 0),
2304 Child, MUI_MakeObject(MUIO_Label, "Reverse", 0),
2305 Child, MUI_MakeObject(MUIO_Label, "Quiet", 0),
2306 Child, numerics[VNSLIDER] = SliderObject,
2307 MUIA_Slider_Horiz, FALSE,
2308 MUIA_Numeric_Min, NUMERIC_MIN,
2309 MUIA_Numeric_Max, NUMERIC_MAX,
2310 MUIA_CycleChain, 1,
2311 End,
2312 Child, numerics[VRSLIDER] = SliderObject,
2313 MUIA_Slider_Horiz, FALSE,
2314 MUIA_Numeric_Reverse, TRUE,
2315 MUIA_Numeric_Min, NUMERIC_MIN,
2316 MUIA_Numeric_Max, NUMERIC_MAX,
2317 MUIA_CycleChain, 1,
2318 End,
2319 Child, numerics[VQSLIDER] = SliderObject,
2320 MUIA_Slider_Horiz, FALSE,
2321 MUIA_Slider_Quiet, TRUE,
2322 MUIA_Numeric_Min, NUMERIC_MIN,
2323 MUIA_Numeric_Max, NUMERIC_MAX,
2324 MUIA_CycleChain, 1,
2325 End,
2326 End,
2327 Child, ColGroup(2),
2328 GroupFrameT("Numeric Buttons"),
2329 Child, MUI_MakeObject(
2330 MUIO_Label, "Normal:", 0),
2331 Child, numerics[NNUMERICBUTTON] =
2332 NumericbuttonObject,
2333 MUIA_Numeric_Min, NUMERIC_MIN,
2334 MUIA_Numeric_Max, NUMERIC_MAX,
2335 MUIA_CycleChain, 1,
2336 End,
2337 Child, MUI_MakeObject(
2338 MUIO_Label, "Reverse:", 0),
2339 Child, numerics[RNUMERICBUTTON] =
2340 NumericbuttonObject,
2341 MUIA_Numeric_Reverse, TRUE,
2342 MUIA_Numeric_Min, NUMERIC_MIN,
2343 MUIA_Numeric_Max, NUMERIC_MAX,
2344 MUIA_CycleChain, 1,
2345 End,
2346 End,
2347 Child, ColGroup(2),
2348 GroupFrameT("Knobs"),
2349 Child, MUI_MakeObject(MUIO_Label, "Normal", 0),
2350 Child, MUI_MakeObject(MUIO_Label, "Reverse", 0),
2351 Child, numerics[NKNOB] = KnobObject,
2352 MUIA_Numeric_Min, NUMERIC_MIN,
2353 MUIA_Numeric_Max, NUMERIC_MAX,
2354 MUIA_CycleChain, 1,
2355 End,
2356 Child, numerics[RKNOB] = KnobObject,
2357 MUIA_Numeric_Reverse, TRUE,
2358 MUIA_Numeric_Min, NUMERIC_MIN,
2359 MUIA_Numeric_Max, NUMERIC_MAX,
2360 MUIA_CycleChain, 1,
2361 End,
2362 End,
2363 Child, ColGroup(2),
2364 Child, MUI_MakeObject(MUIO_Label,
2365 "Minimum Value:", 0),
2366 Child, min_string = (Object *)StringObject,
2367 StringFrame,
2368 MUIA_String_Accept, (IPTR)digits,
2369 MUIA_String_Integer, NUMERIC_MIN,
2370 MUIA_CycleChain, 1,
2371 End,
2372 Child, MUI_MakeObject(MUIO_Label,
2373 "Maximum Value:", 0),
2374 Child, max_string = (Object *)StringObject,
2375 StringFrame,
2376 MUIA_String_Accept, (IPTR)digits,
2377 MUIA_String_Integer, NUMERIC_MAX,
2378 MUIA_CycleChain, 1,
2379 End,
2380 Child, slider_button = TextObject,
2381 ButtonFrame,
2382 MUIA_InputMode, MUIV_InputMode_RelVerify,
2383 MUIA_CycleChain, 1,
2384 MUIA_Background, MUII_ButtonBack,
2385 MUIA_Text_PreParse, "\33c",
2386 MUIA_Text_Contents,
2387 "Change Slider Orientations",
2388 End,
2389 Child, MUI_MakeObject(MUIO_Label, "", 0),
2390 End,
2391 End,
2393 /* radios */
2394 Child, HGroup,
2395 Child, VGroup,
2396 Child, RadioObject,
2397 GroupFrame,
2398 MUIA_Radio_Entries, radio_entries1,
2399 End,
2400 Child, country_radio[0] = RadioObject,
2401 GroupFrame,
2402 MUIA_Radio_Entries, radio_entries2,
2403 MUIA_Radio_Active, 1,
2404 End,
2405 End,
2406 Child, HGroup,
2407 Child, RadioObject,
2408 GroupFrame,
2409 MUIA_Radio_Entries, radio_entries1,
2410 End,
2411 Child, country_radio[1] = RadioObject,
2412 GroupFrame,
2413 MUIA_Radio_Entries, radio_entries2,
2414 MUIA_Radio_Active, 1,
2415 End,
2416 End,
2417 End,
2419 #if defined(TEST_ICONLIST)
2420 /* iconlist */
2421 Child, HGroup,
2422 Child, volume_iconlist =
2423 MUI_NewObject(MUIC_IconVolumeList, GroupFrame,
2424 TAG_DONE),
2425 Child, drawer_iconlist =
2426 MUI_NewObject(MUIC_IconDrawerList, GroupFrame,
2427 MUIA_IconDrawerList_Drawer, "SYS:",
2428 TAG_DONE),
2429 End,
2430 #endif
2432 /* balancing */
2433 Child, HGroup,
2434 Child, create_balance_column(),
2435 Child, BalanceObject,
2436 End,
2438 Child, create_balance_column(),
2439 Child, BalanceObject,
2440 End,
2442 Child, create_balance_column(),
2443 Child, BalanceObject,
2444 End,
2446 Child, create_balance_column(),
2447 Child, BalanceObject,
2448 End,
2450 Child, create_balance_column(),
2452 End,
2454 End,
2456 Child, HGroup,
2457 Child, about_button = TextObject,
2458 ButtonFrame,
2459 MUIA_InputMode, MUIV_InputMode_RelVerify,
2460 MUIA_CycleChain, 1,
2461 MUIA_Background, MUII_ButtonBack,
2462 MUIA_Text_PreParse, "\33c",
2463 MUIA_Text_Contents, "About",
2464 End,
2465 Child, quit_button = TextObject,
2466 ButtonFrame,
2467 MUIA_InputMode, MUIV_InputMode_RelVerify,
2468 MUIA_CycleChain, 1,
2469 MUIA_Background, MUII_ButtonBack,
2470 MUIA_ControlChar, 'q',
2471 MUIA_Text_HiChar, 'q',
2472 MUIA_Text_PreParse, "\33c",
2473 MUIA_Text_Contents, "Quit",
2474 End,
2475 End,
2476 End,
2477 End,
2479 SubWindow, second_wnd = WindowObject,
2480 MUIA_Window_Title, "Second window",
2481 WindowContents, VGroup,
2482 Child, DropTextObject,
2483 MUIA_Text_Contents, "Drop here",
2484 MUIA_Dropable, TRUE,
2485 End,
2486 End,
2487 End,
2489 End;
2491 if (app == NULL)
2492 result = RETURN_FAIL;
2495 if (result == RETURN_OK)
2497 ULONG sigs = 0;
2499 DoMethod(wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2,
2500 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
2501 DoMethod(second_wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
2502 second_wnd, 3, MUIM_Set, MUIA_Window_Open, FALSE);
2503 DoMethod(general.open_button, MUIM_Notify, MUIA_Pressed, FALSE,
2504 second_wnd, 3, MUIM_Set, MUIA_Window_Open, TRUE);
2505 DoMethod(about_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
2506 MUIM_Application_AboutMUI, NULL);
2507 DoMethod(quit_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
2508 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
2509 DoMethod(objects_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
2510 MUIM_CallHook, &hook_objects);
2511 DoMethod(repeat_button, MUIM_Notify, MUIA_Timer, MUIV_EveryTime,
2512 app, 2, MUIM_CallHook, &hook);
2514 /* Notifications and set-up for string objects */
2515 DoMethod(string.max_len_text, MUIM_SetAsString, MUIA_Text_Contents,
2516 "%ld", XGET(string.strings[0], MUIA_String_MaxLen) - 1);
2517 set(string.cursor_pos_slider, MUIA_Numeric_Max,
2518 XGET(string.strings[0], MUIA_String_MaxLen) - 1);
2519 set(string.display_pos_slider, MUIA_Numeric_Max,
2520 XGET(string.strings[0], MUIA_String_MaxLen) - 1);
2521 set(string.cr_advance_check, MUIA_Selected, TRUE);
2522 set(string.attach_list_check, MUIA_Selected, TRUE);
2523 set(string.strings[1], MUIA_Disabled,
2524 XGET(string.strings[1], MUIA_String_Format)
2525 != MUIV_String_Format_Left);
2526 set(string.strings[2], MUIA_Disabled,
2527 XGET(string.strings[2], MUIA_String_Format)
2528 != MUIV_String_Format_Right);
2529 set(string.strings[3], MUIA_Disabled,
2530 XGET(string.strings[3], MUIA_String_Format)
2531 != MUIV_String_Format_Center);
2532 set(string.strings[4], MUIA_Disabled,
2533 !XGET(string.strings[4], MUIA_String_Secret));
2534 set(string.strings[0], MUIA_String_MaxLen, 100);
2535 set(string.reject_string, MUIA_String_Contents,
2536 (IPTR)default_reject_chars);
2538 for (i = 0; i < STRING_COUNT; i++)
2540 if (i == 0)
2542 DoMethod(string.accept_string, MUIM_Notify,
2543 MUIA_String_Contents, MUIV_EveryTime, string.strings[i],
2544 3, MUIM_Set, MUIA_String_Accept, MUIV_TriggerValue);
2545 DoMethod(string.cr_advance_check, MUIM_Notify, MUIA_Selected,
2546 MUIV_EveryTime, string.strings[i], 3, MUIM_Set,
2547 MUIA_String_AdvanceOnCR, MUIV_TriggerValue);
2548 DoMethod(string.cursor_pos_slider, MUIM_Notify,
2549 MUIA_Numeric_Value, MUIV_EveryTime, string.strings[i], 3,
2550 MUIM_Set, MUIA_String_BufferPos, MUIV_TriggerValue);
2551 DoMethod(string.display_pos_slider, MUIM_Notify,
2552 MUIA_Numeric_Value, MUIV_EveryTime, string.strings[i], 3,
2553 MUIM_Set, MUIA_String_DisplayPos, MUIV_TriggerValue);
2554 DoMethod(string.attach_list_check, MUIM_Notify, MUIA_Selected,
2555 TRUE, string.strings[i], 3, MUIM_Set,
2556 MUIA_String_AttachedList, list.lists[0]);
2557 DoMethod(string.attach_list_check, MUIM_Notify, MUIA_Selected,
2558 FALSE, string.strings[i], 3, MUIM_Set,
2559 MUIA_String_AttachedList, NULL);
2561 else
2563 DoMethod(string.strings[0], MUIM_Notify, MUIA_String_Accept,
2564 MUIV_EveryTime, string.strings[i], 3, MUIM_Set,
2565 MUIA_String_Accept, MUIV_TriggerValue);
2566 DoMethod(string.strings[0], MUIM_Notify,
2567 MUIA_String_AdvanceOnCR, MUIV_EveryTime,
2568 string.strings[i], 3, MUIM_Set, MUIA_String_AdvanceOnCR,
2569 MUIV_TriggerValue);
2570 DoMethod(string.strings[0], MUIM_Notify,
2571 MUIA_String_BufferPos, MUIV_EveryTime,
2572 string.strings[i], 3, MUIM_Set, MUIA_String_BufferPos,
2573 MUIV_TriggerValue);
2574 DoMethod(string.strings[0], MUIM_Notify,
2575 MUIA_String_DisplayPos, MUIV_EveryTime,
2576 string.strings[i], 3, MUIM_Set, MUIA_String_DisplayPos,
2577 MUIV_TriggerValue);
2578 DoMethod(string.strings[0], MUIM_Notify,
2579 MUIA_String_AttachedList, MUIV_EveryTime,
2580 string.strings[i], 3, MUIM_Set,
2581 MUIA_String_AttachedList, MUIV_TriggerValue);
2583 DoMethod(string.reject_string, MUIM_Notify, MUIA_String_Contents,
2584 MUIV_EveryTime, string.strings[i], 3, MUIM_Set,
2585 MUIA_String_Reject, MUIV_TriggerValue);
2586 DoMethod(string.strings[i], MUIM_Notify, MUIA_String_Integer,
2587 MUIV_EveryTime, string.integer_string, 3, MUIM_NoNotifySet,
2588 MUIA_String_Integer, MUIV_TriggerValue);
2589 DoMethod(string.integer_string, MUIM_Notify, MUIA_String_Integer,
2590 MUIV_EveryTime, string.strings[i], 3, MUIM_NoNotifySet,
2591 MUIA_String_Integer, MUIV_TriggerValue);
2593 DoMethod(string.accept_all_check, MUIM_Notify, MUIA_Selected,
2594 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2595 ChangeStringAccept);
2596 DoMethod(string.strings[4], MUIM_Notify, MUIA_String_Acknowledge,
2597 MUIV_EveryTime, string.plaintext_string, 3, MUIM_NoNotifySet,
2598 MUIA_String_Contents, MUIV_TriggerValue);
2599 DoMethod(string.plaintext_string, MUIM_Notify,
2600 MUIA_String_Acknowledge, MUIV_EveryTime, string.strings[4], 3,
2601 MUIM_NoNotifySet, MUIA_String_Contents, MUIV_TriggerValue);
2603 DoMethod(wheel, MUIM_Notify, WHEEL_Hue, MUIV_EveryTime, app, 2,
2604 MUIM_CallHook, &hook_wheel);
2605 DoMethod(wheel, MUIM_Notify, WHEEL_Saturation, MUIV_EveryTime, app,
2606 2, MUIM_CallHook, &hook_wheel);
2607 DoMethod(r_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
2608 app, 2, MUIM_CallHook, &hook_slider);
2609 DoMethod(g_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
2610 app, 2, MUIM_CallHook, &hook_slider);
2611 DoMethod(b_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
2612 app, 2, MUIM_CallHook, &hook_slider);
2614 DoMethod(save_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 3,
2615 MUIM_CallHook, &hook_standard, Save);
2617 DoMethod(quit_item, MUIM_Notify, MUIA_Menuitem_Trigger,
2618 MUIV_EveryTime, app, 2, MUIM_Application_ReturnID,
2619 MUIV_Application_ReturnID_Quit);
2620 DoMethod(about_item, MUIM_Notify, MUIA_Menuitem_Trigger,
2621 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2622 About);
2624 /* Notifications for color objects */
2625 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Red,
2626 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Red,
2627 MUIV_TriggerValue);
2628 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Green,
2629 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Green,
2630 MUIV_TriggerValue);
2631 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Blue,
2632 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Blue,
2633 MUIV_TriggerValue);
2634 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Red,
2635 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Red,
2636 MUIV_TriggerValue);
2637 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Green,
2638 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Green,
2639 MUIV_TriggerValue);
2640 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Blue,
2641 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Blue,
2642 MUIV_TriggerValue);
2643 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Pen,
2644 MUIV_EveryTime, colorfield_pen, 3, MUIM_Set,
2645 MUIA_String_Integer, MUIV_TriggerValue);
2646 DoMethod(colorfield_pen, MUIM_Notify, MUIA_String_Acknowledge,
2647 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2648 ChangePen);
2649 DoMethod(colorfield_reset_button, MUIM_Notify, MUIA_Pressed, FALSE,
2650 colorfield, 3, MUIM_Set, MUIA_Colorfield_RGB, default_color);
2652 /* Notifications for pen objects */
2653 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_Pen,
2654 MUIV_EveryTime, pendisplay_pen, 3, MUIM_NoNotifySet,
2655 MUIA_String_Integer, MUIV_TriggerValue);
2656 DoMethod(pendisplay_pen, MUIM_Notify, MUIA_String_Acknowledge,
2657 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2658 ChangePendisplayPen);
2659 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_Spec,
2660 MUIV_EveryTime, pendisplay_spec, 3, MUIM_Set,
2661 MUIA_String_Contents, MUIV_TriggerValue);
2662 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_RGB,
2663 MUIV_EveryTime, pendisplay, 3, MUIM_Set,
2664 MUIA_Pendisplay_RGBcolor, MUIV_TriggerValue);
2665 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_RGBcolor,
2666 MUIV_EveryTime, poppen, 3, MUIM_Set, MUIA_Pendisplay_RGBcolor,
2667 MUIV_TriggerValue);
2668 DoMethod(pendisplay_spec, MUIM_Notify, MUIA_String_Contents,
2669 MUIV_EveryTime, pendisplay, 3, MUIM_Set, MUIA_Pendisplay_Spec,
2670 MUIV_TriggerValue);
2671 DoMethod(reference_check, MUIM_Notify, MUIA_Selected, TRUE,
2672 pendisplay2, 3, MUIM_Set, MUIA_Pendisplay_Reference, pendisplay);
2673 DoMethod(reference_check, MUIM_Notify, MUIA_Selected, FALSE,
2674 pendisplay2, 3, MUIM_Set, MUIA_Pendisplay_Reference, NULL);
2675 DoMethod(shine_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
2676 2, MUIM_Pendisplay_SetMUIPen, MPEN_SHINE);
2677 DoMethod(shadow_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
2678 2, MUIM_Pendisplay_SetMUIPen, MPEN_SHADOW);
2679 DoMethod(yellow_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
2680 4, MUIM_Pendisplay_SetRGB, 0xffffffff, 0xffffffff, 0);
2682 /* Notifications and set-up for list objects */
2683 set(list.showdropmarks_check, MUIA_Selected, TRUE);
2684 UpdateListInfo();
2685 for (i = 0; i < LIST_COUNT; i++)
2687 DoMethod(list.lists[i], MUIM_Notify, MUIA_Listview_DoubleClick,
2688 MUIV_EveryTime, list.lists[i], 3, MUIM_Set, MUIA_Disabled,
2689 TRUE);
2690 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Entries,
2691 MUIV_EveryTime, list.entries_text, 4, MUIM_SetAsString,
2692 MUIA_Text_Contents, "%ld", MUIV_TriggerValue);
2693 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Visible,
2694 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2695 ListGetVisible);
2696 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_First,
2697 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2698 ListGetFirst);
2699 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_InsertPosition,
2700 MUIV_EveryTime, list.insert_text, 4, MUIM_SetAsString,
2701 MUIA_Text_Contents, "%ld", MUIV_TriggerValue);
2702 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Active,
2703 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2704 UpdateListInfo);
2705 DoMethod(list.lists[i], MUIM_Notify, MUIA_Listview_SelectChange,
2706 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2707 ListGetSelected);
2709 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2710 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2711 ListSetDraggable);
2712 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2713 MUIV_EveryTime, list.dragsortable_check, 3, MUIM_Set,
2714 MUIA_Disabled, MUIV_NotTriggerValue);
2715 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2716 FALSE, list.dragsortable_check, 3, MUIM_Set,
2717 MUIA_Selected, FALSE);
2718 DoMethod(list.showdropmarks_check, MUIM_Notify, MUIA_Selected,
2719 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2720 ListSetShowDropMarks);
2721 DoMethod(list.multitest_check, MUIM_Notify, MUIA_Selected,
2722 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2723 ListSetMultiTest);
2724 DoMethod(list.quiet_check, MUIM_Notify, MUIA_Selected,
2725 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2726 ListSetQuiet);
2727 DoMethod(list.dragsortable_check, MUIM_Notify, MUIA_Selected,
2728 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2729 ListSetDragSortable);
2730 DoMethod(list.autovisible_check, MUIM_Notify, MUIA_Selected,
2731 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2732 ListSetAutoVisible);
2733 DoMethod(list.reset_button, MUIM_Notify, MUIA_Pressed, FALSE,
2734 app, 3, MUIM_CallHook, &hook_standard, ListReset);
2735 DoMethod(list.move_button, MUIM_Notify, MUIA_Pressed, FALSE,
2736 app, 3, MUIM_CallHook, &hook_standard, ListMove);
2737 DoMethod(list.sort_button, MUIM_Notify, MUIA_Pressed, FALSE,
2738 app, 3, MUIM_CallHook, &hook_standard, ListSort);
2739 DoMethod(list.enable_button, MUIM_Notify, MUIA_Pressed, FALSE,
2740 app, 3, MUIM_CallHook, &hook_standard, ListEnable);
2741 DoMethod(list.exchange_button, MUIM_Notify, MUIA_Pressed, FALSE,
2742 app, 3, MUIM_CallHook, &hook_standard, ListExchange);
2743 DoMethod(list.jump_button, MUIM_Notify, MUIA_Pressed, FALSE,
2744 app, 3, MUIM_CallHook, &hook_standard, ListJump);
2745 DoMethod(list.select_button, MUIM_Notify, MUIA_Pressed, FALSE,
2746 app, 3, MUIM_CallHook, &hook_standard, ListSelect);
2747 DoMethod(list.deselect_button, MUIM_Notify, MUIA_Pressed, FALSE,
2748 app, 3, MUIM_CallHook, &hook_standard, ListDeselect);
2749 DoMethod(list.toggle_button, MUIM_Notify, MUIA_Pressed, FALSE,
2750 app, 3, MUIM_CallHook, &hook_standard, ListToggle);
2751 DoMethod(list.redraw_button, MUIM_Notify, MUIA_Pressed, FALSE,
2752 app, 3, MUIM_CallHook, &hook_standard, ListRedraw);
2753 DoMethod(list.insert_single_button, MUIM_Notify, MUIA_Pressed, FALSE,
2754 app, 3, MUIM_CallHook, &hook_standard, ListInsertSingle);
2755 DoMethod(list.insert_multiple_button, MUIM_Notify, MUIA_Pressed, FALSE,
2756 app, 3, MUIM_CallHook, &hook_standard, ListInsert);
2757 DoMethod(list.remove_button, MUIM_Notify, MUIA_Pressed, FALSE,
2758 app, 3, MUIM_CallHook, &hook_standard, ListRemove);
2759 DoMethod(list.clear_button, MUIM_Notify, MUIA_Pressed, FALSE,
2760 app, 3, MUIM_CallHook, &hook_standard, ListClear);
2761 DoMethod(list.activate_button, MUIM_Notify, MUIA_Pressed, FALSE,
2762 app, 3, MUIM_CallHook, &hook_standard, ListActivate);
2763 DoMethod(list.deactivate_button, MUIM_Notify, MUIA_Pressed, FALSE,
2764 app, 3, MUIM_CallHook, &hook_standard, ListDeactivate);
2765 DoMethod(list.title_string, MUIM_Notify, MUIA_String_Acknowledge,
2766 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2767 ChangeListTitle);
2768 DoMethod(list.list_radios, MUIM_Notify, MUIA_Radio_Active,
2769 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2770 UpdateListInfo);
2771 SET(list.lists[4], MUIA_List_CompareHook, &hook_compare);
2772 SET(list.lists[4], MUIA_List_AutoVisible, TRUE);
2774 SET(list.showheadings_check, MUIA_Selected,
2775 XGET(list.multi_lists[0], MUIA_List_Title));
2776 SET(list.format_string, MUIA_String_Contents,
2777 XGET(list.multi_lists[1], MUIA_List_Format));
2778 SET(list.def_column_string, MUIA_String_Integer,
2779 XGET(list.multi_lists[0], MUIA_Listview_DefClickColumn));
2780 DoMethod(list.format_string, MUIM_Notify, MUIA_String_Acknowledge,
2781 MUIV_EveryTime, list.multi_lists[1], 3, MUIM_Set,
2782 MUIA_List_Format, MUIV_TriggerValue);
2783 DoMethod(list.multi_lists[1], MUIM_Notify, MUIA_List_Format,
2784 MUIV_EveryTime, wnd, 3, MUIM_Set,
2785 MUIA_Window_ActiveObject, list.format_string);
2786 for (i = 0; i < MULTI_LIST_COUNT; i++)
2788 DoMethod(list.showheadings_check, MUIM_Notify, MUIA_Selected,
2789 MUIV_EveryTime, list.multi_lists[i], 3, MUIM_Set,
2790 MUIA_List_Title, MUIV_TriggerValue);
2791 DoMethod(list.showimage_check, MUIM_Notify, MUIA_Selected,
2792 MUIV_EveryTime, list.multi_lists[i], 2, MUIM_List_Redraw,
2793 MUIV_List_Redraw_All);
2794 DoMethod(list.def_column_string, MUIM_Notify,
2795 MUIA_String_Integer,
2796 MUIV_EveryTime, list.multi_lists[i], 3, MUIM_Set,
2797 MUIA_Listview_DefClickColumn, MUIV_TriggerValue);
2798 DoMethod(list.multi_lists[i], MUIM_Notify,
2799 MUIA_Listview_ClickColumn, MUIV_EveryTime,
2800 list.column_string, 3, MUIM_Set, MUIA_String_Integer,
2801 MUIV_TriggerValue);
2803 DoMethod(list.column_string, MUIM_Notify, MUIA_String_Contents,
2804 MUIV_EveryTime, list.column_text, 3, MUIM_Set, MUIA_Text_Contents,
2805 MUIV_TriggerValue);
2806 DoMethod(list.multi_lists[1], MUIM_Notify, MUIA_Listview_DoubleClick,
2807 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2808 CheckListDoubleClick);
2809 SET(list.multi_lists[1], MUIA_List_ConstructHook, &hook_construct);
2810 SET(list.multi_lists[1], MUIA_List_DestructHook, &hook_destruct);
2811 SET(list.multi_lists[1], MUIA_List_DisplayHook, &hook_display);
2812 DoMethod(list.multi_lists[1], MUIM_List_Insert, entries, -1,
2813 MUIV_List_Insert_Top);
2815 DoMethod(listview, MUIM_Notify, MUIA_Listview_DoubleClick, TRUE,
2816 popobject, 2, MUIM_Popstring_Close, TRUE);
2818 /* numeric */
2819 for (i = 0; i < NUMERIC_COUNT; i++)
2821 DoMethod(min_string, MUIM_Notify, MUIA_String_Integer,
2822 MUIV_EveryTime, numerics[i], 3, MUIM_Set, MUIA_Numeric_Min,
2823 MUIV_TriggerValue);
2824 DoMethod(max_string, MUIM_Notify, MUIA_String_Integer,
2825 MUIV_EveryTime, numerics[i], 3, MUIM_Set, MUIA_Numeric_Max,
2826 MUIV_TriggerValue);
2828 DoMethod(slider_button, MUIM_Notify, MUIA_Pressed, FALSE,
2829 numerics[HRSLIDER], 3, MUIM_Set, MUIA_Slider_Horiz, FALSE);
2831 /* radio */
2832 DoMethod(country_radio[0], MUIM_Notify, MUIA_Radio_Active,
2833 MUIV_EveryTime, country_radio[1], 3, MUIM_NoNotifySet,
2834 MUIA_Radio_Active, MUIV_TriggerValue);
2835 DoMethod(country_radio[1], MUIM_Notify, MUIA_Radio_Active,
2836 MUIV_EveryTime, country_radio[0], 3, MUIM_NoNotifySet,
2837 MUIA_Radio_Active, MUIV_TriggerValue);
2839 #if defined(TEST_ICONLIST)
2840 /* iconlist */
2841 DoMethod(volume_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick,
2842 TRUE, volume_iconlist, 3, MUIM_CallHook, &hook_standard,
2843 volume_doubleclicked);
2844 DoMethod(drawer_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick,
2845 TRUE, drawer_iconlist, 3, MUIM_CallHook, &hook_standard,
2846 drawer_doubleclicked);
2847 #endif
2849 /* pre-display automatic tests */
2850 get(list.lists[0], MUIA_List_Visible, &value);
2851 if (value != -1)
2852 printf("MUIA_List_Visible equals %ld before display,"
2853 " but it should be -1.\n", (long)value);
2854 get(list.multi_lists[0], MUIA_Listview_ClickColumn, &value);
2855 if (value != 0)
2856 printf("MUIA_Listview_ClickColumn equals %ld before display,"
2857 " but it should be 0.\n", (long)value);
2858 get(list.lists[0], MUIA_Listview_DoubleClick, &value);
2859 if (value != 0)
2860 printf("MUIA_Listview_DoubleClick equals %ld before display,"
2861 " but it should be 0.\n", (long)value);
2863 set(wnd, MUIA_Window_Open, TRUE);
2864 set(wnd, MUIA_Window_ScreenTitle, "Zune Test Application");
2866 /* post-display automatic tests */
2867 set(list.lists[0], MUIA_Listview_SelectChange, TRUE);
2868 get(list.lists[0], MUIA_Listview_SelectChange, &value);
2869 if (value)
2870 printf("MUIA_Listview_SelectChange is settable,"
2871 " although it should not be.\n");
2873 list.image = DoMethod(list.multi_lists[0], MUIM_List_CreateImage,
2874 list.colorfield, 0);
2876 /* Set pen fields */
2877 set(colorfield_pen, MUIA_String_Integer,
2878 XGET(colorfield, MUIA_Colorfield_Pen));
2880 char pen_str[10];
2881 nnset(pendisplay_pen, MUIA_String_Integer,
2882 XGET(pendisplay, MUIA_Pendisplay_Pen));
2884 struct MUI_PenSpec *pen_spec = NULL;
2885 GET(pendisplay, MUIA_Pendisplay_Spec, &pen_spec);
2886 strncpy(pen_str, pen_spec->buf, 10);
2887 set(pendisplay_spec, MUIA_String_Contents, pen_str);
2889 while ((LONG) DoMethod(app, MUIM_Application_NewInput,
2890 &sigs) != MUIV_Application_ReturnID_Quit)
2892 if (sigs)
2894 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
2895 if (sigs & SIGBREAKF_CTRL_C)
2896 break;
2897 if (sigs & SIGBREAKF_CTRL_D)
2898 break;
2902 DoMethod(list.multi_lists[0], MUIM_List_DeleteImage, list.image);
2903 MUI_DisposeObject(app);
2905 if (context_menu)
2906 MUI_DisposeObject(context_menu);
2907 CloseLibrary(ColorWheelBase);
2908 MUI_DeleteCustomClass(test_window_class);
2909 MUI_DeleteCustomClass(CL_DropText);
2911 /* shutdown-related automatic tests */
2912 if (list.destruct_count != 18)
2913 printf("The hook installed through MUIA_List_DestructHook has been"
2914 " called %ld times, but should have been called 18 times.\n",
2915 (long)list.destruct_count);
2917 CloseLibrary(MUIMasterBase);
2919 DeletePool(pool);
2921 return result;