~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to gui/XAlice/src/LabelCursor.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*===========================================================================
 
2
  Copyright (C) 1995-2009 European Southern Observatory (ESO)
 
3
 
 
4
  This program is free software; you can redistribute it and/or 
 
5
  modify it under the terms of the GNU General Public License as 
 
6
  published by the Free Software Foundation; either version 2 of 
 
7
  the License, or (at your option) any later version.
 
8
 
 
9
  This program is distributed in the hope that it will be useful,
 
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
  GNU General Public License for more details.
 
13
 
 
14
  You should have received a copy of the GNU General Public 
 
15
  License along with this program; if not, write to the Free 
 
16
  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, 
 
17
  MA 02139, USA.
 
18
 
 
19
  Correspondence concerning ESO-MIDAS should be addressed as follows:
 
20
        Internet e-mail: midas@eso.org
 
21
        Postal address: European Southern Observatory
 
22
                        Data Management Division 
 
23
                        Karl-Schwarzschild-Strasse 2
 
24
                        D 85748 Garching bei Muenchen 
 
25
                        GERMANY
 
26
===========================================================================*/
 
27
 
 
28
 
 
29
 
 
30
/*******************************************************************************
 
31
        LabelCursor.c
 
32
 
 
33
*******************************************************************************/
 
34
 
 
35
#include <stdio.h>
 
36
#include "UxLib.h"
 
37
#include "UxArrB.h"
 
38
#include "UxLabel.h"
 
39
#include "UxText.h"
 
40
#include "UxSep.h"
 
41
#include "UxPushB.h"
 
42
#include "UxForm.h"
 
43
#include "UxTopSh.h"
 
44
 
 
45
/*******************************************************************************
 
46
        Includes, Defines, and Global variables from the Declarations Editor:
 
47
*******************************************************************************/
 
48
 
 
49
#include <ExternResources.h>
 
50
#include <alice_global.h>
 
51
 
 
52
/*******************************************************************************
 
53
        The definition of the context structure:
 
54
        If you create multiple instances of your interface, the context
 
55
        structure ensures that your callbacks use the variables for the
 
56
        correct instance.
 
57
 
 
58
        For each swidget in the interface, each argument to the Interface
 
59
        function, and each variable in the Instance Specific section of the
 
60
        Declarations Editor, there is an entry in the context structure.
 
61
        and a #define.  The #define makes the variable name refer to the
 
62
        corresponding entry in the context structure.
 
63
*******************************************************************************/
 
64
 
 
65
typedef struct
 
66
{
 
67
        swidget UxLabelCursor;
 
68
        swidget Uxform10;
 
69
        swidget Uxform11;
 
70
        swidget UxOkLabelCursor;
 
71
        swidget UxCancelLabel;
 
72
        swidget UxDefaultLabel;
 
73
        swidget Uxseparator2;
 
74
        swidget UxLabelText;
 
75
        swidget Uxlabel13;
 
76
        swidget UxAngleText;
 
77
        swidget UxSizeText;
 
78
        swidget UxFontText;
 
79
        swidget Uxlabel14;
 
80
        swidget Uxlabel15;
 
81
        swidget Uxlabel16;
 
82
        swidget UxarrowButton13;
 
83
        swidget UxarrowButton14;
 
84
} _UxCLabelCursor;
 
85
 
 
86
#define LabelCursor             UxLabelCursorContext->UxLabelCursor
 
87
#define form10                  UxLabelCursorContext->Uxform10
 
88
#define form11                  UxLabelCursorContext->Uxform11
 
89
#define OkLabelCursor           UxLabelCursorContext->UxOkLabelCursor
 
90
#define CancelLabel             UxLabelCursorContext->UxCancelLabel
 
91
#define DefaultLabel            UxLabelCursorContext->UxDefaultLabel
 
92
#define separator2              UxLabelCursorContext->Uxseparator2
 
93
#define LabelText               UxLabelCursorContext->UxLabelText
 
