revert between 56095 -> 55830 in arch
[AROS.git] / developer / debug / test / Zune / test.c
blobe07a681b8e9690eecc31c628cf8f550f4858e7af
1 /*
2 Copyright © 2002-2019, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #define INTUITION_NO_INLINE_STDARG
10 #include <exec/types.h>
11 #include <stdlib.h>
12 #include <stdio.h>
13 #include <string.h>
15 #include <clib/alib_protos.h>
16 #include <intuition/gadgetclass.h>
17 #include <intuition/icclass.h>
18 #include <libraries/asl.h>
19 #include <gadgets/colorwheel.h>
20 #include <proto/exec.h>
21 #include <proto/intuition.h>
22 #include <proto/dos.h>
23 #include <proto/muimaster.h>
24 #include <proto/graphics.h>
25 #include <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
32 #if 0
33 #define TEST_ICONLIST
34 #endif
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"
40 #endif
42 #define TEXT_RAW_IMAGE_SIZE 16
43 #define STRING_COUNT 6
44 #define LIST_COUNT 5
45 #define MULTI_LIST_COUNT 2
47 #define NUMERIC_MIN 0
48 #define NUMERIC_MAX 100
49 #define NUMERIC_DIV 2
50 #define NUMERIC_INIT 30
52 static const char *pages[] =
53 {"General", "Text", "Boopsi", "Color", "Edit", "List", "Numeric", "Select",
54 #if defined(TEST_ICONLIST)
55 "Icon List",
56 #endif
57 "Balancing", NULL};
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",
87 "Pumpkin", NULL};
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[] =
93 MUIV_List_Active_Top,
94 MUIV_List_Active_Bottom,
95 MUIV_List_Active_Off,
96 MUIV_List_Active_Off,
97 MUIV_List_Active_Off
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",
109 "Safe Loop", NULL};
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();
126 enum
128 HNSLIDER,
129 HRSLIDER,
130 HQSLIDER,
131 VNSLIDER,
132 VRSLIDER,
133 VQSLIDER,
134 NNUMERICBUTTON,
135 RNUMERICBUTTON,
136 NKNOB,
137 RKNOB,
138 NLEVELMETER,
139 RLEVELMETER,
140 NUMERIC_COUNT
143 enum
145 HNGAUGE,
146 HQGAUGE,
147 VNGAUGE,
148 VQGAUGE,
149 GAUGE_COUNT
152 struct Library *MUIMasterBase;
153 struct Library *ColorWheelBase;
155 struct list_entry
157 char *column1;
158 char *column2;
161 Object *app, *wnd;
163 static struct
165 Object *open_button,
166 *menus_check;
168 general;
170 static struct
172 Object *window,
173 *title_string,
174 *screen_string,
175 *left_cycle,
176 *left_index_string,
177 *width_cycle,
178 *width_index_string,
179 *top_cycle,
180 *top_index_string,
181 *height_cycle,
182 *height_index_string,
183 *alt_left_cycle,
184 *alt_left_index_string,
185 *alt_width_cycle,
186 *alt_width_index_string,
187 *alt_top_cycle,
188 *alt_top_index_string,
189 *alt_height_cycle,
190 *alt_height_index_string,
191 *appwindow_check,
192 *backdrop_check,
193 *borderless_check,
194 *close_check,
195 *depth_check,
196 *ref_check,
197 *dragbar_check,
198 *size_check,
199 *activate_check,
200 *id_check,
201 *menu_cycle,
202 *open_button,
203 *close_button,
204 *apply_button,
205 *close_item,
206 *left_text,
207 *top_text,
208 *width_text,
209 *height_text,
210 *alt_left_text,
211 *alt_top_text,
212 *alt_width_text,
213 *alt_height_text;
215 window;
217 static struct
219 STRPTR image_text;
221 text;
223 static struct
225 Object *strings[STRING_COUNT],
226 *accept_string,
227 *reject_string,
228 *cursor_pos_slider,
229 *display_pos_slider,
230 *integer_string,
231 *plaintext_string,
232 *max_len_text,
233 *cr_advance_check,
234 *attach_list_check,
235 *standard_hook_check,
236 *custom_hook_check,
237 *accept_all_check;
239 string;
241 static struct
243 Object *lists[LIST_COUNT],
244 *list_radios,
245 *index1_string,
246 *index2_string,
247 *title_string,
248 *move1_cycle,
249 *move2_cycle,
250 *jump_cycle,
251 *select_cycle,
252 *insert_cycle,
253 *remove_cycle,
254 *activate_cycle,
255 *sort_button,
256 *clear_button,
257 *enable_button,
258 *reset_button,
259 *select_button,
260 *deselect_button,
261 *toggle_button,
262 *move_button,
263 *exchange_button,
264 *jump_button,
265 *redraw_button,
266 *insert_single_button,
267 *insert_multiple_button,
268 *remove_button,
269 *activate_button,
270 *deactivate_button,
271 *draggable_check,
272 *showdropmarks_check,
273 *multitest_check,
274 *quiet_check,
275 *dragsortable_check,
276 *autovisible_check,
277 *entries_text,
278 *visible_text,
279 *first_text,
280 *insert_text,
281 *active_text,
282 *drop_text,
283 *selected_text,
284 *multi_lists[MULTI_LIST_COUNT],
285 *colorfield,
286 *format_string,
287 *column_string,
288 *column_text,
289 *def_column_string,
290 *showheadings_check,
291 *showimage_check;
292 LONG quiet[LIST_COUNT],
293 destruct_count,
294 has_multitest[LIST_COUNT];
295 IPTR image;
297 list;
299 static struct
301 Object *numerics[NUMERIC_COUNT],
302 *gauges[GAUGE_COUNT],
303 *min_string,
304 *max_string,
305 *slider_button;
307 numeric;
309 static struct
311 Object *city_cycle,
312 *prev_button,
313 *next_button,
314 *city_text;
316 cycle;
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,
328 *colorfield_pen;
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;
349 #endif
351 AROS_UFH0(void, repeat_function)
353 AROS_USERFUNC_INIT
355 printf("MUI_Timer\n");
357 AROS_USERFUNC_EXIT
360 AROS_UFH0(void, wheel_function)
362 AROS_USERFUNC_INIT
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);
371 AROS_USERFUNC_EXIT
374 AROS_UFH0(void, slider_function)
376 AROS_USERFUNC_INIT
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));
390 AROS_USERFUNC_EXIT
393 AROS_UFH0(void, objects_function)
395 AROS_USERFUNC_INIT
397 Object *new_obj = MUI_MakeObject(MUIO_Button, "Button");
398 if (new_obj)
400 DoMethod(group, MUIM_Group_InitChange);
401 DoMethod(group, OM_ADDMEMBER, new_obj);
402 DoMethod(group, MUIM_Group_ExitChange);
405 AROS_USERFUNC_EXIT
408 static void About(void)
410 static Object *about_wnd;
412 if (!about_wnd)
414 about_wnd = AboutmuiObject, MUIA_Aboutmui_Application, app, End;
417 if (about_wnd)
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,
424 LONG *alt_height)
426 LONG mode;
428 /* Get left edge */
429 mode = XGET(window.left_cycle, MUIA_Cycle_Active);
430 if (mode == 0)
431 *left = XGET(window.left_index_string, MUIA_String_Integer);
432 else
433 *left = 0 - mode;
435 /* Get top edge */
436 mode = XGET(window.top_cycle, MUIA_Cycle_Active);
437 if (mode == 0)
438 *top = XGET(window.top_index_string, MUIA_String_Integer);
439 else if (mode == 3)
440 *top = MUIV_Window_TopEdge_Delta(
441 XGET(window.top_index_string, MUIA_String_Integer));
442 else
443 *top = 0 - mode;
445 /* Get width */
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)
449 *width = 100;
450 switch (mode)
452 case 0:
453 *width = MUIV_Window_Width_Default;
454 break;
455 case 2:
456 *width = MUIV_Window_Width_MinMax(*width);
457 break;
458 case 3:
459 *width = MUIV_Window_Width_Screen(*width);
460 break;
461 case 4:
462 *width = MUIV_Window_Width_Visible(*width);
463 break;
464 case 5:
465 *width = MUIV_Window_Width_Scaled;
466 break;
469 /* Get height */
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)
473 *height = 100;
474 switch (mode)
476 case 0:
477 *height = MUIV_Window_Height_Default;
478 break;
479 case 2:
480 *height = MUIV_Window_Height_MinMax(*height);
481 break;
482 case 3:
483 *height = MUIV_Window_Height_Screen(*height);
484 break;
485 case 4:
486 *height = MUIV_Window_Height_Visible(*height);
487 break;
488 case 5:
489 *height = MUIV_Window_Height_Scaled;
492 /* Get alternative left edge */
493 mode = XGET(window.alt_left_cycle, MUIA_Cycle_Active);
494 if (mode == 0)
495 *alt_left = MUIV_Window_AltLeftEdge_NoChange;
496 else if (mode == 1)
497 *alt_left = XGET(window.alt_left_index_string, MUIA_String_Integer);
498 else
499 *alt_left = 1 - mode;
501 /* Get alternative top edge */
502 mode = XGET(window.alt_top_cycle, MUIA_Cycle_Active);
503 if (mode == 0)
504 *alt_top = MUIV_Window_AltTopEdge_NoChange;
505 else if (mode == 1)
506 *alt_top = XGET(window.alt_top_index_string, MUIA_String_Integer);
507 else if (mode == 3)
508 *alt_top = MUIV_Window_AltTopEdge_Delta(
509 XGET(window.alt_top_index_string, MUIA_String_Integer));
510 else
511 *alt_top = 1 - mode;
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)
517 *alt_width = 100;
518 switch (mode)
520 case 1:
521 *alt_width = MUIV_Window_AltWidth_MinMax(*alt_width);
522 break;
523 case 2:
524 *alt_width = MUIV_Window_AltWidth_Screen(*alt_width);
525 break;
526 case 3:
527 *alt_width = MUIV_Window_AltWidth_Visible(*alt_width);
528 break;
529 case 4:
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)
537 *alt_height = 100;
538 switch (mode)
540 case 1:
541 *alt_height = MUIV_Window_AltHeight_MinMax(*alt_height);
542 break;
543 case 2:
544 *alt_height = MUIV_Window_AltHeight_Screen(*alt_height);
545 break;
546 case 3:
547 *alt_height = MUIV_Window_AltHeight_Visible(*alt_height);
548 break;
549 case 4:
550 *alt_height = MUIV_Window_AltHeight_Scaled;
554 /* Refresh the current position and dimension information shown in the test
555 window */
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);
581 WindowUpdate();
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,
603 alt_height;
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')
611 title = NULL;
612 else
613 title = StrDup(title);
615 GET(window.screen_string, MUIA_String_Contents, &screen_title);
616 if (screen_title[0] == '\0')
617 screen_title = NULL;
618 else
619 screen_title = StrDup(screen_title);
621 GetWindowDimensions(&left, &top, &width, &height, &alt_left, &alt_top,
622 &alt_width, &alt_height);
624 /* Create menus */
625 window.close_item = NULL;
626 mode = XGET(window.menu_cycle, MUIA_Cycle_Active);
627 if (mode == 1)
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,
634 End,
635 End;
637 else if (mode == 2)
638 no_menus = TRUE;
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,
664 MUIA_Window_DragBar,
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,
673 Child, ColGroup(4),
674 GroupFrameT("Current dimensions"),
675 Child, MUI_MakeObject(MUIO_Label, "Left Edge:", 0),
676 Child, window.left_text = TextObject,
677 TextFrame,
678 MUIA_Text_Contents, "N/A",
679 End,
680 Child, MUI_MakeObject(MUIO_Label, "Width:", 0),
681 Child, window.width_text = TextObject,
682 TextFrame,
683 MUIA_Text_Contents, "N/A",
684 End,
685 Child, MUI_MakeObject(MUIO_Label, "Top Edge:", 0),
686 Child, window.top_text = TextObject,
687 TextFrame,
688 MUIA_Text_Contents, "N/A",
689 End,
690 Child, MUI_MakeObject(MUIO_Label, "Height:", 0),
691 Child, window.height_text = TextObject,
692 TextFrame,
693 MUIA_Text_Contents, "N/A",
694 End,
695 End,
696 Child, ColGroup(4),
697 GroupFrameT("Alternative dimensions"),
698 Child, MUI_MakeObject(MUIO_Label, "Left Edge:", 0),
699 Child, window.alt_left_text = TextObject,
700 TextFrame,
701 MUIA_Text_Contents, "N/A",
702 End,
703 Child, MUI_MakeObject(MUIO_Label, "Width:", 0),
704 Child, window.alt_width_text = TextObject,
705 TextFrame,
706 MUIA_Text_Contents, "N/A",
707 End,
708 Child, MUI_MakeObject(MUIO_Label, "Top Edge:", 0),
709 Child, window.alt_top_text = TextObject,
710 TextFrame,
711 MUIA_Text_Contents, "N/A",
712 End,
713 Child, MUI_MakeObject(MUIO_Label, "Height:", 0),
714 Child, window.alt_height_text = TextObject,
715 TextFrame,
716 MUIA_Text_Contents, "N/A",
717 End,
718 End,
719 Child, HVSpace,
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"),
726 End,
727 End;
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,
739 WindowClose);
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 */
776 WindowUpdate();
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);
787 if (title != NULL)
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,
798 alt_height;
799 STRPTR title = (APTR)~0;
801 /* Update window and screen titles */
802 GET(window.window, MUIA_Window_Title, &title);
803 FreeVec(title);
804 GET(window.title_string, MUIA_String_Contents, &title);
805 if (title[0] == '\0')
806 title = NULL;
807 else
808 title = StrDup(title);
809 SET(window.window, MUIA_Window_Title, title);
811 GET(window.window, MUIA_Window_ScreenTitle, &title);
812 FreeVec(title);
813 GET(window.screen_string, MUIA_String_Contents, &title);
814 if (title[0] == '\0')
815 title = NULL;
816 else
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))
839 AROS_USERFUNC_INIT
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;
848 NextObject(&child);
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);
855 AROS_USERFUNC_EXIT
858 static void ChangeStringAccept(void)
860 STRPTR accept_chars = NULL, reject_chars = NULL;
861 BOOL accept_all;
862 UWORD i;
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);
868 if (!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)
883 SIPTR pen = -1;
885 GET(colorfield_pen, MUIA_String_Integer, &pen);
886 if (pen >= 0)
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))
901 AROS_USERFUNC_INIT
903 IPTR len1, len2;
905 len1 = strlen(str1);
906 len2 = strlen(str2);
908 /* Indicate which string is shorter */
909 return len2 - len1;
911 AROS_USERFUNC_EXIT
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))
919 AROS_USERFUNC_INIT
921 /* Indicate whether the string doesn't begin with a vowel */
922 return strchr(vowels, tolower(str[0])) == NULL;
924 AROS_USERFUNC_EXIT
927 static void ChangeListTitle(void)
929 STRPTR title = NULL;
930 UWORD i;
932 i = XGET(list.list_radios, MUIA_Radio_Active);
934 GET(list.lists[i], MUIA_List_Title, &title);
935 FreeVec(title);
937 GET(list.title_string, MUIA_String_Contents, &title);
938 if (title[0] == '\0')
939 title = NULL;
941 title = StrDup(title);
943 SET(list.lists[i], MUIA_List_Title, title);
946 static void UpdateListInfo(void)
948 STRPTR title = NULL;
949 UWORD i;
950 LONG value = 0;
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)
960 value = FALSE;
961 else
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,
978 "%ld", value);
979 GET(list.lists[i], MUIA_List_Visible, &value);
980 DoMethod(list.visible_text, MUIM_SetAsString, MUIA_Text_Contents,
981 "%ld", value);
982 GET(list.lists[i], MUIA_List_First, &value);
983 DoMethod(list.first_text, MUIM_SetAsString, MUIA_Text_Contents,
984 "%ld", value);
985 GET(list.lists[i], MUIA_List_InsertPosition, &value);
986 DoMethod(list.insert_text, MUIM_SetAsString, MUIA_Text_Contents,
987 "%ld", value);
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");
991 else
992 DoMethod(list.active_text, MUIM_SetAsString, MUIA_Text_Contents,
993 "%ld", value);
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,
997 "%ld", value);
998 GET(list.lists[i], MUIA_List_DropMark, &value);
999 DoMethod(list.drop_text, MUIM_SetAsString, MUIA_Text_Contents,
1000 "%ld", value);
1003 static void ListGetVisible(void)
1005 UWORD i;
1006 LONG value = 0;
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,
1012 "%ld", value);
1015 static void ListGetFirst(void)
1017 UWORD i;
1018 LONG value = 0;
1019 Object *real_list;
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,
1028 "%ld", value);
1031 static void ListGetSelected(void)
1033 UWORD i;
1034 LONG value = 0;
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,
1041 "%ld", value);
1044 static void ListSetDraggable(void)
1046 UWORD i;
1047 LONG value = 0;
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)
1058 UWORD i;
1059 LONG value = 0;
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)
1069 UWORD i;
1070 LONG value = 0;
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)
1081 UWORD i;
1082 LONG value = 0;
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)
1093 UWORD i;
1094 LONG value = 0;
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)
1104 UWORD i;
1105 LONG value = 0;
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)
1115 UWORD i;
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;
1125 UWORD i;
1127 i = XGET(list.list_radios, MUIA_Radio_Active);
1129 mode = XGET(list.move1_cycle, MUIA_Cycle_Active);
1131 if (mode == 0)
1132 pos1 = XGET(list.index1_string, MUIA_String_Integer);
1133 else
1134 pos1 = 1 - mode;
1136 mode = XGET(list.move2_cycle, MUIA_Cycle_Active);
1138 if (mode == 0)
1139 pos2 = XGET(list.index2_string, MUIA_String_Integer);
1140 else
1141 pos2 = 1 - mode;
1143 DoMethod(list.lists[i], MUIM_List_Move, pos1, pos2);
1146 static void ListSort(void)
1148 UWORD i;
1150 i = XGET(list.list_radios, MUIA_Radio_Active);
1152 DoMethod(list.lists[i], MUIM_List_Sort);
1155 static void ListEnable(void)
1157 UWORD i;
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;
1167 UWORD i;
1169 i = XGET(list.list_radios, MUIA_Radio_Active);
1171 mode = XGET(list.move1_cycle, MUIA_Cycle_Active);
1173 if (mode == 0)
1174 pos1 = XGET(list.index1_string, MUIA_String_Integer);
1175 else
1176 pos1 = 1 - mode;
1178 mode = XGET(list.move2_cycle, MUIA_Cycle_Active);
1180 if (mode == 0)
1181 pos2 = XGET(list.index2_string, MUIA_String_Integer);
1182 else
1183 pos2 = 1 - mode;
1185 DoMethod(list.lists[i], MUIM_List_Exchange, pos1, pos2);
1188 static void ListJump(void)
1190 LONG mode, pos;
1191 UWORD i;
1193 i = XGET(list.list_radios, MUIA_Radio_Active);
1195 mode = XGET(list.jump_cycle, MUIA_Cycle_Active);
1197 if (mode == 0)
1198 pos = XGET(list.index1_string, MUIA_String_Integer);
1199 else
1200 pos = 1 - mode;
1202 DoMethod(list.lists[i], MUIM_List_Jump, pos);
1205 static void ListSelect(void)
1207 LONG mode, pos;
1208 UWORD i;
1210 i = XGET(list.list_radios, MUIA_Radio_Active);
1212 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
1214 if (mode == 0)
1215 pos = XGET(list.index1_string, MUIA_String_Integer);
1216 else
1217 pos = 0 - mode;
1219 DoMethod(list.lists[i], MUIM_List_Select, pos, MUIV_List_Select_On,
1220 NULL);
1223 static void ListDeselect(void)
1225 LONG mode, pos;
1226 UWORD i;
1228 i = XGET(list.list_radios, MUIA_Radio_Active);
1230 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
1232 if (mode == 0)
1233 pos = XGET(list.index1_string, MUIA_String_Integer);
1234 else
1235 pos = 0 - mode;
1237 DoMethod(list.lists[i], MUIM_List_Select, pos, MUIV_List_Select_Off,
1238 NULL);
1241 static void ListToggle(void)
1243 LONG mode, pos;
1244 UWORD i;
1246 i = XGET(list.list_radios, MUIA_Radio_Active);
1248 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
1250 if (mode == 0)
1251 pos = XGET(list.index1_string, MUIA_String_Integer);
1252 else
1253 pos = 0 - mode;
1255 DoMethod(list.lists[i], MUIM_List_Select, pos,
1256 MUIV_List_Select_Toggle, NULL);
1259 static void ListRedraw(void)
1261 LONG mode, pos;
1262 UWORD i;
1264 i = XGET(list.list_radios, MUIA_Radio_Active);
1266 mode = XGET(list.select_cycle, MUIA_Cycle_Active);
1268 if (mode == 0)
1269 pos = XGET(list.index1_string, MUIA_String_Integer);
1270 else
1271 pos = 0 - mode;
1273 DoMethod(list.lists[i], MUIM_List_Redraw, pos);
1276 static void ListInsertSingle(void)
1278 LONG mode, pos;
1279 UWORD i;
1281 i = XGET(list.list_radios, MUIA_Radio_Active);
1283 mode = XGET(list.insert_cycle, MUIA_Cycle_Active);
1285 if (mode == 0)
1286 pos = XGET(list.index1_string, MUIA_String_Integer);
1287 else
1288 pos = 1 - mode;
1290 DoMethod(list.lists[i], MUIM_List_InsertSingle, "Tomato", pos);
1293 static void ListInsert(void)
1295 LONG mode, pos;
1296 UWORD i;
1298 i = XGET(list.list_radios, MUIA_Radio_Active);
1300 mode = XGET(list.insert_cycle, MUIA_Cycle_Active);
1302 if (mode == 0)
1303 pos = XGET(list.index1_string, MUIA_String_Integer);
1304 else
1305 pos = 1 - mode;
1307 DoMethod(list.lists[i], MUIM_List_Insert, fruits, -1, pos);
1310 static void ListRemove(void)
1312 LONG mode, pos, count, j, *selections;
1313 UWORD i;
1315 i = XGET(list.list_radios, MUIA_Radio_Active);
1317 mode = XGET(list.remove_cycle, MUIA_Cycle_Active);
1319 if (mode == 5)
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)
1327 pos++;
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);
1333 else if (mode == 6)
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);
1339 if (count == 0)
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 */
1353 while (count > 0)
1354 DoMethod(list.lists[i], MUIM_List_Remove, selections[--count]);
1355 FreeVec(selections);
1358 else
1360 if (mode == 0)
1361 pos = XGET(list.index1_string, MUIA_String_Integer);
1362 else
1363 pos = 1 - mode;
1364 DoMethod(list.lists[i], MUIM_List_Remove, pos);
1368 static void ListClear(void)
1370 UWORD i;
1372 i = XGET(list.list_radios, MUIA_Radio_Active);
1374 DoMethod(list.lists[i], MUIM_List_Clear);
1377 static void ListActivate(void)
1379 LONG mode, pos;
1380 UWORD i;
1382 i = XGET(list.list_radios, MUIA_Radio_Active);
1384 mode = XGET(list.activate_cycle, MUIA_Cycle_Active);
1386 if (mode == 0)
1387 pos = XGET(list.index1_string, MUIA_String_Integer);
1388 else
1389 pos = -1 - mode;
1391 SET(list.lists[i], MUIA_List_Active, pos);
1394 static void ListDeactivate(void)
1396 UWORD i;
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)
1405 LONG value = -1;
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))
1417 AROS_USERFUNC_INIT
1419 struct list_entry *entry;
1421 entry = AllocPooled(pool, sizeof(struct list_entry) + 40);
1423 if (entry != NULL)
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);
1431 return entry;
1433 AROS_USERFUNC_EXIT
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))
1441 AROS_USERFUNC_INIT
1443 FreePooled(pool, entry, sizeof(struct list_entry) + 40);
1444 list.destruct_count++;
1446 AROS_USERFUNC_EXIT
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))
1454 AROS_USERFUNC_INIT
1456 static char buf[100];
1458 if (entry)
1460 if (XGET(list.showimage_check, MUIA_Selected))
1461 sprintf(buf, "%ld \33O[%08lx]", (long)*(strings - 1),
1462 (long)list.image);
1463 else
1464 sprintf(buf, "%ld", (long)*(strings - 1));
1465 strings[0] = buf;
1466 strings[1] = entry->column1;
1467 strings[2] = entry->column2;
1469 else
1471 strings[0] = "Number";
1472 strings[1] = "Column 1";
1473 strings[2] = "Column 2";
1476 AROS_USERFUNC_EXIT
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);
1483 BPTR fh;
1485 if (!strlen(filename))
1486 return;
1488 if ((fh = Open(filename, MODE_NEWFILE)))
1490 Write(fh, text, strlen(text));
1491 Close(fh);
1495 /* Update numeric minimums */
1496 static void NumericSetMin(void)
1498 UWORD min, i;
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)
1510 UWORD max, div, i;
1511 TEXT info_text[10];
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)
1531 UWORD i;
1533 i = XGET(numeric.gauges[HNGAUGE], MUIA_Gauge_Current);
1534 SET(numeric.gauges[HQGAUGE], MUIA_Gauge_Current, i);
1537 static void SliderCopyValue(void)
1539 UWORD i;
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)
1549 UWORD i;
1551 i = XGET(city_radios[1], MUIA_Radio_Active);
1552 nnset(city_radios[2], MUIA_Radio_Active, i);
1555 static void CycleCopyActive(void)
1557 UWORD i;
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)
1567 char buf[200];
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)
1573 return;
1575 strcpy(buf, ent->label);
1576 strcat(buf, ":");
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)
1586 return;
1587 set(drawer_iconlist, MUIA_IconDrawerList_Drawer,
1588 ent->ile_IconEntry->ie_IconNode.ln_Name);
1590 #endif
1592 static IPTR create_balance_column(void)
1594 return (IPTR) VGroup,
1595 Child, RectangleObject,
1596 GaugeFrame,
1597 End,
1598 Child, BalanceObject,
1599 End,
1600 Child, RectangleObject,
1601 GaugeFrame,
1602 End,
1603 Child, BalanceObject,
1604 End,
1605 Child, RectangleObject,
1606 GaugeFrame,
1607 End,
1608 Child, BalanceObject,
1609 End,
1610 Child, RectangleObject,
1611 GaugeFrame,
1612 End,
1613 Child, BalanceObject,
1614 End,
1615 Child, RectangleObject,
1616 GaugeFrame,
1617 End,
1618 End;
1621 /* The custom class */
1623 struct DropText_Data
1625 ULONG times;
1628 #ifdef __MAXON__
1629 #undef KeymapBase
1630 struct Library *KeymapBase;
1631 #endif
1633 #ifndef __AROS__
1634 __saveds __asm IPTR dispatcher(register __a0 struct IClass *cl,
1635 register __a2 Object *obj, register __a1 Msg msg)
1636 #else
1637 AROS_UFH3S(IPTR, dispatcher,
1638 AROS_UFHA(Class *, cl, A0),
1639 AROS_UFHA(Object *, obj, A2), AROS_UFHA(Msg, msg, A1))
1640 #endif
1642 AROS_USERFUNC_INIT
1644 switch (msg->MethodID)
1646 case MUIM_DragQuery:
1647 return MUIV_DragQuery_Accept;
1648 case MUIM_DragDrop:
1650 struct DropText_Data *data =
1651 (struct DropText_Data *)INST_DATA(cl, obj);
1652 char buf[100];
1653 data->times++;
1654 sprintf(buf, "%ld times", (long)data->times);
1655 set(obj, MUIA_Text_Contents, buf);
1659 return DoSuperMethodA(cl, obj, (Msg) msg);
1661 AROS_USERFUNC_EXIT
1664 static struct MUI_CustomClass *CL_DropText;
1666 #define DropTextObject BOOPSIOBJMACRO_START(CL_DropText->mcc_Class)
1668 /* Custom Window subclass */
1670 struct TestWindowData
1672 ULONG x;
1675 IPTR TestWindow__OM_SET(struct IClass *cl, Object *obj,
1676 struct opSet *msg)
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:
1686 if (tag->ti_Data)
1687 SET(obj, MUIA_Window_ActiveObject, general.open_button);
1688 break;
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))
1700 AROS_USERFUNC_INIT
1702 switch (msg->MethodID)
1704 case OM_SET:
1705 return TestWindow__OM_SET(cl, obj, (struct opSet *)msg);
1706 default:
1707 return DoSuperMethodA(cl, obj, (Msg) msg);
1710 AROS_USERFUNC_EXIT
1713 static struct MUI_CustomClass *test_window_class;
1715 #define TestWindowObject BOOPSIOBJMACRO_START(test_window_class->mcc_Class)
1717 /* Main prog */
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))
1723 AROS_USERFUNC_INIT
1725 void (*func) (ULONG *) = (void (*)(ULONG *))(*funcptr);
1727 if (func)
1728 func((ULONG *) funcptr + 1);
1730 AROS_USERFUNC_EXIT
1733 int main(void)
1735 LONG result = RETURN_OK;
1736 APTR pool;
1737 Object *second_wnd;
1738 Object *about_button;
1739 Object *quit_button;
1740 Object *about_item, *quit_item;
1741 STRPTR title;
1742 UWORD i;
1743 LONG value = 0;
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,
1771 End,
1772 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,
1785 MUIA_Listview_List,
1786 ListObject,
1787 InputListFrame,
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,
1794 MUIA_ShortHelp,
1795 "Default scroller\nTop entry active\nSorted by length",
1796 End,
1797 MUIA_Listview_MultiSelect,
1798 MUIV_Listview_MultiSelect_None,
1799 MUIA_Listview_DragType, MUIV_Listview_DragType_Immediate,
1800 MUIA_Listview_DoubleClick, TRUE,
1801 MUIA_CycleChain, 1,
1802 End;
1803 list.lists[1] = ListviewObject,
1804 MUIA_Listview_List,
1805 ListObject,
1806 InputListFrame,
1807 MUIA_List_SourceArray, fruits,
1808 MUIA_List_Active, MUIV_List_Active_Bottom,
1809 MUIA_List_PoolPuddleSize, 512,
1810 MUIA_List_AutoVisible, TRUE,
1811 MUIA_ShortHelp,
1812 "Left scroller\nBottom entry active\nSorted alphabetically",
1813 End,
1814 MUIA_Listview_ScrollerPos,
1815 MUIV_Listview_ScrollerPos_Left,
1816 MUIA_Listview_DragType, MUIV_Listview_DragType_None,
1817 MUIA_CycleChain, 1,
1818 End;
1819 list.lists[2] = ListviewObject,
1820 MUIA_Listview_List,
1821 ListObject,
1822 InputListFrame,
1823 MUIA_List_SourceArray, fruits,
1824 MUIA_List_Active, MUIV_List_Active_Off,
1825 MUIA_List_Pool, pool,
1826 MUIA_ShortHelp,
1827 "Right scroller\nNo active entry\nSorted alphabetically",
1828 End,
1829 MUIA_Listview_MultiSelect,
1830 MUIV_Listview_MultiSelect_Shifted,
1831 MUIA_Listview_ScrollerPos,
1832 MUIV_Listview_ScrollerPos_Right,
1833 MUIA_CycleChain, 1,
1834 End;
1835 list.lists[3] = ListviewObject,
1836 MUIA_Listview_List,
1837 ListObject,
1838 InputListFrame,
1839 MUIA_List_SourceArray, fruits,
1840 MUIA_List_Pool, NULL,
1841 MUIA_List_MultiTestHook, &hook_multitest,
1842 MUIA_ShortHelp,
1843 "No scroller\nDefault active entry\nSorted alphabetically",
1844 End,
1845 MUIA_Listview_MultiSelect,
1846 MUIV_Listview_MultiSelect_Always,
1847 MUIA_Listview_ScrollerPos,
1848 MUIV_Listview_ScrollerPos_None,
1849 MUIA_CycleChain, 1,
1850 End;
1851 list.lists[4] = ListviewObject,
1852 MUIA_Listview_List,
1853 ListObject,
1854 ReadListFrame,
1855 MUIA_List_SourceArray, fruits,
1856 MUIA_List_Active, MUIV_List_Active_Bottom,
1857 MUIA_List_MinLineHeight, 20,
1858 MUIA_ShortHelp,
1859 "Default scroller\nBottom entry active\nSorted by length",
1860 End,
1861 MUIA_Listview_Input, FALSE,
1862 MUIA_CycleChain, 1,
1863 End;
1865 list.colorfield = ColorfieldObject,
1866 MUIA_Colorfield_RGB, default_color,
1867 End;
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, "?",
1881 End,
1882 MUIA_Family_Child, MenuitemObject,
1883 MUIA_Menuitem_Title, (SIPTR)-1,
1884 End,
1885 MUIA_Family_Child, quit_item = MenuitemObject,
1886 MUIA_Menuitem_Title, "Quit",
1887 MUIA_Menuitem_Shortcut, "Q",
1888 End,
1889 End,
1890 End,
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)
1909 /* iconlist */
1910 Child, HGroup,
1911 Child, volume_iconlist =
1912 MUI_NewObject(MUIC_IconVolumeList, GroupFrame,
1913 TAG_DONE),
1914 Child, drawer_iconlist =
1915 MUI_NewObject(MUIC_IconDrawerList, GroupFrame,
1916 MUIA_IconDrawerList_Drawer, "SYS:",
1917 TAG_DONE),
1918 End,
1919 #endif
1920 Child, CreateBalancingGroup(),
1922 End,
1924 Child, HGroup,
1925 Child, about_button = TextObject,
1926 ButtonFrame,
1927 MUIA_InputMode, MUIV_InputMode_RelVerify,
1928 MUIA_CycleChain, 1,
1929 MUIA_Background, MUII_ButtonBack,
1930 MUIA_Text_PreParse, "\33c",
1931 MUIA_Text_Contents, "About",
1932 End,
1933 Child, quit_button = TextObject,
1934 ButtonFrame,
1935 MUIA_InputMode, MUIV_InputMode_RelVerify,
1936 MUIA_CycleChain, 1,
1937 MUIA_Background, MUII_ButtonBack,
1938 MUIA_ControlChar, 'q',
1939 MUIA_Text_HiChar, 'q',
1940 MUIA_Text_PreParse, "\33c",
1941 MUIA_Text_Contents, "Quit",
1942 End,
1943 End,
1944 End,
1945 End,
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,
1953 End,
1954 End,
1955 End,
1957 End;
1959 if (app == NULL)
1960 result = RETURN_FAIL;
1963 if (result == RETURN_OK)
1965 ULONG sigs = 0;
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++)
2028 if (i == 0)
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);
2049 else
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,
2057 MUIV_TriggerValue);
2058 DoMethod(string.strings[0], MUIM_Notify,
2059 MUIA_String_BufferPos, MUIV_EveryTime,
2060 string.strings[i], 3, MUIM_Set, MUIA_String_BufferPos,
2061 MUIV_TriggerValue);
2062 DoMethod(string.strings[0], MUIM_Notify,
2063 MUIA_String_DisplayPos, MUIV_EveryTime,
2064 string.strings[i], 3, MUIM_Set, MUIA_String_DisplayPos,
2065 MUIV_TriggerValue);
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,
2110 About);
2112 /* Notifications for color objects */
2113 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Red,
2114 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Red,
2115 MUIV_TriggerValue);
2116 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Green,
2117 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Green,
2118 MUIV_TriggerValue);
2119 DoMethod(colorfield, MUIM_Notify, MUIA_Colorfield_Blue,
2120 MUIV_EveryTime, colorfield2, 3, MUIM_Set, MUIA_Colorfield_Blue,
2121 MUIV_TriggerValue);
2122 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Red,
2123 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Red,
2124 MUIV_TriggerValue);
2125 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Green,
2126 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Green,
2127 MUIV_TriggerValue);
2128 DoMethod(coloradjust, MUIM_Notify, MUIA_Coloradjust_Blue,
2129 MUIV_EveryTime, colorfield, 3, MUIM_Set, MUIA_Colorfield_Blue,
2130 MUIV_TriggerValue);
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,
2136 ChangePen);
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,
2155 MUIV_TriggerValue);
2156 DoMethod(pendisplay_spec, MUIM_Notify, MUIA_String_Contents,
2157 MUIV_EveryTime, pendisplay, 3, MUIM_Set, MUIA_Pendisplay_Spec,
2158 MUIV_TriggerValue);
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);
2172 UpdateListInfo();
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,
2177 TRUE);
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,
2183 ListGetVisible);
2184 DoMethod(list.lists[i], MUIM_Notify, MUIA_List_First,
2185 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2186 ListGetFirst);
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,
2192 UpdateListInfo);
2193 DoMethod(list.lists[i], MUIM_Notify, MUIA_Listview_SelectChange,
2194 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2195 ListGetSelected);
2197 DoMethod(list.draggable_check, MUIM_Notify, MUIA_Selected,
2198 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2199 ListSetDraggable);
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,
2211 ListSetMultiTest);
2212 DoMethod(list.quiet_check, MUIM_Notify, MUIA_Selected,
2213 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2214 ListSetQuiet);
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,
2255 ChangeListTitle);
2256 DoMethod(list.list_radios, MUIM_Notify, MUIA_Radio_Active,
2257 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2258 UpdateListInfo);
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,
2289 MUIV_TriggerValue);
2291 DoMethod(list.column_string, MUIM_Notify, MUIA_String_Contents,
2292 MUIV_EveryTime, list.column_text, 3, MUIM_Set, MUIA_Text_Contents,
2293 MUIV_TriggerValue);
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);
2306 /* numeric */
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,
2312 NumericSetMin);
2313 DoMethod(numeric.max_string, MUIM_Notify, MUIA_String_Acknowledge,
2314 MUIV_EveryTime, app, 3, MUIM_CallHook, &hook_standard,
2315 NumericSetMax);
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,
2341 SliderCopyValue);
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,
2357 GaugeCopyCurrent);
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,
2368 SliderCopyValue);
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);
2386 /* radio */
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,
2395 RadioCopyActive);
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);
2400 /* cycle */
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,
2412 CycleCopyActive);
2414 #if defined(TEST_ICONLIST)
2415 /* 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);
2422 #endif
2424 /* pre-display automatic tests */
2425 get(list.lists[0], MUIA_List_Visible, &value);
2426 if (value != -1)
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);
2430 if (value != 0)
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);
2434 if (value != 0)
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);
2444 if (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));
2455 char pen_str[10];
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);
2462 pen_str[9] = '0';
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)
2469 if (sigs)
2471 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
2472 if (sigs & SIGBREAKF_CTRL_C)
2473 break;
2474 if (sigs & SIGBREAKF_CTRL_D)
2475 break;
2479 /* clean up */
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);
2486 FreeVec(title);
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);
2495 FreeVec(title);
2498 MUI_DisposeObject(app);
2500 if (context_menu)
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);
2514 DeletePool(pool);
2516 return result;
2519 static Object *CreateGeneralGroup()
2521 Object *group;
2523 group = RegisterGroup(general_pages),
2525 /* group */
2526 Child, VGroup,
2527 Child, HGroup,
2528 GroupFrameT("A horizontal group"),
2529 Child, ColGroup(2),
2530 GroupFrameT("A column group"),
2531 Child, repeat_button = TextObject,
2532 MUIA_CycleChain, 1,
2533 ButtonFrame,
2534 MUIA_Background, MUII_ButtonBack,
2535 MUIA_Text_PreParse, "\33c",
2536 MUIA_Text_Contents, "Repeat",
2537 MUIA_InputMode, MUIV_InputMode_RelVerify,
2538 End,
2539 Child, TextObject,
2540 MUIA_CycleChain, 1,
2541 ButtonFrame,
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,
2547 End,
2548 Child, general.open_button = TextObject,
2549 MUIA_CycleChain, 1,
2550 ButtonFrame,
2551 MUIA_Background, MUII_ButtonBack,
2552 MUIA_Text_PreParse, "\33c",
2553 MUIA_Text_Contents, "Open Window",
2554 MUIA_InputMode, MUIV_InputMode_RelVerify,
2555 End,
2556 Child, TextObject,
2557 MUIA_ContextMenu, context_menu,
2558 MUIA_CycleChain, 1,
2559 ButtonFrame,
2560 MUIA_Background, MUII_ButtonBack,
2561 MUIA_Text_PreParse, "\33c",
2562 MUIA_Text_Contents, "Press Right",
2563 MUIA_InputMode, MUIV_InputMode_RelVerify,
2564 End,
2565 Child, objects_button = TextObject,
2566 MUIA_CycleChain, 1,
2567 ButtonFrame,
2568 MUIA_Background, MUII_ButtonBack,
2569 MUIA_Text_PreParse, "\33c",
2570 MUIA_Text_Contents, "Add Objects",
2571 MUIA_InputMode, MUIV_InputMode_RelVerify,
2572 End,
2573 Child, HVSpace,
2574 Child, HGroup,
2575 Child, HVSpace,
2576 Child, general.menus_check =
2577 MUI_MakeObject(MUIO_Checkmark,
2578 "_Enable menus"),
2579 End,
2580 Child, HGroup,
2581 Child, MUI_MakeObject(MUIO_Label,
2582 "_Enable menus", 0),
2583 Child, HVSpace,
2584 End,
2585 Child, HVSpace,
2586 Child, HVSpace,
2587 End,
2588 Child, group = VGroup,
2589 GroupFrameT("A vertical group"),
2590 Child, DropTextObject,
2591 MUIA_Dropable, TRUE,
2592 MUIA_CycleChain, 1,
2593 ButtonFrame,
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,
2599 End,
2600 Child, TextObject,
2601 TextFrame,
2602 MUIA_Background, MUII_MARKHALFSHINE,
2603 MUIA_CycleChain, 1,
2604 MUIA_Text_PreParse, "\33c",
2605 MUIA_Text_Contents, "Pattern",
2606 End,
2607 Child, MUI_NewObject(MUIC_Popimage, TAG_DONE),
2608 End,
2609 Child, ScrollgroupObject,
2610 GroupFrameT("A scroll group"),
2611 MUIA_Scrollgroup_Contents, VGroupV,
2612 VirtualFrame,
2613 Child, TextObject,
2614 TextFrame,
2615 MUIA_Text_Contents,
2616 "Line1\nLine2\nLine3\n"
2617 "Line4\nLine5\nLine6\n"
2618 "Line7\nLine8\n\n\n\n"
2619 "Line9\nLine10\nLine11\n",
2620 End,
2621 Child, HGroup,
2622 Child, MUI_MakeObject(MUIO_Button, "Button9"),
2623 Child, MUI_MakeObject(MUIO_Button, "Button10"),
2624 End,
2625 End,
2626 End,
2627 End,
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,
2633 Child, TextObject,
2634 MUIA_Text_Contents, "test",
2635 End,
2636 Child, listview = ListviewObject,
2637 MUIA_Listview_List, ListObject,
2638 InputListFrame,
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,
2645 End,
2646 End,
2647 End,
2648 MUIA_Popobject_ObjStrHook, &hook_objstr,
2649 End,
2650 Child, CycleObject,
2651 ButtonFrame,
2652 MUIA_Cycle_Entries, pages,
2653 End,
2654 Child, ScrollbarObject,
2655 MUIA_Group_Horiz, TRUE,
2656 MUIA_Prop_Visible, 100,
2657 MUIA_Prop_Entries, 300,
2658 MUIA_Prop_First, 50,
2659 End,
2660 End,
2662 /* window */
2663 Child, VGroup,
2665 Child, ColGroup(4),
2666 Child, MUI_MakeObject(MUIO_Label, "Window title:", 0),
2667 Child, window.title_string =
2668 StringObject,
2669 StringFrame,
2670 MUIA_String_Contents, "Test window",
2671 End,
2672 Child, MUI_MakeObject(MUIO_Label, "Screen title:", 0),
2673 Child, window.screen_string =
2674 StringObject,
2675 StringFrame,
2676 MUIA_String_Contents, "Test window",
2677 End,
2678 End,
2680 Child, ColGroup(2),
2681 GroupFrameT("Initial dimensions"),
2682 Child, ColGroup(2),
2683 GroupFrameT("Left Edge"),
2684 Child, MUI_MakeObject(MUIO_Label, "Mode:", 0),
2685 Child, window.left_cycle = CycleObject,
2686 ButtonFrame,
2687 MUIA_Cycle_Entries, window_left_modes + 1,
2688 End,
2689 Child, MUI_MakeObject(MUIO_Label, "Pixels:", 0),
2690 Child, window.left_index_string =
2691 StringObject,
2692 StringFrame,
2693 MUIA_String_Accept, (IPTR)digits,
2694 MUIA_String_Integer, 100,
2695 End,
2696 End,
2697 Child, ColGroup(2),
2698 GroupFrameT("Width"),
2699 Child, MUI_MakeObject(MUIO_Label, "Mode:", 0),
2700 Child, window.width_cycle = CycleObject,
2701 ButtonFrame,
2702 MUIA_Cycle_Entries, window_dim_modes,
2703 End,
2704 Child, MUI_MakeObject(MUIO_Label,
2705 "Pixels/percentage:", 0),
2706 Child, window.width_index_string =
2707 StringObject,
2708 StringFrame,
2709 MUIA_String_Accept, (IPTR)digits,
2710 MUIA_String_Integer, 100,
2711 End,
2712 End,
2713 Child, ColGroup(2),
2714 GroupFrameT("Top Edge"),
2715 Child, MUI_MakeObject(MUIO_Label, "Mode:", 0),
2716 Child, window.top_cycle = CycleObject,
2717 ButtonFrame,
2718 MUIA_Cycle_Entries, window_top_modes + 1,
2719 End,
2720 Child, MUI_MakeObject(MUIO_Label, "Pixels:", 0),
2721 Child, window.top_index_string =
2722 StringObject,
2723 StringFrame,
2724 MUIA_String_Accept, (IPTR)digits,
2725 MUIA_String_Integer, 100,
2726 End,
2727 End,
2728 Child, ColGroup(2),
2729 GroupFrameT("Height"),
2730 Child, MUI_MakeObject(MUIO_Label, "Mode:", 0),
2731 Child, window.height_cycle =
2732 CycleObject,
2733 ButtonFrame,
2734 MUIA_Cycle_Entries, window_dim_modes,
2735 End,
2736 Child, MUI_MakeObject(MUIO_Label,
2737 "Pixels/percentage:", 0),
2738 Child, window.height_index_string =
2739 StringObject,
2740 StringFrame,
2741 MUIA_String_Accept, (IPTR)digits,
2742 MUIA_String_Integer, 100,
2743 End,
2744 End,
2745 End,
2747 Child, ColGroup(2),
2748 GroupFrameT("Alternative dimensions"),
2749 Child, ColGroup(2),
2750 GroupFrameT("Left Edge"),
2751 Child, MUI_MakeObject(MUIO_Label, "Mode:", 0),
2752 Child, window.alt_left_cycle =
2753 CycleObject,
2754 ButtonFrame,
2755 MUIA_Cycle_Entries, window_left_modes,
2756 End,
2757 Child, MUI_MakeObject(MUIO_Label, "Pixels:", 0),
2758 Child, window.alt_left_index_string =
2759 StringObject,
2760 StringFrame,
2761 MUIA_String_Accept, (IPTR)digits,
2762 MUIA_String_Integer, 100,
2763 End,
2764 End,
2765 Child, ColGroup(2),
2766 GroupFrameT("Width"),
2767 Child, MUI_MakeObject(MUIO_Label, "Mode:", 0),
2768 Child, window.alt_width_cycle =
2769 CycleObject,
2770 ButtonFrame,
2771 MUIA_Cycle_Entries, window_dim_modes + 1,
2772 End,
2773 Child, MUI_MakeObject(MUIO_Label,
2774 "Pixels/percentage:", 0),
2775 Child, window.alt_width_index_string =
2776 StringObject,
2777 StringFrame,
2778 MUIA_String_Accept, (IPTR)digits,
2779 MUIA_String_Integer, 100,
2780 End,
2781 End,
2782 Child, ColGroup(2),
2783 GroupFrameT("Top Edge"),
2784 Child, MUI_MakeObject(MUIO_Label, "Mode:", 0),
2785 Child, window.alt_top_cycle =
2786 CycleObject,
2787 ButtonFrame,
2788 MUIA_Cycle_Entries, window_top_modes,
2789 End,
2790 Child, MUI_MakeObject(MUIO_Label, "Pixels:", 0),
2791 Child, window.alt_top_index_string =
2792 StringObject,
2793 StringFrame,
2794 MUIA_String_Accept, (IPTR)digits,
2795 MUIA_String_Integer, 100,
2796 End,
2797 End,
2798 Child, ColGroup(2),
2799 GroupFrameT("Height"),
2800 Child, MUI_MakeObject(MUIO_Label, "Mode:", 0),
2801 Child, window.alt_height_cycle =
2802 CycleObject,
2803 ButtonFrame,
2804 MUIA_Cycle_Entries, window_dim_modes + 1,
2805 End,
2806 Child, MUI_MakeObject(MUIO_Label,
2807 "Pixels/percentage:", 0),
2808 Child, window.alt_height_index_string =
2809 StringObject,
2810 StringFrame,
2811 MUIA_String_Accept, (IPTR)digits,
2812 MUIA_String_Integer, 100,
2813 End,
2814 End,
2815 End,
2817 Child, ColGroup(6),
2818 Child, HGroup,
2819 Child, window.appwindow_check =
2820 MUI_MakeObject(MUIO_Checkmark, NULL),
2821 Child, MUI_MakeObject(MUIO_Label, "AppWindow", 0),
2822 Child, HVSpace,
2823 End,
2824 Child, HGroup,
2825 Child, window.backdrop_check =
2826 MUI_MakeObject(MUIO_Checkmark, NULL),
2827 Child, MUI_MakeObject(MUIO_Label, "Backdrop", 0),
2828 Child, HVSpace,
2829 End,
2830 Child, HGroup,
2831 Child, window.borderless_check =
2832 MUI_MakeObject(MUIO_Checkmark, NULL),
2833 Child, MUI_MakeObject(MUIO_Label, "Borderless", 0),
2834 Child, HVSpace,
2835 End,
2836 Child, HGroup,
2837 Child, window.close_check =
2838 MUI_MakeObject(MUIO_Checkmark, NULL),
2839 Child, MUI_MakeObject(MUIO_Label, "Close gadget", 0),
2840 Child, HVSpace,
2841 End,
2842 Child, HGroup,
2843 Child, window.depth_check =
2844 MUI_MakeObject(MUIO_Checkmark, NULL),
2845 Child, MUI_MakeObject(MUIO_Label, "Depth gadget", 0),
2846 Child, HVSpace,
2847 End,
2848 Child, HVSpace,
2849 Child, HGroup,
2850 Child, window.dragbar_check =
2851 MUI_MakeObject(MUIO_Checkmark, NULL),
2852 Child, MUI_MakeObject(MUIO_Label,
2853 "Draggable", 0),
2854 Child, HVSpace,
2855 End,
2856 Child, HGroup,
2857 Child, window.ref_check =
2858 MUI_MakeObject(MUIO_Checkmark, NULL),
2859 Child, MUI_MakeObject(MUIO_Label, "Reference parent", 0),
2860 Child, HVSpace,
2861 End,
2862 Child, HGroup,
2863 Child, window.size_check =
2864 MUI_MakeObject(MUIO_Checkmark, NULL),
2865 Child, MUI_MakeObject(MUIO_Label, "Size gadget", 0),
2866 Child, HVSpace,
2867 End,
2868 Child, HGroup,
2869 Child, window.activate_check =
2870 MUI_MakeObject(MUIO_Checkmark, NULL),
2871 Child, MUI_MakeObject(MUIO_Label, "Active", 0),
2872 Child, HVSpace,
2873 End,
2874 Child, HGroup,
2875 Child, window.id_check =
2876 MUI_MakeObject(MUIO_Checkmark, NULL),
2877 Child, MUI_MakeObject(MUIO_Label, "Use ID", 0),
2878 Child, HVSpace,
2879 End,
2880 Child, HGroup,
2881 Child, MUI_MakeObject(MUIO_Label, "Menus:", 0),
2882 Child, window.menu_cycle = CycleObject,
2883 ButtonFrame,
2884 MUIA_Cycle_Entries, window_menu_modes,
2885 End,
2886 End,
2887 End,
2889 Child, HGroup,
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"),
2896 End,
2898 Child, HVSpace,
2899 End,
2900 End;
2902 return group;
2905 static Object *CreateTextGroup()
2907 Object *group;
2908 UWORD i, j;
2909 ULONG colour;
2910 struct MUI_AlphaData *raw_image;
2911 ULONG *pixels;
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)
2918 return 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 */
2944 sprintf(image_text,
2945 "This is a text object with a raw ARGB image: \33A[%lx]",
2946 (IPTR)raw_image);
2948 group = RegisterGroup(text_pages),
2950 /* text */
2951 Child, VGroup,
2952 Child, TextObject,
2953 MUIA_Background, "2:cfffffff,cfffffff,10000000",
2954 TextFrame,
2955 MUIA_Text_Contents, "\33cHello World!\n"
2956 "This is a text object\n\33lLeft "
2957 "\33bbold\33n\n"
2958 "\33rRight",
2959 End,
2960 Child, TextObject,
2961 TextFrame,
2962 /* Test for a bug with pen specifications as
2963 reported here:
2964 https://sourceforge.net/p/aros/bugs/487/
2966 MUIA_Text_Contents,
2967 "This is a \33P[3]text \33P[]object "
2968 "\33P[1]with pen specifications",
2969 End,
2970 Child, TextObject,
2971 TextFrame,
2972 MUIA_Text_Contents, (text.image_text = StrDup(image_text)),
2973 End,
2974 Child, RectangleObject,
2975 MUIA_VertWeight, 0,
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",
2981 End,
2982 Child, StringObject,
2983 StringFrame,
2984 MUIA_CycleChain,1,
2985 MUIA_String_AdvanceOnCR, TRUE,
2986 End,
2987 Child, HVSpace,
2988 End,
2990 /* string */
2991 Child, HGroup,
2992 Child, VGroup,
2993 Child, VGroup,
2994 GroupFrameT("Default Alignment"),
2995 Child, string.strings[0] = StringObject,
2996 StringFrame,
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,
3001 MUIA_CycleChain, 1,
3002 MUIA_String_AttachedList, list.lists[0],
3003 End,
3004 End,
3005 Child, VGroup, GroupFrameT("Left Aligned"),
3006 Child, string.strings[1] = StringObject,
3007 StringFrame,
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,
3013 MUIA_CycleChain, 1,
3014 MUIA_String_Contents, (IPTR)default_accept_chars,
3015 MUIA_String_BufferPos, 3,
3016 MUIA_String_AttachedList, list.lists[0],
3017 End,
3018 End,
3019 Child, VGroup, GroupFrameT("Right Aligned"),
3020 Child, string.strings[2] = StringObject,
3021 StringFrame,
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,
3027 MUIA_CycleChain, 1,
3028 MUIA_String_AttachedList, list.lists[0],
3029 End,
3030 End,
3031 Child, VGroup, GroupFrameT("Centered"),
3032 Child, string.strings[3] = StringObject,
3033 StringFrame,
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,
3039 MUIA_CycleChain, 1,
3040 MUIA_String_Integer, 123,
3041 MUIA_String_AttachedList, list.lists[0],
3042 End,
3043 End,
3044 Child, VGroup, GroupFrameT("Secret"),
3045 Child, string.strings[4] = StringObject,
3046 StringFrame,
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,
3053 MUIA_CycleChain, 1,
3054 MUIA_String_AttachedList, list.lists[0],
3055 End,
3056 End,
3057 Child, HGroup, GroupFrameT("Narrow"),
3058 Child, HVSpace,
3059 Child, string.strings[5] = StringObject,
3060 StringFrame,
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,
3065 MUIA_MaxWidth, 20,
3066 MUIA_String_MaxLen, 9,
3067 MUIA_CycleChain, 1,
3068 MUIA_String_AttachedList, list.lists[0],
3069 End,
3070 Child, HVSpace,
3071 End,
3072 Child, HVSpace,
3073 End,
3074 Child, VGroup, GroupFrameT("Controls"),
3075 Child, HGroup,
3076 Child, string.accept_all_check =
3077 MUI_MakeObject(MUIO_Checkmark, NULL),
3078 Child, MUI_MakeObject(MUIO_Label,
3079 "Accept all characters", 0),
3080 Child, HVSpace,
3081 End,
3082 Child, ColGroup(2),
3083 Child, MUI_MakeObject(MUIO_Label,
3084 "Acceptable characters:", 0),
3085 Child, string.accept_string =
3086 StringObject,
3087 StringFrame,
3088 MUIA_String_Contents, (IPTR)default_accept_chars,
3089 End,
3090 Child, MUI_MakeObject(MUIO_Label,
3091 "Unacceptable characters:", 0),
3092 Child, string.reject_string =
3093 StringObject,
3094 StringFrame,
3095 End,
3096 Child, MUI_MakeObject(MUIO_Label,
3097 "Cursor position:", 0),
3098 Child, string.cursor_pos_slider =
3099 SliderObject,
3100 MUIA_Group_Horiz, TRUE,
3101 MUIA_Numeric_Min, 0,
3102 End,
3103 Child, MUI_MakeObject(MUIO_Label,
3104 "Display position:", 0),
3105 Child, string.display_pos_slider =
3106 SliderObject,
3107 MUIA_Group_Horiz, TRUE,
3108 MUIA_Numeric_Min, 0,
3109 End,
3110 Child, MUI_MakeObject(MUIO_Label,
3111 "Integer value:", 0),
3112 Child, string.integer_string =
3113 StringObject,
3114 StringFrame,
3115 MUIA_String_Accept, (IPTR)digits,
3116 End,
3117 Child, MUI_MakeObject(MUIO_Label,
3118 "Plaintext:", 0),
3119 Child, string.plaintext_string =
3120 StringObject,
3121 StringFrame,
3122 End,
3123 Child, MUI_MakeObject(MUIO_Label,
3124 "Maximum string length:", 0),
3125 Child, string.max_len_text = TextObject,
3126 TextFrame,
3127 MUIA_Text_Contents, "Unknown",
3128 End,
3129 End,
3130 Child, VGroup,
3131 Child, HGroup,
3132 Child, string.cr_advance_check =
3133 MUI_MakeObject(MUIO_Checkmark, NULL),
3134 Child, MUI_MakeObject(MUIO_Label,
3135 "Advance on CR", 0),
3136 Child, HVSpace,
3137 End,
3138 Child, HGroup,
3139 Child, string.attach_list_check =
3140 MUI_MakeObject(MUIO_Checkmark, NULL),
3141 Child, MUI_MakeObject(MUIO_Label,
3142 "Attach list", 0),
3143 Child, HVSpace,
3144 End,
3145 #if 0
3146 Child, HGroup,
3147 Child, string.standard_hook_check =
3148 MUI_MakeObject(MUIO_Checkmark,
3149 NULL),
3150 Child, MUI_MakeObject(MUIO_Label,
3151 "Use standard edit hook", 0),
3152 Child, HVSpace,
3153 End,
3154 Child, HGroup,
3155 Child, string.custom_hook_check =
3156 MUI_MakeObject(MUIO_Checkmark, NULL),
3157 Child, MUI_MakeObject(MUIO_Label,
3158 "Use custom edit hook", 0),
3159 Child, HVSpace,
3160 End,
3161 #endif
3162 End,
3163 Child, HVSpace,
3164 End,
3166 End,
3167 End;
3169 return group;
3172 static Object *CreateBoopsiGroup()
3174 Object *group;
3176 group = VGroup,
3177 Child, wheel = BoopsiObject,
3178 /* MUI/Boopsi tags mixed */
3179 GroupFrame,
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,
3189 WHEEL_Screen, NULL,
3190 GA_Left, 0,
3191 GA_Top, 0, /* MUI will automatically */
3192 GA_Width, 0, /* fill in the correct values */
3193 GA_Height, 0,
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
3201 background */
3202 End,
3204 Child, r_slider = SliderObject,
3205 MUIA_Group_Horiz, TRUE,
3206 MUIA_Numeric_Min, 0,
3207 MUIA_Numeric_Max, 255,
3208 End,
3209 Child, g_slider = SliderObject,
3210 MUIA_Group_Horiz, TRUE,
3211 MUIA_Numeric_Min, 0,
3212 MUIA_Numeric_Max, 255,
3213 End,
3214 Child, b_slider = SliderObject,
3215 MUIA_Group_Horiz, TRUE,
3216 MUIA_Numeric_Min, 0,
3217 MUIA_Numeric_Max, 255,
3218 End,
3219 Child, hue_gauge = GaugeObject,
3220 GaugeFrame,
3221 MUIA_Gauge_Horiz, TRUE,
3222 MUIA_Gauge_Max, 255,
3223 MUIA_Gauge_Divide, 1<<24,
3224 MUIA_Gauge_InfoText, "Hue: %ld",
3225 End,
3226 End;
3228 return group;
3231 static Object *CreateColorGroup()
3233 Object *group;
3235 group = RegisterGroup(color_pages),
3236 Child, VGroup, GroupFrameT("Palette"),
3237 Child, PaletteObject,
3238 End,
3239 End,
3240 Child, HGroup,
3241 Child, VGroup, GroupFrameT("Colorfield"),
3243 Child, HGroup,
3244 Child, colorfield = ColorfieldObject,
3245 MUIA_Colorfield_RGB, default_color,
3246 MUIA_Colorfield_Pen, 253,
3247 End,
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],
3252 End,
3253 End,
3254 Child, colorfield_reset_button =
3255 MUI_MakeObject(MUIO_Button, "Reset"),
3256 Child, HGroup,
3257 Child,
3258 MUI_MakeObject(MUIO_Label, "Pen:", 0),
3259 Child, colorfield_pen = StringObject,
3260 StringFrame,
3261 End,
3262 End,
3263 End,
3264 Child, VGroup, GroupFrameT("Coloradjust"),
3265 Child, coloradjust = ColoradjustObject,
3266 MUIA_Coloradjust_RGB, default_color,
3267 End,
3268 End,
3269 End,
3270 Child, HGroup,
3271 Child, VGroup,
3272 Child, VGroup, GroupFrameT("Pendisplay"),
3273 Child, HGroup,
3274 Child, pendisplay,
3275 Child, pendisplay2 =
3276 PendisplayObject,
3277 MUIA_Pendisplay_RGBcolor, default_color,
3278 End,
3279 End,
3280 Child, ColGroup(2),
3281 Child,
3282 MUI_MakeObject(MUIO_Label, "Pen:", 0),
3283 Child, HGroup,
3284 Child, pendisplay_pen =
3285 StringObject, StringFrame,
3286 End,
3287 Child, HVSpace,
3288 Child, reference_check =
3289 MUI_MakeObject(MUIO_Checkmark, NULL),
3290 Child, MUI_MakeObject(MUIO_Label,
3291 "Reference", 0),
3292 End,
3293 Child,
3294 MUI_MakeObject(MUIO_Label, "Penspec:", 0),
3295 Child, pendisplay_spec =
3296 StringObject,
3297 StringFrame,
3298 End,
3299 End,
3300 Child, HGroup,
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"),
3307 End,
3308 End,
3309 Child, VGroup, GroupFrameT("Poppen"),
3310 Child, poppen = PoppenObject,
3311 End,
3312 End,
3313 End,
3314 Child, VGroup, GroupFrameT("Penadjust"),
3315 Child, PenadjustObject,
3316 End,
3317 End,
3318 End,
3319 End;
3321 return group;
3324 static Object *CreateEditGroup()
3326 Object *group;
3328 group = VGroup,
3329 Child, editor_text = StringObject,
3330 StringFrame,
3331 End,
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),
3337 End,
3338 Child, save_button =
3339 MUI_MakeObject(MUIO_Button, "Save"),
3340 End;
3342 return group;
3345 static Object *CreateListGroup()
3347 Object *group;
3349 group = RegisterGroup(list_pages),
3350 Child, VGroup,
3351 Child, ColGroup(LIST_COUNT),
3352 Child, VGroup,
3353 GroupFrameT("No Multiselect"),
3354 Child, list.lists[0],
3355 End,
3356 Child, VGroup,
3357 GroupFrameT("Default Multiselect"),
3358 Child, list.lists[1],
3359 End,
3360 Child, VGroup,
3361 GroupFrameT("Shifted Multiselect"),
3362 Child, list.lists[2],
3363 End,
3364 Child, VGroup,
3365 GroupFrameT("Unconditional Multiselect"),
3366 Child, list.lists[3],
3367 End,
3368 Child, VGroup,
3369 GroupFrameT("Read Only"),
3370 Child, list.lists[4],
3371 End,
3372 End,
3373 Child, HGroup,
3374 MUIA_Group_HorizSpacing, 0,
3375 Child, RectangleObject,
3376 MUIA_HorizWeight, 1,
3377 End,
3378 Child, list.list_radios = RadioObject,
3379 MUIA_Radio_Entries, empty,
3380 MUIA_Group_Horiz, TRUE,
3381 MUIA_HorizWeight, 1000,
3382 End,
3383 Child, RectangleObject,
3384 MUIA_HorizWeight, 1,
3385 End,
3386 End,
3387 Child, RectangleObject,
3388 MUIA_VertWeight, 0,
3389 MUIA_Rectangle_HBar, TRUE,
3390 MUIA_Rectangle_BarTitle, "List Controls",
3391 End,
3392 Child, ColGroup(6),
3393 Child, MUI_MakeObject(MUIO_Label,
3394 "Affected index 1:", 0),
3395 Child, list.index1_string =
3396 StringObject,
3397 StringFrame,
3398 MUIA_String_Accept, (IPTR)digits,
3399 MUIA_String_Integer, 0,
3400 End,
3401 Child, HGroup,
3402 Child, list.draggable_check =
3403 MUI_MakeObject(MUIO_Checkmark, NULL),
3404 Child, MUI_MakeObject(MUIO_Label,
3405 "Draggable", 0),
3406 Child, HVSpace,
3407 End,
3408 Child, HGroup,
3409 Child, list.showdropmarks_check =
3410 MUI_MakeObject(MUIO_Checkmark, NULL),
3411 Child, MUI_MakeObject(MUIO_Label,
3412 "Show drop marks", 0),
3413 Child, HVSpace,
3414 End,
3415 Child, HGroup,
3416 Child, list.autovisible_check =
3417 MUI_MakeObject(MUIO_Checkmark, NULL),
3418 Child, MUI_MakeObject(MUIO_Label,
3419 "Auto visible", 0),
3420 Child, HVSpace,
3421 End,
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 =
3428 StringObject,
3429 StringFrame,
3430 MUIA_String_Accept, (IPTR)digits,
3431 MUIA_String_Integer, 0,
3432 End,
3433 Child, HGroup,
3434 Child, list.dragsortable_check =
3435 MUI_MakeObject(MUIO_Checkmark, NULL),
3436 Child, MUI_MakeObject(MUIO_Label,
3437 "Drag sortable", 0),
3438 Child, HVSpace,
3439 End,
3440 Child, HGroup,
3441 Child, list.multitest_check =
3442 MUI_MakeObject(MUIO_Checkmark, NULL),
3443 Child, MUI_MakeObject(MUIO_Label,
3444 "Filter multiselect", 0),
3445 Child, HVSpace,
3446 End,
3447 Child, HGroup,
3448 Child, list.quiet_check =
3449 MUI_MakeObject(MUIO_Checkmark, NULL),
3450 Child, MUI_MakeObject(MUIO_Label,
3451 "Quiet", 0),
3452 Child, HVSpace,
3453 End,
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,
3460 ButtonFrame,
3461 MUIA_Cycle_Entries, list_move1_modes,
3462 End,
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,
3468 "Title:", 0),
3469 Child, list.title_string =
3470 StringObject,
3471 StringFrame,
3472 End,
3474 Child, MUI_MakeObject(MUIO_Label,
3475 "Move/exchange mode 2:", 0),
3476 Child, list.move2_cycle = CycleObject,
3477 ButtonFrame,
3478 MUIA_Cycle_Entries, list_move2_modes,
3479 End,
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,
3485 "Entries:", 0),
3486 Child, list.entries_text = TextObject,
3487 TextFrame,
3488 MUIA_Text_Contents, "N/A",
3489 End,
3491 Child, MUI_MakeObject(MUIO_Label,
3492 "Jump mode:", 0),
3493 Child, list.jump_cycle = CycleObject,
3494 ButtonFrame,
3495 MUIA_Cycle_Entries, list_jump_modes,
3496 End,
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,
3504 TextFrame,
3505 MUIA_Text_Contents, "N/A",
3506 End,
3508 Child, MUI_MakeObject(MUIO_Label,
3509 "Select/redraw mode:", 0),
3510 Child, list.select_cycle = CycleObject,
3511 ButtonFrame,
3512 MUIA_Cycle_Entries, list_select_modes,
3513 End,
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,
3521 TextFrame,
3522 MUIA_Text_Contents, "N/A",
3523 End,
3525 Child, MUI_MakeObject(MUIO_Label,
3526 "Insert mode:", 0),
3527 Child, list.insert_cycle = CycleObject,
3528 ButtonFrame,
3529 MUIA_Cycle_Entries, list_insert_modes,
3530 End,
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,
3538 TextFrame,
3539 MUIA_Text_Contents, "N/A",
3540 End,
3542 Child, MUI_MakeObject(MUIO_Label,
3543 "Remove mode:", 0),
3544 Child, list.remove_cycle = CycleObject,
3545 ButtonFrame,
3546 MUIA_Cycle_Entries, list_remove_modes,
3547 End,
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,
3555 TextFrame,
3556 MUIA_Text_Contents, "N/A",
3557 End,
3559 Child, MUI_MakeObject(MUIO_Label,
3560 "Activate mode:", 0),
3561 Child, list.activate_cycle = CycleObject,
3562 ButtonFrame,
3563 MUIA_Cycle_Entries, list_activate_modes,
3564 End,
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,
3572 TextFrame,
3573 MUIA_Text_Contents, "N/A",
3574 End,
3576 Child, HVSpace,
3577 Child, HVSpace,
3578 Child, HVSpace,
3579 Child, HVSpace,
3580 Child, MUI_MakeObject(MUIO_Label,
3581 "Last drop index:", 0),
3582 Child, list.drop_text = TextObject,
3583 TextFrame,
3584 MUIA_Text_Contents, "N/A",
3585 End,
3586 End,
3587 End,
3588 Child, VGroup,
3589 Child, ColGroup(MULTI_LIST_COUNT),
3590 Child, VGroup,
3591 GroupFrameT("Standard Format"),
3592 Child, list.multi_lists[0] =
3593 ListviewObject,
3594 MUIA_Listview_List,
3595 ListObject,
3596 InputListFrame,
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,
3604 End,
3605 MUIA_Listview_MultiSelect,
3606 MUIV_Listview_MultiSelect_None,
3607 MUIA_Listview_DefClickColumn, 1,
3608 MUIA_CycleChain, 1,
3609 End,
3610 End,
3611 Child, VGroup, GroupFrameT("Custom Format"),
3612 Child, list.multi_lists[1] =
3613 ListviewObject,
3614 MUIA_Listview_List,
3615 ListObject,
3616 InputListFrame,
3617 MUIA_List_Format, list_format,
3618 MUIA_List_Title, TRUE,
3619 MUIA_List_AdjustHeight, TRUE,
3620 End,
3621 MUIA_Listview_MultiSelect,
3622 MUIV_Listview_MultiSelect_None,
3623 MUIA_CycleChain, 1,
3624 End,
3625 Child, HVSpace,
3626 End,
3627 End,
3628 Child, RectangleObject,
3629 MUIA_VertWeight, 0,
3630 MUIA_Rectangle_HBar, TRUE,
3631 MUIA_Rectangle_BarTitle, "List Controls",
3632 End,
3633 Child, HGroup,
3634 Child, MUI_MakeObject(
3635 MUIO_Label, "Format:", 0),
3636 Child, list.format_string = StringObject,
3637 StringFrame,
3638 MUIA_CycleChain, 1,
3639 End,
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,
3647 "Show image", 0),
3648 End,
3649 Child, HGroup,
3650 Child, MUI_MakeObject(MUIO_Label,
3651 "Default clicked column:", 0),
3652 Child, list.def_column_string =
3653 StringObject,
3654 StringFrame,
3655 MUIA_String_Accept, (IPTR)digits,
3656 MUIA_String_Integer, -1,
3657 MUIA_CycleChain, 1,
3658 End,
3659 Child, MUI_MakeObject(MUIO_Label,
3660 "Clicked column:", 0),
3661 Child, list.column_string = StringObject,
3662 MUIA_ShowMe, FALSE,
3663 End,
3664 Child, list.column_text = TextObject,
3665 TextFrame,
3666 MUIA_Text_Contents, "N/A",
3667 End,
3668 End,
3669 End,
3670 End;
3672 return group;
3675 static Object *CreateNumericGroup()
3677 Object *group;
3679 group = HGroup,
3680 Child, VGroup,
3681 Child, ColGroup(2),
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,
3688 MUIA_CycleChain, 1,
3689 End,
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,
3695 MUIA_CycleChain, 1,
3696 End,
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,
3702 MUIA_CycleChain, 1,
3703 End,
3704 End,
3705 Child, ColGroup(2),
3706 Child, ColGroup(5),
3707 GroupFrameT("Knobs"),
3708 Child, HVSpace,
3709 Child, MUI_MakeObject(MUIO_Label, "Normal", 0),
3710 Child, HVSpace,
3711 Child, MUI_MakeObject(MUIO_Label, "Reverse", 0),
3712 Child, HVSpace,
3713 Child, HVSpace,
3714 Child, numeric.numerics[NKNOB] = KnobObject,
3715 MUIA_Numeric_Min, NUMERIC_MIN,
3716 MUIA_Numeric_Max, NUMERIC_MAX,
3717 MUIA_CycleChain, 1,
3718 End,
3719 Child, HVSpace,
3720 Child, numeric.numerics[RKNOB] = KnobObject,
3721 MUIA_Numeric_Reverse, TRUE,
3722 MUIA_Numeric_Min, NUMERIC_MIN,
3723 MUIA_Numeric_Max, NUMERIC_MAX,
3724 MUIA_CycleChain, 1,
3725 End,
3726 Child, HVSpace,
3727 End,
3728 Child, VGroup,
3729 Child, ColGroup(2),
3730 Child, MUI_MakeObject(MUIO_Label,
3731 "Minimum Value:", 0),
3732 Child, numeric.min_string = (Object *)StringObject,
3733 StringFrame,
3734 MUIA_String_Accept, (IPTR)digits,
3735 MUIA_String_Integer, NUMERIC_MIN,
3736 MUIA_CycleChain, 1,
3737 End,
3738 Child, MUI_MakeObject(MUIO_Label,
3739 "Maximum Value:", 0),
3740 Child, numeric.max_string = (Object *)StringObject,
3741 StringFrame,
3742 MUIA_String_Accept, (IPTR)digits,
3743 MUIA_String_Integer, NUMERIC_MAX,
3744 MUIA_CycleChain, 1,
3745 End,
3746 End,
3747 Child, numeric.slider_button = TextObject,
3748 ButtonFrame,
3749 MUIA_InputMode, MUIV_InputMode_RelVerify,
3750 MUIA_CycleChain, 1,
3751 MUIA_Background, MUII_ButtonBack,
3752 MUIA_Text_PreParse, "\33c",
3753 MUIA_Text_Contents, "Change Slider Orientations",
3754 End,
3755 End,
3756 Child, ColGroup(2),
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,
3763 MUIA_CycleChain, 1,
3764 End,
3765 Child, numeric.numerics[RLEVELMETER] = LevelmeterObject,
3766 MUIA_Numeric_Reverse, TRUE,
3767 MUIA_Numeric_Min, NUMERIC_MIN,
3768 MUIA_Numeric_Max, NUMERIC_MAX,
3769 MUIA_CycleChain, 1,
3770 End,
3771 End,
3772 Child, ColGroup(3),
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,
3779 MUIA_CycleChain, 1,
3780 End,
3781 Child, HVSpace,
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,
3788 MUIA_CycleChain, 1,
3789 End,
3790 Child, HVSpace,
3791 Child, VSpace(0),
3792 Child, VSpace(0),
3793 Child, HVSpace,
3794 End,
3795 End,
3796 End,
3797 Child, ColGroup(3),
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,
3807 MUIA_CycleChain, 1,
3808 End,
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,
3815 MUIA_CycleChain, 1,
3816 End,
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,
3823 MUIA_CycleChain, 1,
3824 End,
3825 End,
3827 Child, VGroup,
3828 GroupFrameT("Gauges"),
3829 Child, numeric.gauges[HNGAUGE] = GaugeObject,
3830 GaugeFrame,
3831 MUIA_Gauge_Horiz, TRUE,
3832 MUIA_Gauge_InfoText, StrDup("%ld/100"),
3833 End,
3834 Child, numeric.gauges[HQGAUGE] = GaugeObject,
3835 GaugeFrame,
3836 MUIA_Gauge_Horiz, TRUE,
3837 End,
3838 Child, ScaleObject,
3839 End,
3840 Child, HGroup,
3841 Child, numeric.gauges[VNGAUGE] = GaugeObject,
3842 GaugeFrame,
3843 MUIA_Gauge_Current, NUMERIC_INIT,
3844 MUIA_Gauge_Max, NUMERIC_MAX,
3845 MUIA_Gauge_InfoText, StrDup("%ld"),
3846 End,
3847 Child, numeric.gauges[VQGAUGE] = GaugeObject,
3848 GaugeFrame,
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,
3853 End,
3854 End,
3855 End,
3857 End;
3859 return group;
3862 static Object *CreateSelectGroup()
3864 Object *group;
3866 group = HGroup,
3867 Child, VGroup,
3868 GroupFrameT("Radio"),
3869 Child, city_radios[0] = RadioObject,
3870 GroupFrameT("Vertical"),
3871 MUIA_Radio_Entries, cities,
3872 MUIA_Radio_Active, 1,
3873 End,
3874 Child, city_radios[1] = RadioObject,
3875 GroupFrameT("Horizontal"),
3876 MUIA_Group_Horiz, TRUE,
3877 MUIA_Radio_Entries, cities,
3878 MUIA_Radio_Active, 1,
3879 End,
3880 Child, city_radios[2] = RadioObject,
3881 GroupFrameT("Grid"),
3882 MUIA_Group_Rows, 2,
3883 MUIA_Radio_Entries, cities,
3884 MUIA_Radio_Active, 1,
3885 End,
3886 Child, HVSpace,
3887 End,
3888 Child, VGroup,
3889 GroupFrameT("Cycle"),
3890 Child, ColGroup(3),
3891 Child, MUI_MakeObject(
3892 MUIO_Label, "Choose city:", 0),
3893 Child, cycle.city_cycle = CycleObject,
3894 ButtonFrame,
3895 MUIA_Cycle_Entries, cities,
3896 MUIA_Radio_Active, 1,
3897 End,
3898 Child, cycle.prev_button =
3899 MUI_MakeObject(MUIO_Button, "Previous"),
3900 Child, MUI_MakeObject(MUIO_Label,
3901 "Chosen city:", 0),
3902 Child, cycle.city_text = TextObject,
3903 TextFrame,
3904 MUIA_Text_Contents, "N/A",
3905 End,
3906 Child, cycle.next_button =
3907 MUI_MakeObject(MUIO_Button, "Next"),
3908 End,
3909 Child, HVSpace,
3910 End,
3911 End;
3913 return group;
3916 static Object *CreateBalancingGroup()
3918 Object *group;
3920 group = HGroup,
3921 Child, create_balance_column(),
3922 Child, BalanceObject,
3923 End,
3925 Child, create_balance_column(),
3926 Child, BalanceObject,
3927 End,
3929 Child, create_balance_column(),
3930 Child, BalanceObject,
3931 End,
3933 Child, create_balance_column(),
3934 Child, BalanceObject,
3935 End,
3937 Child, create_balance_column(),
3939 End;
3941 return group;