2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: Group.C /main/2 1995/07/17 14:05:44 drk $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
26 * (c) Copyright 1993, 1994 International Business Machines Corp. *
27 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
28 * (c) Copyright 1993, 1994 Novell, Inc. *
36 #include <Xm/RowColumn.h>
39 Group::Group(MotifUI *parent,
42 : MotifUI(parent, name, NULL)
46 _group_type = group_type;
48 parentW = parent->InnerWidget();
49 XmString xm_string = StringCreate(name);
51 _w = XtVaCreateManagedWidget(name, xmFrameWidgetClass, parentW, NULL);
53 _label = XtVaCreateManagedWidget(name, xmLabelWidgetClass, _w,
54 XmNchildType, XmFRAME_TITLE_CHILD,
55 XmNlabelString, xm_string, NULL);
57 _label = XtVaCreateWidget(name, xmLabelWidgetClass, _w,
58 XmNchildType, XmFRAME_TITLE_CHILD,
59 XmNlabelString, xm_string, NULL);
60 if (group_type == FORM_BOX)
61 _rc = XtVaCreateManagedWidget(name, xmFormWidgetClass, _w, NULL);
66 if (group_type == RADIO_GROUP || group_type == HORIZONTAL_RADIO_GROUP)
70 if (group_type == HORIZONTAL_CHECK_BOX ||
71 group_type == HORIZONTAL_RADIO_GROUP)
72 orientaion = XmHORIZONTAL;
74 orientaion = XmVERTICAL;
75 _rc = XtVaCreateManagedWidget(name, xmRowColumnWidgetClass, _w,
76 XmNradioBehavior, flag,
77 XmNorientation, orientaion, NULL);
79 StringFree(xm_string);
82 boolean Group::SetName(char *name)
86 XmString xm_string = StringCreate(name);
87 XtVaSetValues(_label, XmNlabelString, xm_string, NULL);
88 StringFree(xm_string);
89 XtManageChild(_label);
92 XtUnmanageChild(_label);