94
#define label13                 UxLabelCursorContext->Uxlabel13
 
95
#define AngleText               UxLabelCursorContext->UxAngleText
 
96
#define SizeText                UxLabelCursorContext->UxSizeText
 
97
#define FontText                UxLabelCursorContext->UxFontText
 
98
#define label14                 UxLabelCursorContext->Uxlabel14
 
99
#define label15                 UxLabelCursorContext->Uxlabel15
 
100
#define label16                 UxLabelCursorContext->Uxlabel16
 
101
#define arrowButton13           UxLabelCursorContext->UxarrowButton13
 
102
#define arrowButton14           UxLabelCursorContext->UxarrowButton14
 
103
 
 
104
static _UxCLabelCursor  *UxLabelCursorContext;
 
105
 
 
106
extern void  labelCursor(), putFontText(), out_error();
 
107
 
 
108
 
 
109
/*******************************************************************************
 
110
        The following are translation tables.
 
111
*******************************************************************************/
 
112
 
 
113
static char     *CursorTab = "#override\n\
 
114
<Key>Delete:delete-previous-character()\n\
 
115
<Key>BackSpace:delete-previous-character()\n\
 
116
<Key>osfBackSpace:delete-previous-character()\n\
 
117
<Key>osfDelete:delete-previous-character()\n";
 
118
 
 
119
/*******************************************************************************
 
120
        Forward declarations of functions that are defined later in this file.
 
121
*******************************************************************************/
 
122
 
 
123
swidget create_LabelCursor();
 
124
 
 
125
/*******************************************************************************
 
126
        The following are callback functions.
 
127
*******************************************************************************/
 
128
 
 
129
static void     activateCB_OkLabelCursor( UxWidget, UxClientData, UxCallbackArg )
 
130
        Widget          UxWidget;
 
131
        XtPointer       UxClientData, UxCallbackArg;
 
132
{
 
133
        _UxCLabelCursor         *UxSaveCtx, *UxContext;
 
134
        swidget                 UxThisWidget;
 
135
 
 
136
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
137
        UxSaveCtx = UxLabelCursorContext;
 
138
        UxLabelCursorContext = UxContext =
 
139
                        (_UxCLabelCursor *) UxGetContext( UxThisWidget );
 
140
        {
 
141
        char label[240];
 
142
        strcpy(label, UxGetText(UxFindSwidget("LabelText")));
 
143
        labelCursor(label,plotAngle,plotSize,plotFont);
 
144
         
 
145
        
 
146
         
 
147
         
 
148
        }
 
149
        UxLabelCursorContext = UxSaveCtx;
 
150
}
 
151
 
 
152
static void     activateCB_CancelLabel( UxWidget, UxClientData, UxCallbackArg )
 
153
        Widget          UxWidget;
 
154
        XtPointer       UxClientData, UxCallbackArg;
 
155
{
 
156
        _UxCLabelCursor         *UxSaveCtx, *UxContext;
 
157
        swidget                 UxThisWidget;
 
158
 
 
159
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
160
        UxSaveCtx = UxLabelCursorContext;
 
161
        UxLabelCursorContext = UxContext =
 
162
                        (_UxCLabelCursor *) UxGetContext( UxThisWidget );
 
163
        {
 
164
        UxPopdownInterface(LabelCursor);
 
165
        }
 
166
        UxLabelCursorContext = UxSaveCtx;
 
167
}
 
168
 
 
169
static void     activateCB_DefaultLabel( UxWidget, UxClientData, UxCallbackArg )
 
170
        Widget          UxWidget;
 
171
        XtPointer       UxClientData, UxCallbackArg;
 
