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
.multitest_check
=
1837 MUI_MakeObject(MUIO_Checkmark
,NULL
),
1838 Child
, MUI_MakeObject(MUIO_Label
,
1839 "Filter multiselect", 0),
1843 Child
, list
.quiet_check
=
1844 MUI_MakeObject(MUIO_Checkmark
,NULL
),
1845 Child
, MUI_MakeObject(MUIO_Label
,
1850 Child
, MUI_MakeObject(MUIO_Label
,
1851 "Affected index 2:", 0),
1852 Child
, list
.index2_string
=
1855 MUIA_String_Accept
, (IPTR
)digits
,
1856 MUIA_String_Integer
, 0,
1859 Child
, list
.dragsortable_check
=
1860 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1861 Child
, MUI_MakeObject(MUIO_Label
,
1862 "Drag sortable", 0),
1866 Child
, list
.autovisible_check
=
1867 MUI_MakeObject(MUIO_Checkmark
,NULL
),
1868 Child
, MUI_MakeObject(MUIO_Label
,
1872 Child
, list
.reset_button
=
1873 MUI_MakeObject(MUIO_Button
, "Reset"),
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
,
1888 "Last drop index:", 0),
1889 Child
, list
.drop_text
= TextObject
,
1891 MUIA_Text_Contents
, "N/A",
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
.title_string
=
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
,
1923 Child
, list
.entries_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 "Visible entries:", 0),
1940 Child
, list
.visible_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
, "Insert Single"),
1953 Child
, list
.insert_multiple_button
=
1954 MUI_MakeObject(MUIO_Button
, "Insert Multiple"),
1955 Child
, MUI_MakeObject(MUIO_Label
,
1956 "First visible index:", 0),
1957 Child
, list
.first_text
= TextObject
,
1959 MUIA_Text_Contents
, "N/A",
1962 Child
, MUI_MakeObject(MUIO_Label
,
1964 Child
, list
.remove_cycle
= CycleObject
,
1966 MUIA_Cycle_Entries
, list_remove_modes
,
1968 Child
, list
.remove_button
=
1969 MUI_MakeObject(MUIO_Button
, "Remove"),
1970 Child
, list
.clear_button
=
1971 MUI_MakeObject(MUIO_Button
, "Clear"),
1972 Child
, MUI_MakeObject(MUIO_Label
,
1973 "Last insertion index:", 0),
1974 Child
, list
.insert_text
= TextObject
,
1976 MUIA_Text_Contents
, "N/A",
1979 Child
, MUI_MakeObject(MUIO_Label
,
1980 "Activate mode:", 0),
1981 Child
, list
.activate_cycle
= CycleObject
,
1983 MUIA_Cycle_Entries
, list_activate_modes
,
1985 Child
, list
.activate_button
=
1986 MUI_MakeObject(MUIO_Button
, "Activate"),
1987 Child
, list
.deactivate_button
=
1988 MUI_MakeObject(MUIO_Button
, "Deactivate"),
1989 Child
, MUI_MakeObject(MUIO_Label
,
1990 "Active index:", 0),
1991 Child
, list
.active_text
= TextObject
,
1993 MUIA_Text_Contents
, "N/A",
1998 Child
, ColGroup(LIST_COUNT
/ 2),
1999 Child
, VGroup
, GroupFrameT("Standard Format"),
2000 Child
, list
.multi_lists
[0] = ListviewObject
,
2004 MUIA_List_ConstructHook
,
2006 MUIA_List_DestructHook
,
2008 MUIA_List_DisplayHook
,
2010 MUIA_List_Format
, list_format
,
2011 MUIA_List_SourceArray
, entries
,
2012 MUIA_List_Title
, TRUE
,
2013 MUIA_List_AdjustWidth
, TRUE
,
2015 MUIA_Listview_MultiSelect
,
2016 MUIV_Listview_MultiSelect_None
,
2017 MUIA_Listview_DefClickColumn
, 1,
2021 Child
, VGroup
, GroupFrameT("Custom Format"),
2022 Child
, list
.multi_lists
[1] = ListviewObject
,
2026 MUIA_List_Format
, list_format
,
2027 MUIA_List_Title
, TRUE
,
2028 MUIA_List_AdjustHeight
, TRUE
,
2030 MUIA_Listview_MultiSelect
,
2031 MUIV_Listview_MultiSelect_None
,
2037 Child
, RectangleObject
,
2039 MUIA_Rectangle_HBar
, TRUE
,
2040 MUIA_Rectangle_BarTitle
, "List Controls",
2043 Child
, MUI_MakeObject(MUIO_Label
, "Format:", 0),
2044 Child
, list
.format_string
= StringObject
,
2048 Child
, list
.showheadings_check
=
2049 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2050 Child
, MUI_MakeObject(MUIO_Label
,
2051 "Show column headings", 0),
2052 Child
, list
.showimage_check
=
2053 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2054 Child
, MUI_MakeObject(MUIO_Label
,
2058 Child
, MUI_MakeObject(MUIO_Label
,
2059 "Default clicked column:", 0),
2060 Child
, list
.def_column_string
= StringObject
,
2062 MUIA_String_Accept
, (IPTR
)digits
,
2063 MUIA_String_Integer
, -1,
2066 Child
, MUI_MakeObject(MUIO_Label
,
2067 "Clicked column:", 0),
2068 Child
, list
.column_string
= StringObject
,
2071 Child
, list
.column_text
= TextObject
,
2073 MUIA_Text_Contents
, "N/A",
2086 MUIA_Gauge_InfoText
, "%ld %%",
2087 MUIA_Gauge_Horiz
, TRUE
,
2088 MUIA_Gauge_Current
, 25,
2097 MUIA_Gauge_InfoText
, "%ld %%",
2098 MUIA_Gauge_Horiz
, TRUE
,
2099 MUIA_Gauge_Current
, 50,
2108 MUIA_Gauge_InfoText
, "%ld %%",
2109 MUIA_Gauge_Horiz
, TRUE
,
2110 MUIA_Gauge_Current
, 75,
2120 MUIA_Gauge_InfoText
, "%ld %%",
2121 MUIA_Gauge_Current
, 25,
2125 MUIA_Gauge_InfoText
, "%ld %%",
2126 MUIA_Gauge_Current
, 50,
2130 MUIA_Gauge_InfoText
, "%ld %%",
2131 MUIA_Gauge_Current
, 75,
2140 GroupFrameT("Horizontal Sliders"),
2141 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
2142 Child
, numerics
[HNSLIDER
] = SliderObject
,
2143 MUIA_Slider_Horiz
, TRUE
,
2144 MUIA_Numeric_Min
, NUMERIC_MIN
,
2145 MUIA_Numeric_Max
, NUMERIC_MAX
,
2148 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
2149 Child
, numerics
[HRSLIDER
] = SliderObject
,
2150 MUIA_Numeric_Reverse
, TRUE
,
2151 MUIA_Numeric_Min
, NUMERIC_MIN
,
2152 MUIA_Numeric_Max
, NUMERIC_MAX
,
2155 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
2156 Child
, numerics
[HQSLIDER
] = SliderObject
,
2157 MUIA_Slider_Quiet
, TRUE
,
2158 MUIA_Numeric_Min
, NUMERIC_MIN
,
2159 MUIA_Numeric_Max
, NUMERIC_MAX
,
2164 GroupFrameT("Vertical Sliders"),
2165 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2166 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2167 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
2168 Child
, numerics
[VNSLIDER
] = SliderObject
,
2169 MUIA_Slider_Horiz
, FALSE
,
2170 MUIA_Numeric_Min
, NUMERIC_MIN
,
2171 MUIA_Numeric_Max
, NUMERIC_MAX
,
2174 Child
, numerics
[VRSLIDER
] = SliderObject
,
2175 MUIA_Slider_Horiz
, FALSE
,
2176 MUIA_Numeric_Reverse
, TRUE
,
2177 MUIA_Numeric_Min
, NUMERIC_MIN
,
2178 MUIA_Numeric_Max
, NUMERIC_MAX
,
2181 Child
, numerics
[VQSLIDER
] = SliderObject
,
2182 MUIA_Slider_Horiz
, FALSE
,
2183 MUIA_Slider_Quiet
, TRUE
,
2184 MUIA_Numeric_Min
, NUMERIC_MIN
,
2185 MUIA_Numeric_Max
, NUMERIC_MAX
,
2190 GroupFrameT("Numeric Buttons"),
2191 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
2192 Child
, numerics
[NNUMERICBUTTON
] =
2193 NumericbuttonObject
,
2194 MUIA_Numeric_Min
, NUMERIC_MIN
,
2195 MUIA_Numeric_Max
, NUMERIC_MAX
,
2198 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
2199 Child
, numerics
[RNUMERICBUTTON
] =
2200 NumericbuttonObject
,
2201 MUIA_Numeric_Reverse
, TRUE
,
2202 MUIA_Numeric_Min
, NUMERIC_MIN
,
2203 MUIA_Numeric_Max
, NUMERIC_MAX
,
2208 GroupFrameT("Knobs"),
2209 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2210 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2211 Child
, numerics
[NKNOB
] = KnobObject
,
2212 MUIA_Numeric_Min
, NUMERIC_MIN
,
2213 MUIA_Numeric_Max
, NUMERIC_MAX
,
2216 Child
, numerics
[RKNOB
] = KnobObject
,
2217 MUIA_Numeric_Reverse
, TRUE
,
2218 MUIA_Numeric_Min
, NUMERIC_MIN
,
2219 MUIA_Numeric_Max
, NUMERIC_MAX
,
2224 Child
, MUI_MakeObject(MUIO_Label
,
2225 "Minimum Value:", 0),
2226 Child
, min_string
= (Object
*)StringObject
,
2228 MUIA_String_Accept
, (IPTR
)digits
,
2229 MUIA_String_Integer
, NUMERIC_MIN
,
2232 Child
, MUI_MakeObject(MUIO_Label
,
2233 "Maximum Value:", 0),
2234 Child
, max_string
= (Object
*)StringObject
,
2236 MUIA_String_Accept
, (IPTR
)digits
,
2237 MUIA_String_Integer
, NUMERIC_MAX
,
2240 Child
, slider_button
= TextObject
,
2242 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2244 MUIA_Background
, MUII_ButtonBack
,
2245 MUIA_Text_PreParse
, "\33c",
2247 "Change Slider Orientations",
2249 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
2258 MUIA_Radio_Entries
, radio_entries1
,
2260 Child
, country_radio
[0] = RadioObject
,
2262 MUIA_Radio_Entries
, radio_entries2
,
2263 MUIA_Radio_Active
, 1,
2269 MUIA_Radio_Entries
, radio_entries1
,
2271 Child
, country_radio
[1] = RadioObject
,
2273 MUIA_Radio_Entries
, radio_entries2
,
2274 MUIA_Radio_Active
, 1,
2279 #if defined(TEST_ICONLIST)
2282 Child
, volume_iconlist
=
2283 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
2285 Child
, drawer_iconlist
=
2286 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
2287 MUIA_IconDrawerList_Drawer
, "SYS:",
2294 Child
, create_balance_column(),
2295 Child
, BalanceObject
,
2298 Child
, create_balance_column(),
2299 Child
, BalanceObject
,
2302 Child
, create_balance_column(),
2303 Child
, BalanceObject
,
2306 Child
, create_balance_column(),
2307 Child
, BalanceObject
,
2310 Child
, create_balance_column(),
2317 Child
, about_button
= TextObject
,
2319 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2321 MUIA_Background
, MUII_ButtonBack
,
2322 MUIA_Text_PreParse
, "\33c",
2323 MUIA_Text_Contents
, "About",
2325 Child
, quit_button
= TextObject
,
2327 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2329 MUIA_Background
, MUII_ButtonBack
,
2330 MUIA_ControlChar
, 'q',
2331 MUIA_Text_HiChar
, 'q',
2332 MUIA_Text_PreParse
, "\33c",
2333 MUIA_Text_Contents
, "Quit",
2339 SubWindow
, second_wnd
= WindowObject
,
2340 MUIA_Window_Title
, "Second window",
2341 WindowContents
, VGroup
,
2342 Child
, DropTextObject
,
2343 MUIA_Text_Contents
, "Drop here",
2344 MUIA_Dropable
, TRUE
,
2355 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
2356 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2357 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
2358 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
2359 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
,
2360 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
2361 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2362 MUIM_Application_AboutMUI
, NULL
);
2363 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2364 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2365 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2366 MUIM_CallHook
, &hook_objects
);
2367 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
2368 app
, 2, MUIM_CallHook
, &hook
);
2370 /* Notifications and set-up for string objects */
2371 DoMethod(string
.max_len_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
2372 "%ld", XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2373 set(string
.cursor_pos_slider
, MUIA_Numeric_Max
,
2374 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2375 set(string
.display_pos_slider
, MUIA_Numeric_Max
,
2376 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2377 set(string
.cr_advance_check
, MUIA_Selected
, TRUE
);
2378 set(string
.attach_list_check
, MUIA_Selected
, TRUE
);
2379 set(string
.strings
[1], MUIA_Disabled
,
2380 XGET(string
.strings
[1], MUIA_String_Format
)
2381 != MUIV_String_Format_Left
);
2382 set(string
.strings
[2], MUIA_Disabled
,
2383 XGET(string
.strings
[2], MUIA_String_Format
)
2384 != MUIV_String_Format_Right
);
2385 set(string
.strings
[3], MUIA_Disabled
,
2386 XGET(string
.strings
[3], MUIA_String_Format
)
2387 != MUIV_String_Format_Center
);
2388 set(string
.strings
[4], MUIA_Disabled
,
2389 !XGET(string
.strings
[4], MUIA_String_Secret
));
2390 set(string
.strings
[0], MUIA_String_MaxLen
, 100);
2391 set(string
.reject_string
, MUIA_String_Contents
,
2392 (IPTR
)default_reject_chars
);
2394 for (i
= 0; i
< STRING_COUNT
; i
++)
2398 DoMethod(string
.accept_string
, MUIM_Notify
,
2399 MUIA_String_Contents
, MUIV_EveryTime
, string
.strings
[i
],
2400 3, MUIM_Set
, MUIA_String_Accept
, MUIV_TriggerValue
);
2401 DoMethod(string
.cr_advance_check
, MUIM_Notify
, MUIA_Selected
,
2402 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2403 MUIA_String_AdvanceOnCR
, MUIV_TriggerValue
);
2404 DoMethod(string
.cursor_pos_slider
, MUIM_Notify
,
2405 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2406 MUIM_Set
, MUIA_String_BufferPos
, MUIV_TriggerValue
);
2407 DoMethod(string
.display_pos_slider
, MUIM_Notify
,
2408 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2409 MUIM_Set
, MUIA_String_DisplayPos
, MUIV_TriggerValue
);
2410 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2411 TRUE
, string
.strings
[i
], 3, MUIM_Set
,
2412 MUIA_String_AttachedList
, list
.lists
[0]);
2413 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2414 FALSE
, string
.strings
[i
], 3, MUIM_Set
,
2415 MUIA_String_AttachedList
, NULL
);
2419 DoMethod(string
.strings
[0], MUIM_Notify
, MUIA_String_Accept
,
2420 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2421 MUIA_String_Accept
, MUIV_TriggerValue
);
2422 DoMethod(string
.strings
[0], MUIM_Notify
,
2423 MUIA_String_AdvanceOnCR
, MUIV_EveryTime
,
2424 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_AdvanceOnCR
,
2426 DoMethod(string
.strings
[0], MUIM_Notify
,
2427 MUIA_String_BufferPos
, MUIV_EveryTime
,
2428 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_BufferPos
,
2430 DoMethod(string
.strings
[0], MUIM_Notify
,
2431 MUIA_String_DisplayPos
, MUIV_EveryTime
,
2432 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_DisplayPos
,
2434 DoMethod(string
.strings
[0], MUIM_Notify
,
2435 MUIA_String_AttachedList
, MUIV_EveryTime
,
2436 string
.strings
[i
], 3, MUIM_Set
,
2437 MUIA_String_AttachedList
, MUIV_TriggerValue
);
2439 DoMethod(string
.reject_string
, MUIM_Notify
, MUIA_String_Contents
,
2440 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2441 MUIA_String_Reject
, MUIV_TriggerValue
);
2442 DoMethod(string
.strings
[i
], MUIM_Notify
, MUIA_String_Integer
,
2443 MUIV_EveryTime
, string
.integer_string
, 3, MUIM_NoNotifySet
,
2444 MUIA_String_Integer
, MUIV_TriggerValue
);
2445 DoMethod(string
.integer_string
, MUIM_Notify
, MUIA_String_Integer
,
2446 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_NoNotifySet
,
2447 MUIA_String_Integer
, MUIV_TriggerValue
);
2449 DoMethod(string
.accept_all_check
, MUIM_Notify
, MUIA_Selected
,
2450 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2451 ChangeStringAccept
);
2452 DoMethod(string
.strings
[4], MUIM_Notify
, MUIA_String_Acknowledge
,
2453 MUIV_EveryTime
, string
.plaintext_string
, 3, MUIM_NoNotifySet
,
2454 MUIA_String_Contents
, MUIV_TriggerValue
);
2455 DoMethod(string
.plaintext_string
, MUIM_Notify
,
2456 MUIA_String_Acknowledge
, MUIV_EveryTime
, string
.strings
[4], 3,
2457 MUIM_NoNotifySet
, MUIA_String_Contents
, MUIV_TriggerValue
);
2459 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
2460 MUIM_CallHook
, &hook_wheel
);
2461 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
2462 2, MUIM_CallHook
, &hook_wheel
);
2463 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2464 app
, 2, MUIM_CallHook
, &hook_slider
);
2465 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2466 app
, 2, MUIM_CallHook
, &hook_slider
);
2467 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2468 app
, 2, MUIM_CallHook
, &hook_slider
);
2470 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
2471 MUIM_CallHook
, &hook_standard
, Save
);
2473 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2474 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
2475 MUIV_Application_ReturnID_Quit
);
2476 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2477 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2480 /* Notifications for color objects */
2481 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Red
,
2482 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2484 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Green
,
2485 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2487 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Blue
,
2488 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2490 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Red
,
2491 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2493 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Green
,
2494 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2496 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Blue
,
2497 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2499 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Pen
,
2500 MUIV_EveryTime
, colorfield_pen
, 3, MUIM_Set
,
2501 MUIA_String_Integer
, MUIV_TriggerValue
);
2502 DoMethod(colorfield_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2503 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2505 DoMethod(colorfield_reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2506 colorfield
, 3, MUIM_Set
, MUIA_Colorfield_RGB
, default_color
);
2508 /* Notifications for pen objects */
2509 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Pen
,
2510 MUIV_EveryTime
, pendisplay_pen
, 3, MUIM_NoNotifySet
,
2511 MUIA_String_Integer
, MUIV_TriggerValue
);
2512 DoMethod(pendisplay_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2513 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2514 ChangePendisplayPen
);
2515 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Spec
,
2516 MUIV_EveryTime
, pendisplay_spec
, 3, MUIM_Set
,
2517 MUIA_String_Contents
, MUIV_TriggerValue
);
2518 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_RGB
,
2519 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
,
2520 MUIA_Pendisplay_RGBcolor
, MUIV_TriggerValue
);
2521 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_RGBcolor
,
2522 MUIV_EveryTime
, poppen
, 3, MUIM_Set
, MUIA_Pendisplay_RGBcolor
,
2524 DoMethod(pendisplay_spec
, MUIM_Notify
, MUIA_String_Contents
,
2525 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
, MUIA_Pendisplay_Spec
,
2527 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, TRUE
,
2528 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, pendisplay
);
2529 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, FALSE
,
2530 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, NULL
);
2531 DoMethod(shine_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2532 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHINE
);
2533 DoMethod(shadow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2534 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHADOW
);
2535 DoMethod(yellow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2536 4, MUIM_Pendisplay_SetRGB
, 0xffffffff, 0xffffffff, 0);
2538 /* Notifications and set-up for list objects */
2539 set(list
.showdropmarks_check
, MUIA_Selected
, TRUE
);
2541 for (i
= 0; i
< LIST_COUNT
; i
++)
2543 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2544 MUIV_EveryTime
, list
.lists
[i
], 3, MUIM_Set
, MUIA_Disabled
,
2546 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Entries
,
2547 MUIV_EveryTime
, list
.entries_text
, 4, MUIM_SetAsString
,
2548 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2549 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Visible
,
2550 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2552 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_First
,
2553 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2555 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_InsertPosition
,
2556 MUIV_EveryTime
, list
.insert_text
, 4, MUIM_SetAsString
,
2557 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2558 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Active
,
2559 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2562 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2563 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2565 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2566 MUIV_EveryTime
, list
.dragsortable_check
, 3, MUIM_Set
,
2567 MUIA_Disabled
, MUIV_NotTriggerValue
);
2568 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2569 FALSE
, list
.dragsortable_check
, 3, MUIM_Set
,
2570 MUIA_Selected
, FALSE
);
2571 DoMethod(list
.showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
2572 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2573 ListSetShowDropMarks
);
2574 DoMethod(list
.multitest_check
, MUIM_Notify
, MUIA_Selected
,
2575 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2577 DoMethod(list
.quiet_check
, MUIM_Notify
, MUIA_Selected
,
2578 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2580 DoMethod(list
.dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
2581 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2582 ListSetDragSortable
);
2583 DoMethod(list
.autovisible_check
, MUIM_Notify
, MUIA_Selected
,
2584 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2585 ListSetAutoVisible
);
2586 DoMethod(list
.reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2587 app
, 3, MUIM_CallHook
, &hook_standard
, ListReset
);
2588 DoMethod(list
.move_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2589 app
, 3, MUIM_CallHook
, &hook_standard
, ListMove
);
2590 DoMethod(list
.sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2591 app
, 3, MUIM_CallHook
, &hook_standard
, ListSort
);
2592 DoMethod(list
.enable_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2593 app
, 3, MUIM_CallHook
, &hook_standard
, ListEnable
);
2594 DoMethod(list
.exchange_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2595 app
, 3, MUIM_CallHook
, &hook_standard
, ListExchange
);
2596 DoMethod(list
.jump_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2597 app
, 3, MUIM_CallHook
, &hook_standard
, ListJump
);
2598 DoMethod(list
.select_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2599 app
, 3, MUIM_CallHook
, &hook_standard
, ListSelect
);
2600 DoMethod(list
.deselect_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2601 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeselect
);
2602 DoMethod(list
.toggle_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2603 app
, 3, MUIM_CallHook
, &hook_standard
, ListToggle
);
2604 DoMethod(list
.redraw_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2605 app
, 3, MUIM_CallHook
, &hook_standard
, ListRedraw
);
2606 DoMethod(list
.insert_single_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2607 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsertSingle
);
2608 DoMethod(list
.insert_multiple_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2609 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsert
);
2610 DoMethod(list
.remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2611 app
, 3, MUIM_CallHook
, &hook_standard
, ListRemove
);
2612 DoMethod(list
.clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2613 app
, 3, MUIM_CallHook
, &hook_standard
, ListClear
);
2614 DoMethod(list
.activate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2615 app
, 3, MUIM_CallHook
, &hook_standard
, ListActivate
);
2616 DoMethod(list
.deactivate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2617 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeactivate
);
2618 DoMethod(list
.title_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2619 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2621 DoMethod(list
.list_radios
, MUIM_Notify
, MUIA_Radio_Active
,
2622 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2624 SET(list
.lists
[4], MUIA_List_CompareHook
, &hook_compare
);
2625 SET(list
.lists
[4], MUIA_List_AutoVisible
, TRUE
);
2627 SET(list
.showheadings_check
, MUIA_Selected
,
2628 XGET(list
.multi_lists
[0], MUIA_List_Title
));
2629 SET(list
.format_string
, MUIA_String_Contents
,
2630 XGET(list
.multi_lists
[1], MUIA_List_Format
));
2631 SET(list
.def_column_string
, MUIA_String_Integer
,
2632 XGET(list
.multi_lists
[0], MUIA_Listview_DefClickColumn
));
2633 DoMethod(list
.format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2634 MUIV_EveryTime
, list
.multi_lists
[1], 3, MUIM_Set
,
2635 MUIA_List_Format
, MUIV_TriggerValue
);
2636 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_List_Format
,
2637 MUIV_EveryTime
, wnd
, 3, MUIM_Set
,
2638 MUIA_Window_ActiveObject
, list
.format_string
);
2639 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
2641 DoMethod(list
.showheadings_check
, MUIM_Notify
, MUIA_Selected
,
2642 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2643 MUIA_List_Title
, MUIV_TriggerValue
);
2644 DoMethod(list
.showimage_check
, MUIM_Notify
, MUIA_Selected
,
2645 MUIV_EveryTime
, list
.multi_lists
[i
], 2, MUIM_List_Redraw
,
2646 MUIV_List_Redraw_All
);
2647 DoMethod(list
.def_column_string
, MUIM_Notify
,
2648 MUIA_String_Integer
,
2649 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2650 MUIA_Listview_DefClickColumn
, MUIV_TriggerValue
);
2651 DoMethod(list
.multi_lists
[i
], MUIM_Notify
,
2652 MUIA_Listview_ClickColumn
, MUIV_EveryTime
,
2653 list
.column_string
, 3, MUIM_Set
, MUIA_String_Integer
,
2656 DoMethod(list
.column_string
, MUIM_Notify
, MUIA_String_Contents
,
2657 MUIV_EveryTime
, list
.column_text
, 3, MUIM_Set
, MUIA_Text_Contents
,
2659 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2660 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2661 CheckListDoubleClick
);
2662 SET(list
.multi_lists
[1], MUIA_List_ConstructHook
, &hook_construct
);
2663 SET(list
.multi_lists
[1], MUIA_List_DestructHook
, &hook_destruct
);
2664 SET(list
.multi_lists
[1], MUIA_List_DisplayHook
, &hook_display
);
2665 DoMethod(list
.multi_lists
[1], MUIM_List_Insert
, entries
, -1,
2666 MUIV_List_Insert_Top
);
2668 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
2669 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
2672 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
2674 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
2675 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
2677 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
2678 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
2681 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2682 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
2685 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
2686 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
2687 MUIA_Radio_Active
, MUIV_TriggerValue
);
2688 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
2689 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
2690 MUIA_Radio_Active
, MUIV_TriggerValue
);
2692 #if defined(TEST_ICONLIST)
2694 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2695 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2696 volume_doubleclicked
);
2697 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2698 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2699 drawer_doubleclicked
);
2702 /* automatic tests */
2703 get(list
.lists
[0], MUIA_List_Visible
, &value
);
2705 printf("MUIA_List_Visible equals %ld before display,"
2706 " but it should be -1.\n", (long)value
);
2707 get(list
.multi_lists
[0], MUIA_Listview_ClickColumn
, &value
);
2709 printf("MUIA_Listview_ClickColumn equals %ld before display,"
2710 " but it should be 0.\n", (long)value
);
2711 get(list
.lists
[0], MUIA_Listview_DoubleClick
, &value
);
2713 printf("MUIA_Listview_DoubleClick equals %ld before display,"
2714 " but it should be 0.\n", (long)value
);
2716 set(wnd
, MUIA_Window_Open
, TRUE
);
2717 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test Application");
2719 list
.image
= DoMethod(list
.multi_lists
[0], MUIM_List_CreateImage
,
2720 list
.colorfield
, 0);
2722 /* Set pen fields */
2723 set(colorfield_pen
, MUIA_String_Integer
,
2724 XGET(colorfield
, MUIA_Colorfield_Pen
));
2727 nnset(pendisplay_pen
, MUIA_String_Integer
,
2728 XGET(pendisplay
, MUIA_Pendisplay_Pen
));
2730 struct MUI_PenSpec
*pen_spec
= NULL
;
2731 GET(pendisplay
, MUIA_Pendisplay_Spec
, &pen_spec
);
2732 strncpy(pen_str
, pen_spec
->buf
, 10);
2733 set(pendisplay_spec
, MUIA_String_Contents
, pen_str
);
2735 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
2736 &sigs
) != MUIV_Application_ReturnID_Quit
)
2740 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
2741 if (sigs
& SIGBREAKF_CTRL_C
)
2743 if (sigs
& SIGBREAKF_CTRL_D
)
2748 DoMethod(list
.multi_lists
[0], MUIM_List_DeleteImage
, list
.image
);
2749 MUI_DisposeObject(app
);
2752 MUI_DisposeObject(context_menu
);
2753 CloseLibrary(ColorWheelBase
);
2754 MUI_DeleteCustomClass(CL_DropText
);
2756 /* automatic tests */
2757 if (list
.destruct_count
!= 18)
2758 printf("The hook installed through MUIA_List_DestructHook has been"
2759 " called %ld times, but should have been called 18 times.\n",
2760 (long)list
.destruct_count
);
2762 CloseLibrary(MUIMasterBase
);