2 Copyright © 2002-2019, The AROS Development Team.
8 #define INTUITION_NO_INLINE_STDARG
10 #include <exec/types.h>
15 #include <clib/alib_protos.h>
16 #include <intuition/gadgetclass.h>
17 #include <intuition/icclass.h>
18 #include <libraries/asl.h>
19 #include <gadgets/colorwheel.h>
20 #include <proto/exec.h>
21 #include <proto/intuition.h>
22 #include <proto/dos.h>
23 #include <proto/muimaster.h>
24 #include <proto/graphics.h>
25 #include <proto/utility.h>
26 #include <aros/debug.h>
28 /* the following should go in a single include file which then only
29 ** consists of the public constants and members. Actually this is easy
36 #include <libraries/mui.h>
37 #if defined(TEST_ICONLIST)
38 #include "../../workbench/system/Wanderer/Classes/iconlist_attributes.h"
39 #include "../../workbench/system/Wanderer/Classes/iconlist.h"
42 #define TEXT_RAW_IMAGE_SIZE 16
43 #define STRING_COUNT 6
45 #define MULTI_LIST_COUNT 2
48 #define NUMERIC_MAX 100
50 #define NUMERIC_INIT 30
52 static const char *pages
[] =
53 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Numeric", "Select",
54 #if defined(TEST_ICONLIST)
58 static const char *general_pages
[] =
59 {"Group", "Window", NULL
};
60 static const char *text_pages
[] =
61 {"Text", "String", NULL
};
62 static const char *color_pages
[] =
63 {"Palette", "Colors", "Pens", NULL
};
64 static const char *list_pages
[] =
65 {"Single Column", "Multicolumn", NULL
};
66 static const IPTR entries
[] = {1, 2, 3, 4, 5, 6, (IPTR
)NULL
};
67 static const CONST_STRPTR window_left_modes
[] =
68 {"No change", "Pixels", "Centered", "Under pointer", NULL
};
69 static const CONST_STRPTR window_top_modes
[] =
70 {"No change", "Pixels", "Centered", "Under pointer",
71 "Pixels below screen bar", NULL
};
72 static const CONST_STRPTR window_dim_modes
[] =
73 {"Default", "Pixels", "Growth percentage", "Total screen percentage",
74 "Visible screen percentage", "Scaled", NULL
};
75 static const CONST_STRPTR window_menu_modes
[] =
76 {"Parent", "Custom", "None", NULL
};
77 static const TEXT digits
[] = "-0123456789";
78 static const TEXT vowels
[] = "aeiou";
79 static const TEXT default_accept_chars
[] = "aeiou?.";
80 static const TEXT default_reject_chars
[] = "*?";
81 static const ULONG default_color
[] = {155 << 24, 180 << 24, 255 << 24};
82 static const struct MUI_PenSpec default_penspec
= {"m0"};
83 static const char *fruits
[] = {"Strawberry", "Apple", "Banana", "Orange",
84 "Grapefruit", "Kumquat", "Plum", "Raspberry", "Apricot", "Grape",
85 "Peach", "Lemon", "Lime", "Date", "Pineapple", "Blueberry", "Papaya",
86 "Cranberry", "Gooseberry", "Pear", "Fig", "Coconut", "Melon",
88 static char *cities
[] =
89 {"Paris", "Pataya", "London", "New York", "Reykjavik", "Tokyo", NULL
};
90 static const char *empty
[] = {"", "", "", "", "", NULL
};
91 static const LONG list_active_positions
[] =
94 MUIV_List_Active_Bottom
,
99 static const CONST_STRPTR list_move1_modes
[] =
100 {"Index", "Top", "Active", "Bottom", NULL
};
101 static const CONST_STRPTR list_move2_modes
[] =
102 {"Index", "Top", "Active", "Bottom", "Next", "Previous", NULL
};
103 static const CONST_STRPTR list_jump_modes
[] =
104 {"Index", "Top", "Active", "Bottom", "Down", "Up", NULL
};
105 static const CONST_STRPTR list_insert_modes
[] =
106 {"Index", "Top", "Active", "Sorted", "Bottom", NULL
};
107 static const CONST_STRPTR list_remove_modes
[] =
108 {"Index", "First", "Active", "Last", "Selected", "Unsafe Loop",
110 static const CONST_STRPTR list_activate_modes
[] =
111 {"Index", "Top", "Bottom", "Up", "Down", "Page Up", "Page Down", NULL
};
112 static const CONST_STRPTR list_select_modes
[] =
113 {"Index", "Active", "All", NULL
};
114 static const TEXT list_format
[] = "BAR,BAR,";
116 static Object
*CreateGeneralGroup();
117 static Object
*CreateTextGroup();
118 static Object
*CreateBoopsiGroup();
119 static Object
*CreateColorGroup();
120 static Object
*CreateEditGroup();
121 static Object
*CreateListGroup();
122 static Object
*CreateNumericGroup();
123 static Object
*CreateSelectGroup();
124 static Object
*CreateBalancingGroup();
152 struct Library
*MUIMasterBase
;
153 struct Library
*ColorWheelBase
;
182 *height_index_string
,
184 *alt_left_index_string
,
186 *alt_width_index_string
,
188 *alt_top_index_string
,
190 *alt_height_index_string
,
225 Object
*strings
[STRING_COUNT
],
235 *standard_hook_check
,
243 Object
*lists
[LIST_COUNT
],
266 *insert_single_button
,
267 *insert_multiple_button
,
272 *showdropmarks_check
,
284 *multi_lists
[MULTI_LIST_COUNT
],
292 LONG quiet
[LIST_COUNT
],
294 has_multitest
[LIST_COUNT
];
301 Object
*numerics
[NUMERIC_COUNT
],
302 *gauges
[GAUGE_COUNT
],
318 static Object
*repeat_button
;
319 static Object
*objects_button
;
320 static Object
*context_menu
;
321 static Object
*popobject
, *listview
;
322 static Object
*wheel
;
323 static Object
*r_slider
;
324 static Object
*g_slider
;
325 static Object
*b_slider
;
326 static Object
*hue_gauge
;
327 static Object
*colorfield
, *colorfield2
, *colorfield_reset_button
,
329 static Object
*coloradjust
;
330 static Object
*pendisplay
, *pendisplay2
, *pendisplay_pen
, *pendisplay_spec
,
331 *reference_check
, *shine_button
, *shadow_button
, *yellow_button
, *poppen
;
332 static Object
*group
;
333 static Object
*editor_text
;
334 static Object
*filename_string
;
335 static Object
*save_button
;
336 static struct Hook hook_standard
;
337 static struct Hook hook
;
338 static struct Hook hook_wheel
;
339 static struct Hook hook_slider
;
340 static struct Hook hook_objects
;
341 static struct Hook hook_compare
, hook_multitest
;
342 static struct Hook hook_construct
, hook_destruct
, hook_display
;
343 static struct Hook hook_objstr
;
344 static Object
*city_radios
[3];
346 #if defined(TEST_ICONLIST)
347 static Object
*drawer_iconlist
;
348 static Object
*volume_iconlist
;
351 AROS_UFH0(void, repeat_function
)
355 printf("MUI_Timer\n");
360 AROS_UFH0(void, wheel_function
)
364 nnset(r_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
365 WHEEL_Red
) >> 24) & 0xff);
366 nnset(g_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
367 WHEEL_Green
) >> 24) & 0xff);
368 nnset(b_slider
, MUIA_Numeric_Value
, (XGET(wheel
,
369 WHEEL_Blue
) >> 24) & 0xff);
374 AROS_UFH0(void, slider_function
)
378 struct ColorWheelRGB cw
;
379 ULONG red
= XGET(r_slider
, MUIA_Numeric_Value
);
380 ULONG green
= XGET(g_slider
, MUIA_Numeric_Value
);
381 ULONG blue
= XGET(b_slider
, MUIA_Numeric_Value
);
383 cw
.cw_Red
= (red
<< 24) | (red
<< 16) | (red
<< 8) | red
;
384 cw
.cw_Green
= (green
<< 24) | (green
<< 16) | (green
<< 8) | green
;
385 cw
.cw_Blue
= (blue
<< 24) | (blue
<< 16) | (blue
<< 8) | blue
;
387 nnset(wheel
, WHEEL_RGB
, &cw
);
388 set(hue_gauge
, MUIA_Gauge_Current
, XGET(wheel
, WHEEL_Hue
));
393 AROS_UFH0(void, objects_function
)
397 Object
*new_obj
= MUI_MakeObject(MUIO_Button
, "Button");
400 DoMethod(group
, MUIM_Group_InitChange
);
401 DoMethod(group
, OM_ADDMEMBER
, new_obj
);
402 DoMethod(group
, MUIM_Group_ExitChange
);
408 static void About(void)
410 static Object
*about_wnd
;
414 about_wnd
= AboutmuiObject
, MUIA_Aboutmui_Application
, app
, End
;
418 set(about_wnd
, MUIA_Window_Open
, TRUE
);
421 /* Get the test window position and dimension values input by the user */
422 static void GetWindowDimensions(LONG
*left
, LONG
*top
, LONG
*width
,
423 LONG
*height
, LONG
*alt_left
, LONG
*alt_top
, LONG
*alt_width
,
429 mode
= XGET(window
.left_cycle
, MUIA_Cycle_Active
);
431 *left
= XGET(window
.left_index_string
, MUIA_String_Integer
);
436 mode
= XGET(window
.top_cycle
, MUIA_Cycle_Active
);
438 *top
= XGET(window
.top_index_string
, MUIA_String_Integer
);
440 *top
= MUIV_Window_TopEdge_Delta(
441 XGET(window
.top_index_string
, MUIA_String_Integer
));
446 mode
= XGET(window
.width_cycle
, MUIA_Cycle_Active
);
447 *width
= XGET(window
.width_index_string
, MUIA_String_Integer
);
448 if (mode
!= 1 && *width
> 100)
453 *width
= MUIV_Window_Width_Default
;
456 *width
= MUIV_Window_Width_MinMax(*width
);
459 *width
= MUIV_Window_Width_Screen(*width
);
462 *width
= MUIV_Window_Width_Visible(*width
);
465 *width
= MUIV_Window_Width_Scaled
;
470 mode
= XGET(window
.height_cycle
, MUIA_Cycle_Active
);
471 *height
= XGET(window
.height_index_string
, MUIA_String_Integer
);
472 if (mode
!= 1 && *height
> 100)
477 *height
= MUIV_Window_Height_Default
;
480 *height
= MUIV_Window_Height_MinMax(*height
);
483 *height
= MUIV_Window_Height_Screen(*height
);
486 *height
= MUIV_Window_Height_Visible(*height
);
489 *height
= MUIV_Window_Height_Scaled
;
492 /* Get alternative left edge */
493 mode
= XGET(window
.alt_left_cycle
, MUIA_Cycle_Active
);
495 *alt_left
= MUIV_Window_AltLeftEdge_NoChange
;
497 *alt_left
= XGET(window
.alt_left_index_string
, MUIA_String_Integer
);
499 *alt_left
= 1 - mode
;
501 /* Get alternative top edge */
502 mode
= XGET(window
.alt_top_cycle
, MUIA_Cycle_Active
);
504 *alt_top
= MUIV_Window_AltTopEdge_NoChange
;
506 *alt_top
= XGET(window
.alt_top_index_string
, MUIA_String_Integer
);
508 *alt_top
= MUIV_Window_AltTopEdge_Delta(
509 XGET(window
.alt_top_index_string
, MUIA_String_Integer
));
513 /* Get alternative width */
514 mode
= XGET(window
.alt_width_cycle
, MUIA_Cycle_Active
);
515 *alt_width
= XGET(window
.alt_width_index_string
, MUIA_String_Integer
);
516 if (mode
!= 0 && *alt_width
> 100)
521 *alt_width
= MUIV_Window_AltWidth_MinMax(*alt_width
);
524 *alt_width
= MUIV_Window_AltWidth_Screen(*alt_width
);
527 *alt_width
= MUIV_Window_AltWidth_Visible(*alt_width
);
530 *alt_width
= MUIV_Window_AltWidth_Scaled
;
533 /* Get alternative height */
534 mode
= XGET(window
.alt_height_cycle
, MUIA_Cycle_Active
);
535 *alt_height
= XGET(window
.alt_height_index_string
, MUIA_String_Integer
);
536 if (mode
!= 0 && *alt_height
> 100)
541 *alt_height
= MUIV_Window_AltHeight_MinMax(*alt_height
);
544 *alt_height
= MUIV_Window_AltHeight_Screen(*alt_height
);
547 *alt_height
= MUIV_Window_AltHeight_Visible(*alt_height
);
550 *alt_height
= MUIV_Window_AltHeight_Scaled
;
554 /* Refresh the current position and dimension information shown in the test
556 static void WindowUpdate(void)
558 DoMethod(window
.left_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
559 "%ld", XGET(window
.window
, MUIA_Window_LeftEdge
));
560 DoMethod(window
.width_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
561 "%ld", XGET(window
.window
, MUIA_Window_Width
));
562 DoMethod(window
.top_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
563 "%ld", XGET(window
.window
, MUIA_Window_TopEdge
));
564 DoMethod(window
.height_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
565 "%ld", XGET(window
.window
, MUIA_Window_Height
));
567 DoMethod(window
.alt_left_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
568 "%ld", XGET(window
.window
, MUIA_Window_AltLeftEdge
));
569 DoMethod(window
.alt_width_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
570 "%ld", XGET(window
.window
, MUIA_Window_AltWidth
));
571 DoMethod(window
.alt_top_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
572 "%ld", XGET(window
.window
, MUIA_Window_AltTopEdge
));
573 DoMethod(window
.alt_height_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
574 "%ld", XGET(window
.window
, MUIA_Window_AltHeight
));
577 /* Close and reopen the test window. Refresh its info while it's closed */
578 static void WindowReopen(void)
580 SET(window
.window
, MUIA_Window_Open
, FALSE
);
582 SET(window
.window
, MUIA_Window_Open
, TRUE
);
585 /* Close the test window */
586 static void WindowClose(void)
588 SET(window
.open_button
, MUIA_Disabled
, FALSE
);
589 SET(window
.close_button
, MUIA_Disabled
, TRUE
);
590 SET(window
.apply_button
, MUIA_Disabled
, TRUE
);
591 SET(window
.window
, MUIA_Window_Open
, FALSE
);
593 DoMethod(app
, OM_REMMEMBER
, window
.window
);
594 DoMethod(app
, MUIM_Application_PushMethod
, window
.window
, 1, OM_DISPOSE
);
595 window
.window
= NULL
;
596 window
.close_item
= NULL
;
599 /* Open a new test window */
600 static void WindowOpen(void)
602 LONG mode
, left
, top
, width
, height
, alt_left
, alt_top
, alt_width
,
604 Object
*menus
= NULL
, *update_button
, *reopen_button
, *close_button
;
605 BOOL no_menus
= FALSE
;
606 STRPTR title
= NULL
, screen_title
= NULL
;
608 /* Get window and screen titles */
609 GET(window
.title_string
, MUIA_String_Contents
, &title
);
610 if (title
[0] == '\0')
613 title
= StrDup(title
);
615 GET(window
.screen_string
, MUIA_String_Contents
, &screen_title
);
616 if (screen_title
[0] == '\0')
619 screen_title
= StrDup(screen_title
);
621 GetWindowDimensions(&left
, &top
, &width
, &height
, &alt_left
, &alt_top
,
622 &alt_width
, &alt_height
);
625 window
.close_item
= NULL
;
626 mode
= XGET(window
.menu_cycle
, MUIA_Cycle_Active
);
629 menus
= MenustripObject
,
630 MUIA_Family_Child
, MenuObject
,
631 MUIA_Menu_Title
, "Test",
632 MUIA_Family_Child
, window
.close_item
= MenuitemObject
,
633 MUIA_Menuitem_Title
, "Close", End
,
640 /* Create window object */
641 window
.window
= WindowObject
,
642 XGET(window
.id_check
, MUIA_Selected
) ? MUIA_Window_ID
: TAG_IGNORE
,
643 MAKE_ID('T','S','T','2'),
644 MUIA_Window_Title
, title
,
645 MUIA_Window_ScreenTitle
, screen_title
,
646 MUIA_Window_LeftEdge
, left
,
647 MUIA_Window_TopEdge
, top
,
648 MUIA_Window_Width
, width
,
649 MUIA_Window_Height
, height
,
650 MUIA_Window_AltLeftEdge
, alt_left
,
651 MUIA_Window_AltTopEdge
, alt_top
,
652 MUIA_Window_AltWidth
, alt_width
,
653 MUIA_Window_AltHeight
, alt_height
,
654 MUIA_Window_Backdrop
,
655 XGET(window
.backdrop_check
, MUIA_Selected
),
656 MUIA_Window_Borderless
,
657 XGET(window
.borderless_check
, MUIA_Selected
),
658 MUIA_Window_CloseGadget
,
659 XGET(window
.close_check
, MUIA_Selected
),
660 MUIA_Window_DepthGadget
,
661 XGET(window
.depth_check
, MUIA_Selected
),
662 MUIA_Window_RefWindow
,
663 XGET(window
.ref_check
, MUIA_Selected
) ? wnd
: NULL
,
665 XGET(window
.dragbar_check
, MUIA_Selected
),
666 MUIA_Window_SizeGadget
,
667 XGET(window
.size_check
, MUIA_Selected
),
668 MUIA_Window_Activate
,
669 XGET(window
.activate_check
, MUIA_Selected
),
670 MUIA_Window_Menustrip
, menus
,
671 MUIA_Window_NoMenus
, no_menus
,
672 WindowContents
, VGroup
,
674 GroupFrameT("Current dimensions"),
675 Child
, MUI_MakeObject(MUIO_Label
, "Left Edge:", 0),
676 Child
, window
.left_text
= TextObject
,
678 MUIA_Text_Contents
, "N/A",
680 Child
, MUI_MakeObject(MUIO_Label
, "Width:", 0),
681 Child
, window
.width_text
= TextObject
,
683 MUIA_Text_Contents
, "N/A",
685 Child
, MUI_MakeObject(MUIO_Label
, "Top Edge:", 0),
686 Child
, window
.top_text
= TextObject
,
688 MUIA_Text_Contents
, "N/A",
690 Child
, MUI_MakeObject(MUIO_Label
, "Height:", 0),
691 Child
, window
.height_text
= TextObject
,
693 MUIA_Text_Contents
, "N/A",
697 GroupFrameT("Alternative dimensions"),
698 Child
, MUI_MakeObject(MUIO_Label
, "Left Edge:", 0),
699 Child
, window
.alt_left_text
= TextObject
,
701 MUIA_Text_Contents
, "N/A",
703 Child
, MUI_MakeObject(MUIO_Label
, "Width:", 0),
704 Child
, window
.alt_width_text
= TextObject
,
706 MUIA_Text_Contents
, "N/A",
708 Child
, MUI_MakeObject(MUIO_Label
, "Top Edge:", 0),
709 Child
, window
.alt_top_text
= TextObject
,
711 MUIA_Text_Contents
, "N/A",
713 Child
, MUI_MakeObject(MUIO_Label
, "Height:", 0),
714 Child
, window
.alt_height_text
= TextObject
,
716 MUIA_Text_Contents
, "N/A",
720 Child
, update_button
=
721 MUI_MakeObject(MUIO_Button
, "Update"),
722 Child
, reopen_button
=
723 MUI_MakeObject(MUIO_Button
, "Reopen"),
724 Child
, close_button
=
725 MUI_MakeObject(MUIO_Button
, "Close"),
729 if (window
.window
!= NULL
)
731 DoMethod(app
, OM_ADDMEMBER
, window
.window
);
732 DoMethod(window
.window
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
733 app
, 3, MUIM_CallHook
, &hook_standard
, WindowClose
);
734 DoMethod(close_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
735 app
, 3, MUIM_CallHook
, &hook_standard
, WindowClose
);
736 if (window
.close_item
!= NULL
)
737 DoMethod(window
.close_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
738 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
741 /* Update dimensions when they change */
742 DoMethod(window
.window
, MUIM_Notify
, MUIA_Window_LeftEdge
,
743 MUIV_EveryTime
, window
.left_text
, 4, MUIM_SetAsString
,
744 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
745 DoMethod(window
.window
, MUIM_Notify
, MUIA_Window_Width
,
746 MUIV_EveryTime
, window
.width_text
, 4, MUIM_SetAsString
,
747 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
748 DoMethod(window
.window
, MUIM_Notify
, MUIA_Window_TopEdge
,
749 MUIV_EveryTime
, window
.top_text
, 4, MUIM_SetAsString
,
750 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
751 DoMethod(window
.window
, MUIM_Notify
, MUIA_Window_Height
,
752 MUIV_EveryTime
, window
.height_text
, 4, MUIM_SetAsString
,
753 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
754 DoMethod(window
.window
, MUIM_Notify
, MUIA_Window_AltLeftEdge
,
755 MUIV_EveryTime
, window
.alt_left_text
, 4, MUIM_SetAsString
,
756 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
757 DoMethod(window
.window
, MUIM_Notify
, MUIA_Window_AltWidth
,
758 MUIV_EveryTime
, window
.alt_width_text
, 4, MUIM_SetAsString
,
759 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
760 DoMethod(window
.window
, MUIM_Notify
, MUIA_Window_AltTopEdge
,
761 MUIV_EveryTime
, window
.alt_top_text
, 4, MUIM_SetAsString
,
762 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
763 DoMethod(window
.window
, MUIM_Notify
, MUIA_Window_AltHeight
,
764 MUIV_EveryTime
, window
.alt_height_text
, 4, MUIM_SetAsString
,
765 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
767 /* Update dimensions when asked */
768 DoMethod(update_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
769 app
, 3, MUIM_CallHook
, &hook_standard
, WindowUpdate
);
771 /* Close and reopen window when asked */
772 DoMethod(reopen_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
773 app
, 3, MUIM_CallHook
, &hook_standard
, WindowReopen
);
775 /* Get initial dimensions before window is opened */
778 SET(window
.window
, MUIA_Window_Open
, TRUE
);
779 SET(window
.open_button
, MUIA_Disabled
, TRUE
);
780 SET(window
.close_button
, MUIA_Disabled
, FALSE
);
781 SET(window
.apply_button
, MUIA_Disabled
, FALSE
);
785 /* Test getting title attributes */
786 GET(window
.window
, MUIA_Window_Title
, &title
);
788 SET(window
.title_string
, MUIA_String_Contents
, title
);
789 GET(window
.window
, MUIA_Window_ScreenTitle
, &screen_title
);
790 if (screen_title
!= NULL
)
791 SET(window
.screen_string
, MUIA_String_Contents
, screen_title
);
794 /* Apply new specifications to the current test window */
795 static void WindowApply(void)
797 LONG left
, top
, width
, height
, alt_left
, alt_top
, alt_width
,
799 STRPTR title
= (APTR
)~0;
801 /* Update window and screen titles */
802 GET(window
.window
, MUIA_Window_Title
, &title
);
804 GET(window
.title_string
, MUIA_String_Contents
, &title
);
805 if (title
[0] == '\0')
808 title
= StrDup(title
);
809 SET(window
.window
, MUIA_Window_Title
, title
);
811 GET(window
.window
, MUIA_Window_ScreenTitle
, &title
);
813 GET(window
.screen_string
, MUIA_String_Contents
, &title
);
814 if (title
[0] == '\0')
817 title
= StrDup(title
);
818 SET(window
.window
, MUIA_Window_ScreenTitle
, title
);
820 GetWindowDimensions(&left
, &top
, &width
, &height
, &alt_left
, &alt_top
,
821 &alt_width
, &alt_height
);
823 SET(window
.window
, MUIA_Window_LeftEdge
, left
);
824 SET(window
.window
, MUIA_Window_Width
, width
);
825 SET(window
.window
, MUIA_Window_TopEdge
, top
);
826 SET(window
.window
, MUIA_Window_Height
, height
);
828 SET(window
.window
, MUIA_Window_AltLeftEdge
, alt_left
);
829 SET(window
.window
, MUIA_Window_AltWidth
, alt_width
);
830 SET(window
.window
, MUIA_Window_AltTopEdge
, alt_top
);
831 SET(window
.window
, MUIA_Window_AltHeight
, alt_height
);
834 AROS_UFH3(static void, ObjStrHook
,
835 AROS_UFHA(struct Hook
*, h
, A0
),
836 AROS_UFHA(Object
*, group
, A2
),
837 AROS_UFHA(Object
*, str
, A1
))
841 struct List
*child_list
= NULL
;
842 Object
*child
, *list
;
843 struct list_entry
*entry
;
845 /* Find the listview object within its group */
846 GET(group
, MUIA_Group_ChildList
, &child_list
);
847 child
= (APTR
)child_list
->lh_Head
;
849 list
= NextObject(&child
);
851 /* Copy one of the selected entry's fields to the string gadget */
852 DoMethod(list
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &entry
);
853 SET(str
, MUIA_String_Contents
, entry
->column1
);
858 static void ChangeStringAccept(void)
860 STRPTR accept_chars
= NULL
, reject_chars
= NULL
;
864 accept_all
= XGET(string
.accept_all_check
, MUIA_Selected
);
865 SET(string
.accept_string
, MUIA_Disabled
, accept_all
);
866 SET(string
.reject_string
, MUIA_Disabled
, accept_all
);
870 GET(string
.accept_string
, MUIA_String_Contents
, &accept_chars
);
871 GET(string
.reject_string
, MUIA_String_Contents
, &reject_chars
);
874 for (i
= 0; i
< STRING_COUNT
; i
++)
876 SET(string
.strings
[i
], MUIA_String_Accept
, accept_chars
);
877 SET(string
.strings
[i
], MUIA_String_Reject
, reject_chars
);
881 static void ChangePen(void)
885 GET(colorfield_pen
, MUIA_String_Integer
, &pen
);
887 SET(colorfield
, MUIA_Colorfield_Pen
, pen
);
890 static void ChangePendisplayPen(void)
892 DoMethod(pendisplay
, MUIM_Pendisplay_SetColormap
,
893 XGET(pendisplay_pen
, MUIA_String_Integer
));
896 AROS_UFH3(static IPTR
, ListCompareHook
,
897 AROS_UFHA(struct Hook
*, h
, A0
),
898 AROS_UFHA(CONST_STRPTR
, str1
, A2
),
899 AROS_UFHA(CONST_STRPTR
, str2
, A1
))
908 /* Indicate which string is shorter */
914 AROS_UFH3(static IPTR
, ListMultiTestHook
,
915 AROS_UFHA(struct Hook
*, h
, A0
),
916 AROS_UFHA(APTR
, unused
, A2
),
917 AROS_UFHA(CONST_STRPTR
, str
, A1
))
921 /* Indicate whether the string doesn't begin with a vowel */
922 return strchr(vowels
, tolower(str
[0])) == NULL
;
927 static void ChangeListTitle(void)
932 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
934 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
937 GET(list
.title_string
, MUIA_String_Contents
, &title
);
938 if (title
[0] == '\0')
941 title
= StrDup(title
);
943 SET(list
.lists
[i
], MUIA_List_Title
, title
);
946 static void UpdateListInfo(void)
952 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
954 GET(list
.lists
[i
], MUIA_Listview_DragType
, &value
);
955 NNSET(list
.draggable_check
, MUIA_Selected
,
956 value
!= MUIV_Listview_DragType_None
);
957 NNSET(list
.dragsortable_check
, MUIA_Disabled
,
958 value
== MUIV_Listview_DragType_None
);
959 if (value
== MUIV_Listview_DragType_None
)
962 GET(list
.lists
[i
], MUIA_List_DragSortable
, &value
);
963 NNSET(list
.dragsortable_check
, MUIA_Selected
, value
);
964 GET(list
.lists
[i
], MUIA_List_ShowDropMarks
, &value
);
965 NNSET(list
.showdropmarks_check
, MUIA_Selected
, value
);
966 value
= list
.has_multitest
[i
]; // MUIA_List_MultiTestHook isn't gettable!
967 NNSET(list
.multitest_check
, MUIA_Selected
, value
);
968 value
= list
.quiet
[i
]; // MUIA_List_Quiet is not gettable!
969 NNSET(list
.quiet_check
, MUIA_Selected
, value
);
970 GET(list
.lists
[i
], MUIA_List_AutoVisible
, &value
);
971 NNSET(list
.autovisible_check
, MUIA_Selected
, value
);
973 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
974 NNSET(list
.title_string
, MUIA_String_Contents
, title
);
976 GET(list
.lists
[i
], MUIA_List_Entries
, &value
);
977 DoMethod(list
.entries_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
979 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
980 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
982 GET(list
.lists
[i
], MUIA_List_First
, &value
);
983 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
985 GET(list
.lists
[i
], MUIA_List_InsertPosition
, &value
);
986 DoMethod(list
.insert_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
988 GET(list
.lists
[i
], MUIA_List_Active
, &value
);
989 if (value
== MUIV_List_Active_Off
)
990 SET(list
.active_text
, MUIA_Text_Contents
, "N/A");
992 DoMethod(list
.active_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
994 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
995 MUIV_List_Select_Ask
, (IPTR
) &value
);
996 DoMethod(list
.selected_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
998 GET(list
.lists
[i
], MUIA_List_DropMark
, &value
);
999 DoMethod(list
.drop_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
1003 static void ListGetVisible(void)
1008 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1010 GET(list
.lists
[i
], MUIA_List_Visible
, &value
);
1011 DoMethod(list
.visible_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
1015 static void ListGetFirst(void)
1021 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1023 /* We fetch the Listview's list here to provide test coverage for that
1024 attribute. Please don't optimise */
1025 real_list
= (Object
*)XGET(list
.lists
[i
], MUIA_Listview_List
);
1026 GET(real_list
, MUIA_List_First
, &value
);
1027 DoMethod(list
.first_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
1031 static void ListGetSelected(void)
1036 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1038 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
1039 MUIV_List_Select_Ask
, (IPTR
) &value
);
1040 DoMethod(list
.selected_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
1044 static void ListSetDraggable(void)
1049 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1051 GET(list
.draggable_check
, MUIA_Selected
, &value
);
1052 SET(list
.lists
[i
], MUIA_Listview_DragType
, value
?
1053 MUIV_Listview_DragType_Immediate
: MUIV_Listview_DragType_None
);
1056 static void ListSetShowDropMarks(void)
1061 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1063 GET(list
.showdropmarks_check
, MUIA_Selected
, &value
);
1064 SET(list
.lists
[i
], MUIA_List_ShowDropMarks
, value
);
1067 static void ListSetMultiTest(void)
1072 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1074 GET(list
.multitest_check
, MUIA_Selected
, &value
);
1075 SET(list
.lists
[i
], MUIA_List_MultiTestHook
, value
? &hook_multitest
: NULL
);
1076 list
.has_multitest
[i
] = value
;
1079 static void ListSetQuiet(void)
1084 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1086 GET(list
.quiet_check
, MUIA_Selected
, &value
);
1087 SET(list
.lists
[i
], MUIA_List_Quiet
, value
);
1088 list
.quiet
[i
] = value
;
1091 static void ListSetDragSortable(void)
1096 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1098 GET(list
.dragsortable_check
, MUIA_Selected
, &value
);
1099 SET(list
.lists
[i
], MUIA_List_DragSortable
, value
);
1102 static void ListSetAutoVisible(void)
1107 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1109 GET(list
.autovisible_check
, MUIA_Selected
, &value
);
1110 SET(list
.lists
[i
], MUIA_List_AutoVisible
, value
);
1113 static void ListReset(void)
1117 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1119 SET(list
.lists
[i
], MUIA_List_Active
, list_active_positions
[i
]);
1122 static void ListMove(void)
1124 LONG mode
, pos1
, pos2
;
1127 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1129 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
1132 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
1136 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
1139 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
1143 DoMethod(list
.lists
[i
], MUIM_List_Move
, pos1
, pos2
);
1146 static void ListSort(void)
1150 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1152 DoMethod(list
.lists
[i
], MUIM_List_Sort
);
1155 static void ListEnable(void)
1159 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1161 SET(list
.lists
[i
], MUIA_Disabled
, FALSE
);
1164 static void ListExchange(void)
1166 LONG mode
, pos1
, pos2
;
1169 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1171 mode
= XGET(list
.move1_cycle
, MUIA_Cycle_Active
);
1174 pos1
= XGET(list
.index1_string
, MUIA_String_Integer
);
1178 mode
= XGET(list
.move2_cycle
, MUIA_Cycle_Active
);
1181 pos2
= XGET(list
.index2_string
, MUIA_String_Integer
);
1185 DoMethod(list
.lists
[i
], MUIM_List_Exchange
, pos1
, pos2
);
1188 static void ListJump(void)
1193 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1195 mode
= XGET(list
.jump_cycle
, MUIA_Cycle_Active
);
1198 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
1202 DoMethod(list
.lists
[i
], MUIM_List_Jump
, pos
);
1205 static void ListSelect(void)
1210 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1212 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
1215 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
1219 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_On
,
1223 static void ListDeselect(void)
1228 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1230 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
1233 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
1237 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
, MUIV_List_Select_Off
,
1241 static void ListToggle(void)
1246 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1248 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
1251 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
1255 DoMethod(list
.lists
[i
], MUIM_List_Select
, pos
,
1256 MUIV_List_Select_Toggle
, NULL
);
1259 static void ListRedraw(void)
1264 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1266 mode
= XGET(list
.select_cycle
, MUIA_Cycle_Active
);
1269 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
1273 DoMethod(list
.lists
[i
], MUIM_List_Redraw
, pos
);
1276 static void ListInsertSingle(void)
1281 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1283 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
1286 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
1290 DoMethod(list
.lists
[i
], MUIM_List_InsertSingle
, "Tomato", pos
);
1293 static void ListInsert(void)
1298 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1300 mode
= XGET(list
.insert_cycle
, MUIA_Cycle_Active
);
1303 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
1307 DoMethod(list
.lists
[i
], MUIM_List_Insert
, fruits
, -1, pos
);
1310 static void ListRemove(void)
1312 LONG mode
, pos
, count
, j
, *selections
;
1315 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1317 mode
= XGET(list
.remove_cycle
, MUIA_Cycle_Active
);
1321 /* Remove selected entries in a loop to test MUIM_List_NextSelected.
1322 This doesn't work as expected in MUI or Zune */
1323 pos
= MUIV_List_NextSelected_Start
- 1;
1324 while (pos
!= MUIV_List_NextSelected_End
)
1326 if (pos
== MUIV_List_NextSelected_Start
- 1)
1328 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
1329 if (pos
!= MUIV_List_NextSelected_End
)
1330 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
1335 /* Remove selected entries safely by first retrieving them with
1336 MUIM_List_NextSelected and then removing them one by one */
1337 DoMethod(list
.lists
[i
], MUIM_List_Select
, MUIV_List_Select_All
,
1338 MUIV_List_Select_Ask
, &count
);
1340 count
= 1; /* There may still be an active entry */
1341 selections
= AllocVec(sizeof(LONG
) * count
, MEMF_ANY
);
1342 if (selections
!= NULL
)
1344 pos
= MUIV_List_NextSelected_Start
;
1345 for (j
= 0; j
< count
; j
++)
1347 DoMethod(list
.lists
[i
], MUIM_List_NextSelected
, (IPTR
) &pos
);
1348 selections
[j
] = pos
;
1351 /* We must remove the entries in reverse order; otherwise the
1352 later indices will become invalid */
1354 DoMethod(list
.lists
[i
], MUIM_List_Remove
, selections
[--count
]);
1355 FreeVec(selections
);
1361 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
1364 DoMethod(list
.lists
[i
], MUIM_List_Remove
, pos
);
1368 static void ListClear(void)
1372 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1374 DoMethod(list
.lists
[i
], MUIM_List_Clear
);
1377 static void ListActivate(void)
1382 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1384 mode
= XGET(list
.activate_cycle
, MUIA_Cycle_Active
);
1387 pos
= XGET(list
.index1_string
, MUIA_String_Integer
);
1391 SET(list
.lists
[i
], MUIA_List_Active
, pos
);
1394 static void ListDeactivate(void)
1398 i
= XGET(list
.list_radios
, MUIA_Radio_Active
);
1400 SET(list
.lists
[i
], MUIA_List_Active
, MUIV_List_Active_Off
);
1403 static void CheckListDoubleClick(void)
1407 GET(list
.multi_lists
[1], MUIA_Listview_DoubleClick
, &value
);
1408 MUI_Request(app
, wnd
, 0, "Test", "OK",
1409 "MUIA_Listview_Doubleclick = %ld", value
);
1412 AROS_UFH3(static APTR
, ListConstructHook
,
1413 AROS_UFHA(struct Hook
*, h
, A0
),
1414 AROS_UFHA(APTR
, pool
, A2
),
1415 AROS_UFHA(IPTR
, n
, A1
))
1419 struct list_entry
*entry
;
1421 entry
= AllocPooled(pool
, sizeof(struct list_entry
) + 40);
1425 entry
->column1
= (char *)(entry
+ 1);
1426 entry
->column2
= entry
->column1
+ 20;
1427 sprintf(entry
->column1
, "Entry%ld", (long)n
);
1428 sprintf(entry
->column2
, "Col2: Entry%ld", (long)n
);
1436 AROS_UFH3(static void, ListDestructHook
,
1437 AROS_UFHA(struct Hook
*, h
, A0
),
1438 AROS_UFHA(APTR
, pool
, A2
),
1439 AROS_UFHA(struct list_entry
*, entry
, A1
))
1443 FreePooled(pool
, entry
, sizeof(struct list_entry
) + 40);
1444 list
.destruct_count
++;
1449 AROS_UFH3(static void, display_function
,
1450 AROS_UFHA(struct Hook
*, h
, A0
),
1451 AROS_UFHA(char **, strings
, A2
),
1452 AROS_UFHA(struct list_entry
*, entry
, A1
))
1456 static char buf
[100];
1460 if (XGET(list
.showimage_check
, MUIA_Selected
))
1461 sprintf(buf
, "%ld \33O[%08lx]", (long)*(strings
- 1),
1464 sprintf(buf
, "%ld", (long)*(strings
- 1));
1466 strings
[1] = entry
->column1
;
1467 strings
[2] = entry
->column2
;
1471 strings
[0] = "Number";
1472 strings
[1] = "Column 1";
1473 strings
[2] = "Column 2";
1479 static void Save(void)
1481 char *text
= (char *)XGET(editor_text
, MUIA_String_Contents
);
1482 char *filename
= (char *)XGET(filename_string
, MUIA_String_Contents
);
1485 if (!strlen(filename
))
1488 if ((fh
= Open(filename
, MODE_NEWFILE
)))
1490 Write(fh
, text
, strlen(text
));
1495 /* Update numeric minimums */
1496 static void NumericSetMin(void)
1500 min
= XGET(numeric
.min_string
, MUIA_String_Integer
);
1502 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
1503 SET(numeric
.numerics
[i
], MUIA_Numeric_Min
, min
);
1506 /* Update numeric/gauge maximums. Note that the maximum is set for some gauges
1507 * elsewhere through notification */
1508 static void NumericSetMax(void)
1513 max
= XGET(numeric
.max_string
, MUIA_String_Integer
);
1515 for (i
= 0; i
< NUMERIC_COUNT
; i
++)
1516 SET(numeric
.numerics
[i
], MUIA_Numeric_Max
, max
);
1518 sprintf(info_text
, "%%ld/%d", (int)max
);
1519 FreeVec((APTR
)XGET(numeric
.gauges
[HNGAUGE
], MUIA_Gauge_InfoText
));
1520 SET(numeric
.gauges
[HNGAUGE
], MUIA_Gauge_InfoText
, StrDup(info_text
));
1522 SET(numeric
.gauges
[VNGAUGE
], MUIA_Gauge_Max
, max
);
1524 max
= XGET(numeric
.gauges
[VNGAUGE
], MUIA_Gauge_Max
);
1525 div
= XGET(numeric
.gauges
[VQGAUGE
], MUIA_Gauge_Divide
);
1526 SET(numeric
.gauges
[VQGAUGE
], MUIA_Gauge_Max
, max
/ div
);
1529 static void GaugeCopyCurrent(void)
1533 i
= XGET(numeric
.gauges
[HNGAUGE
], MUIA_Gauge_Current
);
1534 SET(numeric
.gauges
[HQGAUGE
], MUIA_Gauge_Current
, i
);
1537 static void SliderCopyValue(void)
1541 i
= XGET(numeric
.numerics
[HRSLIDER
], MUIA_Numeric_Value
);
1542 nnset(numeric
.numerics
[HQSLIDER
], MUIA_Numeric_Value
, i
);
1543 i
= XGET(numeric
.numerics
[VRSLIDER
], MUIA_Numeric_Value
);
1544 nnset(numeric
.numerics
[VQSLIDER
], MUIA_Numeric_Value
, i
);
1547 static void RadioCopyActive(void)
1551 i
= XGET(city_radios
[1], MUIA_Radio_Active
);
1552 nnset(city_radios
[2], MUIA_Radio_Active
, i
);
1555 static void CycleCopyActive(void)
1559 i
= XGET(cycle
.city_cycle
, MUIA_Cycle_Active
);
1560 SET(cycle
.city_text
, MUIA_Text_Contents
, cities
[i
]);
1563 #if defined(TEST_ICONLIST)
1564 /* IconList callbacks */
1565 static void volume_doubleclicked(void)
1568 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
1570 DoMethod(volume_iconlist
, MUIM_IconList_NextIcon
,
1571 MUIV_IconList_NextIcon_Selected
, &ent
);
1572 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
1575 strcpy(buf
, ent
->label
);
1579 static void drawer_doubleclicked(void)
1581 struct IconList_Entry
*ent
= (void *)MUIV_IconList_NextIcon_Start
;
1583 DoMethod(drawer_iconlist
, MUIM_IconList_NextIcon
,
1584 MUIV_IconList_NextIcon_Selected
, &ent
);
1585 if ((IPTR
) ent
== MUIV_IconList_NextIcon_End
)
1587 set(drawer_iconlist
, MUIA_IconDrawerList_Drawer
,
1588 ent
->ile_IconEntry
->ie_IconNode
.ln_Name
);
1592 static IPTR
create_balance_column(void)
1594 return (IPTR
) VGroup
,
1595 Child
, RectangleObject
,
1598 Child
, BalanceObject
,
1600 Child
, RectangleObject
,
1603 Child
, BalanceObject
,
1605 Child
, RectangleObject
,
1608 Child
, BalanceObject
,
1610 Child
, RectangleObject
,
1613 Child
, BalanceObject
,
1615 Child
, RectangleObject
,
1621 /* The custom class */
1623 struct DropText_Data
1630 struct Library
*KeymapBase
;
1634 __saveds __asm IPTR
dispatcher(register __a0
struct IClass
*cl
,
1635 register __a2 Object
*obj
, register __a1 Msg msg
)
1637 AROS_UFH3S(IPTR
, dispatcher
,
1638 AROS_UFHA(Class
*, cl
, A0
),
1639 AROS_UFHA(Object
*, obj
, A2
), AROS_UFHA(Msg
, msg
, A1
))
1644 switch (msg
->MethodID
)
1646 case MUIM_DragQuery
:
1647 return MUIV_DragQuery_Accept
;
1650 struct DropText_Data
*data
=
1651 (struct DropText_Data
*)INST_DATA(cl
, obj
);
1654 sprintf(buf
, "%ld times", (long)data
->times
);
1655 set(obj
, MUIA_Text_Contents
, buf
);
1659 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
1664 static struct MUI_CustomClass
*CL_DropText
;
1666 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
1668 /* Custom Window subclass */
1670 struct TestWindowData
1675 IPTR
TestWindow__OM_SET(struct IClass
*cl
, Object
*obj
,
1678 struct TagItem
*tags
;
1679 struct TagItem
*tag
;
1681 for (tags
= msg
->ops_AttrList
; (tag
= NextTagItem(&tags
));)
1683 switch (tag
->ti_Tag
)
1685 case MUIA_Window_Open
:
1687 SET(obj
, MUIA_Window_ActiveObject
, general
.open_button
);
1692 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
1695 AROS_UFH3S(IPTR
, TestWindowDispatcher
,
1696 AROS_UFHA(Class
*, cl
, A0
),
1697 AROS_UFHA(Object
*, obj
, A2
),
1698 AROS_UFHA(Msg
, msg
, A1
))
1702 switch (msg
->MethodID
)
1705 return TestWindow__OM_SET(cl
, obj
, (struct opSet
*)msg
);
1707 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
1713 static struct MUI_CustomClass
*test_window_class
;
1715 #define TestWindowObject BOOPSIOBJMACRO_START(test_window_class->mcc_Class)
1719 AROS_UFH3S(void, hook_func_standard
,
1720 AROS_UFHA(struct Hook
*, h
, A0
),
1721 AROS_UFHA(void *, dummy
, A2
), AROS_UFHA(void **, funcptr
, A1
))
1725 void (*func
) (ULONG
*) = (void (*)(ULONG
*))(*funcptr
);
1728 func((ULONG
*) funcptr
+ 1);
1735 LONG result
= RETURN_OK
;
1738 Object
*about_button
;
1739 Object
*quit_button
;
1740 Object
*about_item
, *quit_item
;
1745 hook_standard
.h_Entry
= (HOOKFUNC
) hook_func_standard
;
1746 hook_objstr
.h_Entry
= (HOOKFUNC
) ObjStrHook
;
1748 pool
= CreatePool(MEMF_ANY
, 4096, 4096);
1750 MUIMasterBase
= (struct Library
*)OpenLibrary("muimaster.library", 0);
1752 hook
.h_Entry
= (HOOKFUNC
) repeat_function
;
1753 hook_wheel
.h_Entry
= (HOOKFUNC
) wheel_function
;
1754 hook_slider
.h_Entry
= (HOOKFUNC
) slider_function
;
1755 hook_objects
.h_Entry
= (HOOKFUNC
) objects_function
;
1756 hook_compare
.h_Entry
= (HOOKFUNC
) ListCompareHook
;
1757 hook_multitest
.h_Entry
= (HOOKFUNC
) ListMultiTestHook
;
1758 hook_construct
.h_Entry
= (HOOKFUNC
) ListConstructHook
;
1759 hook_destruct
.h_Entry
= (HOOKFUNC
) ListDestructHook
;
1760 hook_display
.h_Entry
= (HOOKFUNC
) display_function
;
1761 list
.destruct_count
= 0;
1762 list
.has_multitest
[3] = TRUE
;
1764 context_menu
= MenustripObject
,
1765 MUIA_Family_Child
, MenuObject
,
1766 MUIA_Menu_Title
, "Menutest",
1767 MUIA_Family_Child
, about_item
= MenuitemObject
,
1768 MUIA_Menuitem_Title
, "First Test Entry", End
,
1769 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1770 MUIA_Menuitem_Title
, "Second Test Entry", End
,
1774 /* should check the result in a real program! */
1775 CL_DropText
= MUI_CreateCustomClass(NULL
, MUIC_Text
, NULL
,
1776 sizeof(struct DropText_Data
), dispatcher
);
1777 test_window_class
= MUI_CreateCustomClass(NULL
, MUIC_Window
, NULL
,
1778 sizeof(struct TestWindowData
), TestWindowDispatcher
);
1779 ColorWheelBase
= OpenLibrary("gadgets/colorwheel.gadget", 0);
1781 pendisplay
= PendisplayObject
, MUIA_Pendisplay_Spec
, &default_penspec
, End
;
1783 title
= StrDup("Fruits");
1784 list
.lists
[0] = ListviewObject
,
1788 MUIA_List_Title
, title
,
1789 MUIA_List_SourceArray
, fruits
,
1790 MUIA_List_Active
, MUIV_List_Active_Top
,
1791 MUIA_List_PoolThreshSize
, 256,
1792 MUIA_List_DragSortable
, TRUE
,
1793 MUIA_List_CompareHook
, &hook_compare
,
1795 "Default scroller\nTop entry active\nSorted by length",
1797 MUIA_Listview_MultiSelect
,
1798 MUIV_Listview_MultiSelect_None
,
1799 MUIA_Listview_DragType
, MUIV_Listview_DragType_Immediate
,
1800 MUIA_Listview_DoubleClick
, TRUE
,
1803 list
.lists
[1] = ListviewObject
,
1807 MUIA_List_SourceArray
, fruits
,
1808 MUIA_List_Active
, MUIV_List_Active_Bottom
,
1809 MUIA_List_PoolPuddleSize
, 512,
1810 MUIA_List_AutoVisible
, TRUE
,
1812 "Left scroller\nBottom entry active\nSorted alphabetically",
1814 MUIA_Listview_ScrollerPos
,
1815 MUIV_Listview_ScrollerPos_Left
,
1816 MUIA_Listview_DragType
, MUIV_Listview_DragType_None
,
1819 list
.lists
[2] = ListviewObject
,
1823 MUIA_List_SourceArray
, fruits
,
1824 MUIA_List_Active
, MUIV_List_Active_Off
,
1825 MUIA_List_Pool
, pool
,
1827 "Right scroller\nNo active entry\nSorted alphabetically",
1829 MUIA_Listview_MultiSelect
,
1830 MUIV_Listview_MultiSelect_Shifted
,
1831 MUIA_Listview_ScrollerPos
,
1832 MUIV_Listview_ScrollerPos_Right
,
1835 list
.lists
[3] = ListviewObject
,
1839 MUIA_List_SourceArray
, fruits
,
1840 MUIA_List_Pool
, NULL
,
1841 MUIA_List_MultiTestHook
, &hook_multitest
,
1843 "No scroller\nDefault active entry\nSorted alphabetically",
1845 MUIA_Listview_MultiSelect
,
1846 MUIV_Listview_MultiSelect_Always
,
1847 MUIA_Listview_ScrollerPos
,
1848 MUIV_Listview_ScrollerPos_None
,
1851 list
.lists
[4] = ListviewObject
,
1855 MUIA_List_SourceArray
, fruits
,
1856 MUIA_List_Active
, MUIV_List_Active_Bottom
,
1857 MUIA_List_MinLineHeight
, 20,
1859 "Default scroller\nBottom entry active\nSorted by length",
1861 MUIA_Listview_Input
, FALSE
,
1865 list
.colorfield
= ColorfieldObject
,
1866 MUIA_Colorfield_RGB
, default_color
,
1869 if (CL_DropText
== NULL
|| test_window_class
== NULL
)
1870 result
= RETURN_FAIL
;
1872 if (result
== RETURN_OK
)
1874 app
= ApplicationObject
,
1875 MUIA_Application_Menustrip
, MenustripObject
,
1876 MUIA_Family_Child
, MenuObject
,
1877 MUIA_Menu_Title
, "Project",
1878 MUIA_Family_Child
, about_item
= MenuitemObject
,
1879 MUIA_Menuitem_Title
, "About...",
1880 MUIA_Menuitem_Shortcut
, "?",
1882 MUIA_Family_Child
, MenuitemObject
,
1883 MUIA_Menuitem_Title
, (SIPTR
)-1,
1885 MUIA_Family_Child
, quit_item
= MenuitemObject
,
1886 MUIA_Menuitem_Title
, "Quit",
1887 MUIA_Menuitem_Shortcut
, "Q",
1892 SubWindow
, wnd
= TestWindowObject
,
1893 MUIA_Window_Title
, "test",
1894 MUIA_Window_ID
, MAKE_ID('T','E','S','T'),
1895 MUIA_Window_Activate
, TRUE
,
1897 WindowContents
, VGroup
,
1898 Child
, RegisterGroup(pages
),
1899 //MUIA_Background, "5:SYS:Prefs/Presets/Backdrops/StuccoBlue.pic",
1900 Child
, CreateGeneralGroup(),
1901 Child
, CreateTextGroup(),
1902 Child
, CreateBoopsiGroup(),
1903 Child
, CreateColorGroup(),
1904 Child
, CreateEditGroup(),
1905 Child
, CreateListGroup(),
1906 Child
, CreateNumericGroup(),
1907 Child
, CreateSelectGroup(),
1908 #if defined(TEST_ICONLIST)
1911 Child
, volume_iconlist
=
1912 MUI_NewObject(MUIC_IconVolumeList
, GroupFrame
,
1914 Child
, drawer_iconlist
=
1915 MUI_NewObject(MUIC_IconDrawerList
, GroupFrame
,
1916 MUIA_IconDrawerList_Drawer
, "SYS:",
1920 Child
, CreateBalancingGroup(),
1925 Child
, about_button
= TextObject
,
1927 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1929 MUIA_Background
, MUII_ButtonBack
,
1930 MUIA_Text_PreParse
, "\33c",
1931 MUIA_Text_Contents
, "About",
1933 Child
, quit_button
= TextObject
,
1935 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
1937 MUIA_Background
, MUII_ButtonBack
,
1938 MUIA_ControlChar
, 'q',
1939 MUIA_Text_HiChar
, 'q',
1940 MUIA_Text_PreParse
, "\33c",
1941 MUIA_Text_Contents
, "Quit",
1947 SubWindow
, second_wnd
= WindowObject
,
1948 MUIA_Window_Title
, "Second window",
1949 WindowContents
, VGroup
,
1950 Child
, DropTextObject
,
1951 MUIA_Text_Contents
, "Drop here",
1952 MUIA_Dropable
, TRUE
,
1960 result
= RETURN_FAIL
;
1963 if (result
== RETURN_OK
)
1967 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2,
1968 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
1969 DoMethod(second_wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
1970 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
1971 DoMethod(general
.open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1972 second_wnd
, 3, MUIM_Set
, MUIA_Window_Open
, TRUE
);
1973 SET(general
.menus_check
, MUIA_Selected
, TRUE
);
1974 DoMethod(general
.menus_check
, MUIM_Notify
, MUIA_Selected
,
1975 MUIV_EveryTime
, wnd
, 3, MUIM_Set
, MUIA_Window_NoMenus
,
1976 MUIV_NotTriggerValue
);
1977 DoMethod(about_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1978 MUIM_Application_AboutMUI
, NULL
);
1979 DoMethod(quit_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1980 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
1981 DoMethod(objects_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 2,
1982 MUIM_CallHook
, &hook_objects
);
1983 DoMethod(repeat_button
, MUIM_Notify
, MUIA_Timer
, MUIV_EveryTime
,
1984 app
, 2, MUIM_CallHook
, &hook
);
1986 /* Notifications and set-up for window tab */
1987 set(window
.close_check
, MUIA_Selected
, TRUE
);
1988 set(window
.depth_check
, MUIA_Selected
, TRUE
);
1989 set(window
.close_check
, MUIA_Selected
, TRUE
);
1990 set(window
.dragbar_check
, MUIA_Selected
, TRUE
);
1991 set(window
.size_check
, MUIA_Selected
, TRUE
);
1992 set(window
.activate_check
, MUIA_Selected
, TRUE
);
1993 set(window
.close_button
, MUIA_Disabled
, TRUE
);
1994 set(window
.apply_button
, MUIA_Disabled
, TRUE
);
1995 DoMethod(window
.open_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1996 app
, 3, MUIM_CallHook
, &hook_standard
, WindowOpen
);
1997 DoMethod(window
.close_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1998 app
, 3, MUIM_CallHook
, &hook_standard
, WindowClose
);
1999 DoMethod(window
.apply_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2000 app
, 3, MUIM_CallHook
, &hook_standard
, WindowApply
);
2002 /* Notifications and set-up for string objects */
2003 DoMethod(string
.max_len_text
, MUIM_SetAsString
, MUIA_Text_Contents
,
2004 "%ld", XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2005 set(string
.cursor_pos_slider
, MUIA_Numeric_Max
,
2006 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2007 set(string
.display_pos_slider
, MUIA_Numeric_Max
,
2008 XGET(string
.strings
[0], MUIA_String_MaxLen
) - 1);
2009 set(string
.cr_advance_check
, MUIA_Selected
, TRUE
);
2010 set(string
.attach_list_check
, MUIA_Selected
, TRUE
);
2011 set(string
.strings
[1], MUIA_Disabled
,
2012 XGET(string
.strings
[1], MUIA_String_Format
)
2013 != MUIV_String_Format_Left
);
2014 set(string
.strings
[2], MUIA_Disabled
,
2015 XGET(string
.strings
[2], MUIA_String_Format
)
2016 != MUIV_String_Format_Right
);
2017 set(string
.strings
[3], MUIA_Disabled
,
2018 XGET(string
.strings
[3], MUIA_String_Format
)
2019 != MUIV_String_Format_Center
);
2020 set(string
.strings
[4], MUIA_Disabled
,
2021 !XGET(string
.strings
[4], MUIA_String_Secret
));
2022 set(string
.strings
[0], MUIA_String_MaxLen
, 100);
2023 set(string
.reject_string
, MUIA_String_Contents
,
2024 (IPTR
)default_reject_chars
);
2026 for (i
= 0; i
< STRING_COUNT
; i
++)
2030 DoMethod(string
.accept_string
, MUIM_Notify
,
2031 MUIA_String_Contents
, MUIV_EveryTime
, string
.strings
[i
],
2032 3, MUIM_Set
, MUIA_String_Accept
, MUIV_TriggerValue
);
2033 DoMethod(string
.cr_advance_check
, MUIM_Notify
, MUIA_Selected
,
2034 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2035 MUIA_String_AdvanceOnCR
, MUIV_TriggerValue
);
2036 DoMethod(string
.cursor_pos_slider
, MUIM_Notify
,
2037 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2038 MUIM_Set
, MUIA_String_BufferPos
, MUIV_TriggerValue
);
2039 DoMethod(string
.display_pos_slider
, MUIM_Notify
,
2040 MUIA_Numeric_Value
, MUIV_EveryTime
, string
.strings
[i
], 3,
2041 MUIM_Set
, MUIA_String_DisplayPos
, MUIV_TriggerValue
);
2042 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2043 TRUE
, string
.strings
[i
], 3, MUIM_Set
,
2044 MUIA_String_AttachedList
, list
.lists
[0]);
2045 DoMethod(string
.attach_list_check
, MUIM_Notify
, MUIA_Selected
,
2046 FALSE
, string
.strings
[i
], 3, MUIM_Set
,
2047 MUIA_String_AttachedList
, NULL
);
2051 DoMethod(string
.strings
[0], MUIM_Notify
, MUIA_String_Accept
,
2052 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2053 MUIA_String_Accept
, MUIV_TriggerValue
);
2054 DoMethod(string
.strings
[0], MUIM_Notify
,
2055 MUIA_String_AdvanceOnCR
, MUIV_EveryTime
,
2056 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_AdvanceOnCR
,
2058 DoMethod(string
.strings
[0], MUIM_Notify
,
2059 MUIA_String_BufferPos
, MUIV_EveryTime
,
2060 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_BufferPos
,
2062 DoMethod(string
.strings
[0], MUIM_Notify
,
2063 MUIA_String_DisplayPos
, MUIV_EveryTime
,
2064 string
.strings
[i
], 3, MUIM_Set
, MUIA_String_DisplayPos
,
2066 DoMethod(string
.strings
[0], MUIM_Notify
,
2067 MUIA_String_AttachedList
, MUIV_EveryTime
,
2068 string
.strings
[i
], 3, MUIM_Set
,
2069 MUIA_String_AttachedList
, MUIV_TriggerValue
);
2071 DoMethod(string
.reject_string
, MUIM_Notify
, MUIA_String_Contents
,
2072 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_Set
,
2073 MUIA_String_Reject
, MUIV_TriggerValue
);
2074 DoMethod(string
.strings
[i
], MUIM_Notify
, MUIA_String_Integer
,
2075 MUIV_EveryTime
, string
.integer_string
, 3, MUIM_NoNotifySet
,
2076 MUIA_String_Integer
, MUIV_TriggerValue
);
2077 DoMethod(string
.integer_string
, MUIM_Notify
, MUIA_String_Integer
,
2078 MUIV_EveryTime
, string
.strings
[i
], 3, MUIM_NoNotifySet
,
2079 MUIA_String_Integer
, MUIV_TriggerValue
);
2081 DoMethod(string
.accept_all_check
, MUIM_Notify
, MUIA_Selected
,
2082 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2083 ChangeStringAccept
);
2084 DoMethod(string
.strings
[4], MUIM_Notify
, MUIA_String_Acknowledge
,
2085 MUIV_EveryTime
, string
.plaintext_string
, 3, MUIM_NoNotifySet
,
2086 MUIA_String_Contents
, MUIV_TriggerValue
);
2087 DoMethod(string
.plaintext_string
, MUIM_Notify
,
2088 MUIA_String_Acknowledge
, MUIV_EveryTime
, string
.strings
[4], 3,
2089 MUIM_NoNotifySet
, MUIA_String_Contents
, MUIV_TriggerValue
);
2091 DoMethod(wheel
, MUIM_Notify
, WHEEL_Hue
, MUIV_EveryTime
, app
, 2,
2092 MUIM_CallHook
, &hook_wheel
);
2093 DoMethod(wheel
, MUIM_Notify
, WHEEL_Saturation
, MUIV_EveryTime
, app
,
2094 2, MUIM_CallHook
, &hook_wheel
);
2095 DoMethod(r_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2096 app
, 2, MUIM_CallHook
, &hook_slider
);
2097 DoMethod(g_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2098 app
, 2, MUIM_CallHook
, &hook_slider
);
2099 DoMethod(b_slider
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
2100 app
, 2, MUIM_CallHook
, &hook_slider
);
2102 DoMethod(save_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, app
, 3,
2103 MUIM_CallHook
, &hook_standard
, Save
);
2105 DoMethod(quit_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2106 MUIV_EveryTime
, app
, 2, MUIM_Application_ReturnID
,
2107 MUIV_Application_ReturnID_Quit
);
2108 DoMethod(about_item
, MUIM_Notify
, MUIA_Menuitem_Trigger
,
2109 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2112 /* Notifications for color objects */
2113 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Red
,
2114 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2116 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Green
,
2117 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2119 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Blue
,
2120 MUIV_EveryTime
, colorfield2
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2122 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Red
,
2123 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Red
,
2125 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Green
,
2126 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Green
,
2128 DoMethod(coloradjust
, MUIM_Notify
, MUIA_Coloradjust_Blue
,
2129 MUIV_EveryTime
, colorfield
, 3, MUIM_Set
, MUIA_Colorfield_Blue
,
2131 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_Pen
,
2132 MUIV_EveryTime
, colorfield_pen
, 3, MUIM_Set
,
2133 MUIA_String_Integer
, MUIV_TriggerValue
);
2134 DoMethod(colorfield_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2135 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2137 DoMethod(colorfield_reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2138 colorfield
, 3, MUIM_Set
, MUIA_Colorfield_RGB
, default_color
);
2140 /* Notifications for pen objects */
2141 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Pen
,
2142 MUIV_EveryTime
, pendisplay_pen
, 3, MUIM_NoNotifySet
,
2143 MUIA_String_Integer
, MUIV_TriggerValue
);
2144 DoMethod(pendisplay_pen
, MUIM_Notify
, MUIA_String_Acknowledge
,
2145 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2146 ChangePendisplayPen
);
2147 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_Spec
,
2148 MUIV_EveryTime
, pendisplay_spec
, 3, MUIM_Set
,
2149 MUIA_String_Contents
, MUIV_TriggerValue
);
2150 DoMethod(colorfield
, MUIM_Notify
, MUIA_Colorfield_RGB
,
2151 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
,
2152 MUIA_Pendisplay_RGBcolor
, MUIV_TriggerValue
);
2153 DoMethod(pendisplay
, MUIM_Notify
, MUIA_Pendisplay_RGBcolor
,
2154 MUIV_EveryTime
, poppen
, 3, MUIM_Set
, MUIA_Pendisplay_RGBcolor
,
2156 DoMethod(pendisplay_spec
, MUIM_Notify
, MUIA_String_Contents
,
2157 MUIV_EveryTime
, pendisplay
, 3, MUIM_Set
, MUIA_Pendisplay_Spec
,
2159 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, TRUE
,
2160 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, pendisplay
);
2161 DoMethod(reference_check
, MUIM_Notify
, MUIA_Selected
, FALSE
,
2162 pendisplay2
, 3, MUIM_Set
, MUIA_Pendisplay_Reference
, NULL
);
2163 DoMethod(shine_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2164 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHINE
);
2165 DoMethod(shadow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2166 2, MUIM_Pendisplay_SetMUIPen
, MPEN_SHADOW
);
2167 DoMethod(yellow_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
, pendisplay
,
2168 4, MUIM_Pendisplay_SetRGB
, 0xffffffff, 0xffffffff, 0);
2170 /* Notifications and set-up for list objects */
2171 set(list
.showdropmarks_check
, MUIA_Selected
, TRUE
);
2173 for (i
= 0; i
< LIST_COUNT
; i
++)
2175 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2176 MUIV_EveryTime
, list
.lists
[i
], 3, MUIM_Set
, MUIA_Disabled
,
2178 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Entries
,
2179 MUIV_EveryTime
, list
.entries_text
, 4, MUIM_SetAsString
,
2180 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2181 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Visible
,
2182 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2184 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_First
,
2185 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2187 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_InsertPosition
,
2188 MUIV_EveryTime
, list
.insert_text
, 4, MUIM_SetAsString
,
2189 MUIA_Text_Contents
, "%ld", MUIV_TriggerValue
);
2190 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_List_Active
,
2191 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2193 DoMethod(list
.lists
[i
], MUIM_Notify
, MUIA_Listview_SelectChange
,
2194 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2197 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2198 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2200 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2201 MUIV_EveryTime
, list
.dragsortable_check
, 3, MUIM_Set
,
2202 MUIA_Disabled
, MUIV_NotTriggerValue
);
2203 DoMethod(list
.draggable_check
, MUIM_Notify
, MUIA_Selected
,
2204 FALSE
, list
.dragsortable_check
, 3, MUIM_Set
,
2205 MUIA_Selected
, FALSE
);
2206 DoMethod(list
.showdropmarks_check
, MUIM_Notify
, MUIA_Selected
,
2207 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2208 ListSetShowDropMarks
);
2209 DoMethod(list
.multitest_check
, MUIM_Notify
, MUIA_Selected
,
2210 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2212 DoMethod(list
.quiet_check
, MUIM_Notify
, MUIA_Selected
,
2213 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2215 DoMethod(list
.dragsortable_check
, MUIM_Notify
, MUIA_Selected
,
2216 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2217 ListSetDragSortable
);
2218 DoMethod(list
.autovisible_check
, MUIM_Notify
, MUIA_Selected
,
2219 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2220 ListSetAutoVisible
);
2221 DoMethod(list
.reset_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2222 app
, 3, MUIM_CallHook
, &hook_standard
, ListReset
);
2223 DoMethod(list
.move_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2224 app
, 3, MUIM_CallHook
, &hook_standard
, ListMove
);
2225 DoMethod(list
.sort_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2226 app
, 3, MUIM_CallHook
, &hook_standard
, ListSort
);
2227 DoMethod(list
.enable_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2228 app
, 3, MUIM_CallHook
, &hook_standard
, ListEnable
);
2229 DoMethod(list
.exchange_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2230 app
, 3, MUIM_CallHook
, &hook_standard
, ListExchange
);
2231 DoMethod(list
.jump_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2232 app
, 3, MUIM_CallHook
, &hook_standard
, ListJump
);
2233 DoMethod(list
.select_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2234 app
, 3, MUIM_CallHook
, &hook_standard
, ListSelect
);
2235 DoMethod(list
.deselect_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2236 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeselect
);
2237 DoMethod(list
.toggle_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2238 app
, 3, MUIM_CallHook
, &hook_standard
, ListToggle
);
2239 DoMethod(list
.redraw_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2240 app
, 3, MUIM_CallHook
, &hook_standard
, ListRedraw
);
2241 DoMethod(list
.insert_single_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2242 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsertSingle
);
2243 DoMethod(list
.insert_multiple_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2244 app
, 3, MUIM_CallHook
, &hook_standard
, ListInsert
);
2245 DoMethod(list
.remove_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2246 app
, 3, MUIM_CallHook
, &hook_standard
, ListRemove
);
2247 DoMethod(list
.clear_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2248 app
, 3, MUIM_CallHook
, &hook_standard
, ListClear
);
2249 DoMethod(list
.activate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2250 app
, 3, MUIM_CallHook
, &hook_standard
, ListActivate
);
2251 DoMethod(list
.deactivate_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2252 app
, 3, MUIM_CallHook
, &hook_standard
, ListDeactivate
);
2253 DoMethod(list
.title_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2254 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2256 DoMethod(list
.list_radios
, MUIM_Notify
, MUIA_Radio_Active
,
2257 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2259 SET(list
.lists
[4], MUIA_List_CompareHook
, &hook_compare
);
2260 SET(list
.lists
[4], MUIA_List_AutoVisible
, TRUE
);
2262 SET(list
.showheadings_check
, MUIA_Selected
,
2263 XGET(list
.multi_lists
[0], MUIA_List_Title
));
2264 SET(list
.format_string
, MUIA_String_Contents
,
2265 XGET(list
.multi_lists
[1], MUIA_List_Format
));
2266 SET(list
.def_column_string
, MUIA_String_Integer
,
2267 XGET(list
.multi_lists
[0], MUIA_Listview_DefClickColumn
));
2268 DoMethod(list
.format_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2269 MUIV_EveryTime
, list
.multi_lists
[1], 3, MUIM_Set
,
2270 MUIA_List_Format
, MUIV_TriggerValue
);
2271 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_List_Format
,
2272 MUIV_EveryTime
, wnd
, 3, MUIM_Set
,
2273 MUIA_Window_ActiveObject
, list
.format_string
);
2274 for (i
= 0; i
< MULTI_LIST_COUNT
; i
++)
2276 DoMethod(list
.showheadings_check
, MUIM_Notify
, MUIA_Selected
,
2277 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2278 MUIA_List_Title
, MUIV_TriggerValue
);
2279 DoMethod(list
.showimage_check
, MUIM_Notify
, MUIA_Selected
,
2280 MUIV_EveryTime
, list
.multi_lists
[i
], 2, MUIM_List_Redraw
,
2281 MUIV_List_Redraw_All
);
2282 DoMethod(list
.def_column_string
, MUIM_Notify
,
2283 MUIA_String_Integer
,
2284 MUIV_EveryTime
, list
.multi_lists
[i
], 3, MUIM_Set
,
2285 MUIA_Listview_DefClickColumn
, MUIV_TriggerValue
);
2286 DoMethod(list
.multi_lists
[i
], MUIM_Notify
,
2287 MUIA_Listview_ClickColumn
, MUIV_EveryTime
,
2288 list
.column_string
, 3, MUIM_Set
, MUIA_String_Integer
,
2291 DoMethod(list
.column_string
, MUIM_Notify
, MUIA_String_Contents
,
2292 MUIV_EveryTime
, list
.column_text
, 3, MUIM_Set
, MUIA_Text_Contents
,
2294 DoMethod(list
.multi_lists
[1], MUIM_Notify
, MUIA_Listview_DoubleClick
,
2295 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2296 CheckListDoubleClick
);
2297 SET(list
.multi_lists
[1], MUIA_List_ConstructHook
, &hook_construct
);
2298 SET(list
.multi_lists
[1], MUIA_List_DestructHook
, &hook_destruct
);
2299 SET(list
.multi_lists
[1], MUIA_List_DisplayHook
, &hook_display
);
2300 DoMethod(list
.multi_lists
[1], MUIM_List_Insert
, entries
, -1,
2301 MUIV_List_Insert_Top
);
2303 DoMethod(listview
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
2304 popobject
, 2, MUIM_Popstring_Close
, TRUE
);
2308 /* Update min/max values of sliders and gauges whenever the min/max
2309 * fields are changed */
2310 DoMethod(numeric
.min_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2311 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2313 DoMethod(numeric
.max_string
, MUIM_Notify
, MUIA_String_Acknowledge
,
2314 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2316 DoMethod(numeric
.numerics
[HNSLIDER
], MUIM_Notify
, MUIA_Numeric_Max
,
2317 MUIV_EveryTime
, numeric
.gauges
[HNGAUGE
], 3, MUIM_Set
,
2318 MUIA_Gauge_Max
, MUIV_TriggerValue
);
2319 DoMethod(numeric
.gauges
[HNGAUGE
], MUIM_Notify
, MUIA_Gauge_Max
,
2320 MUIV_EveryTime
, numeric
.gauges
[HQGAUGE
], 3, MUIM_Set
,
2321 MUIA_Gauge_Max
, MUIV_TriggerValue
);
2323 DoMethod(numeric
.numerics
[NKNOB
], MUIM_Notify
, MUIA_Numeric_Value
,
2324 MUIV_EveryTime
, numeric
.numerics
[NLEVELMETER
], 3, MUIM_Set
,
2325 MUIA_Numeric_Value
, MUIV_TriggerValue
);
2326 DoMethod(numeric
.numerics
[RKNOB
], MUIM_Notify
, MUIA_Numeric_Value
,
2327 MUIV_EveryTime
, numeric
.numerics
[RLEVELMETER
], 3, MUIM_Set
,
2328 MUIA_Numeric_Value
, MUIV_TriggerValue
);
2329 DoMethod(numeric
.slider_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2330 numeric
.numerics
[HRSLIDER
], 3, MUIM_Set
, MUIA_Slider_Horiz
, FALSE
);
2332 /* Get horizontal sliders to follow each other */
2333 DoMethod(numeric
.numerics
[HNSLIDER
], MUIM_Notify
, MUIA_Numeric_Value
,
2334 MUIV_EveryTime
, numeric
.numerics
[HRSLIDER
], 3, MUIM_Set
,
2335 MUIA_Numeric_Value
, MUIV_TriggerValue
);
2336 DoMethod(numeric
.numerics
[HRSLIDER
], MUIM_Notify
, MUIA_Numeric_Value
,
2337 MUIV_EveryTime
, numeric
.numerics
[HNSLIDER
], 3, MUIM_NoNotifySet
,
2338 MUIA_Numeric_Value
, MUIV_TriggerValue
);
2339 DoMethod(numeric
.numerics
[HRSLIDER
], MUIM_Notify
, MUIA_Numeric_Value
,
2340 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2342 DoMethod(numeric
.numerics
[HQSLIDER
], MUIM_Notify
, MUIA_Numeric_Value
,
2343 MUIV_EveryTime
, numeric
.numerics
[HNSLIDER
], 3, MUIM_Set
,
2344 MUIA_Numeric_Value
, MUIV_TriggerValue
);
2346 /* Get normal horizontal gauge to follow horizontal sliders */
2347 for (i
= HNSLIDER
; i
<= HRSLIDER
; i
++)
2349 DoMethod(numeric
.numerics
[i
], MUIM_Notify
, MUIA_Numeric_Value
,
2350 MUIV_EveryTime
, numeric
.gauges
[HNGAUGE
], 3, MUIM_Set
,
2351 MUIA_Gauge_Current
, MUIV_TriggerValue
);
2354 /* Get quiet horizontal gauge to follow normal horizontal gauge */
2355 DoMethod(numeric
.gauges
[HNGAUGE
], MUIM_Notify
, MUIA_Gauge_Current
,
2356 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2359 /* Get vertical sliders to follow each other */
2360 DoMethod(numeric
.numerics
[VNSLIDER
], MUIM_Notify
, MUIA_Numeric_Value
,
2361 MUIV_EveryTime
, numeric
.numerics
[VRSLIDER
], 3, MUIM_Set
,
2362 MUIA_Numeric_Value
, MUIV_TriggerValue
);
2363 DoMethod(numeric
.numerics
[VRSLIDER
], MUIM_Notify
, MUIA_Numeric_Value
,
2364 MUIV_EveryTime
, numeric
.numerics
[VNSLIDER
], 3, MUIM_NoNotifySet
,
2365 MUIA_Numeric_Value
, MUIV_TriggerValue
);
2366 DoMethod(numeric
.numerics
[VRSLIDER
], MUIM_Notify
, MUIA_Numeric_Value
,
2367 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2369 DoMethod(numeric
.numerics
[VQSLIDER
], MUIM_Notify
, MUIA_Numeric_Value
,
2370 MUIV_EveryTime
, numeric
.numerics
[VNSLIDER
], 3, MUIM_Set
,
2371 MUIA_Numeric_Value
, MUIV_TriggerValue
);
2373 /* Get vertical gauge to follow vertical sliders */
2374 for (i
= VNSLIDER
; i
<= VRSLIDER
; i
++)
2376 DoMethod(numeric
.numerics
[i
], MUIM_Notify
, MUIA_Numeric_Value
,
2377 MUIV_EveryTime
, numeric
.gauges
[VNGAUGE
], 3, MUIM_Set
,
2378 MUIA_Gauge_Current
, MUIV_TriggerValue
);
2381 /* Get quiet vertical gauge to follow normal vertical gauge */
2382 DoMethod(numeric
.gauges
[VNGAUGE
], MUIM_Notify
, MUIA_Gauge_Current
,
2383 MUIV_EveryTime
, numeric
.gauges
[VQGAUGE
], 3, MUIM_Set
,
2384 MUIA_Gauge_Current
, MUIV_TriggerValue
);
2387 DoMethod(city_radios
[0], MUIM_Notify
, MUIA_Radio_Active
,
2388 MUIV_EveryTime
, city_radios
[1], 3, MUIM_Set
,
2389 MUIA_Radio_Active
, MUIV_TriggerValue
);
2390 DoMethod(city_radios
[1], MUIM_Notify
, MUIA_Radio_Active
,
2391 MUIV_EveryTime
, city_radios
[0], 3, MUIM_NoNotifySet
,
2392 MUIA_Radio_Active
, MUIV_TriggerValue
);
2393 DoMethod(city_radios
[1], MUIM_Notify
, MUIA_Radio_Active
,
2394 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2396 DoMethod(city_radios
[2], MUIM_Notify
, MUIA_Radio_Active
,
2397 MUIV_EveryTime
, city_radios
[0], 3, MUIM_Set
,
2398 MUIA_Radio_Active
, MUIV_TriggerValue
);
2401 DoMethod(cycle
.city_cycle
, MUIM_Notify
, MUIA_Cycle_Active
,
2402 MUIV_EveryTime
, city_radios
[0], 3, MUIM_Set
,
2403 MUIA_Radio_Active
, MUIV_TriggerValue
);
2404 DoMethod(cycle
.prev_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2405 cycle
.city_cycle
, 3, MUIM_Set
, MUIA_Cycle_Active
,
2406 MUIV_Cycle_Active_Prev
);
2407 DoMethod(cycle
.next_button
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2408 cycle
.city_cycle
, 3, MUIM_Set
, MUIA_Cycle_Active
,
2409 MUIV_Cycle_Active_Next
);
2410 DoMethod(cycle
.city_cycle
, MUIM_Notify
, MUIA_Cycle_Active
,
2411 MUIV_EveryTime
, app
, 3, MUIM_CallHook
, &hook_standard
,
2414 #if defined(TEST_ICONLIST)
2416 DoMethod(volume_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2417 TRUE
, volume_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2418 volume_doubleclicked
);
2419 DoMethod(drawer_iconlist
, MUIM_Notify
, MUIA_IconList_DoubleClick
,
2420 TRUE
, drawer_iconlist
, 3, MUIM_CallHook
, &hook_standard
,
2421 drawer_doubleclicked
);
2424 /* pre-display automatic tests */
2425 get(list
.lists
[0], MUIA_List_Visible
, &value
);
2427 printf("MUIA_List_Visible equals %ld before display,"
2428 " but it should be -1.\n", (long)value
);
2429 get(list
.multi_lists
[0], MUIA_Listview_ClickColumn
, &value
);
2431 printf("MUIA_Listview_ClickColumn equals %ld before display,"
2432 " but it should be 0.\n", (long)value
);
2433 get(list
.lists
[0], MUIA_Listview_DoubleClick
, &value
);
2435 printf("MUIA_Listview_DoubleClick equals %ld before display,"
2436 " but it should be 0.\n", (long)value
);
2438 set(wnd
, MUIA_Window_Open
, TRUE
);
2439 set(wnd
, MUIA_Window_ScreenTitle
, "Zune Test Application");
2441 /* post-display automatic tests */
2442 set(list
.lists
[0], MUIA_Listview_SelectChange
, TRUE
);
2443 get(list
.lists
[0], MUIA_Listview_SelectChange
, &value
);
2445 printf("MUIA_Listview_SelectChange is settable,"
2446 " although it should not be.\n");
2448 list
.image
= DoMethod(list
.multi_lists
[0], MUIM_List_CreateImage
,
2449 list
.colorfield
, 0);
2451 /* Set pen fields */
2452 set(colorfield_pen
, MUIA_String_Integer
,
2453 XGET(colorfield
, MUIA_Colorfield_Pen
));
2456 nnset(pendisplay_pen
, MUIA_String_Integer
,
2457 XGET(pendisplay
, MUIA_Pendisplay_Pen
));
2459 struct MUI_PenSpec
*pen_spec
= NULL
;
2460 GET(pendisplay
, MUIA_Pendisplay_Spec
, &pen_spec
);
2461 CopyMem(pen_spec
->buf
, pen_str
, 10);
2463 set(pendisplay_spec
, MUIA_String_Contents
, pen_str
);
2465 /* Main loop: wait until quit */
2466 while ((LONG
) DoMethod(app
, MUIM_Application_NewInput
,
2467 &sigs
) != MUIV_Application_ReturnID_Quit
)
2471 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
2472 if (sigs
& SIGBREAKF_CTRL_C
)
2474 if (sigs
& SIGBREAKF_CTRL_D
)
2480 DoMethod(list
.multi_lists
[0], MUIM_List_DeleteImage
, list
.image
);
2482 for (i
= 0; i
< LIST_COUNT
; i
++)
2484 GET(list
.lists
[i
], MUIA_List_Title
, &title
);
2485 SET(list
.lists
[i
], MUIA_List_Title
, NULL
);
2489 FreeVec(text
.image_text
);
2491 if (window
.window
!= NULL
)
2493 GET(window
.window
, MUIA_Window_Title
, &title
);
2494 SET(window
.window
, MUIA_Window_Title
, NULL
);
2498 MUI_DisposeObject(app
);
2501 MUI_DisposeObject(context_menu
);
2502 CloseLibrary(ColorWheelBase
);
2503 MUI_DeleteCustomClass(test_window_class
);
2504 MUI_DeleteCustomClass(CL_DropText
);
2506 /* shutdown-related automatic tests */
2507 if (list
.destruct_count
!= 18)
2508 printf("The hook installed through MUIA_List_DestructHook has been"
2509 " called %ld times, but should have been called 18 times.\n",
2510 (long)list
.destruct_count
);
2512 CloseLibrary(MUIMasterBase
);
2519 static Object
*CreateGeneralGroup()
2523 group
= RegisterGroup(general_pages
),
2528 GroupFrameT("A horizontal group"),
2530 GroupFrameT("A column group"),
2531 Child
, repeat_button
= TextObject
,
2534 MUIA_Background
, MUII_ButtonBack
,
2535 MUIA_Text_PreParse
, "\33c",
2536 MUIA_Text_Contents
, "Repeat",
2537 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2542 MUIA_Background
, MUII_ButtonBack
,
2543 MUIA_Text_PreParse
, "\33c",
2544 MUIA_Text_Contents
, "Drag Me",
2545 MUIA_Draggable
, TRUE
,
2546 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2548 Child
, general
.open_button
= TextObject
,
2551 MUIA_Background
, MUII_ButtonBack
,
2552 MUIA_Text_PreParse
, "\33c",
2553 MUIA_Text_Contents
, "Open Window",
2554 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2557 MUIA_ContextMenu
, context_menu
,
2560 MUIA_Background
, MUII_ButtonBack
,
2561 MUIA_Text_PreParse
, "\33c",
2562 MUIA_Text_Contents
, "Press Right",
2563 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2565 Child
, objects_button
= TextObject
,
2568 MUIA_Background
, MUII_ButtonBack
,
2569 MUIA_Text_PreParse
, "\33c",
2570 MUIA_Text_Contents
, "Add Objects",
2571 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2576 Child
, general
.menus_check
=
2577 MUI_MakeObject(MUIO_Checkmark
,
2581 Child
, MUI_MakeObject(MUIO_Label
,
2582 "_Enable menus", 0),
2588 Child
, group
= VGroup
,
2589 GroupFrameT("A vertical group"),
2590 Child
, DropTextObject
,
2591 MUIA_Dropable
, TRUE
,
2594 MUIA_Background
, MUII_ButtonBack
,
2595 MUIA_Text_PreParse
, "\33c",
2596 MUIA_Text_Contents
, "Drop Here",
2597 MUIA_Dropable
, TRUE
,
2598 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2602 MUIA_Background
, MUII_MARKHALFSHINE
,
2604 MUIA_Text_PreParse
, "\33c",
2605 MUIA_Text_Contents
, "Pattern",
2607 Child
, MUI_NewObject(MUIC_Popimage
, TAG_DONE
),
2609 Child
, ScrollgroupObject
,
2610 GroupFrameT("A scroll group"),
2611 MUIA_Scrollgroup_Contents
, VGroupV
,
2616 "Line1\nLine2\nLine3\n"
2617 "Line4\nLine5\nLine6\n"
2618 "Line7\nLine8\n\n\n\n"
2619 "Line9\nLine10\nLine11\n",
2622 Child
, MUI_MakeObject(MUIO_Button
, "Button9"),
2623 Child
, MUI_MakeObject(MUIO_Button
, "Button10"),
2628 Child
, popobject
= PopobjectObject
,
2629 MUIA_Popstring_String
,
2630 MUI_MakeObject(MUIO_String
, NULL
, 200),
2631 MUIA_Popstring_Button
, PopButton(MUII_PopUp
),
2632 MUIA_Popobject_Object
, VGroup
,
2634 MUIA_Text_Contents
, "test",
2636 Child
, listview
= ListviewObject
,
2637 MUIA_Listview_List
, ListObject
,
2639 MUIA_List_ConstructHook
, &hook_construct
,
2640 MUIA_List_DestructHook
, &hook_destruct
,
2641 MUIA_List_DisplayHook
, &hook_display
,
2642 MUIA_List_Format
, ",,",
2643 MUIA_List_SourceArray
, entries
,
2644 MUIA_List_Title
, TRUE
,
2648 MUIA_Popobject_ObjStrHook
, &hook_objstr
,
2652 MUIA_Cycle_Entries
, pages
,
2654 Child
, ScrollbarObject
,
2655 MUIA_Group_Horiz
, TRUE
,
2656 MUIA_Prop_Visible
, 100,
2657 MUIA_Prop_Entries
, 300,
2658 MUIA_Prop_First
, 50,
2666 Child
, MUI_MakeObject(MUIO_Label
, "Window title:", 0),
2667 Child
, window
.title_string
=
2670 MUIA_String_Contents
, "Test window",
2672 Child
, MUI_MakeObject(MUIO_Label
, "Screen title:", 0),
2673 Child
, window
.screen_string
=
2676 MUIA_String_Contents
, "Test window",
2681 GroupFrameT("Initial dimensions"),
2683 GroupFrameT("Left Edge"),
2684 Child
, MUI_MakeObject(MUIO_Label
, "Mode:", 0),
2685 Child
, window
.left_cycle
= CycleObject
,
2687 MUIA_Cycle_Entries
, window_left_modes
+ 1,
2689 Child
, MUI_MakeObject(MUIO_Label
, "Pixels:", 0),
2690 Child
, window
.left_index_string
=
2693 MUIA_String_Accept
, (IPTR
)digits
,
2694 MUIA_String_Integer
, 100,
2698 GroupFrameT("Width"),
2699 Child
, MUI_MakeObject(MUIO_Label
, "Mode:", 0),
2700 Child
, window
.width_cycle
= CycleObject
,
2702 MUIA_Cycle_Entries
, window_dim_modes
,
2704 Child
, MUI_MakeObject(MUIO_Label
,
2705 "Pixels/percentage:", 0),
2706 Child
, window
.width_index_string
=
2709 MUIA_String_Accept
, (IPTR
)digits
,
2710 MUIA_String_Integer
, 100,
2714 GroupFrameT("Top Edge"),
2715 Child
, MUI_MakeObject(MUIO_Label
, "Mode:", 0),
2716 Child
, window
.top_cycle
= CycleObject
,
2718 MUIA_Cycle_Entries
, window_top_modes
+ 1,
2720 Child
, MUI_MakeObject(MUIO_Label
, "Pixels:", 0),
2721 Child
, window
.top_index_string
=
2724 MUIA_String_Accept
, (IPTR
)digits
,
2725 MUIA_String_Integer
, 100,
2729 GroupFrameT("Height"),
2730 Child
, MUI_MakeObject(MUIO_Label
, "Mode:", 0),
2731 Child
, window
.height_cycle
=
2734 MUIA_Cycle_Entries
, window_dim_modes
,
2736 Child
, MUI_MakeObject(MUIO_Label
,
2737 "Pixels/percentage:", 0),
2738 Child
, window
.height_index_string
=
2741 MUIA_String_Accept
, (IPTR
)digits
,
2742 MUIA_String_Integer
, 100,
2748 GroupFrameT("Alternative dimensions"),
2750 GroupFrameT("Left Edge"),
2751 Child
, MUI_MakeObject(MUIO_Label
, "Mode:", 0),
2752 Child
, window
.alt_left_cycle
=
2755 MUIA_Cycle_Entries
, window_left_modes
,
2757 Child
, MUI_MakeObject(MUIO_Label
, "Pixels:", 0),
2758 Child
, window
.alt_left_index_string
=
2761 MUIA_String_Accept
, (IPTR
)digits
,
2762 MUIA_String_Integer
, 100,
2766 GroupFrameT("Width"),
2767 Child
, MUI_MakeObject(MUIO_Label
, "Mode:", 0),
2768 Child
, window
.alt_width_cycle
=
2771 MUIA_Cycle_Entries
, window_dim_modes
+ 1,
2773 Child
, MUI_MakeObject(MUIO_Label
,
2774 "Pixels/percentage:", 0),
2775 Child
, window
.alt_width_index_string
=
2778 MUIA_String_Accept
, (IPTR
)digits
,
2779 MUIA_String_Integer
, 100,
2783 GroupFrameT("Top Edge"),
2784 Child
, MUI_MakeObject(MUIO_Label
, "Mode:", 0),
2785 Child
, window
.alt_top_cycle
=
2788 MUIA_Cycle_Entries
, window_top_modes
,
2790 Child
, MUI_MakeObject(MUIO_Label
, "Pixels:", 0),
2791 Child
, window
.alt_top_index_string
=
2794 MUIA_String_Accept
, (IPTR
)digits
,
2795 MUIA_String_Integer
, 100,
2799 GroupFrameT("Height"),
2800 Child
, MUI_MakeObject(MUIO_Label
, "Mode:", 0),
2801 Child
, window
.alt_height_cycle
=
2804 MUIA_Cycle_Entries
, window_dim_modes
+ 1,
2806 Child
, MUI_MakeObject(MUIO_Label
,
2807 "Pixels/percentage:", 0),
2808 Child
, window
.alt_height_index_string
=
2811 MUIA_String_Accept
, (IPTR
)digits
,
2812 MUIA_String_Integer
, 100,
2819 Child
, window
.appwindow_check
=
2820 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2821 Child
, MUI_MakeObject(MUIO_Label
, "AppWindow", 0),
2825 Child
, window
.backdrop_check
=
2826 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2827 Child
, MUI_MakeObject(MUIO_Label
, "Backdrop", 0),
2831 Child
, window
.borderless_check
=
2832 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2833 Child
, MUI_MakeObject(MUIO_Label
, "Borderless", 0),
2837 Child
, window
.close_check
=
2838 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2839 Child
, MUI_MakeObject(MUIO_Label
, "Close gadget", 0),
2843 Child
, window
.depth_check
=
2844 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2845 Child
, MUI_MakeObject(MUIO_Label
, "Depth gadget", 0),
2850 Child
, window
.dragbar_check
=
2851 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2852 Child
, MUI_MakeObject(MUIO_Label
,
2857 Child
, window
.ref_check
=
2858 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2859 Child
, MUI_MakeObject(MUIO_Label
, "Reference parent", 0),
2863 Child
, window
.size_check
=
2864 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2865 Child
, MUI_MakeObject(MUIO_Label
, "Size gadget", 0),
2869 Child
, window
.activate_check
=
2870 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2871 Child
, MUI_MakeObject(MUIO_Label
, "Active", 0),
2875 Child
, window
.id_check
=
2876 MUI_MakeObject(MUIO_Checkmark
, NULL
),
2877 Child
, MUI_MakeObject(MUIO_Label
, "Use ID", 0),
2881 Child
, MUI_MakeObject(MUIO_Label
, "Menus:", 0),
2882 Child
, window
.menu_cycle
= CycleObject
,
2884 MUIA_Cycle_Entries
, window_menu_modes
,
2890 Child
, window
.open_button
=
2891 MUI_MakeObject(MUIO_Button
, "Open"),
2892 Child
, window
.close_button
=
2893 MUI_MakeObject(MUIO_Button
, "Close"),
2894 Child
, window
.apply_button
=
2895 MUI_MakeObject(MUIO_Button
, "Apply"),
2905 static Object
*CreateTextGroup()
2910 struct MUI_AlphaData
*raw_image
;
2912 TEXT image_text
[100];
2914 /* Allocate image data */
2915 raw_image
= AllocVec(sizeof(struct MUI_AlphaData
)
2916 + TEXT_RAW_IMAGE_SIZE
* TEXT_RAW_IMAGE_SIZE
* sizeof(ULONG
), MEMF_ANY
);
2917 if (raw_image
== NULL
)
2920 /* Create a pattern where each quadrant of a square is a different colour */
2921 raw_image
->width
= TEXT_RAW_IMAGE_SIZE
;
2922 raw_image
->height
= TEXT_RAW_IMAGE_SIZE
;
2923 pixels
= raw_image
->data
;
2924 for (i
= 0; i
< TEXT_RAW_IMAGE_SIZE
/ 2; i
++)
2926 colour
= 0xff0000ff;
2927 for (j
= 0; j
< TEXT_RAW_IMAGE_SIZE
/ 2; j
++)
2928 *pixels
++ = AROS_LONG2LE(colour
);
2929 colour
= 0x00ff00ff;
2930 for (j
= 0; j
< TEXT_RAW_IMAGE_SIZE
/ 2; j
++)
2931 *pixels
++ = AROS_LONG2LE(colour
);
2933 for (i
= 0; i
< TEXT_RAW_IMAGE_SIZE
/ 2; i
++)
2935 colour
= 0x0000ffff;
2936 for (j
= 0; j
< TEXT_RAW_IMAGE_SIZE
/ 2; j
++)
2937 *pixels
++ = AROS_LONG2LE(colour
);
2938 colour
= 0x00000000;
2939 for (j
= 0; j
< TEXT_RAW_IMAGE_SIZE
/ 2; j
++)
2940 *pixels
++ = AROS_LONG2LE(colour
);
2943 /* Embed image in a string */
2945 "This is a text object with a raw ARGB image: \33A[%lx]",
2948 group
= RegisterGroup(text_pages
),
2953 MUIA_Background
, "2:cfffffff,cfffffff,10000000",
2955 MUIA_Text_Contents
, "\33cHello World!\n"
2956 "This is a text object\n\33lLeft "
2962 /* Test for a bug with pen specifications as
2964 https://sourceforge.net/p/aros/bugs/487/
2967 "This is a \33P[3]text \33P[]object "
2968 "\33P[1]with pen specifications",
2972 MUIA_Text_Contents
, (text
.image_text
= StrDup(image_text
)),
2974 Child
, RectangleObject
,
2976 /* Seems to be not supported properly as
2977 orginal MUI doesn't allow to alter the
2978 height of the window */
2979 MUIA_Rectangle_HBar
, TRUE
,
2980 MUIA_Rectangle_BarTitle
, "Enter a string",
2982 Child
, StringObject
,
2985 MUIA_String_AdvanceOnCR
, TRUE
,
2994 GroupFrameT("Default Alignment"),
2995 Child
, string
.strings
[0] = StringObject
,
2997 MUIA_String_Accept
, (IPTR
)default_accept_chars
,
2998 MUIA_String_Reject
, (IPTR
)default_reject_chars
,
2999 MUIA_String_AdvanceOnCR
, TRUE
,
3000 MUIA_String_MaxLen
, 9,
3002 MUIA_String_AttachedList
, list
.lists
[0],
3005 Child
, VGroup
, GroupFrameT("Left Aligned"),
3006 Child
, string
.strings
[1] = StringObject
,
3008 MUIA_String_Accept
, (IPTR
)default_accept_chars
,
3009 MUIA_String_Reject
, (IPTR
)default_reject_chars
,
3010 MUIA_String_Format
, MUIV_String_Format_Left
,
3011 MUIA_String_AdvanceOnCR
, TRUE
,
3012 MUIA_String_MaxLen
, 9,
3014 MUIA_String_Contents
, (IPTR
)default_accept_chars
,
3015 MUIA_String_BufferPos
, 3,
3016 MUIA_String_AttachedList
, list
.lists
[0],
3019 Child
, VGroup
, GroupFrameT("Right Aligned"),
3020 Child
, string
.strings
[2] = StringObject
,
3022 MUIA_String_Accept
, (IPTR
)default_accept_chars
,
3023 MUIA_String_Reject
, (IPTR
)default_reject_chars
,
3024 MUIA_String_Format
, MUIV_String_Format_Right
,
3025 MUIA_String_AdvanceOnCR
, TRUE
,
3026 MUIA_String_MaxLen
, 9,
3028 MUIA_String_AttachedList
, list
.lists
[0],
3031 Child
, VGroup
, GroupFrameT("Centered"),
3032 Child
, string
.strings
[3] = StringObject
,
3034 MUIA_String_Accept
, (IPTR
)default_accept_chars
,
3035 MUIA_String_Reject
, (IPTR
)default_reject_chars
,
3036 MUIA_String_Format
, MUIV_String_Format_Center
,
3037 MUIA_String_AdvanceOnCR
, TRUE
,
3038 MUIA_String_MaxLen
, 9,
3040 MUIA_String_Integer
, 123,
3041 MUIA_String_AttachedList
, list
.lists
[0],
3044 Child
, VGroup
, GroupFrameT("Secret"),
3045 Child
, string
.strings
[4] = StringObject
,
3047 MUIA_String_Accept
, (IPTR
)default_accept_chars
,
3048 MUIA_String_Reject
, (IPTR
)default_reject_chars
,
3049 MUIA_String_Format
, MUIV_String_Format_Center
,
3050 MUIA_String_Secret
, TRUE
,
3051 MUIA_String_AdvanceOnCR
, TRUE
,
3052 MUIA_String_MaxLen
, 9,
3054 MUIA_String_AttachedList
, list
.lists
[0],
3057 Child
, HGroup
, GroupFrameT("Narrow"),
3059 Child
, string
.strings
[5] = StringObject
,
3061 MUIA_String_Accept
, (IPTR
)default_accept_chars
,
3062 MUIA_String_Reject
, (IPTR
)default_reject_chars
,
3063 MUIA_String_Format
, MUIV_String_Format_Center
,
3064 MUIA_String_AdvanceOnCR
, TRUE
,
3066 MUIA_String_MaxLen
, 9,
3068 MUIA_String_AttachedList
, list
.lists
[0],
3074 Child
, VGroup
, GroupFrameT("Controls"),
3076 Child
, string
.accept_all_check
=
3077 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3078 Child
, MUI_MakeObject(MUIO_Label
,
3079 "Accept all characters", 0),
3083 Child
, MUI_MakeObject(MUIO_Label
,
3084 "Acceptable characters:", 0),
3085 Child
, string
.accept_string
=
3088 MUIA_String_Contents
, (IPTR
)default_accept_chars
,
3090 Child
, MUI_MakeObject(MUIO_Label
,
3091 "Unacceptable characters:", 0),
3092 Child
, string
.reject_string
=
3096 Child
, MUI_MakeObject(MUIO_Label
,
3097 "Cursor position:", 0),
3098 Child
, string
.cursor_pos_slider
=
3100 MUIA_Group_Horiz
, TRUE
,
3101 MUIA_Numeric_Min
, 0,
3103 Child
, MUI_MakeObject(MUIO_Label
,
3104 "Display position:", 0),
3105 Child
, string
.display_pos_slider
=
3107 MUIA_Group_Horiz
, TRUE
,
3108 MUIA_Numeric_Min
, 0,
3110 Child
, MUI_MakeObject(MUIO_Label
,
3111 "Integer value:", 0),
3112 Child
, string
.integer_string
=
3115 MUIA_String_Accept
, (IPTR
)digits
,
3117 Child
, MUI_MakeObject(MUIO_Label
,
3119 Child
, string
.plaintext_string
=
3123 Child
, MUI_MakeObject(MUIO_Label
,
3124 "Maximum string length:", 0),
3125 Child
, string
.max_len_text
= TextObject
,
3127 MUIA_Text_Contents
, "Unknown",
3132 Child
, string
.cr_advance_check
=
3133 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3134 Child
, MUI_MakeObject(MUIO_Label
,
3135 "Advance on CR", 0),
3139 Child
, string
.attach_list_check
=
3140 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3141 Child
, MUI_MakeObject(MUIO_Label
,
3147 Child
, string
.standard_hook_check
=
3148 MUI_MakeObject(MUIO_Checkmark
,
3150 Child
, MUI_MakeObject(MUIO_Label
,
3151 "Use standard edit hook", 0),
3155 Child
, string
.custom_hook_check
=
3156 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3157 Child
, MUI_MakeObject(MUIO_Label
,
3158 "Use custom edit hook", 0),
3172 static Object
*CreateBoopsiGroup()
3177 Child
, wheel
= BoopsiObject
,
3178 /* MUI/Boopsi tags mixed */
3180 /* boopsi objects don't know their sizes, so we help keep
3181 * important values during window resize */
3182 MUIA_Boopsi_ClassID
, "colorwheel.gadget",
3183 MUIA_Boopsi_MinWidth
, 30,
3184 MUIA_Boopsi_MinHeight
, 30,
3185 MUIA_Boopsi_Remember
, WHEEL_Saturation
,
3186 MUIA_Boopsi_Remember
, WHEEL_Hue
,
3187 /* this magic fills in the screen pointer */
3188 MUIA_Boopsi_TagScreen
, WHEEL_Screen
,
3191 GA_Top
, 0, /* MUI will automatically */
3192 GA_Width
, 0, /* fill in the correct values */
3194 ICA_TARGET
, ICTARGET_IDCMP
,
3195 /* needed for notification */
3196 WHEEL_Saturation
, 0, /* start in the center */
3197 MUIA_FillArea
, TRUE
,
3198 /* use this because it defaults to FALSE
3199 for boopsi gadgets but the colorwheel
3200 doesn't bother about redrawing its
3204 Child
, r_slider
= SliderObject
,
3205 MUIA_Group_Horiz
, TRUE
,
3206 MUIA_Numeric_Min
, 0,
3207 MUIA_Numeric_Max
, 255,
3209 Child
, g_slider
= SliderObject
,
3210 MUIA_Group_Horiz
, TRUE
,
3211 MUIA_Numeric_Min
, 0,
3212 MUIA_Numeric_Max
, 255,
3214 Child
, b_slider
= SliderObject
,
3215 MUIA_Group_Horiz
, TRUE
,
3216 MUIA_Numeric_Min
, 0,
3217 MUIA_Numeric_Max
, 255,
3219 Child
, hue_gauge
= GaugeObject
,
3221 MUIA_Gauge_Horiz
, TRUE
,
3222 MUIA_Gauge_Max
, 255,
3223 MUIA_Gauge_Divide
, 1<<24,
3224 MUIA_Gauge_InfoText
, "Hue: %ld",
3231 static Object
*CreateColorGroup()
3235 group
= RegisterGroup(color_pages
),
3236 Child
, VGroup
, GroupFrameT("Palette"),
3237 Child
, PaletteObject
,
3241 Child
, VGroup
, GroupFrameT("Colorfield"),
3244 Child
, colorfield
= ColorfieldObject
,
3245 MUIA_Colorfield_RGB
, default_color
,
3246 MUIA_Colorfield_Pen
, 253,
3248 Child
, colorfield2
= ColorfieldObject
,
3249 MUIA_Colorfield_Red
, default_color
[0],
3250 MUIA_Colorfield_Green
, default_color
[1],
3251 MUIA_Colorfield_Blue
, default_color
[2],
3254 Child
, colorfield_reset_button
=
3255 MUI_MakeObject(MUIO_Button
, "Reset"),
3258 MUI_MakeObject(MUIO_Label
, "Pen:", 0),
3259 Child
, colorfield_pen
= StringObject
,
3264 Child
, VGroup
, GroupFrameT("Coloradjust"),
3265 Child
, coloradjust
= ColoradjustObject
,
3266 MUIA_Coloradjust_RGB
, default_color
,
3272 Child
, VGroup
, GroupFrameT("Pendisplay"),
3275 Child
, pendisplay2
=
3277 MUIA_Pendisplay_RGBcolor
, default_color
,
3282 MUI_MakeObject(MUIO_Label
, "Pen:", 0),
3284 Child
, pendisplay_pen
=
3285 StringObject
, StringFrame
,
3288 Child
, reference_check
=
3289 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3290 Child
, MUI_MakeObject(MUIO_Label
,
3294 MUI_MakeObject(MUIO_Label
, "Penspec:", 0),
3295 Child
, pendisplay_spec
=
3301 Child
, shine_button
=
3302 MUI_MakeObject(MUIO_Button
, "Shine"),
3303 Child
, shadow_button
=
3304 MUI_MakeObject(MUIO_Button
, "Shadow"),
3305 Child
, yellow_button
=
3306 MUI_MakeObject(MUIO_Button
, "Yellow"),
3309 Child
, VGroup
, GroupFrameT("Poppen"),
3310 Child
, poppen
= PoppenObject
,
3314 Child
, VGroup
, GroupFrameT("Penadjust"),
3315 Child
, PenadjustObject
,
3324 static Object
*CreateEditGroup()
3329 Child
, editor_text
= StringObject
,
3332 Child
, PopaslObject
,
3333 ASLFR_DoSaveMode
, TRUE
,
3334 MUIA_Popstring_String
, filename_string
=
3335 MUI_MakeObject(MUIO_String
, NULL
, 200),
3336 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
3338 Child
, save_button
=
3339 MUI_MakeObject(MUIO_Button
, "Save"),
3345 static Object
*CreateListGroup()
3349 group
= RegisterGroup(list_pages
),
3351 Child
, ColGroup(LIST_COUNT
),
3353 GroupFrameT("No Multiselect"),
3354 Child
, list
.lists
[0],
3357 GroupFrameT("Default Multiselect"),
3358 Child
, list
.lists
[1],
3361 GroupFrameT("Shifted Multiselect"),
3362 Child
, list
.lists
[2],
3365 GroupFrameT("Unconditional Multiselect"),
3366 Child
, list
.lists
[3],
3369 GroupFrameT("Read Only"),
3370 Child
, list
.lists
[4],
3374 MUIA_Group_HorizSpacing
, 0,
3375 Child
, RectangleObject
,
3376 MUIA_HorizWeight
, 1,
3378 Child
, list
.list_radios
= RadioObject
,
3379 MUIA_Radio_Entries
, empty
,
3380 MUIA_Group_Horiz
, TRUE
,
3381 MUIA_HorizWeight
, 1000,
3383 Child
, RectangleObject
,
3384 MUIA_HorizWeight
, 1,
3387 Child
, RectangleObject
,
3389 MUIA_Rectangle_HBar
, TRUE
,
3390 MUIA_Rectangle_BarTitle
, "List Controls",
3393 Child
, MUI_MakeObject(MUIO_Label
,
3394 "Affected index 1:", 0),
3395 Child
, list
.index1_string
=
3398 MUIA_String_Accept
, (IPTR
)digits
,
3399 MUIA_String_Integer
, 0,
3402 Child
, list
.draggable_check
=
3403 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3404 Child
, MUI_MakeObject(MUIO_Label
,
3409 Child
, list
.showdropmarks_check
=
3410 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3411 Child
, MUI_MakeObject(MUIO_Label
,
3412 "Show drop marks", 0),
3416 Child
, list
.autovisible_check
=
3417 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3418 Child
, MUI_MakeObject(MUIO_Label
,
3422 Child
, list
.reset_button
=
3423 MUI_MakeObject(MUIO_Button
, "Reset"),
3425 Child
, MUI_MakeObject(MUIO_Label
,
3426 "Affected index 2:", 0),
3427 Child
, list
.index2_string
=
3430 MUIA_String_Accept
, (IPTR
)digits
,
3431 MUIA_String_Integer
, 0,
3434 Child
, list
.dragsortable_check
=
3435 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3436 Child
, MUI_MakeObject(MUIO_Label
,
3437 "Drag sortable", 0),
3441 Child
, list
.multitest_check
=
3442 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3443 Child
, MUI_MakeObject(MUIO_Label
,
3444 "Filter multiselect", 0),
3448 Child
, list
.quiet_check
=
3449 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3450 Child
, MUI_MakeObject(MUIO_Label
,
3454 Child
, list
.enable_button
=
3455 MUI_MakeObject(MUIO_Button
, "Enable"),
3457 Child
, MUI_MakeObject(MUIO_Label
,
3458 "Move/exchange mode 1:", 0),
3459 Child
, list
.move1_cycle
= CycleObject
,
3461 MUIA_Cycle_Entries
, list_move1_modes
,
3463 Child
, list
.move_button
=
3464 MUI_MakeObject(MUIO_Button
, "Move"),
3465 Child
, list
.sort_button
=
3466 MUI_MakeObject(MUIO_Button
, "Sort"),
3467 Child
, MUI_MakeObject(MUIO_Label
,
3469 Child
, list
.title_string
=
3474 Child
, MUI_MakeObject(MUIO_Label
,
3475 "Move/exchange mode 2:", 0),
3476 Child
, list
.move2_cycle
= CycleObject
,
3478 MUIA_Cycle_Entries
, list_move2_modes
,
3480 Child
, list
.exchange_button
=
3481 MUI_MakeObject(MUIO_Button
, "Exchange"),
3482 Child
, list
.redraw_button
=
3483 MUI_MakeObject(MUIO_Button
, "Redraw"),
3484 Child
, MUI_MakeObject(MUIO_Label
,
3486 Child
, list
.entries_text
= TextObject
,
3488 MUIA_Text_Contents
, "N/A",
3491 Child
, MUI_MakeObject(MUIO_Label
,
3493 Child
, list
.jump_cycle
= CycleObject
,
3495 MUIA_Cycle_Entries
, list_jump_modes
,
3497 Child
, list
.jump_button
=
3498 MUI_MakeObject(MUIO_Button
, "Jump"),
3499 Child
, list
.toggle_button
=
3500 MUI_MakeObject(MUIO_Button
, "Toggle"),
3501 Child
, MUI_MakeObject(MUIO_Label
,
3502 "Visible entries:", 0),
3503 Child
, list
.visible_text
= TextObject
,
3505 MUIA_Text_Contents
, "N/A",
3508 Child
, MUI_MakeObject(MUIO_Label
,
3509 "Select/redraw mode:", 0),
3510 Child
, list
.select_cycle
= CycleObject
,
3512 MUIA_Cycle_Entries
, list_select_modes
,
3514 Child
, list
.select_button
=
3515 MUI_MakeObject(MUIO_Button
, "Select"),
3516 Child
, list
.deselect_button
=
3517 MUI_MakeObject(MUIO_Button
, "Deselect"),
3518 Child
, MUI_MakeObject(MUIO_Label
,
3519 "First visible index:", 0),
3520 Child
, list
.first_text
= TextObject
,
3522 MUIA_Text_Contents
, "N/A",
3525 Child
, MUI_MakeObject(MUIO_Label
,
3527 Child
, list
.insert_cycle
= CycleObject
,
3529 MUIA_Cycle_Entries
, list_insert_modes
,
3531 Child
, list
.insert_single_button
=
3532 MUI_MakeObject(MUIO_Button
, "Insert Single"),
3533 Child
, list
.insert_multiple_button
=
3534 MUI_MakeObject(MUIO_Button
, "Insert Multiple"),
3535 Child
, MUI_MakeObject(MUIO_Label
,
3536 "Last insertion index:", 0),
3537 Child
, list
.insert_text
= TextObject
,
3539 MUIA_Text_Contents
, "N/A",
3542 Child
, MUI_MakeObject(MUIO_Label
,
3544 Child
, list
.remove_cycle
= CycleObject
,
3546 MUIA_Cycle_Entries
, list_remove_modes
,
3548 Child
, list
.remove_button
=
3549 MUI_MakeObject(MUIO_Button
, "Remove"),
3550 Child
, list
.clear_button
=
3551 MUI_MakeObject(MUIO_Button
, "Clear"),
3552 Child
, MUI_MakeObject(MUIO_Label
,
3553 "Active index:", 0),
3554 Child
, list
.active_text
= TextObject
,
3556 MUIA_Text_Contents
, "N/A",
3559 Child
, MUI_MakeObject(MUIO_Label
,
3560 "Activate mode:", 0),
3561 Child
, list
.activate_cycle
= CycleObject
,
3563 MUIA_Cycle_Entries
, list_activate_modes
,
3565 Child
, list
.activate_button
=
3566 MUI_MakeObject(MUIO_Button
, "Activate"),
3567 Child
, list
.deactivate_button
=
3568 MUI_MakeObject(MUIO_Button
, "Deactivate"),
3569 Child
, MUI_MakeObject(MUIO_Label
,
3570 "Selected entries:", 0),
3571 Child
, list
.selected_text
= TextObject
,
3573 MUIA_Text_Contents
, "N/A",
3580 Child
, MUI_MakeObject(MUIO_Label
,
3581 "Last drop index:", 0),
3582 Child
, list
.drop_text
= TextObject
,
3584 MUIA_Text_Contents
, "N/A",
3589 Child
, ColGroup(MULTI_LIST_COUNT
),
3591 GroupFrameT("Standard Format"),
3592 Child
, list
.multi_lists
[0] =
3597 MUIA_List_ConstructHook
, &hook_construct
,
3598 MUIA_List_DestructHook
, &hook_destruct
,
3599 MUIA_List_DisplayHook
, &hook_display
,
3600 MUIA_List_Format
, list_format
,
3601 MUIA_List_SourceArray
, entries
,
3602 MUIA_List_Title
, TRUE
,
3603 MUIA_List_AdjustWidth
, TRUE
,
3605 MUIA_Listview_MultiSelect
,
3606 MUIV_Listview_MultiSelect_None
,
3607 MUIA_Listview_DefClickColumn
, 1,
3611 Child
, VGroup
, GroupFrameT("Custom Format"),
3612 Child
, list
.multi_lists
[1] =
3617 MUIA_List_Format
, list_format
,
3618 MUIA_List_Title
, TRUE
,
3619 MUIA_List_AdjustHeight
, TRUE
,
3621 MUIA_Listview_MultiSelect
,
3622 MUIV_Listview_MultiSelect_None
,
3628 Child
, RectangleObject
,
3630 MUIA_Rectangle_HBar
, TRUE
,
3631 MUIA_Rectangle_BarTitle
, "List Controls",
3634 Child
, MUI_MakeObject(
3635 MUIO_Label
, "Format:", 0),
3636 Child
, list
.format_string
= StringObject
,
3640 Child
, list
.showheadings_check
=
3641 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3642 Child
, MUI_MakeObject(MUIO_Label
,
3643 "Show column headings", 0),
3644 Child
, list
.showimage_check
=
3645 MUI_MakeObject(MUIO_Checkmark
, NULL
),
3646 Child
, MUI_MakeObject(MUIO_Label
,
3650 Child
, MUI_MakeObject(MUIO_Label
,
3651 "Default clicked column:", 0),
3652 Child
, list
.def_column_string
=
3655 MUIA_String_Accept
, (IPTR
)digits
,
3656 MUIA_String_Integer
, -1,
3659 Child
, MUI_MakeObject(MUIO_Label
,
3660 "Clicked column:", 0),
3661 Child
, list
.column_string
= StringObject
,
3664 Child
, list
.column_text
= TextObject
,
3666 MUIA_Text_Contents
, "N/A",
3675 static Object
*CreateNumericGroup()
3682 GroupFrameT("Horizontal Sliders"),
3683 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
3684 Child
, numeric
.numerics
[HNSLIDER
] = SliderObject
,
3685 MUIA_Slider_Horiz
, TRUE
,
3686 MUIA_Numeric_Min
, NUMERIC_MIN
,
3687 MUIA_Numeric_Max
, NUMERIC_MAX
,
3690 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
3691 Child
, numeric
.numerics
[HRSLIDER
] = SliderObject
,
3692 MUIA_Numeric_Reverse
, TRUE
,
3693 MUIA_Numeric_Min
, NUMERIC_MIN
,
3694 MUIA_Numeric_Max
, NUMERIC_MAX
,
3697 Child
, MUI_MakeObject(MUIO_Label
, "Quiet:", 0),
3698 Child
, numeric
.numerics
[HQSLIDER
] = SliderObject
,
3699 MUIA_Slider_Quiet
, TRUE
,
3700 MUIA_Numeric_Min
, NUMERIC_MIN
,
3701 MUIA_Numeric_Max
, NUMERIC_MAX
,
3707 GroupFrameT("Knobs"),
3709 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
3711 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
3714 Child
, numeric
.numerics
[NKNOB
] = KnobObject
,
3715 MUIA_Numeric_Min
, NUMERIC_MIN
,
3716 MUIA_Numeric_Max
, NUMERIC_MAX
,
3720 Child
, numeric
.numerics
[RKNOB
] = KnobObject
,
3721 MUIA_Numeric_Reverse
, TRUE
,
3722 MUIA_Numeric_Min
, NUMERIC_MIN
,
3723 MUIA_Numeric_Max
, NUMERIC_MAX
,
3730 Child
, MUI_MakeObject(MUIO_Label
,
3731 "Minimum Value:", 0),
3732 Child
, numeric
.min_string
= (Object
*)StringObject
,
3734 MUIA_String_Accept
, (IPTR
)digits
,
3735 MUIA_String_Integer
, NUMERIC_MIN
,
3738 Child
, MUI_MakeObject(MUIO_Label
,
3739 "Maximum Value:", 0),
3740 Child
, numeric
.max_string
= (Object
*)StringObject
,
3742 MUIA_String_Accept
, (IPTR
)digits
,
3743 MUIA_String_Integer
, NUMERIC_MAX
,
3747 Child
, numeric
.slider_button
= TextObject
,
3749 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
3751 MUIA_Background
, MUII_ButtonBack
,
3752 MUIA_Text_PreParse
, "\33c",
3753 MUIA_Text_Contents
, "Change Slider Orientations",
3757 GroupFrameT("Level Meters"),
3758 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
3759 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
3760 Child
, numeric
.numerics
[NLEVELMETER
] = LevelmeterObject
,
3761 MUIA_Numeric_Min
, NUMERIC_MIN
,
3762 MUIA_Numeric_Max
, NUMERIC_MAX
,
3765 Child
, numeric
.numerics
[RLEVELMETER
] = LevelmeterObject
,
3766 MUIA_Numeric_Reverse
, TRUE
,
3767 MUIA_Numeric_Min
, NUMERIC_MIN
,
3768 MUIA_Numeric_Max
, NUMERIC_MAX
,
3773 GroupFrameT("Numeric Buttons"),
3774 Child
, MUI_MakeObject(MUIO_Label
, "Normal:", 0),
3775 Child
, numeric
.numerics
[NNUMERICBUTTON
] =
3776 NumericbuttonObject
,
3777 MUIA_Numeric_Min
, NUMERIC_MIN
,
3778 MUIA_Numeric_Max
, NUMERIC_MAX
,
3782 Child
, MUI_MakeObject(MUIO_Label
, "Reverse:", 0),
3783 Child
, numeric
.numerics
[RNUMERICBUTTON
] =
3784 NumericbuttonObject
,
3785 MUIA_Numeric_Reverse
, TRUE
,
3786 MUIA_Numeric_Min
, NUMERIC_MIN
,
3787 MUIA_Numeric_Max
, NUMERIC_MAX
,
3798 GroupFrameT("Vertical Sliders"),
3799 Child
, MUI_MakeObject(MUIO_Label
, "Normal", 0),
3800 Child
, MUI_MakeObject(MUIO_Label
, "Reverse", 0),
3801 Child
, MUI_MakeObject(MUIO_Label
, "Quiet", 0),
3802 Child
, numeric
.numerics
[VNSLIDER
] = SliderObject
,
3803 MUIA_Slider_Horiz
, FALSE
,
3804 MUIA_Numeric_Min
, NUMERIC_MIN
,
3805 MUIA_Numeric_Max
, NUMERIC_MAX
,
3806 MUIA_Numeric_Value
, NUMERIC_INIT
,
3809 Child
, numeric
.numerics
[VRSLIDER
] = SliderObject
,
3810 MUIA_Slider_Horiz
, FALSE
,
3811 MUIA_Numeric_Reverse
, TRUE
,
3812 MUIA_Numeric_Min
, NUMERIC_MIN
,
3813 MUIA_Numeric_Max
, NUMERIC_MAX
,
3814 MUIA_Numeric_Value
, NUMERIC_INIT
,
3817 Child
, numeric
.numerics
[VQSLIDER
] = SliderObject
,
3818 MUIA_Slider_Horiz
, FALSE
,
3819 MUIA_Slider_Quiet
, TRUE
,
3820 MUIA_Numeric_Min
, NUMERIC_MIN
,
3821 MUIA_Numeric_Max
, NUMERIC_MAX
,
3822 MUIA_Numeric_Value
, NUMERIC_INIT
,
3828 GroupFrameT("Gauges"),
3829 Child
, numeric
.gauges
[HNGAUGE
] = GaugeObject
,
3831 MUIA_Gauge_Horiz
, TRUE
,
3832 MUIA_Gauge_InfoText
, StrDup("%ld/100"),
3834 Child
, numeric
.gauges
[HQGAUGE
] = GaugeObject
,
3836 MUIA_Gauge_Horiz
, TRUE
,
3841 Child
, numeric
.gauges
[VNGAUGE
] = GaugeObject
,
3843 MUIA_Gauge_Current
, NUMERIC_INIT
,
3844 MUIA_Gauge_Max
, NUMERIC_MAX
,
3845 MUIA_Gauge_InfoText
, StrDup("%ld"),
3847 Child
, numeric
.gauges
[VQGAUGE
] = GaugeObject
,
3849 MUIA_Gauge_Horiz
, FALSE
,
3850 MUIA_Gauge_Current
, NUMERIC_INIT
,
3851 MUIA_Gauge_Max
, NUMERIC_MAX
/ NUMERIC_DIV
,
3852 MUIA_Gauge_Divide
, NUMERIC_DIV
,
3862 static Object
*CreateSelectGroup()
3868 GroupFrameT("Radio"),
3869 Child
, city_radios
[0] = RadioObject
,
3870 GroupFrameT("Vertical"),
3871 MUIA_Radio_Entries
, cities
,
3872 MUIA_Radio_Active
, 1,
3874 Child
, city_radios
[1] = RadioObject
,
3875 GroupFrameT("Horizontal"),
3876 MUIA_Group_Horiz
, TRUE
,
3877 MUIA_Radio_Entries
, cities
,
3878 MUIA_Radio_Active
, 1,
3880 Child
, city_radios
[2] = RadioObject
,
3881 GroupFrameT("Grid"),
3883 MUIA_Radio_Entries
, cities
,
3884 MUIA_Radio_Active
, 1,
3889 GroupFrameT("Cycle"),
3891 Child
, MUI_MakeObject(
3892 MUIO_Label
, "Choose city:", 0),
3893 Child
, cycle
.city_cycle
= CycleObject
,
3895 MUIA_Cycle_Entries
, cities
,
3896 MUIA_Radio_Active
, 1,
3898 Child
, cycle
.prev_button
=
3899 MUI_MakeObject(MUIO_Button
, "Previous"),
3900 Child
, MUI_MakeObject(MUIO_Label
,
3902 Child
, cycle
.city_text
= TextObject
,
3904 MUIA_Text_Contents
, "N/A",
3906 Child
, cycle
.next_button
=
3907 MUI_MakeObject(MUIO_Button
, "Next"),
3916 static Object
*CreateBalancingGroup()
3921 Child
, create_balance_column(),
3922 Child
, BalanceObject
,
3925 Child
, create_balance_column(),
3926 Child
, BalanceObject
,
3929 Child
, create_balance_column(),
3930 Child
, BalanceObject
,
3933 Child
, create_balance_column(),
3934 Child
, BalanceObject
,
3937 Child
, create_balance_column(),