172
{
 
173
        _UxCLabelCursor         *UxSaveCtx, *UxContext;
 
174
        swidget                 UxThisWidget;
 
175
 
 
176
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
177
        UxSaveCtx = UxLabelCursorContext;
 
178
        UxLabelCursorContext = UxContext =
 
179
                        (_UxCLabelCursor *) UxGetContext( UxThisWidget );
 
180
        {
 
181
        plotFont = 0;
 
182
        plotAngle = 0.0;
 
183
        plotSize = 1.5;
 
184
        UxPutText(UxFindSwidget("AngleText"),"0");
 
185
        UxPutText(UxFindSwidget("SizeText"),"1.5");
 
186
        UxPutText(UxFindSwidget("FontText"),"Standard");
 
187
        UxPutText(UxFindSwidget("LabelText"),"");
 
188
        }
 
189
        UxLabelCursorContext = UxSaveCtx;
 
190
}
 
191
 
 
192
static void     modifyVerifyCB_AngleText( UxWidget, UxClientData, UxCallbackArg )
 
193
        Widget          UxWidget;
 
194
        XtPointer       UxClientData, UxCallbackArg;
 
195
{
 
196
        _UxCLabelCursor         *UxSaveCtx, *UxContext;
 
197
        swidget                 UxThisWidget;
 
198
 
 
199
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
200
        UxSaveCtx = UxLabelCursorContext;
 
201
        UxLabelCursorContext = UxContext =
 
202
                        (_UxCLabelCursor *) UxGetContext( UxThisWidget );
 
203
        {
 
204
        plotModAngle = TRUE;
 
205
        }
 
206
        UxLabelCursorContext = UxSaveCtx;
 
207
}
 
208
 
 
209
static void     losingFocusCB_AngleText( UxWidget, UxClientData, UxCallbackArg )
 
210
        Widget          UxWidget;
 
211
        XtPointer       UxClientData, UxCallbackArg;
 
212
{
 
213
        _UxCLabelCursor         *UxSaveCtx, *UxContext;
 
214
        swidget                 UxThisWidget;
 
215
 
 
216
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
217
        UxSaveCtx = UxLabelCursorContext;
 
218
        UxLabelCursorContext = UxContext =
 
219
                        (_UxCLabelCursor *) UxGetContext( UxThisWidget );
 
220
        {
 
221
        float aux_angle;
 
222
        char out[20];
 
223
        if( plotModAngle)
 
224
        { plotModAngle = FALSE;
 
225
          if(sscanf(UxGetText( UxFindSwidget("AngleText") ) ,"%f",&aux_angle)==1)
 
226
           plotAngle = aux_angle;
 
227
          else
 
228
          {
 
229
          sprintf(out,"%g",plotAngle);
 
230
          UxPutText( UxFindSwidget("AngleText") ,out); 
 
231
          out_error("Invalid angle input");
 
232
          }  
 
233
        }
 
234
        }
 
235
        UxLabelCursorContext = UxSaveCtx;
 
236
}
 
237
 
 
238
static void     modifyVerifyCB_SizeText( UxWidget, UxClientData, UxCallbackArg )
 
239
        Widget          UxWidget;
 
240
        XtPointer       UxClientData, UxCallbackArg;
 
241
{
 
242
        _UxCLabelCursor         *UxSaveCtx, *UxContext;
 
243
        swidget                 UxThisWidget;
 
244
 
 
245
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
246
        UxSaveCtx = UxLabelCursorContext;
 
247
        UxLabelCursorContext = UxContext =
 
248
                        (_UxCLabelCursor *) UxGetContext( UxThisWidget );
 
249
        {
 
250
        plotModSize = TRUE;
 
251
        }
 
252
        UxLabelCursorContext = UxSaveCtx;
 
253
}
 
254
 
 
255
static void     losingFocusCB_SizeText( UxWidget, UxClientData, UxCallbackArg )
 
256
        Widget          UxWidget;
 
257
        XtPointer       UxClientData, UxCallbackArg;
 
