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 <proto/utility.h>
26 #include <aros/debug.h>
28 /* the following should go in a single include file which then only
29 ** consists of the public constants and members. Actually this is easy
36 #include <libraries/mui.h>
37 #if defined(TEST_ICONLIST)
38 #include "../../workbench/system/Wanderer/Classes/iconlist_attributes.h"
39 #include "../../workbench/system/Wanderer/Classes/iconlist.h"
42 #define STRING_COUNT 6
44 #define MULTI_LIST_COUNT 2
47 #define NUMERIC_MAX 100
49 static const TEXT digits
[] = "-0123456789";
50 static const TEXT vowels
[] = "aeiou";
51 static const TEXT default_accept_chars
[] = "aeiou?.";
52 static const TEXT default_reject_chars
[] = "*?";
53 static const ULONG default_color
[] = {155 << 24, 180 << 24, 255 << 24};
54 static const struct MUI_PenSpec default_penspec
= {"m0"};
55 static const char *fruits
[] = {"Strawberry", "Apple", "Banana", "Orange",
56 "Grapefruit", "Kumquat", "Plum", "Raspberry", "Apricot", "Grape",
57 "Peach", "Lemon", "Lime", "Date", "Pineapple", "Blueberry", "Papaya",
58 "Cranberry", "Gooseberry", "Pear", "Fig", "Coconut", "Melon",
60 static const char *empty
[] = {"", "", "", "", "", NULL
};
61 static const LONG list_active_positions
[] =
64 MUIV_List_Active_Bottom
,
69 static const CONST_STRPTR list_move1_modes
[] =
70 {"Index", "Top", "Active", "Bottom", NULL
};
71 static const CONST_STRPTR list_move2_modes
[] =
72 {"Index", "Top", "Active", "Bottom", "Next", "Previous", NULL
};
73 static const CONST_STRPTR list_jump_modes
[] =
74 {"Index", "Top", "Active", "Bottom", "Down", "Up", NULL
};
75 static const CONST_STRPTR list_insert_modes
[] =
76 {"Index", "Top", "Active", "Sorted", "Bottom", NULL
};
77 static const CONST_STRPTR list_remove_modes
[] =
78 {"Index", "First", "Active", "Last", "Selected", "Unsafe Loop",
80 static const CONST_STRPTR list_activate_modes
[] =
81 {"Index", "Top", "Bottom", "Up", "Down", "Page Up", "Page Down", NULL
};
82 static const CONST_STRPTR list_select_modes
[] =
83 {"Index", "Active", "All", NULL
};
84 static const TEXT list_format
[] = "BAR,BAR,";
101 struct Library
*MUIMasterBase
;
102 struct Library
*ColorWheelBase
;
120 Object
*strings
[STRING_COUNT
],
130 *standard_hook_check
,
138 Object
*lists
[LIST_COUNT
],
161 *insert_single_button
,
162 *insert_multiple_button
,
167 *showdropmarks_check
,
179 *multi_lists
[MULTI_LIST_COUNT
],
187 LONG quiet
[LIST_COUNT
],
189 has_multitest
[LIST_COUNT
];
194 static Object
*wheel
;
195 static Object
*r_slider
;
196 static Object
*g_slider
;
197 static Object
*b_slider
;
198 static Object
*hue_gauge
;
199 static Object
*colorfield
, *colorfield2
, *colorfield_reset_button
,
201 static Object
*coloradjust
;
202 static Object
*pendisplay
, *pendisplay2
, *pendisplay_pen
, *pendisplay_spec
,
203 *reference_check
, *shine_button
, *shadow_button
, *yellow_button
, *poppen
;
204 static Object
*group
;
205 static Object
*editor_text
;
206 static Object
*filename_string
;
207 static Object
*save_button
;
208 static struct Hook hook_standard
;
209 static struct Hook hook
;
210 static struct Hook hook_wheel
;
211 static struct Hook hook_slider
;
212 static struct Hook hook_objects
;
213 static struct Hook hook_compare
, hook_multitest
;
214 static struct Hook hook_construct
, hook_destruct
, hook_display
;
215 static struct Hook hook_objstr
;
217 #if defined(TEST_ICONLIST)
218 static Object
*drawer_iconlist
;
219 static Object
*volume_iconlist
;
222 AROS_UFH0(void, repeat_function
)
226 printf("MUI_Timer\n");
231 AROS_UFH0(void, wheel_function
)
235 nnset(r_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
236 WHEEL_Red
) >> 24) & 0xff);
237 nnset(g_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
238 WHEEL_Green
) >> 24) & 0xff);
239 nnset(b_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
240 WHEEL_Blue
) >> 24) & 0xff);
245 AROS_UFH0(void, slider_function
)
249 struct ColorWheelRGB cw
;
250 ULONG red
= XGET(r_slider
, MUIA_Numeric_Value
);
251 ULONG green
= XGET(g_slider
, MUIA_Numeric_Value
);
252 ULONG blue
= XGET(b_slider
, MUIA_Numeric_Value
);
254 cw
.cw_Red
= (red
<< 24) | (red
<< 16) | (red
<< 8) | red
;
255 cw
.cw_Green
= (green
<< 24) | (green
<< 16) | (green
<< 8) | green
;
256 cw
.cw_Blue
= (blue
<< 24) | (blue
<< 16) | (blue
<< 8) | blue
;
258 nnset(wheel
, WHEEL_RGB
, &cw
);
259 set(hue_gauge
, MUIA_Gauge_Current
, XGET(wheel
, WHEEL_Hue
));
264 AROS_UFH0(void, objects_function
)
268 Object
*new_obj
= MUI_MakeObject(MUIO_Button
, "Button");
271 DoMethod(group
, MUIM_Group_InitChange
);
272 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
273 DoMethod(group
, MUIM_Group_ExitChange
);
279 static void About(void)
281 static Object
*about_wnd
;
285 about_wnd
= AboutmuiObject
, MUIA_Aboutmui_Application
, app
, End
;
289 set(about_wnd
, MUIA_Window_Open
, TRUE
);
292 AROS_UFH3(static void, ObjStrHook
,
293 AROS_UFHA(struct Hook
*, h
, A0
),
294 AROS_UFHA(Object
*, group
, A2
),
295 AROS_UFHA(Object
*, str
, A1
))
299 struct List
*child_list
= NULL
;
300 Object
*child
, *list
;
301 struct list_entry
*entry
;
303 /* Find the listview object within its group */
304 GET(group
, MUIA_Group_ChildList
, &child_list
);
305 child
= (APTR
)child_list
->lh_Head
;
307 list
= NextObject(&child
);
309 /* Copy one of the selected entry's fields to the string gadget */
310 DoMethod(list
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &entry
);
311 SET(str
, MUIA_String_Contents
, entry
->column1
);
316 static void ChangeStringAccept(void)
318 STRPTR accept_chars
= NULL
, reject_chars
= NULL
;
322 accept_all
= XGET(string
.accept_all_check
, MUIA_Selected
);
323 SET(string
.accept_string
, MUIA_Disabled
, accept_all
);
324 SET(string
.reject_string
, MUIA_Disabled
, accept_all
);
328 GET(string
.accept_string
, MUIA_String_Contents
, &accept_chars
);
329 GET(string
.reject_string
, MUIA_String_Contents
, &reject_chars
);
332 for (i
= 0; i
< STRING_COUNT
; i
++)
334 SET(string
.strings
[i
], MUIA_String_Accept
, accept_chars
);
335 SET(string
.strings
[i
], MUIA_String_Reject
, reject_chars
);
339 static void ChangePen(void)
343 GET(colorfield_pen
, MUIA_String_Integer
, &pen
);
345 SET(colorfield
, MUIA_Colorfield_Pen
, pen
);
348 static void ChangePendisplayPen(void)
350 DoMethod(pendisplay
, MUIM_Pendisplay_SetColormap
,
351 XGET(pendisplay_pen
, MUIA_String_Integer
));
354 AROS_UFH3(static IPTR
, ListCompareHook
,
355 AROS_UFHA(struct Hook
*, h
, A0
),
356 AROS_UFHA(CONST_STRPTR
, str1
, A2
),
357 AROS_UFHA(CONST_STRPTR
, str2
, A1
))
366 /* Indicate which string is shorter */
372 AROS_UFH3(static IPTR
, ListMultiTestHook
,
373 AROS_UFHA(struct Hook
*, h
, A0
),
374 AROS_UFHA(APTR
, unused
, A2
),
375 AROS_UFHA(CONST_STRPTR
, str
, A1
))
379 /* Indicate whether the string doesn't begin with a vowel */
380 return strchr(vowels
, tolower(str
[0])) == NULL
;
385 static void ChangeListTitle(void)
390 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
392 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
395 GET(list
.title_string
, MUIA_String_Contents
, &title
);
396 if (title
[0] == '\0')
399 title
= StrDup(title
);
401 SET(list
.lists
[i
], MUIA_List_Title
, title
);
404 static void UpdateListInfo(void)
410 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
412 GET(list
.lists
[i
], MUIA_Listview_DragType
, &value
);
413 NNSET(list
.draggable_check
, MUIA_Selected
,
414 value
!= MUIV_Listview_DragType_None
);
415 NNSET(list
.dragsortable_check
, MUIA_Disabled
,
416 value
== MUIV_Listview_DragType_None
);
417 if (value
== MUIV_Listview_DragType_None
)
420 GET(list
.lists
[i
], MUIA_List_DragSortable
, &value
);
421 NNSET(list
.dragsortable_check
, MUIA_Selected
, value
);
422 GET(list
.lists
[i
], MUIA_List_ShowDropMarks
, &value
);
423 NNSET(list
.showdropmarks_check
, MUIA_Selected
, value
);
424 value
= list
.has_multitest
[i
]; // MUIA_List_MultiTestHook isn't gettable!
425 NNSET(list
.multitest_check
, MUIA_Selected
, value
);
426 value
= list
.quiet
[i
]; // MUIA_List_Quiet is not gettable!
427 NNSET(list
.quiet_check
, MUIA_Selected
, value
);
428 GET(list
.lists
[i
], MUIA_List_AutoVisible
, &value
);
429 NNSET(list
.autovisible_check
, MUIA_Selected
, value
);
431 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
432 NNSET(list
.title_string
, MUIA_String_Contents
, title
);
434 GET(list
.lists
[i
], MUIA_List_Entries
, &value
);
435 DoMethod(list
.entries_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
437 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
438 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
440 GET(list
.lists
[i
], MUIA_List_First
, &value
);
441 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
443 GET(list
.lists
[i
], MUIA_List_InsertPosition
, &value
);
444 DoMethod(list
.insert_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
446 GET(list
.lists
[i
], MUIA_List_Active
, &value
);
447 if (value
== MUIV_List_Active_Off
)
448 SET(list
.active_text
, MUIA_Text_Contents
, "N/A");
450 DoMethod(list
.active_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
452 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
453 MUIV_List_Select_Ask
, (IPTR
) &value
);
454 DoMethod(list
.selected_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
456 GET(list
.lists
[i
], MUIA_List_DropMark
, &value
);
457 DoMethod(list
.drop_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
461 static void ListGetVisible(void)
466 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
468 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
469 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
473 static void ListGetFirst(void)
479 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
481 /* We fetch the Listview's list here to provide test coverage for that
482 attribute. Please don't optimise */
483 real_list
= (Object
*)XGET(list
.lists
[i
], MUIA_Listview_List
);
484 GET(real_list
, MUIA_List_First
, &value
);
485 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
489 static void ListGetSelected(void)
494 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
496 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
497 MUIV_List_Select_Ask
, (IPTR
) &value
);
498 DoMethod(list
.selected_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
502 static void ListSetDraggable(void)
507 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
509 GET(list
.draggable_check
, MUIA_Selected
, &value
);
510 SET(list
.lists
[i
], MUIA_Listview_DragType
, value
?
511 MUIV_Listview_DragType_Immediate
: MUIV_Listview_DragType_None
);
514 static void ListSetShowDropMarks(void)
519 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
521 GET(list
.showdropmarks_check
, MUIA_Selected
, &value
);
522 SET(list
.lists
[i
], MUIA_List_ShowDropMarks
, value
);
525 static void ListSetMultiTest(void)
530 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
532 GET(list
.multitest_check
, MUIA_Selected
, &value
);
533 SET(list
.lists
[i
], MUIA_List_MultiTestHook
, value
? &hook_multitest
: NULL
);
534 list
.has_multitest
[i
] = value
;
537 static void ListSetQuiet(void)
542 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
544 GET(list
.quiet_check
, MUIA_Selected
, &value
);
545 SET(list
.lists
[i
], MUIA_List_Quiet
, value
);
546 list
.quiet
[i
] = value
;
549 static void ListSetDragSortable(void)
554 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
556 GET(list
.dragsortable_check
, MUIA_Selected
, &value
);
557 SET(list
.lists
[i
], MUIA_List_DragSortable
, value
);
560 static void ListSetAutoVisible(void)
565 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
567 GET(list
.autovisible_check
, MUIA_Selected
, &value
);
568 SET(list
.lists
[i
], MUIA_List_AutoVisible
, value
);
571 static void ListReset(void)
575 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
577 SET(list
.lists
[i
], MUIA_List_Active
, list_active_positions
[i
]);
580 static void ListMove(void)
582 LONG mode
, pos1
, pos2
;
585 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
587 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
590 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
594 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
597 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
601 DoMethod(list
.lists
[i
], MUIM_List_Move
, pos1
, pos2
);
604 static void ListSort(void)
608 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
610 DoMethod(list
.lists
[i
], MUIM_List_Sort
);
613 static void ListEnable(void)
617 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
619 SET(list
.lists
[i
], MUIA_Disabled
, FALSE
);
622 static void ListExchange(void)
624 LONG mode
, pos1
, pos2
;
627 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
629 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
632 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
636 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
639 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
643 DoMethod(list
.lists
[i
], MUIM_List_Exchange
, pos1
, pos2
);
646 static void ListJump(void)
651 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
653 mode
= XGET(list
.jump_cycle
, MUIA_Cycle_Active
);
656 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
660 DoMethod(list
.lists
[i
], MUIM_List_Jump
, pos
);
663 static void ListSelect(void)
668 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
670 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
673 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
677 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_On
,
681 static void ListDeselect(void)
686 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
688 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
691 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
695 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_Off
,
699 static void ListToggle(void)
704 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
706 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
709 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
713 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
,
714 MUIV_List_Select_Toggle
, NULL
);
717 static void ListRedraw(void)
722 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
724 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
727 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
731 DoMethod(list
.lists
[i
], MUIM_List_Redraw
, pos
);
734 static void ListInsertSingle(void)
739 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
741 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
744 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
748 DoMethod(list
.lists
[i
], MUIM_List_InsertSingle
, "Tomato", pos
);
751 static void ListInsert(void)
756 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
758 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
761 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
765 DoMethod(list
.lists
[i
], MUIM_List_Insert
, fruits
, -1, pos
);
768 static void ListRemove(void)
770 LONG mode
, pos
, count
, j
, *selections
;
773 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
775 mode
= XGET(list
.remove_cycle
, MUIA_Cycle_Active
);
779 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
780 This doesn't work as expected in MUI or Zune */
781 pos
= MUIV_List_NextSelected_Start
- 1;
782 while (pos
!= MUIV_List_NextSelected_End
)
784 if (pos
== MUIV_List_NextSelected_Start
- 1)
786 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
787 if (pos
!= MUIV_List_NextSelected_End
)
788 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
793 /* Remove selected entries safely by first retrieving them with
794 MUIM_List_NextSelected and then removing them one by one */
795 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
796 MUIV_List_Select_Ask
, &count
);
798 count
= 1; /* There may still be an active entry */
799 selections
= AllocVec(sizeof(LONG
) * count
, MEMF_ANY
);
800 if (selections
!= NULL
)
802 pos
= MUIV_List_NextSelected_Start
;
803 for (j
= 0; j
< count
; j
++)
805 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
809 /* We must remove the entries in reverse order; otherwise the
810 later indices will become invalid */
812 DoMethod(list
.lists
[i
], MUIM_List_Remove
, selections
[--count
]);
819 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
822 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
826 static void ListClear(void)
830 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
832 DoMethod(list
.lists
[i
], MUIM_List_Clear
);
835 static void ListActivate(void)
840 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
842 mode
= XGET(list
.activate_cycle
, MUIA_Cycle_Active
);
845 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
849 SET(list
.lists
[i
], MUIA_List_Active
, pos
);
852 static void ListDeactivate(void)
856 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
858 SET(list
.lists
[i
], MUIA_List_Active
, MUIV_List_Active_Off
);
861 static void CheckListDoubleClick(void)
865 GET(list
.multi_lists
[1], MUIA_Listview_DoubleClick
, &value
);
866 MUI_Request(app
, wnd
, 0, "Test", "OK",
867 "MUIA_Listview_Doubleclick = %ld", value
);
870 AROS_UFH3(static APTR
, ListConstructHook
,
871 AROS_UFHA(struct Hook
*, h
, A0
),
872 AROS_UFHA(APTR
, pool
, A2
),
873 AROS_UFHA(IPTR
, n
, A1
))
877 struct list_entry
*entry
;
879 entry
= AllocPooled(pool
, sizeof(struct list_entry
) + 40);
883 entry
->column1
= (char *)(entry
+ 1);
884 entry
->column2
= entry
->column1
+ 20;
885 sprintf(entry
->column1
, "Entry%ld", (long)n
);
886 sprintf(entry
->column2
, "Col2: Entry%ld", (long)n
);
894 AROS_UFH3(static void, ListDestructHook
,
895 AROS_UFHA(struct Hook
*, h
, A0
),
896 AROS_UFHA(APTR
, pool
, A2
),
897 AROS_UFHA(struct list_entry
*, entry
, A1
))
901 FreePooled(pool
, entry
, sizeof(struct list_entry
) + 40);
902 list
.destruct_count
++;
907 AROS_UFH3(static void, display_function
,
908 AROS_UFHA(struct Hook
*, h
, A0
),
909 AROS_UFHA(char **, strings
, A2
),
910 AROS_UFHA(struct list_entry
*, entry
, A1
))
914 static char buf
[100];
918 if (XGET(list
.showimage_check
, MUIA_Selected
))
919 sprintf(buf
, "%ld \33O[%08lx]", (long)*(strings
- 1),
922 sprintf(buf
, "%ld", (long)*(strings
- 1));
924 strings
[1] = entry
->column1
;
925 strings
[2] = entry
->column2
;
929 strings
[0] = "Number";
930 strings
[1] = "Column 1";
931 strings
[2] = "Column 2";
937 static void Save(void)
939 char *text
= (char *)XGET(editor_text
, MUIA_String_Contents
);
940 char *filename
= (char *)XGET(filename_string
, MUIA_String_Contents
);
943 if (!strlen(filename
))
946 if ((fh
= Open(filename
, MODE_NEWFILE
)))
948 Write(fh
, text
, strlen(text
));
953 #if defined(TEST_ICONLIST)
954 /* IconList callbacks */
955 static void volume_doubleclicked(void)
958 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
960 DoMethod(volume_iconlist
, MUIM_IconList_NextIcon
,
961 MUIV_IconList_NextIcon_Selected
, &ent
);
962 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
965 strcpy(buf
, ent
->label
);
969 static void drawer_doubleclicked(void)
971 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
973 DoMethod(drawer_iconlist
, MUIM_IconList_NextIcon
,
974 MUIV_IconList_NextIcon_Selected
, &ent
);
975 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
977 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
,
978 ent
->ile_IconEntry
->ie_IconNode
.ln_Name
);
982 static IPTR
create_balance_column(void)
984 return (IPTR
) VGroup
,
985 Child
, RectangleObject
,
988 Child
, BalanceObject
,
990 Child
, RectangleObject
,
993 Child
, BalanceObject
,
995 Child
, RectangleObject
,
998 Child
, BalanceObject
,
1000 Child
, RectangleObject
,
1003 Child
, BalanceObject
,
1005 Child
, RectangleObject
,
1011 /* The custom class */
1013 struct DropText_Data
1020 struct Library
*KeymapBase
;
1024 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
,
1025 register __a2 Object
*obj
, register __a1 Msg msg
)
1027 AROS_UFH3S(IPTR
, dispatcher
,
1028 AROS_UFHA(Class
*, cl
, A0
),
1029 AROS_UFHA(Object
*, obj
, A2
), AROS_UFHA(Msg
, msg
, A1
))
1034 switch (msg
->MethodID
)
1036 case MUIM_DragQuery
:
1037 return MUIV_DragQuery_Accept
;
1040 struct DropText_Data
*data
=
1041 (struct DropText_Data
*)INST_DATA(cl
, obj
);
1044 sprintf(buf
, "%ld times", (long)data
->times
);
1045 set(obj
, MUIA_Text_Contents
, buf
);
1049 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
1054 static struct MUI_CustomClass
*CL_DropText
;
1056 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
1058 /* Custom Window subclass */
1060 struct TestWindowData
1065 IPTR
TestWindow__OM_SET(struct IClass
*cl
, Object
*obj
,
1068 struct TagItem
*tags
;
1069 struct TagItem
*tag
;
1071 for (tags
= msg
->ops_AttrList
; (tag
= NextTagItem(&tags
));)
1073 switch (tag
->ti_Tag
)
1075 case MUIA_Window_Open
:
1077 SET(obj
, MUIA_Window_ActiveObject
, general
.open_button
);
1082 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
1085 AROS_UFH3S(IPTR
, TestWindowDispatcher
,
1086 AROS_UFHA(Class
*, cl
, A0
),
1087 AROS_UFHA(Object
*, obj
, A2
),
1088 AROS_UFHA(Msg
, msg
, A1
))
1092 switch (msg
->MethodID
)
1095 return TestWindow__OM_SET(cl
, obj
, (struct opSet
*)msg
);
1097 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
1103 static struct MUI_CustomClass
*test_window_class
;
1105 #define TestWindowObject BOOPSIOBJMACRO_START(test_window_class->mcc_Class)
1109 AROS_UFH3S(void, hook_func_standard
,
1110 AROS_UFHA(struct Hook
*, h
, A0
),
1111 AROS_UFHA(void *, dummy
, A2
), AROS_UFHA(void **, funcptr
, A1
))
1115 void (*func
) (ULONG
*) = (void (*)(ULONG
*))(*funcptr
);
1118 func((ULONG
*) funcptr
+ 1);
1125 LONG result
= RETURN_OK
;
1128 Object
*about_button
;
1129 Object
*quit_button
;
1130 Object
*repeat_button
;
1131 Object
*objects_button
;
1132 Object
*about_item
, *quit_item
;
1133 Object
*context_menu
;
1134 Object
*popobject
, *listview
;
1135 Object
*numerics
[NUMERIC_COUNT
];
1136 Object
*min_string
, *max_string
;
1137 Object
*slider_button
;
1138 Object
*country_radio
[2];
1143 static char *pages
[] =
1144 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
1146 #if defined(TEST_ICONLIST)
1150 static char *text_pages
[] =
1151 {"Text", "String", NULL
};
1152 static char *color_pages
[] =
1153 {"Palette", "Colors", "Pens", NULL
};
1154 static char *list_pages
[] =
1155 {"Single Column", "Multicolumn", NULL
};
1156 static char **radio_entries1
= pages
;
1157 static char *radio_entries2
[] =
1158 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL
};
1160 static IPTR entries
[] = {1, 2, 3, 4, 5, 6, (IPTR
)NULL
};
1162 hook_standard
.h_Entry
= (HOOKFUNC
) hook_func_standard
;
1163 hook_objstr
.h_Entry
= (HOOKFUNC
) ObjStrHook
;
1165 pool
= CreatePool(MEMF_ANY
, 4096, 4096);
1167 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library", 0);
1169 hook
.h_Entry
= (HOOKFUNC
) repeat_function
;
1170 hook_wheel
.h_Entry
= (HOOKFUNC
) wheel_function
;
1171 hook_slider
.h_Entry
= (HOOKFUNC
) slider_function
;
1172 hook_objects
.h_Entry
= (HOOKFUNC
) objects_function
;
1173 hook_compare
.h_Entry
= (HOOKFUNC
) ListCompareHook
;
1174 hook_multitest
.h_Entry
= (HOOKFUNC
) ListMultiTestHook
;
1175 hook_construct
.h_Entry
= (HOOKFUNC
) ListConstructHook
;
1176 hook_destruct
.h_Entry
= (HOOKFUNC
) ListDestructHook
;
1177 hook_display
.h_Entry
= (HOOKFUNC
) display_function
;
1178 list
.destruct_count
= 0;
1179 list
.has_multitest
[3] = TRUE
;
1181 context_menu
= MenustripObject
,
1182 MUIA_Family_Child
, MenuObject
,
1183 MUIA_Menu_Title
, "Menutest",
1184 MUIA_Family_Child
, about_item
= MenuitemObject
,
1185 MUIA_Menuitem_Title
, "First Test Entry", End
,
1186 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1187 MUIA_Menuitem_Title
, "Second Test Entry", End
,
1191 /* should check the result in a real program! */
1192 CL_DropText
= MUI_CreateCustomClass(NULL
, MUIC_Text
, NULL
,
1193 sizeof(struct DropText_Data
), dispatcher
);
1194 test_window_class
= MUI_CreateCustomClass(NULL
, MUIC_Window
, NULL
,
1195 sizeof(struct TestWindowData
), TestWindowDispatcher
);
1196 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget", 0);
1198 pendisplay
= PendisplayObject
, MUIA_Pendisplay_Spec
, &default_penspec
, End
;
1200 title
= StrDup("Fruits");
1201 list
.lists
[0] = ListviewObject
,
1205 MUIA_List_Title
, title
,
1206 MUIA_List_SourceArray
, fruits
,
1207 MUIA_List_Active
, MUIV_List_Active_Top
,
1208 MUIA_List_PoolThreshSize
, 256,
1209 MUIA_List_DragSortable
, TRUE
,
1210 MUIA_List_CompareHook
, &hook_compare
,
1212 "Default scroller\nTop entry active\nSorted by length",
1214 MUIA_Listview_MultiSelect
,
1215 MUIV_Listview_MultiSelect_None
,
1216 MUIA_Listview_DragType
, MUIV_Listview_DragType_Immediate
,
1217 MUIA_Listview_DoubleClick
, TRUE
,
1220 list
.lists
[1] = ListviewObject
,
1224 MUIA_List_SourceArray
, fruits
,
1225 MUIA_List_Active
, MUIV_List_Active_Bottom
,
1226 MUIA_List_PoolPuddleSize
, 512,
1227 MUIA_List_AutoVisible
, TRUE
,
1229 "Left scroller\nBottom entry active\nSorted alphabetically",
1231 MUIA_Listview_ScrollerPos
,
1232 MUIV_Listview_ScrollerPos_Left
,
1233 MUIA_Listview_DragType
, MUIV_Listview_DragType_None
,
1236 list
.lists
[2] = ListviewObject
,
1240 MUIA_List_SourceArray
, fruits
,
1241 MUIA_List_Active
, MUIV_List_Active_Off
,
1242 MUIA_List_Pool
, pool
,
1244 "Right scroller\nNo active entry\nSorted alphabetically",
1246 MUIA_Listview_MultiSelect
,
1247 MUIV_Listview_MultiSelect_Shifted
,
1248 MUIA_Listview_ScrollerPos
,
1249 MUIV_Listview_ScrollerPos_Right
,
1252 list
.lists
[3] = ListviewObject
,
1256 MUIA_List_SourceArray
, fruits
,
1257 MUIA_List_Pool
, NULL
,
1258 MUIA_List_MultiTestHook
, &hook_multitest
,
1260 "No scroller\nDefault active entry\nSorted alphabetically",
1262 MUIA_Listview_MultiSelect
,
1263 MUIV_Listview_MultiSelect_Always
,
1264 MUIA_Listview_ScrollerPos
,
1265 MUIV_Listview_ScrollerPos_None
,
1268 list
.lists
[4] = ListviewObject
,
1272 MUIA_List_SourceArray
, fruits
,
1273 MUIA_List_Active
, MUIV_List_Active_Bottom
,
1274 MUIA_List_MinLineHeight
, 20,
1276 "Default scroller\nBottom entry active\nSorted by length",
1278 MUIA_Listview_Input
, FALSE
,
1282 list
.colorfield
= ColorfieldObject
,
1283 MUIA_Colorfield_RGB
, default_color
,
1286 if (CL_DropText
== NULL
|| test_window_class
== NULL
)
1287 result
= RETURN_FAIL
;
1289 if (result
== RETURN_OK
)
1291 app
= ApplicationObject
,
1292 MUIA_Application_Menustrip
, MenustripObject
,
1293 MUIA_Family_Child
, MenuObject
,
1294 MUIA_Menu_Title
, "Project",
1295 MUIA_Family_Child
, about_item
= MenuitemObject
,
1296 MUIA_Menuitem_Title
, "About...",
1297 MUIA_Menuitem_Shortcut
, "?",
1299 MUIA_Family_Child
, MenuitemObject
,
1300 MUIA_Menuitem_Title
, (SIPTR
)-1,
1302 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1303 MUIA_Menuitem_Title
, "Quit",
1304 MUIA_Menuitem_Shortcut
, "Q",
1309 SubWindow
, wnd
= TestWindowObject
,
1310 MUIA_Window_Title
, "test",
1311 MUIA_Window_Activate
, TRUE
,
1313 WindowContents
, VGroup
,
1314 Child
, RegisterGroup(pages
),
1315 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1320 GroupFrameT("A horizontal group"),
1322 GroupFrameT("A column group"),
1323 Child
, repeat_button
= TextObject
,
1326 MUIA_Background
, MUII_ButtonBack
,
1327 MUIA_Text_PreParse
, "\33c",
1328 MUIA_Text_Contents
, "Repeat",
1330 MUIV_InputMode_RelVerify
,
1335 MUIA_Background
, MUII_ButtonBack
,
1336 MUIA_Text_PreParse
, "\33c",
1337 MUIA_Text_Contents
, "Drag Me",
1338 MUIA_Draggable
, TRUE
,
1340 MUIV_InputMode_RelVerify
,
1342 Child
, general
.open_button
= TextObject
,
1345 MUIA_Background
, MUII_ButtonBack
,
1346 MUIA_Text_PreParse
, "\33c",
1347 MUIA_Text_Contents
, "Open Window",
1349 MUIV_InputMode_RelVerify
,
1352 MUIA_ContextMenu
, context_menu
,
1355 MUIA_Background
, MUII_ButtonBack
,
1356 MUIA_Text_PreParse
, "\33c",
1357 MUIA_Text_Contents
, "Press Right",
1359 MUIV_InputMode_RelVerify
,
1361 Child
, objects_button
= TextObject
,
1364 MUIA_Background
, MUII_ButtonBack
,
1365 MUIA_Text_PreParse
, "\33c",
1366 MUIA_Text_Contents
, "Add Objects",
1368 MUIV_InputMode_RelVerify
,
1373 Child
, MUI_MakeObject(MUIO_Checkmark
,
1377 Child
, MUI_MakeObject(MUIO_Label
,
1384 Child
, group
= VGroup
,
1385 GroupFrameT("A vertical group"),
1386 Child
, DropTextObject
,
1387 MUIA_Dropable
, TRUE
,
1390 MUIA_Background
, MUII_ButtonBack
,
1391 MUIA_Text_PreParse
, "\33c",
1392 MUIA_Text_Contents
, "Drop Here",
1393 MUIA_Dropable
, TRUE
,
1395 MUIV_InputMode_RelVerify
,
1399 MUIA_Background
, MUII_MARKHALFSHINE
,
1401 MUIA_Text_PreParse
, "\33c",
1402 MUIA_Text_Contents
, "Pattern",
1405 MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
1407 Child
, ScrollgroupObject
,
1408 GroupFrameT("A scroll group"),
1409 MUIA_Scrollgroup_Contents
, VGroupV
,
1414 "Line1\nLine2\nLine3\nLine4\n"
1415 "Line5\nLine6\nLine7\nLine8\n"
1417 "Line9\nLine10\nLine11\n",
1420 Child
, MUI_MakeObject(MUIO_Button
,
1422 Child
, MUI_MakeObject(MUIO_Button
,
1428 Child
, popobject
= PopobjectObject
,
1429 MUIA_Popstring_String
,
1430 MUI_MakeObject(MUIO_String
, NULL
, 200),
1431 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
1432 MUIA_Popobject_Object
, VGroup
,
1434 MUIA_Text_Contents
, "test",
1436 Child
, listview
= ListviewObject
,
1437 MUIA_Listview_List
, ListObject
,
1439 MUIA_List_ConstructHook
,
1441 MUIA_List_DestructHook
,
1443 MUIA_List_DisplayHook
,
1445 MUIA_List_Format
, ",,",
1446 MUIA_List_SourceArray
, entries
,
1447 MUIA_List_Title
, TRUE
,
1451 MUIA_Popobject_ObjStrHook
, &hook_objstr
,
1455 MUIA_Cycle_Entries
, pages
,
1457 Child
, ScrollbarObject
,
1458 MUIA_Group_Horiz
, TRUE
,
1459 MUIA_Prop_Visible
, 100,
1460 MUIA_Prop_Entries
, 300,
1461 MUIA_Prop_First
, 50,
1466 Child
, RegisterGroup(text_pages
),
1470 MUIA_Background
, "2:cfffffff,cfffffff,10000000",
1472 MUIA_Text_Contents
, "\33cHello World!\n"
1473 "This is a text object\n\33lLeft "
1479 /* Test for a bug with pen specifications as
1481 https://sourceforge.net/p/aros/bugs/487/
1484 "This is a \33P[3]text \33P[]object "
1485 "\33P[1]with pen specifications",
1487 Child
, RectangleObject
,
1489 /* Seems to be not supported properly as
1490 orginal MUI doesn't allow to alter the
1491 height of the window */
1492 MUIA_Rectangle_HBar
, TRUE
,
1493 MUIA_Rectangle_BarTitle
,"Enter a string",
1495 Child
, StringObject
,
1498 MUIA_String_AdvanceOnCR
, TRUE
,
1507 GroupFrameT("Default Alignment"),
1508 Child
, string
.strings
[0] = StringObject
,
1511 (IPTR
)default_accept_chars
,
1513 (IPTR
)default_reject_chars
,
1514 MUIA_String_AdvanceOnCR
, TRUE
,
1515 MUIA_String_MaxLen
, 9,
1517 MUIA_String_AttachedList
,
1521 Child
, VGroup
, GroupFrameT("Left Aligned"),
1522 Child
, string
.strings
[1] = StringObject
,
1525 (IPTR
)default_accept_chars
,
1527 (IPTR
)default_reject_chars
,
1529 MUIV_String_Format_Left
,
1530 MUIA_String_AdvanceOnCR
, TRUE
,
1531 MUIA_String_MaxLen
, 9,
1533 MUIA_String_Contents
,
1534 (IPTR
)default_accept_chars
,
1535 MUIA_String_BufferPos
, 3,
1536 MUIA_String_AttachedList
,
1540 Child
, VGroup
, GroupFrameT("Right Aligned"),
1541 Child
, string
.strings
[2] = StringObject
,
1544 (IPTR
)default_accept_chars
,
1546 (IPTR
)default_reject_chars
,
1548 MUIV_String_Format_Right
,
1549 MUIA_String_AdvanceOnCR
, TRUE
,
1550 MUIA_String_MaxLen
, 9,
1552 MUIA_String_AttachedList
,
1556 Child
, VGroup
, GroupFrameT("Centered"),
1557 Child
, string
.strings
[3] = StringObject
,
1560 (IPTR
)default_accept_chars
,
1562 (IPTR
)default_reject_chars
,
1564 MUIV_String_Format_Center
,
1565 MUIA_String_AdvanceOnCR
, TRUE
,
1566 MUIA_String_MaxLen
, 9,
1568 MUIA_String_Integer
, 123,
1569 MUIA_String_AttachedList
,
1573 Child
, VGroup
, GroupFrameT("Secret"),
1574 Child
, string
.strings
[4] = StringObject
,
1577 (IPTR
)default_accept_chars
,
1579 (IPTR
)default_reject_chars
,
1581 MUIV_String_Format_Center
,
1582 MUIA_String_Secret
, TRUE
,
1583 MUIA_String_AdvanceOnCR
, TRUE
,
1584 MUIA_String_MaxLen
, 9,
1586 MUIA_String_AttachedList
,
1590 Child
, HGroup
, GroupFrameT("Narrow"),
1592 Child
, string
.strings
[5] = StringObject
,
1595 (IPTR
)default_accept_chars
,
1597 (IPTR
)default_reject_chars
,
1599 MUIV_String_Format_Center
,
1600 MUIA_String_AdvanceOnCR
, TRUE
,
1602 MUIA_String_MaxLen
, 9,
1604 MUIA_String_AttachedList
,
1611 Child
, VGroup
, GroupFrameT("Controls"),
1613 Child
, string
.accept_all_check
=
1614 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1615 Child
, MUI_MakeObject(MUIO_Label
,
1616 "Accept all characters", 0),
1620 Child
, MUI_MakeObject(MUIO_Label
,
1621 "Acceptable characters:", 0),
1622 Child
, string
.accept_string
=
1625 MUIA_String_Contents
,
1626 (IPTR
)default_accept_chars
,
1628 Child
, MUI_MakeObject(MUIO_Label
,
1629 "Unacceptable characters:", 0),
1630 Child
, string
.reject_string
=
1634 Child
, MUI_MakeObject(MUIO_Label
,
1635 "Cursor position:", 0),
1636 Child
, string
.cursor_pos_slider
=
1638 MUIA_Group_Horiz
, TRUE
,
1639 MUIA_Numeric_Min
, 0,
1641 Child
, MUI_MakeObject(MUIO_Label
,
1642 "Display position:", 0),
1643 Child
, string
.display_pos_slider
=
1645 MUIA_Group_Horiz
, TRUE
,
1646 MUIA_Numeric_Min
, 0,
1648 Child
, MUI_MakeObject(MUIO_Label
,
1649 "Integer value:", 0),
1650 Child
, string
.integer_string
=
1653 MUIA_String_Accept
, (IPTR
)digits
,
1655 Child
, MUI_MakeObject(MUIO_Label
,
1657 Child
, string
.plaintext_string
=
1661 Child
, MUI_MakeObject(MUIO_Label
,
1662 "Maximum string length:", 0),
1663 Child
, string
.max_len_text
= TextObject
,
1665 MUIA_Text_Contents
, "Unknown",
1670 Child
, string
.cr_advance_check
=
1671 MUI_MakeObject(MUIO_Checkmark
,
1673 Child
, MUI_MakeObject(MUIO_Label
,
1674 "Advance on CR", 0),
1678 Child
, string
.attach_list_check
=
1679 MUI_MakeObject(MUIO_Checkmark
,
1681 Child
, MUI_MakeObject(MUIO_Label
,
1687 Child
, string
.standard_hook_check
=
1688 MUI_MakeObject(MUIO_Checkmark
,
1690 Child
, MUI_MakeObject(MUIO_Label
,
1691 "Use standard edit hook", 0),
1695 Child
, string
.custom_hook_check
=
1696 MUI_MakeObject(MUIO_Checkmark
,
1698 Child
, MUI_MakeObject(MUIO_Label
,
1699 "Use custom edit hook", 0),
1712 Child
, wheel
= BoopsiObject
,
1713 /* MUI/Boopsi tags mixed */
1715 /* boopsi objects don't know */
1716 /* their sizes, so we help */
1717 /* keep important values */
1718 /* during window resize */
1719 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
1720 MUIA_Boopsi_MinWidth
, 30,
1721 MUIA_Boopsi_MinHeight
, 30,
1722 MUIA_Boopsi_Remember
, WHEEL_Saturation
,
1723 MUIA_Boopsi_Remember
, WHEEL_Hue
,
1724 /* this magic fills in the screen pointer */
1725 MUIA_Boopsi_TagScreen
, WHEEL_Screen
,
1728 GA_Top
, 0, /* MUI will automatically */
1729 GA_Width
, 0, /* fill in the correct values */
1731 ICA_TARGET
, ICTARGET_IDCMP
,
1732 /* needed for notification */
1733 WHEEL_Saturation
, 0, /* start in the center */
1734 MUIA_FillArea
, TRUE
,
1735 /* use this because it defaults to FALSE
1736 for boopsi gadgets but the colorwheel
1737 doesn't bother about redrawing its
1741 Child
, r_slider
= SliderObject
,
1742 MUIA_Group_Horiz
, TRUE
,
1743 MUIA_Numeric_Min
, 0,
1744 MUIA_Numeric_Max
, 255,
1746 Child
, g_slider
= SliderObject
,
1747 MUIA_Group_Horiz
, TRUE
,
1748 MUIA_Numeric_Min
, 0,
1749 MUIA_Numeric_Max
, 255,
1751 Child
, b_slider
= SliderObject
,
1752 MUIA_Group_Horiz
, TRUE
,
1753 MUIA_Numeric_Min
, 0,
1754 MUIA_Numeric_Max
, 255,
1756 Child
, hue_gauge
= GaugeObject
,
1758 MUIA_Gauge_Horiz
, TRUE
,
1759 MUIA_Gauge_Max
, 255,
1760 MUIA_Gauge_Divide
, 1<<24,
1761 MUIA_Gauge_InfoText
, "Hue: %ld",
1766 Child
, RegisterGroup(color_pages
),
1767 Child
, VGroup
, GroupFrameT("Palette"),
1768 Child
, PaletteObject
,
1772 Child
, VGroup
, GroupFrameT("Colorfield"),
1775 Child
, colorfield
= ColorfieldObject
,
1776 MUIA_Colorfield_RGB
, default_color
,
1777 MUIA_Colorfield_Pen
, 253,
1779 Child
, colorfield2
= ColorfieldObject
,
1780 MUIA_Colorfield_Red
,
1782 MUIA_Colorfield_Green
,
1784 MUIA_Colorfield_Blue
,
1788 Child
, colorfield_reset_button
=
1789 MUI_MakeObject(MUIO_Button
,
1794 MUIO_Label
, "Pen:", 0),
1795 Child
, colorfield_pen
= StringObject
,
1800 Child
, VGroup
, GroupFrameT("Coloradjust"),
1801 Child
, coloradjust
= ColoradjustObject
,
1802 MUIA_Coloradjust_RGB
, default_color
,
1808 Child
, VGroup
, GroupFrameT("Pendisplay"),
1811 Child
, pendisplay2
=
1813 MUIA_Pendisplay_RGBcolor
,
1820 MUIO_Label
, "Pen:", 0),
1822 Child
, pendisplay_pen
=
1823 StringObject
, StringFrame
,
1826 Child
, reference_check
=
1828 MUIO_Checkmark
, NULL
),
1829 Child
, MUI_MakeObject(MUIO_Label
,
1834 MUIO_Label
, "Penspec:", 0),
1835 Child
, pendisplay_spec
=
1841 Child
, shine_button
=
1842 MUI_MakeObject(MUIO_Button
,
1844 Child
, shadow_button
=
1845 MUI_MakeObject(MUIO_Button
,
1847 Child
, yellow_button
=
1848 MUI_MakeObject(MUIO_Button
,
1852 Child
, VGroup
, GroupFrameT("Poppen"),
1853 Child
, poppen
= PoppenObject
,
1857 Child
, VGroup
, GroupFrameT("Penadjust"),
1858 Child
, PenadjustObject
,
1866 Child
, editor_text
= StringObject
,
1869 Child
, PopaslObject
,
1870 ASLFR_DoSaveMode
, TRUE
,
1871 MUIA_Popstring_String
, filename_string
=
1872 MUI_MakeObject(MUIO_String
, NULL
, 200),
1873 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
1875 Child
, save_button
=
1876 MUI_MakeObject(MUIO_Button
, "Save"),
1880 Child
, RegisterGroup(list_pages
),
1882 Child
, ColGroup(LIST_COUNT
),
1884 GroupFrameT("No Multiselect"),
1885 Child
, list
.lists
[0],
1888 GroupFrameT("Default Multiselect"),
1889 Child
, list
.lists
[1],
1892 GroupFrameT("Shifted Multiselect"),
1893 Child
, list
.lists
[2],
1897 "Unconditional Multiselect"),
1898 Child
, list
.lists
[3],
1901 GroupFrameT("Read Only"),
1902 Child
, list
.lists
[4],
1906 MUIA_Group_HorizSpacing
, 0,
1907 Child
, RectangleObject
,
1908 MUIA_HorizWeight
, 1,
1910 Child
, list
.list_radios
= RadioObject
,
1911 MUIA_Radio_Entries
, empty
,
1912 MUIA_Group_Horiz
, TRUE
,
1913 MUIA_HorizWeight
, 1000,
1915 Child
, RectangleObject
,
1916 MUIA_HorizWeight
, 1,
1919 Child
, RectangleObject
,
1921 MUIA_Rectangle_HBar
, TRUE
,
1922 MUIA_Rectangle_BarTitle
, "List Controls",
1925 Child
, MUI_MakeObject(MUIO_Label
,
1926 "Affected index 1:", 0),
1927 Child
, list
.index1_string
=
1930 MUIA_String_Accept
, (IPTR
)digits
,
1931 MUIA_String_Integer
, 0,
1934 Child
, list
.draggable_check
=
1936 MUIO_Checkmark
, NULL
),
1937 Child
, MUI_MakeObject(MUIO_Label
,
1942 Child
, list
.showdropmarks_check
=
1944 MUIO_Checkmark
, NULL
),
1945 Child
, MUI_MakeObject(MUIO_Label
,
1946 "Show drop marks", 0),
1950 Child
, list
.autovisible_check
=
1952 MUIO_Checkmark
, NULL
),
1953 Child
, MUI_MakeObject(MUIO_Label
,
1957 Child
, list
.reset_button
=
1958 MUI_MakeObject(MUIO_Button
, "Reset"),
1960 Child
, MUI_MakeObject(MUIO_Label
,
1961 "Affected index 2:", 0),
1962 Child
, list
.index2_string
=
1965 MUIA_String_Accept
, (IPTR
)digits
,
1966 MUIA_String_Integer
, 0,
1969 Child
, list
.dragsortable_check
=
1971 MUIO_Checkmark
, NULL
),
1972 Child
, MUI_MakeObject(MUIO_Label
,
1973 "Drag sortable", 0),
1977 Child
, list
.multitest_check
=
1979 MUIO_Checkmark
, NULL
),
1980 Child
, MUI_MakeObject(MUIO_Label
,
1981 "Filter multiselect", 0),
1985 Child
, list
.quiet_check
=
1987 MUIO_Checkmark
, NULL
),
1988 Child
, MUI_MakeObject(MUIO_Label
,
1992 Child
, list
.enable_button
=
1993 MUI_MakeObject(MUIO_Button
, "Enable"),
1995 Child
, MUI_MakeObject(MUIO_Label
,
1996 "Move/exchange mode 1:", 0),
1997 Child
, list
.move1_cycle
= CycleObject
,
1999 MUIA_Cycle_Entries
, list_move1_modes
,
2001 Child
, list
.move_button
=
2002 MUI_MakeObject(MUIO_Button
, "Move"),
2003 Child
, list
.sort_button
=
2004 MUI_MakeObject(MUIO_Button
, "Sort"),
2005 Child
, MUI_MakeObject(MUIO_Label
,
2007 Child
, list
.title_string
=
2012 Child
, MUI_MakeObject(MUIO_Label
,
2013 "Move/exchange mode 2:", 0),
2014 Child
, list
.move2_cycle
= CycleObject
,
2016 MUIA_Cycle_Entries
, list_move2_modes
,
2018 Child
, list
.exchange_button
=
2019 MUI_MakeObject(MUIO_Button
, "Exchange"),
2020 Child
, list
.redraw_button
=
2021 MUI_MakeObject(MUIO_Button
, "Redraw"),
2022 Child
, MUI_MakeObject(MUIO_Label
,
2024 Child
, list
.entries_text
= TextObject
,
2026 MUIA_Text_Contents
, "N/A",
2029 Child
, MUI_MakeObject(MUIO_Label
,
2031 Child
, list
.jump_cycle
= CycleObject
,
2033 MUIA_Cycle_Entries
, list_jump_modes
,
2035 Child
, list
.jump_button
=
2036 MUI_MakeObject(MUIO_Button
, "Jump"),
2037 Child
, list
.toggle_button
=
2038 MUI_MakeObject(MUIO_Button
, "Toggle"),
2039 Child
, MUI_MakeObject(MUIO_Label
,
2040 "Visible entries:", 0),
2041 Child
, list
.visible_text
= TextObject
,
2043 MUIA_Text_Contents
, "N/A",
2046 Child
, MUI_MakeObject(MUIO_Label
,
2047 "Select/redraw mode:", 0),
2048 Child
, list
.select_cycle
= CycleObject
,
2050 MUIA_Cycle_Entries
, list_select_modes
,
2052 Child
, list
.select_button
=
2053 MUI_MakeObject(MUIO_Button
, "Select"),
2054 Child
, list
.deselect_button
=
2055 MUI_MakeObject(MUIO_Button
, "Deselect"),
2056 Child
, MUI_MakeObject(MUIO_Label
,
2057 "First visible index:", 0),
2058 Child
, list
.first_text
= TextObject
,
2060 MUIA_Text_Contents
, "N/A",
2063 Child
, MUI_MakeObject(MUIO_Label
,
2065 Child
, list
.insert_cycle
= CycleObject
,
2067 MUIA_Cycle_Entries
, list_insert_modes
,
2069 Child
, list
.insert_single_button
=
2070 MUI_MakeObject(MUIO_Button
,
2072 Child
, list
.insert_multiple_button
=
2073 MUI_MakeObject(MUIO_Button
,
2075 Child
, MUI_MakeObject(MUIO_Label
,
2076 "Last insertion index:", 0),
2077 Child
, list
.insert_text
= TextObject
,
2079 MUIA_Text_Contents
, "N/A",
2082 Child
, MUI_MakeObject(MUIO_Label
,
2084 Child
, list
.remove_cycle
= CycleObject
,
2086 MUIA_Cycle_Entries
, list_remove_modes
,
2088 Child
, list
.remove_button
=
2089 MUI_MakeObject(MUIO_Button
, "Remove"),
2090 Child
, list
.clear_button
=
2091 MUI_MakeObject(MUIO_Button
, "Clear"),
2092 Child
, MUI_MakeObject(MUIO_Label
,
2093 "Active index:", 0),
2094 Child
, list
.active_text
= TextObject
,
2096 MUIA_Text_Contents
, "N/A",
2099 Child
, MUI_MakeObject(MUIO_Label
,
2100 "Activate mode:", 0),
2101 Child
, list
.activate_cycle
= CycleObject
,
2103 MUIA_Cycle_Entries
, list_activate_modes
,
2105 Child
, list
.activate_button
=
2106 MUI_MakeObject(MUIO_Button
, "Activate"),
2107 Child
, list
.deactivate_button
=
2109 MUIO_Button
, "Deactivate"),
2110 Child
, MUI_MakeObject(MUIO_Label
,
2111 "Selected entries:", 0),
2112 Child
, list
.selected_text
= TextObject
,
2114 MUIA_Text_Contents
, "N/A",
2121 Child
, MUI_MakeObject(MUIO_Label
,
2122 "Last drop index:", 0),
2123 Child
, list
.drop_text
= TextObject
,
2125 MUIA_Text_Contents
, "N/A",
2130 Child
, ColGroup(MULTI_LIST_COUNT
),
2132 GroupFrameT("Standard Format"),
2133 Child
, list
.multi_lists
[0] =
2138 MUIA_List_ConstructHook
,
2140 MUIA_List_DestructHook
,
2142 MUIA_List_DisplayHook
,
2144 MUIA_List_Format
, list_format
,
2145 MUIA_List_SourceArray
, entries
,
2146 MUIA_List_Title
, TRUE
,
2147 MUIA_List_AdjustWidth
, TRUE
,
2149 MUIA_Listview_MultiSelect
,
2150 MUIV_Listview_MultiSelect_None
,
2151 MUIA_Listview_DefClickColumn
, 1,
2155 Child
, VGroup
, GroupFrameT("Custom Format"),
2156 Child
, list
.multi_lists
[1] =
2161 MUIA_List_Format
, list_format
,
2162 MUIA_List_Title
, TRUE
,
2163 MUIA_List_AdjustHeight
, TRUE
,
2165 MUIA_Listview_MultiSelect
,
2166 MUIV_Listview_MultiSelect_None
,
2172 Child
, RectangleObject
,
2174 MUIA_Rectangle_HBar
, TRUE
,
2175 MUIA_Rectangle_BarTitle
, "List Controls",
2178 Child
, MUI_MakeObject(
2179 MUIO_Label
, "Format:", 0),
2180 Child
, list
.format_string
= StringObject
,
2184 Child
, list
.showheadings_check
=
2185 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2186 Child
, MUI_MakeObject(MUIO_Label
,
2187 "Show column headings", 0),
2188 Child
, list
.showimage_check
=
2189 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2190 Child
, MUI_MakeObject(MUIO_Label
,
2194 Child
, MUI_MakeObject(MUIO_Label
,
2195 "Default clicked column:", 0),
2196 Child
, list
.def_column_string
=
2199 MUIA_String_Accept
, (IPTR
)digits
,
2200 MUIA_String_Integer
, -1,
2203 Child
, MUI_MakeObject(MUIO_Label
,
2204 "Clicked column:", 0),
2205 Child
, list
.column_string
= StringObject
,
2208 Child
, list
.column_text
= TextObject
,
2210 MUIA_Text_Contents
, "N/A",
2223 MUIA_Gauge_InfoText
, "%ld %%",
2224 MUIA_Gauge_Horiz
, TRUE
,
2225 MUIA_Gauge_Current
, 25,
2234 MUIA_Gauge_InfoText
, "%ld %%",
2235 MUIA_Gauge_Horiz
, TRUE
,
2236 MUIA_Gauge_Current
, 50,
2245 MUIA_Gauge_InfoText
, "%ld %%",
2246 MUIA_Gauge_Horiz
, TRUE
,
2247 MUIA_Gauge_Current
, 75,
2257 MUIA_Gauge_InfoText
, "%ld %%",
2258 MUIA_Gauge_Current
, 25,
2262 MUIA_Gauge_InfoText
, "%ld %%",
2263 MUIA_Gauge_Current
, 50,
2267 MUIA_Gauge_InfoText
, "%ld %%",
2268 MUIA_Gauge_Current
, 75,
2277 GroupFrameT("Horizontal Sliders"),
2278 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
2279 Child
, numerics
[HNSLIDER
] = SliderObject
,
2280 MUIA_Slider_Horiz
, TRUE
,
2281 MUIA_Numeric_Min
, NUMERIC_MIN
,
2282 MUIA_Numeric_Max
, NUMERIC_MAX
,
2285 Child
, MUI_MakeObject(
2286 MUIO_Label
, "Reverse:", 0),
2287 Child
, numerics
[HRSLIDER
] = SliderObject
,
2288 MUIA_Numeric_Reverse
, TRUE
,
2289 MUIA_Numeric_Min
, NUMERIC_MIN
,
2290 MUIA_Numeric_Max
, NUMERIC_MAX
,
2293 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
2294 Child
, numerics
[HQSLIDER
] = SliderObject
,
2295 MUIA_Slider_Quiet
, TRUE
,
2296 MUIA_Numeric_Min
, NUMERIC_MIN
,
2297 MUIA_Numeric_Max
, NUMERIC_MAX
,
2302 GroupFrameT("Vertical Sliders"),
2303 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2304 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2305 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
2306 Child
, numerics
[VNSLIDER
] = SliderObject
,
2307 MUIA_Slider_Horiz
, FALSE
,
2308 MUIA_Numeric_Min
, NUMERIC_MIN
,
2309 MUIA_Numeric_Max
, NUMERIC_MAX
,
2312 Child
, numerics
[VRSLIDER
] = SliderObject
,
2313 MUIA_Slider_Horiz
, FALSE
,
2314 MUIA_Numeric_Reverse
, TRUE
,
2315 MUIA_Numeric_Min
, NUMERIC_MIN
,
2316 MUIA_Numeric_Max
, NUMERIC_MAX
,
2319 Child
, numerics
[VQSLIDER
] = SliderObject
,
2320 MUIA_Slider_Horiz
, FALSE
,
2321 MUIA_Slider_Quiet
, TRUE
,
2322 MUIA_Numeric_Min
, NUMERIC_MIN
,
2323 MUIA_Numeric_Max
, NUMERIC_MAX
,
2328 GroupFrameT("Numeric Buttons"),
2329 Child
, MUI_MakeObject(
2330 MUIO_Label
, "Normal:", 0),
2331 Child
, numerics
[NNUMERICBUTTON
] =
2332 NumericbuttonObject
,
2333 MUIA_Numeric_Min
, NUMERIC_MIN
,
2334 MUIA_Numeric_Max
, NUMERIC_MAX
,
2337 Child
, MUI_MakeObject(
2338 MUIO_Label
, "Reverse:", 0),
2339 Child
, numerics
[RNUMERICBUTTON
] =
2340 NumericbuttonObject
,
2341 MUIA_Numeric_Reverse
, TRUE
,
2342 MUIA_Numeric_Min
, NUMERIC_MIN
,
2343 MUIA_Numeric_Max
, NUMERIC_MAX
,
2348 GroupFrameT("Knobs"),
2349 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2350 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2351 Child
, numerics
[NKNOB
] = KnobObject
,
2352 MUIA_Numeric_Min
, NUMERIC_MIN
,
2353 MUIA_Numeric_Max
, NUMERIC_MAX
,
2356 Child
, numerics
[RKNOB
] = KnobObject
,
2357 MUIA_Numeric_Reverse
, TRUE
,
2358 MUIA_Numeric_Min
, NUMERIC_MIN
,
2359 MUIA_Numeric_Max
, NUMERIC_MAX
,
2364 Child
, MUI_MakeObject(MUIO_Label
,
2365 "Minimum Value:", 0),
2366 Child
, min_string
= (Object
*)StringObject
,
2368 MUIA_String_Accept
, (IPTR
)digits
,
2369 MUIA_String_Integer
, NUMERIC_MIN
,
2372 Child
, MUI_MakeObject(MUIO_Label
,
2373 "Maximum Value:", 0),
2374 Child
, max_string
= (Object
*)StringObject
,
2376 MUIA_String_Accept
, (IPTR
)digits
,
2377 MUIA_String_Integer
, NUMERIC_MAX
,
2380 Child
, slider_button
= TextObject
,
2382 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2384 MUIA_Background
, MUII_ButtonBack
,
2385 MUIA_Text_PreParse
, "\33c",
2387 "Change Slider Orientations",
2389 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
2398 MUIA_Radio_Entries
, radio_entries1
,
2400 Child
, country_radio
[0] = RadioObject
,
2402 MUIA_Radio_Entries
, radio_entries2
,
2403 MUIA_Radio_Active
, 1,
2409 MUIA_Radio_Entries
, radio_entries1
,
2411 Child
, country_radio
[1] = RadioObject
,
2413 MUIA_Radio_Entries
, radio_entries2
,
2414 MUIA_Radio_Active
, 1,
2419 #if defined(TEST_ICONLIST)
2422 Child
, volume_iconlist
=
2423 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
2425 Child
, drawer_iconlist
=
2426 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
2427 MUIA_IconDrawerList_Drawer
, "SYS:",
2434 Child
, create_balance_column(),
2435 Child
, BalanceObject
,
2438 Child
, create_balance_column(),
2439 Child
, BalanceObject
,
2442 Child
, create_balance_column(),
2443 Child
, BalanceObject
,
2446 Child
, create_balance_column(),
2447 Child
, BalanceObject
,
2450 Child
, create_balance_column(),
2457 Child
, about_button
= TextObject
,
2459 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2461 MUIA_Background
, MUII_ButtonBack
,
2462 MUIA_Text_PreParse
, "\33c",
2463 MUIA_Text_Contents
, "About",
2465 Child
, quit_button
= TextObject
,
2467 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2469 MUIA_Background
, MUII_ButtonBack
,
2470 MUIA_ControlChar
, 'q',
2471 MUIA_Text_HiChar
, 'q',
2472 MUIA_Text_PreParse
, "\33c",
2473 MUIA_Text_Contents
, "Quit",
2479 SubWindow
, second_wnd
= WindowObject
,
2480 MUIA_Window_Title
, "Second window",
2481 WindowContents
, VGroup
,
2482 Child
, DropTextObject
,
2483 MUIA_Text_Contents
, "Drop here",
2484 MUIA_Dropable
, TRUE
,
2492 result
= RETURN_FAIL
;
2495 if (result
== RETURN_OK
)
2499 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
2500 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2501 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
2502 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
2503 DoMethod(general
.open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2504 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
2505 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2506 MUIM_Application_AboutMUI
, NULL
);
2507 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2508 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2509 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2510 MUIM_CallHook
, &hook_objects
);
2511 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
2512 app
, 2, MUIM_CallHook
, &hook
);
2514 /* Notifications and set-up for string objects */
2515 DoMethod(string
.max_len_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
2516 "%ld", XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2517 set(string
.cursor_pos_slider
, MUIA_Numeric_Max
,
2518 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2519 set(string
.display_pos_slider
, MUIA_Numeric_Max
,
2520 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2521 set(string
.cr_advance_check
, MUIA_Selected
, TRUE
);
2522 set(string
.attach_list_check
, MUIA_Selected
, TRUE
);
2523 set(string
.strings
[1], MUIA_Disabled
,
2524 XGET(string
.strings
[1], MUIA_String_Format
)
2525 != MUIV_String_Format_Left
);
2526 set(string
.strings
[2], MUIA_Disabled
,
2527 XGET(string
.strings
[2], MUIA_String_Format
)
2528 != MUIV_String_Format_Right
);
2529 set(string
.strings
[3], MUIA_Disabled
,
2530 XGET(string
.strings
[3], MUIA_String_Format
)
2531 != MUIV_String_Format_Center
);
2532 set(string
.strings
[4], MUIA_Disabled
,
2533 !XGET(string
.strings
[4], MUIA_String_Secret
));
2534 set(string
.strings
[0], MUIA_String_MaxLen
, 100);
2535 set(string
.reject_string
, MUIA_String_Contents
,
2536 (IPTR
)default_reject_chars
);
2538 for (i
= 0; i
< STRING_COUNT
; i
++)
2542 DoMethod(string
.accept_string
, MUIM_Notify
,
2543 MUIA_String_Contents
, MUIV_EveryTime
, string
.strings
[i
],
2544 3, MUIM_Set
, MUIA_String_Accept
, MUIV_TriggerValue
);
2545 DoMethod(string
.cr_advance_check
, MUIM_Notify
, MUIA_Selected
,
2546 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2547 MUIA_String_AdvanceOnCR
, MUIV_TriggerValue
);
2548 DoMethod(string
.cursor_pos_slider
, MUIM_Notify
,
2549 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2550 MUIM_Set
, MUIA_String_BufferPos
, MUIV_TriggerValue
);
2551 DoMethod(string
.display_pos_slider
, MUIM_Notify
,
2552 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2553 MUIM_Set
, MUIA_String_DisplayPos
, MUIV_TriggerValue
);
2554 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2555 TRUE
, string
.strings
[i
], 3, MUIM_Set
,
2556 MUIA_String_AttachedList
, list
.lists
[0]);
2557 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2558 FALSE
, string
.strings
[i
], 3, MUIM_Set
,
2559 MUIA_String_AttachedList
, NULL
);
2563 DoMethod(string
.strings
[0], MUIM_Notify
, MUIA_String_Accept
,
2564 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2565 MUIA_String_Accept
, MUIV_TriggerValue
);
2566 DoMethod(string
.strings
[0], MUIM_Notify
,
2567 MUIA_String_AdvanceOnCR
, MUIV_EveryTime
,
2568 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_AdvanceOnCR
,
2570 DoMethod(string
.strings
[0], MUIM_Notify
,
2571 MUIA_String_BufferPos
, MUIV_EveryTime
,
2572 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_BufferPos
,
2574 DoMethod(string
.strings
[0], MUIM_Notify
,
2575 MUIA_String_DisplayPos
, MUIV_EveryTime
,
2576 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_DisplayPos
,
2578 DoMethod(string
.strings
[0], MUIM_Notify
,
2579 MUIA_String_AttachedList
, MUIV_EveryTime
,
2580 string
.strings
[i
], 3, MUIM_Set
,
2581 MUIA_String_AttachedList
, MUIV_TriggerValue
);
2583 DoMethod(string
.reject_string
, MUIM_Notify
, MUIA_String_Contents
,
2584 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2585 MUIA_String_Reject
, MUIV_TriggerValue
);
2586 DoMethod(string
.strings
[i
], MUIM_Notify
, MUIA_String_Integer
,
2587 MUIV_EveryTime
, string
.integer_string
, 3, MUIM_NoNotifySet
,
2588 MUIA_String_Integer
, MUIV_TriggerValue
);
2589 DoMethod(string
.integer_string
, MUIM_Notify
, MUIA_String_Integer
,
2590 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_NoNotifySet
,
2591 MUIA_String_Integer
, MUIV_TriggerValue
);
2593 DoMethod(string
.accept_all_check
, MUIM_Notify
, MUIA_Selected
,
2594 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2595 ChangeStringAccept
);
2596 DoMethod(string
.strings
[4], MUIM_Notify
, MUIA_String_Acknowledge
,
2597 MUIV_EveryTime
, string
.plaintext_string
, 3, MUIM_NoNotifySet
,
2598 MUIA_String_Contents
, MUIV_TriggerValue
);
2599 DoMethod(string
.plaintext_string
, MUIM_Notify
,
2600 MUIA_String_Acknowledge
, MUIV_EveryTime
, string
.strings
[4], 3,
2601 MUIM_NoNotifySet
, MUIA_String_Contents
, MUIV_TriggerValue
);
2603 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
2604 MUIM_CallHook
, &hook_wheel
);
2605 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
2606 2, MUIM_CallHook
, &hook_wheel
);
2607 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2608 app
, 2, MUIM_CallHook
, &hook_slider
);
2609 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2610 app
, 2, MUIM_CallHook
, &hook_slider
);
2611 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2612 app
, 2, MUIM_CallHook
, &hook_slider
);
2614 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
2615 MUIM_CallHook
, &hook_standard
, Save
);
2617 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2618 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
2619 MUIV_Application_ReturnID_Quit
);
2620 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2621 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2624 /* Notifications for color objects */
2625 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Red
,
2626 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2628 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Green
,
2629 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2631 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Blue
,
2632 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2634 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Red
,
2635 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2637 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Green
,
2638 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2640 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Blue
,
2641 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2643 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Pen
,
2644 MUIV_EveryTime
, colorfield_pen
, 3, MUIM_Set
,
2645 MUIA_String_Integer
, MUIV_TriggerValue
);
2646 DoMethod(colorfield_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2647 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2649 DoMethod(colorfield_reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2650 colorfield
, 3, MUIM_Set
, MUIA_Colorfield_RGB
, default_color
);
2652 /* Notifications for pen objects */
2653 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Pen
,
2654 MUIV_EveryTime
, pendisplay_pen
, 3, MUIM_NoNotifySet
,
2655 MUIA_String_Integer
, MUIV_TriggerValue
);
2656 DoMethod(pendisplay_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2657 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2658 ChangePendisplayPen
);
2659 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Spec
,
2660 MUIV_EveryTime
, pendisplay_spec
, 3, MUIM_Set
,
2661 MUIA_String_Contents
, MUIV_TriggerValue
);
2662 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_RGB
,
2663 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
,
2664 MUIA_Pendisplay_RGBcolor
, MUIV_TriggerValue
);
2665 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_RGBcolor
,
2666 MUIV_EveryTime
, poppen
, 3, MUIM_Set
, MUIA_Pendisplay_RGBcolor
,
2668 DoMethod(pendisplay_spec
, MUIM_Notify
, MUIA_String_Contents
,
2669 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
, MUIA_Pendisplay_Spec
,
2671 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, TRUE
,
2672 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, pendisplay
);
2673 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, FALSE
,
2674 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, NULL
);
2675 DoMethod(shine_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2676 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHINE
);
2677 DoMethod(shadow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2678 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHADOW
);
2679 DoMethod(yellow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2680 4, MUIM_Pendisplay_SetRGB
, 0xffffffff, 0xffffffff, 0);
2682 /* Notifications and set-up for list objects */
2683 set(list
.showdropmarks_check
, MUIA_Selected
, TRUE
);
2685 for (i
= 0; i
< LIST_COUNT
; i
++)
2687 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2688 MUIV_EveryTime
, list
.lists
[i
], 3, MUIM_Set
, MUIA_Disabled
,
2690 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Entries
,
2691 MUIV_EveryTime
, list
.entries_text
, 4, MUIM_SetAsString
,
2692 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2693 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Visible
,
2694 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2696 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_First
,
2697 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2699 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_InsertPosition
,
2700 MUIV_EveryTime
, list
.insert_text
, 4, MUIM_SetAsString
,
2701 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2702 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Active
,
2703 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2705 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_SelectChange
,
2706 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2709 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2710 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2712 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2713 MUIV_EveryTime
, list
.dragsortable_check
, 3, MUIM_Set
,
2714 MUIA_Disabled
, MUIV_NotTriggerValue
);
2715 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2716 FALSE
, list
.dragsortable_check
, 3, MUIM_Set
,
2717 MUIA_Selected
, FALSE
);
2718 DoMethod(list
.showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
2719 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2720 ListSetShowDropMarks
);
2721 DoMethod(list
.multitest_check
, MUIM_Notify
, MUIA_Selected
,
2722 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2724 DoMethod(list
.quiet_check
, MUIM_Notify
, MUIA_Selected
,
2725 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2727 DoMethod(list
.dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
2728 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2729 ListSetDragSortable
);
2730 DoMethod(list
.autovisible_check
, MUIM_Notify
, MUIA_Selected
,
2731 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2732 ListSetAutoVisible
);
2733 DoMethod(list
.reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2734 app
, 3, MUIM_CallHook
, &hook_standard
, ListReset
);
2735 DoMethod(list
.move_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2736 app
, 3, MUIM_CallHook
, &hook_standard
, ListMove
);
2737 DoMethod(list
.sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2738 app
, 3, MUIM_CallHook
, &hook_standard
, ListSort
);
2739 DoMethod(list
.enable_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2740 app
, 3, MUIM_CallHook
, &hook_standard
, ListEnable
);
2741 DoMethod(list
.exchange_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2742 app
, 3, MUIM_CallHook
, &hook_standard
, ListExchange
);
2743 DoMethod(list
.jump_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2744 app
, 3, MUIM_CallHook
, &hook_standard
, ListJump
);
2745 DoMethod(list
.select_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2746 app
, 3, MUIM_CallHook
, &hook_standard
, ListSelect
);
2747 DoMethod(list
.deselect_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2748 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeselect
);
2749 DoMethod(list
.toggle_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2750 app
, 3, MUIM_CallHook
, &hook_standard
, ListToggle
);
2751 DoMethod(list
.redraw_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2752 app
, 3, MUIM_CallHook
, &hook_standard
, ListRedraw
);
2753 DoMethod(list
.insert_single_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2754 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsertSingle
);
2755 DoMethod(list
.insert_multiple_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2756 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsert
);
2757 DoMethod(list
.remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2758 app
, 3, MUIM_CallHook
, &hook_standard
, ListRemove
);
2759 DoMethod(list
.clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2760 app
, 3, MUIM_CallHook
, &hook_standard
, ListClear
);
2761 DoMethod(list
.activate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2762 app
, 3, MUIM_CallHook
, &hook_standard
, ListActivate
);
2763 DoMethod(list
.deactivate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2764 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeactivate
);
2765 DoMethod(list
.title_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2766 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2768 DoMethod(list
.list_radios
, MUIM_Notify
, MUIA_Radio_Active
,
2769 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2771 SET(list
.lists
[4], MUIA_List_CompareHook
, &hook_compare
);
2772 SET(list
.lists
[4], MUIA_List_AutoVisible
, TRUE
);
2774 SET(list
.showheadings_check
, MUIA_Selected
,
2775 XGET(list
.multi_lists
[0], MUIA_List_Title
));
2776 SET(list
.format_string
, MUIA_String_Contents
,
2777 XGET(list
.multi_lists
[1], MUIA_List_Format
));
2778 SET(list
.def_column_string
, MUIA_String_Integer
,
2779 XGET(list
.multi_lists
[0], MUIA_Listview_DefClickColumn
));
2780 DoMethod(list
.format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2781 MUIV_EveryTime
, list
.multi_lists
[1], 3, MUIM_Set
,
2782 MUIA_List_Format
, MUIV_TriggerValue
);
2783 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_List_Format
,
2784 MUIV_EveryTime
, wnd
, 3, MUIM_Set
,
2785 MUIA_Window_ActiveObject
, list
.format_string
);
2786 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
2788 DoMethod(list
.showheadings_check
, MUIM_Notify
, MUIA_Selected
,
2789 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2790 MUIA_List_Title
, MUIV_TriggerValue
);
2791 DoMethod(list
.showimage_check
, MUIM_Notify
, MUIA_Selected
,
2792 MUIV_EveryTime
, list
.multi_lists
[i
], 2, MUIM_List_Redraw
,
2793 MUIV_List_Redraw_All
);
2794 DoMethod(list
.def_column_string
, MUIM_Notify
,
2795 MUIA_String_Integer
,
2796 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2797 MUIA_Listview_DefClickColumn
, MUIV_TriggerValue
);
2798 DoMethod(list
.multi_lists
[i
], MUIM_Notify
,
2799 MUIA_Listview_ClickColumn
, MUIV_EveryTime
,
2800 list
.column_string
, 3, MUIM_Set
, MUIA_String_Integer
,
2803 DoMethod(list
.column_string
, MUIM_Notify
, MUIA_String_Contents
,
2804 MUIV_EveryTime
, list
.column_text
, 3, MUIM_Set
, MUIA_Text_Contents
,
2806 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2807 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2808 CheckListDoubleClick
);
2809 SET(list
.multi_lists
[1], MUIA_List_ConstructHook
, &hook_construct
);
2810 SET(list
.multi_lists
[1], MUIA_List_DestructHook
, &hook_destruct
);
2811 SET(list
.multi_lists
[1], MUIA_List_DisplayHook
, &hook_display
);
2812 DoMethod(list
.multi_lists
[1], MUIM_List_Insert
, entries
, -1,
2813 MUIV_List_Insert_Top
);
2815 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
2816 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
2819 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
2821 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
2822 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
2824 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
2825 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
2828 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2829 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
2832 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
2833 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
2834 MUIA_Radio_Active
, MUIV_TriggerValue
);
2835 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
2836 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
2837 MUIA_Radio_Active
, MUIV_TriggerValue
);
2839 #if defined(TEST_ICONLIST)
2841 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2842 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2843 volume_doubleclicked
);
2844 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2845 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2846 drawer_doubleclicked
);
2849 /* automatic tests */
2850 get(list
.lists
[0], MUIA_List_Visible
, &value
);
2852 printf("MUIA_List_Visible equals %ld before display,"
2853 " but it should be -1.\n", (long)value
);
2854 get(list
.multi_lists
[0], MUIA_Listview_ClickColumn
, &value
);
2856 printf("MUIA_Listview_ClickColumn equals %ld before display,"
2857 " but it should be 0.\n", (long)value
);
2858 get(list
.lists
[0], MUIA_Listview_DoubleClick
, &value
);
2860 printf("MUIA_Listview_DoubleClick equals %ld before display,"
2861 " but it should be 0.\n", (long)value
);
2863 set(wnd
, MUIA_Window_Open
, TRUE
);
2864 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test Application");
2866 list
.image
= DoMethod(list
.multi_lists
[0], MUIM_List_CreateImage
,
2867 list
.colorfield
, 0);
2869 /* Set pen fields */
2870 set(colorfield_pen
, MUIA_String_Integer
,
2871 XGET(colorfield
, MUIA_Colorfield_Pen
));
2874 nnset(pendisplay_pen
, MUIA_String_Integer
,
2875 XGET(pendisplay
, MUIA_Pendisplay_Pen
));
2877 struct MUI_PenSpec
*pen_spec
= NULL
;
2878 GET(pendisplay
, MUIA_Pendisplay_Spec
, &pen_spec
);
2879 strncpy(pen_str
, pen_spec
->buf
, 10);
2880 set(pendisplay_spec
, MUIA_String_Contents
, pen_str
);
2882 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
2883 &sigs
) != MUIV_Application_ReturnID_Quit
)
2887 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
2888 if (sigs
& SIGBREAKF_CTRL_C
)
2890 if (sigs
& SIGBREAKF_CTRL_D
)
2895 DoMethod(list
.multi_lists
[0], MUIM_List_DeleteImage
, list
.image
);
2896 MUI_DisposeObject(app
);
2899 MUI_DisposeObject(context_menu
);
2900 CloseLibrary(ColorWheelBase
);
2901 MUI_DeleteCustomClass(test_window_class
);
2902 MUI_DeleteCustomClass(CL_DropText
);
2904 /* automatic tests */
2905 if (list
.destruct_count
!= 18)
2906 printf("The hook installed through MUIA_List_DestructHook has been"
2907 " called %ld times, but should have been called 18 times.\n",
2908 (long)list
.destruct_count
);
2910 CloseLibrary(MUIMasterBase
);