2 Copyright © 2002-2016, The AROS Development Team.
8 #define INTUITION_NO_INLINE_STDARG
10 #include <exec/types.h>
15 #include <clib/alib_protos.h>
16 #include <intuition/gadgetclass.h>
17 #include <intuition/icclass.h>
18 #include <libraries/asl.h>
19 #include <gadgets/colorwheel.h>
20 #include <proto/exec.h>
21 #include <proto/intuition.h>
22 #include <proto/dos.h>
23 #include <proto/muimaster.h>
24 #include <proto/graphics.h>
25 #include <aros/debug.h>
27 /* the following should go in a single include file which then only
28 ** consists of the public constants and members. Actually this is easy
35 #include <libraries/mui.h>
36 #if defined(TEST_ICONLIST)
37 #include "../../workbench/system/Wanderer/Classes/iconlist_attributes.h"
38 #include "../../workbench/system/Wanderer/Classes/iconlist.h"
41 #define STRING_COUNT 6
43 #define MULTI_LIST_COUNT 2
46 #define NUMERIC_MAX 100
48 static const TEXT digits
[] = "-0123456789";
49 static const TEXT 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",
59 static const char *empty
[] = {"", "", "", "", "", NULL
};
60 static const LONG list_active_positions
[] =
63 MUIV_List_Active_Bottom
,
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",
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,";
100 struct Library
*MUIMasterBase
;
101 struct Library
*ColorWheelBase
;
113 Object
*strings
[STRING_COUNT
],
123 *standard_hook_check
,
131 Object
*lists
[LIST_COUNT
],
154 *insert_single_button
,
155 *insert_multiple_button
,
160 *showdropmarks_check
,
171 *multi_lists
[MULTI_LIST_COUNT
],
179 LONG quiet
[LIST_COUNT
],
181 has_multitest
[LIST_COUNT
];
186 static Object
*wheel
;
187 static Object
*r_slider
;
188 static Object
*g_slider
;
189 static Object
*b_slider
;
190 static Object
*hue_gauge
;
191 static Object
*colorfield
, *colorfield2
, *colorfield_reset_button
,
193 static Object
*coloradjust
;
194 static Object
*pendisplay
, *pendisplay2
, *pendisplay_pen
, *pendisplay_spec
,
195 *reference_check
, *shine_button
, *shadow_button
, *yellow_button
, *poppen
;
196 static Object
*group
;
197 static Object
*editor_text
;
198 static Object
*filename_string
;
199 static Object
*save_button
;
200 static struct Hook hook_standard
;
201 static struct Hook hook
;
202 static struct Hook hook_wheel
;
203 static struct Hook hook_slider
;
204 static struct Hook hook_objects
;
205 static struct Hook hook_compare
, hook_multitest
;
206 static struct Hook hook_construct
, hook_destruct
, hook_display
;
207 static struct Hook hook_objstr
;
209 #if defined(TEST_ICONLIST)
210 static Object
*drawer_iconlist
;
211 static Object
*volume_iconlist
;
214 AROS_UFH0(void, repeat_function
)
218 printf("MUI_Timer\n");
223 AROS_UFH0(void, wheel_function
)
227 nnset(r_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
228 WHEEL_Red
) >> 24) & 0xff);
229 nnset(g_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
230 WHEEL_Green
) >> 24) & 0xff);
231 nnset(b_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
232 WHEEL_Blue
) >> 24) & 0xff);
237 AROS_UFH0(void, slider_function
)
241 struct ColorWheelRGB cw
;
242 ULONG red
= XGET(r_slider
, MUIA_Numeric_Value
);
243 ULONG green
= XGET(g_slider
, MUIA_Numeric_Value
);
244 ULONG blue
= XGET(b_slider
, MUIA_Numeric_Value
);
246 cw
.cw_Red
= (red
<< 24) | (red
<< 16) | (red
<< 8) | red
;
247 cw
.cw_Green
= (green
<< 24) | (green
<< 16) | (green
<< 8) | green
;
248 cw
.cw_Blue
= (blue
<< 24) | (blue
<< 16) | (blue
<< 8) | blue
;
250 nnset(wheel
, WHEEL_RGB
, &cw
);
251 set(hue_gauge
, MUIA_Gauge_Current
, XGET(wheel
, WHEEL_Hue
));
256 AROS_UFH0(void, objects_function
)
260 Object
*new_obj
= MUI_MakeObject(MUIO_Button
, "Button");
263 DoMethod(group
, MUIM_Group_InitChange
);
264 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
265 DoMethod(group
, MUIM_Group_ExitChange
);
271 static void About(void)
273 static Object
*about_wnd
;
277 about_wnd
= AboutmuiObject
, MUIA_Aboutmui_Application
, app
, End
;
281 set(about_wnd
, MUIA_Window_Open
, TRUE
);
284 AROS_UFH3(static void, ObjStrHook
,
285 AROS_UFHA(struct Hook
*, h
, A0
),
286 AROS_UFHA(Object
*, group
, A2
),
287 AROS_UFHA(Object
*, str
, A1
))
291 struct List
*child_list
= NULL
;
292 Object
*child
, *list
;
293 struct list_entry
*entry
;
295 /* Find the listview object within its group */
296 GET(group
, MUIA_Group_ChildList
, &child_list
);
297 child
= (APTR
)child_list
->lh_Head
;
299 list
= NextObject(&child
);
301 /* Copy one of the selected entry's fields to the string gadget */
302 DoMethod(list
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &entry
);
303 SET(str
, MUIA_String_Contents
, entry
->column1
);
308 static void ChangeStringAccept(void)
310 STRPTR accept_chars
= NULL
, reject_chars
= NULL
;
314 accept_all
= XGET(string
.accept_all_check
, MUIA_Selected
);
315 SET(string
.accept_string
, MUIA_Disabled
, accept_all
);
316 SET(string
.reject_string
, MUIA_Disabled
, accept_all
);
320 GET(string
.accept_string
, MUIA_String_Contents
, &accept_chars
);
321 GET(string
.reject_string
, MUIA_String_Contents
, &reject_chars
);
324 for (i
= 0; i
< STRING_COUNT
; i
++)
326 SET(string
.strings
[i
], MUIA_String_Accept
, accept_chars
);
327 SET(string
.strings
[i
], MUIA_String_Reject
, reject_chars
);
331 static void ChangePen(void)
335 GET(colorfield_pen
, MUIA_String_Integer
, &pen
);
337 SET(colorfield
, MUIA_Colorfield_Pen
, pen
);
340 static void ChangePendisplayPen(void)
342 DoMethod(pendisplay
, MUIM_Pendisplay_SetColormap
,
343 XGET(pendisplay_pen
, MUIA_String_Integer
));
346 AROS_UFH3(static IPTR
, ListCompareHook
,
347 AROS_UFHA(struct Hook
*, h
, A0
),
348 AROS_UFHA(CONST_STRPTR
, str1
, A2
),
349 AROS_UFHA(CONST_STRPTR
, str2
, A1
))
358 /* Indicate which string is shorter */
364 AROS_UFH3(static IPTR
, ListMultiTestHook
,
365 AROS_UFHA(struct Hook
*, h
, A0
),
366 AROS_UFHA(APTR
, unused
, A2
),
367 AROS_UFHA(CONST_STRPTR
, str
, A1
))
371 /* Indicate whether the string doesn't begin with a vowel */
372 return strchr(vowels
, tolower(str
[0])) == NULL
;
377 static void ChangeListTitle(void)
382 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
384 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
387 GET(list
.title_string
, MUIA_String_Contents
, &title
);
388 if (title
[0] == '\0')
391 title
= StrDup(title
);
393 SET(list
.lists
[i
], MUIA_List_Title
, title
);
396 static void UpdateListInfo(void)
402 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
404 GET(list
.lists
[i
], MUIA_Listview_DragType
, &value
);
405 NNSET(list
.draggable_check
, MUIA_Selected
,
406 value
!= MUIV_Listview_DragType_None
);
407 NNSET(list
.dragsortable_check
, MUIA_Disabled
,
408 value
== MUIV_Listview_DragType_None
);
409 if (value
== MUIV_Listview_DragType_None
)
412 GET(list
.lists
[i
], MUIA_List_DragSortable
, &value
);
413 NNSET(list
.dragsortable_check
, MUIA_Selected
, value
);
414 GET(list
.lists
[i
], MUIA_List_ShowDropMarks
, &value
);
415 NNSET(list
.showdropmarks_check
, MUIA_Selected
, value
);
416 value
= list
.has_multitest
[i
]; // MUIA_List_MultiTestHook isn't gettable!
417 NNSET(list
.multitest_check
, MUIA_Selected
, value
);
418 value
= list
.quiet
[i
]; // MUIA_List_Quiet is not gettable!
419 NNSET(list
.quiet_check
, MUIA_Selected
, value
);
420 GET(list
.lists
[i
], MUIA_List_AutoVisible
, &value
);
421 NNSET(list
.autovisible_check
, MUIA_Selected
, value
);
423 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
424 NNSET(list
.title_string
, MUIA_String_Contents
, title
);
426 GET(list
.lists
[i
], MUIA_List_Entries
, &value
);
427 DoMethod(list
.entries_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
429 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
430 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
432 GET(list
.lists
[i
], MUIA_List_First
, &value
);
433 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
435 GET(list
.lists
[i
], MUIA_List_InsertPosition
, &value
);
436 DoMethod(list
.insert_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
438 GET(list
.lists
[i
], MUIA_List_Active
, &value
);
439 if (value
== MUIV_List_Active_Off
)
440 SET(list
.active_text
, MUIA_Text_Contents
, "N/A");
442 DoMethod(list
.active_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
444 GET(list
.lists
[i
], MUIA_List_DropMark
, &value
);
445 DoMethod(list
.drop_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
449 static void ListGetVisible(void)
454 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
456 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
457 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
461 static void ListGetFirst(void)
467 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
469 /* We fetch the Listview's list here to provide test coverage for that
470 attribute. Please don't optimise */
471 real_list
= (Object
*)XGET(list
.lists
[i
], MUIA_Listview_List
);
472 GET(real_list
, MUIA_List_First
, &value
);
473 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
477 static void ListSetDraggable(void)
482 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
484 GET(list
.draggable_check
, MUIA_Selected
, &value
);
485 SET(list
.lists
[i
], MUIA_Listview_DragType
, value
?
486 MUIV_Listview_DragType_Immediate
: MUIV_Listview_DragType_None
);
489 static void ListSetShowDropMarks(void)
494 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
496 GET(list
.showdropmarks_check
, MUIA_Selected
, &value
);
497 SET(list
.lists
[i
], MUIA_List_ShowDropMarks
, value
);
500 static void ListSetMultiTest(void)
505 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
507 GET(list
.multitest_check
, MUIA_Selected
, &value
);
508 SET(list
.lists
[i
], MUIA_List_MultiTestHook
, value
? &hook_multitest
: NULL
);
509 list
.has_multitest
[i
] = value
;
512 static void ListSetQuiet(void)
517 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
519 GET(list
.quiet_check
, MUIA_Selected
, &value
);
520 SET(list
.lists
[i
], MUIA_List_Quiet
, value
);
521 list
.quiet
[i
] = value
;
524 static void ListSetDragSortable(void)
529 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
531 GET(list
.dragsortable_check
, MUIA_Selected
, &value
);
532 SET(list
.lists
[i
], MUIA_List_DragSortable
, value
);
535 static void ListSetAutoVisible(void)
540 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
542 GET(list
.autovisible_check
, MUIA_Selected
, &value
);
543 SET(list
.lists
[i
], MUIA_List_AutoVisible
, value
);
546 static void ListReset(void)
550 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
552 SET(list
.lists
[i
], MUIA_List_Active
, list_active_positions
[i
]);
555 static void ListMove(void)
557 LONG mode
, pos1
, pos2
;
560 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
562 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
565 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
569 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
572 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
576 DoMethod(list
.lists
[i
], MUIM_List_Move
, pos1
, pos2
);
579 static void ListSort(void)
583 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
585 DoMethod(list
.lists
[i
], MUIM_List_Sort
);
588 static void ListEnable(void)
592 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
594 SET(list
.lists
[i
], MUIA_Disabled
, FALSE
);
597 static void ListExchange(void)
599 LONG mode
, pos1
, pos2
;
602 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
604 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
607 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
611 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
614 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
618 DoMethod(list
.lists
[i
], MUIM_List_Exchange
, pos1
, pos2
);
621 static void ListJump(void)
626 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
628 mode
= XGET(list
.jump_cycle
, MUIA_Cycle_Active
);
631 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
635 DoMethod(list
.lists
[i
], MUIM_List_Jump
, pos
);
638 static void ListSelect(void)
643 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
645 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
648 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
652 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_On
,
656 static void ListDeselect(void)
661 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
663 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
666 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
670 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_Off
,
674 static void ListToggle(void)
679 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
681 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
684 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
688 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
,
689 MUIV_List_Select_Toggle
, NULL
);
692 static void ListRedraw(void)
697 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
699 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
702 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
706 DoMethod(list
.lists
[i
], MUIM_List_Redraw
, pos
);
709 static void ListInsertSingle(void)
714 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
716 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
719 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
723 DoMethod(list
.lists
[i
], MUIM_List_InsertSingle
, "Tomato", pos
);
726 static void ListInsert(void)
731 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
733 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
736 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
740 DoMethod(list
.lists
[i
], MUIM_List_Insert
, fruits
, -1, pos
);
743 static void ListRemove(void)
745 LONG mode
, pos
, count
, j
, *selections
;
748 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
750 mode
= XGET(list
.remove_cycle
, MUIA_Cycle_Active
);
754 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
755 This doesn't work as expected in MUI or Zune */
756 pos
= MUIV_List_NextSelected_Start
- 1;
757 while (pos
!= MUIV_List_NextSelected_End
)
759 if (pos
== MUIV_List_NextSelected_Start
- 1)
761 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
762 if (pos
!= MUIV_List_NextSelected_End
)
763 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
768 /* Remove selected entries safely by first retrieving them with
769 MUIM_List_NextSelected and then removing them one by one */
770 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
771 MUIV_List_Select_Ask
, &count
);
773 count
= 1; /* There may still be an active entry */
774 selections
= AllocVec(sizeof(LONG
) * count
, MEMF_ANY
);
775 if (selections
!= NULL
)
777 pos
= MUIV_List_NextSelected_Start
;
778 for (j
= 0; j
< count
; j
++)
780 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
784 /* We must remove the entries in reverse order; otherwise the
785 later indices will become invalid */
787 DoMethod(list
.lists
[i
], MUIM_List_Remove
, selections
[--count
]);
794 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
797 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
801 static void ListClear(void)
805 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
807 DoMethod(list
.lists
[i
], MUIM_List_Clear
);
810 static void ListActivate(void)
815 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
817 mode
= XGET(list
.activate_cycle
, MUIA_Cycle_Active
);
820 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
824 SET(list
.lists
[i
], MUIA_List_Active
, pos
);
827 static void ListDeactivate(void)
831 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
833 SET(list
.lists
[i
], MUIA_List_Active
, MUIV_List_Active_Off
);
836 static void CheckListDoubleClick(void)
840 GET(list
.multi_lists
[1], MUIA_Listview_DoubleClick
, &value
);
841 MUI_Request(app
, wnd
, 0, "Test", "OK",
842 "MUIA_Listview_Doubleclick = %ld", value
);
845 AROS_UFH3(static APTR
, ListConstructHook
,
846 AROS_UFHA(struct Hook
*, h
, A0
),
847 AROS_UFHA(APTR
, pool
, A2
),
848 AROS_UFHA(IPTR
, n
, A1
))
852 struct list_entry
*entry
;
854 entry
= AllocPooled(pool
, sizeof(struct list_entry
) + 40);
858 entry
->column1
= (char *)(entry
+ 1);
859 entry
->column2
= entry
->column1
+ 20;
860 sprintf(entry
->column1
, "Entry%ld", (long)n
);
861 sprintf(entry
->column2
, "Col2: Entry%ld", (long)n
);
869 AROS_UFH3(static void, ListDestructHook
,
870 AROS_UFHA(struct Hook
*, h
, A0
),
871 AROS_UFHA(APTR
, pool
, A2
),
872 AROS_UFHA(struct list_entry
*, entry
, A1
))
876 FreePooled(pool
, entry
, sizeof(struct list_entry
) + 40);
877 list
.destruct_count
++;
882 AROS_UFH3(static void, display_function
,
883 AROS_UFHA(struct Hook
*, h
, A0
),
884 AROS_UFHA(char **, strings
, A2
),
885 AROS_UFHA(struct list_entry
*, entry
, A1
))
889 static char buf
[100];
893 if (XGET(list
.showimage_check
, MUIA_Selected
))
894 sprintf(buf
, "%ld \33O[%08lx]", (long)*(strings
- 1),
897 sprintf(buf
, "%ld", (long)*(strings
- 1));
899 strings
[1] = entry
->column1
;
900 strings
[2] = entry
->column2
;
904 strings
[0] = "Number";
905 strings
[1] = "Column 1";
906 strings
[2] = "Column 2";
912 static void Save(void)
914 char *text
= (char *)XGET(editor_text
, MUIA_String_Contents
);
915 char *filename
= (char *)XGET(filename_string
, MUIA_String_Contents
);
918 if (!strlen(filename
))
921 if ((fh
= Open(filename
, MODE_NEWFILE
)))
923 Write(fh
, text
, strlen(text
));
928 #if defined(TEST_ICONLIST)
929 /* IconList callbacks */
930 static void volume_doubleclicked(void)
933 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
935 DoMethod(volume_iconlist
, MUIM_IconList_NextIcon
,
936 MUIV_IconList_NextIcon_Selected
, &ent
);
937 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
940 strcpy(buf
, ent
->label
);
944 static void drawer_doubleclicked(void)
946 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
948 DoMethod(drawer_iconlist
, MUIM_IconList_NextIcon
,
949 MUIV_IconList_NextIcon_Selected
, &ent
);
950 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
952 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
,
953 ent
->ile_IconEntry
->ie_IconNode
.ln_Name
);
957 static IPTR
create_balance_column(void)
959 return (IPTR
) VGroup
,
960 Child
, RectangleObject
,
963 Child
, BalanceObject
,
965 Child
, RectangleObject
,
968 Child
, BalanceObject
,
970 Child
, RectangleObject
,
973 Child
, BalanceObject
,
975 Child
, RectangleObject
,
978 Child
, BalanceObject
,
980 Child
, RectangleObject
,
986 /* The custom class */
995 struct Library
*KeymapBase
;
999 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
,
1000 register __a2 Object
*obj
, register __a1 Msg msg
)
1002 AROS_UFH3S(IPTR
, dispatcher
,
1003 AROS_UFHA(Class
*, cl
, A0
),
1004 AROS_UFHA(Object
*, obj
, A2
), AROS_UFHA(Msg
, msg
, A1
))
1009 switch (msg
->MethodID
)
1011 case MUIM_DragQuery
:
1012 return MUIV_DragQuery_Accept
;
1015 struct DropText_Data
*data
=
1016 (struct DropText_Data
*)INST_DATA(cl
, obj
);
1019 sprintf(buf
, "%ld times", (long)data
->times
);
1020 set(obj
, MUIA_Text_Contents
, buf
);
1024 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
1029 static struct MUI_CustomClass
*CL_DropText
;
1031 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
1035 AROS_UFH3S(void, hook_func_standard
,
1036 AROS_UFHA(struct Hook
*, h
, A0
),
1037 AROS_UFHA(void *, dummy
, A2
), AROS_UFHA(void **, funcptr
, A1
))
1041 void (*func
) (ULONG
*) = (void (*)(ULONG
*))(*funcptr
);
1044 func((ULONG
*) funcptr
+ 1);
1053 Object
*open_button
;
1054 Object
*about_button
;
1055 Object
*quit_button
;
1056 Object
*repeat_button
;
1057 Object
*objects_button
;
1058 Object
*about_item
, *quit_item
;
1059 Object
*context_menu
;
1060 Object
*popobject
, *listview
;
1061 Object
*numerics
[NUMERIC_COUNT
];
1062 Object
*min_string
, *max_string
;
1063 Object
*slider_button
;
1064 Object
*country_radio
[2];
1069 static char *pages
[] =
1070 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
1072 #if defined(TEST_ICONLIST)
1076 static char *text_pages
[] =
1077 {"Text", "String", NULL
};
1078 static char *color_pages
[] =
1079 {"Palette", "Colors", "Pens", NULL
};
1080 static char *list_pages
[] =
1081 {"Single Column", "Multicolumn", NULL
};
1082 static char **radio_entries1
= pages
;
1083 static char *radio_entries2
[] =
1084 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL
};
1086 static IPTR entries
[] = {1, 2, 3, 4, 5, 6, (IPTR
)NULL
};
1088 hook_standard
.h_Entry
= (HOOKFUNC
) hook_func_standard
;
1089 hook_objstr
.h_Entry
= (HOOKFUNC
) ObjStrHook
;
1091 pool
= CreatePool(MEMF_ANY
, 4096, 4096);
1093 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library", 0);
1095 hook
.h_Entry
= (HOOKFUNC
) repeat_function
;
1096 hook_wheel
.h_Entry
= (HOOKFUNC
) wheel_function
;
1097 hook_slider
.h_Entry
= (HOOKFUNC
) slider_function
;
1098 hook_objects
.h_Entry
= (HOOKFUNC
) objects_function
;
1099 hook_compare
.h_Entry
= (HOOKFUNC
) ListCompareHook
;
1100 hook_multitest
.h_Entry
= (HOOKFUNC
) ListMultiTestHook
;
1101 hook_construct
.h_Entry
= (HOOKFUNC
) ListConstructHook
;
1102 hook_destruct
.h_Entry
= (HOOKFUNC
) ListDestructHook
;
1103 hook_display
.h_Entry
= (HOOKFUNC
) display_function
;
1104 list
.destruct_count
= 0;
1105 list
.has_multitest
[3] = TRUE
;
1107 context_menu
= MenustripObject
,
1108 MUIA_Family_Child
, MenuObject
,
1109 MUIA_Menu_Title
, "Menutest",
1110 MUIA_Family_Child
, about_item
= MenuitemObject
,
1111 MUIA_Menuitem_Title
, "First Test Entry", End
,
1112 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1113 MUIA_Menuitem_Title
, "Second Test Entry", End
,
1117 /* should check the result in a real program! */
1118 CL_DropText
= MUI_CreateCustomClass(NULL
, MUIC_Text
, NULL
,
1119 sizeof(struct DropText_Data
), dispatcher
);
1120 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget", 0);
1122 pendisplay
= PendisplayObject
, MUIA_Pendisplay_Spec
, &default_penspec
, End
;
1124 title
= StrDup("Fruits");
1125 list
.lists
[0] = ListviewObject
,
1129 MUIA_List_Title
, title
,
1130 MUIA_List_SourceArray
, fruits
,
1131 MUIA_List_Active
, MUIV_List_Active_Top
,
1132 MUIA_List_PoolThreshSize
, 256,
1133 MUIA_List_DragSortable
, TRUE
,
1134 MUIA_List_CompareHook
, &hook_compare
,
1136 "Default scroller\nTop entry active\nSorted by length",
1138 MUIA_Listview_MultiSelect
,
1139 MUIV_Listview_MultiSelect_None
,
1140 MUIA_Listview_DragType
, MUIV_Listview_DragType_Immediate
,
1141 MUIA_Listview_DoubleClick
, TRUE
,
1144 list
.lists
[1] = ListviewObject
,
1148 MUIA_List_SourceArray
, fruits
,
1149 MUIA_List_Active
, MUIV_List_Active_Bottom
,
1150 MUIA_List_PoolPuddleSize
, 512,
1151 MUIA_List_AutoVisible
, TRUE
,
1153 "Left scroller\nBottom entry active\nSorted alphabetically",
1155 MUIA_Listview_ScrollerPos
,
1156 MUIV_Listview_ScrollerPos_Left
,
1157 MUIA_Listview_DragType
, MUIV_Listview_DragType_None
,
1160 list
.lists
[2] = ListviewObject
,
1164 MUIA_List_SourceArray
, fruits
,
1165 MUIA_List_Active
, MUIV_List_Active_Off
,
1166 MUIA_List_Pool
, pool
,
1168 "Right scroller\nNo active entry\nSorted alphabetically",
1170 MUIA_Listview_MultiSelect
,
1171 MUIV_Listview_MultiSelect_Shifted
,
1172 MUIA_Listview_ScrollerPos
,
1173 MUIV_Listview_ScrollerPos_Right
,
1176 list
.lists
[3] = ListviewObject
,
1180 MUIA_List_SourceArray
, fruits
,
1181 MUIA_List_Pool
, NULL
,
1182 MUIA_List_MultiTestHook
, &hook_multitest
,
1184 "No scroller\nDefault active entry\nSorted alphabetically",
1186 MUIA_Listview_MultiSelect
,
1187 MUIV_Listview_MultiSelect_Always
,
1188 MUIA_Listview_ScrollerPos
,
1189 MUIV_Listview_ScrollerPos_None
,
1192 list
.lists
[4] = ListviewObject
,
1196 MUIA_List_SourceArray
, fruits
,
1197 MUIA_List_Active
, MUIV_List_Active_Bottom
,
1198 MUIA_List_MinLineHeight
, 20,
1200 "Default scroller\nBottom entry active\nSorted by length",
1202 MUIA_Listview_Input
, FALSE
,
1206 list
.colorfield
= ColorfieldObject
,
1207 MUIA_Colorfield_RGB
, default_color
,
1210 app
= ApplicationObject
,
1211 MUIA_Application_Menustrip
, MenustripObject
,
1212 MUIA_Family_Child
, MenuObject
,
1213 MUIA_Menu_Title
, "Project",
1214 MUIA_Family_Child
, about_item
= MenuitemObject
,
1215 MUIA_Menuitem_Title
, "About...",
1216 MUIA_Menuitem_Shortcut
, "?",
1218 MUIA_Family_Child
, MenuitemObject
,
1219 MUIA_Menuitem_Title
, (SIPTR
)-1,
1221 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1222 MUIA_Menuitem_Title
, "Quit",
1223 MUIA_Menuitem_Shortcut
, "Q",
1228 SubWindow
, wnd
= WindowObject
,
1229 MUIA_Window_Title
, "test",
1230 MUIA_Window_Activate
, TRUE
,
1232 WindowContents
, VGroup
,
1233 Child
, RegisterGroup(pages
),
1234 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1239 GroupFrameT("A horizontal group"),
1241 GroupFrameT("A column group"),
1242 Child
, repeat_button
= TextObject
,
1245 MUIA_Background
, MUII_ButtonBack
,
1246 MUIA_Text_PreParse
, "\33c",
1247 MUIA_Text_Contents
, "Repeat",
1248 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1253 MUIA_Background
, MUII_ButtonBack
,
1254 MUIA_Text_PreParse
, "\33c",
1255 MUIA_Text_Contents
, "Drag Me",
1256 MUIA_Draggable
, TRUE
,
1257 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1259 Child
, open_button
= TextObject
,
1262 MUIA_Background
, MUII_ButtonBack
,
1263 MUIA_Text_PreParse
, "\33c",
1264 MUIA_Text_Contents
, "Open Window",
1265 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1268 MUIA_ContextMenu
, context_menu
,
1271 MUIA_Background
, MUII_ButtonBack
,
1272 MUIA_Text_PreParse
, "\33c",
1273 MUIA_Text_Contents
, "Press Right",
1274 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1276 Child
, objects_button
= TextObject
,
1279 MUIA_Background
, MUII_ButtonBack
,
1280 MUIA_Text_PreParse
, "\33c",
1281 MUIA_Text_Contents
, "Add Objects",
1282 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1287 Child
, MUI_MakeObject(MUIO_Checkmark
,
1291 Child
, MUI_MakeObject(MUIO_Label
,
1298 Child
, group
= VGroup
,
1299 GroupFrameT("A vertical group"),
1300 Child
, DropTextObject
,
1301 MUIA_Dropable
, TRUE
,
1304 MUIA_Background
, MUII_ButtonBack
,
1305 MUIA_Text_PreParse
, "\33c",
1306 MUIA_Text_Contents
, "Drop Here",
1307 MUIA_Dropable
, TRUE
,
1308 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1312 MUIA_Background
, MUII_MARKHALFSHINE
,
1314 MUIA_Text_PreParse
, "\33c",
1315 MUIA_Text_Contents
, "Pattern",
1317 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
1319 Child
, ScrollgroupObject
,
1320 GroupFrameT("A scroll group"),
1321 MUIA_Scrollgroup_Contents
, VGroupV
,
1326 "Line1\nLine2\nLine3\nLine4\n"
1327 "Line5\nLine6\nLine7\nLine8\n"
1329 "Line9\nLine10\nLine11\n",
1332 Child
, MUI_MakeObject(MUIO_Button
,
1334 Child
, MUI_MakeObject(MUIO_Button
,
1340 Child
, popobject
= PopobjectObject
,
1341 MUIA_Popstring_String
,
1342 MUI_MakeObject(MUIO_String
, NULL
, 200),
1343 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
1344 MUIA_Popobject_Object
, VGroup
,
1346 MUIA_Text_Contents
, "test",
1348 Child
, listview
= ListviewObject
,
1349 MUIA_Listview_List
, ListObject
,
1351 MUIA_List_ConstructHook
,
1353 MUIA_List_DestructHook
,
1355 MUIA_List_DisplayHook
, &hook_display
,
1356 MUIA_List_Format
, ",,",
1357 MUIA_List_SourceArray
, entries
,
1358 MUIA_List_Title
, TRUE
,
1362 MUIA_Popobject_ObjStrHook
, &hook_objstr
,
1366 MUIA_Cycle_Entries
, pages
,
1368 Child
, ScrollbarObject
,
1369 MUIA_Group_Horiz
, TRUE
,
1370 MUIA_Prop_Visible
, 100,
1371 MUIA_Prop_Entries
, 300,
1372 MUIA_Prop_First
, 50,
1377 Child
, RegisterGroup(text_pages
),
1381 MUIA_Background
, "2:cfffffff,cfffffff,10000000",
1383 MUIA_Text_Contents
, "\33cHello World!\n"
1384 "This is a text object\n\33lLeft \33bbold\33n\n"
1389 /* Test for a bug with pen specifications as reported here:
1390 https://sourceforge.net/p/aros/bugs/487/
1392 MUIA_Text_Contents
, "This is a \33P[3]text \33P[]object \33P[1]with pen specifications",
1394 Child
, RectangleObject
,
1396 /* Seems to be not supported properly as orginal MUI
1397 doesn't allow to alter the height of the window */
1398 MUIA_Rectangle_HBar
, TRUE
,
1399 MUIA_Rectangle_BarTitle
,"Enter a string",
1401 Child
, StringObject
,
1404 MUIA_String_AdvanceOnCR
, TRUE
,
1412 Child
, VGroup
, GroupFrameT("Default Alignment"),
1413 Child
, string
.strings
[0] = StringObject
,
1416 (IPTR
)default_accept_chars
,
1418 (IPTR
)default_reject_chars
,
1419 MUIA_String_AdvanceOnCR
, TRUE
,
1420 MUIA_String_MaxLen
, 9,
1422 MUIA_String_AttachedList
, list
.lists
[0],
1425 Child
, VGroup
, GroupFrameT("Left Aligned"),
1426 Child
, string
.strings
[1] = StringObject
,
1429 (IPTR
)default_accept_chars
,
1431 (IPTR
)default_reject_chars
,
1433 MUIV_String_Format_Left
,
1434 MUIA_String_AdvanceOnCR
, TRUE
,
1435 MUIA_String_MaxLen
, 9,
1437 MUIA_String_Contents
,
1438 (IPTR
)default_accept_chars
,
1439 MUIA_String_BufferPos
, 3,
1440 MUIA_String_AttachedList
, list
.lists
[0],
1443 Child
, VGroup
, GroupFrameT("Right Aligned"),
1444 Child
, string
.strings
[2] = StringObject
,
1447 (IPTR
)default_accept_chars
,
1449 (IPTR
)default_reject_chars
,
1451 MUIV_String_Format_Right
,
1452 MUIA_String_AdvanceOnCR
, TRUE
,
1453 MUIA_String_MaxLen
, 9,
1455 MUIA_String_AttachedList
, list
.lists
[0],
1458 Child
, VGroup
, GroupFrameT("Centered"),
1459 Child
, string
.strings
[3] = StringObject
,
1462 (IPTR
)default_accept_chars
,
1464 (IPTR
)default_reject_chars
,
1466 MUIV_String_Format_Center
,
1467 MUIA_String_AdvanceOnCR
, TRUE
,
1468 MUIA_String_MaxLen
, 9,
1470 MUIA_String_Integer
, 123,
1471 MUIA_String_AttachedList
, list
.lists
[0],
1474 Child
, VGroup
, GroupFrameT("Secret"),
1475 Child
, string
.strings
[4] = StringObject
,
1478 (IPTR
)default_accept_chars
,
1480 (IPTR
)default_reject_chars
,
1482 MUIV_String_Format_Center
,
1483 MUIA_String_Secret
, TRUE
,
1484 MUIA_String_AdvanceOnCR
, TRUE
,
1485 MUIA_String_MaxLen
, 9,
1487 MUIA_String_AttachedList
, list
.lists
[0],
1490 Child
, HGroup
, GroupFrameT("Narrow"),
1492 Child
, string
.strings
[5] = StringObject
,
1495 (IPTR
)default_accept_chars
,
1497 (IPTR
)default_reject_chars
,
1499 MUIV_String_Format_Center
,
1500 MUIA_String_AdvanceOnCR
, TRUE
,
1502 MUIA_String_MaxLen
, 9,
1504 MUIA_String_AttachedList
, list
.lists
[0],
1510 Child
, VGroup
, GroupFrameT("Controls"),
1512 Child
, string
.accept_all_check
=
1513 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1514 Child
, MUI_MakeObject(MUIO_Label
,
1515 "Accept all characters", 0),
1519 Child
, MUI_MakeObject(MUIO_Label
,
1520 "Acceptable characters:", 0),
1521 Child
, string
.accept_string
= StringObject
,
1523 MUIA_String_Contents
,
1524 (IPTR
)default_accept_chars
,
1526 Child
, MUI_MakeObject(MUIO_Label
,
1527 "Unacceptable characters:", 0),
1528 Child
, string
.reject_string
= StringObject
,
1531 Child
, MUI_MakeObject(MUIO_Label
,
1532 "Cursor position:", 0),
1533 Child
, string
.cursor_pos_slider
=
1535 MUIA_Group_Horiz
, TRUE
,
1536 MUIA_Numeric_Min
, 0,
1538 Child
, MUI_MakeObject(MUIO_Label
,
1539 "Display position:", 0),
1540 Child
, string
.display_pos_slider
=
1542 MUIA_Group_Horiz
, TRUE
,
1543 MUIA_Numeric_Min
, 0,
1545 Child
, MUI_MakeObject(MUIO_Label
,
1546 "Integer value:", 0),
1547 Child
, string
.integer_string
=
1550 MUIA_String_Accept
, (IPTR
)digits
,
1552 Child
, MUI_MakeObject(MUIO_Label
,
1554 Child
, string
.plaintext_string
=
1558 Child
, MUI_MakeObject(MUIO_Label
,
1559 "Maximum string length:", 0),
1560 Child
, string
.max_len_text
= TextObject
,
1562 MUIA_Text_Contents
, "Unknown",
1567 Child
, string
.cr_advance_check
=
1568 MUI_MakeObject(MUIO_Checkmark
,
1570 Child
, MUI_MakeObject(MUIO_Label
,
1571 "Advance on CR", 0),
1575 Child
, string
.attach_list_check
=
1576 MUI_MakeObject(MUIO_Checkmark
,
1578 Child
, MUI_MakeObject(MUIO_Label
,
1584 Child
, string
.standard_hook_check
=
1585 MUI_MakeObject(MUIO_Checkmark
,
1587 Child
, MUI_MakeObject(MUIO_Label
,
1588 "Use standard edit hook", 0),
1592 Child
, string
.custom_hook_check
=
1593 MUI_MakeObject(MUIO_Checkmark
,
1595 Child
, MUI_MakeObject(MUIO_Label
,
1596 "Use custom edit hook", 0),
1609 Child
, wheel
= BoopsiObject
, /* MUI/Boopsi tags mixed */
1611 /* boopsi objects don't know */
1612 /* their sizes, so we help */
1613 /* keep important values */
1614 /* during window resize */
1615 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
1616 MUIA_Boopsi_MinWidth
, 30,
1617 MUIA_Boopsi_MinHeight
, 30,
1618 MUIA_Boopsi_Remember
, WHEEL_Saturation
,
1619 MUIA_Boopsi_Remember
, WHEEL_Hue
,
1620 /* this magic fills in the screen pointer */
1621 MUIA_Boopsi_TagScreen
, WHEEL_Screen
,
1624 GA_Top
, 0, /* MUI will automatically */
1625 GA_Width
, 0, /* fill in the correct values */
1627 ICA_TARGET
, ICTARGET_IDCMP
,
1628 /* needed for notification */
1629 WHEEL_Saturation
, 0, /* start in the center */
1630 MUIA_FillArea
, TRUE
,
1631 /* use this because it defaults to FALSE
1632 for boopsi gadgets but the colorwheel
1633 doesn't bother about redrawing its
1637 Child
, r_slider
= SliderObject
,
1638 MUIA_Group_Horiz
, TRUE
,
1639 MUIA_Numeric_Min
, 0,
1640 MUIA_Numeric_Max
, 255,
1642 Child
, g_slider
= SliderObject
,
1643 MUIA_Group_Horiz
, TRUE
,
1644 MUIA_Numeric_Min
, 0,
1645 MUIA_Numeric_Max
, 255,
1647 Child
, b_slider
= SliderObject
,
1648 MUIA_Group_Horiz
, TRUE
,
1649 MUIA_Numeric_Min
, 0,
1650 MUIA_Numeric_Max
, 255,
1652 Child
, hue_gauge
= GaugeObject
,
1654 MUIA_Gauge_Horiz
, TRUE
,
1655 MUIA_Gauge_Max
, 255,
1656 MUIA_Gauge_Divide
, 1<<24,
1657 MUIA_Gauge_InfoText
, "Hue: %ld",
1662 Child
, RegisterGroup(color_pages
),
1663 Child
, VGroup
, GroupFrameT("Palette"),
1664 Child
, PaletteObject
,
1668 Child
, VGroup
, GroupFrameT("Colorfield"),
1671 Child
, colorfield
= ColorfieldObject
,
1672 MUIA_Colorfield_RGB
, default_color
,
1673 MUIA_Colorfield_Pen
, 253,
1675 Child
, colorfield2
= ColorfieldObject
,
1676 MUIA_Colorfield_Red
, default_color
[0],
1677 MUIA_Colorfield_Green
, default_color
[1],
1678 MUIA_Colorfield_Blue
, default_color
[2],
1681 Child
, colorfield_reset_button
=
1682 MUI_MakeObject(MUIO_Button
,
1686 MUI_MakeObject(MUIO_Label
, "Pen:", 0),
1687 Child
, colorfield_pen
= StringObject
,
1692 Child
, VGroup
, GroupFrameT("Coloradjust"),
1693 Child
, coloradjust
= ColoradjustObject
,
1694 MUIA_Coloradjust_RGB
, default_color
,
1700 Child
, VGroup
, GroupFrameT("Pendisplay"),
1703 Child
, pendisplay2
= PendisplayObject
,
1704 MUIA_Pendisplay_RGBcolor
,
1711 MUIO_Label
, "Pen:", 0),
1713 Child
, pendisplay_pen
=
1714 StringObject
, StringFrame
,
1717 Child
, reference_check
=
1718 MUI_MakeObject(MUIO_Checkmark
,
1720 Child
, MUI_MakeObject(MUIO_Label
,
1725 MUIO_Label
, "Penspec:", 0),
1726 Child
, pendisplay_spec
= StringObject
,
1731 Child
, shine_button
=
1732 MUI_MakeObject(MUIO_Button
,
1734 Child
, shadow_button
=
1735 MUI_MakeObject(MUIO_Button
,
1737 Child
, yellow_button
=
1738 MUI_MakeObject(MUIO_Button
,
1742 Child
, VGroup
, GroupFrameT("Poppen"),
1743 Child
, poppen
= PoppenObject
,
1747 Child
, VGroup
, GroupFrameT("Penadjust"),
1748 Child
, PenadjustObject
,
1756 Child
, editor_text
= StringObject
,
1759 Child
, PopaslObject
,
1760 ASLFR_DoSaveMode
, TRUE
,
1761 MUIA_Popstring_String
, filename_string
=
1762 MUI_MakeObject(MUIO_String
, NULL
, 200),
1763 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
1765 Child
, save_button
=
1766 MUI_MakeObject(MUIO_Button
, "Save"),
1770 Child
, RegisterGroup(list_pages
),
1772 Child
, ColGroup(LIST_COUNT
),
1773 Child
, VGroup
, GroupFrameT("No Multiselect"),
1774 Child
, list
.lists
[0],
1777 GroupFrameT("Default Multiselect"),
1778 Child
, list
.lists
[1],
1781 GroupFrameT("Shifted Multiselect"),
1782 Child
, list
.lists
[2],
1785 GroupFrameT("Unconditional Multiselect"),
1786 Child
, list
.lists
[3],
1789 GroupFrameT("Read Only"),
1790 Child
, list
.lists
[4],
1794 MUIA_Group_HorizSpacing
, 0,
1795 Child
, RectangleObject
,
1796 MUIA_HorizWeight
, 1,
1798 Child
, list
.list_radios
= RadioObject
,
1799 MUIA_Radio_Entries
, empty
,
1800 MUIA_Group_Horiz
, TRUE
,
1801 MUIA_HorizWeight
, 1000,
1803 Child
, RectangleObject
,
1804 MUIA_HorizWeight
, 1,
1807 Child
, RectangleObject
,
1809 MUIA_Rectangle_HBar
, TRUE
,
1810 MUIA_Rectangle_BarTitle
, "List Controls",
1813 Child
, MUI_MakeObject(MUIO_Label
,
1814 "Affected index 1:", 0),
1815 Child
, list
.index1_string
=
1818 MUIA_String_Accept
, (IPTR
)digits
,
1819 MUIA_String_Integer
, 0,
1822 Child
, list
.draggable_check
=
1823 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1824 Child
, MUI_MakeObject(MUIO_Label
,
1829 Child
, list
.showdropmarks_check
=
1830 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1831 Child
, MUI_MakeObject(MUIO_Label
,
1832 "Show drop marks", 0),
1836 Child
, list
.autovisible_check
=
1837 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1838 Child
, MUI_MakeObject(MUIO_Label
,
1842 Child
, list
.reset_button
=
1843 MUI_MakeObject(MUIO_Button
, "Reset"),
1845 Child
, MUI_MakeObject(MUIO_Label
,
1846 "Affected index 2:", 0),
1847 Child
, list
.index2_string
=
1850 MUIA_String_Accept
, (IPTR
)digits
,
1851 MUIA_String_Integer
, 0,
1854 Child
, list
.dragsortable_check
=
1855 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1856 Child
, MUI_MakeObject(MUIO_Label
,
1857 "Drag sortable", 0),
1861 Child
, list
.multitest_check
=
1862 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1863 Child
, MUI_MakeObject(MUIO_Label
,
1864 "Filter multiselect", 0),
1868 Child
, list
.quiet_check
=
1869 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1870 Child
, MUI_MakeObject(MUIO_Label
,
1874 Child
, list
.enable_button
=
1875 MUI_MakeObject(MUIO_Button
, "Enable"),
1877 Child
, MUI_MakeObject(MUIO_Label
,
1878 "Move/exchange mode 1:", 0),
1879 Child
, list
.move1_cycle
= CycleObject
,
1881 MUIA_Cycle_Entries
, list_move1_modes
,
1883 Child
, list
.move_button
=
1884 MUI_MakeObject(MUIO_Button
, "Move"),
1885 Child
, list
.sort_button
=
1886 MUI_MakeObject(MUIO_Button
, "Sort"),
1887 Child
, MUI_MakeObject(MUIO_Label
,
1889 Child
, list
.title_string
=
1894 Child
, MUI_MakeObject(MUIO_Label
,
1895 "Move/exchange mode 2:", 0),
1896 Child
, list
.move2_cycle
= CycleObject
,
1898 MUIA_Cycle_Entries
, list_move2_modes
,
1900 Child
, list
.exchange_button
=
1901 MUI_MakeObject(MUIO_Button
, "Exchange"),
1902 Child
, list
.redraw_button
=
1903 MUI_MakeObject(MUIO_Button
, "Redraw"),
1904 Child
, MUI_MakeObject(MUIO_Label
,
1906 Child
, list
.entries_text
= TextObject
,
1908 MUIA_Text_Contents
, "N/A",
1911 Child
, MUI_MakeObject(MUIO_Label
,
1913 Child
, list
.jump_cycle
= CycleObject
,
1915 MUIA_Cycle_Entries
, list_jump_modes
,
1917 Child
, list
.jump_button
=
1918 MUI_MakeObject(MUIO_Button
, "Jump"),
1919 Child
, list
.toggle_button
=
1920 MUI_MakeObject(MUIO_Button
, "Toggle"),
1921 Child
, MUI_MakeObject(MUIO_Label
,
1922 "Visible entries:", 0),
1923 Child
, list
.visible_text
= TextObject
,
1925 MUIA_Text_Contents
, "N/A",
1928 Child
, MUI_MakeObject(MUIO_Label
,
1929 "Select/redraw mode:", 0),
1930 Child
, list
.select_cycle
= CycleObject
,
1932 MUIA_Cycle_Entries
, list_select_modes
,
1934 Child
, list
.select_button
=
1935 MUI_MakeObject(MUIO_Button
, "Select"),
1936 Child
, list
.deselect_button
=
1937 MUI_MakeObject(MUIO_Button
, "Deselect"),
1938 Child
, MUI_MakeObject(MUIO_Label
,
1939 "First visible index:", 0),
1940 Child
, list
.first_text
= TextObject
,
1942 MUIA_Text_Contents
, "N/A",
1945 Child
, MUI_MakeObject(MUIO_Label
,
1947 Child
, list
.insert_cycle
= CycleObject
,
1949 MUIA_Cycle_Entries
, list_insert_modes
,
1951 Child
, list
.insert_single_button
=
1952 MUI_MakeObject(MUIO_Button
,
1954 Child
, list
.insert_multiple_button
=
1955 MUI_MakeObject(MUIO_Button
,
1957 Child
, MUI_MakeObject(MUIO_Label
,
1958 "Last insertion index:", 0),
1959 Child
, list
.insert_text
= TextObject
,
1961 MUIA_Text_Contents
, "N/A",
1964 Child
, MUI_MakeObject(MUIO_Label
,
1966 Child
, list
.remove_cycle
= CycleObject
,
1968 MUIA_Cycle_Entries
, list_remove_modes
,
1970 Child
, list
.remove_button
=
1971 MUI_MakeObject(MUIO_Button
, "Remove"),
1972 Child
, list
.clear_button
=
1973 MUI_MakeObject(MUIO_Button
, "Clear"),
1974 Child
, MUI_MakeObject(MUIO_Label
,
1975 "Active index:", 0),
1976 Child
, list
.active_text
= TextObject
,
1978 MUIA_Text_Contents
, "N/A",
1981 Child
, MUI_MakeObject(MUIO_Label
,
1982 "Activate mode:", 0),
1983 Child
, list
.activate_cycle
= CycleObject
,
1985 MUIA_Cycle_Entries
, list_activate_modes
,
1987 Child
, list
.activate_button
=
1988 MUI_MakeObject(MUIO_Button
, "Activate"),
1989 Child
, list
.deactivate_button
=
1990 MUI_MakeObject(MUIO_Button
, "Deactivate"),
1991 Child
, MUI_MakeObject(MUIO_Label
,
1992 "Last drop index:", 0),
1993 Child
, list
.drop_text
= TextObject
,
1995 MUIA_Text_Contents
, "N/A",
2000 Child
, ColGroup(LIST_COUNT
/ 2),
2001 Child
, VGroup
, GroupFrameT("Standard Format"),
2002 Child
, list
.multi_lists
[0] = ListviewObject
,
2006 MUIA_List_ConstructHook
,
2008 MUIA_List_DestructHook
,
2010 MUIA_List_DisplayHook
,
2012 MUIA_List_Format
, list_format
,
2013 MUIA_List_SourceArray
, entries
,
2014 MUIA_List_Title
, TRUE
,
2015 MUIA_List_AdjustWidth
, TRUE
,
2017 MUIA_Listview_MultiSelect
,
2018 MUIV_Listview_MultiSelect_None
,
2019 MUIA_Listview_DefClickColumn
, 1,
2023 Child
, VGroup
, GroupFrameT("Custom Format"),
2024 Child
, list
.multi_lists
[1] = ListviewObject
,
2028 MUIA_List_Format
, list_format
,
2029 MUIA_List_Title
, TRUE
,
2030 MUIA_List_AdjustHeight
, TRUE
,
2032 MUIA_Listview_MultiSelect
,
2033 MUIV_Listview_MultiSelect_None
,
2039 Child
, RectangleObject
,
2041 MUIA_Rectangle_HBar
, TRUE
,
2042 MUIA_Rectangle_BarTitle
, "List Controls",
2045 Child
, MUI_MakeObject(MUIO_Label
, "Format:", 0),
2046 Child
, list
.format_string
= StringObject
,
2050 Child
, list
.showheadings_check
=
2051 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2052 Child
, MUI_MakeObject(MUIO_Label
,
2053 "Show column headings", 0),
2054 Child
, list
.showimage_check
=
2055 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2056 Child
, MUI_MakeObject(MUIO_Label
,
2060 Child
, MUI_MakeObject(MUIO_Label
,
2061 "Default clicked column:", 0),
2062 Child
, list
.def_column_string
= StringObject
,
2064 MUIA_String_Accept
, (IPTR
)digits
,
2065 MUIA_String_Integer
, -1,
2068 Child
, MUI_MakeObject(MUIO_Label
,
2069 "Clicked column:", 0),
2070 Child
, list
.column_string
= StringObject
,
2073 Child
, list
.column_text
= TextObject
,
2075 MUIA_Text_Contents
, "N/A",
2088 MUIA_Gauge_InfoText
, "%ld %%",
2089 MUIA_Gauge_Horiz
, TRUE
,
2090 MUIA_Gauge_Current
, 25,
2099 MUIA_Gauge_InfoText
, "%ld %%",
2100 MUIA_Gauge_Horiz
, TRUE
,
2101 MUIA_Gauge_Current
, 50,
2110 MUIA_Gauge_InfoText
, "%ld %%",
2111 MUIA_Gauge_Horiz
, TRUE
,
2112 MUIA_Gauge_Current
, 75,
2122 MUIA_Gauge_InfoText
, "%ld %%",
2123 MUIA_Gauge_Current
, 25,
2127 MUIA_Gauge_InfoText
, "%ld %%",
2128 MUIA_Gauge_Current
, 50,
2132 MUIA_Gauge_InfoText
, "%ld %%",
2133 MUIA_Gauge_Current
, 75,
2142 GroupFrameT("Horizontal Sliders"),
2143 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
2144 Child
, numerics
[HNSLIDER
] = SliderObject
,
2145 MUIA_Slider_Horiz
, TRUE
,
2146 MUIA_Numeric_Min
, NUMERIC_MIN
,
2147 MUIA_Numeric_Max
, NUMERIC_MAX
,
2150 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
2151 Child
, numerics
[HRSLIDER
] = SliderObject
,
2152 MUIA_Numeric_Reverse
, TRUE
,
2153 MUIA_Numeric_Min
, NUMERIC_MIN
,
2154 MUIA_Numeric_Max
, NUMERIC_MAX
,
2157 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
2158 Child
, numerics
[HQSLIDER
] = SliderObject
,
2159 MUIA_Slider_Quiet
, TRUE
,
2160 MUIA_Numeric_Min
, NUMERIC_MIN
,
2161 MUIA_Numeric_Max
, NUMERIC_MAX
,
2166 GroupFrameT("Vertical Sliders"),
2167 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2168 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2169 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
2170 Child
, numerics
[VNSLIDER
] = SliderObject
,
2171 MUIA_Slider_Horiz
, FALSE
,
2172 MUIA_Numeric_Min
, NUMERIC_MIN
,
2173 MUIA_Numeric_Max
, NUMERIC_MAX
,
2176 Child
, numerics
[VRSLIDER
] = SliderObject
,
2177 MUIA_Slider_Horiz
, FALSE
,
2178 MUIA_Numeric_Reverse
, TRUE
,
2179 MUIA_Numeric_Min
, NUMERIC_MIN
,
2180 MUIA_Numeric_Max
, NUMERIC_MAX
,
2183 Child
, numerics
[VQSLIDER
] = SliderObject
,
2184 MUIA_Slider_Horiz
, FALSE
,
2185 MUIA_Slider_Quiet
, TRUE
,
2186 MUIA_Numeric_Min
, NUMERIC_MIN
,
2187 MUIA_Numeric_Max
, NUMERIC_MAX
,
2192 GroupFrameT("Numeric Buttons"),
2193 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
2194 Child
, numerics
[NNUMERICBUTTON
] =
2195 NumericbuttonObject
,
2196 MUIA_Numeric_Min
, NUMERIC_MIN
,
2197 MUIA_Numeric_Max
, NUMERIC_MAX
,
2200 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
2201 Child
, numerics
[RNUMERICBUTTON
] =
2202 NumericbuttonObject
,
2203 MUIA_Numeric_Reverse
, TRUE
,
2204 MUIA_Numeric_Min
, NUMERIC_MIN
,
2205 MUIA_Numeric_Max
, NUMERIC_MAX
,
2210 GroupFrameT("Knobs"),
2211 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2212 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2213 Child
, numerics
[NKNOB
] = KnobObject
,
2214 MUIA_Numeric_Min
, NUMERIC_MIN
,
2215 MUIA_Numeric_Max
, NUMERIC_MAX
,
2218 Child
, numerics
[RKNOB
] = KnobObject
,
2219 MUIA_Numeric_Reverse
, TRUE
,
2220 MUIA_Numeric_Min
, NUMERIC_MIN
,
2221 MUIA_Numeric_Max
, NUMERIC_MAX
,
2226 Child
, MUI_MakeObject(MUIO_Label
,
2227 "Minimum Value:", 0),
2228 Child
, min_string
= (Object
*)StringObject
,
2230 MUIA_String_Accept
, (IPTR
)digits
,
2231 MUIA_String_Integer
, NUMERIC_MIN
,
2234 Child
, MUI_MakeObject(MUIO_Label
,
2235 "Maximum Value:", 0),
2236 Child
, max_string
= (Object
*)StringObject
,
2238 MUIA_String_Accept
, (IPTR
)digits
,
2239 MUIA_String_Integer
, NUMERIC_MAX
,
2242 Child
, slider_button
= TextObject
,
2244 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2246 MUIA_Background
, MUII_ButtonBack
,
2247 MUIA_Text_PreParse
, "\33c",
2249 "Change Slider Orientations",
2251 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
2260 MUIA_Radio_Entries
, radio_entries1
,
2262 Child
, country_radio
[0] = RadioObject
,
2264 MUIA_Radio_Entries
, radio_entries2
,
2265 MUIA_Radio_Active
, 1,
2271 MUIA_Radio_Entries
, radio_entries1
,
2273 Child
, country_radio
[1] = RadioObject
,
2275 MUIA_Radio_Entries
, radio_entries2
,
2276 MUIA_Radio_Active
, 1,
2281 #if defined(TEST_ICONLIST)
2284 Child
, volume_iconlist
=
2285 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
2287 Child
, drawer_iconlist
=
2288 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
2289 MUIA_IconDrawerList_Drawer
, "SYS:",
2296 Child
, create_balance_column(),
2297 Child
, BalanceObject
,
2300 Child
, create_balance_column(),
2301 Child
, BalanceObject
,
2304 Child
, create_balance_column(),
2305 Child
, BalanceObject
,
2308 Child
, create_balance_column(),
2309 Child
, BalanceObject
,
2312 Child
, create_balance_column(),
2319 Child
, about_button
= TextObject
,
2321 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2323 MUIA_Background
, MUII_ButtonBack
,
2324 MUIA_Text_PreParse
, "\33c",
2325 MUIA_Text_Contents
, "About",
2327 Child
, quit_button
= TextObject
,
2329 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2331 MUIA_Background
, MUII_ButtonBack
,
2332 MUIA_ControlChar
, 'q',
2333 MUIA_Text_HiChar
, 'q',
2334 MUIA_Text_PreParse
, "\33c",
2335 MUIA_Text_Contents
, "Quit",
2341 SubWindow
, second_wnd
= WindowObject
,
2342 MUIA_Window_Title
, "Second window",
2343 WindowContents
, VGroup
,
2344 Child
, DropTextObject
,
2345 MUIA_Text_Contents
, "Drop here",
2346 MUIA_Dropable
, TRUE
,
2357 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
2358 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2359 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
2360 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
2361 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
,
2362 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
2363 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2364 MUIM_Application_AboutMUI
, NULL
);
2365 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2366 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2367 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2368 MUIM_CallHook
, &hook_objects
);
2369 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
2370 app
, 2, MUIM_CallHook
, &hook
);
2372 /* Notifications and set-up for string objects */
2373 DoMethod(string
.max_len_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
2374 "%ld", XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2375 set(string
.cursor_pos_slider
, MUIA_Numeric_Max
,
2376 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2377 set(string
.display_pos_slider
, MUIA_Numeric_Max
,
2378 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2379 set(string
.cr_advance_check
, MUIA_Selected
, TRUE
);
2380 set(string
.attach_list_check
, MUIA_Selected
, TRUE
);
2381 set(string
.strings
[1], MUIA_Disabled
,
2382 XGET(string
.strings
[1], MUIA_String_Format
)
2383 != MUIV_String_Format_Left
);
2384 set(string
.strings
[2], MUIA_Disabled
,
2385 XGET(string
.strings
[2], MUIA_String_Format
)
2386 != MUIV_String_Format_Right
);
2387 set(string
.strings
[3], MUIA_Disabled
,
2388 XGET(string
.strings
[3], MUIA_String_Format
)
2389 != MUIV_String_Format_Center
);
2390 set(string
.strings
[4], MUIA_Disabled
,
2391 !XGET(string
.strings
[4], MUIA_String_Secret
));
2392 set(string
.strings
[0], MUIA_String_MaxLen
, 100);
2393 set(string
.reject_string
, MUIA_String_Contents
,
2394 (IPTR
)default_reject_chars
);
2396 for (i
= 0; i
< STRING_COUNT
; i
++)
2400 DoMethod(string
.accept_string
, MUIM_Notify
,
2401 MUIA_String_Contents
, MUIV_EveryTime
, string
.strings
[i
],
2402 3, MUIM_Set
, MUIA_String_Accept
, MUIV_TriggerValue
);
2403 DoMethod(string
.cr_advance_check
, MUIM_Notify
, MUIA_Selected
,
2404 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2405 MUIA_String_AdvanceOnCR
, MUIV_TriggerValue
);
2406 DoMethod(string
.cursor_pos_slider
, MUIM_Notify
,
2407 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2408 MUIM_Set
, MUIA_String_BufferPos
, MUIV_TriggerValue
);
2409 DoMethod(string
.display_pos_slider
, MUIM_Notify
,
2410 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2411 MUIM_Set
, MUIA_String_DisplayPos
, MUIV_TriggerValue
);
2412 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2413 TRUE
, string
.strings
[i
], 3, MUIM_Set
,
2414 MUIA_String_AttachedList
, list
.lists
[0]);
2415 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2416 FALSE
, string
.strings
[i
], 3, MUIM_Set
,
2417 MUIA_String_AttachedList
, NULL
);
2421 DoMethod(string
.strings
[0], MUIM_Notify
, MUIA_String_Accept
,
2422 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2423 MUIA_String_Accept
, MUIV_TriggerValue
);
2424 DoMethod(string
.strings
[0], MUIM_Notify
,
2425 MUIA_String_AdvanceOnCR
, MUIV_EveryTime
,
2426 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_AdvanceOnCR
,
2428 DoMethod(string
.strings
[0], MUIM_Notify
,
2429 MUIA_String_BufferPos
, MUIV_EveryTime
,
2430 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_BufferPos
,
2432 DoMethod(string
.strings
[0], MUIM_Notify
,
2433 MUIA_String_DisplayPos
, MUIV_EveryTime
,
2434 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_DisplayPos
,
2436 DoMethod(string
.strings
[0], MUIM_Notify
,
2437 MUIA_String_AttachedList
, MUIV_EveryTime
,
2438 string
.strings
[i
], 3, MUIM_Set
,
2439 MUIA_String_AttachedList
, MUIV_TriggerValue
);
2441 DoMethod(string
.reject_string
, MUIM_Notify
, MUIA_String_Contents
,
2442 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2443 MUIA_String_Reject
, MUIV_TriggerValue
);
2444 DoMethod(string
.strings
[i
], MUIM_Notify
, MUIA_String_Integer
,
2445 MUIV_EveryTime
, string
.integer_string
, 3, MUIM_NoNotifySet
,
2446 MUIA_String_Integer
, MUIV_TriggerValue
);
2447 DoMethod(string
.integer_string
, MUIM_Notify
, MUIA_String_Integer
,
2448 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_NoNotifySet
,
2449 MUIA_String_Integer
, MUIV_TriggerValue
);
2451 DoMethod(string
.accept_all_check
, MUIM_Notify
, MUIA_Selected
,
2452 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2453 ChangeStringAccept
);
2454 DoMethod(string
.strings
[4], MUIM_Notify
, MUIA_String_Acknowledge
,
2455 MUIV_EveryTime
, string
.plaintext_string
, 3, MUIM_NoNotifySet
,
2456 MUIA_String_Contents
, MUIV_TriggerValue
);
2457 DoMethod(string
.plaintext_string
, MUIM_Notify
,
2458 MUIA_String_Acknowledge
, MUIV_EveryTime
, string
.strings
[4], 3,
2459 MUIM_NoNotifySet
, MUIA_String_Contents
, MUIV_TriggerValue
);
2461 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
2462 MUIM_CallHook
, &hook_wheel
);
2463 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
2464 2, MUIM_CallHook
, &hook_wheel
);
2465 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2466 app
, 2, MUIM_CallHook
, &hook_slider
);
2467 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2468 app
, 2, MUIM_CallHook
, &hook_slider
);
2469 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2470 app
, 2, MUIM_CallHook
, &hook_slider
);
2472 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
2473 MUIM_CallHook
, &hook_standard
, Save
);
2475 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2476 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
2477 MUIV_Application_ReturnID_Quit
);
2478 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2479 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2482 /* Notifications for color objects */
2483 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Red
,
2484 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2486 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Green
,
2487 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2489 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Blue
,
2490 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2492 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Red
,
2493 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2495 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Green
,
2496 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2498 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Blue
,
2499 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2501 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Pen
,
2502 MUIV_EveryTime
, colorfield_pen
, 3, MUIM_Set
,
2503 MUIA_String_Integer
, MUIV_TriggerValue
);
2504 DoMethod(colorfield_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2505 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2507 DoMethod(colorfield_reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2508 colorfield
, 3, MUIM_Set
, MUIA_Colorfield_RGB
, default_color
);
2510 /* Notifications for pen objects */
2511 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Pen
,
2512 MUIV_EveryTime
, pendisplay_pen
, 3, MUIM_NoNotifySet
,
2513 MUIA_String_Integer
, MUIV_TriggerValue
);
2514 DoMethod(pendisplay_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2515 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2516 ChangePendisplayPen
);
2517 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Spec
,
2518 MUIV_EveryTime
, pendisplay_spec
, 3, MUIM_Set
,
2519 MUIA_String_Contents
, MUIV_TriggerValue
);
2520 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_RGB
,
2521 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
,
2522 MUIA_Pendisplay_RGBcolor
, MUIV_TriggerValue
);
2523 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_RGBcolor
,
2524 MUIV_EveryTime
, poppen
, 3, MUIM_Set
, MUIA_Pendisplay_RGBcolor
,
2526 DoMethod(pendisplay_spec
, MUIM_Notify
, MUIA_String_Contents
,
2527 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
, MUIA_Pendisplay_Spec
,
2529 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, TRUE
,
2530 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, pendisplay
);
2531 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, FALSE
,
2532 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, NULL
);
2533 DoMethod(shine_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2534 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHINE
);
2535 DoMethod(shadow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2536 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHADOW
);
2537 DoMethod(yellow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2538 4, MUIM_Pendisplay_SetRGB
, 0xffffffff, 0xffffffff, 0);
2540 /* Notifications and set-up for list objects */
2541 set(list
.showdropmarks_check
, MUIA_Selected
, TRUE
);
2543 for (i
= 0; i
< LIST_COUNT
; i
++)
2545 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2546 MUIV_EveryTime
, list
.lists
[i
], 3, MUIM_Set
, MUIA_Disabled
,
2548 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Entries
,
2549 MUIV_EveryTime
, list
.entries_text
, 4, MUIM_SetAsString
,
2550 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2551 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Visible
,
2552 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2554 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_First
,
2555 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2557 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_InsertPosition
,
2558 MUIV_EveryTime
, list
.insert_text
, 4, MUIM_SetAsString
,
2559 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2560 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Active
,
2561 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2564 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2565 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2567 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2568 MUIV_EveryTime
, list
.dragsortable_check
, 3, MUIM_Set
,
2569 MUIA_Disabled
, MUIV_NotTriggerValue
);
2570 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2571 FALSE
, list
.dragsortable_check
, 3, MUIM_Set
,
2572 MUIA_Selected
, FALSE
);
2573 DoMethod(list
.showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
2574 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2575 ListSetShowDropMarks
);
2576 DoMethod(list
.multitest_check
, MUIM_Notify
, MUIA_Selected
,
2577 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2579 DoMethod(list
.quiet_check
, MUIM_Notify
, MUIA_Selected
,
2580 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2582 DoMethod(list
.dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
2583 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2584 ListSetDragSortable
);
2585 DoMethod(list
.autovisible_check
, MUIM_Notify
, MUIA_Selected
,
2586 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2587 ListSetAutoVisible
);
2588 DoMethod(list
.reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2589 app
, 3, MUIM_CallHook
, &hook_standard
, ListReset
);
2590 DoMethod(list
.move_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2591 app
, 3, MUIM_CallHook
, &hook_standard
, ListMove
);
2592 DoMethod(list
.sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2593 app
, 3, MUIM_CallHook
, &hook_standard
, ListSort
);
2594 DoMethod(list
.enable_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2595 app
, 3, MUIM_CallHook
, &hook_standard
, ListEnable
);
2596 DoMethod(list
.exchange_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2597 app
, 3, MUIM_CallHook
, &hook_standard
, ListExchange
);
2598 DoMethod(list
.jump_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2599 app
, 3, MUIM_CallHook
, &hook_standard
, ListJump
);
2600 DoMethod(list
.select_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2601 app
, 3, MUIM_CallHook
, &hook_standard
, ListSelect
);
2602 DoMethod(list
.deselect_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2603 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeselect
);
2604 DoMethod(list
.toggle_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2605 app
, 3, MUIM_CallHook
, &hook_standard
, ListToggle
);
2606 DoMethod(list
.redraw_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2607 app
, 3, MUIM_CallHook
, &hook_standard
, ListRedraw
);
2608 DoMethod(list
.insert_single_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2609 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsertSingle
);
2610 DoMethod(list
.insert_multiple_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2611 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsert
);
2612 DoMethod(list
.remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2613 app
, 3, MUIM_CallHook
, &hook_standard
, ListRemove
);
2614 DoMethod(list
.clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2615 app
, 3, MUIM_CallHook
, &hook_standard
, ListClear
);
2616 DoMethod(list
.activate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2617 app
, 3, MUIM_CallHook
, &hook_standard
, ListActivate
);
2618 DoMethod(list
.deactivate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2619 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeactivate
);
2620 DoMethod(list
.title_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2621 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2623 DoMethod(list
.list_radios
, MUIM_Notify
, MUIA_Radio_Active
,
2624 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2626 SET(list
.lists
[4], MUIA_List_CompareHook
, &hook_compare
);
2627 SET(list
.lists
[4], MUIA_List_AutoVisible
, TRUE
);
2629 SET(list
.showheadings_check
, MUIA_Selected
,
2630 XGET(list
.multi_lists
[0], MUIA_List_Title
));
2631 SET(list
.format_string
, MUIA_String_Contents
,
2632 XGET(list
.multi_lists
[1], MUIA_List_Format
));
2633 SET(list
.def_column_string
, MUIA_String_Integer
,
2634 XGET(list
.multi_lists
[0], MUIA_Listview_DefClickColumn
));
2635 DoMethod(list
.format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2636 MUIV_EveryTime
, list
.multi_lists
[1], 3, MUIM_Set
,
2637 MUIA_List_Format
, MUIV_TriggerValue
);
2638 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_List_Format
,
2639 MUIV_EveryTime
, wnd
, 3, MUIM_Set
,
2640 MUIA_Window_ActiveObject
, list
.format_string
);
2641 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
2643 DoMethod(list
.showheadings_check
, MUIM_Notify
, MUIA_Selected
,
2644 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2645 MUIA_List_Title
, MUIV_TriggerValue
);
2646 DoMethod(list
.showimage_check
, MUIM_Notify
, MUIA_Selected
,
2647 MUIV_EveryTime
, list
.multi_lists
[i
], 2, MUIM_List_Redraw
,
2648 MUIV_List_Redraw_All
);
2649 DoMethod(list
.def_column_string
, MUIM_Notify
,
2650 MUIA_String_Integer
,
2651 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2652 MUIA_Listview_DefClickColumn
, MUIV_TriggerValue
);
2653 DoMethod(list
.multi_lists
[i
], MUIM_Notify
,
2654 MUIA_Listview_ClickColumn
, MUIV_EveryTime
,
2655 list
.column_string
, 3, MUIM_Set
, MUIA_String_Integer
,
2658 DoMethod(list
.column_string
, MUIM_Notify
, MUIA_String_Contents
,
2659 MUIV_EveryTime
, list
.column_text
, 3, MUIM_Set
, MUIA_Text_Contents
,
2661 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2662 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2663 CheckListDoubleClick
);
2664 SET(list
.multi_lists
[1], MUIA_List_ConstructHook
, &hook_construct
);
2665 SET(list
.multi_lists
[1], MUIA_List_DestructHook
, &hook_destruct
);
2666 SET(list
.multi_lists
[1], MUIA_List_DisplayHook
, &hook_display
);
2667 DoMethod(list
.multi_lists
[1], MUIM_List_Insert
, entries
, -1,
2668 MUIV_List_Insert_Top
);
2670 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
2671 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
2674 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
2676 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
2677 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
2679 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
2680 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
2683 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2684 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
2687 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
2688 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
2689 MUIA_Radio_Active
, MUIV_TriggerValue
);
2690 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
2691 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
2692 MUIA_Radio_Active
, MUIV_TriggerValue
);
2694 #if defined(TEST_ICONLIST)
2696 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2697 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2698 volume_doubleclicked
);
2699 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2700 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2701 drawer_doubleclicked
);
2704 /* automatic tests */
2705 get(list
.lists
[0], MUIA_List_Visible
, &value
);
2707 printf("MUIA_List_Visible equals %ld before display,"
2708 " but it should be -1.\n", (long)value
);
2709 get(list
.multi_lists
[0], MUIA_Listview_ClickColumn
, &value
);
2711 printf("MUIA_Listview_ClickColumn equals %ld before display,"
2712 " but it should be 0.\n", (long)value
);
2713 get(list
.lists
[0], MUIA_Listview_DoubleClick
, &value
);
2715 printf("MUIA_Listview_DoubleClick equals %ld before display,"
2716 " but it should be 0.\n", (long)value
);
2718 set(wnd
, MUIA_Window_Open
, TRUE
);
2719 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test Application");
2721 list
.image
= DoMethod(list
.multi_lists
[0], MUIM_List_CreateImage
,
2722 list
.colorfield
, 0);
2724 /* Set pen fields */
2725 set(colorfield_pen
, MUIA_String_Integer
,
2726 XGET(colorfield
, MUIA_Colorfield_Pen
));
2729 nnset(pendisplay_pen
, MUIA_String_Integer
,
2730 XGET(pendisplay
, MUIA_Pendisplay_Pen
));
2732 struct MUI_PenSpec
*pen_spec
= NULL
;
2733 GET(pendisplay
, MUIA_Pendisplay_Spec
, &pen_spec
);
2734 strncpy(pen_str
, pen_spec
->buf
, 10);
2735 set(pendisplay_spec
, MUIA_String_Contents
, pen_str
);
2737 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
2738 &sigs
) != MUIV_Application_ReturnID_Quit
)
2742 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
2743 if (sigs
& SIGBREAKF_CTRL_C
)
2745 if (sigs
& SIGBREAKF_CTRL_D
)
2750 DoMethod(list
.multi_lists
[0], MUIM_List_DeleteImage
, list
.image
);
2751 MUI_DisposeObject(app
);
2754 MUI_DisposeObject(context_menu
);
2755 CloseLibrary(ColorWheelBase
);
2756 MUI_DeleteCustomClass(CL_DropText
);
2758 /* automatic tests */
2759 if (list
.destruct_count
!= 18)
2760 printf("The hook installed through MUIA_List_DestructHook has been"
2761 " called %ld times, but should have been called 18 times.\n",
2762 (long)list
.destruct_count
);
2764 CloseLibrary(MUIMasterBase
);