258
{
 
259
        _UxCLabelCursor         *UxSaveCtx, *UxContext;
 
260
        swidget                 UxThisWidget;
 
261
 
 
262
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
263
        UxSaveCtx = UxLabelCursorContext;
 
264
        UxLabelCursorContext = UxContext =
 
265
                        (_UxCLabelCursor *) UxGetContext( UxThisWidget );
 
266
        {
 
267
        float aux_size;
 
268
        char out[20];
 
269
        if( plotModSize)
 
270
        { plotModSize = FALSE;
 
271
          if(sscanf(UxGetText( UxFindSwidget("SizeText" )) ,"%f",&aux_size)==1)
 
272
           plotSize = aux_size;
 
273
          else
 
274
          {
 
275
          sprintf(out,"%g",plotSize);
 
276
          UxPutText(UxFindSwidget("SizeText") ,out); 
 
277
          out_error("Invalid size input");
 
278
          }  
 
279
        }
 
280
        }
 
281
        UxLabelCursorContext = UxSaveCtx;
 
282
}
 
283
 
 
284
static void     activateCB_arrowButton13( UxWidget, UxClientData, UxCallbackArg )
 
285
        Widget          UxWidget;
 
286
        XtPointer       UxClientData, UxCallbackArg;
 
287
{
 
288
        _UxCLabelCursor         *UxSaveCtx, *UxContext;
 
289
        swidget                 UxThisWidget;
 
290
 
 
291
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
292
        UxSaveCtx = UxLabelCursorContext;
 
293
        UxLabelCursorContext = UxContext =
 
294
                        (_UxCLabelCursor *) UxGetContext( UxThisWidget );
 
295
        {
 
296
        if(plotFont < 5)
 
297
         plotFont++;
 
298
        else 
 
299
         plotFont = 0;
 
300
        putFontText(plotFont);
 
301
        }
 
302
        UxLabelCursorContext = UxSaveCtx;
 
303
}
 
304
 
 
305
static void     activateCB_arrowButton14( UxWidget, UxClientData, UxCallbackArg )
 
306
        Widget          UxWidget;
 
307
        XtPointer       UxClientData, UxCallbackArg;
 
308
{
 
309
        _UxCLabelCursor         *UxSaveCtx, *UxContext;
 
310
        swidget                 UxThisWidget;
 
311
 
 
312
        UxThisWidget = UxWidgetToSwidget( UxWidget );
 
313
        UxSaveCtx = UxLabelCursorContext;
 
314
        UxLabelCursorContext = UxContext =
 
315
                        (_UxCLabelCursor *) UxGetContext( UxThisWidget );
 
316
        {
 
317
        if(plotFont > 1)
 
318
         plotFont--;
 
319
        else 
 
320
         plotFont = 5;
 
321
        putFontText(plotFont);
 
322
        }
 
323
        UxLabelCursorContext = UxSaveCtx;
 
324
}
 
325
 
 
326
/*******************************************************************************
 
327
        The 'init_' function sets the private properties for all the
 
328
        swidgets to the values specified in the Property Table.
 
329
        Some properties need to be set after the X widgets have been
 
330
        created and the setting of these properties is done in the
 
331
        'build_' function after the UxCreateWidget call.
 
332
*******************************************************************************/
 
333
 
 
334
static void     _Uxinit_LabelCursor()
 
