annotate lwlib/xlwradio.c @ 5482:384423af8fb5 first-gplv3 r21-5-31

Update CHANGES-beta.
author Stephen J. Turnbull <stephen@xemacs.org>
date Sat, 30 Apr 2011 12:50:14 +0900
parents 308d34e9f07d
children 574f0cded429
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
1 /* Radio Widget for XEmacs.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
2 Copyright (C) 1999 Edward A. Falk
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
3
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
4 This file is part of XEmacs.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
5
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4769
diff changeset
6 XEmacs is free software: you can redistribute it and/or modify it
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4769
diff changeset
8 Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4769
diff changeset
9 option) any later version.
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
10
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
14 for more details.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
15
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4769
diff changeset
17 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
18
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
19 /* Synched up with: Radio.c 1.1 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
20
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
21 /*
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
22 * Radio.c - Radio button widget
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
23 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
24 * Author: Edward A. Falk
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
25 * falk@falconer.vip.best.com
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
26 *
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
27 * Date: June 30, 1997
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
28 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
29 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
30 * Overview: This widget is identical to the Toggle widget in behavior,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
31 * but completely different in appearance. This widget looks like a small
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
32 * diamond-shaped button with a label to the right.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
33 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
34 * To make this work, we subclass the Toggle widget to inherit its behavior
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
35 * and to inherit the label-drawing function from which Toggle is
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
36 * subclassed. We then completely replace the Expose, Set, Unset
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
37 * and Highlight member functions.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
38 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
39 * The Set and Unset actions are slightly unorthodox. In Toggle's
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
40 * ClassInit function, Toggle searches the Command actions list and
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
41 * "steals" the Set and Unset functions, caching pointers to them in its
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
42 * class record. It then calls these functions from its own ToggleSet
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
43 * and Toggle actions.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
44 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
45 * We, in turn, override the Set() and Unset() actions in our own ClassRec.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
46 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
47
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
48
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
49 #include <config.h>
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
50 #include <stdio.h>
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
51
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
52 #include <X11/IntrinsicP.h>
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
53 #include <X11/StringDefs.h>
4769
5460287a3327 Remove support for pre-X11R5 systems, including systems without Xmu. See
Jerry James <james@xemacs.org>
parents: 4528
diff changeset
54 #include <X11/Xmu/Misc.h>
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
55 #include ATHENA_XawInit_h_
4528
726060ee587c First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4522
diff changeset
56 #include "xt-wrappers.h"
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
57 #include "xlwradioP.h"
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
58
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
59 #define BOX_SIZE 13
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
60
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
61 #define rclass(w) ((RadioWidgetClass)((w)->core.widget_class))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
62
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
63
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
64 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
65 #define swid(rw) ((rw)->threeD.shadow_width)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
66 #else
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
67 #define swid(rw) ((rw)->core.border_width)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
68 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
69
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
70 #define bsize(rw) (rclass(rw)->radio_class.dsize)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
71 #define bs(rw) (bsize(rw) + 2*swid(rw))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
72
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
73
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
74
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
75 /****************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
76 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
77 * Full class record constant
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
78 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
79 ****************************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
80
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
81 /* The translations table from Toggle do not need to be
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
82 * overridden by Radio
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
83 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
84
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
85
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
86 /* Member functions */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
87
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
88 static void RadioInit (Widget, Widget, ArgList, Cardinal *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
89 static void RadioExpose (Widget, XEvent *, Region);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
90 static void RadioResize (Widget);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
91 static void RadioClassInit (void);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
92 static void RadioClassPartInit (WidgetClass);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
93 static Boolean RadioSetValues (Widget, Widget, Widget, ArgList, Cardinal *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
94 static void DrawDiamond (Widget);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
95 static XtGeometryResult RadioQueryGeometry (Widget, XtWidgetGeometry *,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
96 XtWidgetGeometry *);
3072
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
97 #if 0
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
98 /* #### This function isn't used and is slated for destruction.
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
99 Can we just nuke it? */
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
100 static void RadioDestroy (Widget, XtPointer, XtPointer);
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
101 #endif
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
102
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
103 /* Action procs */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
104
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
105 static void RadioHighlight (Widget, XEvent *, String *, Cardinal *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
106 static void RadioUnhighlight (Widget, XEvent *, String *, Cardinal *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
107
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
108 /* internal privates */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
109
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
110 static void RadioSize (RadioWidget, Dimension *, Dimension *);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
111
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
112 /* The actions table from Toggle is almost perfect, but we need
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
113 * to override Highlight, Set, and Unset.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
114 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
115
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
116 static XtActionsRec actionsList[] =
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
117 {
4528
726060ee587c First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4522
diff changeset
118 { (String) "highlight", RadioHighlight },
726060ee587c First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4522
diff changeset
119 { (String) "unhighlight", RadioUnhighlight },
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
120 };
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
121
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
122 #define SuperClass ((ToggleWidgetClass)&toggleClassRec)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
123
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
124 RadioClassRec radioClassRec = {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
125 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
126 (WidgetClass) SuperClass, /* superclass */
4528
726060ee587c First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4522
diff changeset
127 (String) "Radio", /* class_name */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
128 sizeof(RadioRec), /* size */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
129 RadioClassInit, /* class_initialize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
130 RadioClassPartInit, /* class_part_initialize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
131 FALSE, /* class_inited */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
132 RadioInit, /* initialize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
133 NULL, /* initialize_hook */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
134 XtInheritRealize, /* realize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
135 actionsList, /* actions */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
136 XtNumber(actionsList), /* num_actions */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
137 NULL, /* resources */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
138 0, /* resource_count */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
139 NULLQUARK, /* xrm_class */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
140 TRUE, /* compress_motion */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
141 TRUE, /* compress_exposure */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
142 TRUE, /* compress_enterleave */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
143 FALSE, /* visible_interest */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
144 NULL, /* destroy */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
145 RadioResize, /* resize */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
146 RadioExpose, /* expose */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
147 RadioSetValues, /* set_values */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
148 NULL, /* set_values_hook */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
149 XtInheritSetValuesAlmost, /* set_values_almost */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
150 NULL, /* get_values_hook */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
151 NULL, /* accept_focus */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
152 XtVersion, /* version */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
153 NULL, /* callback_private */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
154 XtInheritTranslations, /* tm_table */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
155 RadioQueryGeometry, /* query_geometry */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
156 XtInheritDisplayAccelerator, /* display_accelerator */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
157 NULL /* extension */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
158 }, /* CoreClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
159 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
160 XtInheritChangeSensitive /* change_sensitive */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
161 }, /* SimpleClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
162 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
163 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
164 XtInheritXaw3dShadowDraw /* field not used */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
165 }, /* ThreeDClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
166 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
167 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
168 0 /* field not used */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
169 }, /* LabelClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
170 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
171 0 /* field not used */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
172 }, /* CommandClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
173 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
174 RadioSet, /* Set Procedure. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
175 RadioUnset, /* Unset Procedure. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
176 NULL /* extension. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
177 }, /* ToggleClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
178 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
179 BOX_SIZE,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
180 DrawDiamond, /* draw procedure */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
181 NULL /* extension. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
182 } /* RadioClass fields initialization */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
183 };
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
184
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
185 /* for public consumption */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
186 WidgetClass radioWidgetClass = (WidgetClass) &radioClassRec;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
187
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
188
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
189
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
190
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
191
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
192
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
193 /****************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
194 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
195 * Class Methods
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
196 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
197 ****************************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
198
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
199 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
200 RadioClassInit (void)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
201 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
202 XawInitializeWidgetSet();
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
203 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
204
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
205 static void
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
206 RadioClassPartInit (WidgetClass class_)
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
207 {
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
208 RadioWidgetClass c = (RadioWidgetClass) class_ ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
209 RadioWidgetClass super = (RadioWidgetClass)c->core_class.superclass ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
210
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
211 if( c->radio_class.drawDiamond == NULL ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
212 c->radio_class.drawDiamond == XtInheritDrawDiamond )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
213 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
214 c->radio_class.drawDiamond = super->radio_class.drawDiamond ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
215 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
216 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
217
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
218
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
219
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
220
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
221 /*ARGSUSED*/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
222 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
223 RadioInit (Widget request,
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
224 Widget new_,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
225 ArgList UNUSED (args),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
226 Cardinal *UNUSED (num_args))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
227 {
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
228 RadioWidget rw = (RadioWidget) new_;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
229 RadioWidget rw_req = (RadioWidget) request;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
230 Dimension w,h ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
231
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
232 /* Select initial size for the widget */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
233 if( rw_req->core.width == 0 || rw_req->core.height == 0 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
234 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
235 RadioSize(rw, &w,&h) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
236 if( rw_req->core.width == 0 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
237 rw->core.width = w ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
238 if( rw_req->core.height == 0 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
239 rw->core.height = h ;
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
240 rw->core.widget_class->core_class.resize(new_) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
241 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
242 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
243
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
244 /* Function Name: RadioDestroy
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
245 * Description: Destroy Callback for radio widget.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
246 * Arguments: w - the radio widget that is being destroyed.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
247 * junk, garbage - not used.
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
248 * Returns: none.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
249 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
250
3072
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
251 #if 0
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
252 /* #### This function isn't used and is slated for destruction.
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
253 Can we just nuke it? */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
254 /* ARGSUSED */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
255 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
256 RadioDestroy (Widget UNUSED (w),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
257 XtPointer UNUSED (junk),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
258 XtPointer UNUSED (garbage))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
259 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
260 /* TODO: get rid of this */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
261 }
3072
4c038e89d563 [xemacs-hg @ 2005-11-16 07:22:37 by stephent]
stephent
parents: 3055
diff changeset
262 #endif
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
263
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
264 /* React to size change from manager. Label widget will compute some internal
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
265 * stuff, but we need to override. This code requires knowledge of the
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
266 * internals of the Label widget.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
267 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
268
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
269 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
270 RadioResize (Widget w)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
271 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
272 RadioWidget rw = (RadioWidget)w ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
273
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
274 /* call parent resize proc */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
275 SuperClass->core_class.resize(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
276
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
277 /* override label offset */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
278
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
279 switch( rw->label.justify ) {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
280 case XtJustifyLeft:
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
281 rw->label.label_x += (bs(rw) + rw->label.internal_width) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
282 break ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
283 case XtJustifyRight:
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
284 break ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
285 case XtJustifyCenter:
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
286 default:
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
287 rw->label.label_x += (bs(rw) + rw->label.internal_width)/2;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
288 break ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
289 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
290 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
291
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
292
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
293 /*
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
294 * Repaint the widget window.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
295 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
296
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
297 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
298 RadioExpose (Widget w,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
299 XEvent *event,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
300 Region region)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
301 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
302 RadioWidget rw = (RadioWidget) w ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
303 Display *dpy = XtDisplay(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
304 Window win = XtWindow(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
305 GC gc ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
306 Pixmap left_bitmap ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
307 extern WidgetClass labelWidgetClass ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
308
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
309 /* Note: the Label widget examines the region to decide if anything
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
310 * needs to be drawn. I'm not sure that this is worth the effort,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
311 * but it bears thinking on.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
312 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
313
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
314 /* Let label widget draw the label. If there was an lbm_x
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
315 * field, we could let Label draw the bitmap too. But there
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
316 * isn't, so we need to temporarily remove the bitmap and
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
317 * draw it ourself later.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
318 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
319 left_bitmap = rw->label.left_bitmap ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
320 rw->label.left_bitmap = None ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
321 labelWidgetClass->core_class.expose(w,event,region) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
322 rw->label.left_bitmap = left_bitmap ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
323
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
324 /* now manually draw the left bitmap. TODO: 3-d look, xaw-xpm */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
325 gc = XtIsSensitive(w) ? rw->label.normal_GC : rw->label.gray_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
326 if( left_bitmap != None && rw->label.lbm_width > 0 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
327 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
328 /* TODO: handle pixmaps */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
329 XCopyPlane(dpy, left_bitmap, win, gc,
458
c33ae14dd6d0 Import from CVS: tag r21-2-44
cvs
parents: 442
diff changeset
330 0,0, rw->label.lbm_width, rw->label.lbm_height,
c33ae14dd6d0 Import from CVS: tag r21-2-44
cvs
parents: 442
diff changeset
331 (int) rw->label.internal_width*2 + bs(rw),
c33ae14dd6d0 Import from CVS: tag r21-2-44
cvs
parents: 442
diff changeset
332 (int) rw->label.internal_height + rw->label.lbm_y,
c33ae14dd6d0 Import from CVS: tag r21-2-44
cvs
parents: 442
diff changeset
333 1UL) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
334 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
335
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
336 /* Finally, the button itself */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
337 ((RadioWidgetClass)(w->core.widget_class))->radio_class.drawDiamond(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
338 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
339
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
340
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
341
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
342
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
343 /************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
344 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
345 * Set specified arguments into widget
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
346 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
347 ***********************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
348
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
349
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
350 /* ARGSUSED */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
351 static Boolean
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
352 RadioSetValues (Widget current,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
353 Widget UNUSED (request),
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
354 Widget new_,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
355 ArgList UNUSED (args),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
356 Cardinal *UNUSED (num_args))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
357 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
358 RadioWidget oldrw = (RadioWidget) current;
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
359 RadioWidget newrw = (RadioWidget) new_;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
360
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
361 /* Need to find out if the size of the widget changed. Set new size
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
362 * if it did and resize is permitted. One way to determine of the
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
363 * widget changed size would be to scan the args list. Another way
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
364 * is to compare the old and new widgets and see if any of several
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
365 * size-related fields have been changed. The Label widget chose the
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
366 * former method, but I choose the latter.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
367 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
368
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
369 if( newrw->label.resize &&
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
370 ( newrw->core.width != oldrw->core.width ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
371 newrw->core.height != oldrw->core.height ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
372 newrw->core.border_width != oldrw->core.border_width ) )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
373 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
374 RadioSize(newrw, &newrw->core.width, &newrw->core.height) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
375 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
376
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
377 /* The label set values routine can resize the widget. We need to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
378 * recalculate if this is true.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
379 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
380 if (newrw->label.label_x != oldrw->label.label_x)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
381 {
3055
6c9e392b4307 [xemacs-hg @ 2005-11-10 15:47:33 by crestani]
crestani
parents: 2286
diff changeset
382 RadioResize (new_);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
383 }
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
384 return FALSE ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
385 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
386
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
387 static XtGeometryResult
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
388 RadioQueryGeometry (Widget w,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
389 XtWidgetGeometry *intended,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
390 XtWidgetGeometry *preferred)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
391 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
392 RadioWidget rw = (RadioWidget) w;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
393
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
394 preferred->request_mode = CWWidth | CWHeight;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
395 RadioSize(rw, &preferred->width, &preferred->height) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
396
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
397 if ( ((intended->request_mode & (CWWidth | CWHeight))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
398 == (CWWidth | CWHeight)) &&
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
399 intended->width == preferred->width &&
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
400 intended->height == preferred->height)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
401 return XtGeometryYes;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
402 else if (preferred->width == w->core.width &&
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
403 preferred->height == w->core.height)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
404 return XtGeometryNo;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
405 else
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
406 return XtGeometryAlmost;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
407 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
408
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
409
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
410
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
411
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
412
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
413 /************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
414 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
415 * Action Procedures
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
416 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
417 ************************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
418
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
419 /*
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
420 * Draw the highlight border around the widget. The Command widget
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
421 * did this by drawing through a mask. We do it by just drawing the
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
422 * border.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
423 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
424
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
425 static void
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
426 DrawHighlight (Widget w,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
427 GC gc)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
428 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
429 RadioWidget rw = (RadioWidget)w;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
430 XRectangle rects[4] ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
431 Dimension ht = rw->command.highlight_thickness ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
432
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
433 if( ht <= 0 ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
434 ht > rw->core.width/2 ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
435 ht > rw->core.height/2 )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
436 return ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
437
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
438 if( ! XtIsRealized(w) )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
439 return ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
440
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
441 rects[0].x = 0 ; rects[0].y = 0 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
442 rects[0].width = rw->core.width ; rects[0].height = ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
443 rects[1].x = 0 ; rects[1].y = rw->core.height - ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
444 rects[1].width = rw->core.width ; rects[1].height = ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
445 rects[2].x = 0 ; rects[2].y = ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
446 rects[2].width = ht ; rects[2].height = rw->core.height - ht*2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
447 rects[3].x = rw->core.width - ht ; rects[3].y = ht ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
448 rects[3].width = ht ; rects[3].height = rw->core.height - ht*2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
449 XFillRectangles( XtDisplay(w), XtWindow(w), gc, rects, 4) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
450 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
451
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
452 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
453 RadioHighlight (Widget w,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
454 XEvent *UNUSED (event),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
455 String *UNUSED (params),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
456 Cardinal *UNUSED (num_params))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
457 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
458 RadioWidget rw = (RadioWidget)w;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
459 DrawHighlight(w, rw->command.normal_GC) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
460 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
461
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
462
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
463 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
464 RadioUnhighlight (Widget w,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
465 XEvent *UNUSED (event),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
466 String *UNUSED (params),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
467 Cardinal *UNUSED (num_params))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
468 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
469 RadioWidget rw = (RadioWidget)w;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
470 DrawHighlight(w, rw->command.inverse_GC) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
471 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
472
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
473
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
474 /* ARGSUSED */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
475 void
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
476 RadioSet (Widget w,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
477 XEvent *UNUSED (event),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
478 String *UNUSED (params),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
479 Cardinal *UNUSED (num_params))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
480 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
481 RadioWidget rw = (RadioWidget)w;
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
482 RadioWidgetClass class_ = (RadioWidgetClass) w->core.widget_class ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
483
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
484 if( rw->command.set )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
485 return ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
486
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
487 rw->command.set = TRUE ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
488 if( XtIsRealized(w) )
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
489 class_->radio_class.drawDiamond(w) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
490 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
491
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
492
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
493 /* ARGSUSED */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 434
diff changeset
494 void
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
495 RadioUnset (Widget w,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
496 XEvent *UNUSED (event),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
497 String *UNUSED (params),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 2041
diff changeset
498 Cardinal *UNUSED (num_params))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
499 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
500 RadioWidget rw = (RadioWidget)w;
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
501 RadioWidgetClass class_ = (RadioWidgetClass) w->core.widget_class ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
502
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
503 if( ! rw->command.set )
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
504 return ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
505
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
506 rw->command.set = FALSE ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
507 if( XtIsRealized(w) )
1201
c2569faae8ed [xemacs-hg @ 2003-01-12 10:45:53 by michaels]
michaels
parents: 458
diff changeset
508 class_->radio_class.drawDiamond(w) ;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
509 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
510
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
511
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
512
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
513
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
514 /************************************************************
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
515 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
516 * Internal Procedures
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
517 *
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
518 ************************************************************/
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
519
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
520
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
521 /* Size of widget. Width is size of box plus width of border around
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
522 * box plus width of label plus three margins plus the size of the left
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
523 * bitmap, if any. Height is max(box,bitmap,label) plus two margins.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
524 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
525
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
526 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
527 RadioSize (RadioWidget rw,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
528 Dimension *w,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
529 Dimension *h)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
530 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
531 *w = rw->label.label_width + bs(rw) + LEFT_OFFSET(rw) +
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
532 3 * rw->label.internal_width ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
533 *h = Max( rw->label.label_height, bs(rw) ) +
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
534 2 * rw->label.internal_width ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
535 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
536
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
537
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
538 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
539 DrawDiamond (Widget w)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
540 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
541 RadioWidget rw = (RadioWidget) w ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
542 Display *dpy = XtDisplay(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
543 Window win = XtWindow(w) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
544 GC gc, gci ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
545
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
546 XPoint pts[5] ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
547 Dimension del = bsize(rw)/2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
548 Position x,y ; /* diamond center */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
549 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
550 int i=0;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
551 Dimension s = swid(rw) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
552 GC top, bot, ctr ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
553 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
554 gc = XtIsSensitive(w) ? rw->command.normal_GC : rw->label.gray_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
555
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
556 gci = rw->command.set ? rw->command.normal_GC : rw->command.inverse_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
557
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
558 x = rw->label.internal_width + bs(rw)/2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
559 y = rw->core.height/2 ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
560
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
561 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
562 if( ! rw->command.set ) {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
563 top = rw->threeD.top_shadow_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
564 bot = rw->threeD.bot_shadow_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
565 ctr = gc ; /* TODO */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
566 } else {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
567 top = rw->threeD.bot_shadow_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
568 bot = rw->threeD.top_shadow_GC ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
569 ctr = gc ; /* TODO */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
570 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
571 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
572
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
573 pts[0].x = x - del ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
574 pts[0].y = y ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
575 pts[1].x = x ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
576 pts[1].y = y - del ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
577 pts[2].x = x + del ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
578 pts[2].y = y ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
579 pts[3].x = x ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
580 pts[3].y = y + del ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
581 pts[4] = pts[0] ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
582 XFillPolygon(dpy,win,gci, pts,4, Convex, CoordModeOrigin) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
583
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
584 #ifdef _ThreeDP_h
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
585 for(i=0; i<s; ++i) {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
586 XDrawLine(dpy,win,bot, x-i-del,y, x,y+del+i) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
587 XDrawLine(dpy,win,bot, x+del+i,y, x,y+del+i) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
588 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
589 for(i=0; i<s; ++i) {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
590 XDrawLine(dpy,win,top, x-del-i,y, x,y-del-i) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
591 XDrawLine(dpy,win,top, x+del+i,y, x,y-del-i) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
592 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
593 #else
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
594 XDrawLines(dpy,win,gc, pts,5, CoordModeOrigin) ;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
595 #endif
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents:
diff changeset
596 }