Added a test for MUIA_Listview_SelectChange.
[AROS.git] / test / Zune / test.c
blob167b6cf028ab1d75481cf9237314a9ab79be0745
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 *selected_text,
172 *multi_lists[MULTI_LIST_COUNT],
173 *colorfield,
174 *format_string,
175 *column_string,
176 *column_text,
177 *def_column_string,
178 *showheadings_check,
179 *showimage_check;
180 LONG quiet[LIST_COUNT],
181 destruct_count,
182 has_multitest[LIST_COUNT];
183 IPTR image;
185 list;
187 static Object *wheel;
188 static Object *r_slider;
189 static Object *g_slider;
190 static Object *b_slider;
191 static Object *hue_gauge;
192 static Object *colorfield, *colorfield2, *colorfield_reset_button,
193 *colorfield_pen;
194 static Object *coloradjust;
195 static Object *pendisplay, *pendisplay2, *pendisplay_pen, *pendisplay_spec,
196 *reference_check, *shine_button, *shadow_button, *yellow_button, *poppen;
197 static Object *group;
198 static Object *editor_text;
199 static Object *filename_string;
200 static Object *save_button;
201 static struct Hook hook_standard;
202 static struct Hook hook;
203 static struct Hook hook_wheel;
204 static struct Hook hook_slider;
205 static struct Hook hook_objects;
206 static struct Hook hook_compare, hook_multitest;
207 static struct Hook hook_construct, hook_destruct, hook_display;
208 static struct Hook hook_objstr;
210 #if defined(TEST_ICONLIST)
211 static Object *drawer_iconlist;
212 static Object *volume_iconlist;
213 #endif
215 AROS_UFH0(void, repeat_function)
217 AROS_USERFUNC_INIT
219 printf("MUI_Timer\n");
221 AROS_USERFUNC_EXIT
224 AROS_UFH0(void, wheel_function)
226 AROS_USERFUNC_INIT
228 nnset(r_slider, MUIA_Numeric_Value, (XGET(wheel,
229 WHEEL_Red) >> 24) & 0xff);
230 nnset(g_slider, MUIA_Numeric_Value, (XGET(wheel,
231 WHEEL_Green) >> 24) & 0xff);
232 nnset(b_slider, MUIA_Numeric_Value, (XGET(wheel,
233 WHEEL_Blue) >> 24) & 0xff);
235 AROS_USERFUNC_EXIT
238 AROS_UFH0(void, slider_function)
240 AROS_USERFUNC_INIT
242 struct ColorWheelRGB cw;
243 ULONG red = XGET(r_slider, MUIA_Numeric_Value);
244 ULONG green = XGET(g_slider, MUIA_Numeric_Value);
245 ULONG blue = XGET(b_slider, MUIA_Numeric_Value);
247 cw.cw_Red = (red << 24) | (red << 16) | (red << 8) | red;
248 cw.cw_Green = (green << 24) | (green << 16) | (green << 8) | green;
249 cw.cw_Blue = (blue << 24) | (blue << 16) | (blue << 8) | blue;
251 nnset(wheel, WHEEL_RGB, &cw);
252 set(hue_gauge, MUIA_Gauge_Current, XGET(wheel, WHEEL_Hue));
254 AROS_USERFUNC_EXIT
257 AROS_UFH0(void, objects_function)
259 AROS_USERFUNC_INIT
261 Object *new_obj = MUI_MakeObject(MUIO_Button, "Button");
262 if (new_obj)
264 DoMethod(group, MUIM_Group_InitChange);
265 DoMethod(group, OM_ADDMEMBER, new_obj);
266 DoMethod(group, MUIM_Group_ExitChange);
269 AROS_USERFUNC_EXIT
272 static void About(void)
274 static Object *about_wnd;
276 if (!about_wnd)
278 about_wnd = AboutmuiObject, MUIA_Aboutmui_Application, app, End;
281 if (about_wnd)
282 set(about_wnd, MUIA_Window_Open, TRUE);
285 AROS_UFH3(static void, ObjStrHook,
286 AROS_UFHA(struct Hook *, h, A0),
287 AROS_UFHA(Object *, group, A2),
288 AROS_UFHA(Object *, str, A1))
290 AROS_USERFUNC_INIT
292 struct List *child_list = NULL;
293 Object *child, *list;
294 struct list_entry *entry;
296 /* Find the listview object within its group */
297 GET(group, MUIA_Group_ChildList, &child_list);
298 child = (APTR)child_list->lh_Head;
299 NextObject(&child);
300 list = NextObject(&child);
302 /* Copy one of the selected entry's fields to the string gadget */
303 DoMethod(list, MUIM_List_GetEntry, MUIV_List_GetEntry_Active, &entry);
304 SET(str, MUIA_String_Contents, entry->column1);
306 AROS_USERFUNC_EXIT
309 static void ChangeStringAccept(void)
311 STRPTR accept_chars = NULL, reject_chars = NULL;
312 BOOL accept_all;
313 UWORD i;
315 accept_all = XGET(string.accept_all_check, MUIA_Selected);
316 SET(string.accept_string, MUIA_Disabled, accept_all);
317 SET(string.reject_string, MUIA_Disabled, accept_all);
319 if (!accept_all)
321 GET(string.accept_string, MUIA_String_Contents, &accept_chars);
322 GET(string.reject_string, MUIA_String_Contents, &reject_chars);
325 for (i = 0; i < STRING_COUNT; i++)
327 SET(string.strings[i], MUIA_String_Accept, accept_chars);
328 SET(string.strings[i], MUIA_String_Reject, reject_chars);
332 static void ChangePen(void)
334 SIPTR pen = -1;
336 GET(colorfield_pen, MUIA_String_Integer, &pen);
337 if (pen >= 0)
338 SET(colorfield, MUIA_Colorfield_Pen, pen);
341 static void ChangePendisplayPen(void)
343 DoMethod(pendisplay, MUIM_Pendisplay_SetColormap,
344 XGET(pendisplay_pen, MUIA_String_Integer));
347 AROS_UFH3(static IPTR, ListCompareHook,
348 AROS_UFHA(struct Hook *, h, A0),
349 AROS_UFHA(CONST_STRPTR, str1, A2),
350 AROS_UFHA(CONST_STRPTR, str2, A1))
352 AROS_USERFUNC_INIT
354 IPTR len1, len2;
356 len1 = strlen(str1);
357 len2 = strlen(str2);
359 /* Indicate which string is shorter */
360 return len2 - len1;
362 AROS_USERFUNC_EXIT
365 AROS_UFH3(static IPTR, ListMultiTestHook,
366 AROS_UFHA(struct Hook *, h, A0),
367 AROS_UFHA(APTR, unused, A2),
368 AROS_UFHA(CONST_STRPTR, str, A1))
370 AROS_USERFUNC_INIT
372 /* Indicate whether the string doesn't begin with a vowel */
373 return strchr(vowels, tolower(str[0])) == NULL;
375 AROS_USERFUNC_EXIT
378 static void ChangeListTitle(void)
380 STRPTR title = NULL;
381 UWORD i;
383 i = XGET(list.list_radios, MUIA_Radio_Active);
385 GET(list.lists[i], MUIA_List_Title, &title);
386 FreeVec(title);
388 GET(list.title_string, MUIA_String_Contents, &title);
389 if (title[0] == '\0')
390 title = NULL;
392 title = StrDup(title);
394 SET(list.lists[i], MUIA_List_Title, title);
397 static void UpdateListInfo(void)
399 STRPTR title = NULL;
400 UWORD i;
401 LONG value = 0;
403 i = XGET(list.list_radios, MUIA_Radio_Active);
405 GET(list.lists[i], MUIA_Listview_DragType, &value);
406 NNSET(list.draggable_check, MUIA_Selected,
407 value != MUIV_Listview_DragType_None);
408 NNSET(list.dragsortable_check, MUIA_Disabled,
409 value == MUIV_Listview_DragType_None);
410 if (value == MUIV_Listview_DragType_None)
411 value = FALSE;
412 else
413 GET(list.lists[i], MUIA_List_DragSortable, &value);
414 NNSET(list.dragsortable_check, MUIA_Selected, value);
415 GET(list.lists[i], MUIA_List_ShowDropMarks, &value);
416 NNSET(list.showdropmarks_check, MUIA_Selected, value);
417 value = list.has_multitest[i]; // MUIA_List_MultiTestHook isn't gettable!
418 NNSET(list.multitest_check, MUIA_Selected, value);
419 value = list.quiet[i]; // MUIA_List_Quiet is not gettable!
420 NNSET(list.quiet_check, MUIA_Selected, value);
421 GET(list.lists[i], MUIA_List_AutoVisible, &value);
422 NNSET(list.autovisible_check, MUIA_Selected, value);
424 GET(list.lists[i], MUIA_List_Title, &title);
425 NNSET(list.title_string, MUIA_String_Contents, title);
427 GET(list.lists[i], MUIA_List_Entries, &value);
428 DoMethod(list.entries_text, MUIM_SetAsString, MUIA_Text_Contents,
429 "%ld", value);
430 GET(list.lists[i], MUIA_List_Visible, &value);
431 DoMethod(list.visible_text, MUIM_SetAsString, MUIA_Text_Contents,
432 "%ld", value);
433 GET(list.lists[i], MUIA_List_First, &value);
434 DoMethod(list.first_text, MUIM_SetAsString, MUIA_Text_Contents,
435 "%ld", value);
436 GET(list.lists[i], MUIA_List_InsertPosition, &value);
437 DoMethod(list.insert_text, MUIM_SetAsString, MUIA_Text_Contents,
438 "%ld", value);
439 GET(list.lists[i], MUIA_List_Active, &value);
440 if (value == MUIV_List_Active_Off)
441 SET(list.active_text, MUIA_Text_Contents, "N/A");
442 else
443 DoMethod(list.active_text, MUIM_SetAsString, MUIA_Text_Contents,
444 "%ld", value);
445 DoMethod(list.lists[i], MUIM_List_Select, MUIV_List_Select_All,
446 MUIV_List_Select_Ask, (IPTR) &value);
447 DoMethod(list.selected_text, MUIM_SetAsString, MUIA_Text_Contents,
448 "%ld", value);
449 GET(list.lists[i], MUIA_List_DropMark, &value);
450 DoMethod(list.drop_text, MUIM_SetAsString, MUIA_Text_Contents,
451 "%ld", value);
454 static void ListGetVisible(void)
456 UWORD i;
457 LONG value = 0;
459 i = XGET(list.list_radios, MUIA_Radio_Active);
461 GET(list.lists[i], MUIA_List_Visible, &value);
462 DoMethod(list.visible_text, MUIM_SetAsString, MUIA_Text_Contents,
463 "%ld", value);
466 static void ListGetFirst(void)
468 UWORD i;
469 LONG value = 0;
470 Object *real_list;
472 i = XGET(list.list_radios, MUIA_Radio_Active);
474 /* We fetch the Listview's list here to provide test coverage for that
475 attribute. Please don't optimise */
476 real_list = (Object *)XGET(list.lists[i], MUIA_Listview_List);
477 GET(real_list, MUIA_List_First, &value);
478 DoMethod(list.first_text, MUIM_SetAsString, MUIA_Text_Contents,
479 "%ld", value);
482 static void ListGetSelected(void)
484 UWORD i;
485 LONG value = 0;
487 i = XGET(list.list_radios, MUIA_Radio_Active);
489 DoMethod(list.lists[i], MUIM_List_Select, MUIV_List_Select_All,
490 MUIV_List_Select_Ask, (IPTR) &value);
491 DoMethod(list.selected_text, MUIM_SetAsString, MUIA_Text_Contents,
492 "%ld", value);
495 static void ListSetDraggable(void)
497 UWORD i;
498 LONG value = 0;
500 i = XGET(list.list_radios, MUIA_Radio_Active);
502 GET(list.draggable_check, MUIA_Selected, &value);
503 SET(list.lists[i], MUIA_Listview_DragType, value ?
504 MUIV_Listview_DragType_Immediate : MUIV_Listview_DragType_None);
507 static void ListSetShowDropMarks(void)
509 UWORD i;
510 LONG value = 0;
512 i = XGET(list.list_radios, MUIA_Radio_Active);
514 GET(list.showdropmarks_check, MUIA_Selected, &value);
515 SET(list.lists[i], MUIA_List_ShowDropMarks, value);
518 static void ListSetMultiTest(void)
520 UWORD i;
521 LONG value = 0;
523 i = XGET(list.list_radios, MUIA_Radio_Active);
525 GET(list.multitest_check, MUIA_Selected, &value);
526 SET(list.lists[i], MUIA_List_MultiTestHook, value ? &hook_multitest : NULL);
527 list.has_multitest[i] = value;
530 static void ListSetQuiet(void)
532 UWORD i;
533 LONG value = 0;
535 i = XGET(list.list_radios, MUIA_Radio_Active);
537 GET(list.quiet_check, MUIA_Selected, &value);
538 SET(list.lists[i], MUIA_List_Quiet, value);
539 list.quiet[i] = value;
542 static void ListSetDragSortable(void)
544 UWORD i;
545 LONG value = 0;
547 i = XGET(list.list_radios, MUIA_Radio_Active);
549 GET(list.dragsortable_check, MUIA_Selected, &value);
550 SET(list.lists[i], MUIA_List_DragSortable, value);
553 static void ListSetAutoVisible(void)
555 UWORD i;
556 LONG value = 0;
558 i = XGET(list.list_radios, MUIA_Radio_Active);
560 GET(list.autovisible_check, MUIA_Selected, &value);
561 SET(list.lists[i], MUIA_List_AutoVisible, value);
564 static void ListReset(void)
566 UWORD i;
568 i = XGET(list.list_radios, MUIA_Radio_Active);
570 SET(list.lists[i], MUIA_List_Active, list_active_positions[i]);
573 static void ListMove(void)
575 LONG mode, pos1, pos2;
576 UWORD i;
578 i = XGET(list.list_radios, MUIA_Radio_Active);
580 mode = XGET(list.move1_cycle, MUIA_Cycle_Active);
582 if (mode == 0)
583 pos1 = XGET(list.index1_string, MUIA_String_Integer);
584 else
585 pos1 = 1 - mode;
587 mode = XGET(list.move2_cycle, MUIA_Cycle_Active);
589 if (mode == 0)
590 pos2 = XGET(list.index2_string, MUIA_String_Integer);
591 else
592 pos2 = 1 - mode;
594 DoMethod(list.lists[i], MUIM_List_Move, pos1, pos2);
597 static void ListSort(void)
599 UWORD i;
601 i = XGET(list.list_radios, MUIA_Radio_Active);
603 DoMethod(list.lists[i], MUIM_List_Sort);
606 static void ListEnable(void)
608 UWORD i;
610 i = XGET(list.list_radios, MUIA_Radio_Active);
612 SET(list.lists[i], MUIA_Disabled, FALSE);
615 static void ListExchange(void)
617 LONG mode, pos1, pos2;
618 UWORD i;
620 i = XGET(list.list_radios, MUIA_Radio_Active);
622 mode = XGET(list.move1_cycle, MUIA_Cycle_Active);
624 if (mode == 0)
625 pos1 = XGET(list.index1_string, MUIA_String_Integer);
626 else
627 pos1 = 1 - mode;
629 mode = XGET(list.move2_cycle, MUIA_Cycle_Active);
631 if (mode == 0)
632 pos2 = XGET(list.index2_string, MUIA_String_Integer);
633 else
634 pos2 = 1 - mode;
636 DoMethod(list.lists[i], MUIM_List_Exchange, pos1, pos2);
639 static void ListJump(void)
641 LONG mode, pos;
642 UWORD i;
644 i = XGET(list.list_radios, MUIA_Radio_Active);
646 mode = XGET(list.jump_cycle, MUIA_Cycle_Active);
648 if (mode == 0)
649 pos = XGET(list.index1_string, MUIA_String_Integer);
650 else
651 pos = 1 - mode;
653 DoMethod(list.lists[i], MUIM_List_Jump, pos);
656 static void ListSelect(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_On,
671 NULL);
674 static void ListDeselect(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, MUIV_List_Select_Off,
689 NULL);
692 static void ListToggle(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_Select, pos,
707 MUIV_List_Select_Toggle, NULL);
710 static void ListRedraw(void)
712 LONG mode, pos;
713 UWORD i;
715 i = XGET(list.list_radios, MUIA_Radio_Active);
717 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
719 if (mode == 0)
720 pos = XGET(list.index1_string, MUIA_String_Integer);
721 else
722 pos = 0 - mode;
724 DoMethod(list.lists[i], MUIM_List_Redraw, pos);
727 static void ListInsertSingle(void)
729 LONG mode, pos;
730 UWORD i;
732 i = XGET(list.list_radios, MUIA_Radio_Active);
734 mode = XGET(list.insert_cycle, MUIA_Cycle_Active);
736 if (mode == 0)
737 pos = XGET(list.index1_string, MUIA_String_Integer);
738 else
739 pos = 1 - mode;
741 DoMethod(list.lists[i], MUIM_List_InsertSingle, "Tomato", pos);
744 static void ListInsert(void)
746 LONG mode, pos;
747 UWORD i;
749 i = XGET(list.list_radios, MUIA_Radio_Active);
751 mode = XGET(list.insert_cycle, MUIA_Cycle_Active);
753 if (mode == 0)
754 pos = XGET(list.index1_string, MUIA_String_Integer);
755 else
756 pos = 1 - mode;
758 DoMethod(list.lists[i], MUIM_List_Insert, fruits, -1, pos);
761 static void ListRemove(void)
763 LONG mode, pos, count, j, *selections;
764 UWORD i;
766 i = XGET(list.list_radios, MUIA_Radio_Active);
768 mode = XGET(list.remove_cycle, MUIA_Cycle_Active);
770 if (mode == 5)
772 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
773 This doesn't work as expected in MUI or Zune */
774 pos = MUIV_List_NextSelected_Start - 1;
775 while (pos != MUIV_List_NextSelected_End)
777 if (pos == MUIV_List_NextSelected_Start - 1)
778 pos++;
779 DoMethod(list.lists[i], MUIM_List_NextSelected, (IPTR) &pos);
780 if (pos != MUIV_List_NextSelected_End)
781 DoMethod(list.lists[i], MUIM_List_Remove, pos);
784 else if (mode == 6)
786 /* Remove selected entries safely by first retrieving them with
787 MUIM_List_NextSelected and then removing them one by one */
788 DoMethod(list.lists[i], MUIM_List_Select, MUIV_List_Select_All,
789 MUIV_List_Select_Ask, &count);
790 if (count == 0)
791 count = 1; /* There may still be an active entry */
792 selections = AllocVec(sizeof(LONG) * count, MEMF_ANY);
793 if (selections != NULL)
795 pos = MUIV_List_NextSelected_Start;
796 for (j = 0; j < count; j++)
798 DoMethod(list.lists[i], MUIM_List_NextSelected, (IPTR) &pos);
799 selections[j] = pos;
802 /* We must remove the entries in reverse order; otherwise the
803 later indices will become invalid */
804 while (count > 0)
805 DoMethod(list.lists[i], MUIM_List_Remove, selections[--count]);
806 FreeVec(selections);
809 else
811 if (mode == 0)
812 pos = XGET(list.index1_string, MUIA_String_Integer);
813 else
814 pos = 1 - mode;
815 DoMethod(list.lists[i], MUIM_List_Remove, pos);
819 static void ListClear(void)
821 UWORD i;
823 i = XGET(list.list_radios, MUIA_Radio_Active);
825 DoMethod(list.lists[i], MUIM_List_Clear);
828 static void ListActivate(void)
830 LONG mode, pos;
831 UWORD i;
833 i = XGET(list.list_radios, MUIA_Radio_Active);
835 mode = XGET(list.activate_cycle, MUIA_Cycle_Active);
837 if (mode == 0)
838 pos = XGET(list.index1_string, MUIA_String_Integer);
839 else
840 pos = -1 - mode;
842 SET(list.lists[i], MUIA_List_Active, pos);
845 static void ListDeactivate(void)
847 UWORD i;
849 i = XGET(list.list_radios, MUIA_Radio_Active);
851 SET(list.lists[i], MUIA_List_Active, MUIV_List_Active_Off);
854 static void CheckListDoubleClick(void)
856 LONG value = -1;
858 GET(list.multi_lists[1], MUIA_Listview_DoubleClick, &value);
859 MUI_Request(app, wnd, 0, "Test", "OK",
860 "MUIA_Listview_Doubleclick = %ld", value);
863 AROS_UFH3(static APTR, ListConstructHook,
864 AROS_UFHA(struct Hook *, h, A0),
865 AROS_UFHA(APTR, pool, A2),
866 AROS_UFHA(IPTR, n, A1))
868 AROS_USERFUNC_INIT
870 struct list_entry *entry;
872 entry = AllocPooled(pool, sizeof(struct list_entry) + 40);
874 if (entry != NULL)
876 entry->column1 = (char *)(entry + 1);
877 entry->column2 = entry->column1 + 20;
878 sprintf(entry->column1, "Entry%ld", (long)n);
879 sprintf(entry->column2, "Col2: Entry%ld", (long)n);
882 return entry;
884 AROS_USERFUNC_EXIT
887 AROS_UFH3(static void, ListDestructHook,
888 AROS_UFHA(struct Hook *, h, A0),
889 AROS_UFHA(APTR, pool, A2),
890 AROS_UFHA(struct list_entry *, entry, A1))
892 AROS_USERFUNC_INIT
894 FreePooled(pool, entry, sizeof(struct list_entry) + 40);
895 list.destruct_count++;
897 AROS_USERFUNC_EXIT
900 AROS_UFH3(static void, display_function,
901 AROS_UFHA(struct Hook *, h, A0),
902 AROS_UFHA(char **, strings, A2),
903 AROS_UFHA(struct list_entry *, entry, A1))
905 AROS_USERFUNC_INIT
907 static char buf[100];
909 if (entry)
911 if (XGET(list.showimage_check, MUIA_Selected))
912 sprintf(buf, "%ld \33O[%08lx]", (long)*(strings - 1),
913 (long)list.image);
914 else
915 sprintf(buf, "%ld", (long)*(strings - 1));
916 strings[0] = buf;
917 strings[1] = entry->column1;
918 strings[2] = entry->column2;
920 else
922 strings[0] = "Number";
923 strings[1] = "Column 1";
924 strings[2] = "Column 2";
927 AROS_USERFUNC_EXIT
930 static void Save(void)
932 char *text = (char *)XGET(editor_text, MUIA_String_Contents);
933 char *filename = (char *)XGET(filename_string, MUIA_String_Contents);
934 BPTR fh;
936 if (!strlen(filename))
937 return;
939 if ((fh = Open(filename, MODE_NEWFILE)))
941 Write(fh, text, strlen(text));
942 Close(fh);
946 #if defined(TEST_ICONLIST)
947 /* IconList callbacks */
948 static void volume_doubleclicked(void)
950 char buf[200];
951 struct IconList_Entry *ent = (void *)MUIV_IconList_NextIcon_Start;
953 DoMethod(volume_iconlist, MUIM_IconList_NextIcon,
954 MUIV_IconList_NextIcon_Selected, &ent);
955 if ((IPTR) ent == MUIV_IconList_NextIcon_End)
956 return;
958 strcpy(buf, ent->label);
959 strcat(buf, ":");
962 static void drawer_doubleclicked(void)
964 struct IconList_Entry *ent = (void *)MUIV_IconList_NextIcon_Start;
966 DoMethod(drawer_iconlist, MUIM_IconList_NextIcon,
967 MUIV_IconList_NextIcon_Selected, &ent);
968 if ((IPTR) ent == MUIV_IconList_NextIcon_End)
969 return;
970 set(drawer_iconlist, MUIA_IconDrawerList_Drawer,
971 ent->ile_IconEntry->ie_IconNode.ln_Name);
973 #endif
975 static IPTR create_balance_column(void)
977 return (IPTR) VGroup,
978 Child, RectangleObject,
979 GaugeFrame,
980 End,
981 Child, BalanceObject,
982 End,
983 Child, RectangleObject,
984 GaugeFrame,
985 End,
986 Child, BalanceObject,
987 End,
988 Child, RectangleObject,
989 GaugeFrame,
990 End,
991 Child, BalanceObject,
992 End,
993 Child, RectangleObject,
994 GaugeFrame,
995 End,
996 Child, BalanceObject,
997 End,
998 Child, RectangleObject,
999 GaugeFrame,
1000 End,
1001 End;
1004 /* The custom class */
1006 struct DropText_Data
1008 ULONG times;
1011 #ifdef __MAXON__
1012 #undef KeymapBase
1013 struct Library *KeymapBase;
1014 #endif
1016 #ifndef __AROS__
1017 __saveds __asm IPTR dispatcher(register __a0 struct IClass *cl,
1018 register __a2 Object *obj, register __a1 Msg msg)
1019 #else
1020 AROS_UFH3S(IPTR, dispatcher,
1021 AROS_UFHA(Class *, cl, A0),
1022 AROS_UFHA(Object *, obj, A2), AROS_UFHA(Msg, msg, A1))
1023 #endif
1025 AROS_USERFUNC_INIT
1027 switch (msg->MethodID)
1029 case MUIM_DragQuery:
1030 return MUIV_DragQuery_Accept;
1031 case MUIM_DragDrop:
1033 struct DropText_Data *data =
1034 (struct DropText_Data *)INST_DATA(cl, obj);
1035 char buf[100];
1036 data->times++;
1037 sprintf(buf, "%ld times", (long)data->times);
1038 set(obj, MUIA_Text_Contents, buf);
1042 return DoSuperMethodA(cl, obj, (Msg) msg);
1044 AROS_USERFUNC_EXIT
1047 static struct MUI_CustomClass *CL_DropText;
1049 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
1051 /* Main prog */
1053 AROS_UFH3S(void, hook_func_standard,
1054 AROS_UFHA(struct Hook *, h, A0),
1055 AROS_UFHA(void *, dummy, A2), AROS_UFHA(void **, funcptr, A1))
1057 AROS_USERFUNC_INIT
1059 void (*func) (ULONG *) = (void (*)(ULONG *))(*funcptr);
1061 if (func)
1062 func((ULONG *) funcptr + 1);
1064 AROS_USERFUNC_EXIT
1067 int main(void)
1069 APTR pool;
1070 Object *second_wnd;
1071 Object *open_button;
1072 Object *about_button;
1073 Object *quit_button;
1074 Object *repeat_button;
1075 Object *objects_button;
1076 Object *about_item, *quit_item;
1077 Object *context_menu;
1078 Object *popobject, *listview;
1079 Object *numerics[NUMERIC_COUNT];
1080 Object *min_string, *max_string;
1081 Object *slider_button;
1082 Object *country_radio[2];
1083 CONST_STRPTR title;
1084 UWORD i;
1085 LONG value = 0;
1087 static char *pages[] =
1088 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
1089 "Numeric", "Radio",
1090 #if defined(TEST_ICONLIST)
1091 "Icon List",
1092 #endif
1093 "Balancing", NULL};
1094 static char *text_pages[] =
1095 {"Text", "String", NULL};
1096 static char *color_pages[] =
1097 {"Palette", "Colors", "Pens", NULL};
1098 static char *list_pages[] =
1099 {"Single Column", "Multicolumn", NULL};
1100 static char **radio_entries1 = pages;
1101 static char *radio_entries2[] =
1102 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL};
1104 static IPTR entries[] = {1, 2, 3, 4, 5, 6, (IPTR)NULL};
1106 hook_standard.h_Entry = (HOOKFUNC) hook_func_standard;
1107 hook_objstr.h_Entry = (HOOKFUNC) ObjStrHook;
1109 pool = CreatePool(MEMF_ANY, 4096, 4096);
1111 MUIMasterBase = (struct Library *)OpenLibrary("muimaster.library", 0);
1113 hook.h_Entry = (HOOKFUNC) repeat_function;
1114 hook_wheel.h_Entry = (HOOKFUNC) wheel_function;
1115 hook_slider.h_Entry = (HOOKFUNC) slider_function;
1116 hook_objects.h_Entry = (HOOKFUNC) objects_function;
1117 hook_compare.h_Entry = (HOOKFUNC) ListCompareHook;
1118 hook_multitest.h_Entry = (HOOKFUNC) ListMultiTestHook;
1119 hook_construct.h_Entry = (HOOKFUNC) ListConstructHook;
1120 hook_destruct.h_Entry = (HOOKFUNC) ListDestructHook;
1121 hook_display.h_Entry = (HOOKFUNC) display_function;
1122 list.destruct_count = 0;
1123 list.has_multitest[3] = TRUE;
1125 context_menu = MenustripObject,
1126 MUIA_Family_Child, MenuObject,
1127 MUIA_Menu_Title, "Menutest",
1128 MUIA_Family_Child, about_item = MenuitemObject,
1129 MUIA_Menuitem_Title, "First Test Entry", End,
1130 MUIA_Family_Child, quit_item = MenuitemObject,
1131 MUIA_Menuitem_Title, "Second Test Entry", End,
1132 End,
1133 End;
1135 /* should check the result in a real program! */
1136 CL_DropText = MUI_CreateCustomClass(NULL, MUIC_Text, NULL,
1137 sizeof(struct DropText_Data), dispatcher);
1138 ColorWheelBase = OpenLibrary("gadgets/colorwheel.gadget", 0);
1140 pendisplay = PendisplayObject, MUIA_Pendisplay_Spec, &default_penspec, End;
1142 title = StrDup("Fruits");
1143 list.lists[0] = ListviewObject,
1144 MUIA_Listview_List,
1145 ListObject,
1146 InputListFrame,
1147 MUIA_List_Title, title,
1148 MUIA_List_SourceArray, fruits,
1149 MUIA_List_Active, MUIV_List_Active_Top,
1150 MUIA_List_PoolThreshSize, 256,
1151 MUIA_List_DragSortable, TRUE,
1152 MUIA_List_CompareHook, &hook_compare,
1153 MUIA_ShortHelp,
1154 "Default scroller\nTop entry active\nSorted by length",
1155 End,
1156 MUIA_Listview_MultiSelect,
1157 MUIV_Listview_MultiSelect_None,
1158 MUIA_Listview_DragType, MUIV_Listview_DragType_Immediate,
1159 MUIA_Listview_DoubleClick, TRUE,
1160 MUIA_CycleChain, 1,
1161 End;
1162 list.lists[1] = ListviewObject,
1163 MUIA_Listview_List,
1164 ListObject,
1165 InputListFrame,
1166 MUIA_List_SourceArray, fruits,
1167 MUIA_List_Active, MUIV_List_Active_Bottom,
1168 MUIA_List_PoolPuddleSize, 512,
1169 MUIA_List_AutoVisible, TRUE,
1170 MUIA_ShortHelp,
1171 "Left scroller\nBottom entry active\nSorted alphabetically",
1172 End,
1173 MUIA_Listview_ScrollerPos,
1174 MUIV_Listview_ScrollerPos_Left,
1175 MUIA_Listview_DragType, MUIV_Listview_DragType_None,
1176 MUIA_CycleChain, 1,
1177 End;
1178 list.lists[2] = ListviewObject,
1179 MUIA_Listview_List,
1180 ListObject,
1181 InputListFrame,
1182 MUIA_List_SourceArray, fruits,
1183 MUIA_List_Active, MUIV_List_Active_Off,
1184 MUIA_List_Pool, pool,
1185 MUIA_ShortHelp,
1186 "Right scroller\nNo active entry\nSorted alphabetically",
1187 End,
1188 MUIA_Listview_MultiSelect,
1189 MUIV_Listview_MultiSelect_Shifted,
1190 MUIA_Listview_ScrollerPos,
1191 MUIV_Listview_ScrollerPos_Right,
1192 MUIA_CycleChain, 1,
1193 End;
1194 list.lists[3] = ListviewObject,
1195 MUIA_Listview_List,
1196 ListObject,
1197 InputListFrame,
1198 MUIA_List_SourceArray, fruits,
1199 MUIA_List_Pool, NULL,
1200 MUIA_List_MultiTestHook, &hook_multitest,
1201 MUIA_ShortHelp,
1202 "No scroller\nDefault active entry\nSorted alphabetically",
1203 End,
1204 MUIA_Listview_MultiSelect,
1205 MUIV_Listview_MultiSelect_Always,
1206 MUIA_Listview_ScrollerPos,
1207 MUIV_Listview_ScrollerPos_None,
1208 MUIA_CycleChain, 1,
1209 End;
1210 list.lists[4] = ListviewObject,
1211 MUIA_Listview_List,
1212 ListObject,
1213 ReadListFrame,
1214 MUIA_List_SourceArray, fruits,
1215 MUIA_List_Active, MUIV_List_Active_Bottom,
1216 MUIA_List_MinLineHeight, 20,
1217 MUIA_ShortHelp,
1218 "Default scroller\nBottom entry active\nSorted by length",
1219 End,
1220 MUIA_Listview_Input, FALSE,
1221 MUIA_CycleChain, 1,
1222 End;
1224 list.colorfield = ColorfieldObject,
1225 MUIA_Colorfield_RGB, default_color,
1226 End;
1228 app = ApplicationObject,
1229 MUIA_Application_Menustrip, MenustripObject,
1230 MUIA_Family_Child, MenuObject,
1231 MUIA_Menu_Title, "Project",
1232 MUIA_Family_Child, about_item = MenuitemObject,
1233 MUIA_Menuitem_Title, "About...",
1234 MUIA_Menuitem_Shortcut, "?",
1235 End,
1236 MUIA_Family_Child, MenuitemObject,
1237 MUIA_Menuitem_Title, (SIPTR)-1,
1238 End,
1239 MUIA_Family_Child, quit_item = MenuitemObject,
1240 MUIA_Menuitem_Title, "Quit",
1241 MUIA_Menuitem_Shortcut, "Q",
1242 End,
1243 End,
1244 End,
1246 SubWindow, wnd = WindowObject,
1247 MUIA_Window_Title, "test",
1248 MUIA_Window_Activate, TRUE,
1250 WindowContents, VGroup,
1251 Child, RegisterGroup(pages),
1252 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1254 /* general */
1255 Child, VGroup,
1256 Child, HGroup,
1257 GroupFrameT("A horizontal group"),
1258 Child, ColGroup(2),
1259 GroupFrameT("A column group"),
1260 Child, repeat_button = TextObject,
1261 MUIA_CycleChain, 1,
1262 ButtonFrame,
1263 MUIA_Background, MUII_ButtonBack,
1264 MUIA_Text_PreParse, "\33c",
1265 MUIA_Text_Contents, "Repeat",
1266 MUIA_InputMode, MUIV_InputMode_RelVerify,
1267 End,
1268 Child, TextObject,
1269 MUIA_CycleChain, 1,
1270 ButtonFrame,
1271 MUIA_Background, MUII_ButtonBack,
1272 MUIA_Text_PreParse, "\33c",
1273 MUIA_Text_Contents, "Drag Me",
1274 MUIA_Draggable, TRUE,
1275 MUIA_InputMode, MUIV_InputMode_RelVerify,
1276 End,
1277 Child, open_button = TextObject,
1278 MUIA_CycleChain, 1,
1279 ButtonFrame,
1280 MUIA_Background, MUII_ButtonBack,
1281 MUIA_Text_PreParse, "\33c",
1282 MUIA_Text_Contents, "Open Window",
1283 MUIA_InputMode, MUIV_InputMode_RelVerify,
1284 End,
1285 Child, TextObject,
1286 MUIA_ContextMenu, context_menu,
1287 MUIA_CycleChain, 1,
1288 ButtonFrame,
1289 MUIA_Background, MUII_ButtonBack,
1290 MUIA_Text_PreParse, "\33c",
1291 MUIA_Text_Contents, "Press Right",
1292 MUIA_InputMode, MUIV_InputMode_RelVerify,
1293 End,
1294 Child, objects_button = TextObject,
1295 MUIA_CycleChain, 1,
1296 ButtonFrame,
1297 MUIA_Background, MUII_ButtonBack,
1298 MUIA_Text_PreParse, "\33c",
1299 MUIA_Text_Contents, "Add Objects",
1300 MUIA_InputMode, MUIV_InputMode_RelVerify,
1301 End,
1302 Child, HVSpace,
1303 Child, HGroup,
1304 Child, HVSpace,
1305 Child, MUI_MakeObject(MUIO_Checkmark,
1306 "_Checkmark"),
1307 End,
1308 Child, HGroup,
1309 Child, MUI_MakeObject(MUIO_Label,
1310 "_Checkmark", 0),
1311 Child, HVSpace,
1312 End,
1313 Child, HVSpace,
1314 Child, HVSpace,
1315 End,
1316 Child, group = VGroup,
1317 GroupFrameT("A vertical group"),
1318 Child, DropTextObject,
1319 MUIA_Dropable, TRUE,
1320 MUIA_CycleChain, 1,
1321 ButtonFrame,
1322 MUIA_Background, MUII_ButtonBack,
1323 MUIA_Text_PreParse, "\33c",
1324 MUIA_Text_Contents, "Drop Here",
1325 MUIA_Dropable, TRUE,
1326 MUIA_InputMode, MUIV_InputMode_RelVerify,
1327 End,
1328 Child, TextObject,
1329 TextFrame,
1330 MUIA_Background, MUII_MARKHALFSHINE,
1331 MUIA_CycleChain, 1,
1332 MUIA_Text_PreParse, "\33c",
1333 MUIA_Text_Contents, "Pattern",
1334 End,
1335 Child, MUI_NewObject(MUIC_Popimage, TAG_DONE),
1336 End,
1337 Child, ScrollgroupObject,
1338 GroupFrameT("A scroll group"),
1339 MUIA_Scrollgroup_Contents, VGroupV,
1340 VirtualFrame,
1341 Child, TextObject,
1342 TextFrame,
1343 MUIA_Text_Contents,
1344 "Line1\nLine2\nLine3\nLine4\n"
1345 "Line5\nLine6\nLine7\nLine8\n"
1346 "\n\n\n"
1347 "Line9\nLine10\nLine11\n",
1348 End,
1349 Child, HGroup,
1350 Child, MUI_MakeObject(MUIO_Button,
1351 "Button9"),
1352 Child, MUI_MakeObject(MUIO_Button,
1353 "Button10"),
1354 End,
1355 End,
1356 End,
1357 End,
1358 Child, popobject = PopobjectObject,
1359 MUIA_Popstring_String,
1360 MUI_MakeObject(MUIO_String, NULL, 200),
1361 MUIA_Popstring_Button, PopButton(MUII_PopUp),
1362 MUIA_Popobject_Object, VGroup,
1363 Child, TextObject,
1364 MUIA_Text_Contents, "test",
1365 End,
1366 Child, listview = ListviewObject,
1367 MUIA_Listview_List, ListObject,
1368 InputListFrame,
1369 MUIA_List_ConstructHook,
1370 &hook_construct,
1371 MUIA_List_DestructHook,
1372 &hook_destruct,
1373 MUIA_List_DisplayHook, &hook_display,
1374 MUIA_List_Format, ",,",
1375 MUIA_List_SourceArray, entries,
1376 MUIA_List_Title, TRUE,
1377 End,
1378 End,
1379 End,
1380 MUIA_Popobject_ObjStrHook, &hook_objstr,
1381 End,
1382 Child, CycleObject,
1383 ButtonFrame,
1384 MUIA_Cycle_Entries, pages,
1385 End,
1386 Child, ScrollbarObject,
1387 MUIA_Group_Horiz, TRUE,
1388 MUIA_Prop_Visible, 100,
1389 MUIA_Prop_Entries, 300,
1390 MUIA_Prop_First, 50,
1391 End,
1392 End,
1394 /* text */
1395 Child, RegisterGroup(text_pages),
1397 Child, VGroup,
1398 Child, TextObject,
1399 MUIA_Background, "2:cfffffff,cfffffff,10000000",
1400 TextFrame,
1401 MUIA_Text_Contents, "\33cHello World!\n"
1402 "This is a text object\n\33lLeft \33bbold\33n\n"
1403 "\33rRight",
1404 End,
1405 Child, TextObject,
1406 TextFrame,
1407 /* Test for a bug with pen specifications as reported here:
1408 https://sourceforge.net/p/aros/bugs/487/
1410 MUIA_Text_Contents, "This is a \33P[3]text \33P[]object \33P[1]with pen specifications",
1411 End,
1412 Child, RectangleObject,
1413 MUIA_VertWeight, 0,
1414 /* Seems to be not supported properly as orginal MUI
1415 doesn't allow to alter the height of the window */
1416 MUIA_Rectangle_HBar, TRUE,
1417 MUIA_Rectangle_BarTitle,"Enter a string",
1418 End,
1419 Child, StringObject,
1420 StringFrame,
1421 MUIA_CycleChain,1,
1422 MUIA_String_AdvanceOnCR, TRUE,
1423 End,
1424 Child, HVSpace,
1425 End,
1427 /* string */
1428 Child, HGroup,
1429 Child, VGroup,
1430 Child, VGroup, GroupFrameT("Default Alignment"),
1431 Child, string.strings[0] = StringObject,
1432 StringFrame,
1433 MUIA_String_Accept,
1434 (IPTR)default_accept_chars,
1435 MUIA_String_Reject,
1436 (IPTR)default_reject_chars,
1437 MUIA_String_AdvanceOnCR, TRUE,
1438 MUIA_String_MaxLen, 9,
1439 MUIA_CycleChain, 1,
1440 MUIA_String_AttachedList, list.lists[0],
1441 End,
1442 End,
1443 Child, VGroup, GroupFrameT("Left Aligned"),
1444 Child, string.strings[1] = 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_Left,
1452 MUIA_String_AdvanceOnCR, TRUE,
1453 MUIA_String_MaxLen, 9,
1454 MUIA_CycleChain, 1,
1455 MUIA_String_Contents,
1456 (IPTR)default_accept_chars,
1457 MUIA_String_BufferPos, 3,
1458 MUIA_String_AttachedList, list.lists[0],
1459 End,
1460 End,
1461 Child, VGroup, GroupFrameT("Right Aligned"),
1462 Child, string.strings[2] = StringObject,
1463 StringFrame,
1464 MUIA_String_Accept,
1465 (IPTR)default_accept_chars,
1466 MUIA_String_Reject,
1467 (IPTR)default_reject_chars,
1468 MUIA_String_Format,
1469 MUIV_String_Format_Right,
1470 MUIA_String_AdvanceOnCR, TRUE,
1471 MUIA_String_MaxLen, 9,
1472 MUIA_CycleChain, 1,
1473 MUIA_String_AttachedList, list.lists[0],
1474 End,
1475 End,
1476 Child, VGroup, GroupFrameT("Centered"),
1477 Child, string.strings[3] = StringObject,
1478 StringFrame,
1479 MUIA_String_Accept,
1480 (IPTR)default_accept_chars,
1481 MUIA_String_Reject,
1482 (IPTR)default_reject_chars,
1483 MUIA_String_Format,
1484 MUIV_String_Format_Center,
1485 MUIA_String_AdvanceOnCR, TRUE,
1486 MUIA_String_MaxLen, 9,
1487 MUIA_CycleChain, 1,
1488 MUIA_String_Integer, 123,
1489 MUIA_String_AttachedList, list.lists[0],
1490 End,
1491 End,
1492 Child, VGroup, GroupFrameT("Secret"),
1493 Child, string.strings[4] = StringObject,
1494 StringFrame,
1495 MUIA_String_Accept,
1496 (IPTR)default_accept_chars,
1497 MUIA_String_Reject,
1498 (IPTR)default_reject_chars,
1499 MUIA_String_Format,
1500 MUIV_String_Format_Center,
1501 MUIA_String_Secret, TRUE,
1502 MUIA_String_AdvanceOnCR, TRUE,
1503 MUIA_String_MaxLen, 9,
1504 MUIA_CycleChain, 1,
1505 MUIA_String_AttachedList, list.lists[0],
1506 End,
1507 End,
1508 Child, HGroup, GroupFrameT("Narrow"),
1509 Child, HVSpace,
1510 Child, string.strings[5] = StringObject,
1511 StringFrame,
1512 MUIA_String_Accept,
1513 (IPTR)default_accept_chars,
1514 MUIA_String_Reject,
1515 (IPTR)default_reject_chars,
1516 MUIA_String_Format,
1517 MUIV_String_Format_Center,
1518 MUIA_String_AdvanceOnCR, TRUE,
1519 MUIA_MaxWidth, 20,
1520 MUIA_String_MaxLen, 9,
1521 MUIA_CycleChain, 1,
1522 MUIA_String_AttachedList, list.lists[0],
1523 End,
1524 Child, HVSpace,
1525 End,
1526 Child, HVSpace,
1527 End,
1528 Child, VGroup, GroupFrameT("Controls"),
1529 Child, HGroup,
1530 Child, string.accept_all_check =
1531 MUI_MakeObject(MUIO_Checkmark, NULL),
1532 Child, MUI_MakeObject(MUIO_Label,
1533 "Accept all characters", 0),
1534 Child, HVSpace,
1535 End,
1536 Child, ColGroup(2),
1537 Child, MUI_MakeObject(MUIO_Label,
1538 "Acceptable characters:", 0),
1539 Child, string.accept_string = StringObject,
1540 StringFrame,
1541 MUIA_String_Contents,
1542 (IPTR)default_accept_chars,
1543 End,
1544 Child, MUI_MakeObject(MUIO_Label,
1545 "Unacceptable characters:", 0),
1546 Child, string.reject_string = StringObject,
1547 StringFrame,
1548 End,
1549 Child, MUI_MakeObject(MUIO_Label,
1550 "Cursor position:", 0),
1551 Child, string.cursor_pos_slider =
1552 SliderObject,
1553 MUIA_Group_Horiz, TRUE,
1554 MUIA_Numeric_Min, 0,
1555 End,
1556 Child, MUI_MakeObject(MUIO_Label,
1557 "Display position:", 0),
1558 Child, string.display_pos_slider =
1559 SliderObject,
1560 MUIA_Group_Horiz, TRUE,
1561 MUIA_Numeric_Min, 0,
1562 End,
1563 Child, MUI_MakeObject(MUIO_Label,
1564 "Integer value:", 0),
1565 Child, string.integer_string =
1566 StringObject,
1567 StringFrame,
1568 MUIA_String_Accept, (IPTR)digits,
1569 End,
1570 Child, MUI_MakeObject(MUIO_Label,
1571 "Plaintext:", 0),
1572 Child, string.plaintext_string =
1573 StringObject,
1574 StringFrame,
1575 End,
1576 Child, MUI_MakeObject(MUIO_Label,
1577 "Maximum string length:", 0),
1578 Child, string.max_len_text = TextObject,
1579 TextFrame,
1580 MUIA_Text_Contents, "Unknown",
1581 End,
1582 End,
1583 Child, VGroup,
1584 Child, HGroup,
1585 Child, string.cr_advance_check =
1586 MUI_MakeObject(MUIO_Checkmark,
1587 NULL),
1588 Child, MUI_MakeObject(MUIO_Label,
1589 "Advance on CR", 0),
1590 Child, HVSpace,
1591 End,
1592 Child, HGroup,
1593 Child, string.attach_list_check =
1594 MUI_MakeObject(MUIO_Checkmark,
1595 NULL),
1596 Child, MUI_MakeObject(MUIO_Label,
1597 "Attach list", 0),
1598 Child, HVSpace,
1599 End,
1600 #if 0
1601 Child, HGroup,
1602 Child, string.standard_hook_check =
1603 MUI_MakeObject(MUIO_Checkmark,
1604 NULL),
1605 Child, MUI_MakeObject(MUIO_Label,
1606 "Use standard edit hook", 0),
1607 Child, HVSpace,
1608 End,
1609 Child, HGroup,
1610 Child, string.custom_hook_check =
1611 MUI_MakeObject(MUIO_Checkmark,
1612 NULL),
1613 Child, MUI_MakeObject(MUIO_Label,
1614 "Use custom edit hook", 0),
1615 Child, HVSpace,
1616 End,
1617 #endif
1618 End,
1619 Child, HVSpace,
1620 End,
1622 End,
1623 End,
1625 /* boopsi */
1626 Child, VGroup,
1627 Child, wheel = BoopsiObject, /* MUI/Boopsi tags mixed */
1628 GroupFrame,
1629 /* boopsi objects don't know */
1630 /* their sizes, so we help */
1631 /* keep important values */
1632 /* during window resize */
1633 MUIA_Boopsi_ClassID, "colorwheel.gadget",
1634 MUIA_Boopsi_MinWidth , 30,
1635 MUIA_Boopsi_MinHeight, 30,
1636 MUIA_Boopsi_Remember , WHEEL_Saturation,
1637 MUIA_Boopsi_Remember , WHEEL_Hue,
1638 /* this magic fills in the screen pointer */
1639 MUIA_Boopsi_TagScreen, WHEEL_Screen,
1640 WHEEL_Screen, NULL,
1641 GA_Left, 0,
1642 GA_Top, 0, /* MUI will automatically */
1643 GA_Width, 0, /* fill in the correct values */
1644 GA_Height, 0,
1645 ICA_TARGET, ICTARGET_IDCMP,
1646 /* needed for notification */
1647 WHEEL_Saturation, 0, /* start in the center */
1648 MUIA_FillArea, TRUE,
1649 /* use this because it defaults to FALSE
1650 for boopsi gadgets but the colorwheel
1651 doesn't bother about redrawing its
1652 background */
1653 End,
1655 Child, r_slider = SliderObject,
1656 MUIA_Group_Horiz, TRUE,
1657 MUIA_Numeric_Min, 0,
1658 MUIA_Numeric_Max, 255,
1659 End,
1660 Child, g_slider = SliderObject,
1661 MUIA_Group_Horiz, TRUE,
1662 MUIA_Numeric_Min, 0,
1663 MUIA_Numeric_Max, 255,
1664 End,
1665 Child, b_slider = SliderObject,
1666 MUIA_Group_Horiz, TRUE,
1667 MUIA_Numeric_Min, 0,
1668 MUIA_Numeric_Max, 255,
1669 End,
1670 Child, hue_gauge = GaugeObject,
1671 GaugeFrame,
1672 MUIA_Gauge_Horiz, TRUE,
1673 MUIA_Gauge_Max, 255,
1674 MUIA_Gauge_Divide, 1<<24,
1675 MUIA_Gauge_InfoText, "Hue: %ld",
1676 End,
1677 End,
1679 /* color */
1680 Child, RegisterGroup(color_pages),
1681 Child, VGroup, GroupFrameT("Palette"),
1682 Child, PaletteObject,
1683 End,
1684 End,
1685 Child, HGroup,
1686 Child, VGroup, GroupFrameT("Colorfield"),
1688 Child, HGroup,
1689 Child, colorfield = ColorfieldObject,
1690 MUIA_Colorfield_RGB, default_color,
1691 MUIA_Colorfield_Pen, 253,
1692 End,
1693 Child, colorfield2 = ColorfieldObject,
1694 MUIA_Colorfield_Red, default_color[0],
1695 MUIA_Colorfield_Green, default_color[1],
1696 MUIA_Colorfield_Blue, default_color[2],
1697 End,
1698 End,
1699 Child, colorfield_reset_button =
1700 MUI_MakeObject(MUIO_Button,
1701 "Reset"),
1702 Child, HGroup,
1703 Child,
1704 MUI_MakeObject(MUIO_Label, "Pen:", 0),
1705 Child, colorfield_pen = StringObject,
1706 StringFrame,
1707 End,
1708 End,
1709 End,
1710 Child, VGroup, GroupFrameT("Coloradjust"),
1711 Child, coloradjust = ColoradjustObject,
1712 MUIA_Coloradjust_RGB, default_color,
1713 End,
1714 End,
1715 End,
1716 Child, HGroup,
1717 Child, VGroup,
1718 Child, VGroup, GroupFrameT("Pendisplay"),
1719 Child, HGroup,
1720 Child, pendisplay,
1721 Child, pendisplay2 = PendisplayObject,
1722 MUIA_Pendisplay_RGBcolor,
1723 default_color,
1724 End,
1725 End,
1726 Child, ColGroup(2),
1727 Child,
1728 MUI_MakeObject(
1729 MUIO_Label, "Pen:", 0),
1730 Child, HGroup,
1731 Child, pendisplay_pen =
1732 StringObject, StringFrame,
1733 End,
1734 Child, HVSpace,
1735 Child, reference_check =
1736 MUI_MakeObject(MUIO_Checkmark,
1737 NULL),
1738 Child, MUI_MakeObject(MUIO_Label,
1739 "Reference", 0),
1740 End,
1741 Child,
1742 MUI_MakeObject(
1743 MUIO_Label, "Penspec:", 0),
1744 Child, pendisplay_spec = StringObject,
1745 StringFrame,
1746 End,
1747 End,
1748 Child, HGroup,
1749 Child, shine_button =
1750 MUI_MakeObject(MUIO_Button,
1751 "Shine"),
1752 Child, shadow_button =
1753 MUI_MakeObject(MUIO_Button,
1754 "Shadow"),
1755 Child, yellow_button =
1756 MUI_MakeObject(MUIO_Button,
1757 "Yellow"),
1758 End,
1759 End,
1760 Child, VGroup, GroupFrameT("Poppen"),
1761 Child, poppen = PoppenObject,
1762 End,
1763 End,
1764 End,
1765 Child, VGroup, GroupFrameT("Penadjust"),
1766 Child, PenadjustObject,
1767 End,
1768 End,
1769 End,
1770 End,
1772 /* edit */
1773 Child, VGroup,
1774 Child, editor_text = StringObject,
1775 StringFrame,
1776 End,
1777 Child, PopaslObject,
1778 ASLFR_DoSaveMode, TRUE,
1779 MUIA_Popstring_String, filename_string =
1780 MUI_MakeObject(MUIO_String, NULL, 200),
1781 MUIA_Popstring_Button, PopButton(MUII_PopFile),
1782 End,
1783 Child, save_button =
1784 MUI_MakeObject(MUIO_Button, "Save"),
1785 End,
1787 /* lists */
1788 Child, RegisterGroup(list_pages),
1789 Child, VGroup,
1790 Child, ColGroup(LIST_COUNT),
1791 Child, VGroup, GroupFrameT("No Multiselect"),
1792 Child, list.lists[0],
1793 End,
1794 Child, VGroup,
1795 GroupFrameT("Default Multiselect"),
1796 Child, list.lists[1],
1797 End,
1798 Child, VGroup,
1799 GroupFrameT("Shifted Multiselect"),
1800 Child, list.lists[2],
1801 End,
1802 Child, VGroup,
1803 GroupFrameT("Unconditional Multiselect"),
1804 Child, list.lists[3],
1805 End,
1806 Child, VGroup,
1807 GroupFrameT("Read Only"),
1808 Child, list.lists[4],
1809 End,
1810 End,
1811 Child, HGroup,
1812 MUIA_Group_HorizSpacing, 0,
1813 Child, RectangleObject,
1814 MUIA_HorizWeight, 1,
1815 End,
1816 Child, list.list_radios = RadioObject,
1817 MUIA_Radio_Entries, empty,
1818 MUIA_Group_Horiz, TRUE,
1819 MUIA_HorizWeight, 1000,
1820 End,
1821 Child, RectangleObject,
1822 MUIA_HorizWeight, 1,
1823 End,
1824 End,
1825 Child, RectangleObject,
1826 MUIA_VertWeight, 0,
1827 MUIA_Rectangle_HBar, TRUE,
1828 MUIA_Rectangle_BarTitle, "List Controls",
1829 End,
1830 Child, ColGroup(6),
1831 Child, MUI_MakeObject(MUIO_Label,
1832 "Affected index 1:", 0),
1833 Child, list.index1_string =
1834 StringObject,
1835 StringFrame,
1836 MUIA_String_Accept, (IPTR)digits,
1837 MUIA_String_Integer, 0,
1838 End,
1839 Child, HGroup,
1840 Child, list.draggable_check =
1841 MUI_MakeObject(MUIO_Checkmark, NULL),
1842 Child, MUI_MakeObject(MUIO_Label,
1843 "Draggable", 0),
1844 Child, HVSpace,
1845 End,
1846 Child, HGroup,
1847 Child, list.showdropmarks_check =
1848 MUI_MakeObject(MUIO_Checkmark, NULL),
1849 Child, MUI_MakeObject(MUIO_Label,
1850 "Show drop marks", 0),
1851 Child, HVSpace,
1852 End,
1853 Child, HGroup,
1854 Child, list.autovisible_check =
1855 MUI_MakeObject(MUIO_Checkmark, NULL),
1856 Child, MUI_MakeObject(MUIO_Label,
1857 "Auto visible", 0),
1858 Child, HVSpace,
1859 End,
1860 Child, list.reset_button =
1861 MUI_MakeObject(MUIO_Button, "Reset"),
1863 Child, MUI_MakeObject(MUIO_Label,
1864 "Affected index 2:", 0),
1865 Child, list.index2_string =
1866 StringObject,
1867 StringFrame,
1868 MUIA_String_Accept, (IPTR)digits,
1869 MUIA_String_Integer, 0,
1870 End,
1871 Child, HGroup,
1872 Child, list.dragsortable_check =
1873 MUI_MakeObject(MUIO_Checkmark, NULL),
1874 Child, MUI_MakeObject(MUIO_Label,
1875 "Drag sortable", 0),
1876 Child, HVSpace,
1877 End,
1878 Child, HGroup,
1879 Child, list.multitest_check =
1880 MUI_MakeObject(MUIO_Checkmark, NULL),
1881 Child, MUI_MakeObject(MUIO_Label,
1882 "Filter multiselect", 0),
1883 Child, HVSpace,
1884 End,
1885 Child, HGroup,
1886 Child, list.quiet_check =
1887 MUI_MakeObject(MUIO_Checkmark, NULL),
1888 Child, MUI_MakeObject(MUIO_Label,
1889 "Quiet", 0),
1890 Child, HVSpace,
1891 End,
1892 Child, list.enable_button =
1893 MUI_MakeObject(MUIO_Button, "Enable"),
1895 Child, MUI_MakeObject(MUIO_Label,
1896 "Move/exchange mode 1:", 0),
1897 Child, list.move1_cycle = CycleObject,
1898 ButtonFrame,
1899 MUIA_Cycle_Entries, list_move1_modes,
1900 End,
1901 Child, list.move_button =
1902 MUI_MakeObject(MUIO_Button, "Move"),
1903 Child, list.sort_button =
1904 MUI_MakeObject(MUIO_Button, "Sort"),
1905 Child, MUI_MakeObject(MUIO_Label,
1906 "Title:", 0),
1907 Child, list.title_string =
1908 StringObject,
1909 StringFrame,
1910 End,
1912 Child, MUI_MakeObject(MUIO_Label,
1913 "Move/exchange mode 2:", 0),
1914 Child, list.move2_cycle = CycleObject,
1915 ButtonFrame,
1916 MUIA_Cycle_Entries, list_move2_modes,
1917 End,
1918 Child, list.exchange_button =
1919 MUI_MakeObject(MUIO_Button, "Exchange"),
1920 Child, list.redraw_button =
1921 MUI_MakeObject(MUIO_Button, "Redraw"),
1922 Child, MUI_MakeObject(MUIO_Label,
1923 "Entries:", 0),
1924 Child, list.entries_text = TextObject,
1925 TextFrame,
1926 MUIA_Text_Contents, "N/A",
1927 End,
1929 Child, MUI_MakeObject(MUIO_Label,
1930 "Jump mode:", 0),
1931 Child, list.jump_cycle = CycleObject,
1932 ButtonFrame,
1933 MUIA_Cycle_Entries, list_jump_modes,
1934 End,
1935 Child, list.jump_button =
1936 MUI_MakeObject(MUIO_Button, "Jump"),
1937 Child, list.toggle_button =
1938 MUI_MakeObject(MUIO_Button, "Toggle"),
1939 Child, MUI_MakeObject(MUIO_Label,
1940 "Visible entries:", 0),
1941 Child, list.visible_text = TextObject,
1942 TextFrame,
1943 MUIA_Text_Contents, "N/A",
1944 End,
1946 Child, MUI_MakeObject(MUIO_Label,
1947 "Select/redraw mode:", 0),
1948 Child, list.select_cycle = CycleObject,
1949 ButtonFrame,
1950 MUIA_Cycle_Entries, list_select_modes,
1951 End,
1952 Child, list.select_button =
1953 MUI_MakeObject(MUIO_Button, "Select"),
1954 Child, list.deselect_button =
1955 MUI_MakeObject(MUIO_Button, "Deselect"),
1956 Child, MUI_MakeObject(MUIO_Label,
1957 "First visible index:", 0),
1958 Child, list.first_text = TextObject,
1959 TextFrame,
1960 MUIA_Text_Contents, "N/A",
1961 End,
1963 Child, MUI_MakeObject(MUIO_Label,
1964 "Insert mode:", 0),
1965 Child, list.insert_cycle = CycleObject,
1966 ButtonFrame,
1967 MUIA_Cycle_Entries, list_insert_modes,
1968 End,
1969 Child, list.insert_single_button =
1970 MUI_MakeObject(MUIO_Button,
1971 "Insert Single"),
1972 Child, list.insert_multiple_button =
1973 MUI_MakeObject(MUIO_Button,
1974 "Insert Multiple"),
1975 Child, MUI_MakeObject(MUIO_Label,
1976 "Last insertion index:", 0),
1977 Child, list.insert_text = TextObject,
1978 TextFrame,
1979 MUIA_Text_Contents, "N/A",
1980 End,
1982 Child, MUI_MakeObject(MUIO_Label,
1983 "Remove mode:", 0),
1984 Child, list.remove_cycle = CycleObject,
1985 ButtonFrame,
1986 MUIA_Cycle_Entries, list_remove_modes,
1987 End,
1988 Child, list.remove_button =
1989 MUI_MakeObject(MUIO_Button, "Remove"),
1990 Child, list.clear_button =
1991 MUI_MakeObject(MUIO_Button, "Clear"),
1992 Child, MUI_MakeObject(MUIO_Label,
1993 "Active index:", 0),
1994 Child, list.active_text = TextObject,
1995 TextFrame,
1996 MUIA_Text_Contents, "N/A",
1997 End,
1999 Child, MUI_MakeObject(MUIO_Label,
2000 "Activate mode:", 0),
2001 Child, list.activate_cycle = CycleObject,
2002 ButtonFrame,
2003 MUIA_Cycle_Entries, list_activate_modes,
2004 End,
2005 Child, list.activate_button =
2006 MUI_MakeObject(MUIO_Button, "Activate"),
2007 Child, list.deactivate_button =
2008 MUI_MakeObject(MUIO_Button, "Deactivate"),
2009 Child, MUI_MakeObject(MUIO_Label,
2010 "Selected entries:", 0),
2011 Child, list.selected_text = TextObject,
2012 TextFrame,
2013 MUIA_Text_Contents, "N/A",
2014 End,
2016 Child, HVSpace,
2017 Child, HVSpace,
2018 Child, HVSpace,
2019 Child, HVSpace,
2020 Child, MUI_MakeObject(MUIO_Label,
2021 "Last drop index:", 0),
2022 Child, list.drop_text = TextObject,
2023 TextFrame,
2024 MUIA_Text_Contents, "N/A",
2025 End,
2026 End,
2027 End,
2028 Child, VGroup,
2029 Child, ColGroup(MULTI_LIST_COUNT),
2030 Child, VGroup, GroupFrameT("Standard Format"),
2031 Child, list.multi_lists[0] = ListviewObject,
2032 MUIA_Listview_List,
2033 ListObject,
2034 InputListFrame,
2035 MUIA_List_ConstructHook,
2036 &hook_construct,
2037 MUIA_List_DestructHook,
2038 &hook_destruct,
2039 MUIA_List_DisplayHook,
2040 &hook_display,
2041 MUIA_List_Format, list_format,
2042 MUIA_List_SourceArray, entries,
2043 MUIA_List_Title, TRUE,
2044 MUIA_List_AdjustWidth, TRUE,
2045 End,
2046 MUIA_Listview_MultiSelect,
2047 MUIV_Listview_MultiSelect_None,
2048 MUIA_Listview_DefClickColumn, 1,
2049 MUIA_CycleChain, 1,
2050 End,
2051 End,
2052 Child, VGroup, GroupFrameT("Custom Format"),
2053 Child, list.multi_lists[1] = ListviewObject,
2054 MUIA_Listview_List,
2055 ListObject,
2056 InputListFrame,
2057 MUIA_List_Format, list_format,
2058 MUIA_List_Title, TRUE,
2059 MUIA_List_AdjustHeight, TRUE,
2060 End,
2061 MUIA_Listview_MultiSelect,
2062 MUIV_Listview_MultiSelect_None,
2063 MUIA_CycleChain, 1,
2064 End,
2065 Child, HVSpace,
2066 End,
2067 End,
2068 Child, RectangleObject,
2069 MUIA_VertWeight, 0,
2070 MUIA_Rectangle_HBar, TRUE,
2071 MUIA_Rectangle_BarTitle, "List Controls",
2072 End,
2073 Child, HGroup,
2074 Child, MUI_MakeObject(MUIO_Label, "Format:", 0),
2075 Child, list.format_string = StringObject,
2076 StringFrame,
2077 MUIA_CycleChain, 1,
2078 End,
2079 Child, list.showheadings_check =
2080 MUI_MakeObject(MUIO_Checkmark, NULL),
2081 Child, MUI_MakeObject(MUIO_Label,
2082 "Show column headings", 0),
2083 Child, list.showimage_check =
2084 MUI_MakeObject(MUIO_Checkmark, NULL),
2085 Child, MUI_MakeObject(MUIO_Label,
2086 "Show image", 0),
2087 End,
2088 Child, HGroup,
2089 Child, MUI_MakeObject(MUIO_Label,
2090 "Default clicked column:", 0),
2091 Child, list.def_column_string = StringObject,
2092 StringFrame,
2093 MUIA_String_Accept, (IPTR)digits,
2094 MUIA_String_Integer, -1,
2095 MUIA_CycleChain, 1,
2096 End,
2097 Child, MUI_MakeObject(MUIO_Label,
2098 "Clicked column:", 0),
2099 Child, list.column_string = StringObject,
2100 MUIA_ShowMe, FALSE,
2101 End,
2102 Child, list.column_text = TextObject,
2103 TextFrame,
2104 MUIA_Text_Contents, "N/A",
2105 End,
2106 End,
2107 End,
2108 End,
2110 /* gauges */
2111 Child, HGroup,
2112 Child, VGroup,
2113 Child, VGroup,
2114 GroupFrame,
2115 Child, GaugeObject,
2116 GaugeFrame,
2117 MUIA_Gauge_InfoText, "%ld %%",
2118 MUIA_Gauge_Horiz, TRUE,
2119 MUIA_Gauge_Current, 25,
2120 End,
2121 Child, ScaleObject,
2122 End,
2123 End,
2124 Child, VGroup,
2125 GroupFrame,
2126 Child, GaugeObject,
2127 GaugeFrame,
2128 MUIA_Gauge_InfoText, "%ld %%",
2129 MUIA_Gauge_Horiz, TRUE,
2130 MUIA_Gauge_Current, 50,
2131 End,
2132 Child, ScaleObject,
2133 End,
2134 End,
2135 Child, VGroup,
2136 GroupFrame,
2137 Child, GaugeObject,
2138 GaugeFrame,
2139 MUIA_Gauge_InfoText, "%ld %%",
2140 MUIA_Gauge_Horiz, TRUE,
2141 MUIA_Gauge_Current, 75,
2142 End,
2143 Child, ScaleObject,
2144 End,
2145 End,
2146 End,
2147 Child, HGroup,
2148 Child, HVSpace,
2149 Child, GaugeObject,
2150 GaugeFrame,
2151 MUIA_Gauge_InfoText, "%ld %%",
2152 MUIA_Gauge_Current, 25,
2153 End,
2154 Child, GaugeObject,
2155 GaugeFrame,
2156 MUIA_Gauge_InfoText, "%ld %%",
2157 MUIA_Gauge_Current, 50,
2158 End,
2159 Child, GaugeObject,
2160 GaugeFrame,
2161 MUIA_Gauge_InfoText, "%ld %%",
2162 MUIA_Gauge_Current, 75,
2163 End,
2164 Child, HVSpace,
2165 End,
2166 End,
2168 /* numeric */
2169 Child, HGroup,
2170 Child, ColGroup(2),
2171 GroupFrameT("Horizontal Sliders"),
2172 Child, MUI_MakeObject(MUIO_Label, "Normal:", 0),
2173 Child, numerics[HNSLIDER] = SliderObject,
2174 MUIA_Slider_Horiz, TRUE,
2175 MUIA_Numeric_Min, NUMERIC_MIN,
2176 MUIA_Numeric_Max, NUMERIC_MAX,
2177 MUIA_CycleChain, 1,
2178 End,
2179 Child, MUI_MakeObject(MUIO_Label, "Reverse:", 0),
2180 Child, numerics[HRSLIDER] = SliderObject,
2181 MUIA_Numeric_Reverse, TRUE,
2182 MUIA_Numeric_Min, NUMERIC_MIN,
2183 MUIA_Numeric_Max, NUMERIC_MAX,
2184 MUIA_CycleChain, 1,
2185 End,
2186 Child, MUI_MakeObject(MUIO_Label, "Quiet:", 0),
2187 Child, numerics[HQSLIDER] = SliderObject,
2188 MUIA_Slider_Quiet, TRUE,
2189 MUIA_Numeric_Min, NUMERIC_MIN,
2190 MUIA_Numeric_Max, NUMERIC_MAX,
2191 MUIA_CycleChain, 1,
2192 End,
2193 End,
2194 Child, ColGroup(3),
2195 GroupFrameT("Vertical Sliders"),
2196 Child, MUI_MakeObject(MUIO_Label, "Normal", 0),
2197 Child, MUI_MakeObject(MUIO_Label, "Reverse", 0),
2198 Child, MUI_MakeObject(MUIO_Label, "Quiet", 0),
2199 Child, numerics[VNSLIDER] = SliderObject,
2200 MUIA_Slider_Horiz, FALSE,
2201 MUIA_Numeric_Min, NUMERIC_MIN,
2202 MUIA_Numeric_Max, NUMERIC_MAX,
2203 MUIA_CycleChain, 1,
2204 End,
2205 Child, numerics[VRSLIDER] = SliderObject,
2206 MUIA_Slider_Horiz, FALSE,
2207 MUIA_Numeric_Reverse, TRUE,
2208 MUIA_Numeric_Min, NUMERIC_MIN,
2209 MUIA_Numeric_Max, NUMERIC_MAX,
2210 MUIA_CycleChain, 1,
2211 End,
2212 Child, numerics[VQSLIDER] = SliderObject,
2213 MUIA_Slider_Horiz, FALSE,
2214 MUIA_Slider_Quiet, TRUE,
2215 MUIA_Numeric_Min, NUMERIC_MIN,
2216 MUIA_Numeric_Max, NUMERIC_MAX,
2217 MUIA_CycleChain, 1,
2218 End,
2219 End,
2220 Child, ColGroup(2),
2221 GroupFrameT("Numeric Buttons"),
2222 Child, MUI_MakeObject(MUIO_Label, "Normal:", 0),
2223 Child, numerics[NNUMERICBUTTON] =
2224 NumericbuttonObject,
2225 MUIA_Numeric_Min, NUMERIC_MIN,
2226 MUIA_Numeric_Max, NUMERIC_MAX,
2227 MUIA_CycleChain, 1,
2228 End,
2229 Child, MUI_MakeObject(MUIO_Label, "Reverse:", 0),
2230 Child, numerics[RNUMERICBUTTON] =
2231 NumericbuttonObject,
2232 MUIA_Numeric_Reverse, TRUE,
2233 MUIA_Numeric_Min, NUMERIC_MIN,
2234 MUIA_Numeric_Max, NUMERIC_MAX,
2235 MUIA_CycleChain, 1,
2236 End,
2237 End,
2238 Child, ColGroup(2),
2239 GroupFrameT("Knobs"),
2240 Child, MUI_MakeObject(MUIO_Label, "Normal", 0),
2241 Child, MUI_MakeObject(MUIO_Label, "Reverse", 0),
2242 Child, numerics[NKNOB] = KnobObject,
2243 MUIA_Numeric_Min, NUMERIC_MIN,
2244 MUIA_Numeric_Max, NUMERIC_MAX,
2245 MUIA_CycleChain, 1,
2246 End,
2247 Child, numerics[RKNOB] = KnobObject,
2248 MUIA_Numeric_Reverse, TRUE,
2249 MUIA_Numeric_Min, NUMERIC_MIN,
2250 MUIA_Numeric_Max, NUMERIC_MAX,
2251 MUIA_CycleChain, 1,
2252 End,
2253 End,
2254 Child, ColGroup(2),
2255 Child, MUI_MakeObject(MUIO_Label,
2256 "Minimum Value:", 0),
2257 Child, min_string = (Object *)StringObject,
2258 StringFrame,
2259 MUIA_String_Accept, (IPTR)digits,
2260 MUIA_String_Integer, NUMERIC_MIN,
2261 MUIA_CycleChain, 1,
2262 End,
2263 Child, MUI_MakeObject(MUIO_Label,
2264 "Maximum Value:", 0),
2265 Child, max_string = (Object *)StringObject,
2266 StringFrame,
2267 MUIA_String_Accept, (IPTR)digits,
2268 MUIA_String_Integer, NUMERIC_MAX,
2269 MUIA_CycleChain, 1,
2270 End,
2271 Child, slider_button = TextObject,
2272 ButtonFrame,
2273 MUIA_InputMode, MUIV_InputMode_RelVerify,
2274 MUIA_CycleChain, 1,
2275 MUIA_Background, MUII_ButtonBack,
2276 MUIA_Text_PreParse, "\33c",
2277 MUIA_Text_Contents,
2278 "Change Slider Orientations",
2279 End,
2280 Child, MUI_MakeObject(MUIO_Label, "", 0),
2281 End,
2282 End,
2284 /* radios */
2285 Child, HGroup,
2286 Child, VGroup,
2287 Child, RadioObject,
2288 GroupFrame,
2289 MUIA_Radio_Entries, radio_entries1,
2290 End,
2291 Child, country_radio[0] = RadioObject,
2292 GroupFrame,
2293 MUIA_Radio_Entries, radio_entries2,
2294 MUIA_Radio_Active, 1,
2295 End,
2296 End,
2297 Child, HGroup,
2298 Child, RadioObject,
2299 GroupFrame,
2300 MUIA_Radio_Entries, radio_entries1,
2301 End,
2302 Child, country_radio[1] = RadioObject,
2303 GroupFrame,
2304 MUIA_Radio_Entries, radio_entries2,
2305 MUIA_Radio_Active, 1,
2306 End,
2307 End,
2308 End,
2310 #if defined(TEST_ICONLIST)
2311 /* iconlist */
2312 Child, HGroup,
2313 Child, volume_iconlist =
2314 MUI_NewObject(MUIC_IconVolumeList, GroupFrame,
2315 TAG_DONE),
2316 Child, drawer_iconlist =
2317 MUI_NewObject(MUIC_IconDrawerList, GroupFrame,
2318 MUIA_IconDrawerList_Drawer, "SYS:",
2319 TAG_DONE),
2320 End,
2321 #endif
2323 /* balancing */
2324 Child, HGroup,
2325 Child, create_balance_column(),
2326 Child, BalanceObject,
2327 End,
2329 Child, create_balance_column(),
2330 Child, BalanceObject,
2331 End,
2333 Child, create_balance_column(),
2334 Child, BalanceObject,
2335 End,
2337 Child, create_balance_column(),
2338 Child, BalanceObject,
2339 End,
2341 Child, create_balance_column(),
2343 End,
2345 End,
2347 Child, HGroup,
2348 Child, about_button = TextObject,
2349 ButtonFrame,
2350 MUIA_InputMode, MUIV_InputMode_RelVerify,
2351 MUIA_CycleChain, 1,
2352 MUIA_Background, MUII_ButtonBack,
2353 MUIA_Text_PreParse, "\33c",
2354 MUIA_Text_Contents, "About",
2355 End,
2356 Child, quit_button = TextObject,
2357 ButtonFrame,
2358 MUIA_InputMode, MUIV_InputMode_RelVerify,
2359 MUIA_CycleChain, 1,
2360 MUIA_Background, MUII_ButtonBack,
2361 MUIA_ControlChar, 'q',
2362 MUIA_Text_HiChar, 'q',
2363 MUIA_Text_PreParse, "\33c",
2364 MUIA_Text_Contents, "Quit",
2365 End,
2366 End,
2367 End,
2368 End,
2370 SubWindow, second_wnd = WindowObject,
2371 MUIA_Window_Title, "Second window",
2372 WindowContents, VGroup,
2373 Child, DropTextObject,
2374 MUIA_Text_Contents, "Drop here",
2375 MUIA_Dropable, TRUE,
2376 End,
2377 End,
2378 End,
2380 End;
2382 if (app)
2384 ULONG sigs = 0;
2386 DoMethod(wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2,
2387 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
2388 DoMethod(second_wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
2389 second_wnd, 3, MUIM_Set, MUIA_Window_Open, FALSE);
2390 DoMethod(open_button, MUIM_Notify, MUIA_Pressed, FALSE, second_wnd,
2391 3, MUIM_Set, MUIA_Window_Open, TRUE);
2392 DoMethod(about_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
2393 MUIM_Application_AboutMUI, NULL);
2394 DoMethod(quit_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
2395 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
2396 DoMethod(objects_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
2397 MUIM_CallHook, &hook_objects);
2398 DoMethod(repeat_button, MUIM_Notify, MUIA_Timer, MUIV_EveryTime,
2399 app, 2, MUIM_CallHook, &hook);
2401 /* Notifications and set-up for string objects */
2402 DoMethod(string.max_len_text, MUIM_SetAsString, MUIA_Text_Contents,
2403 "%ld", XGET(string.strings[0], MUIA_String_MaxLen) - 1);
2404 set(string.cursor_pos_slider, MUIA_Numeric_Max,
2405 XGET(string.strings[0], MUIA_String_MaxLen) - 1);
2406 set(string.display_pos_slider, MUIA_Numeric_Max,
2407 XGET(string.strings[0], MUIA_String_MaxLen) - 1);
2408 set(string.cr_advance_check, MUIA_Selected, TRUE);
2409 set(string.attach_list_check, MUIA_Selected, TRUE);
2410 set(string.strings[1], MUIA_Disabled,
2411 XGET(string.strings[1], MUIA_String_Format)
2412 != MUIV_String_Format_Left);
2413 set(string.strings[2], MUIA_Disabled,
2414 XGET(string.strings[2], MUIA_String_Format)
2415 != MUIV_String_Format_Right);
2416 set(string.strings[3], MUIA_Disabled,
2417 XGET(string.strings[3], MUIA_String_Format)
2418 != MUIV_String_Format_Center);
2419 set(string.strings[4], MUIA_Disabled,
2420 !XGET(string.strings[4], MUIA_String_Secret));
2421 set(string.strings[0], MUIA_String_MaxLen, 100);
2422 set(string.reject_string, MUIA_String_Contents,
2423 (IPTR)default_reject_chars);
2425 for (i = 0; i < STRING_COUNT; i++)
2427 if (i == 0)
2429 DoMethod(string.accept_string, MUIM_Notify,
2430 MUIA_String_Contents, MUIV_EveryTime, string.strings[i],
2431 3, MUIM_Set, MUIA_String_Accept, MUIV_TriggerValue);
2432 DoMethod(string.cr_advance_check, MUIM_Notify, MUIA_Selected,
2433 MUIV_EveryTime, string.strings[i], 3, MUIM_Set,
2434 MUIA_String_AdvanceOnCR, MUIV_TriggerValue);
2435 DoMethod(string.cursor_pos_slider, MUIM_Notify,
2436 MUIA_Numeric_Value, MUIV_EveryTime, string.strings[i], 3,
2437 MUIM_Set, MUIA_String_BufferPos, MUIV_TriggerValue);
2438 DoMethod(string.display_pos_slider, MUIM_Notify,
2439 MUIA_Numeric_Value, MUIV_EveryTime, string.strings[i], 3,
2440 MUIM_Set, MUIA_String_DisplayPos, MUIV_TriggerValue);
2441 DoMethod(string.attach_list_check, MUIM_Notify, MUIA_Selected,
2442 TRUE, string.strings[i], 3, MUIM_Set,
2443 MUIA_String_AttachedList, list.lists[0]);
2444 DoMethod(string.attach_list_check, MUIM_Notify, MUIA_Selected,
2445 FALSE, string.strings[i], 3, MUIM_Set,
2446 MUIA_String_AttachedList, NULL);
2448 else
2450 DoMethod(string.strings[0], MUIM_Notify, MUIA_String_Accept,
2451 MUIV_EveryTime, string.strings[i], 3, MUIM_Set,
2452 MUIA_String_Accept, MUIV_TriggerValue);
2453 DoMethod(string.strings[0], MUIM_Notify,
2454 MUIA_String_AdvanceOnCR, MUIV_EveryTime,
2455 string.strings[i], 3, MUIM_Set, MUIA_String_AdvanceOnCR,
2456 MUIV_TriggerValue);
2457 DoMethod(string.strings[0], MUIM_Notify,
2458 MUIA_String_BufferPos, MUIV_EveryTime,
2459 string.strings[i], 3, MUIM_Set, MUIA_String_BufferPos,
2460 MUIV_TriggerValue);
2461 DoMethod(string.strings[0], MUIM_Notify,
2462 MUIA_String_DisplayPos, MUIV_EveryTime,
2463 string.strings[i], 3, MUIM_Set, MUIA_String_DisplayPos,
2464 MUIV_TriggerValue);
2465 DoMethod(string.strings[0], MUIM_Notify,
2466 MUIA_String_AttachedList, MUIV_EveryTime,
2467 string.strings[i], 3, MUIM_Set,
2468 MUIA_String_AttachedList, MUIV_TriggerValue);
2470 DoMethod(string.reject_string, MUIM_Notify, MUIA_String_Contents,
2471 MUIV_EveryTime, string.strings[i], 3, MUIM_Set,
2472 MUIA_String_Reject, MUIV_TriggerValue);
2473 DoMethod(string.strings[i], MUIM_Notify, MUIA_String_Integer,
2474 MUIV_EveryTime, string.integer_string, 3, MUIM_NoNotifySet,
2475 MUIA_String_Integer, MUIV_TriggerValue);
2476 DoMethod(string.integer_string, MUIM_Notify, MUIA_String_Integer,
2477 MUIV_EveryTime, string.strings[i], 3, MUIM_NoNotifySet,
2478 MUIA_String_Integer, MUIV_TriggerValue);
2480 DoMethod(string.accept_all_check, MUIM_Notify, MUIA_Selected,
2481 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2482 ChangeStringAccept);
2483 DoMethod(string.strings[4], MUIM_Notify, MUIA_String_Acknowledge,
2484 MUIV_EveryTime, string.plaintext_string, 3, MUIM_NoNotifySet,
2485 MUIA_String_Contents, MUIV_TriggerValue);
2486 DoMethod(string.plaintext_string, MUIM_Notify,
2487 MUIA_String_Acknowledge, MUIV_EveryTime, string.strings[4], 3,
2488 MUIM_NoNotifySet, MUIA_String_Contents, MUIV_TriggerValue);
2490 DoMethod(wheel, MUIM_Notify, WHEEL_Hue, MUIV_EveryTime, app, 2,
2491 MUIM_CallHook, &hook_wheel);
2492 DoMethod(wheel, MUIM_Notify, WHEEL_Saturation, MUIV_EveryTime, app,
2493 2, MUIM_CallHook, &hook_wheel);
2494 DoMethod(r_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
2495 app, 2, MUIM_CallHook, &hook_slider);
2496 DoMethod(g_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
2497 app, 2, MUIM_CallHook, &hook_slider);
2498 DoMethod(b_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
2499 app, 2, MUIM_CallHook, &hook_slider);
2501 DoMethod(save_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 3,
2502 MUIM_CallHook, &hook_standard, Save);
2504 DoMethod(quit_item, MUIM_Notify, MUIA_Menuitem_Trigger,
2505 MUIV_EveryTime, app, 2, MUIM_Application_ReturnID,
2506 MUIV_Application_ReturnID_Quit);
2507 DoMethod(about_item, MUIM_Notify, MUIA_Menuitem_Trigger,
2508 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2509 About);
2511 /* Notifications for color objects */
2512 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Red,
2513 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Red,
2514 MUIV_TriggerValue);
2515 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Green,
2516 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Green,
2517 MUIV_TriggerValue);
2518 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Blue,
2519 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Blue,
2520 MUIV_TriggerValue);
2521 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Red,
2522 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Red,
2523 MUIV_TriggerValue);
2524 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Green,
2525 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Green,
2526 MUIV_TriggerValue);
2527 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Blue,
2528 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Blue,
2529 MUIV_TriggerValue);
2530 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Pen,
2531 MUIV_EveryTime, colorfield_pen, 3, MUIM_Set,
2532 MUIA_String_Integer, MUIV_TriggerValue);
2533 DoMethod(colorfield_pen, MUIM_Notify, MUIA_String_Acknowledge,
2534 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2535 ChangePen);
2536 DoMethod(colorfield_reset_button, MUIM_Notify, MUIA_Pressed, FALSE,
2537 colorfield, 3, MUIM_Set, MUIA_Colorfield_RGB, default_color);
2539 /* Notifications for pen objects */
2540 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_Pen,
2541 MUIV_EveryTime, pendisplay_pen, 3, MUIM_NoNotifySet,
2542 MUIA_String_Integer, MUIV_TriggerValue);
2543 DoMethod(pendisplay_pen, MUIM_Notify, MUIA_String_Acknowledge,
2544 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2545 ChangePendisplayPen);
2546 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_Spec,
2547 MUIV_EveryTime, pendisplay_spec, 3, MUIM_Set,
2548 MUIA_String_Contents, MUIV_TriggerValue);
2549 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_RGB,
2550 MUIV_EveryTime, pendisplay, 3, MUIM_Set,
2551 MUIA_Pendisplay_RGBcolor, MUIV_TriggerValue);
2552 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_RGBcolor,
2553 MUIV_EveryTime, poppen, 3, MUIM_Set, MUIA_Pendisplay_RGBcolor,
2554 MUIV_TriggerValue);
2555 DoMethod(pendisplay_spec, MUIM_Notify, MUIA_String_Contents,
2556 MUIV_EveryTime, pendisplay, 3, MUIM_Set, MUIA_Pendisplay_Spec,
2557 MUIV_TriggerValue);
2558 DoMethod(reference_check, MUIM_Notify, MUIA_Selected, TRUE,
2559 pendisplay2, 3, MUIM_Set, MUIA_Pendisplay_Reference, pendisplay);
2560 DoMethod(reference_check, MUIM_Notify, MUIA_Selected, FALSE,
2561 pendisplay2, 3, MUIM_Set, MUIA_Pendisplay_Reference, NULL);
2562 DoMethod(shine_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
2563 2, MUIM_Pendisplay_SetMUIPen, MPEN_SHINE);
2564 DoMethod(shadow_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
2565 2, MUIM_Pendisplay_SetMUIPen, MPEN_SHADOW);
2566 DoMethod(yellow_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
2567 4, MUIM_Pendisplay_SetRGB, 0xffffffff, 0xffffffff, 0);
2569 /* Notifications and set-up for list objects */
2570 set(list.showdropmarks_check, MUIA_Selected, TRUE);
2571 UpdateListInfo();
2572 for (i = 0; i < LIST_COUNT; i++)
2574 DoMethod(list.lists[i], MUIM_Notify, MUIA_Listview_DoubleClick,
2575 MUIV_EveryTime, list.lists[i], 3, MUIM_Set, MUIA_Disabled,
2576 TRUE);
2577 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Entries,
2578 MUIV_EveryTime, list.entries_text, 4, MUIM_SetAsString,
2579 MUIA_Text_Contents, "%ld", MUIV_TriggerValue);
2580 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Visible,
2581 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2582 ListGetVisible);
2583 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_First,
2584 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2585 ListGetFirst);
2586 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_InsertPosition,
2587 MUIV_EveryTime, list.insert_text, 4, MUIM_SetAsString,
2588 MUIA_Text_Contents, "%ld", MUIV_TriggerValue);
2589 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_Active,
2590 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2591 UpdateListInfo);
2592 DoMethod(list.lists[i], MUIM_Notify, MUIA_Listview_SelectChange,
2593 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2594 ListGetSelected);
2596 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2597 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2598 ListSetDraggable);
2599 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2600 MUIV_EveryTime, list.dragsortable_check, 3, MUIM_Set,
2601 MUIA_Disabled, MUIV_NotTriggerValue);
2602 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2603 FALSE, list.dragsortable_check, 3, MUIM_Set,
2604 MUIA_Selected, FALSE);
2605 DoMethod(list.showdropmarks_check, MUIM_Notify, MUIA_Selected,
2606 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2607 ListSetShowDropMarks);
2608 DoMethod(list.multitest_check, MUIM_Notify, MUIA_Selected,
2609 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2610 ListSetMultiTest);
2611 DoMethod(list.quiet_check, MUIM_Notify, MUIA_Selected,
2612 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2613 ListSetQuiet);
2614 DoMethod(list.dragsortable_check, MUIM_Notify, MUIA_Selected,
2615 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2616 ListSetDragSortable);
2617 DoMethod(list.autovisible_check, MUIM_Notify, MUIA_Selected,
2618 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2619 ListSetAutoVisible);
2620 DoMethod(list.reset_button, MUIM_Notify, MUIA_Pressed, FALSE,
2621 app, 3, MUIM_CallHook, &hook_standard, ListReset);
2622 DoMethod(list.move_button, MUIM_Notify, MUIA_Pressed, FALSE,
2623 app, 3, MUIM_CallHook, &hook_standard, ListMove);
2624 DoMethod(list.sort_button, MUIM_Notify, MUIA_Pressed, FALSE,
2625 app, 3, MUIM_CallHook, &hook_standard, ListSort);
2626 DoMethod(list.enable_button, MUIM_Notify, MUIA_Pressed, FALSE,
2627 app, 3, MUIM_CallHook, &hook_standard, ListEnable);
2628 DoMethod(list.exchange_button, MUIM_Notify, MUIA_Pressed, FALSE,
2629 app, 3, MUIM_CallHook, &hook_standard, ListExchange);
2630 DoMethod(list.jump_button, MUIM_Notify, MUIA_Pressed, FALSE,
2631 app, 3, MUIM_CallHook, &hook_standard, ListJump);
2632 DoMethod(list.select_button, MUIM_Notify, MUIA_Pressed, FALSE,
2633 app, 3, MUIM_CallHook, &hook_standard, ListSelect);
2634 DoMethod(list.deselect_button, MUIM_Notify, MUIA_Pressed, FALSE,
2635 app, 3, MUIM_CallHook, &hook_standard, ListDeselect);
2636 DoMethod(list.toggle_button, MUIM_Notify, MUIA_Pressed, FALSE,
2637 app, 3, MUIM_CallHook, &hook_standard, ListToggle);
2638 DoMethod(list.redraw_button, MUIM_Notify, MUIA_Pressed, FALSE,
2639 app, 3, MUIM_CallHook, &hook_standard, ListRedraw);
2640 DoMethod(list.insert_single_button, MUIM_Notify, MUIA_Pressed, FALSE,
2641 app, 3, MUIM_CallHook, &hook_standard, ListInsertSingle);
2642 DoMethod(list.insert_multiple_button, MUIM_Notify, MUIA_Pressed, FALSE,
2643 app, 3, MUIM_CallHook, &hook_standard, ListInsert);
2644 DoMethod(list.remove_button, MUIM_Notify, MUIA_Pressed, FALSE,
2645 app, 3, MUIM_CallHook, &hook_standard, ListRemove);
2646 DoMethod(list.clear_button, MUIM_Notify, MUIA_Pressed, FALSE,
2647 app, 3, MUIM_CallHook, &hook_standard, ListClear);
2648 DoMethod(list.activate_button, MUIM_Notify, MUIA_Pressed, FALSE,
2649 app, 3, MUIM_CallHook, &hook_standard, ListActivate);
2650 DoMethod(list.deactivate_button, MUIM_Notify, MUIA_Pressed, FALSE,
2651 app, 3, MUIM_CallHook, &hook_standard, ListDeactivate);
2652 DoMethod(list.title_string, MUIM_Notify, MUIA_String_Acknowledge,
2653 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2654 ChangeListTitle);
2655 DoMethod(list.list_radios, MUIM_Notify, MUIA_Radio_Active,
2656 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2657 UpdateListInfo);
2658 SET(list.lists[4], MUIA_List_CompareHook, &hook_compare);
2659 SET(list.lists[4], MUIA_List_AutoVisible, TRUE);
2661 SET(list.showheadings_check, MUIA_Selected,
2662 XGET(list.multi_lists[0], MUIA_List_Title));
2663 SET(list.format_string, MUIA_String_Contents,
2664 XGET(list.multi_lists[1], MUIA_List_Format));
2665 SET(list.def_column_string, MUIA_String_Integer,
2666 XGET(list.multi_lists[0], MUIA_Listview_DefClickColumn));
2667 DoMethod(list.format_string, MUIM_Notify, MUIA_String_Acknowledge,
2668 MUIV_EveryTime, list.multi_lists[1], 3, MUIM_Set,
2669 MUIA_List_Format, MUIV_TriggerValue);
2670 DoMethod(list.multi_lists[1], MUIM_Notify, MUIA_List_Format,
2671 MUIV_EveryTime, wnd, 3, MUIM_Set,
2672 MUIA_Window_ActiveObject, list.format_string);
2673 for (i = 0; i < MULTI_LIST_COUNT; i++)
2675 DoMethod(list.showheadings_check, MUIM_Notify, MUIA_Selected,
2676 MUIV_EveryTime, list.multi_lists[i], 3, MUIM_Set,
2677 MUIA_List_Title, MUIV_TriggerValue);
2678 DoMethod(list.showimage_check, MUIM_Notify, MUIA_Selected,
2679 MUIV_EveryTime, list.multi_lists[i], 2, MUIM_List_Redraw,
2680 MUIV_List_Redraw_All);
2681 DoMethod(list.def_column_string, MUIM_Notify,
2682 MUIA_String_Integer,
2683 MUIV_EveryTime, list.multi_lists[i], 3, MUIM_Set,
2684 MUIA_Listview_DefClickColumn, MUIV_TriggerValue);
2685 DoMethod(list.multi_lists[i], MUIM_Notify,
2686 MUIA_Listview_ClickColumn, MUIV_EveryTime,
2687 list.column_string, 3, MUIM_Set, MUIA_String_Integer,
2688 MUIV_TriggerValue);
2690 DoMethod(list.column_string, MUIM_Notify, MUIA_String_Contents,
2691 MUIV_EveryTime, list.column_text, 3, MUIM_Set, MUIA_Text_Contents,
2692 MUIV_TriggerValue);
2693 DoMethod(list.multi_lists[1], MUIM_Notify, MUIA_Listview_DoubleClick,
2694 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2695 CheckListDoubleClick);
2696 SET(list.multi_lists[1], MUIA_List_ConstructHook, &hook_construct);
2697 SET(list.multi_lists[1], MUIA_List_DestructHook, &hook_destruct);
2698 SET(list.multi_lists[1], MUIA_List_DisplayHook, &hook_display);
2699 DoMethod(list.multi_lists[1], MUIM_List_Insert, entries, -1,
2700 MUIV_List_Insert_Top);
2702 DoMethod(listview, MUIM_Notify, MUIA_Listview_DoubleClick, TRUE,
2703 popobject, 2, MUIM_Popstring_Close, TRUE);
2705 /* numeric */
2706 for (i = 0; i < NUMERIC_COUNT; i++)
2708 DoMethod(min_string, MUIM_Notify, MUIA_String_Integer,
2709 MUIV_EveryTime, numerics[i], 3, MUIM_Set, MUIA_Numeric_Min,
2710 MUIV_TriggerValue);
2711 DoMethod(max_string, MUIM_Notify, MUIA_String_Integer,
2712 MUIV_EveryTime, numerics[i], 3, MUIM_Set, MUIA_Numeric_Max,
2713 MUIV_TriggerValue);
2715 DoMethod(slider_button, MUIM_Notify, MUIA_Pressed, FALSE,
2716 numerics[HRSLIDER], 3, MUIM_Set, MUIA_Slider_Horiz, FALSE);
2718 /* radio */
2719 DoMethod(country_radio[0], MUIM_Notify, MUIA_Radio_Active,
2720 MUIV_EveryTime, country_radio[1], 3, MUIM_NoNotifySet,
2721 MUIA_Radio_Active, MUIV_TriggerValue);
2722 DoMethod(country_radio[1], MUIM_Notify, MUIA_Radio_Active,
2723 MUIV_EveryTime, country_radio[0], 3, MUIM_NoNotifySet,
2724 MUIA_Radio_Active, MUIV_TriggerValue);
2726 #if defined(TEST_ICONLIST)
2727 /* iconlist */
2728 DoMethod(volume_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick,
2729 TRUE, volume_iconlist, 3, MUIM_CallHook, &hook_standard,
2730 volume_doubleclicked);
2731 DoMethod(drawer_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick,
2732 TRUE, drawer_iconlist, 3, MUIM_CallHook, &hook_standard,
2733 drawer_doubleclicked);
2734 #endif
2736 /* automatic tests */
2737 get(list.lists[0], MUIA_List_Visible, &value);
2738 if (value != -1)
2739 printf("MUIA_List_Visible equals %ld before display,"
2740 " but it should be -1.\n", (long)value);
2741 get(list.multi_lists[0], MUIA_Listview_ClickColumn, &value);
2742 if (value != 0)
2743 printf("MUIA_Listview_ClickColumn equals %ld before display,"
2744 " but it should be 0.\n", (long)value);
2745 get(list.lists[0], MUIA_Listview_DoubleClick, &value);
2746 if (value != 0)
2747 printf("MUIA_Listview_DoubleClick equals %ld before display,"
2748 " but it should be 0.\n", (long)value);
2750 set(wnd, MUIA_Window_Open, TRUE);
2751 set(wnd, MUIA_Window_ScreenTitle, "Zune Test Application");
2753 list.image = DoMethod(list.multi_lists[0], MUIM_List_CreateImage,
2754 list.colorfield, 0);
2756 /* Set pen fields */
2757 set(colorfield_pen, MUIA_String_Integer,
2758 XGET(colorfield, MUIA_Colorfield_Pen));
2760 char pen_str[10];
2761 nnset(pendisplay_pen, MUIA_String_Integer,
2762 XGET(pendisplay, MUIA_Pendisplay_Pen));
2764 struct MUI_PenSpec *pen_spec = NULL;
2765 GET(pendisplay, MUIA_Pendisplay_Spec, &pen_spec);
2766 strncpy(pen_str, pen_spec->buf, 10);
2767 set(pendisplay_spec, MUIA_String_Contents, pen_str);
2769 while ((LONG) DoMethod(app, MUIM_Application_NewInput,
2770 &sigs) != MUIV_Application_ReturnID_Quit)
2772 if (sigs)
2774 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
2775 if (sigs & SIGBREAKF_CTRL_C)
2776 break;
2777 if (sigs & SIGBREAKF_CTRL_D)
2778 break;
2782 DoMethod(list.multi_lists[0], MUIM_List_DeleteImage, list.image);
2783 MUI_DisposeObject(app);
2785 if (context_menu)
2786 MUI_DisposeObject(context_menu);
2787 CloseLibrary(ColorWheelBase);
2788 MUI_DeleteCustomClass(CL_DropText);
2790 /* automatic tests */
2791 if (list.destruct_count != 18)
2792 printf("The hook installed through MUIA_List_DestructHook has been"
2793 " called %ld times, but should have been called 18 times.\n",
2794 (long)list.destruct_count);
2796 CloseLibrary(MUIMasterBase);
2798 DeletePool(pool);
2800 return 0;