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
,
172 *multi_lists
[MULTI_LIST_COUNT
],
180 LONG quiet
[LIST_COUNT
],
182 has_multitest
[LIST_COUNT
];
187 static Object
*wheel
;
188 static Object
*r_slider
;
189 static Object
*g_slider
;
190 static Object
*b_slider
;
191 static Object
*hue_gauge
;
192 static Object
*colorfield
, *colorfield2
, *colorfield_reset_button
,
194 static Object
*coloradjust
;
195 static Object
*pendisplay
, *pendisplay2
, *pendisplay_pen
, *pendisplay_spec
,
196 *reference_check
, *shine_button
, *shadow_button
, *yellow_button
, *poppen
;
197 static Object
*group
;
198 static Object
*editor_text
;
199 static Object
*filename_string
;
200 static Object
*save_button
;
201 static struct Hook hook_standard
;
202 static struct Hook hook
;
203 static struct Hook hook_wheel
;
204 static struct Hook hook_slider
;
205 static struct Hook hook_objects
;
206 static struct Hook hook_compare
, hook_multitest
;
207 static struct Hook hook_construct
, hook_destruct
, hook_display
;
208 static struct Hook hook_objstr
;
210 #if defined(TEST_ICONLIST)
211 static Object
*drawer_iconlist
;
212 static Object
*volume_iconlist
;
215 AROS_UFH0(void, repeat_function
)
219 printf("MUI_Timer\n");
224 AROS_UFH0(void, wheel_function
)
228 nnset(r_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
229 WHEEL_Red
) >> 24) & 0xff);
230 nnset(g_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
231 WHEEL_Green
) >> 24) & 0xff);
232 nnset(b_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
233 WHEEL_Blue
) >> 24) & 0xff);
238 AROS_UFH0(void, slider_function
)
242 struct ColorWheelRGB cw
;
243 ULONG red
= XGET(r_slider
, MUIA_Numeric_Value
);
244 ULONG green
= XGET(g_slider
, MUIA_Numeric_Value
);
245 ULONG blue
= XGET(b_slider
, MUIA_Numeric_Value
);
247 cw
.cw_Red
= (red
<< 24) | (red
<< 16) | (red
<< 8) | red
;
248 cw
.cw_Green
= (green
<< 24) | (green
<< 16) | (green
<< 8) | green
;
249 cw
.cw_Blue
= (blue
<< 24) | (blue
<< 16) | (blue
<< 8) | blue
;
251 nnset(wheel
, WHEEL_RGB
, &cw
);
252 set(hue_gauge
, MUIA_Gauge_Current
, XGET(wheel
, WHEEL_Hue
));
257 AROS_UFH0(void, objects_function
)
261 Object
*new_obj
= MUI_MakeObject(MUIO_Button
, "Button");
264 DoMethod(group
, MUIM_Group_InitChange
);
265 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
266 DoMethod(group
, MUIM_Group_ExitChange
);
272 static void About(void)
274 static Object
*about_wnd
;
278 about_wnd
= AboutmuiObject
, MUIA_Aboutmui_Application
, app
, End
;
282 set(about_wnd
, MUIA_Window_Open
, TRUE
);
285 AROS_UFH3(static void, ObjStrHook
,
286 AROS_UFHA(struct Hook
*, h
, A0
),
287 AROS_UFHA(Object
*, group
, A2
),
288 AROS_UFHA(Object
*, str
, A1
))
292 struct List
*child_list
= NULL
;
293 Object
*child
, *list
;
294 struct list_entry
*entry
;
296 /* Find the listview object within its group */
297 GET(group
, MUIA_Group_ChildList
, &child_list
);
298 child
= (APTR
)child_list
->lh_Head
;
300 list
= NextObject(&child
);
302 /* Copy one of the selected entry's fields to the string gadget */
303 DoMethod(list
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &entry
);
304 SET(str
, MUIA_String_Contents
, entry
->column1
);
309 static void ChangeStringAccept(void)
311 STRPTR accept_chars
= NULL
, reject_chars
= NULL
;
315 accept_all
= XGET(string
.accept_all_check
, MUIA_Selected
);
316 SET(string
.accept_string
, MUIA_Disabled
, accept_all
);
317 SET(string
.reject_string
, MUIA_Disabled
, accept_all
);
321 GET(string
.accept_string
, MUIA_String_Contents
, &accept_chars
);
322 GET(string
.reject_string
, MUIA_String_Contents
, &reject_chars
);
325 for (i
= 0; i
< STRING_COUNT
; i
++)
327 SET(string
.strings
[i
], MUIA_String_Accept
, accept_chars
);
328 SET(string
.strings
[i
], MUIA_String_Reject
, reject_chars
);
332 static void ChangePen(void)
336 GET(colorfield_pen
, MUIA_String_Integer
, &pen
);
338 SET(colorfield
, MUIA_Colorfield_Pen
, pen
);
341 static void ChangePendisplayPen(void)
343 DoMethod(pendisplay
, MUIM_Pendisplay_SetColormap
,
344 XGET(pendisplay_pen
, MUIA_String_Integer
));
347 AROS_UFH3(static IPTR
, ListCompareHook
,
348 AROS_UFHA(struct Hook
*, h
, A0
),
349 AROS_UFHA(CONST_STRPTR
, str1
, A2
),
350 AROS_UFHA(CONST_STRPTR
, str2
, A1
))
359 /* Indicate which string is shorter */
365 AROS_UFH3(static IPTR
, ListMultiTestHook
,
366 AROS_UFHA(struct Hook
*, h
, A0
),
367 AROS_UFHA(APTR
, unused
, A2
),
368 AROS_UFHA(CONST_STRPTR
, str
, A1
))
372 /* Indicate whether the string doesn't begin with a vowel */
373 return strchr(vowels
, tolower(str
[0])) == NULL
;
378 static void ChangeListTitle(void)
383 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
385 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
388 GET(list
.title_string
, MUIA_String_Contents
, &title
);
389 if (title
[0] == '\0')
392 title
= StrDup(title
);
394 SET(list
.lists
[i
], MUIA_List_Title
, title
);
397 static void UpdateListInfo(void)
403 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
405 GET(list
.lists
[i
], MUIA_Listview_DragType
, &value
);
406 NNSET(list
.draggable_check
, MUIA_Selected
,
407 value
!= MUIV_Listview_DragType_None
);
408 NNSET(list
.dragsortable_check
, MUIA_Disabled
,
409 value
== MUIV_Listview_DragType_None
);
410 if (value
== MUIV_Listview_DragType_None
)
413 GET(list
.lists
[i
], MUIA_List_DragSortable
, &value
);
414 NNSET(list
.dragsortable_check
, MUIA_Selected
, value
);
415 GET(list
.lists
[i
], MUIA_List_ShowDropMarks
, &value
);
416 NNSET(list
.showdropmarks_check
, MUIA_Selected
, value
);
417 value
= list
.has_multitest
[i
]; // MUIA_List_MultiTestHook isn't gettable!
418 NNSET(list
.multitest_check
, MUIA_Selected
, value
);
419 value
= list
.quiet
[i
]; // MUIA_List_Quiet is not gettable!
420 NNSET(list
.quiet_check
, MUIA_Selected
, value
);
421 GET(list
.lists
[i
], MUIA_List_AutoVisible
, &value
);
422 NNSET(list
.autovisible_check
, MUIA_Selected
, value
);
424 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
425 NNSET(list
.title_string
, MUIA_String_Contents
, title
);
427 GET(list
.lists
[i
], MUIA_List_Entries
, &value
);
428 DoMethod(list
.entries_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
430 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
431 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
433 GET(list
.lists
[i
], MUIA_List_First
, &value
);
434 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
436 GET(list
.lists
[i
], MUIA_List_InsertPosition
, &value
);
437 DoMethod(list
.insert_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
439 GET(list
.lists
[i
], MUIA_List_Active
, &value
);
440 if (value
== MUIV_List_Active_Off
)
441 SET(list
.active_text
, MUIA_Text_Contents
, "N/A");
443 DoMethod(list
.active_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
445 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
446 MUIV_List_Select_Ask
, (IPTR
) &value
);
447 DoMethod(list
.selected_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
449 GET(list
.lists
[i
], MUIA_List_DropMark
, &value
);
450 DoMethod(list
.drop_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
454 static void ListGetVisible(void)
459 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
461 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
462 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
466 static void ListGetFirst(void)
472 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
474 /* We fetch the Listview's list here to provide test coverage for that
475 attribute. Please don't optimise */
476 real_list
= (Object
*)XGET(list
.lists
[i
], MUIA_Listview_List
);
477 GET(real_list
, MUIA_List_First
, &value
);
478 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
482 static void ListGetSelected(void)
487 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
489 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
490 MUIV_List_Select_Ask
, (IPTR
) &value
);
491 DoMethod(list
.selected_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
495 static void ListSetDraggable(void)
500 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
502 GET(list
.draggable_check
, MUIA_Selected
, &value
);
503 SET(list
.lists
[i
], MUIA_Listview_DragType
, value
?
504 MUIV_Listview_DragType_Immediate
: MUIV_Listview_DragType_None
);
507 static void ListSetShowDropMarks(void)
512 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
514 GET(list
.showdropmarks_check
, MUIA_Selected
, &value
);
515 SET(list
.lists
[i
], MUIA_List_ShowDropMarks
, value
);
518 static void ListSetMultiTest(void)
523 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
525 GET(list
.multitest_check
, MUIA_Selected
, &value
);
526 SET(list
.lists
[i
], MUIA_List_MultiTestHook
, value
? &hook_multitest
: NULL
);
527 list
.has_multitest
[i
] = value
;
530 static void ListSetQuiet(void)
535 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
537 GET(list
.quiet_check
, MUIA_Selected
, &value
);
538 SET(list
.lists
[i
], MUIA_List_Quiet
, value
);
539 list
.quiet
[i
] = value
;
542 static void ListSetDragSortable(void)
547 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
549 GET(list
.dragsortable_check
, MUIA_Selected
, &value
);
550 SET(list
.lists
[i
], MUIA_List_DragSortable
, value
);
553 static void ListSetAutoVisible(void)
558 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
560 GET(list
.autovisible_check
, MUIA_Selected
, &value
);
561 SET(list
.lists
[i
], MUIA_List_AutoVisible
, value
);
564 static void ListReset(void)
568 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
570 SET(list
.lists
[i
], MUIA_List_Active
, list_active_positions
[i
]);
573 static void ListMove(void)
575 LONG mode
, pos1
, pos2
;
578 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
580 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
583 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
587 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
590 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
594 DoMethod(list
.lists
[i
], MUIM_List_Move
, pos1
, pos2
);
597 static void ListSort(void)
601 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
603 DoMethod(list
.lists
[i
], MUIM_List_Sort
);
606 static void ListEnable(void)
610 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
612 SET(list
.lists
[i
], MUIA_Disabled
, FALSE
);
615 static void ListExchange(void)
617 LONG mode
, pos1
, pos2
;
620 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
622 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
625 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
629 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
632 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
636 DoMethod(list
.lists
[i
], MUIM_List_Exchange
, pos1
, pos2
);
639 static void ListJump(void)
644 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
646 mode
= XGET(list
.jump_cycle
, MUIA_Cycle_Active
);
649 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
653 DoMethod(list
.lists
[i
], MUIM_List_Jump
, pos
);
656 static void ListSelect(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_On
,
674 static void ListDeselect(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
, MUIV_List_Select_Off
,
692 static void ListToggle(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_Select
, pos
,
707 MUIV_List_Select_Toggle
, NULL
);
710 static void ListRedraw(void)
715 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
717 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
720 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
724 DoMethod(list
.lists
[i
], MUIM_List_Redraw
, pos
);
727 static void ListInsertSingle(void)
732 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
734 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
737 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
741 DoMethod(list
.lists
[i
], MUIM_List_InsertSingle
, "Tomato", pos
);
744 static void ListInsert(void)
749 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
751 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
754 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
758 DoMethod(list
.lists
[i
], MUIM_List_Insert
, fruits
, -1, pos
);
761 static void ListRemove(void)
763 LONG mode
, pos
, count
, j
, *selections
;
766 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
768 mode
= XGET(list
.remove_cycle
, MUIA_Cycle_Active
);
772 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
773 This doesn't work as expected in MUI or Zune */
774 pos
= MUIV_List_NextSelected_Start
- 1;
775 while (pos
!= MUIV_List_NextSelected_End
)
777 if (pos
== MUIV_List_NextSelected_Start
- 1)
779 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
780 if (pos
!= MUIV_List_NextSelected_End
)
781 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
786 /* Remove selected entries safely by first retrieving them with
787 MUIM_List_NextSelected and then removing them one by one */
788 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
789 MUIV_List_Select_Ask
, &count
);
791 count
= 1; /* There may still be an active entry */
792 selections
= AllocVec(sizeof(LONG
) * count
, MEMF_ANY
);
793 if (selections
!= NULL
)
795 pos
= MUIV_List_NextSelected_Start
;
796 for (j
= 0; j
< count
; j
++)
798 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
802 /* We must remove the entries in reverse order; otherwise the
803 later indices will become invalid */
805 DoMethod(list
.lists
[i
], MUIM_List_Remove
, selections
[--count
]);
812 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
815 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
819 static void ListClear(void)
823 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
825 DoMethod(list
.lists
[i
], MUIM_List_Clear
);
828 static void ListActivate(void)
833 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
835 mode
= XGET(list
.activate_cycle
, MUIA_Cycle_Active
);
838 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
842 SET(list
.lists
[i
], MUIA_List_Active
, pos
);
845 static void ListDeactivate(void)
849 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
851 SET(list
.lists
[i
], MUIA_List_Active
, MUIV_List_Active_Off
);
854 static void CheckListDoubleClick(void)
858 GET(list
.multi_lists
[1], MUIA_Listview_DoubleClick
, &value
);
859 MUI_Request(app
, wnd
, 0, "Test", "OK",
860 "MUIA_Listview_Doubleclick = %ld", value
);
863 AROS_UFH3(static APTR
, ListConstructHook
,
864 AROS_UFHA(struct Hook
*, h
, A0
),
865 AROS_UFHA(APTR
, pool
, A2
),
866 AROS_UFHA(IPTR
, n
, A1
))
870 struct list_entry
*entry
;
872 entry
= AllocPooled(pool
, sizeof(struct list_entry
) + 40);
876 entry
->column1
= (char *)(entry
+ 1);
877 entry
->column2
= entry
->column1
+ 20;
878 sprintf(entry
->column1
, "Entry%ld", (long)n
);
879 sprintf(entry
->column2
, "Col2: Entry%ld", (long)n
);
887 AROS_UFH3(static void, ListDestructHook
,
888 AROS_UFHA(struct Hook
*, h
, A0
),
889 AROS_UFHA(APTR
, pool
, A2
),
890 AROS_UFHA(struct list_entry
*, entry
, A1
))
894 FreePooled(pool
, entry
, sizeof(struct list_entry
) + 40);
895 list
.destruct_count
++;
900 AROS_UFH3(static void, display_function
,
901 AROS_UFHA(struct Hook
*, h
, A0
),
902 AROS_UFHA(char **, strings
, A2
),
903 AROS_UFHA(struct list_entry
*, entry
, A1
))
907 static char buf
[100];
911 if (XGET(list
.showimage_check
, MUIA_Selected
))
912 sprintf(buf
, "%ld \33O[%08lx]", (long)*(strings
- 1),
915 sprintf(buf
, "%ld", (long)*(strings
- 1));
917 strings
[1] = entry
->column1
;
918 strings
[2] = entry
->column2
;
922 strings
[0] = "Number";
923 strings
[1] = "Column 1";
924 strings
[2] = "Column 2";
930 static void Save(void)
932 char *text
= (char *)XGET(editor_text
, MUIA_String_Contents
);
933 char *filename
= (char *)XGET(filename_string
, MUIA_String_Contents
);
936 if (!strlen(filename
))
939 if ((fh
= Open(filename
, MODE_NEWFILE
)))
941 Write(fh
, text
, strlen(text
));
946 #if defined(TEST_ICONLIST)
947 /* IconList callbacks */
948 static void volume_doubleclicked(void)
951 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
953 DoMethod(volume_iconlist
, MUIM_IconList_NextIcon
,
954 MUIV_IconList_NextIcon_Selected
, &ent
);
955 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
958 strcpy(buf
, ent
->label
);
962 static void drawer_doubleclicked(void)
964 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
966 DoMethod(drawer_iconlist
, MUIM_IconList_NextIcon
,
967 MUIV_IconList_NextIcon_Selected
, &ent
);
968 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
970 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
,
971 ent
->ile_IconEntry
->ie_IconNode
.ln_Name
);
975 static IPTR
create_balance_column(void)
977 return (IPTR
) VGroup
,
978 Child
, RectangleObject
,
981 Child
, BalanceObject
,
983 Child
, RectangleObject
,
986 Child
, BalanceObject
,
988 Child
, RectangleObject
,
991 Child
, BalanceObject
,
993 Child
, RectangleObject
,
996 Child
, BalanceObject
,
998 Child
, RectangleObject
,
1004 /* The custom class */
1006 struct DropText_Data
1013 struct Library
*KeymapBase
;
1017 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
,
1018 register __a2 Object
*obj
, register __a1 Msg msg
)
1020 AROS_UFH3S(IPTR
, dispatcher
,
1021 AROS_UFHA(Class
*, cl
, A0
),
1022 AROS_UFHA(Object
*, obj
, A2
), AROS_UFHA(Msg
, msg
, A1
))
1027 switch (msg
->MethodID
)
1029 case MUIM_DragQuery
:
1030 return MUIV_DragQuery_Accept
;
1033 struct DropText_Data
*data
=
1034 (struct DropText_Data
*)INST_DATA(cl
, obj
);
1037 sprintf(buf
, "%ld times", (long)data
->times
);
1038 set(obj
, MUIA_Text_Contents
, buf
);
1042 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
1047 static struct MUI_CustomClass
*CL_DropText
;
1049 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
1053 AROS_UFH3S(void, hook_func_standard
,
1054 AROS_UFHA(struct Hook
*, h
, A0
),
1055 AROS_UFHA(void *, dummy
, A2
), AROS_UFHA(void **, funcptr
, A1
))
1059 void (*func
) (ULONG
*) = (void (*)(ULONG
*))(*funcptr
);
1062 func((ULONG
*) funcptr
+ 1);
1071 Object
*open_button
;
1072 Object
*about_button
;
1073 Object
*quit_button
;
1074 Object
*repeat_button
;
1075 Object
*objects_button
;
1076 Object
*about_item
, *quit_item
;
1077 Object
*context_menu
;
1078 Object
*popobject
, *listview
;
1079 Object
*numerics
[NUMERIC_COUNT
];
1080 Object
*min_string
, *max_string
;
1081 Object
*slider_button
;
1082 Object
*country_radio
[2];
1087 static char *pages
[] =
1088 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
1090 #if defined(TEST_ICONLIST)
1094 static char *text_pages
[] =
1095 {"Text", "String", NULL
};
1096 static char *color_pages
[] =
1097 {"Palette", "Colors", "Pens", NULL
};
1098 static char *list_pages
[] =
1099 {"Single Column", "Multicolumn", NULL
};
1100 static char **radio_entries1
= pages
;
1101 static char *radio_entries2
[] =
1102 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL
};
1104 static IPTR entries
[] = {1, 2, 3, 4, 5, 6, (IPTR
)NULL
};
1106 hook_standard
.h_Entry
= (HOOKFUNC
) hook_func_standard
;
1107 hook_objstr
.h_Entry
= (HOOKFUNC
) ObjStrHook
;
1109 pool
= CreatePool(MEMF_ANY
, 4096, 4096);
1111 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library", 0);
1113 hook
.h_Entry
= (HOOKFUNC
) repeat_function
;
1114 hook_wheel
.h_Entry
= (HOOKFUNC
) wheel_function
;
1115 hook_slider
.h_Entry
= (HOOKFUNC
) slider_function
;
1116 hook_objects
.h_Entry
= (HOOKFUNC
) objects_function
;
1117 hook_compare
.h_Entry
= (HOOKFUNC
) ListCompareHook
;
1118 hook_multitest
.h_Entry
= (HOOKFUNC
) ListMultiTestHook
;
1119 hook_construct
.h_Entry
= (HOOKFUNC
) ListConstructHook
;
1120 hook_destruct
.h_Entry
= (HOOKFUNC
) ListDestructHook
;
1121 hook_display
.h_Entry
= (HOOKFUNC
) display_function
;
1122 list
.destruct_count
= 0;
1123 list
.has_multitest
[3] = TRUE
;
1125 context_menu
= MenustripObject
,
1126 MUIA_Family_Child
, MenuObject
,
1127 MUIA_Menu_Title
, "Menutest",
1128 MUIA_Family_Child
, about_item
= MenuitemObject
,
1129 MUIA_Menuitem_Title
, "First Test Entry", End
,
1130 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1131 MUIA_Menuitem_Title
, "Second Test Entry", End
,
1135 /* should check the result in a real program! */
1136 CL_DropText
= MUI_CreateCustomClass(NULL
, MUIC_Text
, NULL
,
1137 sizeof(struct DropText_Data
), dispatcher
);
1138 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget", 0);
1140 pendisplay
= PendisplayObject
, MUIA_Pendisplay_Spec
, &default_penspec
, End
;
1142 title
= StrDup("Fruits");
1143 list
.lists
[0] = ListviewObject
,
1147 MUIA_List_Title
, title
,
1148 MUIA_List_SourceArray
, fruits
,
1149 MUIA_List_Active
, MUIV_List_Active_Top
,
1150 MUIA_List_PoolThreshSize
, 256,
1151 MUIA_List_DragSortable
, TRUE
,
1152 MUIA_List_CompareHook
, &hook_compare
,
1154 "Default scroller\nTop entry active\nSorted by length",
1156 MUIA_Listview_MultiSelect
,
1157 MUIV_Listview_MultiSelect_None
,
1158 MUIA_Listview_DragType
, MUIV_Listview_DragType_Immediate
,
1159 MUIA_Listview_DoubleClick
, TRUE
,
1162 list
.lists
[1] = ListviewObject
,
1166 MUIA_List_SourceArray
, fruits
,
1167 MUIA_List_Active
, MUIV_List_Active_Bottom
,
1168 MUIA_List_PoolPuddleSize
, 512,
1169 MUIA_List_AutoVisible
, TRUE
,
1171 "Left scroller\nBottom entry active\nSorted alphabetically",
1173 MUIA_Listview_ScrollerPos
,
1174 MUIV_Listview_ScrollerPos_Left
,
1175 MUIA_Listview_DragType
, MUIV_Listview_DragType_None
,
1178 list
.lists
[2] = ListviewObject
,
1182 MUIA_List_SourceArray
, fruits
,
1183 MUIA_List_Active
, MUIV_List_Active_Off
,
1184 MUIA_List_Pool
, pool
,
1186 "Right scroller\nNo active entry\nSorted alphabetically",
1188 MUIA_Listview_MultiSelect
,
1189 MUIV_Listview_MultiSelect_Shifted
,
1190 MUIA_Listview_ScrollerPos
,
1191 MUIV_Listview_ScrollerPos_Right
,
1194 list
.lists
[3] = ListviewObject
,
1198 MUIA_List_SourceArray
, fruits
,
1199 MUIA_List_Pool
, NULL
,
1200 MUIA_List_MultiTestHook
, &hook_multitest
,
1202 "No scroller\nDefault active entry\nSorted alphabetically",
1204 MUIA_Listview_MultiSelect
,
1205 MUIV_Listview_MultiSelect_Always
,
1206 MUIA_Listview_ScrollerPos
,
1207 MUIV_Listview_ScrollerPos_None
,
1210 list
.lists
[4] = ListviewObject
,
1214 MUIA_List_SourceArray
, fruits
,
1215 MUIA_List_Active
, MUIV_List_Active_Bottom
,
1216 MUIA_List_MinLineHeight
, 20,
1218 "Default scroller\nBottom entry active\nSorted by length",
1220 MUIA_Listview_Input
, FALSE
,
1224 list
.colorfield
= ColorfieldObject
,
1225 MUIA_Colorfield_RGB
, default_color
,
1228 app
= ApplicationObject
,
1229 MUIA_Application_Menustrip
, MenustripObject
,
1230 MUIA_Family_Child
, MenuObject
,
1231 MUIA_Menu_Title
, "Project",
1232 MUIA_Family_Child
, about_item
= MenuitemObject
,
1233 MUIA_Menuitem_Title
, "About...",
1234 MUIA_Menuitem_Shortcut
, "?",
1236 MUIA_Family_Child
, MenuitemObject
,
1237 MUIA_Menuitem_Title
, (SIPTR
)-1,
1239 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1240 MUIA_Menuitem_Title
, "Quit",
1241 MUIA_Menuitem_Shortcut
, "Q",
1246 SubWindow
, wnd
= WindowObject
,
1247 MUIA_Window_Title
, "test",
1248 MUIA_Window_Activate
, TRUE
,
1250 WindowContents
, VGroup
,
1251 Child
, RegisterGroup(pages
),
1252 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1257 GroupFrameT("A horizontal group"),
1259 GroupFrameT("A column group"),
1260 Child
, repeat_button
= TextObject
,
1263 MUIA_Background
, MUII_ButtonBack
,
1264 MUIA_Text_PreParse
, "\33c",
1265 MUIA_Text_Contents
, "Repeat",
1266 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1271 MUIA_Background
, MUII_ButtonBack
,
1272 MUIA_Text_PreParse
, "\33c",
1273 MUIA_Text_Contents
, "Drag Me",
1274 MUIA_Draggable
, TRUE
,
1275 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1277 Child
, open_button
= TextObject
,
1280 MUIA_Background
, MUII_ButtonBack
,
1281 MUIA_Text_PreParse
, "\33c",
1282 MUIA_Text_Contents
, "Open Window",
1283 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1286 MUIA_ContextMenu
, context_menu
,
1289 MUIA_Background
, MUII_ButtonBack
,
1290 MUIA_Text_PreParse
, "\33c",
1291 MUIA_Text_Contents
, "Press Right",
1292 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1294 Child
, objects_button
= TextObject
,
1297 MUIA_Background
, MUII_ButtonBack
,
1298 MUIA_Text_PreParse
, "\33c",
1299 MUIA_Text_Contents
, "Add Objects",
1300 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1305 Child
, MUI_MakeObject(MUIO_Checkmark
,
1309 Child
, MUI_MakeObject(MUIO_Label
,
1316 Child
, group
= VGroup
,
1317 GroupFrameT("A vertical group"),
1318 Child
, DropTextObject
,
1319 MUIA_Dropable
, TRUE
,
1322 MUIA_Background
, MUII_ButtonBack
,
1323 MUIA_Text_PreParse
, "\33c",
1324 MUIA_Text_Contents
, "Drop Here",
1325 MUIA_Dropable
, TRUE
,
1326 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1330 MUIA_Background
, MUII_MARKHALFSHINE
,
1332 MUIA_Text_PreParse
, "\33c",
1333 MUIA_Text_Contents
, "Pattern",
1335 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
1337 Child
, ScrollgroupObject
,
1338 GroupFrameT("A scroll group"),
1339 MUIA_Scrollgroup_Contents
, VGroupV
,
1344 "Line1\nLine2\nLine3\nLine4\n"
1345 "Line5\nLine6\nLine7\nLine8\n"
1347 "Line9\nLine10\nLine11\n",
1350 Child
, MUI_MakeObject(MUIO_Button
,
1352 Child
, MUI_MakeObject(MUIO_Button
,
1358 Child
, popobject
= PopobjectObject
,
1359 MUIA_Popstring_String
,
1360 MUI_MakeObject(MUIO_String
, NULL
, 200),
1361 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
1362 MUIA_Popobject_Object
, VGroup
,
1364 MUIA_Text_Contents
, "test",
1366 Child
, listview
= ListviewObject
,
1367 MUIA_Listview_List
, ListObject
,
1369 MUIA_List_ConstructHook
,
1371 MUIA_List_DestructHook
,
1373 MUIA_List_DisplayHook
, &hook_display
,
1374 MUIA_List_Format
, ",,",
1375 MUIA_List_SourceArray
, entries
,
1376 MUIA_List_Title
, TRUE
,
1380 MUIA_Popobject_ObjStrHook
, &hook_objstr
,
1384 MUIA_Cycle_Entries
, pages
,
1386 Child
, ScrollbarObject
,
1387 MUIA_Group_Horiz
, TRUE
,
1388 MUIA_Prop_Visible
, 100,
1389 MUIA_Prop_Entries
, 300,
1390 MUIA_Prop_First
, 50,
1395 Child
, RegisterGroup(text_pages
),
1399 MUIA_Background
, "2:cfffffff,cfffffff,10000000",
1401 MUIA_Text_Contents
, "\33cHello World!\n"
1402 "This is a text object\n\33lLeft \33bbold\33n\n"
1407 /* Test for a bug with pen specifications as reported here:
1408 https://sourceforge.net/p/aros/bugs/487/
1410 MUIA_Text_Contents
, "This is a \33P[3]text \33P[]object \33P[1]with pen specifications",
1412 Child
, RectangleObject
,
1414 /* Seems to be not supported properly as orginal MUI
1415 doesn't allow to alter the height of the window */
1416 MUIA_Rectangle_HBar
, TRUE
,
1417 MUIA_Rectangle_BarTitle
,"Enter a string",
1419 Child
, StringObject
,
1422 MUIA_String_AdvanceOnCR
, TRUE
,
1430 Child
, VGroup
, GroupFrameT("Default Alignment"),
1431 Child
, string
.strings
[0] = StringObject
,
1434 (IPTR
)default_accept_chars
,
1436 (IPTR
)default_reject_chars
,
1437 MUIA_String_AdvanceOnCR
, TRUE
,
1438 MUIA_String_MaxLen
, 9,
1440 MUIA_String_AttachedList
, list
.lists
[0],
1443 Child
, VGroup
, GroupFrameT("Left Aligned"),
1444 Child
, string
.strings
[1] = StringObject
,
1447 (IPTR
)default_accept_chars
,
1449 (IPTR
)default_reject_chars
,
1451 MUIV_String_Format_Left
,
1452 MUIA_String_AdvanceOnCR
, TRUE
,
1453 MUIA_String_MaxLen
, 9,
1455 MUIA_String_Contents
,
1456 (IPTR
)default_accept_chars
,
1457 MUIA_String_BufferPos
, 3,
1458 MUIA_String_AttachedList
, list
.lists
[0],
1461 Child
, VGroup
, GroupFrameT("Right Aligned"),
1462 Child
, string
.strings
[2] = StringObject
,
1465 (IPTR
)default_accept_chars
,
1467 (IPTR
)default_reject_chars
,
1469 MUIV_String_Format_Right
,
1470 MUIA_String_AdvanceOnCR
, TRUE
,
1471 MUIA_String_MaxLen
, 9,
1473 MUIA_String_AttachedList
, list
.lists
[0],
1476 Child
, VGroup
, GroupFrameT("Centered"),
1477 Child
, string
.strings
[3] = StringObject
,
1480 (IPTR
)default_accept_chars
,
1482 (IPTR
)default_reject_chars
,
1484 MUIV_String_Format_Center
,
1485 MUIA_String_AdvanceOnCR
, TRUE
,
1486 MUIA_String_MaxLen
, 9,
1488 MUIA_String_Integer
, 123,
1489 MUIA_String_AttachedList
, list
.lists
[0],
1492 Child
, VGroup
, GroupFrameT("Secret"),
1493 Child
, string
.strings
[4] = StringObject
,
1496 (IPTR
)default_accept_chars
,
1498 (IPTR
)default_reject_chars
,
1500 MUIV_String_Format_Center
,
1501 MUIA_String_Secret
, TRUE
,
1502 MUIA_String_AdvanceOnCR
, TRUE
,
1503 MUIA_String_MaxLen
, 9,
1505 MUIA_String_AttachedList
, list
.lists
[0],
1508 Child
, HGroup
, GroupFrameT("Narrow"),
1510 Child
, string
.strings
[5] = StringObject
,
1513 (IPTR
)default_accept_chars
,
1515 (IPTR
)default_reject_chars
,
1517 MUIV_String_Format_Center
,
1518 MUIA_String_AdvanceOnCR
, TRUE
,
1520 MUIA_String_MaxLen
, 9,
1522 MUIA_String_AttachedList
, list
.lists
[0],
1528 Child
, VGroup
, GroupFrameT("Controls"),
1530 Child
, string
.accept_all_check
=
1531 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1532 Child
, MUI_MakeObject(MUIO_Label
,
1533 "Accept all characters", 0),
1537 Child
, MUI_MakeObject(MUIO_Label
,
1538 "Acceptable characters:", 0),
1539 Child
, string
.accept_string
= StringObject
,
1541 MUIA_String_Contents
,
1542 (IPTR
)default_accept_chars
,
1544 Child
, MUI_MakeObject(MUIO_Label
,
1545 "Unacceptable characters:", 0),
1546 Child
, string
.reject_string
= StringObject
,
1549 Child
, MUI_MakeObject(MUIO_Label
,
1550 "Cursor position:", 0),
1551 Child
, string
.cursor_pos_slider
=
1553 MUIA_Group_Horiz
, TRUE
,
1554 MUIA_Numeric_Min
, 0,
1556 Child
, MUI_MakeObject(MUIO_Label
,
1557 "Display position:", 0),
1558 Child
, string
.display_pos_slider
=
1560 MUIA_Group_Horiz
, TRUE
,
1561 MUIA_Numeric_Min
, 0,
1563 Child
, MUI_MakeObject(MUIO_Label
,
1564 "Integer value:", 0),
1565 Child
, string
.integer_string
=
1568 MUIA_String_Accept
, (IPTR
)digits
,
1570 Child
, MUI_MakeObject(MUIO_Label
,
1572 Child
, string
.plaintext_string
=
1576 Child
, MUI_MakeObject(MUIO_Label
,
1577 "Maximum string length:", 0),
1578 Child
, string
.max_len_text
= TextObject
,
1580 MUIA_Text_Contents
, "Unknown",
1585 Child
, string
.cr_advance_check
=
1586 MUI_MakeObject(MUIO_Checkmark
,
1588 Child
, MUI_MakeObject(MUIO_Label
,
1589 "Advance on CR", 0),
1593 Child
, string
.attach_list_check
=
1594 MUI_MakeObject(MUIO_Checkmark
,
1596 Child
, MUI_MakeObject(MUIO_Label
,
1602 Child
, string
.standard_hook_check
=
1603 MUI_MakeObject(MUIO_Checkmark
,
1605 Child
, MUI_MakeObject(MUIO_Label
,
1606 "Use standard edit hook", 0),
1610 Child
, string
.custom_hook_check
=
1611 MUI_MakeObject(MUIO_Checkmark
,
1613 Child
, MUI_MakeObject(MUIO_Label
,
1614 "Use custom edit hook", 0),
1627 Child
, wheel
= BoopsiObject
, /* MUI/Boopsi tags mixed */
1629 /* boopsi objects don't know */
1630 /* their sizes, so we help */
1631 /* keep important values */
1632 /* during window resize */
1633 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
1634 MUIA_Boopsi_MinWidth
, 30,
1635 MUIA_Boopsi_MinHeight
, 30,
1636 MUIA_Boopsi_Remember
, WHEEL_Saturation
,
1637 MUIA_Boopsi_Remember
, WHEEL_Hue
,
1638 /* this magic fills in the screen pointer */
1639 MUIA_Boopsi_TagScreen
, WHEEL_Screen
,
1642 GA_Top
, 0, /* MUI will automatically */
1643 GA_Width
, 0, /* fill in the correct values */
1645 ICA_TARGET
, ICTARGET_IDCMP
,
1646 /* needed for notification */
1647 WHEEL_Saturation
, 0, /* start in the center */
1648 MUIA_FillArea
, TRUE
,
1649 /* use this because it defaults to FALSE
1650 for boopsi gadgets but the colorwheel
1651 doesn't bother about redrawing its
1655 Child
, r_slider
= SliderObject
,
1656 MUIA_Group_Horiz
, TRUE
,
1657 MUIA_Numeric_Min
, 0,
1658 MUIA_Numeric_Max
, 255,
1660 Child
, g_slider
= SliderObject
,
1661 MUIA_Group_Horiz
, TRUE
,
1662 MUIA_Numeric_Min
, 0,
1663 MUIA_Numeric_Max
, 255,
1665 Child
, b_slider
= SliderObject
,
1666 MUIA_Group_Horiz
, TRUE
,
1667 MUIA_Numeric_Min
, 0,
1668 MUIA_Numeric_Max
, 255,
1670 Child
, hue_gauge
= GaugeObject
,
1672 MUIA_Gauge_Horiz
, TRUE
,
1673 MUIA_Gauge_Max
, 255,
1674 MUIA_Gauge_Divide
, 1<<24,
1675 MUIA_Gauge_InfoText
, "Hue: %ld",
1680 Child
, RegisterGroup(color_pages
),
1681 Child
, VGroup
, GroupFrameT("Palette"),
1682 Child
, PaletteObject
,
1686 Child
, VGroup
, GroupFrameT("Colorfield"),
1689 Child
, colorfield
= ColorfieldObject
,
1690 MUIA_Colorfield_RGB
, default_color
,
1691 MUIA_Colorfield_Pen
, 253,
1693 Child
, colorfield2
= ColorfieldObject
,
1694 MUIA_Colorfield_Red
, default_color
[0],
1695 MUIA_Colorfield_Green
, default_color
[1],
1696 MUIA_Colorfield_Blue
, default_color
[2],
1699 Child
, colorfield_reset_button
=
1700 MUI_MakeObject(MUIO_Button
,
1704 MUI_MakeObject(MUIO_Label
, "Pen:", 0),
1705 Child
, colorfield_pen
= StringObject
,
1710 Child
, VGroup
, GroupFrameT("Coloradjust"),
1711 Child
, coloradjust
= ColoradjustObject
,
1712 MUIA_Coloradjust_RGB
, default_color
,
1718 Child
, VGroup
, GroupFrameT("Pendisplay"),
1721 Child
, pendisplay2
= PendisplayObject
,
1722 MUIA_Pendisplay_RGBcolor
,
1729 MUIO_Label
, "Pen:", 0),
1731 Child
, pendisplay_pen
=
1732 StringObject
, StringFrame
,
1735 Child
, reference_check
=
1736 MUI_MakeObject(MUIO_Checkmark
,
1738 Child
, MUI_MakeObject(MUIO_Label
,
1743 MUIO_Label
, "Penspec:", 0),
1744 Child
, pendisplay_spec
= StringObject
,
1749 Child
, shine_button
=
1750 MUI_MakeObject(MUIO_Button
,
1752 Child
, shadow_button
=
1753 MUI_MakeObject(MUIO_Button
,
1755 Child
, yellow_button
=
1756 MUI_MakeObject(MUIO_Button
,
1760 Child
, VGroup
, GroupFrameT("Poppen"),
1761 Child
, poppen
= PoppenObject
,
1765 Child
, VGroup
, GroupFrameT("Penadjust"),
1766 Child
, PenadjustObject
,
1774 Child
, editor_text
= StringObject
,
1777 Child
, PopaslObject
,
1778 ASLFR_DoSaveMode
, TRUE
,
1779 MUIA_Popstring_String
, filename_string
=
1780 MUI_MakeObject(MUIO_String
, NULL
, 200),
1781 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
1783 Child
, save_button
=
1784 MUI_MakeObject(MUIO_Button
, "Save"),
1788 Child
, RegisterGroup(list_pages
),
1790 Child
, ColGroup(LIST_COUNT
),
1791 Child
, VGroup
, GroupFrameT("No Multiselect"),
1792 Child
, list
.lists
[0],
1795 GroupFrameT("Default Multiselect"),
1796 Child
, list
.lists
[1],
1799 GroupFrameT("Shifted Multiselect"),
1800 Child
, list
.lists
[2],
1803 GroupFrameT("Unconditional Multiselect"),
1804 Child
, list
.lists
[3],
1807 GroupFrameT("Read Only"),
1808 Child
, list
.lists
[4],
1812 MUIA_Group_HorizSpacing
, 0,
1813 Child
, RectangleObject
,
1814 MUIA_HorizWeight
, 1,
1816 Child
, list
.list_radios
= RadioObject
,
1817 MUIA_Radio_Entries
, empty
,
1818 MUIA_Group_Horiz
, TRUE
,
1819 MUIA_HorizWeight
, 1000,
1821 Child
, RectangleObject
,
1822 MUIA_HorizWeight
, 1,
1825 Child
, RectangleObject
,
1827 MUIA_Rectangle_HBar
, TRUE
,
1828 MUIA_Rectangle_BarTitle
, "List Controls",
1831 Child
, MUI_MakeObject(MUIO_Label
,
1832 "Affected index 1:", 0),
1833 Child
, list
.index1_string
=
1836 MUIA_String_Accept
, (IPTR
)digits
,
1837 MUIA_String_Integer
, 0,
1840 Child
, list
.draggable_check
=
1841 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1842 Child
, MUI_MakeObject(MUIO_Label
,
1847 Child
, list
.showdropmarks_check
=
1848 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1849 Child
, MUI_MakeObject(MUIO_Label
,
1850 "Show drop marks", 0),
1854 Child
, list
.autovisible_check
=
1855 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1856 Child
, MUI_MakeObject(MUIO_Label
,
1860 Child
, list
.reset_button
=
1861 MUI_MakeObject(MUIO_Button
, "Reset"),
1863 Child
, MUI_MakeObject(MUIO_Label
,
1864 "Affected index 2:", 0),
1865 Child
, list
.index2_string
=
1868 MUIA_String_Accept
, (IPTR
)digits
,
1869 MUIA_String_Integer
, 0,
1872 Child
, list
.dragsortable_check
=
1873 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1874 Child
, MUI_MakeObject(MUIO_Label
,
1875 "Drag sortable", 0),
1879 Child
, list
.multitest_check
=
1880 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1881 Child
, MUI_MakeObject(MUIO_Label
,
1882 "Filter multiselect", 0),
1886 Child
, list
.quiet_check
=
1887 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1888 Child
, MUI_MakeObject(MUIO_Label
,
1892 Child
, list
.enable_button
=
1893 MUI_MakeObject(MUIO_Button
, "Enable"),
1895 Child
, MUI_MakeObject(MUIO_Label
,
1896 "Move/exchange mode 1:", 0),
1897 Child
, list
.move1_cycle
= CycleObject
,
1899 MUIA_Cycle_Entries
, list_move1_modes
,
1901 Child
, list
.move_button
=
1902 MUI_MakeObject(MUIO_Button
, "Move"),
1903 Child
, list
.sort_button
=
1904 MUI_MakeObject(MUIO_Button
, "Sort"),
1905 Child
, MUI_MakeObject(MUIO_Label
,
1907 Child
, list
.title_string
=
1912 Child
, MUI_MakeObject(MUIO_Label
,
1913 "Move/exchange mode 2:", 0),
1914 Child
, list
.move2_cycle
= CycleObject
,
1916 MUIA_Cycle_Entries
, list_move2_modes
,
1918 Child
, list
.exchange_button
=
1919 MUI_MakeObject(MUIO_Button
, "Exchange"),
1920 Child
, list
.redraw_button
=
1921 MUI_MakeObject(MUIO_Button
, "Redraw"),
1922 Child
, MUI_MakeObject(MUIO_Label
,
1924 Child
, list
.entries_text
= TextObject
,
1926 MUIA_Text_Contents
, "N/A",
1929 Child
, MUI_MakeObject(MUIO_Label
,
1931 Child
, list
.jump_cycle
= CycleObject
,
1933 MUIA_Cycle_Entries
, list_jump_modes
,
1935 Child
, list
.jump_button
=
1936 MUI_MakeObject(MUIO_Button
, "Jump"),
1937 Child
, list
.toggle_button
=
1938 MUI_MakeObject(MUIO_Button
, "Toggle"),
1939 Child
, MUI_MakeObject(MUIO_Label
,
1940 "Visible entries:", 0),
1941 Child
, list
.visible_text
= TextObject
,
1943 MUIA_Text_Contents
, "N/A",
1946 Child
, MUI_MakeObject(MUIO_Label
,
1947 "Select/redraw mode:", 0),
1948 Child
, list
.select_cycle
= CycleObject
,
1950 MUIA_Cycle_Entries
, list_select_modes
,
1952 Child
, list
.select_button
=
1953 MUI_MakeObject(MUIO_Button
, "Select"),
1954 Child
, list
.deselect_button
=
1955 MUI_MakeObject(MUIO_Button
, "Deselect"),
1956 Child
, MUI_MakeObject(MUIO_Label
,
1957 "First visible index:", 0),
1958 Child
, list
.first_text
= TextObject
,
1960 MUIA_Text_Contents
, "N/A",
1963 Child
, MUI_MakeObject(MUIO_Label
,
1965 Child
, list
.insert_cycle
= CycleObject
,
1967 MUIA_Cycle_Entries
, list_insert_modes
,
1969 Child
, list
.insert_single_button
=
1970 MUI_MakeObject(MUIO_Button
,
1972 Child
, list
.insert_multiple_button
=
1973 MUI_MakeObject(MUIO_Button
,
1975 Child
, MUI_MakeObject(MUIO_Label
,
1976 "Last insertion index:", 0),
1977 Child
, list
.insert_text
= TextObject
,
1979 MUIA_Text_Contents
, "N/A",
1982 Child
, MUI_MakeObject(MUIO_Label
,
1984 Child
, list
.remove_cycle
= CycleObject
,
1986 MUIA_Cycle_Entries
, list_remove_modes
,
1988 Child
, list
.remove_button
=
1989 MUI_MakeObject(MUIO_Button
, "Remove"),
1990 Child
, list
.clear_button
=
1991 MUI_MakeObject(MUIO_Button
, "Clear"),
1992 Child
, MUI_MakeObject(MUIO_Label
,
1993 "Active index:", 0),
1994 Child
, list
.active_text
= TextObject
,
1996 MUIA_Text_Contents
, "N/A",
1999 Child
, MUI_MakeObject(MUIO_Label
,
2000 "Activate mode:", 0),
2001 Child
, list
.activate_cycle
= CycleObject
,
2003 MUIA_Cycle_Entries
, list_activate_modes
,
2005 Child
, list
.activate_button
=
2006 MUI_MakeObject(MUIO_Button
, "Activate"),
2007 Child
, list
.deactivate_button
=
2008 MUI_MakeObject(MUIO_Button
, "Deactivate"),
2009 Child
, MUI_MakeObject(MUIO_Label
,
2010 "Selected entries:", 0),
2011 Child
, list
.selected_text
= TextObject
,
2013 MUIA_Text_Contents
, "N/A",
2020 Child
, MUI_MakeObject(MUIO_Label
,
2021 "Last drop index:", 0),
2022 Child
, list
.drop_text
= TextObject
,
2024 MUIA_Text_Contents
, "N/A",
2029 Child
, ColGroup(MULTI_LIST_COUNT
),
2030 Child
, VGroup
, GroupFrameT("Standard Format"),
2031 Child
, list
.multi_lists
[0] = ListviewObject
,
2035 MUIA_List_ConstructHook
,
2037 MUIA_List_DestructHook
,
2039 MUIA_List_DisplayHook
,
2041 MUIA_List_Format
, list_format
,
2042 MUIA_List_SourceArray
, entries
,
2043 MUIA_List_Title
, TRUE
,
2044 MUIA_List_AdjustWidth
, TRUE
,
2046 MUIA_Listview_MultiSelect
,
2047 MUIV_Listview_MultiSelect_None
,
2048 MUIA_Listview_DefClickColumn
, 1,
2052 Child
, VGroup
, GroupFrameT("Custom Format"),
2053 Child
, list
.multi_lists
[1] = ListviewObject
,
2057 MUIA_List_Format
, list_format
,
2058 MUIA_List_Title
, TRUE
,
2059 MUIA_List_AdjustHeight
, TRUE
,
2061 MUIA_Listview_MultiSelect
,
2062 MUIV_Listview_MultiSelect_None
,
2068 Child
, RectangleObject
,
2070 MUIA_Rectangle_HBar
, TRUE
,
2071 MUIA_Rectangle_BarTitle
, "List Controls",
2074 Child
, MUI_MakeObject(MUIO_Label
, "Format:", 0),
2075 Child
, list
.format_string
= StringObject
,
2079 Child
, list
.showheadings_check
=
2080 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2081 Child
, MUI_MakeObject(MUIO_Label
,
2082 "Show column headings", 0),
2083 Child
, list
.showimage_check
=
2084 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2085 Child
, MUI_MakeObject(MUIO_Label
,
2089 Child
, MUI_MakeObject(MUIO_Label
,
2090 "Default clicked column:", 0),
2091 Child
, list
.def_column_string
= StringObject
,
2093 MUIA_String_Accept
, (IPTR
)digits
,
2094 MUIA_String_Integer
, -1,
2097 Child
, MUI_MakeObject(MUIO_Label
,
2098 "Clicked column:", 0),
2099 Child
, list
.column_string
= StringObject
,
2102 Child
, list
.column_text
= TextObject
,
2104 MUIA_Text_Contents
, "N/A",
2117 MUIA_Gauge_InfoText
, "%ld %%",
2118 MUIA_Gauge_Horiz
, TRUE
,
2119 MUIA_Gauge_Current
, 25,
2128 MUIA_Gauge_InfoText
, "%ld %%",
2129 MUIA_Gauge_Horiz
, TRUE
,
2130 MUIA_Gauge_Current
, 50,
2139 MUIA_Gauge_InfoText
, "%ld %%",
2140 MUIA_Gauge_Horiz
, TRUE
,
2141 MUIA_Gauge_Current
, 75,
2151 MUIA_Gauge_InfoText
, "%ld %%",
2152 MUIA_Gauge_Current
, 25,
2156 MUIA_Gauge_InfoText
, "%ld %%",
2157 MUIA_Gauge_Current
, 50,
2161 MUIA_Gauge_InfoText
, "%ld %%",
2162 MUIA_Gauge_Current
, 75,
2171 GroupFrameT("Horizontal Sliders"),
2172 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
2173 Child
, numerics
[HNSLIDER
] = SliderObject
,
2174 MUIA_Slider_Horiz
, TRUE
,
2175 MUIA_Numeric_Min
, NUMERIC_MIN
,
2176 MUIA_Numeric_Max
, NUMERIC_MAX
,
2179 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
2180 Child
, numerics
[HRSLIDER
] = SliderObject
,
2181 MUIA_Numeric_Reverse
, TRUE
,
2182 MUIA_Numeric_Min
, NUMERIC_MIN
,
2183 MUIA_Numeric_Max
, NUMERIC_MAX
,
2186 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
2187 Child
, numerics
[HQSLIDER
] = SliderObject
,
2188 MUIA_Slider_Quiet
, TRUE
,
2189 MUIA_Numeric_Min
, NUMERIC_MIN
,
2190 MUIA_Numeric_Max
, NUMERIC_MAX
,
2195 GroupFrameT("Vertical Sliders"),
2196 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2197 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2198 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
2199 Child
, numerics
[VNSLIDER
] = SliderObject
,
2200 MUIA_Slider_Horiz
, FALSE
,
2201 MUIA_Numeric_Min
, NUMERIC_MIN
,
2202 MUIA_Numeric_Max
, NUMERIC_MAX
,
2205 Child
, numerics
[VRSLIDER
] = SliderObject
,
2206 MUIA_Slider_Horiz
, FALSE
,
2207 MUIA_Numeric_Reverse
, TRUE
,
2208 MUIA_Numeric_Min
, NUMERIC_MIN
,
2209 MUIA_Numeric_Max
, NUMERIC_MAX
,
2212 Child
, numerics
[VQSLIDER
] = SliderObject
,
2213 MUIA_Slider_Horiz
, FALSE
,
2214 MUIA_Slider_Quiet
, TRUE
,
2215 MUIA_Numeric_Min
, NUMERIC_MIN
,
2216 MUIA_Numeric_Max
, NUMERIC_MAX
,
2221 GroupFrameT("Numeric Buttons"),
2222 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
2223 Child
, numerics
[NNUMERICBUTTON
] =
2224 NumericbuttonObject
,
2225 MUIA_Numeric_Min
, NUMERIC_MIN
,
2226 MUIA_Numeric_Max
, NUMERIC_MAX
,
2229 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
2230 Child
, numerics
[RNUMERICBUTTON
] =
2231 NumericbuttonObject
,
2232 MUIA_Numeric_Reverse
, TRUE
,
2233 MUIA_Numeric_Min
, NUMERIC_MIN
,
2234 MUIA_Numeric_Max
, NUMERIC_MAX
,
2239 GroupFrameT("Knobs"),
2240 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2241 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2242 Child
, numerics
[NKNOB
] = KnobObject
,
2243 MUIA_Numeric_Min
, NUMERIC_MIN
,
2244 MUIA_Numeric_Max
, NUMERIC_MAX
,
2247 Child
, numerics
[RKNOB
] = KnobObject
,
2248 MUIA_Numeric_Reverse
, TRUE
,
2249 MUIA_Numeric_Min
, NUMERIC_MIN
,
2250 MUIA_Numeric_Max
, NUMERIC_MAX
,
2255 Child
, MUI_MakeObject(MUIO_Label
,
2256 "Minimum Value:", 0),
2257 Child
, min_string
= (Object
*)StringObject
,
2259 MUIA_String_Accept
, (IPTR
)digits
,
2260 MUIA_String_Integer
, NUMERIC_MIN
,
2263 Child
, MUI_MakeObject(MUIO_Label
,
2264 "Maximum Value:", 0),
2265 Child
, max_string
= (Object
*)StringObject
,
2267 MUIA_String_Accept
, (IPTR
)digits
,
2268 MUIA_String_Integer
, NUMERIC_MAX
,
2271 Child
, slider_button
= TextObject
,
2273 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2275 MUIA_Background
, MUII_ButtonBack
,
2276 MUIA_Text_PreParse
, "\33c",
2278 "Change Slider Orientations",
2280 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
2289 MUIA_Radio_Entries
, radio_entries1
,
2291 Child
, country_radio
[0] = RadioObject
,
2293 MUIA_Radio_Entries
, radio_entries2
,
2294 MUIA_Radio_Active
, 1,
2300 MUIA_Radio_Entries
, radio_entries1
,
2302 Child
, country_radio
[1] = RadioObject
,
2304 MUIA_Radio_Entries
, radio_entries2
,
2305 MUIA_Radio_Active
, 1,
2310 #if defined(TEST_ICONLIST)
2313 Child
, volume_iconlist
=
2314 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
2316 Child
, drawer_iconlist
=
2317 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
2318 MUIA_IconDrawerList_Drawer
, "SYS:",
2325 Child
, create_balance_column(),
2326 Child
, BalanceObject
,
2329 Child
, create_balance_column(),
2330 Child
, BalanceObject
,
2333 Child
, create_balance_column(),
2334 Child
, BalanceObject
,
2337 Child
, create_balance_column(),
2338 Child
, BalanceObject
,
2341 Child
, create_balance_column(),
2348 Child
, about_button
= TextObject
,
2350 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2352 MUIA_Background
, MUII_ButtonBack
,
2353 MUIA_Text_PreParse
, "\33c",
2354 MUIA_Text_Contents
, "About",
2356 Child
, quit_button
= TextObject
,
2358 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2360 MUIA_Background
, MUII_ButtonBack
,
2361 MUIA_ControlChar
, 'q',
2362 MUIA_Text_HiChar
, 'q',
2363 MUIA_Text_PreParse
, "\33c",
2364 MUIA_Text_Contents
, "Quit",
2370 SubWindow
, second_wnd
= WindowObject
,
2371 MUIA_Window_Title
, "Second window",
2372 WindowContents
, VGroup
,
2373 Child
, DropTextObject
,
2374 MUIA_Text_Contents
, "Drop here",
2375 MUIA_Dropable
, TRUE
,
2386 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
2387 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2388 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
2389 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
2390 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
,
2391 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
2392 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2393 MUIM_Application_AboutMUI
, NULL
);
2394 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2395 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2396 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2397 MUIM_CallHook
, &hook_objects
);
2398 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
2399 app
, 2, MUIM_CallHook
, &hook
);
2401 /* Notifications and set-up for string objects */
2402 DoMethod(string
.max_len_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
2403 "%ld", XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2404 set(string
.cursor_pos_slider
, MUIA_Numeric_Max
,
2405 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2406 set(string
.display_pos_slider
, MUIA_Numeric_Max
,
2407 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2408 set(string
.cr_advance_check
, MUIA_Selected
, TRUE
);
2409 set(string
.attach_list_check
, MUIA_Selected
, TRUE
);
2410 set(string
.strings
[1], MUIA_Disabled
,
2411 XGET(string
.strings
[1], MUIA_String_Format
)
2412 != MUIV_String_Format_Left
);
2413 set(string
.strings
[2], MUIA_Disabled
,
2414 XGET(string
.strings
[2], MUIA_String_Format
)
2415 != MUIV_String_Format_Right
);
2416 set(string
.strings
[3], MUIA_Disabled
,
2417 XGET(string
.strings
[3], MUIA_String_Format
)
2418 != MUIV_String_Format_Center
);
2419 set(string
.strings
[4], MUIA_Disabled
,
2420 !XGET(string
.strings
[4], MUIA_String_Secret
));
2421 set(string
.strings
[0], MUIA_String_MaxLen
, 100);
2422 set(string
.reject_string
, MUIA_String_Contents
,
2423 (IPTR
)default_reject_chars
);
2425 for (i
= 0; i
< STRING_COUNT
; i
++)
2429 DoMethod(string
.accept_string
, MUIM_Notify
,
2430 MUIA_String_Contents
, MUIV_EveryTime
, string
.strings
[i
],
2431 3, MUIM_Set
, MUIA_String_Accept
, MUIV_TriggerValue
);
2432 DoMethod(string
.cr_advance_check
, MUIM_Notify
, MUIA_Selected
,
2433 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2434 MUIA_String_AdvanceOnCR
, MUIV_TriggerValue
);
2435 DoMethod(string
.cursor_pos_slider
, MUIM_Notify
,
2436 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2437 MUIM_Set
, MUIA_String_BufferPos
, MUIV_TriggerValue
);
2438 DoMethod(string
.display_pos_slider
, MUIM_Notify
,
2439 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2440 MUIM_Set
, MUIA_String_DisplayPos
, MUIV_TriggerValue
);
2441 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2442 TRUE
, string
.strings
[i
], 3, MUIM_Set
,
2443 MUIA_String_AttachedList
, list
.lists
[0]);
2444 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2445 FALSE
, string
.strings
[i
], 3, MUIM_Set
,
2446 MUIA_String_AttachedList
, NULL
);
2450 DoMethod(string
.strings
[0], MUIM_Notify
, MUIA_String_Accept
,
2451 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2452 MUIA_String_Accept
, MUIV_TriggerValue
);
2453 DoMethod(string
.strings
[0], MUIM_Notify
,
2454 MUIA_String_AdvanceOnCR
, MUIV_EveryTime
,
2455 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_AdvanceOnCR
,
2457 DoMethod(string
.strings
[0], MUIM_Notify
,
2458 MUIA_String_BufferPos
, MUIV_EveryTime
,
2459 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_BufferPos
,
2461 DoMethod(string
.strings
[0], MUIM_Notify
,
2462 MUIA_String_DisplayPos
, MUIV_EveryTime
,
2463 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_DisplayPos
,
2465 DoMethod(string
.strings
[0], MUIM_Notify
,
2466 MUIA_String_AttachedList
, MUIV_EveryTime
,
2467 string
.strings
[i
], 3, MUIM_Set
,
2468 MUIA_String_AttachedList
, MUIV_TriggerValue
);
2470 DoMethod(string
.reject_string
, MUIM_Notify
, MUIA_String_Contents
,
2471 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2472 MUIA_String_Reject
, MUIV_TriggerValue
);
2473 DoMethod(string
.strings
[i
], MUIM_Notify
, MUIA_String_Integer
,
2474 MUIV_EveryTime
, string
.integer_string
, 3, MUIM_NoNotifySet
,
2475 MUIA_String_Integer
, MUIV_TriggerValue
);
2476 DoMethod(string
.integer_string
, MUIM_Notify
, MUIA_String_Integer
,
2477 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_NoNotifySet
,
2478 MUIA_String_Integer
, MUIV_TriggerValue
);
2480 DoMethod(string
.accept_all_check
, MUIM_Notify
, MUIA_Selected
,
2481 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2482 ChangeStringAccept
);
2483 DoMethod(string
.strings
[4], MUIM_Notify
, MUIA_String_Acknowledge
,
2484 MUIV_EveryTime
, string
.plaintext_string
, 3, MUIM_NoNotifySet
,
2485 MUIA_String_Contents
, MUIV_TriggerValue
);
2486 DoMethod(string
.plaintext_string
, MUIM_Notify
,
2487 MUIA_String_Acknowledge
, MUIV_EveryTime
, string
.strings
[4], 3,
2488 MUIM_NoNotifySet
, MUIA_String_Contents
, MUIV_TriggerValue
);
2490 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
2491 MUIM_CallHook
, &hook_wheel
);
2492 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
2493 2, MUIM_CallHook
, &hook_wheel
);
2494 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2495 app
, 2, MUIM_CallHook
, &hook_slider
);
2496 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2497 app
, 2, MUIM_CallHook
, &hook_slider
);
2498 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2499 app
, 2, MUIM_CallHook
, &hook_slider
);
2501 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
2502 MUIM_CallHook
, &hook_standard
, Save
);
2504 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2505 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
2506 MUIV_Application_ReturnID_Quit
);
2507 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2508 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2511 /* Notifications for color objects */
2512 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Red
,
2513 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2515 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Green
,
2516 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2518 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Blue
,
2519 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2521 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Red
,
2522 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2524 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Green
,
2525 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2527 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Blue
,
2528 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2530 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Pen
,
2531 MUIV_EveryTime
, colorfield_pen
, 3, MUIM_Set
,
2532 MUIA_String_Integer
, MUIV_TriggerValue
);
2533 DoMethod(colorfield_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2534 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2536 DoMethod(colorfield_reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2537 colorfield
, 3, MUIM_Set
, MUIA_Colorfield_RGB
, default_color
);
2539 /* Notifications for pen objects */
2540 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Pen
,
2541 MUIV_EveryTime
, pendisplay_pen
, 3, MUIM_NoNotifySet
,
2542 MUIA_String_Integer
, MUIV_TriggerValue
);
2543 DoMethod(pendisplay_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2544 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2545 ChangePendisplayPen
);
2546 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Spec
,
2547 MUIV_EveryTime
, pendisplay_spec
, 3, MUIM_Set
,
2548 MUIA_String_Contents
, MUIV_TriggerValue
);
2549 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_RGB
,
2550 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
,
2551 MUIA_Pendisplay_RGBcolor
, MUIV_TriggerValue
);
2552 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_RGBcolor
,
2553 MUIV_EveryTime
, poppen
, 3, MUIM_Set
, MUIA_Pendisplay_RGBcolor
,
2555 DoMethod(pendisplay_spec
, MUIM_Notify
, MUIA_String_Contents
,
2556 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
, MUIA_Pendisplay_Spec
,
2558 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, TRUE
,
2559 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, pendisplay
);
2560 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, FALSE
,
2561 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, NULL
);
2562 DoMethod(shine_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2563 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHINE
);
2564 DoMethod(shadow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2565 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHADOW
);
2566 DoMethod(yellow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2567 4, MUIM_Pendisplay_SetRGB
, 0xffffffff, 0xffffffff, 0);
2569 /* Notifications and set-up for list objects */
2570 set(list
.showdropmarks_check
, MUIA_Selected
, TRUE
);
2572 for (i
= 0; i
< LIST_COUNT
; i
++)
2574 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2575 MUIV_EveryTime
, list
.lists
[i
], 3, MUIM_Set
, MUIA_Disabled
,
2577 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Entries
,
2578 MUIV_EveryTime
, list
.entries_text
, 4, MUIM_SetAsString
,
2579 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2580 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Visible
,
2581 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2583 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_First
,
2584 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2586 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_InsertPosition
,
2587 MUIV_EveryTime
, list
.insert_text
, 4, MUIM_SetAsString
,
2588 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2589 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Active
,
2590 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2592 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_SelectChange
,
2593 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2596 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2597 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2599 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2600 MUIV_EveryTime
, list
.dragsortable_check
, 3, MUIM_Set
,
2601 MUIA_Disabled
, MUIV_NotTriggerValue
);
2602 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2603 FALSE
, list
.dragsortable_check
, 3, MUIM_Set
,
2604 MUIA_Selected
, FALSE
);
2605 DoMethod(list
.showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
2606 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2607 ListSetShowDropMarks
);
2608 DoMethod(list
.multitest_check
, MUIM_Notify
, MUIA_Selected
,
2609 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2611 DoMethod(list
.quiet_check
, MUIM_Notify
, MUIA_Selected
,
2612 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2614 DoMethod(list
.dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
2615 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2616 ListSetDragSortable
);
2617 DoMethod(list
.autovisible_check
, MUIM_Notify
, MUIA_Selected
,
2618 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2619 ListSetAutoVisible
);
2620 DoMethod(list
.reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2621 app
, 3, MUIM_CallHook
, &hook_standard
, ListReset
);
2622 DoMethod(list
.move_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2623 app
, 3, MUIM_CallHook
, &hook_standard
, ListMove
);
2624 DoMethod(list
.sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2625 app
, 3, MUIM_CallHook
, &hook_standard
, ListSort
);
2626 DoMethod(list
.enable_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2627 app
, 3, MUIM_CallHook
, &hook_standard
, ListEnable
);
2628 DoMethod(list
.exchange_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2629 app
, 3, MUIM_CallHook
, &hook_standard
, ListExchange
);
2630 DoMethod(list
.jump_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2631 app
, 3, MUIM_CallHook
, &hook_standard
, ListJump
);
2632 DoMethod(list
.select_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2633 app
, 3, MUIM_CallHook
, &hook_standard
, ListSelect
);
2634 DoMethod(list
.deselect_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2635 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeselect
);
2636 DoMethod(list
.toggle_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2637 app
, 3, MUIM_CallHook
, &hook_standard
, ListToggle
);
2638 DoMethod(list
.redraw_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2639 app
, 3, MUIM_CallHook
, &hook_standard
, ListRedraw
);
2640 DoMethod(list
.insert_single_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2641 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsertSingle
);
2642 DoMethod(list
.insert_multiple_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2643 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsert
);
2644 DoMethod(list
.remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2645 app
, 3, MUIM_CallHook
, &hook_standard
, ListRemove
);
2646 DoMethod(list
.clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2647 app
, 3, MUIM_CallHook
, &hook_standard
, ListClear
);
2648 DoMethod(list
.activate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2649 app
, 3, MUIM_CallHook
, &hook_standard
, ListActivate
);
2650 DoMethod(list
.deactivate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2651 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeactivate
);
2652 DoMethod(list
.title_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2653 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2655 DoMethod(list
.list_radios
, MUIM_Notify
, MUIA_Radio_Active
,
2656 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2658 SET(list
.lists
[4], MUIA_List_CompareHook
, &hook_compare
);
2659 SET(list
.lists
[4], MUIA_List_AutoVisible
, TRUE
);
2661 SET(list
.showheadings_check
, MUIA_Selected
,
2662 XGET(list
.multi_lists
[0], MUIA_List_Title
));
2663 SET(list
.format_string
, MUIA_String_Contents
,
2664 XGET(list
.multi_lists
[1], MUIA_List_Format
));
2665 SET(list
.def_column_string
, MUIA_String_Integer
,
2666 XGET(list
.multi_lists
[0], MUIA_Listview_DefClickColumn
));
2667 DoMethod(list
.format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2668 MUIV_EveryTime
, list
.multi_lists
[1], 3, MUIM_Set
,
2669 MUIA_List_Format
, MUIV_TriggerValue
);
2670 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_List_Format
,
2671 MUIV_EveryTime
, wnd
, 3, MUIM_Set
,
2672 MUIA_Window_ActiveObject
, list
.format_string
);
2673 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
2675 DoMethod(list
.showheadings_check
, MUIM_Notify
, MUIA_Selected
,
2676 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2677 MUIA_List_Title
, MUIV_TriggerValue
);
2678 DoMethod(list
.showimage_check
, MUIM_Notify
, MUIA_Selected
,
2679 MUIV_EveryTime
, list
.multi_lists
[i
], 2, MUIM_List_Redraw
,
2680 MUIV_List_Redraw_All
);
2681 DoMethod(list
.def_column_string
, MUIM_Notify
,
2682 MUIA_String_Integer
,
2683 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2684 MUIA_Listview_DefClickColumn
, MUIV_TriggerValue
);
2685 DoMethod(list
.multi_lists
[i
], MUIM_Notify
,
2686 MUIA_Listview_ClickColumn
, MUIV_EveryTime
,
2687 list
.column_string
, 3, MUIM_Set
, MUIA_String_Integer
,
2690 DoMethod(list
.column_string
, MUIM_Notify
, MUIA_String_Contents
,
2691 MUIV_EveryTime
, list
.column_text
, 3, MUIM_Set
, MUIA_Text_Contents
,
2693 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2694 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2695 CheckListDoubleClick
);
2696 SET(list
.multi_lists
[1], MUIA_List_ConstructHook
, &hook_construct
);
2697 SET(list
.multi_lists
[1], MUIA_List_DestructHook
, &hook_destruct
);
2698 SET(list
.multi_lists
[1], MUIA_List_DisplayHook
, &hook_display
);
2699 DoMethod(list
.multi_lists
[1], MUIM_List_Insert
, entries
, -1,
2700 MUIV_List_Insert_Top
);
2702 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
2703 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
2706 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
2708 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
2709 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
2711 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
2712 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
2715 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2716 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
2719 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
2720 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
2721 MUIA_Radio_Active
, MUIV_TriggerValue
);
2722 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
2723 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
2724 MUIA_Radio_Active
, MUIV_TriggerValue
);
2726 #if defined(TEST_ICONLIST)
2728 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2729 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2730 volume_doubleclicked
);
2731 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2732 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2733 drawer_doubleclicked
);
2736 /* automatic tests */
2737 get(list
.lists
[0], MUIA_List_Visible
, &value
);
2739 printf("MUIA_List_Visible equals %ld before display,"
2740 " but it should be -1.\n", (long)value
);
2741 get(list
.multi_lists
[0], MUIA_Listview_ClickColumn
, &value
);
2743 printf("MUIA_Listview_ClickColumn equals %ld before display,"
2744 " but it should be 0.\n", (long)value
);
2745 get(list
.lists
[0], MUIA_Listview_DoubleClick
, &value
);
2747 printf("MUIA_Listview_DoubleClick equals %ld before display,"
2748 " but it should be 0.\n", (long)value
);
2750 set(wnd
, MUIA_Window_Open
, TRUE
);
2751 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test Application");
2753 list
.image
= DoMethod(list
.multi_lists
[0], MUIM_List_CreateImage
,
2754 list
.colorfield
, 0);
2756 /* Set pen fields */
2757 set(colorfield_pen
, MUIA_String_Integer
,
2758 XGET(colorfield
, MUIA_Colorfield_Pen
));
2761 nnset(pendisplay_pen
, MUIA_String_Integer
,
2762 XGET(pendisplay
, MUIA_Pendisplay_Pen
));
2764 struct MUI_PenSpec
*pen_spec
= NULL
;
2765 GET(pendisplay
, MUIA_Pendisplay_Spec
, &pen_spec
);
2766 strncpy(pen_str
, pen_spec
->buf
, 10);
2767 set(pendisplay_spec
, MUIA_String_Contents
, pen_str
);
2769 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
2770 &sigs
) != MUIV_Application_ReturnID_Quit
)
2774 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
2775 if (sigs
& SIGBREAKF_CTRL_C
)
2777 if (sigs
& SIGBREAKF_CTRL_D
)
2782 DoMethod(list
.multi_lists
[0], MUIM_List_DeleteImage
, list
.image
);
2783 MUI_DisposeObject(app
);
2786 MUI_DisposeObject(context_menu
);
2787 CloseLibrary(ColorWheelBase
);
2788 MUI_DeleteCustomClass(CL_DropText
);
2790 /* automatic tests */
2791 if (list
.destruct_count
!= 18)
2792 printf("The hook installed through MUIA_List_DestructHook has been"
2793 " called %ld times, but should have been called 18 times.\n",
2794 (long)list
.destruct_count
);
2796 CloseLibrary(MUIMasterBase
);