2
/*******************************************************************************
5
*******************************************************************************/
11
/*******************************************************************************
12
Includes, Defines, and Global variables from the Declarations Editor:
13
*******************************************************************************/
15
#include <ExternResources.h>
17
/*******************************************************************************
18
The definition of the context structure:
19
If you create multiple instances of your interface, the context
20
structure ensures that your callbacks use the variables for the
23
For each swidget in the interface, each argument to the Interface
24
function, and each variable in the Instance Specific section of the
25
Declarations Editor, there is an entry in the context structure.
26
and a #define. The #define makes the variable name refer to the
27
corresponding entry in the context structure.
28
*******************************************************************************/
32
swidget UxSelectDescrTable;
33
} _UxCSelectDescrTable;
35
#define SelectDescrTable UxSelectDescrTableContext->UxSelectDescrTable
37
static _UxCSelectDescrTable *UxSelectDescrTableContext;
40
/*******************************************************************************
41
Forward declarations of functions that are defined later in this file.
42
*******************************************************************************/
44
swidget create_SelectDescrTable();
46
/*******************************************************************************
47
The following are callback functions.
48
*******************************************************************************/
50
static void okCallback_SelectDescrTable( UxWidget, UxClientData, UxCallbackArg )
52
XtPointer UxClientData, UxCallbackArg;
54
_UxCSelectDescrTable *UxSaveCtx, *UxContext;
57
UxThisWidget = UxWidgetToSwidget( UxWidget );
58
UxSaveCtx = UxSelectDescrTableContext;
59
UxSelectDescrTableContext = UxContext =
60
(_UxCSelectDescrTable *) UxGetContext( UxThisWidget );
62
XmFileSelectionBoxCallbackStruct *cbs;
65
cbs = (XmFileSelectionBoxCallbackStruct *)UxCallbackArg;
66
XmStringGetLtoR(cbs->value,XmSTRING_DEFAULT_CHARSET,&value);
67
UxPutText(UxFindSwidget("ost_t3"),value);
68
XmTextShowPosition(UxGetWidget(UxFindSwidget("ost_t3")),strlen(value));
70
UxSelectDescrTableContext = UxSaveCtx;
73
static void cancelCB_SelectDescrTable( UxWidget, UxClientData, UxCallbackArg )
75
XtPointer UxClientData, UxCallbackArg;
77
_UxCSelectDescrTable *UxSaveCtx, *UxContext;
80
UxThisWidget = UxWidgetToSwidget( UxWidget );
81
UxSaveCtx = UxSelectDescrTableContext;
82
UxSelectDescrTableContext = UxContext =
83
(_UxCSelectDescrTable *) UxGetContext( UxThisWidget );
86
UxPopdownInterface(dlist);
88
UxSelectDescrTableContext = UxSaveCtx;
91
/*******************************************************************************
92
The 'init_' function sets the private properties for all the
93
swidgets to the values specified in the Property Table.
94
Some properties need to be set after the X widgets have been
95
created and the setting of these properties is done in the
96
'build_' function after the UxCreateWidget call.
97
*******************************************************************************/
99
static void _Uxinit_SelectDescrTable()
101
UxPutDialogTitle( SelectDescrTable, "" );
102
UxPutTextFontList( SelectDescrTable, BoldTextFont );
103
UxPutLabelFontList( SelectDescrTable, BoldTextFont );
104
UxPutButtonFontList( SelectDescrTable, BoldTextFont );
105
UxPutBackground( SelectDescrTable, WindowBackground );
106
UxPutHeight( SelectDescrTable, 400 );
107
UxPutWidth( SelectDescrTable, 350 );
108
UxPutY( SelectDescrTable, 330 );
109
UxPutX( SelectDescrTable, 770 );
110
UxPutUnitType( SelectDescrTable, "pixels" );
111
UxPutResizePolicy( SelectDescrTable, "resize_none" );
115
/*******************************************************************************
116
The 'build_' function creates all the swidgets and X widgets,
117
and sets their properties to the values specified in the
119
*******************************************************************************/
121
static swidget _Uxbuild_SelectDescrTable()
123
/* Create the swidgets */
125
SelectDescrTable = UxCreateFileSelectionBox( "SelectDescrTable", NO_PARENT );
126
UxPutContext( SelectDescrTable, UxSelectDescrTableContext );
127
UxPutDefaultShell( SelectDescrTable, "topLevelShell" );
130
_Uxinit_SelectDescrTable();
132
/* Create the X widgets */
134
UxCreateWidget( SelectDescrTable );
136
UxAddCallback( SelectDescrTable, XmNokCallback,
137
okCallback_SelectDescrTable,
138
(XtPointer) UxSelectDescrTableContext );
139
UxAddCallback( SelectDescrTable, XmNcancelCallback,
140
cancelCB_SelectDescrTable,
141
(XtPointer) UxSelectDescrTableContext );
144
/* Finally, call UxRealizeInterface to create the X windows
145
for the widgets created above. */
147
UxRealizeInterface( SelectDescrTable );
149
return ( SelectDescrTable );
152
/*******************************************************************************
153
The following function includes the code that was entered
154
in the 'Initial Code' and 'Final Code' sections of the
155
Declarations Editor. This function is called from the
156
'Interface function' below.
157
*******************************************************************************/
159
static swidget _Ux_create_SelectDescrTable()
162
_UxCSelectDescrTable *UxContext;
164
UxSelectDescrTableContext = UxContext =
165
(_UxCSelectDescrTable *) UxMalloc( sizeof(_UxCSelectDescrTable) );
167
rtrn = _Uxbuild_SelectDescrTable();
172
/*******************************************************************************
173
The following is the 'Interface function' which is the
174
external entry point for creating this interface.
175
This function should be called from your application or from
177
*******************************************************************************/
179
swidget create_SelectDescrTable()
183
_Uxrtrn = _Ux_create_SelectDescrTable();
188
/*******************************************************************************
190
*******************************************************************************/