don't use NULL or cast NULL where appropriate.
[AROS-Contrib.git] / bgui / radiobuttonclass.c
blob783ef24f12ebcec7945c563970076e5ca636a44f
1 /*
2 * @(#) $Header$
4 * BGUI library
5 * radiobuttonclass.c
7 * (C) Copyright 1998 Manuel Lemos.
8 * (C) Copyright 1996-1997 Ian J. Einman.
9 * (C) Copyright 1993-1996 Jaba Development.
10 * (C) Copyright 1993-1996 Jan van den Baard.
11 * All Rights Reserved.
13 * $Log$
14 * Revision 42.2 2004/06/16 20:16:48 verhaegs
15 * Use METHODPROTO, METHOD_END and REGFUNCPROTOn where needed.
17 * Revision 42.1 2000/05/15 19:27:02 stegerg
18 * another hundreds of REG() macro replacements in func headers/protos.
20 * Revision 42.0 2000/05/09 22:10:01 mlemos
21 * Bumped to revision 42.0 before handing BGUI to AROS team
23 * Revision 41.11 2000/05/09 19:54:57 mlemos
24 * Merged with the branch Manuel_Lemos_fixes.
26 * Revision 41.10 1998/02/25 21:12:56 mlemos
27 * Bumping to 41.10
29 * Revision 1.1 1998/02/25 17:09:33 mlemos
30 * Ian sources
35 #include "include/classdefs.h"
37 /// OM_NEW
39 * Create a shiny new object.
41 METHOD(RBClassNew, struct opSet *, ops)
43 IPTR rc = 0;
44 Object *rb;
45 struct TagItem ttags[2], *tags;
48 * Get us a radiobutton image.
50 if ((rb = BGUI_NewObject(BGUI_VECTOR_IMAGE, VIT_BuiltIn, BUILTIN_RADIOBUTTON, VIT_DriPen, FILLPEN, TAG_DONE)))
52 ttags[0].ti_Tag = BUTTON_SelectedVector;
53 ttags[0].ti_Data = (IPTR)rb;
54 ttags[1].ti_Tag = TAG_MORE;
55 ttags[1].ti_Data = (IPTR)ops->ops_AttrList;
57 tags = DefTagList(BGUI_RADIOBUTTON_GADGET, ttags);
60 * Let the superclass setup an object for us.
62 if ((rc = NewSuperObject(cl, obj, tags)))
65 * No recessed rendering.
67 DoSetMethodNG((Object *)rc, FRM_EdgesOnly, FALSE, GA_ToggleSelect, TRUE, TAG_DONE);
69 else
71 AsmDoMethod(rb, OM_DISPOSE);
73 FreeTagItems(tags);
75 return rc;
77 METHOD_END
78 ///
79 /// Class Initialization.
81 * Class function table.
83 STATIC DPFUNC ClassFunc[] = {
84 { OM_NEW, RBClassNew, },
85 { DF_END },
89 * Initialize the radiobutton class.
91 makeproto Class *InitRadioButtonClass(void)
93 return BGUI_MakeClass(CLASS_SuperClassBGUI, BGUI_BUTTON_GADGET,
94 CLASS_DFTable, ClassFunc,
95 TAG_DONE);
97 ///