1
/* @(#)HelpShell.c 19.1 (ES0-DMD) 02/25/03 13:45:56 */
2
/*===========================================================================
3
Copyright (C) 1995 European Southern Observatory (ESO)
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License as
7
published by the Free Software Foundation; either version 2 of
8
the License, or (at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public
16
License along with this program; if not, write to the Free
17
Software Foundation, Inc., 675 Massachusetss Ave, Cambridge,
20
Corresponding concerning ESO-MIDAS should be addressed as follows:
21
Internet e-mail: midas@eso.org
22
Postal address: European Southern Observatory
23
Data Management Division
24
Karl-Schwarzschild-Strasse 2
25
D 85748 Garching bei Muenchen
27
===========================================================================*/
30
/*******************************************************************************
33
*******************************************************************************/
44
/*******************************************************************************
45
Includes, Defines, and Global variables from the Declarations Editor:
46
*******************************************************************************/
48
#include <ExternResources.h>
50
/*******************************************************************************
51
The definition of the context structure:
52
If you create multiple instances of your interface, the context
53
structure ensures that your callbacks use the variables for the
56
For each swidget in the interface, each argument to the Interface
57
function, and each variable in the Instance Specific section of the
58
Declarations Editor, there is an entry in the context structure.
59
and a #define. The #define makes the variable name refer to the
60
corresponding entry in the context structure.
61
*******************************************************************************/
67
swidget UxscrolledWindow9;
69
swidget Uxtx_extended_help;
71
swidget Uxpb_help_return;
74
#define HelpShell UxHelpShellContext->UxHelpShell
75
#define form21 UxHelpShellContext->Uxform21
76
#define scrolledWindow9 UxHelpShellContext->UxscrolledWindow9
77
#define rowColumn8 UxHelpShellContext->UxrowColumn8
78
#define tx_extended_help UxHelpShellContext->Uxtx_extended_help
79
#define help_print UxHelpShellContext->Uxhelp_print
80
#define pb_help_return UxHelpShellContext->Uxpb_help_return
82
static _UxCHelpShell *UxHelpShellContext;
85
/*******************************************************************************
86
Forward declarations of functions that are defined later in this file.
87
*******************************************************************************/
89
swidget create_HelpShell();
91
/*******************************************************************************
92
The following are callback functions.
93
*******************************************************************************/
95
static void activateCB_pb_help_return( UxWidget, UxClientData, UxCallbackArg )
97
XtPointer UxClientData, UxCallbackArg;
99
_UxCHelpShell *UxSaveCtx, *UxContext;
100
swidget UxThisWidget;
102
UxThisWidget = UxWidgetToSwidget( UxWidget );
103
UxSaveCtx = UxHelpShellContext;
104
UxHelpShellContext = UxContext =
105
(_UxCHelpShell *) UxGetContext( UxThisWidget );
107
UxPopdownInterface(UxFindSwidget("HelpShell"));
111
UxHelpShellContext = UxSaveCtx;
114
/*******************************************************************************
115
The 'init_' function sets the private properties for all the
116
swidgets to the values specified in the Property Table.
117
Some properties need to be set after the X widgets have been
118
created and the setting of these properties is done in the
119
'build_' function after the UxCreateWidget call.
120
*******************************************************************************/
122
static void _Uxinit_HelpShell()
124
UxPutGeometry( HelpShell, "-0+0" );
125
UxPutBackground( HelpShell, ButtonBackground );
126
UxPutIconName( HelpShell, "Extended help" );
127
UxPutKeyboardFocusPolicy( HelpShell, "pointer" );
128
UxPutTitle( HelpShell, "Extended help" );
129
UxPutHeight( HelpShell, 415 );
130
UxPutWidth( HelpShell, 700 );
131
UxPutY( HelpShell, 70 );
132
UxPutX( HelpShell, 20 );
134
UxPutBackground( form21, ButtonBackground );
135
UxPutHeight( form21, 284 );
136
UxPutWidth( form21, 664 );
139
UxPutUnitType( form21, "pixels" );
140
UxPutResizePolicy( form21, "resize_none" );
142
UxPutBackground( scrolledWindow9, WindowBackground );
143
UxPutScrollBarPlacement( scrolledWindow9, "bottom_left" );
144
UxPutHeight( scrolledWindow9, 372 );
145
UxPutWidth( scrolledWindow9, 710 );
146
UxPutY( scrolledWindow9, 2 );
147
UxPutX( scrolledWindow9, 0 );
148
UxPutScrollingPolicy( scrolledWindow9, "automatic" );
150
UxPutEntryAlignment( rowColumn8, "alignment_beginning" );
151
UxPutBackground( rowColumn8, "white" );
152
UxPutOrientation( rowColumn8, "horizontal" );
153
UxPutHeight( rowColumn8, 427 );
154
UxPutWidth( rowColumn8, 418 );
155
UxPutY( rowColumn8, 4 );
156
UxPutX( rowColumn8, 25 );
158
UxPutHighlightColor( tx_extended_help, "Black" );
159
UxPutForeground( tx_extended_help, TextForeground );
160
UxPutCursorPositionVisible( tx_extended_help, "false" );
161
UxPutEditMode( tx_extended_help, "multi_line_edit" );
162
UxPutFontList( tx_extended_help, SmallFont );
163
UxPutBackground( tx_extended_help, TextBackground );
164
UxPutHeight( tx_extended_help, 853 );
165
UxPutWidth( tx_extended_help, 673 );
166
UxPutY( tx_extended_help, 3 );
167
UxPutX( tx_extended_help, 3 );
169
UxPutForeground( help_print, ButtonForeground );
170
UxPutHighlightOnEnter( help_print, "true" );
171
UxPutHighlightColor( help_print, "Black" );
172
UxPutFontList( help_print, BoldTextFont );
173
UxPutLabelString( help_print, "Print" );
174
UxPutBackground( help_print, ButtonBackground );
175
UxPutHeight( help_print, 32 );
176
UxPutWidth( help_print, 82 );
177
UxPutY( help_print, 378 );
178
UxPutX( help_print, 516 );
180
UxPutForeground( pb_help_return, CancelForeground );
181
UxPutHighlightOnEnter( pb_help_return, "true" );
182
UxPutHighlightColor( pb_help_return, "red" );
183
UxPutLabelString( pb_help_return, "Quit" );
184
UxPutFontList( pb_help_return, BoldTextFont );
185
UxPutBackground( pb_help_return, ButtonBackground );
186
UxPutHeight( pb_help_return, 32 );
187
UxPutWidth( pb_help_return, 82 );
188
UxPutY( pb_help_return, 378 );
189
UxPutX( pb_help_return, 604 );
193
/*******************************************************************************
194
The 'build_' function creates all the swidgets and X widgets,
195
and sets their properties to the values specified in the
197
*******************************************************************************/
199
static swidget _Uxbuild_HelpShell()
201
/* Create the swidgets */
203
HelpShell = UxCreateTopLevelShell( "HelpShell", NO_PARENT );
204
UxPutContext( HelpShell, UxHelpShellContext );
206
form21 = UxCreateForm( "form21", HelpShell );
207
scrolledWindow9 = UxCreateScrolledWindow( "scrolledWindow9", form21 );
208
rowColumn8 = UxCreateRowColumn( "rowColumn8", scrolledWindow9 );
209
tx_extended_help = UxCreateText( "tx_extended_help", rowColumn8 );
210
help_print = UxCreatePushButton( "help_print", form21 );
211
pb_help_return = UxCreatePushButton( "pb_help_return", form21 );
215
/* Create the X widgets */
217
UxCreateWidget( HelpShell );
218
UxCreateWidget( form21 );
219
UxCreateWidget( scrolledWindow9 );
220
UxCreateWidget( rowColumn8 );
221
UxCreateWidget( tx_extended_help );
222
UxCreateWidget( help_print );
223
UxCreateWidget( pb_help_return );
225
UxAddCallback( pb_help_return, XmNactivateCallback,
226
activateCB_pb_help_return,
227
(XtPointer) UxHelpShellContext );
230
/* Finally, call UxRealizeInterface to create the X windows
231
for the widgets created above. */
233
UxRealizeInterface( HelpShell );
235
return ( HelpShell );
238
/*******************************************************************************
239
The following function includes the code that was entered
240
in the 'Initial Code' and 'Final Code' sections of the
241
Declarations Editor. This function is called from the
242
'Interface function' below.
243
*******************************************************************************/
245
static swidget _Ux_create_HelpShell()
248
_UxCHelpShell *UxContext;
250
UxHelpShellContext = UxContext =
251
(_UxCHelpShell *) UxMalloc( sizeof(_UxCHelpShell) );
253
rtrn = _Uxbuild_HelpShell();
258
/*******************************************************************************
259
The following is the 'Interface function' which is the
260
external entry point for creating this interface.
261
This function should be called from your application or from
263
*******************************************************************************/
265
swidget create_HelpShell()
269
_Uxrtrn = _Ux_create_HelpShell();
274
/*******************************************************************************
276
*******************************************************************************/