aknowledge pending IRQs when we disable them
[AROS.git] / test / Zune / test.c
blob88702f300813f145bb80a54cc698995dc67d9b5f
1 /*
2 Copyright © 2002-2015, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #define INTUITION_NO_INLINE_STDARG
10 #include <exec/types.h>
11 #include <stdlib.h>
12 #include <stdio.h>
13 #include <string.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
31 #if 0
32 #define TEST_ICONLIST
33 #endif
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"
39 #endif
41 #define LIST_COUNT 5
42 #define MULTI_LIST_COUNT 2
44 #define NUMERIC_MIN 0
45 #define NUMERIC_MAX 100
47 static const ULONG default_color[] = {155 << 24, 180 << 24, 255 << 24};
48 static const struct MUI_PenSpec default_penspec = {"m0"};
49 static const TEXT list_format[] = "BAR,BAR,";
51 enum
53 HNSLIDER,
54 HRSLIDER,
55 HQSLIDER,
56 VNSLIDER,
57 VRSLIDER,
58 VQSLIDER,
59 NNUMERICBUTTON,
60 RNUMERICBUTTON,
61 NKNOB,
62 RKNOB,
63 NUMERIC_COUNT
66 struct Library *MUIMasterBase;
67 struct Library *ColorWheelBase;
69 struct list_entry
71 char *column1;
72 char *column2;
75 Object *app;
77 Object *wheel;
78 Object *r_slider;
79 Object *g_slider;
80 Object *b_slider;
81 Object *hue_gauge;
82 Object *colorfield, *colorfield2, *colorfield_reset_button, *colorfield_pen;
83 Object *coloradjust;
84 Object *pendisplay, *pendisplay2, *pendisplay_pen, *pendisplay_spec,
85 *reference_check, *shine_button, *shadow_button, *yellow_button, *poppen;
86 Object *group;
87 Object *editor_text;
88 Object *filename_string;
89 Object *save_button;
90 Object *list2;
92 Object *drawer_iconlist;
93 Object *volume_iconlist;
95 AROS_UFH0(void, repeat_function)
97 AROS_USERFUNC_INIT
99 printf("MUI_Timer\n");
101 AROS_USERFUNC_EXIT
104 AROS_UFH0(void, wheel_function)
106 AROS_USERFUNC_INIT
108 nnset(r_slider, MUIA_Numeric_Value, (XGET(wheel,
109 WHEEL_Red) >> 24) & 0xff);
110 nnset(g_slider, MUIA_Numeric_Value, (XGET(wheel,
111 WHEEL_Green) >> 24) & 0xff);
112 nnset(b_slider, MUIA_Numeric_Value, (XGET(wheel,
113 WHEEL_Blue) >> 24) & 0xff);
115 AROS_USERFUNC_EXIT
118 AROS_UFH0(void, slider_function)
120 AROS_USERFUNC_INIT
122 struct ColorWheelRGB cw;
123 ULONG red = XGET(r_slider, MUIA_Numeric_Value);
124 ULONG green = XGET(g_slider, MUIA_Numeric_Value);
125 ULONG blue = XGET(b_slider, MUIA_Numeric_Value);
127 cw.cw_Red = (red << 24) | (red << 16) | (red << 8) | red;
128 cw.cw_Green = (green << 24) | (green << 16) | (green << 8) | green;
129 cw.cw_Blue = (blue << 24) | (blue << 16) | (blue << 8) | blue;
131 nnset(wheel, WHEEL_RGB, &cw);
132 set(hue_gauge, MUIA_Gauge_Current, XGET(wheel, WHEEL_Hue));
134 AROS_USERFUNC_EXIT
137 AROS_UFH0(void, objects_function)
139 AROS_USERFUNC_INIT
141 Object *new_obj = MUI_MakeObject(MUIO_Button, "Button");
142 if (new_obj)
144 DoMethod(group, MUIM_Group_InitChange);
145 DoMethod(group, OM_ADDMEMBER, new_obj);
146 DoMethod(group, MUIM_Group_ExitChange);
149 AROS_USERFUNC_EXIT
152 AROS_UFH0(void, about_function)
154 AROS_USERFUNC_INIT
156 static Object *about_wnd;
158 if (!about_wnd)
160 about_wnd = AboutmuiObject, MUIA_Aboutmui_Application, app, End;
163 if (about_wnd)
164 set(about_wnd, MUIA_Window_Open, TRUE);
166 AROS_USERFUNC_EXIT
169 AROS_UFH0(void, changepen_function)
171 AROS_USERFUNC_INIT
173 SIPTR pen;
175 GET(colorfield_pen, MUIA_String_Integer, &pen);
176 if (pen >= 0)
177 SET(colorfield, MUIA_Colorfield_Pen, pen);
179 AROS_USERFUNC_EXIT
182 AROS_UFH0(void, ChangePendisplayPen)
184 AROS_USERFUNC_INIT
186 DoMethod(pendisplay, MUIM_Pendisplay_SetColormap,
187 XGET(pendisplay_pen, MUIA_String_Integer));
189 AROS_USERFUNC_EXIT
192 AROS_UFH3(void, display_function,
193 AROS_UFHA(struct Hook *, h, A0),
194 AROS_UFHA(char **, strings, A2),
195 AROS_UFHA(struct list_entry *, entry, A1))
197 AROS_USERFUNC_INIT
199 static char buf[100];
201 if (entry)
203 sprintf(buf, "%ld", (long)*(strings - 1));
204 strings[0] = buf;
205 strings[1] = entry->column1;
206 strings[2] = entry->column2;
208 else
210 strings[0] = "Number";
211 strings[1] = "Column 1";
212 strings[2] = "Column 2";
215 AROS_USERFUNC_EXIT
218 AROS_UFH3(void, display2_function,
219 AROS_UFHA(struct Hook *, h, A0),
220 AROS_UFHA(char **, strings, A2),
221 AROS_UFHA(struct list_entry *, entry, A1))
223 AROS_USERFUNC_INIT
225 static char buf[100];
227 if (entry)
229 sprintf(buf, "line num: %ld id: %p", (long)*(strings - 1), entry);
230 strings[0] = buf;
232 else
234 strings[0] = "Number";
237 AROS_USERFUNC_EXIT
240 AROS_UFH0(void, save_function)
242 AROS_USERFUNC_INIT
244 char *text = (char *)XGET(editor_text, MUIA_String_Contents);
245 char *filename = (char *)XGET(filename_string, MUIA_String_Contents);
246 BPTR fh;
248 if (!strlen(filename))
249 return;
251 if ((fh = Open(filename, MODE_NEWFILE)))
253 Write(fh, text, strlen(text));
254 Close(fh);
257 AROS_USERFUNC_EXIT
260 static int id = 1;
262 AROS_UFH0(void, add_function)
264 AROS_USERFUNC_INIT
266 DoMethod(list2, MUIM_List_InsertSingle, id++,
267 MUIV_List_Insert_Bottom);
269 AROS_USERFUNC_EXIT
272 #if defined(TEST_ICONLIST)
273 /* IconList callbacks */
274 void volume_doubleclicked(void)
276 char buf[200];
277 struct IconList_Entry *ent = (void *)MUIV_IconList_NextIcon_Start;
279 DoMethod(volume_iconlist, MUIM_IconList_NextIcon,
280 MUIV_IconList_NextIcon_Selected, &ent);
281 if ((IPTR) ent == MUIV_IconList_NextIcon_End)
282 return;
284 strcpy(buf, ent->label);
285 strcat(buf, ":");
286 set(drawer_iconlist, MUIA_IconDrawerList_Drawer, buf);
289 void drawer_doubleclicked(void)
291 struct IconList_Entry *ent = (void *)MUIV_IconList_NextIcon_Start;
293 DoMethod(drawer_iconlist, MUIM_IconList_NextIcon,
294 MUIV_IconList_NextIcon_Selected, &ent);
295 if ((IPTR) ent == MUIV_IconList_NextIcon_End)
296 return;
297 set(drawer_iconlist, MUIA_IconDrawerList_Drawer,
298 ent->ile_IconEntry->ie_IconNode.ln_Name);
300 #endif
302 static IPTR create_balance_column(void)
304 return (IPTR) VGroup,
305 Child, RectangleObject,
306 GaugeFrame,
307 End,
308 Child, BalanceObject,
309 End,
310 Child, RectangleObject,
311 GaugeFrame,
312 End,
313 Child, BalanceObject,
314 End,
315 Child, RectangleObject,
316 GaugeFrame,
317 End,
318 Child, BalanceObject,
319 End,
320 Child, RectangleObject,
321 GaugeFrame,
322 End,
323 Child, BalanceObject,
324 End,
325 Child, RectangleObject,
326 GaugeFrame,
327 End,
328 End;
331 /* The custom class */
333 struct DropText_Data
335 ULONG times;
338 #ifdef __MAXON__
339 #undef KeymapBase
340 struct Library *KeymapBase;
341 #endif
343 #ifndef __AROS__
344 __saveds __asm IPTR dispatcher(register __a0 struct IClass *cl,
345 register __a2 Object *obj, register __a1 Msg msg)
346 #else
347 AROS_UFH3S(IPTR, dispatcher,
348 AROS_UFHA(Class *, cl, A0),
349 AROS_UFHA(Object *, obj, A2), AROS_UFHA(Msg, msg, A1))
350 #endif
352 AROS_USERFUNC_INIT
354 switch (msg->MethodID)
356 case MUIM_DragQuery:
357 return MUIV_DragQuery_Accept;
358 case MUIM_DragDrop:
360 struct DropText_Data *data =
361 (struct DropText_Data *)INST_DATA(cl, obj);
362 char buf[100];
363 data->times++;
364 sprintf(buf, "%ld times", (long)data->times);
365 /* no MUIM_SetAsString yet */
366 set(obj, MUIA_Text_Contents, buf);
370 return DoSuperMethodA(cl, obj, (Msg) msg);
372 AROS_USERFUNC_EXIT
375 struct MUI_CustomClass *CL_DropText;
377 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
379 /* Main prog */
381 static struct Hook hook_standard;
383 AROS_UFH3(void, hook_func_standard,
384 AROS_UFHA(struct Hook *, h, A0),
385 AROS_UFHA(void *, dummy, A2), AROS_UFHA(void **, funcptr, A1))
387 AROS_USERFUNC_INIT
389 void (*func) (ULONG *) = (void (*)(ULONG *))(*funcptr);
391 if (func)
392 func((ULONG *) funcptr + 1);
394 AROS_USERFUNC_EXIT
397 int main(void)
399 Object *wnd, *second_wnd;
400 Object *open_button;
401 Object *about_button;
402 Object *quit_button;
403 Object *repeat_button;
404 Object *objects_button;
405 Object *about_item, *quit_item;
406 Object *context_menu;
407 Object *popobject, *listview;
408 Object *lists[LIST_COUNT];
409 Object *list_add_button, *list_remove_button, *list_clear_button;
410 Object *dragsortable_check, *showdropmarks_check, *quiet_check;
411 Object *sort_button, *clear_button, *fill_button, *enable_button;
412 Object *multi_lists[MULTI_LIST_COUNT];
413 Object *format_string;
414 Object *column_string;
415 Object *column_text;
416 Object *showheadings_check;
417 Object *numerics[NUMERIC_COUNT];
418 Object *min_string, *max_string;
419 Object *slider_button;
420 Object *country_radio[2];
421 UWORD i;
423 static char *pages[] =
424 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Gauges",
425 "Numeric", "Radio",
426 #if defined(TEST_ICONLIST)
427 "Icon List",
428 #endif
429 "Balancing", NULL};
430 static char *color_pages[] =
431 {"Palette", "Colors", "Pens", NULL};
432 static char *list_pages[] =
433 {"Single Column (1)", "Single Column (2)", "Multicolumn", NULL};
434 static char **radio_entries1 = pages;
435 static char *radio_entries2[] =
436 {"Paris", "Pataya", "London", "New York", "Reykjavik", NULL};
437 static char *fruits[] = {"Strawberry", "Apple", "Banana", "Orange",
438 "Grapefruit", "Kumquat", "Plum", "Raspberry", "Apricot", "Grape",
439 "Peach", "Lemon", "Lime", "Date", "Pineapple", "Blueberry", "Papaya",
440 "Cranberry", "Gooseberry", "Pear", "Fig", "Coconut", "Melon",
441 "Pumpkin", NULL};
443 static struct list_entry entry1 = {"Testentry1", "Col2: Entry1"};
444 static struct list_entry entry2 = {"Entry2", "Col2: Entry2"};
445 static struct list_entry entry3 = {"Entry3", "Col2: Entry3"};
446 static struct list_entry entry4 = {"Entry4", "Col2: Entry4"};
447 static struct list_entry entry5 = {"Entry5", "Col2: Entry5"};
448 static struct list_entry entry6 = {"Entry6", "Col2: Entry6"};
450 static struct list_entry *entries[] =
451 {&entry1, &entry2, &entry3, &entry4, &entry5, &entry6, NULL};
453 struct Hook hook;
454 struct Hook hook_wheel;
455 struct Hook hook_slider;
456 struct Hook hook_objects;
457 struct Hook hook_display;
458 struct Hook hook_display2;
460 hook_standard.h_Entry = (HOOKFUNC) hook_func_standard;
462 MUIMasterBase = (struct Library *)OpenLibrary("muimaster.library", 0);
464 hook.h_Entry = (HOOKFUNC) repeat_function;
465 hook_wheel.h_Entry = (HOOKFUNC) wheel_function;
466 hook_slider.h_Entry = (HOOKFUNC) slider_function;
467 hook_objects.h_Entry = (HOOKFUNC) objects_function;
468 hook_display.h_Entry = (HOOKFUNC) display_function;
469 hook_display2.h_Entry = (HOOKFUNC) display2_function;
471 context_menu = MenuitemObject,
472 MUIA_Family_Child, MenuitemObject,
473 MUIA_Menuitem_Title, "Menutest",
474 MUIA_Family_Child, about_item = MenuitemObject,
475 MUIA_Menuitem_Title, "First Test Entry", End,
476 MUIA_Family_Child, quit_item = MenuitemObject,
477 MUIA_Menuitem_Title, "Second Test Entry", End,
478 End,
479 End;
481 /* should check the result in a real program! */
482 CL_DropText = MUI_CreateCustomClass(NULL, MUIC_Text, NULL,
483 sizeof(struct DropText_Data), dispatcher);
484 ColorWheelBase = OpenLibrary("gadgets/colorwheel.gadget", 0);
486 pendisplay = PendisplayObject, MUIA_Pendisplay_Spec, &default_penspec, End;
488 app = ApplicationObject,
489 MUIA_Application_Menustrip, MenuitemObject,
490 MUIA_Family_Child, MenuitemObject,
491 MUIA_Menuitem_Title, "Project",
492 MUIA_Family_Child, about_item = MenuitemObject,
493 MUIA_Menuitem_Title, "About...",
494 MUIA_Menuitem_Shortcut, "?",
495 End,
496 MUIA_Family_Child, MenuitemObject,
497 MUIA_Menuitem_Title, (SIPTR)-1,
498 End,
499 MUIA_Family_Child, quit_item = MenuitemObject,
500 MUIA_Menuitem_Title, "Quit",
501 MUIA_Menuitem_Shortcut, "Q",
502 End,
503 End,
504 End,
506 SubWindow, wnd = WindowObject,
507 MUIA_Window_Title, "test",
508 MUIA_Window_Activate, TRUE,
510 WindowContents, VGroup,
511 Child, RegisterGroup(pages),
512 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
514 /* general */
515 Child, VGroup,
516 Child, HGroup,
517 GroupFrameT("A horizontal group"),
518 Child, ColGroup(2),
519 GroupFrameT("A column group"),
520 Child, repeat_button = TextObject,
521 MUIA_CycleChain, 1,
522 ButtonFrame,
523 MUIA_Background, MUII_ButtonBack,
524 MUIA_Text_PreParse, "\33c",
525 MUIA_Text_Contents, "Repeat",
526 MUIA_InputMode, MUIV_InputMode_RelVerify,
527 End,
528 Child, TextObject,
529 MUIA_CycleChain, 1,
530 ButtonFrame,
531 MUIA_Background, MUII_ButtonBack,
532 MUIA_Text_PreParse, "\33c",
533 MUIA_Text_Contents, "Drag Me",
534 MUIA_Draggable, TRUE,
535 MUIA_InputMode, MUIV_InputMode_RelVerify,
536 End,
537 Child, open_button = TextObject,
538 MUIA_CycleChain, 1,
539 ButtonFrame,
540 MUIA_Background, MUII_ButtonBack,
541 MUIA_Text_PreParse, "\33c",
542 MUIA_Text_Contents, "Open Window",
543 MUIA_InputMode, MUIV_InputMode_RelVerify,
544 End,
545 Child, TextObject,
546 MUIA_ContextMenu, context_menu,
547 MUIA_CycleChain, 1,
548 ButtonFrame,
549 MUIA_Background, MUII_ButtonBack,
550 MUIA_Text_PreParse, "\33c",
551 MUIA_Text_Contents, "Press Right",
552 MUIA_InputMode, MUIV_InputMode_RelVerify,
553 End,
554 Child, objects_button = TextObject,
555 MUIA_CycleChain, 1,
556 ButtonFrame,
557 MUIA_Background, MUII_ButtonBack,
558 MUIA_Text_PreParse, "\33c",
559 MUIA_Text_Contents, "Add Objects",
560 MUIA_InputMode, MUIV_InputMode_RelVerify,
561 End,
562 Child, HVSpace,
563 Child, HGroup,
564 Child, HVSpace,
565 Child, MUI_MakeObject(MUIO_Checkmark,
566 "_Checkmark"),
567 End,
568 Child, HGroup,
569 Child, MUI_MakeObject(MUIO_Label,
570 "_Checkmark", 0),
571 Child, HVSpace,
572 End,
573 Child, HVSpace,
574 Child, HVSpace,
575 End,
576 Child, group = VGroup,
577 GroupFrameT("A vertical group"),
578 Child, DropTextObject,
579 MUIA_Dropable, TRUE,
580 MUIA_CycleChain, 1,
581 ButtonFrame,
582 MUIA_Background, MUII_ButtonBack,
583 MUIA_Text_PreParse, "\33c",
584 MUIA_Text_Contents, "Drop Here",
585 MUIA_Dropable, TRUE,
586 MUIA_InputMode, MUIV_InputMode_RelVerify,
587 End,
588 Child, TextObject,
589 TextFrame,
590 MUIA_Background, MUII_MARKHALFSHINE,
591 MUIA_CycleChain, 1,
592 MUIA_Text_PreParse, "\33c",
593 MUIA_Text_Contents, "Pattern",
594 End,
595 Child, MUI_NewObject(MUIC_Popimage, TAG_DONE),
596 End,
597 Child, ScrollgroupObject,
598 GroupFrameT("A scroll group"),
599 MUIA_Scrollgroup_Contents, VGroupV,
600 VirtualFrame,
601 Child, TextObject,
602 TextFrame,
603 MUIA_Text_Contents,
604 "Line1\nLine2\nLine3\nLine4\n"
605 "Line5\nLine6\nLine7\nLine8\n"
606 "\n\n\n"
607 "Line9\nLine10\nLine11\n",
608 End,
609 Child, HGroup,
610 Child, MUI_MakeObject(MUIO_Button,
611 "Button9"),
612 Child, MUI_MakeObject(MUIO_Button,
613 "Button10"),
614 End,
615 End,
616 End,
617 End,
618 Child, popobject = PopobjectObject,
619 MUIA_Popstring_String,
620 MUI_MakeObject(MUIO_String, NULL, 200),
621 MUIA_Popstring_Button, PopButton(MUII_PopUp),
622 MUIA_Popobject_Object, VGroup,
623 Child, TextObject,
624 MUIA_Text_Contents, "test",
625 End,
626 Child, listview = ListviewObject,
627 MUIA_Listview_List, ListObject,
628 InputListFrame,
629 MUIA_List_DisplayHook, &hook_display,
630 MUIA_List_Format, ",,",
631 MUIA_List_SourceArray, entries,
632 MUIA_List_Title, TRUE,
633 End,
634 End,
635 End,
636 End,
637 Child, CycleObject,
638 ButtonFrame,
639 MUIA_Cycle_Entries, pages,
640 End,
641 Child, ScrollbarObject,
642 MUIA_Group_Horiz, TRUE,
643 MUIA_Prop_Visible, 100,
644 MUIA_Prop_Entries, 300,
645 MUIA_Prop_First, 50,
646 End,
647 End,
649 /* text */
650 Child, VGroup,
651 Child, TextObject,
652 MUIA_Background, "2:cfffffff,cfffffff,10000000",
653 TextFrame,
654 MUIA_Text_Contents, "\33cHello World!\n"
655 "This is a text object\n\33lLeft \33bbold\33n\n"
656 "\33rRight",
657 End,
658 Child, RectangleObject,
659 MUIA_VertWeight, 0,
660 /* Seems to be not supported properly as orginal MUI
661 doesn't allow to alter the height of the window */
662 MUIA_Rectangle_HBar, TRUE,
663 MUIA_Rectangle_BarTitle,"Enter a string",
664 End,
665 Child, StringObject,
666 StringFrame,
667 MUIA_CycleChain,1,
668 MUIA_String_AdvanceOnCR, TRUE,
669 End,
670 Child, HVSpace,
671 End,
673 /* boopsi */
674 Child, VGroup,
675 Child, wheel = BoopsiObject, /* MUI/Boopsi tags mixed */
676 GroupFrame,
677 /* boopsi objects don't know */
678 /* their sizes, so we help */
679 /* keep important values */
680 /* during window resize */
681 MUIA_Boopsi_ClassID, "colorwheel.gadget",
682 MUIA_Boopsi_MinWidth , 30,
683 MUIA_Boopsi_MinHeight, 30,
684 MUIA_Boopsi_Remember , WHEEL_Saturation,
685 MUIA_Boopsi_Remember , WHEEL_Hue,
686 /* this magic fills in the screen pointer */
687 MUIA_Boopsi_TagScreen, WHEEL_Screen,
688 WHEEL_Screen, NULL,
689 GA_Left, 0,
690 GA_Top, 0, /* MUI will automatically */
691 GA_Width, 0, /* fill in the correct values */
692 GA_Height, 0,
693 ICA_TARGET, ICTARGET_IDCMP,
694 /* needed for notification */
695 WHEEL_Saturation, 0, /* start in the center */
696 MUIA_FillArea, TRUE,
697 /* use this because it defaults to FALSE
698 for boopsi gadgets but the colorwheel
699 doesn't bother about redrawing its
700 background */
701 End,
703 Child, r_slider = SliderObject,
704 MUIA_Group_Horiz, TRUE,
705 MUIA_Numeric_Min, 0,
706 MUIA_Numeric_Max, 255,
707 End,
708 Child, g_slider = SliderObject,
709 MUIA_Group_Horiz, TRUE,
710 MUIA_Numeric_Min, 0,
711 MUIA_Numeric_Max, 255,
712 End,
713 Child, b_slider = SliderObject,
714 MUIA_Group_Horiz, TRUE,
715 MUIA_Numeric_Min, 0,
716 MUIA_Numeric_Max, 255,
717 End,
718 Child, hue_gauge = GaugeObject,
719 GaugeFrame,
720 MUIA_Gauge_Horiz, TRUE,
721 MUIA_Gauge_Max, 255,
722 MUIA_Gauge_Divide, 1<<24,
723 MUIA_Gauge_InfoText, "Hue: %ld",
724 End,
725 End,
727 /* color */
728 Child, RegisterGroup(color_pages),
729 Child, VGroup, GroupFrameT("Palette"),
730 Child, PaletteObject,
731 End,
732 End,
733 Child, HGroup,
734 Child, VGroup, GroupFrameT("Colorfield"),
736 Child, HGroup,
737 Child, colorfield = ColorfieldObject,
738 MUIA_Colorfield_RGB, default_color,
739 MUIA_Colorfield_Pen, 253,
740 End,
741 Child, colorfield2 = ColorfieldObject,
742 MUIA_Colorfield_Red, default_color[0],
743 MUIA_Colorfield_Green, default_color[1],
744 MUIA_Colorfield_Blue, default_color[2],
745 End,
746 End,
747 Child, colorfield_reset_button =
748 MUI_MakeObject(MUIO_Button,
749 "Reset"),
750 Child, HGroup,
751 Child,
752 MUI_MakeObject(MUIO_Label, "Pen:", 0),
753 Child, colorfield_pen = StringObject,
754 StringFrame,
755 End,
756 End,
757 End,
758 Child, VGroup, GroupFrameT("Coloradjust"),
759 Child, coloradjust = ColoradjustObject,
760 MUIA_Coloradjust_RGB, default_color,
761 End,
762 End,
763 End,
764 Child, HGroup,
765 Child, VGroup,
766 Child, VGroup, GroupFrameT("Pendisplay"),
767 Child, HGroup,
768 Child, pendisplay,
769 Child, pendisplay2 = PendisplayObject,
770 MUIA_Pendisplay_RGBcolor,
771 default_color,
772 End,
773 End,
774 Child, ColGroup(2),
775 Child,
776 MUI_MakeObject(
777 MUIO_Label, "Pen:", 0),
778 Child, HGroup,
779 Child, pendisplay_pen =
780 StringObject, StringFrame,
781 End,
782 Child, HVSpace,
783 Child, reference_check =
784 MUI_MakeObject(MUIO_Checkmark,
785 NULL),
786 Child, MUI_MakeObject(MUIO_Label,
787 "Reference", 0),
788 End,
789 Child,
790 MUI_MakeObject(
791 MUIO_Label, "Penspec:", 0),
792 Child, pendisplay_spec = StringObject,
793 StringFrame,
794 End,
795 End,
796 Child, HGroup,
797 Child, shine_button =
798 MUI_MakeObject(MUIO_Button,
799 "Shine"),
800 Child, shadow_button =
801 MUI_MakeObject(MUIO_Button,
802 "Shadow"),
803 Child, yellow_button =
804 MUI_MakeObject(MUIO_Button,
805 "Yellow"),
806 End,
807 End,
808 Child, VGroup, GroupFrameT("Poppen"),
809 Child, poppen = PoppenObject,
810 End,
811 End,
812 End,
813 Child, VGroup, GroupFrameT("Penadjust"),
814 Child, PenadjustObject,
815 End,
816 End,
817 End,
818 End,
820 /* edit */
821 Child, VGroup,
822 Child, editor_text = StringObject,
823 StringFrame,
824 End,
825 Child, PopaslObject,
826 ASLFR_DoSaveMode, TRUE,
827 MUIA_Popstring_String, filename_string =
828 MUI_MakeObject(MUIO_String, NULL, 200),
829 MUIA_Popstring_Button, PopButton(MUII_PopFile),
830 End,
831 Child, save_button =
832 MUI_MakeObject(MUIO_Button, "Save"),
833 End,
835 /* lists */
836 Child, RegisterGroup(list_pages),
837 Child, VGroup,
838 Child, ColGroup(LIST_COUNT),
839 Child, VGroup, GroupFrameT("No Multiselect"),
840 Child, lists[0] = ListviewObject,
841 MUIA_Listview_List,
842 ListObject,
843 InputListFrame,
844 MUIA_List_Title, "Fruits",
845 MUIA_List_SourceArray, fruits,
846 MUIA_ShortHelp, "Default scroller",
847 End,
848 MUIA_Listview_MultiSelect,
849 MUIV_Listview_MultiSelect_None,
850 MUIA_CycleChain, 1,
851 End,
852 End,
853 Child, VGroup,
854 GroupFrameT("Default Multiselect"),
855 Child, lists[1] = ListviewObject,
856 MUIA_Listview_List,
857 ListObject,
858 InputListFrame,
859 MUIA_List_SourceArray, fruits,
860 MUIA_ShortHelp, "Left scroller",
861 End,
862 MUIA_Listview_ScrollerPos,
863 MUIV_Listview_ScrollerPos_Left,
864 MUIA_CycleChain, 1,
865 End,
866 End,
867 Child, VGroup,
868 GroupFrameT("Shifted Multiselect"),
869 Child, lists[2] = ListviewObject,
870 MUIA_Listview_List,
871 ListObject,
872 InputListFrame,
873 MUIA_List_SourceArray, fruits,
874 MUIA_ShortHelp, "Right scroller",
875 End,
876 MUIA_Listview_MultiSelect,
877 MUIV_Listview_MultiSelect_Shifted,
878 MUIA_Listview_ScrollerPos,
879 MUIV_Listview_ScrollerPos_Right,
880 MUIA_CycleChain, 1,
881 End,
882 End,
883 Child, VGroup,
884 GroupFrameT("Unconditional Multiselect"),
885 Child, lists[3] = ListviewObject,
886 MUIA_Listview_List,
887 ListObject,
888 InputListFrame,
889 MUIA_List_SourceArray, fruits,
890 MUIA_ShortHelp, "No scroller",
891 End,
892 MUIA_Listview_MultiSelect,
893 MUIV_Listview_MultiSelect_Always,
894 MUIA_Listview_ScrollerPos,
895 MUIV_Listview_ScrollerPos_None,
896 MUIA_CycleChain, 1,
897 End,
898 End,
899 Child, VGroup,
900 GroupFrameT("Read Only"),
901 Child, lists[4] = ListviewObject,
902 MUIA_Listview_List,
903 ListObject,
904 ReadListFrame,
905 MUIA_List_SourceArray, fruits,
906 MUIA_ShortHelp, "Default scroller",
907 End,
908 MUIA_Listview_Input, FALSE,
909 MUIA_CycleChain, 1,
910 End,
911 End,
912 End,
913 Child, RectangleObject,
914 MUIA_VertWeight, 0,
915 MUIA_Rectangle_HBar, TRUE,
916 MUIA_Rectangle_BarTitle, "List Controls",
917 End,
918 Child, HGroup,
919 Child, sort_button =
920 MUI_MakeObject(MUIO_Button, "Sort"),
921 Child, clear_button =
922 MUI_MakeObject(MUIO_Button, "Clear"),
923 Child, fill_button =
924 MUI_MakeObject(MUIO_Button, "Fill"),
925 Child, enable_button =
926 MUI_MakeObject(MUIO_Button, "Enable"),
927 End,
928 Child, HGroup,
929 Child, HGroup,
930 Child, dragsortable_check =
931 MUI_MakeObject(MUIO_Checkmark, NULL),
932 Child, MUI_MakeObject(MUIO_Label,
933 "Drag sortable", 0),
934 Child, HVSpace,
935 End,
936 Child, HGroup,
937 Child, showdropmarks_check =
938 MUI_MakeObject(MUIO_Checkmark, NULL),
939 Child, MUI_MakeObject(MUIO_Label,
940 "Show drop marks", 0),
941 Child, HVSpace,
942 End,
943 Child, HGroup,
944 Child, quiet_check =
945 MUI_MakeObject(MUIO_Checkmark,NULL),
946 Child, MUI_MakeObject(MUIO_Label,
947 "Quiet", 0),
948 Child, HVSpace,
949 End,
950 End,
951 End,
952 Child, VGroup,
953 Child, ListviewObject,
954 MUIA_Listview_List, list2 = ListObject,
955 InputListFrame,
956 MUIA_List_DisplayHook, &hook_display2,
957 End,
958 End,
959 Child, HGroup,
960 Child, list_add_button =
961 MUI_MakeObject(MUIO_Button,"_Add"),
962 Child, list_remove_button =
963 MUI_MakeObject(MUIO_Button,"_Remove"),
964 Child, list_clear_button =
965 MUI_MakeObject(MUIO_Button,"_Clear"),
966 End,
967 End,
968 Child, VGroup,
969 Child, ColGroup(LIST_COUNT / 2),
970 Child, VGroup, GroupFrameT("Standard Format"),
971 Child, multi_lists[0] = ListviewObject,
972 MUIA_Listview_List,
973 ListObject,
974 InputListFrame,
975 MUIA_List_DisplayHook,
976 &hook_display,
977 MUIA_List_Format, list_format,
978 MUIA_List_SourceArray, entries,
979 MUIA_List_Title, TRUE,
980 End,
981 MUIA_Listview_MultiSelect,
982 MUIV_Listview_MultiSelect_None,
983 MUIA_CycleChain, 1,
984 End,
985 End,
986 Child, VGroup, GroupFrameT("Custom Format"),
987 Child, multi_lists[1] = ListviewObject,
988 MUIA_Listview_List,
989 ListObject,
990 InputListFrame,
991 MUIA_List_DisplayHook,
992 &hook_display,
993 MUIA_List_Format, list_format,
994 MUIA_List_SourceArray, entries,
995 MUIA_List_Title, TRUE,
996 End,
997 MUIA_Listview_MultiSelect,
998 MUIV_Listview_MultiSelect_None,
999 MUIA_CycleChain, 1,
1000 End,
1001 End,
1002 End,
1003 Child, RectangleObject,
1004 MUIA_VertWeight, 0,
1005 MUIA_Rectangle_HBar, TRUE,
1006 MUIA_Rectangle_BarTitle, "List Controls",
1007 End,
1008 Child, HGroup,
1009 Child, MUI_MakeObject(MUIO_Label, "Format:", 0),
1010 Child, format_string = StringObject,
1011 StringFrame,
1012 MUIA_String_Contents, list_format,
1013 MUIA_CycleChain, 1,
1014 End,
1015 Child, showheadings_check =
1016 MUI_MakeObject(MUIO_Checkmark, NULL),
1017 Child, MUI_MakeObject(MUIO_Label,
1018 "Show column headings", 0),
1019 End,
1020 Child, HGroup,
1021 Child, MUI_MakeObject(MUIO_Label,
1022 "Clicked column:", 0),
1023 Child, column_string = StringObject,
1024 MUIA_ShowMe, FALSE,
1025 End,
1026 Child, column_text = TextObject,
1027 TextFrame,
1028 MUIA_Text_Contents, "N/A",
1029 End,
1030 End,
1031 End,
1032 End,
1034 /* gauges */
1035 Child, HGroup,
1036 Child, VGroup,
1037 Child, VGroup,
1038 GroupFrame,
1039 Child, GaugeObject,
1040 GaugeFrame,
1041 MUIA_Gauge_InfoText, "%ld %%",
1042 MUIA_Gauge_Horiz, TRUE,
1043 MUIA_Gauge_Current, 25,
1044 End,
1045 Child, ScaleObject,
1046 End,
1047 End,
1048 Child, VGroup,
1049 GroupFrame,
1050 Child, GaugeObject,
1051 GaugeFrame,
1052 MUIA_Gauge_InfoText, "%ld %%",
1053 MUIA_Gauge_Horiz, TRUE,
1054 MUIA_Gauge_Current, 50,
1055 End,
1056 Child, ScaleObject,
1057 End,
1058 End,
1059 Child, VGroup,
1060 GroupFrame,
1061 Child, GaugeObject,
1062 GaugeFrame,
1063 MUIA_Gauge_InfoText, "%ld %%",
1064 MUIA_Gauge_Horiz, TRUE,
1065 MUIA_Gauge_Current, 75,
1066 End,
1067 Child, ScaleObject,
1068 End,
1069 End,
1070 End,
1071 Child, HGroup,
1072 Child, HVSpace,
1073 Child, GaugeObject,
1074 GaugeFrame,
1075 MUIA_Gauge_InfoText, "%ld %%",
1076 MUIA_Gauge_Current, 25,
1077 End,
1078 Child, GaugeObject,
1079 GaugeFrame,
1080 MUIA_Gauge_InfoText, "%ld %%",
1081 MUIA_Gauge_Current, 50,
1082 End,
1083 Child, GaugeObject,
1084 GaugeFrame,
1085 MUIA_Gauge_InfoText, "%ld %%",
1086 MUIA_Gauge_Current, 75,
1087 End,
1088 Child, HVSpace,
1089 End,
1090 End,
1092 /* numeric */
1093 Child, HGroup,
1094 Child, ColGroup(2),
1095 GroupFrameT("Horizontal Sliders"),
1096 Child, MUI_MakeObject(MUIO_Label, "Normal:", 0),
1097 Child, numerics[HNSLIDER] = SliderObject,
1098 MUIA_Slider_Horiz, TRUE,
1099 MUIA_Numeric_Min, NUMERIC_MIN,
1100 MUIA_Numeric_Max, NUMERIC_MAX,
1101 MUIA_CycleChain, 1,
1102 End,
1103 Child, MUI_MakeObject(MUIO_Label, "Reverse:", 0),
1104 Child, numerics[HRSLIDER] = SliderObject,
1105 MUIA_Numeric_Reverse, TRUE,
1106 MUIA_Numeric_Min, NUMERIC_MIN,
1107 MUIA_Numeric_Max, NUMERIC_MAX,
1108 MUIA_CycleChain, 1,
1109 End,
1110 Child, MUI_MakeObject(MUIO_Label, "Quiet:", 0),
1111 Child, numerics[HQSLIDER] = SliderObject,
1112 MUIA_Slider_Quiet, TRUE,
1113 MUIA_Numeric_Min, NUMERIC_MIN,
1114 MUIA_Numeric_Max, NUMERIC_MAX,
1115 MUIA_CycleChain, 1,
1116 End,
1117 End,
1118 Child, ColGroup(3),
1119 GroupFrameT("Vertical Sliders"),
1120 Child, MUI_MakeObject(MUIO_Label, "Normal", 0),
1121 Child, MUI_MakeObject(MUIO_Label, "Reverse", 0),
1122 Child, MUI_MakeObject(MUIO_Label, "Quiet", 0),
1123 Child, numerics[VNSLIDER] = SliderObject,
1124 MUIA_Slider_Horiz, FALSE,
1125 MUIA_Numeric_Min, NUMERIC_MIN,
1126 MUIA_Numeric_Max, NUMERIC_MAX,
1127 MUIA_CycleChain, 1,
1128 End,
1129 Child, numerics[VRSLIDER] = SliderObject,
1130 MUIA_Slider_Horiz, FALSE,
1131 MUIA_Numeric_Reverse, TRUE,
1132 MUIA_Numeric_Min, NUMERIC_MIN,
1133 MUIA_Numeric_Max, NUMERIC_MAX,
1134 MUIA_CycleChain, 1,
1135 End,
1136 Child, numerics[VQSLIDER] = SliderObject,
1137 MUIA_Slider_Horiz, FALSE,
1138 MUIA_Slider_Quiet, TRUE,
1139 MUIA_Numeric_Min, NUMERIC_MIN,
1140 MUIA_Numeric_Max, NUMERIC_MAX,
1141 MUIA_CycleChain, 1,
1142 End,
1143 End,
1144 Child, ColGroup(2),
1145 GroupFrameT("Numeric Buttons"),
1146 Child, MUI_MakeObject(MUIO_Label, "Normal:", 0),
1147 Child, numerics[NNUMERICBUTTON] =
1148 NumericbuttonObject,
1149 MUIA_Numeric_Min, NUMERIC_MIN,
1150 MUIA_Numeric_Max, NUMERIC_MAX,
1151 MUIA_CycleChain, 1,
1152 End,
1153 Child, MUI_MakeObject(MUIO_Label, "Reverse:", 0),
1154 Child, numerics[RNUMERICBUTTON] =
1155 NumericbuttonObject,
1156 MUIA_Numeric_Reverse, TRUE,
1157 MUIA_Numeric_Min, NUMERIC_MIN,
1158 MUIA_Numeric_Max, NUMERIC_MAX,
1159 MUIA_CycleChain, 1,
1160 End,
1161 End,
1162 Child, ColGroup(2),
1163 GroupFrameT("Knobs"),
1164 Child, MUI_MakeObject(MUIO_Label, "Normal", 0),
1165 Child, MUI_MakeObject(MUIO_Label, "Reverse", 0),
1166 Child, numerics[NKNOB] = KnobObject,
1167 MUIA_Numeric_Min, NUMERIC_MIN,
1168 MUIA_Numeric_Max, NUMERIC_MAX,
1169 MUIA_CycleChain, 1,
1170 End,
1171 Child, numerics[RKNOB] = KnobObject,
1172 MUIA_Numeric_Reverse, TRUE,
1173 MUIA_Numeric_Min, NUMERIC_MIN,
1174 MUIA_Numeric_Max, NUMERIC_MAX,
1175 MUIA_CycleChain, 1,
1176 End,
1177 End,
1178 Child, ColGroup(2),
1179 Child, MUI_MakeObject(MUIO_Label,
1180 "Minimum Value:", 0),
1181 Child, min_string = (Object *)StringObject,
1182 StringFrame,
1183 MUIA_String_Accept, (IPTR)"-0123456789",
1184 MUIA_String_Integer, NUMERIC_MIN,
1185 MUIA_CycleChain, 1,
1186 End,
1187 Child, MUI_MakeObject(MUIO_Label,
1188 "Maximum Value:", 0),
1189 Child, max_string = (Object *)StringObject,
1190 StringFrame,
1191 MUIA_String_Accept, (IPTR)"-0123456789",
1192 MUIA_String_Integer, NUMERIC_MAX,
1193 MUIA_CycleChain, 1,
1194 End,
1195 Child, slider_button = TextObject,
1196 ButtonFrame,
1197 MUIA_InputMode, MUIV_InputMode_RelVerify,
1198 MUIA_CycleChain, 1,
1199 MUIA_Background, MUII_ButtonBack,
1200 MUIA_Text_PreParse, "\33c",
1201 MUIA_Text_Contents,
1202 "Change Slider Orientations",
1203 End,
1204 Child, MUI_MakeObject(MUIO_Label, "", 0),
1205 End,
1206 End,
1208 /* radios */
1209 Child, HGroup,
1210 Child, VGroup,
1211 Child, RadioObject,
1212 GroupFrame,
1213 MUIA_Radio_Entries, radio_entries1,
1214 End,
1215 Child, country_radio[0] = RadioObject,
1216 GroupFrame,
1217 MUIA_Radio_Entries, radio_entries2,
1218 MUIA_Radio_Active, 1,
1219 End,
1220 End,
1221 Child, HGroup,
1222 Child, RadioObject,
1223 GroupFrame,
1224 MUIA_Radio_Entries, radio_entries1,
1225 End,
1226 Child, country_radio[1] = RadioObject,
1227 GroupFrame,
1228 MUIA_Radio_Entries, radio_entries2,
1229 MUIA_Radio_Active, 1,
1230 End,
1231 End,
1232 End,
1234 #if defined(TEST_ICONLIST)
1235 /* iconlist */
1236 Child, HGroup,
1237 Child, volume_iconlist =
1238 MUI_NewObject(MUIC_IconVolumeList, GroupFrame,
1239 TAG_DONE),
1240 Child, drawer_iconlist =
1241 MUI_NewObject(MUIC_IconDrawerList, GroupFrame,
1242 MUIA_IconDrawerList_Drawer, "SYS:",
1243 TAG_DONE),
1244 End,
1245 #endif
1247 /* balancing */
1248 Child, HGroup,
1249 Child, create_balance_column(),
1250 Child, BalanceObject,
1251 End,
1253 Child, create_balance_column(),
1254 Child, BalanceObject,
1255 End,
1257 Child, create_balance_column(),
1258 Child, BalanceObject,
1259 End,
1261 Child, create_balance_column(),
1262 Child, BalanceObject,
1263 End,
1265 Child, create_balance_column(),
1267 End,
1269 End,
1271 Child, HGroup,
1272 Child, about_button = TextObject,
1273 ButtonFrame,
1274 MUIA_InputMode, MUIV_InputMode_RelVerify,
1275 MUIA_CycleChain, 1,
1276 MUIA_Background, MUII_ButtonBack,
1277 MUIA_Text_PreParse, "\33c",
1278 MUIA_Text_Contents, "About",
1279 End,
1280 Child, quit_button = TextObject,
1281 ButtonFrame,
1282 MUIA_InputMode, MUIV_InputMode_RelVerify,
1283 MUIA_CycleChain, 1,
1284 MUIA_Background, MUII_ButtonBack,
1285 MUIA_ControlChar, 'q',
1286 MUIA_Text_HiChar, 'q',
1287 MUIA_Text_PreParse, "\33c",
1288 MUIA_Text_Contents, "Quit",
1289 End,
1290 End,
1291 End,
1292 End,
1294 SubWindow, second_wnd = WindowObject,
1295 MUIA_Window_Title, "Second window",
1296 WindowContents, VGroup,
1297 Child, DropTextObject,
1298 MUIA_Text_Contents, "Drop here",
1299 MUIA_Dropable, TRUE,
1300 End,
1301 End,
1302 End,
1304 End;
1306 if (app)
1308 ULONG sigs = 0;
1310 DoMethod(wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2,
1311 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
1312 DoMethod(second_wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
1313 second_wnd, 3, MUIM_Set, MUIA_Window_Open, FALSE);
1314 DoMethod(open_button, MUIM_Notify, MUIA_Pressed, FALSE, second_wnd,
1315 3, MUIM_Set, MUIA_Window_Open, TRUE);
1316 DoMethod(about_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
1317 MUIM_Application_AboutMUI, NULL);
1318 DoMethod(quit_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
1319 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
1320 DoMethod(objects_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 2,
1321 MUIM_CallHook, &hook_objects);
1322 DoMethod(repeat_button, MUIM_Notify, MUIA_Timer, MUIV_EveryTime,
1323 app, 2, MUIM_CallHook, &hook);
1325 DoMethod(wheel, MUIM_Notify, WHEEL_Hue, MUIV_EveryTime, app, 2,
1326 MUIM_CallHook, &hook_wheel);
1327 DoMethod(wheel, MUIM_Notify, WHEEL_Saturation, MUIV_EveryTime, app,
1328 2, MUIM_CallHook, &hook_wheel);
1329 DoMethod(r_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
1330 app, 2, MUIM_CallHook, &hook_slider);
1331 DoMethod(g_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
1332 app, 2, MUIM_CallHook, &hook_slider);
1333 DoMethod(b_slider, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime,
1334 app, 2, MUIM_CallHook, &hook_slider);
1336 DoMethod(save_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 3,
1337 MUIM_CallHook, &hook_standard, save_function);
1339 DoMethod(quit_item, MUIM_Notify, MUIA_Menuitem_Trigger,
1340 MUIV_EveryTime, app, 2, MUIM_Application_ReturnID,
1341 MUIV_Application_ReturnID_Quit);
1342 DoMethod(about_item, MUIM_Notify, MUIA_Menuitem_Trigger,
1343 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
1344 about_function);
1346 /* Notifications for color objects */
1347 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Red,
1348 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Red,
1349 MUIV_TriggerValue);
1350 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Green,
1351 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Green,
1352 MUIV_TriggerValue);
1353 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Blue,
1354 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Blue,
1355 MUIV_TriggerValue);
1356 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Red,
1357 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Red,
1358 MUIV_TriggerValue);
1359 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Green,
1360 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Green,
1361 MUIV_TriggerValue);
1362 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Blue,
1363 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Blue,
1364 MUIV_TriggerValue);
1365 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Pen,
1366 MUIV_EveryTime, colorfield_pen, 3, MUIM_Set,
1367 MUIA_String_Integer, MUIV_TriggerValue);
1368 DoMethod(colorfield_pen, MUIM_Notify, MUIA_String_Acknowledge,
1369 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
1370 changepen_function);
1371 DoMethod(colorfield_reset_button, MUIM_Notify, MUIA_Pressed, FALSE,
1372 colorfield, 3, MUIM_Set, MUIA_Colorfield_RGB, default_color);
1374 /* Notifications for pen objects */
1375 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_Pen,
1376 MUIV_EveryTime, pendisplay_pen, 3, MUIM_NoNotifySet,
1377 MUIA_String_Integer, MUIV_TriggerValue);
1378 DoMethod(pendisplay_pen, MUIM_Notify, MUIA_String_Acknowledge,
1379 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
1380 ChangePendisplayPen);
1381 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_Spec,
1382 MUIV_EveryTime, pendisplay_spec, 3, MUIM_Set,
1383 MUIA_String_Contents, MUIV_TriggerValue);
1384 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_RGB,
1385 MUIV_EveryTime, pendisplay, 3, MUIM_Set,
1386 MUIA_Pendisplay_RGBcolor, MUIV_TriggerValue);
1387 DoMethod(pendisplay, MUIM_Notify, MUIA_Pendisplay_RGBcolor,
1388 MUIV_EveryTime, poppen, 3, MUIM_Set, MUIA_Pendisplay_RGBcolor,
1389 MUIV_TriggerValue);
1390 DoMethod(pendisplay_spec, MUIM_Notify, MUIA_String_Contents,
1391 MUIV_EveryTime, pendisplay, 3, MUIM_Set, MUIA_Pendisplay_Spec,
1392 MUIV_TriggerValue);
1393 DoMethod(reference_check, MUIM_Notify, MUIA_Selected, TRUE,
1394 pendisplay2, 3, MUIM_Set, MUIA_Pendisplay_Reference, pendisplay);
1395 DoMethod(reference_check, MUIM_Notify, MUIA_Selected, FALSE,
1396 pendisplay2, 3, MUIM_Set, MUIA_Pendisplay_Reference, NULL);
1397 DoMethod(shine_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
1398 2, MUIM_Pendisplay_SetMUIPen, MPEN_SHINE);
1399 DoMethod(shadow_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
1400 2, MUIM_Pendisplay_SetMUIPen, MPEN_SHADOW);
1401 DoMethod(yellow_button, MUIM_Notify, MUIA_Pressed, FALSE, pendisplay,
1402 4, MUIM_Pendisplay_SetRGB, 0xffffffff, 0xffffffff, 0);
1404 /* list */
1405 set(showdropmarks_check, MUIA_Selected, TRUE);
1406 for (i = 0; i < LIST_COUNT; i++)
1408 DoMethod(lists[i], MUIM_Notify, MUIA_Listview_DoubleClick,
1409 MUIV_EveryTime, lists[i], 3, MUIM_Set, MUIA_Disabled, TRUE);
1410 DoMethod(sort_button, MUIM_Notify, MUIA_Pressed, FALSE,
1411 lists[i], 1, MUIM_List_Sort);
1412 DoMethod(clear_button, MUIM_Notify, MUIA_Pressed, FALSE,
1413 lists[i], 1, MUIM_List_Clear);
1414 DoMethod(fill_button, MUIM_Notify, MUIA_Pressed, FALSE,
1415 lists[i], 4, MUIM_List_Insert, fruits, -1,
1416 MUIV_List_Insert_Bottom);
1417 DoMethod(enable_button, MUIM_Notify, MUIA_Pressed, FALSE,
1418 lists[i], 3, MUIM_Set, MUIA_Disabled, FALSE);
1419 DoMethod(dragsortable_check, MUIM_Notify, MUIA_Selected,
1420 MUIV_EveryTime, lists[i], 3, MUIM_Set,
1421 MUIA_List_DragSortable, MUIV_TriggerValue);
1422 DoMethod(showdropmarks_check, MUIM_Notify, MUIA_Selected,
1423 MUIV_EveryTime, lists[i], 3, MUIM_Set,
1424 MUIA_List_ShowDropMarks, MUIV_TriggerValue);
1425 DoMethod(quiet_check, MUIM_Notify, MUIA_Selected,
1426 MUIV_EveryTime, lists[i], 3, MUIM_Set, MUIA_List_Quiet,
1427 MUIV_TriggerValue);
1430 set(showheadings_check, MUIA_Selected, TRUE);
1431 DoMethod(format_string, MUIM_Notify, MUIA_String_Acknowledge,
1432 MUIV_EveryTime, multi_lists[1], 3, MUIM_Set, MUIA_List_Format,
1433 MUIV_TriggerValue);
1434 for (i = 0; i < MULTI_LIST_COUNT; i++)
1436 DoMethod(showheadings_check, MUIM_Notify, MUIA_Selected,
1437 MUIV_EveryTime, multi_lists[i], 3, MUIM_Set,
1438 MUIA_List_Title, MUIV_TriggerValue);
1439 DoMethod(multi_lists[i], MUIM_Notify, MUIA_Listview_ClickColumn,
1440 MUIV_EveryTime, column_string, 3, MUIM_Set,
1441 MUIA_String_Integer, MUIV_TriggerValue);
1443 DoMethod(column_string, MUIM_Notify, MUIA_String_Contents,
1444 MUIV_EveryTime, column_text, 3, MUIM_Set, MUIA_Text_Contents,
1445 MUIV_TriggerValue);
1447 DoMethod(listview, MUIM_Notify, MUIA_Listview_DoubleClick, TRUE,
1448 popobject, 2, MUIM_Popstring_Close, TRUE);
1450 /* The callbacks of the buttons within the list page */
1451 DoMethod(list_add_button, MUIM_Notify, MUIA_Pressed, FALSE, app, 3,
1452 MUIM_CallHook, &hook_standard, add_function);
1453 DoMethod(list_remove_button, MUIM_Notify, MUIA_Pressed, FALSE,
1454 list2, 2, MUIM_List_Remove, MUIV_List_Remove_Active);
1455 DoMethod(list_clear_button, MUIM_Notify, MUIA_Pressed, FALSE, list2,
1456 1, MUIM_List_Clear);
1458 /* numeric */
1459 for (i = 0; i < NUMERIC_COUNT; i++)
1461 DoMethod(min_string, MUIM_Notify, MUIA_String_Integer,
1462 MUIV_EveryTime, numerics[i], 3, MUIM_Set, MUIA_Numeric_Min,
1463 MUIV_TriggerValue);
1464 DoMethod(max_string, MUIM_Notify, MUIA_String_Integer,
1465 MUIV_EveryTime, numerics[i], 3, MUIM_Set, MUIA_Numeric_Max,
1466 MUIV_TriggerValue);
1468 DoMethod(slider_button, MUIM_Notify, MUIA_Pressed, FALSE,
1469 numerics[HRSLIDER], 3, MUIM_Set, MUIA_Slider_Horiz, FALSE);
1471 /* radio */
1472 DoMethod(country_radio[0], MUIM_Notify, MUIA_Radio_Active,
1473 MUIV_EveryTime, country_radio[1], 3, MUIM_NoNotifySet,
1474 MUIA_Radio_Active, MUIV_TriggerValue);
1475 DoMethod(country_radio[1], MUIM_Notify, MUIA_Radio_Active,
1476 MUIV_EveryTime, country_radio[0], 3, MUIM_NoNotifySet,
1477 MUIA_Radio_Active, MUIV_TriggerValue);
1479 #if defined(TEST_ICONLIST)
1480 /* iconlist */
1481 DoMethod(volume_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick,
1482 TRUE, volume_iconlist, 3, MUIM_CallHook, &hook_standard,
1483 volume_doubleclicked);
1484 DoMethod(drawer_iconlist, MUIM_Notify, MUIA_IconList_DoubleClick,
1485 TRUE, drawer_iconlist, 3, MUIM_CallHook, &hook_standard,
1486 drawer_doubleclicked);
1487 #endif
1489 set(wnd, MUIA_Window_Open, TRUE);
1490 set(wnd, MUIA_Window_ScreenTitle, "Zune Test application");
1492 /* Set pen fields */
1493 set(colorfield_pen, MUIA_String_Integer,
1494 XGET(colorfield, MUIA_Colorfield_Pen));
1496 char pen_str[10];
1497 nnset(pendisplay_pen, MUIA_String_Integer,
1498 XGET(pendisplay, MUIA_Pendisplay_Pen));
1500 struct MUI_PenSpec *pen_spec;
1501 GET(pendisplay, MUIA_Pendisplay_Spec, &pen_spec);
1502 strncpy(pen_str, pen_spec->buf, 10);
1503 set(pendisplay_spec, MUIA_String_Contents, pen_str);
1505 while ((LONG) DoMethod(app, MUIM_Application_NewInput,
1506 &sigs) != MUIV_Application_ReturnID_Quit)
1508 if (sigs)
1510 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
1511 if (sigs & SIGBREAKF_CTRL_C)
1512 break;
1513 if (sigs & SIGBREAKF_CTRL_D)
1514 break;
1518 MUI_DisposeObject(app);
1520 if (context_menu)
1521 MUI_DisposeObject(context_menu);
1522 CloseLibrary(ColorWheelBase);
1523 MUI_DeleteCustomClass(CL_DropText);
1525 CloseLibrary(MUIMasterBase);
1526 return 0;