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: oliascmd.c /main/3 1996/06/11 16:48:04 cde-hal $ */
25 * $id: oliascmd.c,v 1.2 1992/10/07 16:38:43 brennan Exp $
27 * Copyright (c) 1992 HaL Computer Systems, Inc. All rights reserved.
28 * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
29 * States. Use of a copyright notice is precautionary only and does not
30 * imply publication or disclosure.
32 * This software contains confidential information and trade secrets of HaL
33 * Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
34 * without the prior express written permission of HaL Computer Systems, Inc.
36 * RESTRICTED RIGHTS LEGEND
37 * Use, duplication, or disclosure by the Government is subject to
38 * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
39 * Technical Data and Computer Software clause at DFARS 252.227-7013.
40 * HaL Computer Systems, Inc.
41 * 1315 Dell Avenue, Campbell, CA 95008
51 #include <Xm/Separator.h>
53 #include <X11/Xmu/Editres.h>
55 Widget toplevel, ibase, loc;
57 /* **************************************************************
59 * ************************************************************** */
62 activate (Widget w, XtPointer client_data, XtPointer call_data)
64 static OliasDisplayEvent event;
66 event.type = OLIAS_DISPLAY_EVENT;
67 XtVaGetValues (ibase, XmNvalue, &event.infobase, NULL);
68 XtVaGetValues (loc, XmNvalue, &event.locator, NULL);
70 /* printf ("Infobase = <%s>, locator = <%s>\n", event.infobase, event.locator);
72 /* puts ("** Calling API **"); */
73 olias_send_event (toplevel, (OliasEvent *) &event);
74 /* puts ("** Returned from API **"); */
78 /* **************************************************************
80 * ************************************************************** */
83 main (int argc, char *argv[])
85 XtAppContext app_context;
86 Widget form, lform, fform;
87 Widget sep, panel, send, quit;
88 Dimension width, height;
91 XtVaAppInitialize (&app_context, "OliasCmd", NULL, 0, &argc, argv, NULL, 0);
93 XtAddEventHandler(toplevel, (EventMask) 0, TRUE,
94 (XtEventHandler) _XEditResCheckMessages, NULL);
96 #define WIDGET XtVaCreateWidget
97 #define WIDGETM XtVaCreateManagedWidget
99 form = WIDGET ("form", xmFormWidgetClass, toplevel, NULL);
100 panel = WIDGET ("panel", xmFormWidgetClass, form, NULL);
101 send = WIDGETM ("send", xmPushButtonWidgetClass, panel, NULL);
102 quit = WIDGETM ("quit", xmPushButtonWidgetClass, panel, NULL);
103 sep = WIDGETM ("separator", xmSeparatorWidgetClass, form, NULL);
104 lform = WIDGET ("lform", xmFormWidgetClass, form, NULL);
105 WIDGETM ("infobase", xmLabelWidgetClass, lform, NULL);
106 WIDGETM ("locator", xmLabelWidgetClass, lform, NULL);
107 fform = WIDGET ("fform", xmFormWidgetClass, form, NULL);
108 ibase = WIDGETM ("ib_field", xmTextFieldWidgetClass, fform, NULL);
109 loc = WIDGETM ("loc_field", xmTextFieldWidgetClass, fform, NULL);
111 XtAddCallback (send, XmNactivateCallback, activate, toplevel);
112 XtAddCallback (quit, XmNactivateCallback, (XtCallbackProc) exit, toplevel);
114 XtVaSetValues (form, XmNdefaultButton, send, NULL);
116 XtManageChild (panel);
117 XtManageChild (lform);
118 XtManageChild (fform);
119 XtVaSetValues (form, XmNshadowThickness, 0, NULL);
120 XtManageChild (form);
122 XtRealizeWidget (toplevel);
124 XtVaGetValues (toplevel, XmNwidth, &width, XmNheight, &height, NULL);
125 XtVaSetValues (toplevel, XmNminWidth, (int) width,
126 XmNminHeight, (int) height,
127 XmNmaxHeight, (int) height,
130 XtAppMainLoop (app_context);