2 Copyright © 2002-2015, 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
];
177 static Object
*wheel
;
178 static Object
*r_slider
;
179 static Object
*g_slider
;
180 static Object
*b_slider
;
181 static Object
*hue_gauge
;
182 static Object
*colorfield
, *colorfield2
, *colorfield_reset_button
,
184 static Object
*coloradjust
;
185 static Object
*pendisplay
, *pendisplay2
, *pendisplay_pen
, *pendisplay_spec
,
186 *reference_check
, *shine_button
, *shadow_button
, *yellow_button
, *poppen
;
187 static Object
*group
;
188 static Object
*editor_text
;
189 static Object
*filename_string
;
190 static Object
*save_button
;
191 static Object
*list2
;
193 static Object
*drawer_iconlist
;
194 static Object
*volume_iconlist
;
196 AROS_UFH0(void, repeat_function
)
200 printf("MUI_Timer\n");
205 AROS_UFH0(void, wheel_function
)
209 nnset(r_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
210 WHEEL_Red
) >> 24) & 0xff);
211 nnset(g_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
212 WHEEL_Green
) >> 24) & 0xff);
213 nnset(b_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
214 WHEEL_Blue
) >> 24) & 0xff);
219 AROS_UFH0(void, slider_function
)
223 struct ColorWheelRGB cw
;
224 ULONG red
= XGET(r_slider
, MUIA_Numeric_Value
);
225 ULONG green
= XGET(g_slider
, MUIA_Numeric_Value
);
226 ULONG blue
= XGET(b_slider
, MUIA_Numeric_Value
);
228 cw
.cw_Red
= (red
<< 24) | (red
<< 16) | (red
<< 8) | red
;
229 cw
.cw_Green
= (green
<< 24) | (green
<< 16) | (green
<< 8) | green
;
230 cw
.cw_Blue
= (blue
<< 24) | (blue
<< 16) | (blue
<< 8) | blue
;
232 nnset(wheel
, WHEEL_RGB
, &cw
);
233 set(hue_gauge
, MUIA_Gauge_Current
, XGET(wheel
, WHEEL_Hue
));
238 AROS_UFH0(void, objects_function
)
242 Object
*new_obj
= MUI_MakeObject(MUIO_Button
, "Button");
245 DoMethod(group
, MUIM_Group_InitChange
);
246 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
247 DoMethod(group
, MUIM_Group_ExitChange
);
253 static void About(void)
255 static Object
*about_wnd
;
259 about_wnd
= AboutmuiObject
, MUIA_Aboutmui_Application
, app
, End
;
263 set(about_wnd
, MUIA_Window_Open
, TRUE
);
266 static void ChangeStringAccept(void)
268 STRPTR accept_chars
= NULL
, reject_chars
= NULL
;
272 accept_all
= XGET(string
.accept_all_check
, MUIA_Selected
);
273 SET(string
.accept_string
, MUIA_Disabled
, accept_all
);
274 SET(string
.reject_string
, MUIA_Disabled
, accept_all
);
278 GET(string
.accept_string
, MUIA_String_Contents
, &accept_chars
);
279 GET(string
.reject_string
, MUIA_String_Contents
, &reject_chars
);
282 for (i
= 0; i
< STRING_COUNT
; i
++)
284 SET(string
.strings
[i
], MUIA_String_Accept
, accept_chars
);
285 SET(string
.strings
[i
], MUIA_String_Reject
, reject_chars
);
289 static void ChangePen(void)
293 GET(colorfield_pen
, MUIA_String_Integer
, &pen
);
295 SET(colorfield
, MUIA_Colorfield_Pen
, pen
);
298 static void ChangePendisplayPen(void)
300 DoMethod(pendisplay
, MUIM_Pendisplay_SetColormap
,
301 XGET(pendisplay_pen
, MUIA_String_Integer
));
304 static void ChangeListTitle(void)
309 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
311 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
314 GET(list
.title_string
, MUIA_String_Contents
, &title
);
315 if (title
[0] == '\0')
318 title
= StrDup(title
);
320 SET(list
.lists
[i
], MUIA_List_Title
, title
);
323 static void UpdateListInfo(void)
329 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
331 GET(list
.lists
[i
], MUIA_List_DragSortable
, &value
);
332 NNSET(list
.dragsortable_check
, MUIA_Selected
, value
);
333 GET(list
.lists
[i
], MUIA_List_ShowDropMarks
, &value
);
334 NNSET(list
.showdropmarks_check
, MUIA_Selected
, value
);
335 value
= list
.quiet
[i
]; // MUIA_List_Quiet is not gettable!
336 NNSET(list
.quiet_check
, MUIA_Selected
, value
);
337 GET(list
.lists
[i
], MUIA_List_AutoVisible
, &value
);
338 NNSET(list
.autovisible_check
, MUIA_Selected
, value
);
340 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
341 NNSET(list
.title_string
, MUIA_String_Contents
, title
);
343 GET(list
.lists
[i
], MUIA_List_Entries
, &value
);
344 DoMethod(list
.entries_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
346 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
347 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
349 GET(list
.lists
[i
], MUIA_List_First
, &value
);
350 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
352 GET(list
.lists
[i
], MUIA_List_InsertPosition
, &value
);
353 DoMethod(list
.insert_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
355 GET(list
.lists
[i
], MUIA_List_Active
, &value
);
356 if (value
== MUIV_List_Active_Off
)
357 SET(list
.active_text
, MUIA_Text_Contents
, "N/A");
359 DoMethod(list
.active_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
363 static void ListGetVisible(void)
368 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
370 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
371 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
375 static void ListGetFirst(void)
380 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
382 GET(list
.lists
[i
], MUIA_List_First
, &value
);
383 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
387 static void ListSetDragSortable(void)
392 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
394 GET(list
.dragsortable_check
, MUIA_Selected
, &value
);
395 SET(list
.lists
[i
], MUIA_List_DragSortable
, value
);
398 static void ListSetShowDropMarks(void)
403 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
405 GET(list
.showdropmarks_check
, MUIA_Selected
, &value
);
406 SET(list
.lists
[i
], MUIA_List_ShowDropMarks
, value
);
409 static void ListSetQuiet(void)
414 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
416 GET(list
.quiet_check
, MUIA_Selected
, &value
);
417 SET(list
.lists
[i
], MUIA_List_Quiet
, value
);
418 list
.quiet
[i
] = value
;
421 static void ListSetAutoVisible(void)
426 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
428 GET(list
.autovisible_check
, MUIA_Selected
, &value
);
429 SET(list
.lists
[i
], MUIA_List_AutoVisible
, value
);
432 static void ListReset(void)
436 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
438 SET(list
.lists
[i
], MUIA_List_Active
, list_active_positions
[i
]);
441 static void ListMove(void)
443 LONG mode
, pos1
, pos2
;
446 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
448 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
451 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
455 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
458 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
462 DoMethod(list
.lists
[i
], MUIM_List_Move
, pos1
, pos2
);
465 static void ListSort(void)
469 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
471 DoMethod(list
.lists
[i
], MUIM_List_Sort
);
474 static void ListEnable(void)
478 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
480 SET(list
.lists
[i
], MUIA_Disabled
, FALSE
);
483 static void ListExchange(void)
485 LONG mode
, pos1
, pos2
;
488 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
490 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
493 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
497 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
500 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
504 DoMethod(list
.lists
[i
], MUIM_List_Exchange
, pos1
, pos2
);
507 static void ListJump(void)
512 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
514 mode
= XGET(list
.jump_cycle
, MUIA_Cycle_Active
);
517 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
521 DoMethod(list
.lists
[i
], MUIM_List_Jump
, pos
);
524 static void ListSelect(void)
529 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
531 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
534 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
538 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_On
,
542 static void ListDeselect(void)
547 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
549 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
552 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
556 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_Off
,
560 static void ListToggle(void)
565 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
567 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
570 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
574 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
,
575 MUIV_List_Select_Toggle
, NULL
);
578 static void ListRedraw(void)
583 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
585 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
588 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
592 DoMethod(list
.lists
[i
], MUIM_List_Redraw
, pos
);
595 static void ListInsertSingle(void)
600 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
602 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
605 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
609 DoMethod(list
.lists
[i
], MUIM_List_InsertSingle
, "Tomato", pos
);
612 static void ListInsert(void)
617 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
619 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
622 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
626 DoMethod(list
.lists
[i
], MUIM_List_Insert
, fruits
, -1, pos
);
629 static void ListRemove(void)
631 LONG mode
, pos
, count
, j
, *selections
;
634 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
636 mode
= XGET(list
.remove_cycle
, MUIA_Cycle_Active
);
639 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
645 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
646 This doesn't work as expected in MUI or Zune */
647 pos
= MUIV_List_NextSelected_Start
- 1;
648 while (pos
!= MUIV_List_NextSelected_End
)
650 if (pos
== MUIV_List_NextSelected_Start
- 1)
652 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
653 if (pos
!= MUIV_List_NextSelected_End
)
654 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
659 /* Remove selected entries safely by first retrieving them with
660 MUIM_List_NextSelected and then removing them one by one */
661 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
662 MUIV_List_Select_Ask
, &count
);
663 selections
= AllocVec(sizeof(LONG
) * count
, MEMF_ANY
);
664 if (selections
!= NULL
)
666 pos
= MUIV_List_NextSelected_Start
;
667 for (j
= 0; j
< count
; j
++)
669 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
673 /* We must remove the entries in reverse order; otherwise the
674 later indices will become invalid */
676 DoMethod(list
.lists
[i
], MUIM_List_Remove
, selections
[--count
]);
681 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
684 static void ListClear(void)
688 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
690 DoMethod(list
.lists
[i
], MUIM_List_Clear
);
693 static void ListActivate(void)
698 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
700 mode
= XGET(list
.activate_cycle
, MUIA_Cycle_Active
);
703 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
707 SET(list
.lists
[i
], MUIA_List_Active
, pos
);
710 static void ListDeactivate(void)
714 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
716 SET(list
.lists
[i
], MUIA_List_Active
, MUIV_List_Active_Off
);
719 AROS_UFH3(static void, display_function
,
720 AROS_UFHA(struct Hook
*, h
, A0
),
721 AROS_UFHA(char **, strings
, A2
),
722 AROS_UFHA(struct list_entry
*, entry
, A1
))
726 static char buf
[100];
730 sprintf(buf
, "%ld", (long)*(strings
- 1));
732 strings
[1] = entry
->column1
;
733 strings
[2] = entry
->column2
;
737 strings
[0] = "Number";
738 strings
[1] = "Column 1";
739 strings
[2] = "Column 2";
745 static void Save(void)
747 char *text
= (char *)XGET(editor_text
, MUIA_String_Contents
);
748 char *filename
= (char *)XGET(filename_string
, MUIA_String_Contents
);
751 if (!strlen(filename
))
754 if ((fh
= Open(filename
, MODE_NEWFILE
)))
756 Write(fh
, text
, strlen(text
));
761 #if defined(TEST_ICONLIST)
762 /* IconList callbacks */
763 static void volume_doubleclicked(void)
766 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
768 DoMethod(volume_iconlist
, MUIM_IconList_NextIcon
,
769 MUIV_IconList_NextIcon_Selected
, &ent
);
770 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
773 strcpy(buf
, ent
->label
);
775 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
, buf
);
778 static void drawer_doubleclicked(void)
780 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
782 DoMethod(drawer_iconlist
, MUIM_IconList_NextIcon
,
783 MUIV_IconList_NextIcon_Selected
, &ent
);
784 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
786 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
,
787 ent
->ile_IconEntry
->ie_IconNode
.ln_Name
);
791 static IPTR
create_balance_column(void)
793 return (IPTR
) VGroup
,
794 Child
, RectangleObject
,
797 Child
, BalanceObject
,
799 Child
, RectangleObject
,
802 Child
, BalanceObject
,
804 Child
, RectangleObject
,
807 Child
, BalanceObject
,
809 Child
, RectangleObject
,
812 Child
, BalanceObject
,
814 Child
, RectangleObject
,
820 /* The custom class */
829 struct Library
*KeymapBase
;
833 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
,
834 register __a2 Object
*obj
, register __a1 Msg msg
)
836 AROS_UFH3S(IPTR
, dispatcher
,
837 AROS_UFHA(Class
*, cl
, A0
),
838 AROS_UFHA(Object
*, obj
, A2
), AROS_UFHA(Msg
, msg
, A1
))
843 switch (msg
->MethodID
)
846 return MUIV_DragQuery_Accept
;
849 struct DropText_Data
*data
=
850 (struct DropText_Data
*)INST_DATA(cl
, obj
);
853 sprintf(buf
, "%ld times", (long)data
->times
);
854 set(obj
, MUIA_Text_Contents
, buf
);
858 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
863 static struct MUI_CustomClass
*CL_DropText
;
865 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
869 static struct Hook hook_standard
;
871 AROS_UFH3S(void, hook_func_standard
,
872 AROS_UFHA(struct Hook
*, h
, A0
),
873 AROS_UFHA(void *, dummy
, A2
), AROS_UFHA(void **, funcptr
, A1
))
877 void (*func
) (ULONG
*) = (void (*)(ULONG
*))(*funcptr
);
880 func((ULONG
*) funcptr
+ 1);
888 Object
*wnd
, *second_wnd
;
890 Object
*about_button
;
892 Object
*repeat_button
;
893 Object
*objects_button
;
894 Object
*about_item
, *quit_item
;
895 Object
*context_menu
;
896 Object
*popobject
, *listview
;
897 Object
*numerics
[NUMERIC_COUNT
];
898 Object
*min_string
, *max_string
;
899 Object
*slider_button
;
900 Object
*country_radio
[2];
905 static char *pages
[] =
906 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
908 #if defined(TEST_ICONLIST)
912 static char *text_pages
[] =
913 {"Text", "String", NULL
};
914 static char *color_pages
[] =
915 {"Palette", "Colors", "Pens", NULL
};
916 static char *list_pages
[] =
917 {"Single Column", "Multicolumn", NULL
};
918 static char **radio_entries1
= pages
;
919 static char *radio_entries2
[] =
920 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL
};
922 static struct list_entry entry1
= {"Testentry1", "Col2: Entry1"};
923 static struct list_entry entry2
= {"Entry2", "Col2: Entry2"};
924 static struct list_entry entry3
= {"Entry3", "Col2: Entry3"};
925 static struct list_entry entry4
= {"Entry4", "Col2: Entry4"};
926 static struct list_entry entry5
= {"Entry5", "Col2: Entry5"};
927 static struct list_entry entry6
= {"Entry6", "Col2: Entry6"};
929 static struct list_entry
*entries
[] =
930 {&entry1
, &entry2
, &entry3
, &entry4
, &entry5
, &entry6
, NULL
};
933 struct Hook hook_wheel
;
934 struct Hook hook_slider
;
935 struct Hook hook_objects
;
936 struct Hook hook_display
;
938 hook_standard
.h_Entry
= (HOOKFUNC
) hook_func_standard
;
940 pool
= CreatePool(MEMF_ANY
, 4096, 4096);
942 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library", 0);
944 hook
.h_Entry
= (HOOKFUNC
) repeat_function
;
945 hook_wheel
.h_Entry
= (HOOKFUNC
) wheel_function
;
946 hook_slider
.h_Entry
= (HOOKFUNC
) slider_function
;
947 hook_objects
.h_Entry
= (HOOKFUNC
) objects_function
;
948 hook_display
.h_Entry
= (HOOKFUNC
) display_function
;
950 context_menu
= MenustripObject
,
951 MUIA_Family_Child
, MenuObject
,
952 MUIA_Menu_Title
, "Menutest",
953 MUIA_Family_Child
, about_item
= MenuitemObject
,
954 MUIA_Menuitem_Title
, "First Test Entry", End
,
955 MUIA_Family_Child
, quit_item
= MenuitemObject
,
956 MUIA_Menuitem_Title
, "Second Test Entry", End
,
960 /* should check the result in a real program! */
961 CL_DropText
= MUI_CreateCustomClass(NULL
, MUIC_Text
, NULL
,
962 sizeof(struct DropText_Data
), dispatcher
);
963 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget", 0);
965 pendisplay
= PendisplayObject
, MUIA_Pendisplay_Spec
, &default_penspec
, End
;
967 title
= StrDup("Fruits");
968 list
.lists
[0] = ListviewObject
,
972 MUIA_List_Title
, title
,
973 MUIA_List_SourceArray
, fruits
,
974 MUIA_List_Active
, MUIV_List_Active_Top
,
975 MUIA_List_PoolThreshSize
, 256,
976 MUIA_ShortHelp
, "Default scroller\nTop entry active",
978 MUIA_Listview_MultiSelect
,
979 MUIV_Listview_MultiSelect_None
,
982 list
.lists
[1] = ListviewObject
,
986 MUIA_List_SourceArray
, fruits
,
987 MUIA_List_Active
, MUIV_List_Active_Bottom
,
988 MUIA_List_PoolPuddleSize
, 512,
989 MUIA_ShortHelp
, "Left scroller\nBottom entry active",
991 MUIA_Listview_ScrollerPos
,
992 MUIV_Listview_ScrollerPos_Left
,
995 list
.lists
[2] = ListviewObject
,
999 MUIA_List_SourceArray
, fruits
,
1000 MUIA_List_Active
, MUIV_List_Active_Off
,
1001 MUIA_List_Pool
, pool
,
1002 MUIA_ShortHelp
, "Right scroller\nNo active entry",
1004 MUIA_Listview_MultiSelect
,
1005 MUIV_Listview_MultiSelect_Shifted
,
1006 MUIA_Listview_ScrollerPos
,
1007 MUIV_Listview_ScrollerPos_Right
,
1010 list
.lists
[3] = ListviewObject
,
1014 MUIA_List_SourceArray
, fruits
,
1015 MUIA_List_Pool
, NULL
,
1016 MUIA_ShortHelp
, "No scroller\nDefault active entry",
1018 MUIA_Listview_MultiSelect
,
1019 MUIV_Listview_MultiSelect_Always
,
1020 MUIA_Listview_ScrollerPos
,
1021 MUIV_Listview_ScrollerPos_None
,
1024 list
.lists
[4] = ListviewObject
,
1028 MUIA_List_SourceArray
, fruits
,
1029 MUIA_ShortHelp
, "Default scroller\nDefault active entry",
1031 MUIA_Listview_Input
, FALSE
,
1035 app
= ApplicationObject
,
1036 MUIA_Application_Menustrip
, MenustripObject
,
1037 MUIA_Family_Child
, MenuObject
,
1038 MUIA_Menu_Title
, "Project",
1039 MUIA_Family_Child
, about_item
= MenuitemObject
,
1040 MUIA_Menuitem_Title
, "About...",
1041 MUIA_Menuitem_Shortcut
, "?",
1043 MUIA_Family_Child
, MenuitemObject
,
1044 MUIA_Menuitem_Title
, (SIPTR
)-1,
1046 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1047 MUIA_Menuitem_Title
, "Quit",
1048 MUIA_Menuitem_Shortcut
, "Q",
1053 SubWindow
, wnd
= WindowObject
,
1054 MUIA_Window_Title
, "test",
1055 MUIA_Window_Activate
, TRUE
,
1057 WindowContents
, VGroup
,
1058 Child
, RegisterGroup(pages
),
1059 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1064 GroupFrameT("A horizontal group"),
1066 GroupFrameT("A column group"),
1067 Child
, repeat_button
= TextObject
,
1070 MUIA_Background
, MUII_ButtonBack
,
1071 MUIA_Text_PreParse
, "\33c",
1072 MUIA_Text_Contents
, "Repeat",
1073 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1078 MUIA_Background
, MUII_ButtonBack
,
1079 MUIA_Text_PreParse
, "\33c",
1080 MUIA_Text_Contents
, "Drag Me",
1081 MUIA_Draggable
, TRUE
,
1082 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1084 Child
, open_button
= TextObject
,
1087 MUIA_Background
, MUII_ButtonBack
,
1088 MUIA_Text_PreParse
, "\33c",
1089 MUIA_Text_Contents
, "Open Window",
1090 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1093 MUIA_ContextMenu
, context_menu
,
1096 MUIA_Background
, MUII_ButtonBack
,
1097 MUIA_Text_PreParse
, "\33c",
1098 MUIA_Text_Contents
, "Press Right",
1099 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1101 Child
, objects_button
= TextObject
,
1104 MUIA_Background
, MUII_ButtonBack
,
1105 MUIA_Text_PreParse
, "\33c",
1106 MUIA_Text_Contents
, "Add Objects",
1107 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1112 Child
, MUI_MakeObject(MUIO_Checkmark
,
1116 Child
, MUI_MakeObject(MUIO_Label
,
1123 Child
, group
= VGroup
,
1124 GroupFrameT("A vertical group"),
1125 Child
, DropTextObject
,
1126 MUIA_Dropable
, TRUE
,
1129 MUIA_Background
, MUII_ButtonBack
,
1130 MUIA_Text_PreParse
, "\33c",
1131 MUIA_Text_Contents
, "Drop Here",
1132 MUIA_Dropable
, TRUE
,
1133 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1137 MUIA_Background
, MUII_MARKHALFSHINE
,
1139 MUIA_Text_PreParse
, "\33c",
1140 MUIA_Text_Contents
, "Pattern",
1142 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
1144 Child
, ScrollgroupObject
,
1145 GroupFrameT("A scroll group"),
1146 MUIA_Scrollgroup_Contents
, VGroupV
,
1151 "Line1\nLine2\nLine3\nLine4\n"
1152 "Line5\nLine6\nLine7\nLine8\n"
1154 "Line9\nLine10\nLine11\n",
1157 Child
, MUI_MakeObject(MUIO_Button
,
1159 Child
, MUI_MakeObject(MUIO_Button
,
1165 Child
, popobject
= PopobjectObject
,
1166 MUIA_Popstring_String
,
1167 MUI_MakeObject(MUIO_String
, NULL
, 200),
1168 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
1169 MUIA_Popobject_Object
, VGroup
,
1171 MUIA_Text_Contents
, "test",
1173 Child
, listview
= ListviewObject
,
1174 MUIA_Listview_List
, ListObject
,
1176 MUIA_List_DisplayHook
, &hook_display
,
1177 MUIA_List_Format
, ",,",
1178 MUIA_List_SourceArray
, entries
,
1179 MUIA_List_Title
, TRUE
,
1186 MUIA_Cycle_Entries
, pages
,
1188 Child
, ScrollbarObject
,
1189 MUIA_Group_Horiz
, TRUE
,
1190 MUIA_Prop_Visible
, 100,
1191 MUIA_Prop_Entries
, 300,
1192 MUIA_Prop_First
, 50,
1197 Child
, RegisterGroup(text_pages
),
1201 MUIA_Background
, "2:cfffffff,cfffffff,10000000",
1203 MUIA_Text_Contents
, "\33cHello World!\n"
1204 "This is a text object\n\33lLeft \33bbold\33n\n"
1207 Child
, RectangleObject
,
1209 /* Seems to be not supported properly as orginal MUI
1210 doesn't allow to alter the height of the window */
1211 MUIA_Rectangle_HBar
, TRUE
,
1212 MUIA_Rectangle_BarTitle
,"Enter a string",
1214 Child
, StringObject
,
1217 MUIA_String_AdvanceOnCR
, TRUE
,
1225 Child
, VGroup
, GroupFrameT("Default Alignment"),
1226 Child
, string
.strings
[0] = StringObject
,
1229 (IPTR
)default_accept_chars
,
1231 (IPTR
)default_reject_chars
,
1232 MUIA_String_AdvanceOnCR
, TRUE
,
1233 MUIA_String_MaxLen
, 9,
1235 MUIA_String_AttachedList
, list
.lists
[0],
1238 Child
, VGroup
, GroupFrameT("Left Aligned"),
1239 Child
, string
.strings
[1] = StringObject
,
1242 (IPTR
)default_accept_chars
,
1244 (IPTR
)default_reject_chars
,
1246 MUIV_String_Format_Left
,
1247 MUIA_String_AdvanceOnCR
, TRUE
,
1248 MUIA_String_MaxLen
, 9,
1250 MUIA_String_Contents
,
1251 (IPTR
)default_accept_chars
,
1252 MUIA_String_BufferPos
, 3,
1253 MUIA_String_AttachedList
, list
.lists
[0],
1256 Child
, VGroup
, GroupFrameT("Right Aligned"),
1257 Child
, string
.strings
[2] = StringObject
,
1260 (IPTR
)default_accept_chars
,
1262 (IPTR
)default_reject_chars
,
1264 MUIV_String_Format_Right
,
1265 MUIA_String_AdvanceOnCR
, TRUE
,
1266 MUIA_String_MaxLen
, 9,
1268 MUIA_String_AttachedList
, list
.lists
[0],
1271 Child
, VGroup
, GroupFrameT("Centered"),
1272 Child
, string
.strings
[3] = StringObject
,
1275 (IPTR
)default_accept_chars
,
1277 (IPTR
)default_reject_chars
,
1279 MUIV_String_Format_Center
,
1280 MUIA_String_AdvanceOnCR
, TRUE
,
1281 MUIA_String_MaxLen
, 9,
1283 MUIA_String_Integer
, 123,
1284 MUIA_String_AttachedList
, list
.lists
[0],
1287 Child
, VGroup
, GroupFrameT("Secret"),
1288 Child
, string
.strings
[4] = StringObject
,
1291 (IPTR
)default_accept_chars
,
1293 (IPTR
)default_reject_chars
,
1295 MUIV_String_Format_Center
,
1296 MUIA_String_Secret
, TRUE
,
1297 MUIA_String_AdvanceOnCR
, TRUE
,
1298 MUIA_String_MaxLen
, 9,
1300 MUIA_String_AttachedList
, list
.lists
[0],
1303 Child
, HGroup
, GroupFrameT("Narrow"),
1305 Child
, string
.strings
[5] = StringObject
,
1308 (IPTR
)default_accept_chars
,
1310 (IPTR
)default_reject_chars
,
1312 MUIV_String_Format_Center
,
1313 MUIA_String_AdvanceOnCR
, TRUE
,
1315 MUIA_String_MaxLen
, 9,
1317 MUIA_String_AttachedList
, list
.lists
[0],
1323 Child
, VGroup
, GroupFrameT("Controls"),
1325 Child
, string
.accept_all_check
=
1326 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1327 Child
, MUI_MakeObject(MUIO_Label
,
1328 "Accept all characters", 0),
1332 Child
, MUI_MakeObject(MUIO_Label
,
1333 "Acceptable characters:", 0),
1334 Child
, string
.accept_string
= StringObject
,
1336 MUIA_String_Contents
,
1337 (IPTR
)default_accept_chars
,
1339 Child
, MUI_MakeObject(MUIO_Label
,
1340 "Unacceptable characters:", 0),
1341 Child
, string
.reject_string
= StringObject
,
1344 Child
, MUI_MakeObject(MUIO_Label
,
1345 "Cursor position:", 0),
1346 Child
, string
.cursor_pos_slider
=
1348 MUIA_Group_Horiz
, TRUE
,
1349 MUIA_Numeric_Min
, 0,
1351 Child
, MUI_MakeObject(MUIO_Label
,
1352 "Display position:", 0),
1353 Child
, string
.display_pos_slider
=
1355 MUIA_Group_Horiz
, TRUE
,
1356 MUIA_Numeric_Min
, 0,
1358 Child
, MUI_MakeObject(MUIO_Label
,
1359 "Integer value:", 0),
1360 Child
, string
.integer_string
=
1363 MUIA_String_Accept
, (IPTR
)digits
,
1365 Child
, MUI_MakeObject(MUIO_Label
,
1367 Child
, string
.plaintext_string
=
1371 Child
, MUI_MakeObject(MUIO_Label
,
1372 "Maximum string length:", 0),
1373 Child
, string
.max_len_text
= TextObject
,
1375 MUIA_Text_Contents
, "Unknown",
1380 Child
, string
.cr_advance_check
=
1381 MUI_MakeObject(MUIO_Checkmark
,
1383 Child
, MUI_MakeObject(MUIO_Label
,
1384 "Advance on CR", 0),
1388 Child
, string
.attach_list_check
=
1389 MUI_MakeObject(MUIO_Checkmark
,
1391 Child
, MUI_MakeObject(MUIO_Label
,
1397 Child
, string
.standard_hook_check
=
1398 MUI_MakeObject(MUIO_Checkmark
,
1400 Child
, MUI_MakeObject(MUIO_Label
,
1401 "Use standard edit hook", 0),
1405 Child
, string
.custom_hook_check
=
1406 MUI_MakeObject(MUIO_Checkmark
,
1408 Child
, MUI_MakeObject(MUIO_Label
,
1409 "Use custom edit hook", 0),
1422 Child
, wheel
= BoopsiObject
, /* MUI/Boopsi tags mixed */
1424 /* boopsi objects don't know */
1425 /* their sizes, so we help */
1426 /* keep important values */
1427 /* during window resize */
1428 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
1429 MUIA_Boopsi_MinWidth
, 30,
1430 MUIA_Boopsi_MinHeight
, 30,
1431 MUIA_Boopsi_Remember
, WHEEL_Saturation
,
1432 MUIA_Boopsi_Remember
, WHEEL_Hue
,
1433 /* this magic fills in the screen pointer */
1434 MUIA_Boopsi_TagScreen
, WHEEL_Screen
,
1437 GA_Top
, 0, /* MUI will automatically */
1438 GA_Width
, 0, /* fill in the correct values */
1440 ICA_TARGET
, ICTARGET_IDCMP
,
1441 /* needed for notification */
1442 WHEEL_Saturation
, 0, /* start in the center */
1443 MUIA_FillArea
, TRUE
,
1444 /* use this because it defaults to FALSE
1445 for boopsi gadgets but the colorwheel
1446 doesn't bother about redrawing its
1450 Child
, r_slider
= SliderObject
,
1451 MUIA_Group_Horiz
, TRUE
,
1452 MUIA_Numeric_Min
, 0,
1453 MUIA_Numeric_Max
, 255,
1455 Child
, g_slider
= SliderObject
,
1456 MUIA_Group_Horiz
, TRUE
,
1457 MUIA_Numeric_Min
, 0,
1458 MUIA_Numeric_Max
, 255,
1460 Child
, b_slider
= SliderObject
,
1461 MUIA_Group_Horiz
, TRUE
,
1462 MUIA_Numeric_Min
, 0,
1463 MUIA_Numeric_Max
, 255,
1465 Child
, hue_gauge
= GaugeObject
,
1467 MUIA_Gauge_Horiz
, TRUE
,
1468 MUIA_Gauge_Max
, 255,
1469 MUIA_Gauge_Divide
, 1<<24,
1470 MUIA_Gauge_InfoText
, "Hue: %ld",
1475 Child
, RegisterGroup(color_pages
),
1476 Child
, VGroup
, GroupFrameT("Palette"),
1477 Child
, PaletteObject
,
1481 Child
, VGroup
, GroupFrameT("Colorfield"),
1484 Child
, colorfield
= ColorfieldObject
,
1485 MUIA_Colorfield_RGB
, default_color
,
1486 MUIA_Colorfield_Pen
, 253,
1488 Child
, colorfield2
= ColorfieldObject
,
1489 MUIA_Colorfield_Red
, default_color
[0],
1490 MUIA_Colorfield_Green
, default_color
[1],
1491 MUIA_Colorfield_Blue
, default_color
[2],
1494 Child
, colorfield_reset_button
=
1495 MUI_MakeObject(MUIO_Button
,
1499 MUI_MakeObject(MUIO_Label
, "Pen:", 0),
1500 Child
, colorfield_pen
= StringObject
,
1505 Child
, VGroup
, GroupFrameT("Coloradjust"),
1506 Child
, coloradjust
= ColoradjustObject
,
1507 MUIA_Coloradjust_RGB
, default_color
,
1513 Child
, VGroup
, GroupFrameT("Pendisplay"),
1516 Child
, pendisplay2
= PendisplayObject
,
1517 MUIA_Pendisplay_RGBcolor
,
1524 MUIO_Label
, "Pen:", 0),
1526 Child
, pendisplay_pen
=
1527 StringObject
, StringFrame
,
1530 Child
, reference_check
=
1531 MUI_MakeObject(MUIO_Checkmark
,
1533 Child
, MUI_MakeObject(MUIO_Label
,
1538 MUIO_Label
, "Penspec:", 0),
1539 Child
, pendisplay_spec
= StringObject
,
1544 Child
, shine_button
=
1545 MUI_MakeObject(MUIO_Button
,
1547 Child
, shadow_button
=
1548 MUI_MakeObject(MUIO_Button
,
1550 Child
, yellow_button
=
1551 MUI_MakeObject(MUIO_Button
,
1555 Child
, VGroup
, GroupFrameT("Poppen"),
1556 Child
, poppen
= PoppenObject
,
1560 Child
, VGroup
, GroupFrameT("Penadjust"),
1561 Child
, PenadjustObject
,
1569 Child
, editor_text
= StringObject
,
1572 Child
, PopaslObject
,
1573 ASLFR_DoSaveMode
, TRUE
,
1574 MUIA_Popstring_String
, filename_string
=
1575 MUI_MakeObject(MUIO_String
, NULL
, 200),
1576 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
1578 Child
, save_button
=
1579 MUI_MakeObject(MUIO_Button
, "Save"),
1583 Child
, RegisterGroup(list_pages
),
1585 Child
, ColGroup(LIST_COUNT
),
1586 Child
, VGroup
, GroupFrameT("No Multiselect"),
1587 Child
, list
.lists
[0],
1590 GroupFrameT("Default Multiselect"),
1591 Child
, list
.lists
[1],
1594 GroupFrameT("Shifted Multiselect"),
1595 Child
, list
.lists
[2],
1598 GroupFrameT("Unconditional Multiselect"),
1599 Child
, list
.lists
[3],
1602 GroupFrameT("Read Only"),
1603 Child
, list
.lists
[4],
1607 MUIA_Group_HorizSpacing
, 0,
1608 Child
, RectangleObject
,
1609 MUIA_HorizWeight
, 1,
1611 Child
, list
.list_radios
= RadioObject
,
1612 MUIA_Radio_Entries
, empty
,
1613 MUIA_Group_Horiz
, TRUE
,
1614 MUIA_HorizWeight
, 1000,
1616 Child
, RectangleObject
,
1617 MUIA_HorizWeight
, 1,
1620 Child
, RectangleObject
,
1622 MUIA_Rectangle_HBar
, TRUE
,
1623 MUIA_Rectangle_BarTitle
, "List Controls",
1626 Child
, MUI_MakeObject(MUIO_Label
,
1627 "Affected index 1:", 0),
1628 Child
, list
.index1_string
=
1631 MUIA_String_Accept
, (IPTR
)digits
,
1632 MUIA_String_Integer
, 0,
1635 Child
, list
.dragsortable_check
=
1636 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1637 Child
, MUI_MakeObject(MUIO_Label
,
1638 "Drag sortable", 0),
1642 Child
, list
.showdropmarks_check
=
1643 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1644 Child
, MUI_MakeObject(MUIO_Label
,
1645 "Show drop marks", 0),
1651 Child
, MUI_MakeObject(MUIO_Label
,
1652 "Affected index 2:", 0),
1653 Child
, list
.index2_string
=
1656 MUIA_String_Accept
, (IPTR
)digits
,
1657 MUIA_String_Integer
, 0,
1660 Child
, list
.quiet_check
=
1661 MUI_MakeObject(MUIO_Checkmark
,NULL
),
1662 Child
, MUI_MakeObject(MUIO_Label
,
1667 Child
, list
.autovisible_check
=
1668 MUI_MakeObject(MUIO_Checkmark
,NULL
),
1669 Child
, MUI_MakeObject(MUIO_Label
,
1673 Child
, list
.reset_button
=
1674 MUI_MakeObject(MUIO_Button
, "Reset"),
1677 Child
, MUI_MakeObject(MUIO_Label
,
1678 "Move/exchange mode 1:", 0),
1679 Child
, list
.move1_cycle
= CycleObject
,
1681 MUIA_Cycle_Entries
, list_move1_modes
,
1683 Child
, list
.move_button
=
1684 MUI_MakeObject(MUIO_Button
, "Move"),
1685 Child
, list
.sort_button
=
1686 MUI_MakeObject(MUIO_Button
, "Sort"),
1687 Child
, list
.enable_button
=
1688 MUI_MakeObject(MUIO_Button
, "Enable"),
1691 Child
, MUI_MakeObject(MUIO_Label
,
1692 "Move/exchange mode 2:", 0),
1693 Child
, list
.move2_cycle
= CycleObject
,
1695 MUIA_Cycle_Entries
, list_move2_modes
,
1697 Child
, list
.exchange_button
=
1698 MUI_MakeObject(MUIO_Button
, "Exchange"),
1699 Child
, list
.redraw_button
=
1700 MUI_MakeObject(MUIO_Button
, "Redraw"),
1701 Child
, MUI_MakeObject(MUIO_Label
,
1703 Child
, list
.title_string
=
1708 Child
, MUI_MakeObject(MUIO_Label
,
1710 Child
, list
.jump_cycle
= CycleObject
,
1712 MUIA_Cycle_Entries
, list_jump_modes
,
1714 Child
, list
.jump_button
=
1715 MUI_MakeObject(MUIO_Button
, "Jump"),
1716 Child
, list
.toggle_button
=
1717 MUI_MakeObject(MUIO_Button
, "Toggle"),
1718 Child
, MUI_MakeObject(MUIO_Label
,
1720 Child
, list
.entries_text
= TextObject
,
1722 MUIA_Text_Contents
, "N/A",
1725 Child
, MUI_MakeObject(MUIO_Label
,
1726 "Select/redraw mode:", 0),
1727 Child
, list
.select_cycle
= CycleObject
,
1729 MUIA_Cycle_Entries
, list_select_modes
,
1731 Child
, list
.select_button
=
1732 MUI_MakeObject(MUIO_Button
, "Select"),
1733 Child
, list
.deselect_button
=
1734 MUI_MakeObject(MUIO_Button
, "Deselect"),
1735 Child
, MUI_MakeObject(MUIO_Label
,
1736 "Visible entries:", 0),
1737 Child
, list
.visible_text
= TextObject
,
1739 MUIA_Text_Contents
, "N/A",
1742 Child
, MUI_MakeObject(MUIO_Label
,
1744 Child
, list
.insert_cycle
= CycleObject
,
1746 MUIA_Cycle_Entries
, list_insert_modes
,
1748 Child
, list
.insert_single_button
=
1749 MUI_MakeObject(MUIO_Button
, "Insert Single"),
1750 Child
, list
.insert_multiple_button
=
1751 MUI_MakeObject(MUIO_Button
, "Insert Multiple"),
1752 Child
, MUI_MakeObject(MUIO_Label
,
1753 "First visible index:", 0),
1754 Child
, list
.first_text
= TextObject
,
1756 MUIA_Text_Contents
, "N/A",
1759 Child
, MUI_MakeObject(MUIO_Label
,
1761 Child
, list
.remove_cycle
= CycleObject
,
1763 MUIA_Cycle_Entries
, list_remove_modes
,
1765 Child
, list
.remove_button
=
1766 MUI_MakeObject(MUIO_Button
, "Remove"),
1767 Child
, list
.clear_button
=
1768 MUI_MakeObject(MUIO_Button
, "Clear"),
1769 Child
, MUI_MakeObject(MUIO_Label
,
1770 "Last insertion index:", 0),
1771 Child
, list
.insert_text
= TextObject
,
1773 MUIA_Text_Contents
, "N/A",
1776 Child
, MUI_MakeObject(MUIO_Label
,
1777 "Activate mode:", 0),
1778 Child
, list
.activate_cycle
= CycleObject
,
1780 MUIA_Cycle_Entries
, list_activate_modes
,
1782 Child
, list
.activate_button
=
1783 MUI_MakeObject(MUIO_Button
, "Activate"),
1784 Child
, list
.deactivate_button
=
1785 MUI_MakeObject(MUIO_Button
, "Deactivate"),
1786 Child
, MUI_MakeObject(MUIO_Label
,
1787 "Active index:", 0),
1788 Child
, list
.active_text
= TextObject
,
1790 MUIA_Text_Contents
, "N/A",
1795 Child
, ColGroup(LIST_COUNT
/ 2),
1796 Child
, VGroup
, GroupFrameT("Standard Format"),
1797 Child
, list
.multi_lists
[0] = ListviewObject
,
1801 MUIA_List_DisplayHook
,
1803 MUIA_List_Format
, list_format
,
1804 MUIA_List_SourceArray
, entries
,
1805 MUIA_List_Title
, TRUE
,
1807 MUIA_Listview_MultiSelect
,
1808 MUIV_Listview_MultiSelect_None
,
1809 MUIA_Listview_DefClickColumn
, 1,
1813 Child
, VGroup
, GroupFrameT("Custom Format"),
1814 Child
, list
.multi_lists
[1] = ListviewObject
,
1818 MUIA_List_DisplayHook
,
1820 MUIA_List_Format
, list_format
,
1821 MUIA_List_SourceArray
, entries
,
1822 MUIA_List_Title
, TRUE
,
1824 MUIA_Listview_MultiSelect
,
1825 MUIV_Listview_MultiSelect_None
,
1830 Child
, RectangleObject
,
1832 MUIA_Rectangle_HBar
, TRUE
,
1833 MUIA_Rectangle_BarTitle
, "List Controls",
1836 Child
, MUI_MakeObject(MUIO_Label
, "Format:", 0),
1837 Child
, list
.format_string
= StringObject
,
1841 Child
, list
.showheadings_check
=
1842 MUI_MakeObject(MUIO_Checkmark
, NULL
),
1843 Child
, MUI_MakeObject(MUIO_Label
,
1844 "Show column headings", 0),
1847 Child
, MUI_MakeObject(MUIO_Label
,
1848 "Default clicked column:", 0),
1849 Child
, list
.def_column_string
= StringObject
,
1851 MUIA_String_Accept
, (IPTR
)digits
,
1852 MUIA_String_Integer
, -1,
1855 Child
, MUI_MakeObject(MUIO_Label
,
1856 "Clicked column:", 0),
1857 Child
, list
.column_string
= StringObject
,
1860 Child
, list
.column_text
= TextObject
,
1862 MUIA_Text_Contents
, "N/A",
1875 MUIA_Gauge_InfoText
, "%ld %%",
1876 MUIA_Gauge_Horiz
, TRUE
,
1877 MUIA_Gauge_Current
, 25,
1886 MUIA_Gauge_InfoText
, "%ld %%",
1887 MUIA_Gauge_Horiz
, TRUE
,
1888 MUIA_Gauge_Current
, 50,
1897 MUIA_Gauge_InfoText
, "%ld %%",
1898 MUIA_Gauge_Horiz
, TRUE
,
1899 MUIA_Gauge_Current
, 75,
1909 MUIA_Gauge_InfoText
, "%ld %%",
1910 MUIA_Gauge_Current
, 25,
1914 MUIA_Gauge_InfoText
, "%ld %%",
1915 MUIA_Gauge_Current
, 50,
1919 MUIA_Gauge_InfoText
, "%ld %%",
1920 MUIA_Gauge_Current
, 75,
1929 GroupFrameT("Horizontal Sliders"),
1930 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
1931 Child
, numerics
[HNSLIDER
] = SliderObject
,
1932 MUIA_Slider_Horiz
, TRUE
,
1933 MUIA_Numeric_Min
, NUMERIC_MIN
,
1934 MUIA_Numeric_Max
, NUMERIC_MAX
,
1937 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
1938 Child
, numerics
[HRSLIDER
] = SliderObject
,
1939 MUIA_Numeric_Reverse
, TRUE
,
1940 MUIA_Numeric_Min
, NUMERIC_MIN
,
1941 MUIA_Numeric_Max
, NUMERIC_MAX
,
1944 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
1945 Child
, numerics
[HQSLIDER
] = SliderObject
,
1946 MUIA_Slider_Quiet
, TRUE
,
1947 MUIA_Numeric_Min
, NUMERIC_MIN
,
1948 MUIA_Numeric_Max
, NUMERIC_MAX
,
1953 GroupFrameT("Vertical Sliders"),
1954 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
1955 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
1956 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
1957 Child
, numerics
[VNSLIDER
] = SliderObject
,
1958 MUIA_Slider_Horiz
, FALSE
,
1959 MUIA_Numeric_Min
, NUMERIC_MIN
,
1960 MUIA_Numeric_Max
, NUMERIC_MAX
,
1963 Child
, numerics
[VRSLIDER
] = SliderObject
,
1964 MUIA_Slider_Horiz
, FALSE
,
1965 MUIA_Numeric_Reverse
, TRUE
,
1966 MUIA_Numeric_Min
, NUMERIC_MIN
,
1967 MUIA_Numeric_Max
, NUMERIC_MAX
,
1970 Child
, numerics
[VQSLIDER
] = SliderObject
,
1971 MUIA_Slider_Horiz
, FALSE
,
1972 MUIA_Slider_Quiet
, TRUE
,
1973 MUIA_Numeric_Min
, NUMERIC_MIN
,
1974 MUIA_Numeric_Max
, NUMERIC_MAX
,
1979 GroupFrameT("Numeric Buttons"),
1980 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
1981 Child
, numerics
[NNUMERICBUTTON
] =
1982 NumericbuttonObject
,
1983 MUIA_Numeric_Min
, NUMERIC_MIN
,
1984 MUIA_Numeric_Max
, NUMERIC_MAX
,
1987 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
1988 Child
, numerics
[RNUMERICBUTTON
] =
1989 NumericbuttonObject
,
1990 MUIA_Numeric_Reverse
, TRUE
,
1991 MUIA_Numeric_Min
, NUMERIC_MIN
,
1992 MUIA_Numeric_Max
, NUMERIC_MAX
,
1997 GroupFrameT("Knobs"),
1998 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
1999 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
2000 Child
, numerics
[NKNOB
] = KnobObject
,
2001 MUIA_Numeric_Min
, NUMERIC_MIN
,
2002 MUIA_Numeric_Max
, NUMERIC_MAX
,
2005 Child
, numerics
[RKNOB
] = KnobObject
,
2006 MUIA_Numeric_Reverse
, TRUE
,
2007 MUIA_Numeric_Min
, NUMERIC_MIN
,
2008 MUIA_Numeric_Max
, NUMERIC_MAX
,
2013 Child
, MUI_MakeObject(MUIO_Label
,
2014 "Minimum Value:", 0),
2015 Child
, min_string
= (Object
*)StringObject
,
2017 MUIA_String_Accept
, (IPTR
)digits
,
2018 MUIA_String_Integer
, NUMERIC_MIN
,
2021 Child
, MUI_MakeObject(MUIO_Label
,
2022 "Maximum Value:", 0),
2023 Child
, max_string
= (Object
*)StringObject
,
2025 MUIA_String_Accept
, (IPTR
)digits
,
2026 MUIA_String_Integer
, NUMERIC_MAX
,
2029 Child
, slider_button
= TextObject
,
2031 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2033 MUIA_Background
, MUII_ButtonBack
,
2034 MUIA_Text_PreParse
, "\33c",
2036 "Change Slider Orientations",
2038 Child
, MUI_MakeObject(MUIO_Label
, "", 0),
2047 MUIA_Radio_Entries
, radio_entries1
,
2049 Child
, country_radio
[0] = RadioObject
,
2051 MUIA_Radio_Entries
, radio_entries2
,
2052 MUIA_Radio_Active
, 1,
2058 MUIA_Radio_Entries
, radio_entries1
,
2060 Child
, country_radio
[1] = RadioObject
,
2062 MUIA_Radio_Entries
, radio_entries2
,
2063 MUIA_Radio_Active
, 1,
2068 #if defined(TEST_ICONLIST)
2071 Child
, volume_iconlist
=
2072 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
2074 Child
, drawer_iconlist
=
2075 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
2076 MUIA_IconDrawerList_Drawer
, "SYS:",
2083 Child
, create_balance_column(),
2084 Child
, BalanceObject
,
2087 Child
, create_balance_column(),
2088 Child
, BalanceObject
,
2091 Child
, create_balance_column(),
2092 Child
, BalanceObject
,
2095 Child
, create_balance_column(),
2096 Child
, BalanceObject
,
2099 Child
, create_balance_column(),
2106 Child
, about_button
= TextObject
,
2108 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2110 MUIA_Background
, MUII_ButtonBack
,
2111 MUIA_Text_PreParse
, "\33c",
2112 MUIA_Text_Contents
, "About",
2114 Child
, quit_button
= TextObject
,
2116 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2118 MUIA_Background
, MUII_ButtonBack
,
2119 MUIA_ControlChar
, 'q',
2120 MUIA_Text_HiChar
, 'q',
2121 MUIA_Text_PreParse
, "\33c",
2122 MUIA_Text_Contents
, "Quit",
2128 SubWindow
, second_wnd
= WindowObject
,
2129 MUIA_Window_Title
, "Second window",
2130 WindowContents
, VGroup
,
2131 Child
, DropTextObject
,
2132 MUIA_Text_Contents
, "Drop here",
2133 MUIA_Dropable
, TRUE
,
2144 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
2145 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2146 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
2147 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
2148 DoMethod(open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, second_wnd
,
2149 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
2150 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2151 MUIM_Application_AboutMUI
, NULL
);
2152 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2153 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
2154 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
2155 MUIM_CallHook
, &hook_objects
);
2156 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
2157 app
, 2, MUIM_CallHook
, &hook
);
2159 /* Notifications and set-up for string objects */
2160 DoMethod(string
.max_len_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
2161 "%ld", XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2162 set(string
.cursor_pos_slider
, MUIA_Numeric_Max
,
2163 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2164 set(string
.display_pos_slider
, MUIA_Numeric_Max
,
2165 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2166 set(string
.cr_advance_check
, MUIA_Selected
, TRUE
);
2167 set(string
.attach_list_check
, MUIA_Selected
, TRUE
);
2168 set(string
.strings
[1], MUIA_Disabled
,
2169 XGET(string
.strings
[1], MUIA_String_Format
)
2170 != MUIV_String_Format_Left
);
2171 set(string
.strings
[2], MUIA_Disabled
,
2172 XGET(string
.strings
[2], MUIA_String_Format
)
2173 != MUIV_String_Format_Right
);
2174 set(string
.strings
[3], MUIA_Disabled
,
2175 XGET(string
.strings
[3], MUIA_String_Format
)
2176 != MUIV_String_Format_Center
);
2177 set(string
.strings
[4], MUIA_Disabled
,
2178 !XGET(string
.strings
[4], MUIA_String_Secret
));
2179 set(string
.strings
[0], MUIA_String_MaxLen
, 100);
2180 set(string
.reject_string
, MUIA_String_Contents
,
2181 (IPTR
)default_reject_chars
);
2183 for (i
= 0; i
< STRING_COUNT
; i
++)
2187 DoMethod(string
.accept_string
, MUIM_Notify
,
2188 MUIA_String_Contents
, MUIV_EveryTime
, string
.strings
[i
],
2189 3, MUIM_Set
, MUIA_String_Accept
, MUIV_TriggerValue
);
2190 DoMethod(string
.cr_advance_check
, MUIM_Notify
, MUIA_Selected
,
2191 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2192 MUIA_String_AdvanceOnCR
, MUIV_TriggerValue
);
2193 DoMethod(string
.cursor_pos_slider
, MUIM_Notify
,
2194 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2195 MUIM_Set
, MUIA_String_BufferPos
, MUIV_TriggerValue
);
2196 DoMethod(string
.display_pos_slider
, MUIM_Notify
,
2197 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2198 MUIM_Set
, MUIA_String_DisplayPos
, MUIV_TriggerValue
);
2199 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2200 TRUE
, string
.strings
[i
], 3, MUIM_Set
,
2201 MUIA_String_AttachedList
, list
.lists
[0]);
2202 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2203 FALSE
, string
.strings
[i
], 3, MUIM_Set
,
2204 MUIA_String_AttachedList
, NULL
);
2208 DoMethod(string
.strings
[0], MUIM_Notify
, MUIA_String_Accept
,
2209 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2210 MUIA_String_Accept
, MUIV_TriggerValue
);
2211 DoMethod(string
.strings
[0], MUIM_Notify
,
2212 MUIA_String_AdvanceOnCR
, MUIV_EveryTime
,
2213 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_AdvanceOnCR
,
2215 DoMethod(string
.strings
[0], MUIM_Notify
,
2216 MUIA_String_BufferPos
, MUIV_EveryTime
,
2217 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_BufferPos
,
2219 DoMethod(string
.strings
[0], MUIM_Notify
,
2220 MUIA_String_DisplayPos
, MUIV_EveryTime
,
2221 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_DisplayPos
,
2223 DoMethod(string
.strings
[0], MUIM_Notify
,
2224 MUIA_String_AttachedList
, MUIV_EveryTime
,
2225 string
.strings
[i
], 3, MUIM_Set
,
2226 MUIA_String_AttachedList
, MUIV_TriggerValue
);
2228 DoMethod(string
.reject_string
, MUIM_Notify
, MUIA_String_Contents
,
2229 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2230 MUIA_String_Reject
, MUIV_TriggerValue
);
2231 DoMethod(string
.strings
[i
], MUIM_Notify
, MUIA_String_Integer
,
2232 MUIV_EveryTime
, string
.integer_string
, 3, MUIM_NoNotifySet
,
2233 MUIA_String_Integer
, MUIV_TriggerValue
);
2234 DoMethod(string
.integer_string
, MUIM_Notify
, MUIA_String_Integer
,
2235 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_NoNotifySet
,
2236 MUIA_String_Integer
, MUIV_TriggerValue
);
2238 DoMethod(string
.accept_all_check
, MUIM_Notify
, MUIA_Selected
,
2239 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2240 ChangeStringAccept
);
2241 DoMethod(string
.strings
[4], MUIM_Notify
, MUIA_String_Acknowledge
,
2242 MUIV_EveryTime
, string
.plaintext_string
, 3, MUIM_NoNotifySet
,
2243 MUIA_String_Contents
, MUIV_TriggerValue
);
2244 DoMethod(string
.plaintext_string
, MUIM_Notify
,
2245 MUIA_String_Acknowledge
, MUIV_EveryTime
, string
.strings
[4], 3,
2246 MUIM_NoNotifySet
, MUIA_String_Contents
, MUIV_TriggerValue
);
2248 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
2249 MUIM_CallHook
, &hook_wheel
);
2250 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
2251 2, MUIM_CallHook
, &hook_wheel
);
2252 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2253 app
, 2, MUIM_CallHook
, &hook_slider
);
2254 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2255 app
, 2, MUIM_CallHook
, &hook_slider
);
2256 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2257 app
, 2, MUIM_CallHook
, &hook_slider
);
2259 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
2260 MUIM_CallHook
, &hook_standard
, Save
);
2262 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2263 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
2264 MUIV_Application_ReturnID_Quit
);
2265 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2266 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2269 /* Notifications for color objects */
2270 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Red
,
2271 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2273 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Green
,
2274 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2276 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Blue
,
2277 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2279 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Red
,
2280 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2282 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Green
,
2283 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2285 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Blue
,
2286 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2288 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Pen
,
2289 MUIV_EveryTime
, colorfield_pen
, 3, MUIM_Set
,
2290 MUIA_String_Integer
, MUIV_TriggerValue
);
2291 DoMethod(colorfield_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2292 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2294 DoMethod(colorfield_reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2295 colorfield
, 3, MUIM_Set
, MUIA_Colorfield_RGB
, default_color
);
2297 /* Notifications for pen objects */
2298 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Pen
,
2299 MUIV_EveryTime
, pendisplay_pen
, 3, MUIM_NoNotifySet
,
2300 MUIA_String_Integer
, MUIV_TriggerValue
);
2301 DoMethod(pendisplay_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2302 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2303 ChangePendisplayPen
);
2304 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Spec
,
2305 MUIV_EveryTime
, pendisplay_spec
, 3, MUIM_Set
,
2306 MUIA_String_Contents
, MUIV_TriggerValue
);
2307 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_RGB
,
2308 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
,
2309 MUIA_Pendisplay_RGBcolor
, MUIV_TriggerValue
);
2310 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_RGBcolor
,
2311 MUIV_EveryTime
, poppen
, 3, MUIM_Set
, MUIA_Pendisplay_RGBcolor
,
2313 DoMethod(pendisplay_spec
, MUIM_Notify
, MUIA_String_Contents
,
2314 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
, MUIA_Pendisplay_Spec
,
2316 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, TRUE
,
2317 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, pendisplay
);
2318 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, FALSE
,
2319 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, NULL
);
2320 DoMethod(shine_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2321 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHINE
);
2322 DoMethod(shadow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2323 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHADOW
);
2324 DoMethod(yellow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2325 4, MUIM_Pendisplay_SetRGB
, 0xffffffff, 0xffffffff, 0);
2327 /* Notifications and set-up for list objects */
2328 set(list
.showdropmarks_check
, MUIA_Selected
, TRUE
);
2330 for (i
= 0; i
< LIST_COUNT
; i
++)
2332 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2333 MUIV_EveryTime
, list
.lists
[i
], 3, MUIM_Set
, MUIA_Disabled
,
2335 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Entries
,
2336 MUIV_EveryTime
, list
.entries_text
, 4, MUIM_SetAsString
,
2337 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2338 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Visible
,
2339 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2341 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_First
,
2342 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2344 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_InsertPosition
,
2345 MUIV_EveryTime
, list
.insert_text
, 4, MUIM_SetAsString
,
2346 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2347 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Active
,
2348 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2351 DoMethod(list
.dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
2352 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2353 ListSetDragSortable
);
2354 DoMethod(list
.showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
2355 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2356 ListSetShowDropMarks
);
2357 DoMethod(list
.quiet_check
, MUIM_Notify
, MUIA_Selected
,
2358 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2360 DoMethod(list
.autovisible_check
, MUIM_Notify
, MUIA_Selected
,
2361 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2362 ListSetAutoVisible
);
2363 DoMethod(list
.reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2364 app
, 3, MUIM_CallHook
, &hook_standard
, ListReset
);
2365 DoMethod(list
.move_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2366 app
, 3, MUIM_CallHook
, &hook_standard
, ListMove
);
2367 DoMethod(list
.sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2368 app
, 3, MUIM_CallHook
, &hook_standard
, ListSort
);
2369 DoMethod(list
.enable_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2370 app
, 3, MUIM_CallHook
, &hook_standard
, ListEnable
);
2371 DoMethod(list
.exchange_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2372 app
, 3, MUIM_CallHook
, &hook_standard
, ListExchange
);
2373 DoMethod(list
.jump_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2374 app
, 3, MUIM_CallHook
, &hook_standard
, ListJump
);
2375 DoMethod(list
.select_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2376 app
, 3, MUIM_CallHook
, &hook_standard
, ListSelect
);
2377 DoMethod(list
.deselect_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2378 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeselect
);
2379 DoMethod(list
.toggle_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2380 app
, 3, MUIM_CallHook
, &hook_standard
, ListToggle
);
2381 DoMethod(list
.redraw_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2382 app
, 3, MUIM_CallHook
, &hook_standard
, ListRedraw
);
2383 DoMethod(list
.insert_single_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2384 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsertSingle
);
2385 DoMethod(list
.insert_multiple_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2386 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsert
);
2387 DoMethod(list
.remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2388 app
, 3, MUIM_CallHook
, &hook_standard
, ListRemove
);
2389 DoMethod(list
.clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2390 app
, 3, MUIM_CallHook
, &hook_standard
, ListClear
);
2391 DoMethod(list
.activate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2392 app
, 3, MUIM_CallHook
, &hook_standard
, ListActivate
);
2393 DoMethod(list
.deactivate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2394 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeactivate
);
2395 DoMethod(list
.title_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2396 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2398 DoMethod(list
.list_radios
, MUIM_Notify
, MUIA_Radio_Active
,
2399 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2402 SET(list
.showheadings_check
, MUIA_Selected
,
2403 XGET(list
.multi_lists
[0], MUIA_List_Title
));
2404 SET(list
.format_string
, MUIA_String_Contents
,
2405 XGET(list
.multi_lists
[1], MUIA_List_Format
));
2406 SET(list
.def_column_string
, MUIA_String_Integer
,
2407 XGET(list
.multi_lists
[0], MUIA_Listview_DefClickColumn
));
2408 DoMethod(list
.format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2409 MUIV_EveryTime
, list
.multi_lists
[1], 3, MUIM_Set
,
2410 MUIA_List_Format
, MUIV_TriggerValue
);
2411 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_List_Format
,
2412 MUIV_EveryTime
, wnd
, 3, MUIM_Set
,
2413 MUIA_Window_ActiveObject
, list
.format_string
);
2414 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
2416 DoMethod(list
.showheadings_check
, MUIM_Notify
, MUIA_Selected
,
2417 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2418 MUIA_List_Title
, MUIV_TriggerValue
);
2419 DoMethod(list
.def_column_string
, MUIM_Notify
,
2420 MUIA_String_Integer
,
2421 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2422 MUIA_Listview_DefClickColumn
, MUIV_TriggerValue
);
2423 DoMethod(list
.multi_lists
[i
], MUIM_Notify
,
2424 MUIA_Listview_ClickColumn
, MUIV_EveryTime
,
2425 list
.column_string
, 3, MUIM_Set
, MUIA_String_Integer
,
2428 DoMethod(list
.column_string
, MUIM_Notify
, MUIA_String_Contents
,
2429 MUIV_EveryTime
, list
.column_text
, 3, MUIM_Set
, MUIA_Text_Contents
,
2432 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
2433 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
2436 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
2438 DoMethod(min_string
, MUIM_Notify
, MUIA_String_Integer
,
2439 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Min
,
2441 DoMethod(max_string
, MUIM_Notify
, MUIA_String_Integer
,
2442 MUIV_EveryTime
, numerics
[i
], 3, MUIM_Set
, MUIA_Numeric_Max
,
2445 DoMethod(slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2446 numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
2449 DoMethod(country_radio
[0], MUIM_Notify
, MUIA_Radio_Active
,
2450 MUIV_EveryTime
, country_radio
[1], 3, MUIM_NoNotifySet
,
2451 MUIA_Radio_Active
, MUIV_TriggerValue
);
2452 DoMethod(country_radio
[1], MUIM_Notify
, MUIA_Radio_Active
,
2453 MUIV_EveryTime
, country_radio
[0], 3, MUIM_NoNotifySet
,
2454 MUIA_Radio_Active
, MUIV_TriggerValue
);
2456 #if defined(TEST_ICONLIST)
2458 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2459 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2460 volume_doubleclicked
);
2461 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2462 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2463 drawer_doubleclicked
);
2466 /* automatic tests */
2467 get(list
.lists
[0], MUIA_List_Visible
, &value
);
2469 printf("MUIA_List_Visible equals %ld before display,"
2470 " but it should be -1.\n", (long)value
);
2472 set(wnd
, MUIA_Window_Open
, TRUE
);
2473 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test application");
2475 /* Set pen fields */
2476 set(colorfield_pen
, MUIA_String_Integer
,
2477 XGET(colorfield
, MUIA_Colorfield_Pen
));
2480 nnset(pendisplay_pen
, MUIA_String_Integer
,
2481 XGET(pendisplay
, MUIA_Pendisplay_Pen
));
2483 struct MUI_PenSpec
*pen_spec
= NULL
;
2484 GET(pendisplay
, MUIA_Pendisplay_Spec
, &pen_spec
);
2485 strncpy(pen_str
, pen_spec
->buf
, 10);
2486 set(pendisplay_spec
, MUIA_String_Contents
, pen_str
);
2488 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
2489 &sigs
) != MUIV_Application_ReturnID_Quit
)
2493 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
2494 if (sigs
& SIGBREAKF_CTRL_C
)
2496 if (sigs
& SIGBREAKF_CTRL_D
)
2501 MUI_DisposeObject(app
);
2504 MUI_DisposeObject(context_menu
);
2505 CloseLibrary(ColorWheelBase
);
2506 MUI_DeleteCustomClass(CL_DropText
);
2508 CloseLibrary(MUIMasterBase
);