335
{
 
336
        UxPutIconName( LabelCursor, "Label Cursor" );
 
337
        UxPutKeyboardFocusPolicy( LabelCursor, "pointer" );
 
338
        UxPutHeight( LabelCursor, 148 );
 
339
        UxPutWidth( LabelCursor, 384 );
 
340
        UxPutY( LabelCursor, 448 );
 
341
        UxPutX( LabelCursor, 533 );
 
342
 
 
343
        UxPutBackground( form10, WindowBackground );
 
344
        UxPutHeight( form10, 98 );
 
345
        UxPutWidth( form10, 182 );
 
346
        UxPutY( form10, 16 );
 
347
        UxPutX( form10, 52 );
 
348
        UxPutUnitType( form10, "pixels" );
 
349
        UxPutResizePolicy( form10, "resize_none" );
 
350
 
 
351
        UxPutBackground( form11, ButtonBackground );
 
352
        UxPutHeight( form11, 52 );
 
353
        UxPutWidth( form11, 386 );
 
354
        UxPutY( form11, 96 );
 
355
        UxPutX( form11, 0 );
 
356
        UxPutResizePolicy( form11, "resize_none" );
 
357
 
 
358
        UxPutHighlightColor( OkLabelCursor, "Black" );
 
359
        UxPutHighlightOnEnter( OkLabelCursor, "true" );
 
360
        UxPutLabelString( OkLabelCursor, "Ok" );
 
361
        UxPutForeground( OkLabelCursor, ButtonForeground );
 
362
        UxPutFontList( OkLabelCursor, BoldTextFont );
 
363
        UxPutBackground( OkLabelCursor, ButtonBackground );
 
364
        UxPutHeight( OkLabelCursor, 30 );
 
365
        UxPutWidth( OkLabelCursor, 90 );
 
366
        UxPutY( OkLabelCursor, 12 );
 
367
        UxPutX( OkLabelCursor, 132 );
 
368
 
 
369
        UxPutHighlightColor( CancelLabel, "Black" );
 
370
        UxPutHighlightOnEnter( CancelLabel, "true" );
 
371
        UxPutLabelString( CancelLabel, "Cancel" );
 
372
        UxPutForeground( CancelLabel, CancelForeground );
 
373
        UxPutFontList( CancelLabel, BoldTextFont );
 
374
        UxPutBackground( CancelLabel, ButtonBackground );
 
375
        UxPutHeight( CancelLabel, 30 );
 
376
        UxPutWidth( CancelLabel, 90 );
 
377
        UxPutY( CancelLabel, 12 );
 
378
        UxPutX( CancelLabel, 240 );
 
379
 
 
380
        UxPutHighlightColor( DefaultLabel, "Black" );
 
381
        UxPutHighlightOnEnter( DefaultLabel, "true" );
 
382
        UxPutLabelString( DefaultLabel, "Default" );
 
383
        UxPutForeground( DefaultLabel, ButtonForeground );
 
384
        UxPutFontList( DefaultLabel, BoldTextFont );
 
385
        UxPutBackground( DefaultLabel, ButtonBackground );
 
386
        UxPutHeight( DefaultLabel, 30 );
 
387
        UxPutWidth( DefaultLabel, 90 );
 
388
        UxPutY( DefaultLabel, 12 );
 
389
        UxPutX( DefaultLabel, 24 );
 
390
 
 
391
        UxPutBackground( separator2, ButtonBackground );
 
392
        UxPutHeight( separator2, 6 );
 
393
        UxPutWidth( separator2, 386 );
 
394
        UxPutY( separator2, 90 );
 
395
        UxPutX( separator2, -2 );
 
396
 
 
397
        UxPutMarginHeight( LabelText, 3 );
 
398
        UxPutHighlightColor( LabelText, "Black" );
 
399
        UxPutForeground( LabelText, TextForeground );
 
400
        UxPutTranslations( LabelText, CursorTab );
 
401
        UxPutFontList( LabelText, TextFont );
 
402
        UxPutHighlightOnEnter( LabelText, "true" );
 
403
        UxPutMaxLength( LabelText, 240 );
 
404
        UxPutBackground( LabelText, TextBackground );
 
405
        UxPutHeight( LabelText, 32 );
 
406
        UxPutWidth( LabelText, 316 );
 
407
        UxPutY( LabelText, 6 );
 
408
        UxPutX( LabelText, 60 );
 
409
 
 
410
        UxPutHighlightColor( label13, "Black" );
 
411
        UxPutForeground( label13, TextForeground );
 
412
        UxPutFontList( label13, TextFont );
 
413
        UxPutLabelString( label13, "Text :" );
 
414
        UxPutBackground( label13, LabelBackground );
 
415
        UxPutHeight( label13, 30 );
 
416
        UxPutWidth( label13, 52 );
 
417
        UxPutY( label13, 8 );
 
418
        UxPutX( label13, 6 );
 
419
 
 
420
        UxPutMarginHeight( AngleText, 3 );
 
421
        UxPutHighlightColor( AngleText, "Black" );
 
422
        UxPutForeground( AngleText, TextForeground );
 
423
        UxPutTranslations( AngleText, CursorTab );
 
424
        UxPutFontList( AngleText, TextFont );
 
425
        UxPutHighlightOnEnter( AngleText, "true" );
 
426
        UxPutMaxLength( AngleText, 40 );
 
427
        UxPutBackground( AngleText, TextBackground );
 
428
        UxPutHeight( AngleText, 32 );
 
429
        UxPutWidth( AngleText, 42 );
 
430
        UxPutY( AngleText, 50 );
 
431
        UxPutX( AngleText, 68 );
 
432
 
 
433
        UxPutMarginHeight( SizeText, 3 );
 
434
        UxPutHighlightColor( SizeText, "Black" );
 
435
        UxPutForeground( SizeText, TextForeground );
 
436
        UxPutTranslations( SizeText, CursorTab );
 
437
        UxPutFontList( SizeText, TextFont );
 
438
        UxPutHighlightOnEnter( SizeText, "true" );
 
439
        UxPutMaxLength( SizeText, 40 );
 
440
        UxPutBackground( SizeText, TextBackground );
 
441
        UxPutHeight( SizeText, 32 );
 
442
        UxPutWidth( SizeText, 42 );
 
443
        UxPutY( SizeText, 50 );
 
444
        UxPutX( SizeText, 170 );
 
445
 
 
446
        UxPutMarginWidth( FontText, 3 );
 
447
        UxPutMarginHeight( FontText, 3 );
 
448
        UxPutHighlightColor( FontText, "Black" );
 
449
        UxPutForeground( FontText, TextForeground );
 
450
        UxPutCursorPositionVisible( FontText, "false" );
 
451
        UxPutFontList( FontText, TextFont );
 
452
        UxPutHighlightOnEnter( FontText, "true" );
 
453
        UxPutColumns( FontText, 12 );
 
454
        UxPutMaxLength( FontText, 20 );
 
455
        UxPutEditable( FontText, "false" );
 
456
        UxPutBackground( FontText, TextBackground );
 
457
        UxPutHeight( FontText, 32 );
 
458
        UxPutWidth( FontText, 94 );
 
459
        UxPutY( FontText, 50 );
 
460
        UxPutX( FontText, 254 );
 
461
 
 
462
        UxPutHighlightColor( label14, "Black" );
 
463
        UxPutForeground( label14, TextForeground );
 
464
        UxPutFontList( label14, TextFont );
 
465
        UxPutLabelString( label14, "Angle :" );
 
466
        UxPutBackground( label14, LabelBackground );
 
467
        UxPutHeight( label14, 30 );
 
468
        UxPutWidth( label14, 58 );
 
469
        UxPutY( label14, 50 );
 
470
        UxPutX( label14, 10 );
 
471
 
 
472
        UxPutHighlightColor( label15, "Black" );
 
473
        UxPutForeground( label15, TextForeground );
 
474
        UxPutFontList( label15, TextFont );
 
475
        UxPutLabelString( label15, "Size :" );
 
476
        UxPutBackground( label15, LabelBackground );
 
477
        UxPutHeight( label15, 30 );
 
478
        UxPutWidth( label15, 58 );
 
479
        UxPutY( label15, 50 );
 
480
        UxPutX( label15, 110 );
 
481
 
 
482
        UxPutHighlightColor( label16, "Black" );
 
483
        UxPutForeground( label16, TextForeground );
 
484
        UxPutFontList( label16, TextFont );
 
485
        UxPutLabelString( label16, "Font :" );
 
486
        UxPutBackground( label16, LabelBackground );
 
487
        UxPutHeight( label16, 30 );
 
488
        UxPutWidth( label16, 40 );
 
489
        UxPutY( label16, 50 );
 
490
        UxPutX( label16, 214 );
 
491
 
 
492
        UxPutBackground( arrowButton13, TextBackground );
 
493
        UxPutHighlightOnEnter( arrowButton13, "true" );
 
494
        UxPutForeground( arrowButton13, MenuBackground );
 
495
        UxPutHeight( arrowButton13, 20 );
 
496
        UxPutWidth( arrowButton13, 30 );
 
497
        UxPutY( arrowButton13, 48 );
 
498
        UxPutX( arrowButton13, 346 );
 
499
 
 
500
        UxPutBackground( arrowButton14, TextBackground );
 
501
        UxPutHighlightOnEnter( arrowButton14, "true" );
 
502
        UxPutForeground( arrowButton14, MenuBackground );
 
503
        UxPutArrowDirection( arrowButton14, "arrow_down" );
 
504
        UxPutHeight( arrowButton14, 20 );
 
505
        UxPutWidth( arrowButton14, 30 );
 
506
        UxPutY( arrowButton14, 66 );
 
507
        UxPutX( arrowButton14, 346 );
 
508
 
 
509
}
 
