Icons for Radium and Shellplayer.
[AROS-Contrib.git] / bgui / include / bgui_macros.h
blob2187b22cfcec055c95978c0ca0be771282d640e4
1 #ifndef BGUI_BGUI_MACROS_H
2 #define BGUI_BGUI_MACROS_H
3 /*
4 * @(#) $Header$
6 * $VER: libraries/bgui_macros.h 41.10 (19.1.97)
7 * bgui.library macros.
9 * (C) Copyright 1998 Manuel Lemos.
10 * (C) Copyright 1996-1997 Ian J. Einman.
11 * (C) Copyright 1993-1996 Jaba Development.
12 * (C) Copyright 1993-1996 Jan van den Baard.
13 * All Rights Reserved.
15 * $Log$
16 * Revision 42.6 2003/01/18 19:10:21 chodorowski
17 * Instead of using the _AROS or __AROS preprocessor symbols, use __AROS__.
19 * Revision 42.5 2000/08/08 20:57:28 chodorowski
20 * Minor fixes to build on Amiga.
22 * Revision 42.4 2000/08/08 14:03:07 chodorowski
23 * Removed all REGFUNC, REGPARAM and REG macros (not needed here).
25 * Revision 42.3 2000/08/07 21:51:05 stegerg
26 * fixed/activated REGFUNC/REGPARAM macros.
28 * Revision 42.2 2000/05/29 00:40:25 bergers
29 * Update to compile with AROS now. Should also still compile with SASC etc since I only made changes that test the define __AROS__. The compilation is still very noisy but it does the trick for the main directory. Maybe members of the BGUI team should also have a look at the compiler warnings because some could also cause problems on other systems... (Comparison always TRUE due to datatype (or something like that)). And please compile it on an Amiga to see whether it still works... Thanks.
31 * Revision 42.1 2000/05/15 19:28:20 stegerg
32 * REG() macro replacementes
34 * Revision 42.0 2000/05/09 22:23:17 mlemos
35 * Bumped to revision 42.0 before handing BGUI to AROS team
37 * Revision 41.11 2000/05/09 20:01:52 mlemos
38 * Merged with the branch Manuel_Lemos_fixes.
40 * Revision 41.10.2.3 1999/08/13 04:36:26 mlemos
41 * Changed the pre-processor define to denote that this file was included.
43 * Revision 41.10.2.2 1999/02/19 05:00:57 mlemos
44 * Added support for Storm C.
46 * Revision 41.10.2.1 1998/10/12 01:42:27 mlemos
47 * Made the definition of compiler specific macros conditionally dependeing on
48 * wether the macros are already defined.
50 * Revision 41.10 1998/02/25 21:13:54 mlemos
51 * Bumping to 41.10
53 * Revision 1.1 1998/02/25 17:15:59 mlemos
54 * Ian sources
59 #ifndef LIBRARIES_BGUI_H
60 #include <libraries/bgui.h>
61 #endif /* LIBRARIES_BGUI_H */
63 #ifndef CLIB_ALIB_PROTOS_H
64 #ifdef __AROS__
65 #include <proto/alib.h>
66 #else
67 #include <clib/alib_protos.h>
68 #endif
69 #endif /* CLIB_ALIB_PROTOS_H */
72 /*****************************************************************************
74 * General object creation macros.
76 #define LabelObject BGUI_NewObject(BGUI_LABEL_IMAGE
77 #define FrameObject BGUI_NewObject(BGUI_FRAME_IMAGE
78 #define VectorObject BGUI_NewObject(BGUI_VECTOR_IMAGE
80 #define HGroupObject BGUI_NewObject(BGUI_GROUP_GADGET
81 #define VGroupObject BGUI_NewObject(BGUI_GROUP_GADGET, GROUP_Style, GRSTYLE_VERTICAL
82 #define ButtonObject BGUI_NewObject(BGUI_BUTTON_GADGET
83 #define ToggleObject BGUI_NewObject(BGUI_BUTTON_GADGET, GA_ToggleSelect, TRUE
84 #define CycleObject BGUI_NewObject(BGUI_CYCLE_GADGET
85 #define CheckBoxObject BGUI_NewObject(BGUI_CHECKBOX_GADGET
86 #define InfoObject BGUI_NewObject(BGUI_INFO_GADGET
87 #define StringObject BGUI_NewObject(BGUI_STRING_GADGET
88 #define PropObject BGUI_NewObject(BGUI_PROP_GADGET
89 #define IndicatorObject BGUI_NewObject(BGUI_INDICATOR_GADGET
90 #define ProgressObject BGUI_NewObject(BGUI_PROGRESS_GADGET
91 #define SliderObject BGUI_NewObject(BGUI_SLIDER_GADGET
92 #define PageObject BGUI_NewObject(BGUI_PAGE_GADGET
93 #define MxObject BGUI_NewObject(BGUI_MX_GADGET
94 #define ListviewObject BGUI_NewObject(BGUI_LISTVIEW_GADGET
95 #define ExternalObject BGUI_NewObject(BGUI_EXTERNAL_GADGET, GA_Left, 0, GA_Top, 0, GA_Width, 0, GA_Height, 0
96 #define SeparatorObject BGUI_NewObject(BGUI_SEPARATOR_GADGET
97 #define AreaObject BGUI_NewObject(BGUI_AREA_GADGET
98 #define ViewObject BGUI_NewObject(BGUI_VIEW_GADGET
99 #define PaletteObject BGUI_NewObject(BGUI_PALETTE_GADGET
100 #define PopButtonObject BGUI_NewObject(BGUI_POPBUTTON_GADGET
102 #define WindowObject BGUI_NewObject(BGUI_WINDOW_OBJECT
103 #define FileReqObject BGUI_NewObject(BGUI_FILEREQ_OBJECT
104 #define FontReqObject BGUI_NewObject(BGUI_FONTREQ_OBJECT
105 #define ScreenReqObject BGUI_NewObject(BGUI_SCREENREQ_OBJECT
106 #define CommodityObject BGUI_NewObject(BGUI_COMMODITY_OBJECT
107 #define ARexxObject BGUI_NewObject(BGUI_AREXX_OBJECT
109 #define EndObject TAG_END)
111 /* Typo */
112 #define SeperatorObject SeparatorObject
114 /*****************************************************************************
116 * Label creation.
118 #define Label(l) LAB_Label, l
119 #define UScoreLabel(l,u) LAB_Label, l, LAB_Underscore, u
120 #define Style(s) LAB_Style, s
121 #define Place(p) LAB_Place, p
123 /*****************************************************************************
125 * Frames.
127 #define ButtonFrame FRM_Type, FRTYPE_BUTTON
128 #define RidgeFrame FRM_Type, FRTYPE_RIDGE
129 #define DropBoxFrame FRM_Type, FRTYPE_DROPBOX
130 #define NeXTFrame FRM_Type, FRTYPE_NEXT
131 #define RadioFrame FRM_Type, FRTYPE_RADIOBUTTON
132 #define XenFrame FRM_Type, FRTYPE_XEN_BUTTON
133 #define TabAboveFrame FRM_Type, FRTYPE_TAB_ABOVE
134 #define TabBelowFrame FRM_Type, FRTYPE_TAB_BELOW
135 #define BorderFrame FRM_Type, FRTYPE_BORDER
136 #define FuzzButtonFrame FRM_Type, FRTYPE_FUZZ_BUTTON
137 #define FuzzRidgeFrame FRM_Type, FRTYPE_FUZZ_RIDGE
138 #define NoFrame FRM_Type, FRTYPE_NONE
139 #define DefaultFrame FRM_Type, FRTYPE_DEFAULT
141 /* For clarity. */
142 #define StringFrame RidgeFrame
143 #define MxFrame RadioFrame
145 #define FrameTitle(t) FRM_Title, t
147 /* Built-in back fills */
148 #define ShineRaster FRM_BackFill, SHINE_RASTER
149 #define ShadowRaster FRM_BackFill, SHADOW_RASTER
150 #define ShineShadowRaster FRM_BackFill, SHINE_SHADOW_RASTER
151 #define FillRaster FRM_BackFill, FILL_RASTER
152 #define ShineFillRaster FRM_BackFill, SHINE_FILL_RASTER
153 #define ShadowFillRaster FRM_BackFill, SHADOW_FILL_RASTER
154 #define ShineBlock FRM_BackFill, SHINE_BLOCK
155 #define ShadowBlock FRM_BackFill, SHADOW_BLOCK
157 /*****************************************************************************
159 * Vector images.
161 #define GetPath VIT_BuiltIn, BUILTIN_GETPATH
162 #define GetFile VIT_BuiltIn, BUILTIN_GETFILE
163 #define CheckMark VIT_BuiltIn, BUILTIN_CHECKMARK
164 #define PopUp VIT_BuiltIn, BUILTIN_POPUP
165 #define ArrowUp VIT_BuiltIn, BUILTIN_ARROW_UP
166 #define ArrowDown VIT_BuiltIn, BUILTIN_ARROW_DOWN
167 #define ArrowLeft VIT_BuiltIn, BUILTIN_ARROW_LEFT
168 #define ArrowRight VIT_BuiltIn, BUILTIN_ARROW_RIGHT
170 /*****************************************************************************
172 * Group class macros.
174 #define StartMember GROUP_Member
175 #define EndMember TAG_END, 0
176 #define Spacing(p) GROUP_Spacing, p
177 #define Offset(p) GROUP_Offset, p
178 #define HOffset(p) GROUP_HorizOffset, p
179 #define VOffset(p) GROUP_VertOffset, p
180 #define LOffset(p) GROUP_LeftOffset, p
181 #define ROffset(p) GROUP_RightOffset, p
182 #define TOffset(p) GROUP_TopOffset, p
183 #define BOffset(p) GROUP_BottomOffset, p
184 #define VarSpace(w) GROUP_SpaceObject, w
185 #define EqualWidth GROUP_EqualWidth, TRUE
186 #define EqualHeight GROUP_EqualHeight, TRUE
187 #define Rows(n) GROUP_Rows, n
188 #define Columns(n) GROUP_Columns, n
190 #define NormalSpacing GROUP_Spacing, GRSPACE_NORMAL
191 #define NormalHOffset GROUP_HorizOffset, GRSPACE_NORMAL
192 #define NormalVOffset GROUP_VertOffset, GRSPACE_NORMAL
193 #define NarrowSpacing GROUP_Spacing, GRSPACE_NARROW
194 #define NarrowHOffset GROUP_HorizOffset, GRSPACE_NARROW
195 #define NarrowVOffset GROUP_VertOffset, GRSPACE_NARROW
196 #define WideSpacing GROUP_Spacing, GRSPACE_WIDE
197 #define WideHOffset GROUP_HorizOffset, GRSPACE_WIDE
198 #define WideVOffset GROUP_VertOffset, GRSPACE_WIDE
199 #define NormalOffset NormalHOffset, NormalVOffset
201 /*****************************************************************************
203 * Layout macros.
205 #define FixMinWidth LGO_FixMinWidth, TRUE
206 #define FixMinHeight LGO_FixMinHeight, TRUE
207 #define Weight(w) LGO_Weight, w
208 #define FixWidth(w) LGO_FixWidth, w
209 #define FixHeight(h) LGO_FixHeight, h
210 #define Align LGO_Align, TRUE
211 #define AlignTop LGO_VAlign, GRALIGN_TOP
212 #define AlignBottom LGO_VAlign, GRALIGN_BOTTOM
213 #define AlignCenterV LGO_VAlign, GRALIGN_CENTER
214 #define AlignLeft LGO_HAlign, GRALIGN_LEFT
215 #define AlignRight LGO_HAlign, GRALIGN_RIGHT
216 #define AlignCenterH LGO_HAlign, GRALIGN_CENTER
217 #define FixMinSize FixMinWidth, FixMinHeight
218 #define FixSize(w,h) FixWidth(w), FixHeight(h)
219 #define NoAlign LGO_NoAlign, TRUE
220 #define FixAspect(x,y) LGO_FixAspect, ((x) << 16) | (y)
222 /*****************************************************************************
224 * Page class macros.
226 #define PageMember PAGE_Member
228 /*****************************************************************************
230 * "Quick" button creation macros.
232 #define PrefButton(label,id)\
233 ButtonObject,\
234 LAB_Label, label,\
235 GA_ID, id,\
236 EndObject
238 #define Button(label,id)\
239 ButtonObject,\
240 LAB_Label, label,\
241 GA_ID, id,\
242 ButtonFrame,\
243 EndObject
246 #define PrefToggle(label,state,id)\
247 ToggleObject,\
248 LAB_Label, label,\
249 GA_ID, id,\
250 GA_Selected, state,\
251 EndObject
253 #define Toggle(label,state,id)\
254 ToggleObject,\
255 LAB_Label, label,\
256 GA_ID, id,\
257 GA_Selected, state,\
258 ButtonFrame,\
259 EndObject
261 #define XenButton(label,id)\
262 ButtonObject,\
263 LAB_Label, label,\
264 GA_ID, id,\
265 XenFrame,\
266 EndObject
268 #define XenToggle(label,state,id)\
269 ToggleObject,\
270 LAB_Label, label,\
271 GA_ID, id,\
272 GA_Selected, state,\
273 XenFrame,\
274 EndObject
276 #define KeyButton Button
277 #define KeyToggle Toggle
278 #define XenKeyButton XenButton
279 #define XenKeyToggle XenToggle
281 /*****************************************************************************
283 * "Quick" cycle creation macros.
285 #define PrefCycle(label,labels,active,id)\
286 CycleObject,\
287 LAB_Label, label,\
288 GA_ID, id,\
289 CYC_Labels, labels,\
290 CYC_Active, active,\
291 EndObject
293 #define Cycle(label,labels,active,id)\
294 CycleObject,\
295 LAB_Label, label,\
296 GA_ID, id,\
297 ButtonFrame,\
298 CYC_Labels, labels,\
299 CYC_Active, active,\
300 CYC_Popup, FALSE,\
301 EndObject
303 #define XenCycle(label,labels,active,id)\
304 CycleObject,\
305 LAB_Label, label,\
306 GA_ID, id,\
307 XenFrame,\
308 CYC_Labels, labels,\
309 CYC_Active, active,\
310 CYC_Popup, FALSE,\
311 EndObject
313 #define PopCycle(label,labels,active,id)\
314 CycleObject,\
315 LAB_Label, label,\
316 GA_ID, id,\
317 ButtonFrame,\
318 CYC_Labels, labels,\
319 CYC_Active, active,\
320 CYC_Popup, TRUE,\
321 EndObject
323 #define XenPopCycle(label,labels,active,id)\
324 CycleObject,\
325 LAB_Label, label,\
326 GA_ID, id,\
327 XenFrame,\
328 CYC_Labels, labels,\
329 CYC_Active, active,\
330 CYC_Popup, TRUE,\
331 EndObject
333 #define KeyCycle Cycle
334 #define XenKeyCycle XenCycle
335 #define KeyPopCycle PopCycle
336 #define XenKeyPopCycle XenPopCycle
338 /*****************************************************************************
340 * "Quick" checkbox creation macros.
342 #define PrefCheckBoxNF(label,state,id)\
343 CheckBoxObject,\
344 LAB_Label, label,\
345 GA_ID, id,\
346 GA_Selected, state,\
347 EndObject
349 #define CheckBoxNF(label,state,id)\
350 CheckBoxObject,\
351 LAB_Label, label,\
352 GA_ID, id,\
353 ButtonFrame,\
354 GA_Selected, state,\
355 EndObject
357 #define XenCheckBoxNF(label,state,id)\
358 CheckBoxObject,\
359 LAB_Label, label,\
360 GA_ID, id,\
361 XenFrame,\
362 GA_Selected, state,\
363 EndObject
365 #define PrefCheckBox(label,state,id) PrefCheckBoxNF(label,state,id), FixMinSize
366 #define CheckBox(label,state,id) CheckBoxNF(label,state,id), FixMinSize
367 #define XenCheckBox(label,state,id) XenCheckBoxNF(label,state,id), FixMinSize
369 #define KeyCheckBoxNF CheckBoxNF
370 #define XenKeyCheckBoxNF XenCheckBoxNF
371 #define KeyCheckBox CheckBox
372 #define XenKeyCheckBox XenCheckBox
374 /*****************************************************************************
376 * "Quick" info object creation macros.
378 #define PrefInfoFixed(label,text,args,numlines)\
379 InfoObject,\
380 LAB_Label, label,\
381 DefaultFrame,\
382 INFO_TextFormat, text,\
383 INFO_Args, args,\
384 INFO_MinLines, numlines,\
385 INFO_FixTextWidth, TRUE,\
386 EndObject
388 #define PrefInfo(label,text,args,numlines)\
389 InfoObject,\
390 LAB_Label, label,\
391 DefaultFrame,\
392 INFO_TextFormat, text,\
393 INFO_Args, args,\
394 INFO_MinLines, numlines,\
395 EndObject
397 #define InfoFixed(label,text,args,numlines)\
398 InfoObject,\
399 LAB_Label, label,\
400 ButtonFrame,\
401 FRM_Flags, FRF_RECESSED,\
402 INFO_TextFormat, text,\
403 INFO_Args, args,\
404 INFO_MinLines, numlines,\
405 INFO_FixTextWidth, TRUE,\
406 EndObject
408 #define InfoObj(label,text,args,numlines)\
409 InfoObject,\
410 LAB_Label, label,\
411 ButtonFrame,\
412 FRM_Flags, FRF_RECESSED,\
413 INFO_TextFormat, text,\
414 INFO_Args, args,\
415 INFO_MinLines, numlines,\
416 EndObject
418 /*****************************************************************************
420 * "Quick" string/integer creation macros.
422 #define PrefString(label,contents,maxchars,id)\
423 StringObject,\
424 LAB_Label, label,\
425 STRINGA_TextVal, contents,\
426 STRINGA_MaxChars, maxchars,\
427 GA_ID, id,\
428 GA_TabCycle, TRUE,\
429 EndObject
431 #define String(label,contents,maxchars,id)\
432 StringObject,\
433 LAB_Label, label,\
434 RidgeFrame,\
435 STRINGA_TextVal, contents,\
436 STRINGA_MaxChars, maxchars,\
437 GA_ID, id,\
438 EndObject
440 #define TabString(label,contents,maxchars,id)\
441 StringObject,\
442 LAB_Label, label,\
443 RidgeFrame,\
444 STRINGA_TextVal, contents,\
445 STRINGA_MaxChars, maxchars,\
446 GA_ID, id,\
447 GA_TabCycle, TRUE,\
448 EndObject
450 #define PrefInteger(label,contents,maxchars,id)\
451 StringObject,\
452 LAB_Label, label,\
453 STRINGA_LongVal, contents,\
454 STRINGA_MaxChars, maxchars,\
455 GA_ID, id,\
456 GA_TabCycle, TRUE,\
457 EndObject
459 #define Integer(label,contents,maxchars,id)\
460 StringObject,\
461 LAB_Label, label,\
462 RidgeFrame,\
463 STRINGA_LongVal, contents,\
464 STRINGA_MaxChars, maxchars,\
465 GA_ID, id,\
466 EndObject
468 #define TabInteger(label,contents,maxchars,id)\
469 StringObject,\
470 LAB_Label, label,\
471 RidgeFrame,\
472 STRINGA_LongVal, contents,\
473 STRINGA_MaxChars, maxchars,\
474 GA_ID, id,\
475 GA_TabCycle, TRUE,\
476 EndObject
478 #define KeyString String
479 #define TabKeyString TabString
480 #define KeyInteger Integer
481 #define TabKeyInteger TabInteger
484 * STRINGA_Pens & STRINGA_ActivePens pen-pack macro.
486 #define PACKPENS(a,b) (((b<<8)&0xFF00)|((a)&0x00FF))
488 /*****************************************************************************
490 * "Quick" scroller creation macros.
492 #define HorizScroller(label,top,total,visible,id)\
493 PropObject,\
494 LAB_Label, label,\
495 PGA_Top, top,\
496 PGA_Total, total,\
497 PGA_Visible, visible,\
498 PGA_Freedom, FREEHORIZ,\
499 GA_ID, id,\
500 PGA_Arrows, TRUE,\
501 EndObject
503 #define VertScroller(label,top,total,visible,id)\
504 PropObject,\
505 LAB_Label, label,\
506 PGA_Top, top,\
507 PGA_Total, total,\
508 PGA_Visible, visible,\
509 GA_ID, id,\
510 PGA_Arrows, TRUE,\
511 EndObject
513 #define KeyHorizScroller HorizScroller
514 #define KeyVertScroller VertScroller
516 /*****************************************************************************
518 * "Quick" indicator creation macros.
520 #define Indicator(min,max,level,just)\
521 IndicatorObject,\
522 INDIC_Min, min,\
523 INDIC_Max, max,\
524 INDIC_Level, level,\
525 INDIC_Justification, just,\
526 EndObject
528 #define IndicatorFormat(min,max,level,just,format)\
529 IndicatorObject,\
530 INDIC_Min, min,\
531 INDIC_Max, max,\
532 INDIC_Level, level,\
533 INDIC_Justification, just,\
534 INDIC_FormatString, format,\
535 EndObject
537 /*****************************************************************************
539 * "Quick" progress creation macros.
541 #define HorizProgress(label,min,max,done)\
542 ProgressObject,\
543 LAB_Label, label,\
544 ButtonFrame,\
545 FRM_Flags, FRF_RECESSED,\
546 PROGRESS_Min, min,\
547 PROGRESS_Max, max,\
548 PROGRESS_Done, done,\
549 EndObject
551 #define VertProgress(label,min,max,done)\
552 ProgressObject,\
553 LAB_Label, label,\
554 ButtonFrame,\
555 FRM_Flags, FRF_RECESSED,\
556 PROGRESS_Min, min,\
557 PROGRESS_Max, max,\
558 PROGRESS_Done, done,\
559 PROGRESS_Vertical, TRUE,\
560 EndObject
562 #define HorizProgressFS(label,min,max,done,fstr)\
563 ProgressObject,\
564 LAB_Label, label,\
565 ButtonFrame,\
566 FRM_Flags, FRF_RECESSED,\
567 PROGRESS_Min, min,\
568 PROGRESS_Max, max,\
569 PROGRESS_Done, done,\
570 PROGRESS_FormatString, fstr,\
571 EndObject
573 #define VertProgressFS(label,min,max,done,fstr)\
574 ProgressObject,\
575 LAB_Label, label,\
576 ButtonFrame,\
577 FRM_Flags, FRF_RECESSED,\
578 PROGRESS_Min, min,\
579 PROGRESS_Max, max,\
580 PROGRESS_Done, done,\
581 PROGRESS_Vertical, TRUE,\
582 PROGRESS_FormatString, fstr,\
583 EndObject
585 /*****************************************************************************
587 * "Quick" slider creation macros.
589 #define HorizSlider(label,min,max,level,id)\
590 SliderObject,\
591 LAB_Label, label,\
592 SLIDER_Min, min,\
593 SLIDER_Max, max,\
594 SLIDER_Level, level,\
595 GA_ID, id,\
596 EndObject
598 #define VertSlider(label,min,max,level,id)\
599 SliderObject,\
600 LAB_Label, label,\
601 SLIDER_Min, min,\
602 SLIDER_Max, max,\
603 SLIDER_Level, level,\
604 PGA_Freedom, FREEVERT,\
605 GA_ID, id,\
606 EndObject
608 #define KeyHorizSlider HorizSlider
609 #define KeyVertSlider VertSlider
611 /*****************************************************************************
613 * "Quick" mx creation macros.
615 #define PrefMx(label,labels,active,id)\
616 MxObject,\
617 GROUP_Style, GRSTYLE_VERTICAL,\
618 LAB_Label, label,\
619 MX_Labels, labels,\
620 MX_Active, active,\
621 GA_ID, id,\
622 EndObject, FixMinSize
624 #define RightMx(label,labels,active,id)\
625 MxObject,\
626 GROUP_Style, GRSTYLE_VERTICAL,\
627 LAB_Label, label,\
628 MX_Labels, labels,\
629 MX_Active, active,\
630 MX_LabelPlace, PLACE_RIGHT,\
631 GA_ID, id,\
632 EndObject, FixMinSize
634 #define LeftMx(label,labels,active,id)\
635 MxObject,\
636 GROUP_Style, GRSTYLE_VERTICAL,\
637 LAB_Label, label,\
638 MX_Labels, labels,\
639 MX_Active, active,\
640 MX_LabelPlace, PLACE_LEFT,\
641 GA_ID, id,\
642 EndObject, FixMinSize
644 #define Tabs(label,labels,active,id)\
645 MxObject,\
646 MX_TabsObject, TRUE,\
647 LAB_Label, label,\
648 MX_Labels, labels,\
649 MX_Active, active,\
650 GA_ID, id,\
651 EndObject, FixMinHeight
654 #define TabsEqual(label,labels,active,id)\
655 MxObject,\
656 GROUP_EqualWidth, TRUE,\
657 MX_TabsObject, TRUE,\
658 LAB_Label, label,\
659 MX_Labels, labels,\
660 MX_Active, active,\
661 GA_ID, id,\
662 EndObject, FixMinHeight
664 #define USDTabs(label,labels,active,id)\
665 MxObject,\
666 MX_TabsObject, TRUE,\
667 LAB_Label, label,\
668 MX_Labels, labels,\
669 MX_Active, active,\
670 MX_TabsUpsideDown, TRUE,\
671 GA_ID, id,\
672 EndObject, FixMinHeight
674 #define USDTabsEqual(label,labels,active,id)\
675 MxObject,\
676 GROUP_EqualWidth, TRUE,\
677 MX_TabsObject, TRUE,\
678 LAB_Label, label,\
679 MX_Labels, labels,\
680 MX_Active, active,\
681 MX_TabsUpsideDown, TRUE,\
682 GA_ID, id,\
683 EndObject, FixMinHeight
685 #define RightMxKey RightMx
686 #define LeftMxKey LeftMx
687 #define TabsKey Tabs
688 #define TabsEqualKey TabsEqual
689 #define USDTabsKey USDTabs
690 #define USDTabsEqualKey USDTabsEqual
692 /*****************************************************************************
694 * "Quick" listview creation macros.
696 #define StrListview(label,strings,id)\
697 ListviewObject,\
698 LAB_Label, label,\
699 GA_ID, id,\
700 LISTV_EntryArray, strings,\
701 EndObject
703 #define StrListviewSorted(label,strings,id)\
704 ListviewObject,\
705 LAB_Label, label,\
706 GA_ID, id,\
707 LISTV_EntryArray, strings,\
708 LISTV_SortEntryArray, TRUE,\
709 EndObject
711 #define ReadStrListview(label,strings)\
712 ListviewObject,\
713 LAB_Label, label,\
714 LISTV_EntryArray, strings,\
715 LISTV_ReadOnly, TRUE,\
716 EndObject
718 #define ReadStrListviewSorted(label,strings)\
719 ListviewObject,\
720 LAB_Label, label,\
721 LISTV_EntryArray, strings,\
722 LISTV_SortEntryArray, TRUE,\
723 LISTV_ReadOnly, TRUE,\
724 EndObject
726 #define MultiStrListview(label,strings,id)\
727 ListviewObject,\
728 LAB_Label, label,\
729 GA_ID, id,\
730 LISTV_EntryArray, strings,\
731 LISTV_MultiSelect, TRUE,\
732 EndObject
734 #define MultiStrListviewSorted(label,strings,id)\
735 ListviewObject,\
736 LAB_Label, label,\
737 GA_ID, id,\
738 LISTV_EntryArray, strings,\
739 LISTV_SortEntryArray, TRUE,\
740 LISTV_MultiSelect, TRUE,\
741 EndObject
743 /*****************************************************************************
745 * "Quick" separator bar creation macros.
747 #define VertSeparator\
748 SeperatorObject,\
749 EndObject, FixMinWidth
751 #define VertThinSeparator\
752 SeperatorObject,\
753 SEP_Thin, TRUE,\
754 EndObject, FixMinWidth
756 #define HorizSeparator\
757 SeperatorObject,\
758 SEP_Horiz, TRUE,\
759 EndObject, FixMinHeight
761 #define TitleSeparator(t)\
762 SeperatorObject,\
763 SEP_Horiz, TRUE,\
764 SEP_Title, t,\
765 EndObject, FixMinHeight
767 #define HTitleSeparator(t)\
768 SeperatorObject,\
769 SEP_Horiz, TRUE,\
770 SEP_Title, t,\
771 SEP_Highlight, TRUE,\
772 EndObject, FixMinHeight
774 #define CTitleSeparator(t)\
775 SeperatorObject,\
776 SEP_Horiz, TRUE,\
777 SEP_Title, t,\
778 SEP_CenterTitle, TRUE,\
779 EndObject, FixMinHeight
781 #define CHTitleSeparator(t)\
782 SeperatorObject,\
783 SEP_Horiz, TRUE,\
784 SEP_Title, t,\
785 SEP_Highlight, TRUE,\
786 SEP_CenterTitle, TRUE,\
787 EndObject, FixMinHeight
789 #define TitleSeparatorLeft(t)\
790 SeperatorObject,\
791 SEP_Horiz, TRUE,\
792 SEP_Title, t,\
793 SEP_TitleLeft, TRUE,\
794 EndObject, FixMinHeight
796 #define HTitleSeparatorLeft(t)\
797 SeperatorObject,\
798 SEP_Horiz, TRUE,\
799 SEP_Title, t,\
800 SEP_Highlight, TRUE,\
801 SEP_TitleLeft, TRUE,\
802 EndObject, FixMinHeight
804 #define CTitleSeparatorLeft(t)\
805 SeperatorObject,\
806 SEP_Horiz, TRUE,\
807 SEP_Title, t,\
808 SEP_CenterTitle, TRUE,\
809 SEP_TitleLeft, TRUE,\
810 EndObject, FixMinHeight
812 #define CHTitleSeparatorLeft(t)\
813 SeperatorObject,\
814 SEP_Horiz, TRUE,\
815 SEP_Title, t,\
816 SEP_Highlight, TRUE,\
817 SEP_CenterTitle, TRUE,\
818 SEP_TitleLeft, TRUE,\
819 EndObject, FixMinHeight
821 /* Typos */
822 #define VertSeperator VertSeparator
823 #define VertThinSeperator VertThinSeparator
824 #define HorizSeperator HorizSeparator
825 #define TitleSeperator TitleSeparator
826 #define HTitleSeperator HTitleSeparator
827 #define CTitleSeperator CTitleSeparator
828 #define CHTitleSeperator CHTitleSeparator
830 /*****************************************************************************
832 * Some simple menu macros.
834 #define Title(t)\
835 { NM_TITLE, t, NULL, 0, 0, NULL }
836 #define Item(t,s,i)\
837 { NM_ITEM, t, s, 0, 0, (APTR)i }
838 #define ItemBar\
839 { NM_ITEM, NM_BARLABEL, NULL, 0, 0, NULL }
840 #define SubItem(t,s,i)\
841 { NM_SUB, t, s, 0, 0, (APTR)i }
842 #define SubBar\
843 { NM_SUB, NM_BARLABEL, NULL, 0, 0, NULL }
844 #define End\
845 { NM_END, NULL, NULL, 0, 0, NULL }
847 /*****************************************************************************
849 * Base class method macros.
851 #define AddMap(object,target,map)\
852 DoMethod( object, BASE_ADDMAP, target, map )
854 #define AddCondit(object,target,ttag,tdat,ftag,fdat,stag,sdat)\
855 DoMethod( object, BASE_ADDCONDITIONAL, target,\
856 ttag, tdat,\
857 ftag, fdat,\
858 stag, sdat )
860 #define AddHook(object,hook)\
861 DoMethod( object, BASE_ADDHOOK, hook )
863 #define RemMap(object,target)\
864 DoMethod( object, BASE_REMMAP, target )
866 #define RemCondit(object,target)\
867 DoMethod( object, BASE_REMCONDITIONAL, target )
869 #define RemHook( object,hook)\
870 DoMethod( object, BASE_REMHOOK, hook )
872 /*****************************************************************************
874 * Listview class method macros.
876 #define AddEntry(window,object,entry,how)\
877 BGUI_DoGadgetMethod( object, window, NULL, LVM_ADDSINGLE,\
878 NULL, entry, how, 0L )
880 #define AddEntryVisible(window,object,entry,how)\
881 BGUI_DoGadgetMethod( object, window, NULL, LVM_ADDSINGLE,\
882 NULL, entry, how, LVASF_MAKEVISIBLE )
884 #define AddEntrySelect(window,object,entry,how)\
885 BGUI_DoGadgetMethod( object, window, NULL, LVM_ADDSINGLE,\
886 NULL, entry, how, LVASF_SELECT )
888 #define InsertEntry(window,object,entry,where)\
889 BGUI_DoGadgetMethod( object, window, NULL, LVM_INSERTSINGLE,\
890 NULL, where, entry, 0L )
892 #define InsertEntryVisible(window,object,entry,where)\
893 BGUI_DoGadgetMethod( object, window, NULL, LVM_INSERTSINGLE,\
894 NULL, where, entry, LVASF_MAKEVISIBLE )
896 #define InsertEntrySelect(window,object,entry,where)\
897 BGUI_DoGadgetMethod( object, window, NULL, LVM_INSERTSINGLE,\
898 NULL, where, entry, LVASF_SELECT )
900 #define ClearList(window,object)\
901 BGUI_DoGadgetMethod( object, window, NULL, LVM_CLEAR, NULL )
903 #define FirstEntry(object)\
904 DoMethod( object, LVM_FIRSTENTRY, NULL, 0L )
906 #define FirstSelected(object)\
907 DoMethod( object, LVM_FIRSTENTRY, NULL, LVGEF_SELECTED )
909 #define LastEntry(object)\
910 DoMethod( object, LVM_LASTENTRY, NULL, 0L )
912 #define LastSelected(object)\
913 DoMethod( object, LVM_LASTENTRY, NULL, LVGEF_SELECTED )
915 #define NextEntry(object,last)\
916 DoMethod( object, LVM_NEXTENTRY, last, 0L )
918 #define NextSelected(object,last)\
919 DoMethod( object, LVM_NEXTENTRY, last, LVGEF_SELECTED )
921 #define PrevEntry(object,last)\
922 DoMethod( object, LVM_PREVENTRY, last, 0L )
924 #define PrevSelected(object,last)\
925 DoMethod( object, LVM_PREVENTRY, last, LVGEF_SELECTED )
927 #define RemoveEntry(object,entry)\
928 DoMethod( object, LVM_REMENTRY, NULL, entry )
930 #define RemoveEntryVisible(window,object,entry)\
931 BGUI_DoGadgetMethod( object, window, NULL, LVM_REMENTRY, NULL, entry )
933 #define RefreshList(window,object)\
934 BGUI_DoGadgetMethod( object, window, NULL, LVM_REFRESH, NULL )
936 #define RedrawList(window,object)\
937 BGUI_DoGadgetMethod( object, window, NULL, LVM_REDRAW, NULL )
939 #define SortList(window,object)\
940 BGUI_DoGadgetMethod( object, window, NULL, LVM_SORT, NULL )
942 #define LockList(object)\
943 DoMethod( object, LVM_LOCKLIST, NULL )
945 #define UnlockList(window,object)\
946 BGUI_DoGadgetMethod( object, window, NULL, LVM_UNLOCKLIST, NULL )
948 #define MoveEntry(window,object,entry,dir)\
949 BGUI_DoGadgetMethod( object, window, NULL, LVM_MOVE, NULL,\
950 entry, dir )
952 #define MoveSelectedEntry(window,object,dir)\
953 BGUI_DoGadgetMethod( object, window, NULL, LVM_MOVE, NULL,\
954 NULL, dir )
956 #define ReplaceEntry(window,object,old,new)\
957 BGUI_DoGadgetMethod( object, window, NULL, LVM_REPLACE, NULL,\
958 old, new )
960 #define RemoveSelected(window,object)\
961 BGUI_DoGadgetMethod( object, window, NULL, LVM_REMSELECTED, NULL )
963 /*****************************************************************************
965 * Window class method macros.
967 #define GadgetKey(wobj,gobj,key)\
968 DoMethod( wobj, WM_GADGETKEY, NULL, gobj, key )
970 #define WindowOpen(wobj)\
971 ({struct Window *win = (struct Window *)DoMethod( wobj, WM_OPEN );win;})
973 #define WindowClose(wobj)\
974 DoMethod( wobj, WM_CLOSE )
976 #define WindowBusy(wobj)\
977 DoMethod( wobj, WM_SLEEP )
979 #define WindowReady(wobj)\
980 DoMethod( wobj, WM_WAKEUP )
982 #define HandleEvent(wobj)\
983 DoMethod( wobj, WM_HANDLEIDCMP )
985 #define DisableMenu(wobj,id,set)\
986 DoMethod( wobj, WM_DISABLEMENU, id, set )
988 #define CheckItem(wobj,id,set)\
989 DoMethod( wobj, WM_CHECKITEM, id, set )
991 #define MenuDisabled(wobj,id)\
992 DoMethod( wobj, WM_MENUDISABLED, id )
994 #define ItemChecked(wobj,id)\
995 DoMethod( wobj, WM_ITEMCHECKED, id )
997 #define GetAppMsg(wobj)\
998 ( struct AppMessage * )DoMethod( wobj, WM_GETAPPMSG )
1000 #define AddUpdate(wobj,id,target,map)\
1001 DoMethod( wobj, WM_ADDUPDATE, id, target, map )
1003 #define GetSignalWindow(wobj)\
1004 ( struct Window * )DoMethod( wobj, WM_GET_SIGNAL_WINDOW )
1006 /*****************************************************************************
1008 * Commodity class method macros.
1010 #define AddHotkey(broker,desc,id,flags)\
1011 DoMethod( broker, CM_ADDHOTKEY, desc, id, flags )
1013 #define RemHotkey(broker,id)\
1014 DoMethod( broker, CM_REMHOTKEY, id )
1016 #define DisableHotkey(broker,id)\
1017 DoMethod( broker, CM_DISABLEHOTKEY, id )
1019 #define EnableHotKey(broker,id)\
1020 DoMethod( broker, CM_ENABLEHOTKEY, id )
1022 #define EnableBroker(broker)\
1023 DoMethod( broker, CM_ENABLEBROKER )
1025 #define DisableBroker(broker)\
1026 DoMethod( broker, CM_DISABLEBROKER )
1028 #define MsgInfo(broker,type,id,data)\
1029 DoMethod( broker, CM_MSGINFO,\
1030 ( ULONG * )type,\
1031 ( ULONG * )id,\
1032 ( ULONG * )data )
1034 /*****************************************************************************
1036 * AslReq class method macros.
1038 #define DoRequest(object)\
1039 DoMethod( object, ASLM_DOREQUEST )
1041 #endif /* BGUI_BGUI_MACROS_H */