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 default_accept_chars
[] = "aeiou?.";
50 static const TEXT default_reject_chars
[] = "*?";
51 static const ULONG default_color
[] = {155 << 24, 180 << 24, 255 << 24};
52 static const struct MUI_PenSpec default_penspec
= {"m0"};
53 static const char *fruits
[] = {"Strawberry", "Apple", "Banana", "Orange",
54 "Grapefruit", "Kumquat", "Plum", "Raspberry", "Apricot", "Grape",
55 "Peach", "Lemon", "Lime", "Date", "Pineapple", "Blueberry", "Papaya",
56 "Cranberry", "Gooseberry", "Pear", "Fig", "Coconut", "Melon",
58 static const char *empty
[] = {"", "", "", "", "", NULL
};
59 static const LONG list_active_positions
[] =
62 MUIV_List_Active_Bottom
,
67 static const CONST_STRPTR list_move1_modes
[] =
68 {"Index", "Top", "Active", "Bottom", NULL
};
69 static const CONST_STRPTR list_move2_modes
[] =
70 {"Index", "Top", "Active", "Bottom", "Next", "Previous", NULL
};
71 static const CONST_STRPTR list_jump_modes
[] =
72 {"Index", "Top", "Active", "Bottom", "Down", "Up", NULL
};
73 static const CONST_STRPTR list_insert_modes
[] =
74 {"Index", "Top", "Active", "Sorted", "Bottom", NULL
};
75 static const CONST_STRPTR list_remove_modes
[] =
76 {"Index", "First", "Active", "Last", "Selected", "Unsafe Loop",
78 static const CONST_STRPTR list_activate_modes
[] =
79 {"Index", "Top", "Bottom", "Up", "Down", "Page Up", "Page Down", NULL
};
80 static const CONST_STRPTR list_select_modes
[] =
81 {"Index", "Active", "All", NULL
};
82 static const TEXT list_format
[] = "BAR,BAR,";
99 struct Library
*MUIMasterBase
;
100 struct Library
*ColorWheelBase
;
112 Object
*strings
[STRING_COUNT
],
122 *standard_hook_check
,
130 Object
*lists
[LIST_COUNT
],
153 *insert_single_button
,
154 *insert_multiple_button
,
159 *showdropmarks_check
,
167 *multi_lists
[MULTI_LIST_COUNT
],
173 LONG quiet
[LIST_COUNT
],
178 static Object
*wheel
;
179 static Object
*r_slider
;
180 static Object
*g_slider
;
181 static Object
*b_slider
;
182 static Object
*hue_gauge
;
183 static Object
*colorfield
, *colorfield2
, *colorfield_reset_button
,
185 static Object
*coloradjust
;
186 static Object
*pendisplay
, *pendisplay2
, *pendisplay_pen
, *pendisplay_spec
,
187 *reference_check
, *shine_button
, *shadow_button
, *yellow_button
, *poppen
;
188 static Object
*group
;
189 static Object
*editor_text
;
190 static Object
*filename_string
;
191 static Object
*save_button
;
193 #if defined(TEST_ICONLIST)
194 static Object
*drawer_iconlist
;
195 static Object
*volume_iconlist
;
198 AROS_UFH0(void, repeat_function
)
202 printf("MUI_Timer\n");
207 AROS_UFH0(void, wheel_function
)
211 nnset(r_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
212 WHEEL_Red
) >> 24) & 0xff);
213 nnset(g_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
214 WHEEL_Green
) >> 24) & 0xff);
215 nnset(b_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
216 WHEEL_Blue
) >> 24) & 0xff);
221 AROS_UFH0(void, slider_function
)
225 struct ColorWheelRGB cw
;
226 ULONG red
= XGET(r_slider
, MUIA_Numeric_Value
);
227 ULONG green
= XGET(g_slider
, MUIA_Numeric_Value
);
228 ULONG blue
= XGET(b_slider
, MUIA_Numeric_Value
);
230 cw
.cw_Red
= (red
<< 24) | (red
<< 16) | (red
<< 8) | red
;
231 cw
.cw_Green
= (green
<< 24) | (green
<< 16) | (green
<< 8) | green
;
232 cw
.cw_Blue
= (blue
<< 24) | (blue
<< 16) | (blue
<< 8) | blue
;
234 nnset(wheel
, WHEEL_RGB
, &cw
);
235 set(hue_gauge
, MUIA_Gauge_Current
, XGET(wheel
, WHEEL_Hue
));
240 AROS_UFH0(void, objects_function
)
244 Object
*new_obj
= MUI_MakeObject(MUIO_Button
, "Button");
247 DoMethod(group
, MUIM_Group_InitChange
);
248 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
249 DoMethod(group
, MUIM_Group_ExitChange
);
255 static void About(void)
257 static Object
*about_wnd
;
261 about_wnd
= AboutmuiObject
, MUIA_Aboutmui_Application
, app
, End
;
265 set(about_wnd
, MUIA_Window_Open
, TRUE
);
268 static void ChangeStringAccept(void)
270 STRPTR accept_chars
= NULL
, reject_chars
= NULL
;
274 accept_all
= XGET(string
.accept_all_check
, MUIA_Selected
);
275 SET(string
.accept_string
, MUIA_Disabled
, accept_all
);
276 SET(string
.reject_string
, MUIA_Disabled
, accept_all
);
280 GET(string
.accept_string
, MUIA_String_Contents
, &accept_chars
);
281 GET(string
.reject_string
, MUIA_String_Contents
, &reject_chars
);
284 for (i
= 0; i
< STRING_COUNT
; i
++)
286 SET(string
.strings
[i
], MUIA_String_Accept
, accept_chars
);
287 SET(string
.strings
[i
], MUIA_String_Reject
, reject_chars
);
291 static void ChangePen(void)
295 GET(colorfield_pen
, MUIA_String_Integer
, &pen
);
297 SET(colorfield
, MUIA_Colorfield_Pen
, pen
);
300 static void ChangePendisplayPen(void)
302 DoMethod(pendisplay
, MUIM_Pendisplay_SetColormap
,
303 XGET(pendisplay_pen
, MUIA_String_Integer
));
306 static void ChangeListTitle(void)
311 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
313 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
316 GET(list
.title_string
, MUIA_String_Contents
, &title
);
317 if (title
[0] == '\0')
320 title
= StrDup(title
);
322 SET(list
.lists
[i
], MUIA_List_Title
, title
);
325 static void UpdateListInfo(void)
331 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
333 GET(list
.lists
[i
], MUIA_List_DragSortable
, &value
);
334 NNSET(list
.dragsortable_check
, MUIA_Selected
, value
);
335 GET(list
.lists
[i
], MUIA_List_ShowDropMarks
, &value
);
336 NNSET(list
.showdropmarks_check
, MUIA_Selected
, value
);
337 value
= list
.quiet
[i
]; // MUIA_List_Quiet is not gettable!
338 NNSET(list
.quiet_check
, MUIA_Selected
, value
);
339 GET(list
.lists
[i
], MUIA_List_AutoVisible
, &value
);
340 NNSET(list
.autovisible_check
, MUIA_Selected
, value
);
342 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
343 NNSET(list
.title_string
, MUIA_String_Contents
, title
);
345 GET(list
.lists
[i
], MUIA_List_Entries
, &value
);
346 DoMethod(list
.entries_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
348 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
349 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
351 GET(list
.lists
[i
], MUIA_List_First
, &value
);
352 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
354 GET(list
.lists
[i
], MUIA_List_InsertPosition
, &value
);
355 DoMethod(list
.insert_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
357 GET(list
.lists
[i
], MUIA_List_Active
, &value
);
358 if (value
== MUIV_List_Active_Off
)
359 SET(list
.active_text
, MUIA_Text_Contents
, "N/A");
361 DoMethod(list
.active_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
365 static void ListGetVisible(void)
370 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
372 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
373 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
377 static void ListGetFirst(void)
383 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
385 /* We fetch the Listview's list here to provide test coverage for that
386 attribute. Please don't optimise */
387 real_list
= (Object
*)XGET(list
.lists
[i
], MUIA_Listview_List
);
388 GET(real_list
, MUIA_List_First
, &value
);
389 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
393 static void ListSetDragSortable(void)
398 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
400 GET(list
.dragsortable_check
, MUIA_Selected
, &value
);
401 SET(list
.lists
[i
], MUIA_List_DragSortable
, value
);
404 static void ListSetShowDropMarks(void)
409 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
411 GET(list
.showdropmarks_check
, MUIA_Selected
, &value
);
412 SET(list
.lists
[i
], MUIA_List_ShowDropMarks
, value
);
415 static void ListSetQuiet(void)
420 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
422 GET(list
.quiet_check
, MUIA_Selected
, &value
);
423 SET(list
.lists
[i
], MUIA_List_Quiet
, value
);
424 list
.quiet
[i
] = value
;
427 static void ListSetAutoVisible(void)
432 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
434 GET(list
.autovisible_check
, MUIA_Selected
, &value
);
435 SET(list
.lists
[i
], MUIA_List_AutoVisible
, value
);
438 static void ListReset(void)
442 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
444 SET(list
.lists
[i
], MUIA_List_Active
, list_active_positions
[i
]);
447 static void ListMove(void)
449 LONG mode
, pos1
, pos2
;
452 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
454 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
457 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
461 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
464 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
468 DoMethod(list
.lists
[i
], MUIM_List_Move
, pos1
, pos2
);
471 static void ListSort(void)
475 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
477 DoMethod(list
.lists
[i
], MUIM_List_Sort
);
480 static void ListEnable(void)
484 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
486 SET(list
.lists
[i
], MUIA_Disabled
, FALSE
);
489 static void ListExchange(void)
491 LONG mode
, pos1
, pos2
;
494 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
496 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
499 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
503 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
506 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
510 DoMethod(list
.lists
[i
], MUIM_List_Exchange
, pos1
, pos2
);
513 static void ListJump(void)
518 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
520 mode
= XGET(list
.jump_cycle
, MUIA_Cycle_Active
);
523 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
527 DoMethod(list
.lists
[i
], MUIM_List_Jump
, pos
);
530 static void ListSelect(void)
535 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
537 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
540 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
544 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_On
,
548 static void ListDeselect(void)
553 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
555 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
558 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
562 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_Off
,
566 static void ListToggle(void)
571 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
573 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
576 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
580 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
,
581 MUIV_List_Select_Toggle
, NULL
);
584 static void ListRedraw(void)
589 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
591 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
594 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
598 DoMethod(list
.lists
[i
], MUIM_List_Redraw
, pos
);
601 static void ListInsertSingle(void)
606 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
608 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
611 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
615 DoMethod(list
.lists
[i
], MUIM_List_InsertSingle
, "Tomato", pos
);
618 static void ListInsert(void)
623 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
625 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
628 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
632 DoMethod(list
.lists
[i
], MUIM_List_Insert
, fruits
, -1, pos
);
635 static void ListRemove(void)
637 LONG mode
, pos
, count
, j
, *selections
;
640 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
642 mode
= XGET(list
.remove_cycle
, MUIA_Cycle_Active
);
646 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
647 This doesn't work as expected in MUI or Zune */
648 pos
= MUIV_List_NextSelected_Start
- 1;
649 while (pos
!= MUIV_List_NextSelected_End
)
651 if (pos
== MUIV_List_NextSelected_Start
- 1)
653 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
654 if (pos
!= MUIV_List_NextSelected_End
)
655 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
660 /* Remove selected entries safely by first retrieving them with
661 MUIM_List_NextSelected and then removing them one by one */
662 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
663 MUIV_List_Select_Ask
, &count
);
664 selections
= AllocVec(sizeof(LONG
) * count
, MEMF_ANY
);
665 if (selections
!= NULL
)
667 pos
= MUIV_List_NextSelected_Start
;
668 for (j
= 0; j
< count
; j
++)
670 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
674 /* We must remove the entries in reverse order; otherwise the
675 later indices will become invalid */
677 DoMethod(list
.lists
[i
], MUIM_List_Remove
, selections
[--count
]);
684 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
687 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
691 static void ListClear(void)
695 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
697 DoMethod(list
.lists
[i
], MUIM_List_Clear
);
700 static void ListActivate(void)
705 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
707 mode
= XGET(list
.activate_cycle
, MUIA_Cycle_Active
);
710 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
714 SET(list
.lists
[i
], MUIA_List_Active
, pos
);
717 static void ListDeactivate(void)
721 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
723 SET(list
.lists
[i
], MUIA_List_Active
, MUIV_List_Active_Off
);
726 static void CheckListDoubleClick(void)
730 GET(list
.multi_lists
[1], MUIA_Listview_DoubleClick
, &value
);
731 MUI_Request(app
, wnd
, 0, "Test", "OK",
732 "MUIA_Listview_Doubleclick = %ld", value
);
735 AROS_UFH3(static APTR
, ListConstructHook
,
736 AROS_UFHA(struct Hook
*, h
, A0
),
737 AROS_UFHA(APTR
, pool
, A2
),
738 AROS_UFHA(IPTR
, n
, A1
))
742 struct list_entry
*entry
;
744 entry
= AllocPooled(pool
, sizeof(struct list_entry
) + 40);
748 entry
->column1
= (char *)(entry
+ 1);
749 entry
->column2
= entry
->column1
+ 20;
750 sprintf(entry
->column1
, "Entry%ld", (long)n
);
751 sprintf(entry
->column2
, "Col2: Entry%ld", (long)n
);
759 AROS_UFH3(static void, ListDestructHook
,
760 AROS_UFHA(struct Hook
*, h
, A0
),
761 AROS_UFHA(APTR
, pool
, A2
),
762 AROS_UFHA(struct list_entry
*, entry
, A1
))
766 FreePooled(pool
, entry
, sizeof(struct list_entry
) + 40);
767 list
.destruct_count
++;
772 AROS_UFH3(static void, display_function
,
773 AROS_UFHA(struct Hook
*, h
, A0
),
774 AROS_UFHA(char **, strings
, A2
),
775 AROS_UFHA(struct list_entry
*, entry
, A1
))
779 static char buf
[100];
783 sprintf(buf
, "%ld", (long)*(strings
- 1));
785 strings
[1] = entry
->column1
;
786 strings
[2] = entry
->column2
;
790 strings
[0] = "Number";
791 strings
[1] = "Column 1";
792 strings
[2] = "Column 2";
798 static void Save(void)
800 char *text
= (char *)XGET(editor_text
, MUIA_String_Contents
);
801 char *filename
= (char *)XGET(filename_string
, MUIA_String_Contents
);
804 if (!strlen(filename
))
807 if ((fh
= Open(filename
, MODE_NEWFILE
)))
809 Write(fh
, text
, strlen(text
));
814 #if defined(TEST_ICONLIST)
815 /* IconList callbacks */
816 static void volume_doubleclicked(void)
819 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
821 DoMethod(volume_iconlist
, MUIM_IconList_NextIcon
,
822 MUIV_IconList_NextIcon_Selected
, &ent
);
823 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
826 strcpy(buf
, ent
->label
);
830 static void drawer_doubleclicked(void)
832 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
834 DoMethod(drawer_iconlist
, MUIM_IconList_NextIcon
,
835 MUIV_IconList_NextIcon_Selected
, &ent
);
836 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
838 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
,
839 ent
->ile_IconEntry
->ie_IconNode
.ln_Name
);
843 static IPTR
create_balance_column(void)
845 return (IPTR
) VGroup
,
846 Child
, RectangleObject
,
849 Child
, BalanceObject
,
851 Child
, RectangleObject
,
854 Child
, BalanceObject
,
856 Child
, RectangleObject
,
859 Child
, BalanceObject
,
861 Child
, RectangleObject
,
864 Child
, BalanceObject
,
866 Child
, RectangleObject
,
872 /* The custom class */
881 struct Library
*KeymapBase
;
885 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
,
886 register __a2 Object
*obj
, register __a1 Msg msg
)
888 AROS_UFH3S(IPTR
, dispatcher
,
889 AROS_UFHA(Class
*, cl
, A0
),
890 AROS_UFHA(Object
*, obj
, A2
), AROS_UFHA(Msg
, msg
, A1
))
895 switch (msg
->MethodID
)
898 return MUIV_DragQuery_Accept
;
901 struct DropText_Data
*data
=
902 (struct DropText_Data
*)INST_DATA(cl
, obj
);
905 sprintf(buf
, "%ld times", (long)data
->times
);
906 set(obj
, MUIA_Text_Contents
, buf
);
910 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
915 static struct MUI_CustomClass
*CL_DropText
;
917 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
921 static struct Hook hook_standard
;
923 AROS_UFH3S(void, hook_func_standard
,
924 AROS_UFHA(struct Hook
*, h
, A0
),
925 AROS_UFHA(void *, dummy
, A2
), AROS_UFHA(void **, funcptr
, A1
))
929 void (*func
) (ULONG
*) = (void (*)(ULONG
*))(*funcptr
);
932 func((ULONG
*) funcptr
+ 1);
942 Object
*about_button
;
944 Object
*repeat_button
;
945 Object
*objects_button
;
946 Object
*about_item
, *quit_item
;
947 Object
*context_menu
;
948 Object
*popobject
, *listview
;
949 Object
*numerics
[NUMERIC_COUNT
];
950 Object
*min_string
, *max_string
;
951 Object
*slider_button
;
952 Object
*country_radio
[2];
957 static char *pages
[] =
958 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
960 #if defined(TEST_ICONLIST)
964 static char *text_pages
[] =
965 {"Text", "String", NULL
};
966 static char *color_pages
[] =
967 {"Palette", "Colors", "Pens", NULL
};
968 static char *list_pages
[] =
969 {"Single Column", "Multicolumn", NULL
};
970 static char **radio_entries1
= pages
;
971 static char *radio_entries2
[] =
972 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL
};
974 static IPTR entries
[] = {1, 2, 3, 4, 5, 6, (IPTR
)NULL
};
977 struct Hook hook_wheel
;
978 struct Hook hook_slider
;
979 struct Hook hook_objects
;
980 struct Hook hook_construct
, hook_destruct
, hook_display
;
982 hook_standard
.h_Entry
= (HOOKFUNC
) hook_func_standard
;
984 pool
= CreatePool(MEMF_ANY
, 4096, 4096);
986 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library", 0);
988 hook
.h_Entry
= (HOOKFUNC
) repeat_function
;
989 hook_wheel
.h_Entry
= (HOOKFUNC
) wheel_function
;
990 hook_slider
.h_Entry
= (HOOKFUNC
) slider_function
;
991 hook_objects
.h_Entry
= (HOOKFUNC
) objects_function
;
992 hook_construct
.h_Entry
= (HOOKFUNC
) ListConstructHook
;
993 hook_destruct
.h_Entry
= (HOOKFUNC
) ListDestructHook
;
994 hook_display
.h_Entry
= (HOOKFUNC
) display_function
;
995 list
.destruct_count
= 0;
997 context_menu
= MenustripObject
,
998 MUIA_Family_Child
, MenuObject
,
999 MUIA_Menu_Title
, "Menutest",
1000 MUIA_Family_Child
, about_item
= MenuitemObject
,
1001 MUIA_Menuitem_Title
, "First Test Entry", End
,
1002 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1003 MUIA_Menuitem_Title
, "Second Test Entry", End
,
1007 /* should check the result in a real program! */
1008 CL_DropText
= MUI_CreateCustomClass(NULL
, MUIC_Text
, NULL
,
1009 sizeof(struct DropText_Data
), dispatcher
);
1010 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget", 0);
1012 pendisplay
= PendisplayObject
, MUIA_Pendisplay_Spec
, &default_penspec
, End
;
1014 title
= StrDup("Fruits");
1015 list
.lists
[0] = ListviewObject
,
1019 MUIA_List_Title
, title
,
1020 MUIA_List_SourceArray
, fruits
,
1021 MUIA_List_Active
, MUIV_List_Active_Top
,
1022 MUIA_List_PoolThreshSize
, 256,
1023 MUIA_List_DragSortable
, TRUE
,
1024 MUIA_ShortHelp
, "Default scroller\nTop entry active",
1026 MUIA_Listview_MultiSelect
,
1027 MUIV_Listview_MultiSelect_None
,
1028 MUIA_Listview_DoubleClick
, TRUE
,
1031 list
.lists
[1] = ListviewObject
,
1035 MUIA_List_SourceArray
, fruits
,
1036 MUIA_List_Active
, MUIV_List_Active_Bottom
,
1037 MUIA_List_PoolPuddleSize
, 512,
1038 MUIA_ShortHelp
, "Left scroller\nBottom entry active",
1040 MUIA_Listview_ScrollerPos
,
1041 MUIV_Listview_ScrollerPos_Left
,
1044 list
.lists
[2] = ListviewObject
,
1048 MUIA_List_SourceArray
, fruits
,
1049 MUIA_List_Active
, MUIV_List_Active_Off
,
1050 MUIA_List_Pool
, pool
,
1051 MUIA_ShortHelp
, "Right scroller\nNo active entry",
1053 MUIA_Listview_MultiSelect
,
1054 MUIV_Listview_MultiSelect_Shifted
,
1055 MUIA_Listview_ScrollerPos
,
1056 MUIV_Listview_ScrollerPos_Right
,
1059 list
.lists
[3] = ListviewObject
,
1063 MUIA_List_SourceArray
, fruits
,
1064 MUIA_List_Pool
, NULL
,
1065 MUIA_ShortHelp
, "No scroller\nDefault active entry",
1067 MUIA_Listview_MultiSelect
,
1068 MUIV_Listview_MultiSelect_Always
,
1069 MUIA_Listview_ScrollerPos
,
1070 MUIV_Listview_ScrollerPos_None
,
1073 list
.lists
[4] = ListviewObject
,
1077 MUIA_List_SourceArray
, fruits
,
1078 MUIA_List_MinLineHeight
, 20,
1079 MUIA_ShortHelp
, "Default scroller\nDefault active entry",
1081 MUIA_Listview_Input
, FALSE
,
1085 app
= ApplicationObject
,
1086 MUIA_Application_Menustrip
, MenustripObject
,
1087 MUIA_Family_Child
, MenuObject
,
1088 MUIA_Menu_Title
, "Project",
1089 MUIA_Family_Child
, about_item
= MenuitemObject
,
1090 MUIA_Menuitem_Title
, "About...",
1091 MUIA_Menuitem_Shortcut
, "?",
1093 MUIA_Family_Child
, MenuitemObject
,
1094 MUIA_Menuitem_Title
, (SIPTR
)-1,
1096 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1097 MUIA_Menuitem_Title
, "Quit",
1098 MUIA_Menuitem_Shortcut
, "Q",
1103 SubWindow
, wnd
= WindowObject
,
1104 MUIA_Window_Title
, "test",
1105 MUIA_Window_Activate
, TRUE
,
1107 WindowContents
, VGroup
,
1108 Child
, RegisterGroup(pages
),
1109 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1114 GroupFrameT("A horizontal group"),
1116 GroupFrameT("A column group"),
1117 Child
, repeat_button
= TextObject
,
1120 MUIA_Background
, MUII_ButtonBack
,
1121 MUIA_Text_PreParse
, "\33c",
1122 MUIA_Text_Contents
, "Repeat",
1123 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1128 MUIA_Background
, MUII_ButtonBack
,
1129 MUIA_Text_PreParse
, "\33c",
1130 MUIA_Text_Contents
, "Drag Me",
1131 MUIA_Draggable
, TRUE
,
1132 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1134 Child
, open_button
= TextObject
,
1137 MUIA_Background
, MUII_ButtonBack
,
1138 MUIA_Text_PreParse
, "\33c",
1139 MUIA_Text_Contents
, "Open Window",
1140 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1143 MUIA_ContextMenu
, context_menu
,
1146 MUIA_Background
, MUII_ButtonBack
,
1147 MUIA_Text_PreParse
, "\33c",
1148 MUIA_Text_Contents
, "Press Right",
1149 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1151 Child
, objects_button
= TextObject
,
1154 MUIA_Background
, MUII_ButtonBack
,
1155 MUIA_Text_PreParse
, "\33c",
1156 MUIA_Text_Contents
, "Add Objects",
1157 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1162 Child
, MUI_MakeObject(MUIO_Checkmark
,
1166 Child
, MUI_MakeObject(MUIO_Label
,
1173 Child
, group
= VGroup
,
1174 GroupFrameT("A vertical group"),
1175 Child
, DropTextObject
,
1176 MUIA_Dropable
, TRUE
,
1179 MUIA_Background
, MUII_ButtonBack
,
1180 MUIA_Text_PreParse
, "\33c",
1181 MUIA_Text_Contents
, "Drop Here",
1182 MUIA_Dropable
, TRUE
,
1183 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1187 MUIA_Background
, MUII_MARKHALFSHINE
,
1189 MUIA_Text_PreParse
, "\33c",
1190 MUIA_Text_Contents
, "Pattern",
1192 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
1194 Child
, ScrollgroupObject
,
1195 GroupFrameT("A scroll group"),
1196 MUIA_Scrollgroup_Contents
, VGroupV
,
1201 "Line1\nLine2\nLine3\nLine4\n"
1202 "Line5\nLine6\nLine7\nLine8\n"
1204 "Line9\nLine10\nLine11\n",
1207 Child
, MUI_MakeObject(MUIO_Button
,
1209 Child
, MUI_MakeObject(MUIO_Button
,
1215 Child
, popobject
= PopobjectObject
,
1216 MUIA_Popstring_String
,
1217 MUI_MakeObject(MUIO_String
, NULL
, 200),
1218 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
1219 MUIA_Popobject_Object
, VGroup
,
1221 MUIA_Text_Contents
, "test",
1223 Child
, listview
= ListviewObject
,
1224 MUIA_Listview_List
, ListObject
,
1226 MUIA_List_ConstructHook
,
1228 MUIA_List_DestructHook
,
1230 MUIA_List_DisplayHook
, &hook_display
,
1231 MUIA_List_Format
, ",,",
1232 MUIA_List_SourceArray
, entries
,
1233 MUIA_List_Title
, TRUE
,
1240 MUIA_Cycle_Entries
, pages
,
1242 Child
, ScrollbarObject
,
1243 MUIA_Group_Horiz
, TRUE
,
1244 MUIA_Prop_Visible
, 100,
1245 MUIA_Prop_Entries
, 300,
1246 MUIA_Prop_First
, 50,
1251 Child
, RegisterGroup(text_pages
),
1255 MUIA_Background
, "2:cfffffff,cfffffff,10000000",
1257 MUIA_Text_Contents
, "\33cHello World!\n"
1258 "This is a text object\n\33lLeft \33bbold\33n\n"
1263 /* Test for a bug with pen specifications as reported here:
1264 https://sourceforge.net/p/aros/bugs/487/
1266 MUIA_Text_Contents
, "This is a \33P[3]text \33P[]object \33P[1]with pen specifications",
1268 Child
, RectangleObject
,
1270 /* Seems to be not supported properly as orginal MUI
1271 doesn't allow to alter the height of the window */
1272 MUIA_Rectangle_HBar
, TRUE
,
1273 MUIA_Rectangle_BarTitle
,"Enter a string",
1275 Child
, StringObject
,
1278 MUIA_String_AdvanceOnCR
, TRUE
,
1286 Child
, VGroup
, GroupFrameT("Default Alignment"),
1287 Child
, string
.strings
[0] = StringObject
,
1290 (IPTR
)default_accept_chars
,
1292 (IPTR
)default_reject_chars
,
1293 MUIA_String_AdvanceOnCR
, TRUE
,
1294 MUIA_String_MaxLen
, 9,
1296 MUIA_String_AttachedList
, list
.lists
[0],
1299 Child
, VGroup
, GroupFrameT("Left Aligned"),
1300 Child
, string
.strings
[1] = StringObject
,
1303 (IPTR
)default_accept_chars
,
1305 (IPTR
)default_reject_chars
,
1307 MUIV_String_Format_Left
,
1308 MUIA_String_AdvanceOnCR
, TRUE
,
1309 MUIA_String_MaxLen
, 9,
1311 MUIA_String_Contents
,
1312 (IPTR
)default_accept_chars
,
1313 MUIA_String_BufferPos
, 3,
1314 MUIA_String_AttachedList
, list
.lists
[0],
1317 Child
, VGroup
, GroupFrameT("Right Aligned"),
1318 Child
, string
.strings
[2] = StringObject
,
1321 (IPTR
)default_accept_chars
,
1323 (IPTR
)default_reject_chars
,
1325 MUIV_String_Format_Right
,
1326 MUIA_String_AdvanceOnCR
, TRUE
,
1327 MUIA_String_MaxLen
, 9,
1329 MUIA_String_AttachedList
, list
.lists
[0],
1332 Child
, VGroup
, GroupFrameT("Centered"),
1333 Child
, string
.strings
[3] = StringObject
,
1336 (IPTR
)default_accept_chars
,
1338 (IPTR
)default_reject_chars
,
1340 MUIV_String_Format_Center
,
1341 MUIA_String_AdvanceOnCR
, TRUE
,
1342 MUIA_String_MaxLen
, 9,
1344 MUIA_String_Integer
, 123,
1345 MUIA_String_AttachedList
, list
.lists
[0],
1348 Child
, VGroup
, GroupFrameT("Secret"),
1349 Child
, string
.strings
[4] = StringObject
,
1352 (IPTR
)default_accept_chars
,
1354 (IPTR
)default_reject_chars
,
1356 MUIV_String_Format_Center
,
1357 MUIA_String_Secret
, TRUE
,
1358 MUIA_String_AdvanceOnCR
, TRUE
,
1359 MUIA_String_MaxLen
, 9,
1361 MUIA_String_AttachedList
, list
.lists
[0],
1364 Child
, HGroup
, GroupFrameT("Narrow"),
1366 Child
, string
.strings
[5] = StringObject
,
1369 (IPTR
)default_accept_chars
,
1371 (IPTR
)default_reject_chars
,
1373 MUIV_String_Format_Center
,
1374 MUIA_String_AdvanceOnCR
, TRUE
,
1376 MUIA_String_MaxLen
, 9,
1378 MUIA_String_AttachedList
, list
.lists
[0],
1384 Child
, VGroup
, GroupFrameT("Controls"),
1386 Child
, string
.accept_all_check
=
1387 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1388 Child
, MUI_MakeObject(MUIO_Label
,
1389 "Accept all characters", 0),
1393 Child
, MUI_MakeObject(MUIO_Label
,
1394 "Acceptable characters:", 0),
1395 Child
, string
.accept_string
= StringObject
,
1397 MUIA_String_Contents
,
1398 (IPTR
)default_accept_chars
,
1400 Child
, MUI_MakeObject(MUIO_Label
,
1401 "Unacceptable characters:", 0),
1402 Child
, string
.reject_string
= StringObject
,
1405 Child
, MUI_MakeObject(MUIO_Label
,
1406 "Cursor position:", 0),
1407 Child
, string
.cursor_pos_slider
=
1409 MUIA_Group_Horiz
, TRUE
,
1410 MUIA_Numeric_Min
, 0,
1412 Child
, MUI_MakeObject(MUIO_Label
,
1413 "Display position:", 0),
1414 Child
, string
.display_pos_slider
=
1416 MUIA_Group_Horiz
, TRUE
,
1417 MUIA_Numeric_Min
, 0,
1419 Child
, MUI_MakeObject(MUIO_Label
,
1420 "Integer value:", 0),
1421 Child
, string
.integer_string
=
1424 MUIA_String_Accept
, (IPTR
)digits
,
1426 Child
, MUI_MakeObject(MUIO_Label
,
1428 Child
, string
.plaintext_string
=
1432 Child
, MUI_MakeObject(MUIO_Label
,
1433 "Maximum string length:", 0),
1434 Child
, string
.max_len_text
= TextObject
,
1436 MUIA_Text_Contents
, "Unknown",
1441 Child
, string
.cr_advance_check
=
1442 MUI_MakeObject(MUIO_Checkmark
,
1444 Child
, MUI_MakeObject(MUIO_Label
,
1445 "Advance on CR", 0),
1449 Child
, string
.attach_list_check
=
1450 MUI_MakeObject(MUIO_Checkmark
,
1452 Child
, MUI_MakeObject(MUIO_Label
,
1458 Child
, string
.standard_hook_check
=
1459 MUI_MakeObject(MUIO_Checkmark
,
1461 Child
, MUI_MakeObject(MUIO_Label
,
1462 "Use standard edit hook", 0),
1466 Child
, string
.custom_hook_check
=
1467 MUI_MakeObject(MUIO_Checkmark
,
1469 Child
, MUI_MakeObject(MUIO_Label
,
1470 "Use custom edit hook", 0),
1483 Child
, wheel
= BoopsiObject
, /* MUI/Boopsi tags mixed */
1485 /* boopsi objects don't know */
1486 /* their sizes, so we help */
1487 /* keep important values */
1488 /* during window resize */
1489 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
1490 MUIA_Boopsi_MinWidth
, 30,
1491 MUIA_Boopsi_MinHeight
, 30,
1492 MUIA_Boopsi_Remember
, WHEEL_Saturation
,
1493 MUIA_Boopsi_Remember
, WHEEL_Hue
,
1494 /* this magic fills in the screen pointer */
1495 MUIA_Boopsi_TagScreen
, WHEEL_Screen
,
1498 GA_Top
, 0, /* MUI will automatically */
1499 GA_Width
, 0, /* fill in the correct values */
1501 ICA_TARGET
, ICTARGET_IDCMP
,
1502 /* needed for notification */
1503 WHEEL_Saturation
, 0, /* start in the center */
1504 MUIA_FillArea
, TRUE
,
1505 /* use this because it defaults to FALSE
1506 for boopsi gadgets but the colorwheel
1507 doesn't bother about redrawing its
1511 Child
, r_slider
= SliderObject
,
1512 MUIA_Group_Horiz
, TRUE
,
1513 MUIA_Numeric_Min
, 0,
1514 MUIA_Numeric_Max
, 255,
1516 Child
, g_slider
= SliderObject
,
1517 MUIA_Group_Horiz
, TRUE
,
1518 MUIA_Numeric_Min
, 0,
1519 MUIA_Numeric_Max
, 255,
1521 Child
, b_slider
= SliderObject
,
1522 MUIA_Group_Horiz
, TRUE
,
1523 MUIA_Numeric_Min
, 0,
1524 MUIA_Numeric_Max
, 255,
1526 Child
, hue_gauge
= GaugeObject
,
1528 MUIA_Gauge_Horiz
, TRUE
,
1529 MUIA_Gauge_Max
, 255,
1530 MUIA_Gauge_Divide
, 1<<24,
1531 MUIA_Gauge_InfoText
, "Hue: %ld",
1536 Child
, RegisterGroup(color_pages
),
1537 Child
, VGroup
, GroupFrameT("Palette"),
1538 Child
, PaletteObject
,
1542 Child
, VGroup
, GroupFrameT("Colorfield"),
1545 Child
, colorfield
= ColorfieldObject
,
1546 MUIA_Colorfield_RGB
, default_color
,
1547 MUIA_Colorfield_Pen
, 253,
1549 Child
, colorfield2
= ColorfieldObject
,
1550 MUIA_Colorfield_Red
, default_color
[0],
1551 MUIA_Colorfield_Green
, default_color
[1],
1552 MUIA_Colorfield_Blue
, default_color
[2],
1555 Child
, colorfield_reset_button
=
1556 MUI_MakeObject(MUIO_Button
,
1560 MUI_MakeObject(MUIO_Label
, "Pen:", 0),
1561 Child
, colorfield_pen
= StringObject
,
1566 Child
, VGroup
, GroupFrameT("Coloradjust"),
1567 Child
, coloradjust
= ColoradjustObject
,
1568 MUIA_Coloradjust_RGB
, default_color
,
1574 Child
, VGroup
, GroupFrameT("Pendisplay"),
1577 Child
, pendisplay2
= PendisplayObject
,
1578 MUIA_Pendisplay_RGBcolor
,
1585 MUIO_Label
, "Pen:", 0),
1587 Child
, pendisplay_pen
=
1588 StringObject
, StringFrame
,
1591 Child
, reference_check
=
1592 MUI_MakeObject(MUIO_Checkmark
,
1594 Child
, MUI_MakeObject(MUIO_Label
,
1599 MUIO_Label
, "Penspec:", 0),
1600 Child
, pendisplay_spec
= StringObject
,
1605 Child
, shine_button
=
1606 MUI_MakeObject(MUIO_Button
,
1608 Child
, shadow_button
=
1609 MUI_MakeObject(MUIO_Button
,
1611 Child
, yellow_button
=
1612 MUI_MakeObject(MUIO_Button
,
1616 Child
, VGroup
, GroupFrameT("Poppen"),
1617 Child
, poppen
= PoppenObject
,
1621 Child
, VGroup
, GroupFrameT("Penadjust"),
1622 Child
, PenadjustObject
,
1630 Child
, editor_text
= StringObject
,
1633 Child
, PopaslObject
,
1634 ASLFR_DoSaveMode
, TRUE
,
1635 MUIA_Popstring_String
, filename_string
=
1636 MUI_MakeObject(MUIO_String
, NULL
, 200),
1637 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
1639 Child
, save_button
=
1640 MUI_MakeObject(MUIO_Button
, "Save"),
1644 Child
, RegisterGroup(list_pages
),
1646 Child
, ColGroup(LIST_COUNT
),
1647 Child
, VGroup
, GroupFrameT("No Multiselect"),
1648 Child
, list
.lists
[0],
1651 GroupFrameT("Default Multiselect"),
1652 Child
, list
.lists
[1],
1655 GroupFrameT("Shifted Multiselect"),
1656 Child
, list
.lists
[2],
1659 GroupFrameT("Unconditional Multiselect"),
1660 Child
, list
.lists
[3],
1663 GroupFrameT("Read Only"),
1664 Child
, list
.lists
[4],
1668 MUIA_Group_HorizSpacing
, 0,
1669 Child
, RectangleObject
,
1670 MUIA_HorizWeight
, 1,
1672 Child
, list
.list_radios
= RadioObject
,
1673 MUIA_Radio_Entries
, empty
,
1674 MUIA_Group_Horiz
, TRUE
,
1675 MUIA_HorizWeight
, 1000,
1677 Child
, RectangleObject
,
1678 MUIA_HorizWeight
, 1,
1681 Child
, RectangleObject
,
1683 MUIA_Rectangle_HBar
, TRUE
,
1684 MUIA_Rectangle_BarTitle
, "List Controls",
1687 Child
, MUI_MakeObject(MUIO_Label
,
1688 "Affected index 1:", 0),
1689 Child
, list
.index1_string
=
1692 MUIA_String_Accept
, (IPTR
)digits
,
1693 MUIA_String_Integer
, 0,
1696 Child
, list
.dragsortable_check
=
1697 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1698 Child
, MUI_MakeObject(MUIO_Label
,
1699 "Drag sortable", 0),
1703 Child
, list
.showdropmarks_check
=
1704 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1705 Child
, MUI_MakeObject(MUIO_Label
,
1706 "Show drop marks", 0),
1712 Child
, MUI_MakeObject(MUIO_Label
,
1713 "Affected index 2:", 0),
1714 Child
, list
.index2_string
=
1717 MUIA_String_Accept
, (IPTR
)digits
,
1718 MUIA_String_Integer
, 0,
1721 Child
, list
.quiet_check
=
1722 MUI_MakeObject(MUIO_Checkmark
,NULL
),
1723 Child
, MUI_MakeObject(MUIO_Label
,
1728 Child
, list
.autovisible_check
=
1729 MUI_MakeObject(MUIO_Checkmark
,NULL
),
1730 Child
, MUI_MakeObject(MUIO_Label
,
1734 Child
, list
.reset_button
=
1735 MUI_MakeObject(MUIO_Button
, "Reset"),
1738 Child
, MUI_MakeObject(MUIO_Label
,
1739 "Move/exchange mode 1:", 0),
1740 Child
, list
.move1_cycle
= CycleObject
,
1742 MUIA_Cycle_Entries
, list_move1_modes
,
1744 Child
, list
.move_button
=
1745 MUI_MakeObject(MUIO_Button
, "Move"),
1746 Child
, list
.sort_button
=
1747 MUI_MakeObject(MUIO_Button
, "Sort"),
1748 Child
, list
.enable_button
=
1749 MUI_MakeObject(MUIO_Button
, "Enable"),
1752 Child
, MUI_MakeObject(MUIO_Label
,
1753 "Move/exchange mode 2:", 0),
1754 Child
, list
.move2_cycle
= CycleObject
,
1756 MUIA_Cycle_Entries
, list_move2_modes
,
1758 Child
, list
.exchange_button
=
1759 MUI_MakeObject(MUIO_Button
, "Exchange"),
1760 Child
, list
.redraw_button
=
1761 MUI_MakeObject(MUIO_Button
, "Redraw"),
1762 Child
, MUI_MakeObject(MUIO_Label
,
1764 Child
, list
.title_string
=
1769 Child
, MUI_MakeObject(MUIO_Label
,
1771 Child
, list
.jump_cycle
= CycleObject
,
1773 MUIA_Cycle_Entries
, list_jump_modes
,
1775 Child
, list
.jump_button
=
1776 MUI_MakeObject(MUIO_Button
, "Jump"),
1777 Child
, list
.toggle_button
=
1778 MUI_MakeObject(MUIO_Button
, "Toggle"),
1779 Child
, MUI_MakeObject(MUIO_Label
,
1781 Child
, list
.entries_text
= TextObject
,
1783 MUIA_Text_Contents
, "N/A",
1786 Child
, MUI_MakeObject(MUIO_Label
,
1787 "Select/redraw mode:", 0),
1788 Child
, list
.select_cycle
= CycleObject
,
1790 MUIA_Cycle_Entries
, list_select_modes
,
1792 Child
, list
.select_button
=
1793 MUI_MakeObject(MUIO_Button
, "Select"),
1794 Child
, list
.deselect_button
=
1795 MUI_MakeObject(MUIO_Button
, "Deselect"),
1796 Child
, MUI_MakeObject(MUIO_Label
,
1797 "Visible entries:", 0),
1798 Child
, list
.visible_text
= TextObject
,
1800 MUIA_Text_Contents
, "N/A",
1803 Child
, MUI_MakeObject(MUIO_Label
,
1805 Child
, list
.insert_cycle
= CycleObject
,
1807 MUIA_Cycle_Entries
, list_insert_modes
,
1809 Child
, list
.insert_single_button
=
1810 MUI_MakeObject(MUIO_Button
, "Insert Single"),
1811 Child
, list
.insert_multiple_button
=
1812 MUI_MakeObject(MUIO_Button
, "Insert Multiple"),
1813 Child
, MUI_MakeObject(MUIO_Label
,
1814 "First visible index:", 0),
1815 Child
, list
.first_text
= TextObject
,
1817 MUIA_Text_Contents
, "N/A",
1820 Child
, MUI_MakeObject(MUIO_Label
,
1822 Child
, list
.remove_cycle
= CycleObject
,
1824 MUIA_Cycle_Entries
, list_remove_modes
,
1826 Child
, list
.remove_button
=
1827 MUI_MakeObject(MUIO_Button
, "Remove"),
1828 Child
, list
.clear_button
=
1829 MUI_MakeObject(MUIO_Button
, "Clear"),
1830 Child
, MUI_MakeObject(MUIO_Label
,
1831 "Last insertion index:", 0),
1832 Child
, list
.insert_text
= TextObject
,
1834 MUIA_Text_Contents
, "N/A",
1837 Child
, MUI_MakeObject(MUIO_Label
,
1838 "Activate mode:", 0),
1839 Child
, list
.activate_cycle
= CycleObject
,
1841 MUIA_Cycle_Entries
, list_activate_modes
,
1843 Child
, list
.activate_button
=
1844 MUI_MakeObject(MUIO_Button
, "Activate"),
1845 Child
, list
.deactivate_button
=
1846 MUI_MakeObject(MUIO_Button
, "Deactivate"),
1847 Child
, MUI_MakeObject(MUIO_Label
,
1848 "Active index:", 0),
1849 Child
, list
.active_text
= TextObject
,
1851 MUIA_Text_Contents
, "N/A",
1856 Child
, ColGroup(LIST_COUNT
/ 2),
1857 Child
, VGroup
, GroupFrameT("Standard Format"),
1858 Child
, list
.multi_lists
[0] = ListviewObject
,
1862 MUIA_List_ConstructHook
,
1864 MUIA_List_DestructHook
,
1866 MUIA_List_DisplayHook
,
1868 MUIA_List_Format
, list_format
,
1869 MUIA_List_SourceArray
, entries
,
1870 MUIA_List_Title
, TRUE
,
1871 MUIA_List_AdjustWidth
, TRUE
,
1873 MUIA_Listview_MultiSelect
,
1874 MUIV_Listview_MultiSelect_None
,
1875 MUIA_Listview_DefClickColumn
, 1,
1879 Child
, VGroup
, GroupFrameT("Custom Format"),
1880 Child
, list
.multi_lists
[1] = ListviewObject
,
1884 MUIA_List_DisplayHook
,
1886 MUIA_List_Format
, list_format
,
1887 MUIA_List_Title
, TRUE
,
1888 MUIA_List_AdjustHeight
, TRUE
,
1890 MUIA_Listview_MultiSelect
,
1891 MUIV_Listview_MultiSelect_None
,
1897 Child
, RectangleObject
,
1899 MUIA_Rectangle_HBar
, TRUE
,
1900 MUIA_Rectangle_BarTitle
, "List Controls",
1903 Child
, MUI_MakeObject(MUIO_Label
, "Format:", 0),
1904 Child
, list
.format_string
= StringObject
,
1908 Child
, list
.showheadings_check
=
1909 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1910 Child
, MUI_MakeObject(MUIO_Label
,
1911 "Show column headings", 0),
1914 Child
, MUI_MakeObject(MUIO_Label
,
1915 "Default clicked column:", 0),
1916 Child
, list
.def_column_string
= StringObject
,
1918 MUIA_String_Accept
, (IPTR
)digits
,
1919 MUIA_String_Integer
, -1,
1922 Child
, MUI_MakeObject(MUIO_Label
,
1923 "Clicked column:", 0),
1924 Child
, list
.column_string
= StringObject
,
1927 Child
, list
.column_text
= TextObject
,
1929 MUIA_Text_Contents
, "N/A",
1942 MUIA_Gauge_InfoText
, "%ld %%",
1943 MUIA_Gauge_Horiz
, TRUE
,
1944 MUIA_Gauge_Current
, 25,
1953 MUIA_Gauge_InfoText
, "%ld %%",
1954 MUIA_Gauge_Horiz
, TRUE
,
1955 MUIA_Gauge_Current
, 50,
1964 MUIA_Gauge_InfoText
, "%ld %%",
1965 MUIA_Gauge_Horiz
, TRUE
,
1966 MUIA_Gauge_Current
, 75,
1976 MUIA_Gauge_InfoText
, "%ld %%",
1977 MUIA_Gauge_Current
, 25,
1981 MUIA_Gauge_InfoText
, "%ld %%",
1982 MUIA_Gauge_Current
, 50,
1986 MUIA_Gauge_InfoText
, "%ld %%",
1987 MUIA_Gauge_Current
, 75,
1996 GroupFrameT("Horizontal Sliders"),
1997 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
1998 Child
, numerics
[HNSLIDER
] = SliderObject
,
1999 MUIA_Slider_Horiz
, TRUE
,
2000 MUIA_Numeric_Min
, NUMERIC_MIN
,
2001 MUIA_Numeric_Max
, NUMERIC_MAX
,
2004 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
2005 Child
, numerics
[HRSLIDER
] = SliderObject
,
2006 MUIA_Numeric_Reverse
, TRUE
,
2007 MUIA_Numeric_Min
, NUMERIC_MIN
,
2008 MUIA_Numeric_Max
, NUMERIC_MAX
,
2011 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
2012 Child
, numerics
[HQSLIDER
] = SliderObject
,
2013 MUIA_Slider_Quiet
, TRUE
,
2014 MUIA_Numeric_Min
, NUMERIC_MIN
,
2015 MUIA_Numeric_Max
, NUMERIC_MAX
,
2020 GroupFrameT("Vertical Sliders"),
2021 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2022 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2023 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
2024 Child
, numerics
[VNSLIDER
] = SliderObject
,
2025 MUIA_Slider_Horiz
, FALSE
,
2026 MUIA_Numeric_Min
, NUMERIC_MIN
,
2027 MUIA_Numeric_Max
, NUMERIC_MAX
,
2030 Child
, numerics
[VRSLIDER
] = SliderObject
,
2031 MUIA_Slider_Horiz
, FALSE
,
2032 MUIA_Numeric_Reverse
, TRUE
,
2033 MUIA_Numeric_Min
, NUMERIC_MIN
,
2034 MUIA_Numeric_Max
, NUMERIC_MAX
,
2037 Child
, numerics
[VQSLIDER
] = SliderObject
,
2038 MUIA_Slider_Horiz
, FALSE
,
2039 MUIA_Slider_Quiet
, TRUE
,
2040 MUIA_Numeric_Min
, NUMERIC_MIN
,
2041 MUIA_Numeric_Max
, NUMERIC_MAX
,
2046 GroupFrameT("Numeric Buttons"),
2047 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
2048 Child
, numerics
[NNUMERICBUTTON
] =
2049 NumericbuttonObject
,
2050 MUIA_Numeric_Min
, NUMERIC_MIN
,
2051 MUIA_Numeric_Max
, NUMERIC_MAX
,
2054 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
2055 Child
, numerics
[RNUMERICBUTTON
] =
2056 NumericbuttonObject
,
2057 MUIA_Numeric_Reverse
, TRUE
,
2058 MUIA_Numeric_Min
, NUMERIC_MIN
,
2059 MUIA_Numeric_Max
, NUMERIC_MAX
,
2064 GroupFrameT("Knobs"),
2065 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
2066 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2067 Child
, numerics
[NKNOB
] = KnobObject
,
2068 MUIA_Numeric_Min
, NUMERIC_MIN
,
2069 MUIA_Numeric_Max
, NUMERIC_MAX
,
2072 Child
, numerics
[RKNOB
] = KnobObject
,
2073 MUIA_Numeric_Reverse
, TRUE
,
2074 MUIA_Numeric_Min
, NUMERIC_MIN
,
2075 MUIA_Numeric_Max
, NUMERIC_MAX
,
2080 Child
, MUI_MakeObject(MUIO_Label
,
2081 "Minimum Value:", 0),
2082 Child
, min_string
= (Object
*)StringObject
,
2084 MUIA_String_Accept
, (IPTR
)digits
,
2085 MUIA_String_Integer
, NUMERIC_MIN
,
2088 Child
, MUI_MakeObject(MUIO_Label
,
2089 "Maximum Value:", 0),
2090 Child
, max_string
= (Object
*)StringObject
,
2092 MUIA_String_Accept
, (IPTR
)digits
,
2093 MUIA_String_Integer
, NUMERIC_MAX
,
2096 Child
, slider_button
= TextObject
,
2098 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2100 MUIA_Background
, MUII_ButtonBack
,
2101 MUIA_Text_PreParse
, "\33c",
2103 "Change Slider Orientations",
2105 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
2114 MUIA_Radio_Entries
, radio_entries1
,
2116 Child
, country_radio
[0] = RadioObject
,
2118 MUIA_Radio_Entries
, radio_entries2
,
2119 MUIA_Radio_Active
, 1,
2125 MUIA_Radio_Entries
, radio_entries1
,
2127 Child
, country_radio
[1] = RadioObject
,
2129 MUIA_Radio_Entries
, radio_entries2
,
2130 MUIA_Radio_Active
, 1,
2135 #if defined(TEST_ICONLIST)
2138 Child
, volume_iconlist
=
2139 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
2141 Child
, drawer_iconlist
=
2142 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
2143 MUIA_IconDrawerList_Drawer
, "SYS:",
2150 Child
, create_balance_column(),
2151 Child
, BalanceObject
,
2154 Child
, create_balance_column(),
2155 Child
, BalanceObject
,
2158 Child
, create_balance_column(),
2159 Child
, BalanceObject
,
2162 Child
, create_balance_column(),
2163 Child
, BalanceObject
,
2166 Child
, create_balance_column(),
2173 Child
, about_button
= TextObject
,
2175 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2177 MUIA_Background
, MUII_ButtonBack
,
2178 MUIA_Text_PreParse
, "\33c",
2179 MUIA_Text_Contents
, "About",
2181 Child
, quit_button
= TextObject
,
2183 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2185 MUIA_Background
, MUII_ButtonBack
,
2186 MUIA_ControlChar
, 'q',
2187 MUIA_Text_HiChar
, 'q',
2188 MUIA_Text_PreParse
, "\33c",
2189 MUIA_Text_Contents
, "Quit",
2195 SubWindow
, second_wnd
= WindowObject
,
2196 MUIA_Window_Title
, "Second window",
2197 WindowContents
, VGroup
,
2198 Child
, DropTextObject
,
2199 MUIA_Text_Contents
, "Drop here",
2200 MUIA_Dropable
, TRUE
,
2211 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
2212 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2213 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
2214 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
2215 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
,
2216 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
2217 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2218 MUIM_Application_AboutMUI
, NULL
);
2219 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2220 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2221 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2222 MUIM_CallHook
, &hook_objects
);
2223 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
2224 app
, 2, MUIM_CallHook
, &hook
);
2226 /* Notifications and set-up for string objects */
2227 DoMethod(string
.max_len_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
2228 "%ld", XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2229 set(string
.cursor_pos_slider
, MUIA_Numeric_Max
,
2230 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2231 set(string
.display_pos_slider
, MUIA_Numeric_Max
,
2232 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2233 set(string
.cr_advance_check
, MUIA_Selected
, TRUE
);
2234 set(string
.attach_list_check
, MUIA_Selected
, TRUE
);
2235 set(string
.strings
[1], MUIA_Disabled
,
2236 XGET(string
.strings
[1], MUIA_String_Format
)
2237 != MUIV_String_Format_Left
);
2238 set(string
.strings
[2], MUIA_Disabled
,
2239 XGET(string
.strings
[2], MUIA_String_Format
)
2240 != MUIV_String_Format_Right
);
2241 set(string
.strings
[3], MUIA_Disabled
,
2242 XGET(string
.strings
[3], MUIA_String_Format
)
2243 != MUIV_String_Format_Center
);
2244 set(string
.strings
[4], MUIA_Disabled
,
2245 !XGET(string
.strings
[4], MUIA_String_Secret
));
2246 set(string
.strings
[0], MUIA_String_MaxLen
, 100);
2247 set(string
.reject_string
, MUIA_String_Contents
,
2248 (IPTR
)default_reject_chars
);
2250 for (i
= 0; i
< STRING_COUNT
; i
++)
2254 DoMethod(string
.accept_string
, MUIM_Notify
,
2255 MUIA_String_Contents
, MUIV_EveryTime
, string
.strings
[i
],
2256 3, MUIM_Set
, MUIA_String_Accept
, MUIV_TriggerValue
);
2257 DoMethod(string
.cr_advance_check
, MUIM_Notify
, MUIA_Selected
,
2258 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2259 MUIA_String_AdvanceOnCR
, MUIV_TriggerValue
);
2260 DoMethod(string
.cursor_pos_slider
, MUIM_Notify
,
2261 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2262 MUIM_Set
, MUIA_String_BufferPos
, MUIV_TriggerValue
);
2263 DoMethod(string
.display_pos_slider
, MUIM_Notify
,
2264 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2265 MUIM_Set
, MUIA_String_DisplayPos
, MUIV_TriggerValue
);
2266 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2267 TRUE
, string
.strings
[i
], 3, MUIM_Set
,
2268 MUIA_String_AttachedList
, list
.lists
[0]);
2269 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2270 FALSE
, string
.strings
[i
], 3, MUIM_Set
,
2271 MUIA_String_AttachedList
, NULL
);
2275 DoMethod(string
.strings
[0], MUIM_Notify
, MUIA_String_Accept
,
2276 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2277 MUIA_String_Accept
, MUIV_TriggerValue
);
2278 DoMethod(string
.strings
[0], MUIM_Notify
,
2279 MUIA_String_AdvanceOnCR
, MUIV_EveryTime
,
2280 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_AdvanceOnCR
,
2282 DoMethod(string
.strings
[0], MUIM_Notify
,
2283 MUIA_String_BufferPos
, MUIV_EveryTime
,
2284 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_BufferPos
,
2286 DoMethod(string
.strings
[0], MUIM_Notify
,
2287 MUIA_String_DisplayPos
, MUIV_EveryTime
,
2288 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_DisplayPos
,
2290 DoMethod(string
.strings
[0], MUIM_Notify
,
2291 MUIA_String_AttachedList
, MUIV_EveryTime
,
2292 string
.strings
[i
], 3, MUIM_Set
,
2293 MUIA_String_AttachedList
, MUIV_TriggerValue
);
2295 DoMethod(string
.reject_string
, MUIM_Notify
, MUIA_String_Contents
,
2296 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2297 MUIA_String_Reject
, MUIV_TriggerValue
);
2298 DoMethod(string
.strings
[i
], MUIM_Notify
, MUIA_String_Integer
,
2299 MUIV_EveryTime
, string
.integer_string
, 3, MUIM_NoNotifySet
,
2300 MUIA_String_Integer
, MUIV_TriggerValue
);
2301 DoMethod(string
.integer_string
, MUIM_Notify
, MUIA_String_Integer
,
2302 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_NoNotifySet
,
2303 MUIA_String_Integer
, MUIV_TriggerValue
);
2305 DoMethod(string
.accept_all_check
, MUIM_Notify
, MUIA_Selected
,
2306 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2307 ChangeStringAccept
);
2308 DoMethod(string
.strings
[4], MUIM_Notify
, MUIA_String_Acknowledge
,
2309 MUIV_EveryTime
, string
.plaintext_string
, 3, MUIM_NoNotifySet
,
2310 MUIA_String_Contents
, MUIV_TriggerValue
);
2311 DoMethod(string
.plaintext_string
, MUIM_Notify
,
2312 MUIA_String_Acknowledge
, MUIV_EveryTime
, string
.strings
[4], 3,
2313 MUIM_NoNotifySet
, MUIA_String_Contents
, MUIV_TriggerValue
);
2315 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
2316 MUIM_CallHook
, &hook_wheel
);
2317 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
2318 2, MUIM_CallHook
, &hook_wheel
);
2319 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2320 app
, 2, MUIM_CallHook
, &hook_slider
);
2321 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2322 app
, 2, MUIM_CallHook
, &hook_slider
);
2323 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2324 app
, 2, MUIM_CallHook
, &hook_slider
);
2326 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
2327 MUIM_CallHook
, &hook_standard
, Save
);
2329 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2330 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
2331 MUIV_Application_ReturnID_Quit
);
2332 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2333 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2336 /* Notifications for color objects */
2337 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Red
,
2338 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2340 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Green
,
2341 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2343 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Blue
,
2344 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2346 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Red
,
2347 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2349 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Green
,
2350 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2352 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Blue
,
2353 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2355 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Pen
,
2356 MUIV_EveryTime
, colorfield_pen
, 3, MUIM_Set
,
2357 MUIA_String_Integer
, MUIV_TriggerValue
);
2358 DoMethod(colorfield_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2359 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2361 DoMethod(colorfield_reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2362 colorfield
, 3, MUIM_Set
, MUIA_Colorfield_RGB
, default_color
);
2364 /* Notifications for pen objects */
2365 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Pen
,
2366 MUIV_EveryTime
, pendisplay_pen
, 3, MUIM_NoNotifySet
,
2367 MUIA_String_Integer
, MUIV_TriggerValue
);
2368 DoMethod(pendisplay_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2369 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2370 ChangePendisplayPen
);
2371 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Spec
,
2372 MUIV_EveryTime
, pendisplay_spec
, 3, MUIM_Set
,
2373 MUIA_String_Contents
, MUIV_TriggerValue
);
2374 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_RGB
,
2375 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
,
2376 MUIA_Pendisplay_RGBcolor
, MUIV_TriggerValue
);
2377 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_RGBcolor
,
2378 MUIV_EveryTime
, poppen
, 3, MUIM_Set
, MUIA_Pendisplay_RGBcolor
,
2380 DoMethod(pendisplay_spec
, MUIM_Notify
, MUIA_String_Contents
,
2381 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
, MUIA_Pendisplay_Spec
,
2383 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, TRUE
,
2384 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, pendisplay
);
2385 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, FALSE
,
2386 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, NULL
);
2387 DoMethod(shine_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2388 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHINE
);
2389 DoMethod(shadow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2390 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHADOW
);
2391 DoMethod(yellow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2392 4, MUIM_Pendisplay_SetRGB
, 0xffffffff, 0xffffffff, 0);
2394 /* Notifications and set-up for list objects */
2395 set(list
.showdropmarks_check
, MUIA_Selected
, TRUE
);
2397 for (i
= 0; i
< LIST_COUNT
; i
++)
2399 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2400 MUIV_EveryTime
, list
.lists
[i
], 3, MUIM_Set
, MUIA_Disabled
,
2402 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Entries
,
2403 MUIV_EveryTime
, list
.entries_text
, 4, MUIM_SetAsString
,
2404 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2405 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Visible
,
2406 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2408 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_First
,
2409 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2411 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_InsertPosition
,
2412 MUIV_EveryTime
, list
.insert_text
, 4, MUIM_SetAsString
,
2413 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2414 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Active
,
2415 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2418 DoMethod(list
.dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
2419 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2420 ListSetDragSortable
);
2421 DoMethod(list
.showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
2422 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2423 ListSetShowDropMarks
);
2424 DoMethod(list
.quiet_check
, MUIM_Notify
, MUIA_Selected
,
2425 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2427 DoMethod(list
.autovisible_check
, MUIM_Notify
, MUIA_Selected
,
2428 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2429 ListSetAutoVisible
);
2430 DoMethod(list
.reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2431 app
, 3, MUIM_CallHook
, &hook_standard
, ListReset
);
2432 DoMethod(list
.move_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2433 app
, 3, MUIM_CallHook
, &hook_standard
, ListMove
);
2434 DoMethod(list
.sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2435 app
, 3, MUIM_CallHook
, &hook_standard
, ListSort
);
2436 DoMethod(list
.enable_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2437 app
, 3, MUIM_CallHook
, &hook_standard
, ListEnable
);
2438 DoMethod(list
.exchange_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2439 app
, 3, MUIM_CallHook
, &hook_standard
, ListExchange
);
2440 DoMethod(list
.jump_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2441 app
, 3, MUIM_CallHook
, &hook_standard
, ListJump
);
2442 DoMethod(list
.select_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2443 app
, 3, MUIM_CallHook
, &hook_standard
, ListSelect
);
2444 DoMethod(list
.deselect_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2445 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeselect
);
2446 DoMethod(list
.toggle_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2447 app
, 3, MUIM_CallHook
, &hook_standard
, ListToggle
);
2448 DoMethod(list
.redraw_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2449 app
, 3, MUIM_CallHook
, &hook_standard
, ListRedraw
);
2450 DoMethod(list
.insert_single_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2451 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsertSingle
);
2452 DoMethod(list
.insert_multiple_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2453 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsert
);
2454 DoMethod(list
.remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2455 app
, 3, MUIM_CallHook
, &hook_standard
, ListRemove
);
2456 DoMethod(list
.clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2457 app
, 3, MUIM_CallHook
, &hook_standard
, ListClear
);
2458 DoMethod(list
.activate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2459 app
, 3, MUIM_CallHook
, &hook_standard
, ListActivate
);
2460 DoMethod(list
.deactivate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2461 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeactivate
);
2462 DoMethod(list
.title_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2463 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2465 DoMethod(list
.list_radios
, MUIM_Notify
, MUIA_Radio_Active
,
2466 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2469 SET(list
.showheadings_check
, MUIA_Selected
,
2470 XGET(list
.multi_lists
[0], MUIA_List_Title
));
2471 SET(list
.format_string
, MUIA_String_Contents
,
2472 XGET(list
.multi_lists
[1], MUIA_List_Format
));
2473 SET(list
.def_column_string
, MUIA_String_Integer
,
2474 XGET(list
.multi_lists
[0], MUIA_Listview_DefClickColumn
));
2475 DoMethod(list
.format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2476 MUIV_EveryTime
, list
.multi_lists
[1], 3, MUIM_Set
,
2477 MUIA_List_Format
, MUIV_TriggerValue
);
2478 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_List_Format
,
2479 MUIV_EveryTime
, wnd
, 3, MUIM_Set
,
2480 MUIA_Window_ActiveObject
, list
.format_string
);
2481 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
2483 DoMethod(list
.showheadings_check
, MUIM_Notify
, MUIA_Selected
,
2484 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2485 MUIA_List_Title
, MUIV_TriggerValue
);
2486 DoMethod(list
.def_column_string
, MUIM_Notify
,
2487 MUIA_String_Integer
,
2488 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2489 MUIA_Listview_DefClickColumn
, MUIV_TriggerValue
);
2490 DoMethod(list
.multi_lists
[i
], MUIM_Notify
,
2491 MUIA_Listview_ClickColumn
, MUIV_EveryTime
,
2492 list
.column_string
, 3, MUIM_Set
, MUIA_String_Integer
,
2495 DoMethod(list
.column_string
, MUIM_Notify
, MUIA_String_Contents
,
2496 MUIV_EveryTime
, list
.column_text
, 3, MUIM_Set
, MUIA_Text_Contents
,
2498 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2499 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2500 CheckListDoubleClick
);
2501 SET(list
.multi_lists
[1], MUIA_List_ConstructHook
, &hook_construct
);
2502 SET(list
.multi_lists
[1], MUIA_List_DestructHook
, &hook_destruct
);
2503 DoMethod(list
.multi_lists
[1], MUIM_List_Insert
, entries
, -1,
2504 MUIV_List_Insert_Top
);
2506 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
2507 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
2510 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
2512 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
2513 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
2515 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
2516 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
2519 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2520 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
2523 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
2524 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
2525 MUIA_Radio_Active
, MUIV_TriggerValue
);
2526 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
2527 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
2528 MUIA_Radio_Active
, MUIV_TriggerValue
);
2530 #if defined(TEST_ICONLIST)
2532 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2533 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2534 volume_doubleclicked
);
2535 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2536 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2537 drawer_doubleclicked
);
2540 /* automatic tests */
2541 get(list
.lists
[0], MUIA_List_Visible
, &value
);
2543 printf("MUIA_List_Visible equals %ld before display,"
2544 " but it should be -1.\n", (long)value
);
2545 get(list
.multi_lists
[0], MUIA_Listview_ClickColumn
, &value
);
2547 printf("MUIA_Listview_ClickColumn equals %ld before display,"
2548 " but it should be 0.\n", (long)value
);
2549 get(list
.lists
[0], MUIA_Listview_DoubleClick
, &value
);
2551 printf("MUIA_Listview_DoubleClick equals %ld before display,"
2552 " but it should be 0.\n", (long)value
);
2554 set(wnd
, MUIA_Window_Open
, TRUE
);
2555 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test application");
2557 /* Set pen fields */
2558 set(colorfield_pen
, MUIA_String_Integer
,
2559 XGET(colorfield
, MUIA_Colorfield_Pen
));
2562 nnset(pendisplay_pen
, MUIA_String_Integer
,
2563 XGET(pendisplay
, MUIA_Pendisplay_Pen
));
2565 struct MUI_PenSpec
*pen_spec
= NULL
;
2566 GET(pendisplay
, MUIA_Pendisplay_Spec
, &pen_spec
);
2567 strncpy(pen_str
, pen_spec
->buf
, 10);
2568 set(pendisplay_spec
, MUIA_String_Contents
, pen_str
);
2570 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
2571 &sigs
) != MUIV_Application_ReturnID_Quit
)
2575 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
2576 if (sigs
& SIGBREAKF_CTRL_C
)
2578 if (sigs
& SIGBREAKF_CTRL_D
)
2583 MUI_DisposeObject(app
);
2586 MUI_DisposeObject(context_menu
);
2587 CloseLibrary(ColorWheelBase
);
2588 MUI_DeleteCustomClass(CL_DropText
);
2590 /* automatic tests */
2591 if (list
.destruct_count
!= 18)
2592 printf("The hook installed through MUIA_List_DestructHook has been"
2593 " called %ld times, but should have been called 18 times.\n",
2594 (long)list
.destruct_count
);
2596 CloseLibrary(MUIMasterBase
);