510
 
 
511
/*******************************************************************************
 
512
        The 'build_' function creates all the swidgets and X widgets,
 
513
        and sets their properties to the values specified in the
 
514
        Property Editor.
 
515
*******************************************************************************/
 
516
 
 
517
static swidget  _Uxbuild_LabelCursor()
 
518
{
 
519
        /* Create the swidgets */
 
520
 
 
521
        LabelCursor = UxCreateTopLevelShell( "LabelCursor", NO_PARENT );
 
522
        UxPutContext( LabelCursor, UxLabelCursorContext );
 
523
 
 
524
        form10 = UxCreateForm( "form10", LabelCursor );
 
525
        form11 = UxCreateForm( "form11", form10 );
 
526
        OkLabelCursor = UxCreatePushButton( "OkLabelCursor", form11 );
 
527
        CancelLabel = UxCreatePushButton( "CancelLabel", form11 );
 
528
        DefaultLabel = UxCreatePushButton( "DefaultLabel", form11 );
 
529
        separator2 = UxCreateSeparator( "separator2", form10 );
 
530
        LabelText = UxCreateText( "LabelText", form10 );
 
531
        label13 = UxCreateLabel( "label13", form10 );
 
532
        AngleText = UxCreateText( "AngleText", form10 );
 
533
        SizeText = UxCreateText( "SizeText", form10 );
 
534
        FontText = UxCreateText( "FontText", form10 );
 
535
        label14 = UxCreateLabel( "label14", form10 );
 
536
        label15 = UxCreateLabel( "label15", form10 );
 
537
        label16 = UxCreateLabel( "label16", form10 );
 
538
        arrowButton13 = UxCreateArrowButton( "arrowButton13", form10 );
 
539
        arrowButton14 = UxCreateArrowButton( "arrowButton14", form10 );
 
540
 
 
541
        _Uxinit_LabelCursor();
 
542
 
 
543
        /* Create the X widgets */
 
544
 
 
545
        UxCreateWidget( LabelCursor );
 
546
        UxCreateWidget( form10 );
 
547
        UxCreateWidget( form11 );
 
548
        UxCreateWidget( OkLabelCursor );
 
549
        UxCreateWidget( CancelLabel );
 
550
        UxCreateWidget( DefaultLabel );
 
551
        UxCreateWidget( separator2 );
 
552
        UxCreateWidget( LabelText );
 
553
        UxCreateWidget( label13 );
 
554
        UxCreateWidget( AngleText );
 
555
        UxCreateWidget( SizeText );
 
556
        UxCreateWidget( FontText );
 
557
        UxCreateWidget( label14 );
 
558
        UxCreateWidget( label15 );
 
559
        UxCreateWidget( label16 );
 
560
        UxCreateWidget( arrowButton13 );
 
561
        UxCreateWidget( arrowButton14 );
 
562
 
 
563
        UxAddCallback( OkLabelCursor, XmNactivateCallback,
 
564
                        activateCB_OkLabelCursor,
 
565
                        (XtPointer) UxLabelCursorContext );
 
566
 
 
567
        UxAddCallback( CancelLabel, XmNactivateCallback,
 
568
                        activateCB_CancelLabel,
 
569
                        (XtPointer) UxLabelCursorContext );
 
570
 
 
571
        UxAddCallback( DefaultLabel, XmNactivateCallback,
 
572
                        activateCB_DefaultLabel,
 
573
                        (XtPointer) UxLabelCursorContext );
 
574
 
 
575
        UxAddCallback( AngleText, XmNmodifyVerifyCallback,
 
576
                        modifyVerifyCB_AngleText,
 
577
                        (XtPointer) UxLabelCursorContext );
 
578
        UxAddCallback( AngleText, XmNlosingFocusCallback,
 
579
                        losingFocusCB_AngleText,
 
580
                        (XtPointer) UxLabelCursorContext );
 
581
 
 
582
        UxAddCallback( SizeText, XmNmodifyVerifyCallback,
 
583
                        modifyVerifyCB_SizeText,
 
584
                        (XtPointer) UxLabelCursorContext );
 
585
        UxAddCallback( SizeText, XmNlosingFocusCallback,
 
586
                        losingFocusCB_SizeText,
 
587
                        (XtPointer) UxLabelCursorContext );
 
588
 
 
589
        UxAddCallback( arrowButton13, XmNactivateCallback,
 
590
                        activateCB_arrowButton13,
 
591
                        (XtPointer) UxLabelCursorContext );
 
592
 
 
593
        UxAddCallback( arrowButton14, XmNactivateCallback,
 
594
                        activateCB_arrowButton14,
 
595
                        (XtPointer) UxLabelCursorContext );
 
596
 
 
597
 
 
598
        /* Finally, call UxRealizeInterface to create the X windows
 
599
           for the widgets created above. */
 
600
 
 
601
        UxRealizeInterface( LabelCursor );
 
602
 
 
603
        return ( LabelCursor );
 
604
}
 
605
 
 
606
/*******************************************************************************
 
607
        The following function includes the code that was entered
 
608
        in the 'Initial Code' and 'Final Code' sections of the
 
609
        Declarations Editor. This function is called from the
 
610
        'Interface function' below.
 
611
*******************************************************************************/
 
612
 
 
613
static swidget  _Ux_create_LabelCursor()
 
614
{
 
615
        swidget                 rtrn;
 
616
        _UxCLabelCursor         *UxContext;
 
617
 
 
618
        UxLabelCursorContext = UxContext =
 
619
                (_UxCLabelCursor *) UxMalloc( sizeof(_UxCLabelCursor) );
 
620
 
 
621
        rtrn = _Uxbuild_LabelCursor();
 
622
 
 
623
        return(rtrn);
 
624
}
 
625
 
 
626
/*******************************************************************************
 
627
        The following is the 'Interface function' which is the
 
628
        external entry point for creating this interface.
 
629
        This function should be called from your application or from
 
630
        a callback function.
 
631
*******************************************************************************/
 
632
 
 
633
swidget create_LabelCursor()
 
634
{
 
635
        swidget                 _Uxrtrn;
 
636
 
 
637
        _Uxrtrn = _Ux_create_LabelCursor();
 
638
 
 
639
        return ( _Uxrtrn );
 
640
}
 
641
 
 
642
/*******************************************************************************
 
643
        END OF FILE
 
644
*******************************************************************************/
 
645