| 1 |
|
| 2 |
/******************************************************************************* |
| 3 |
errorDialog1.c |
| 4 |
|
| 5 |
*******************************************************************************/ |
| 6 |
|
| 7 |
#include <stdio.h> |
| 8 |
#include "UxLib.h" |
| 9 |
#include "UxErrorD.h" |
| 10 |
|
| 11 |
/******************************************************************************* |
| 12 |
Includes, Defines, and Global variables from the Declarations Editor: |
| 13 |
*******************************************************************************/ |
| 14 |
|
| 15 |
#include <ExternResources.h> |
| 16 |
|
| 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 |
| 21 |
correct instance. |
| 22 |
|
| 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 |
*******************************************************************************/ |
| 29 |
|
| 30 |
typedef struct |
| 31 |
{ |
| 32 |
swidget UxerrorDialog1; |
| 33 |
} _UxCerrorDialog1; |
| 34 |
|
| 35 |
#define errorDialog1 UxErrorDialog1Context->UxerrorDialog1 |
| 36 |
|
| 37 |
static _UxCerrorDialog1 *UxErrorDialog1Context; |
| 38 |
|
| 39 |
|
| 40 |
/******************************************************************************* |
| 41 |
Forward declarations of functions that are defined later in this file. |
| 42 |
*******************************************************************************/ |
| 43 |
|
| 44 |
swidget create_errorDialog1(); |
| 45 |
|
| 46 |
/******************************************************************************* |
| 47 |
The following are callback functions. |
| 48 |
*******************************************************************************/ |
| 49 |
|
| 50 |
static void createCB_errorDialog1( UxWidget, UxClientData, UxCallbackArg ) |
| 51 |
Widget UxWidget; |
| 52 |
XtPointer UxClientData, UxCallbackArg; |
| 53 |
{ |
| 54 |
_UxCerrorDialog1 *UxSaveCtx, *UxContext; |
| 55 |
swidget UxThisWidget; |
| 56 |
|
| 57 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 58 |
UxSaveCtx = UxErrorDialog1Context; |
| 59 |
UxErrorDialog1Context = UxContext = |
| 60 |
(_UxCerrorDialog1 *) UxGetContext( UxThisWidget ); |
| 61 |
{ |
| 62 |
XtVaSetValues(UxWidget,XmNallowShellResize,True,NULL); |
| 63 |
XtVaSetValues(UxWidget,XmNdialogType,XmDIALOG_ERROR,NULL); |
| 64 |
} |
| 65 |
UxErrorDialog1Context = UxSaveCtx; |
| 66 |
} |
| 67 |
|
| 68 |
/******************************************************************************* |
| 69 |
The 'init_' function sets the private properties for all the |
| 70 |
swidgets to the values specified in the Property Table. |
| 71 |
Some properties need to be set after the X widgets have been |
| 72 |
created and the setting of these properties is done in the |
| 73 |
'build_' function after the UxCreateWidget call. |
| 74 |
*******************************************************************************/ |
| 75 |
|
| 76 |
static void _Uxinit_errorDialog1() |
| 77 |
{ |
| 78 |
UxPutAllowShellResize( errorDialog1, "true" ); |
| 79 |
UxPutMinimizeButtons( errorDialog1, "false" ); |
| 80 |
UxPutLabelFontList( errorDialog1, TextFont ); |
| 81 |
UxPutMessageString( errorDialog1, "" ); |
| 82 |
UxPutDialogTitle( errorDialog1, "Error" ); |
| 83 |
UxPutButtonFontList( errorDialog1, BoldTextFont ); |
| 84 |
UxPutTextFontList( errorDialog1, BoldTextFont ); |
| 85 |
UxPutBackground( errorDialog1, WindowBackground ); |
| 86 |
UxPutHeight( errorDialog1, 140 ); |
| 87 |
UxPutWidth( errorDialog1, 300 ); |
| 88 |
UxPutY( errorDialog1, 150 ); |
| 89 |
UxPutX( errorDialog1, 620 ); |
| 90 |
UxPutUnitType( errorDialog1, "pixels" ); |
| 91 |
UxPutDialogType( errorDialog1, "dialog_file_selection" ); |
| 92 |
|
| 93 |
} |
| 94 |
|
| 95 |
/******************************************************************************* |
| 96 |
The 'build_' function creates all the swidgets and X widgets, |
| 97 |
and sets their properties to the values specified in the |
| 98 |
Property Editor. |
| 99 |
*******************************************************************************/ |
| 100 |
|
| 101 |
static swidget _Uxbuild_errorDialog1() |
| 102 |
{ |
| 103 |
/* Create the swidgets */ |
| 104 |
|
| 105 |
errorDialog1 = UxCreateErrorDialog( "errorDialog1", NO_PARENT ); |
| 106 |
UxPutContext( errorDialog1, UxErrorDialog1Context ); |
| 107 |
UxPutDefaultShell( errorDialog1, "topLevelShell" ); |
| 108 |
|
| 109 |
|
| 110 |
_Uxinit_errorDialog1(); |
| 111 |
|
| 112 |
/* Create the X widgets */ |
| 113 |
|
| 114 |
UxCreateWidget( errorDialog1 ); |
| 115 |
createCB_errorDialog1( UxGetWidget( errorDialog1 ), |
| 116 |
(XtPointer) UxErrorDialog1Context, (XtPointer) NULL ); |
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
/* Finally, call UxRealizeInterface to create the X windows |
| 121 |
for the widgets created above. */ |
| 122 |
|
| 123 |
UxRealizeInterface( errorDialog1 ); |
| 124 |
|
| 125 |
return ( errorDialog1 ); |
| 126 |
} |
| 127 |
|
| 128 |
/******************************************************************************* |
| 129 |
The following function includes the code that was entered |
| 130 |
in the 'Initial Code' and 'Final Code' sections of the |
| 131 |
Declarations Editor. This function is called from the |
| 132 |
'Interface function' below. |
| 133 |
*******************************************************************************/ |
| 134 |
|
| 135 |
static swidget _Ux_create_errorDialog1() |
| 136 |
{ |
| 137 |
swidget rtrn; |
| 138 |
_UxCerrorDialog1 *UxContext; |
| 139 |
|
| 140 |
UxErrorDialog1Context = UxContext = |
| 141 |
(_UxCerrorDialog1 *) UxMalloc( sizeof(_UxCerrorDialog1) ); |
| 142 |
|
| 143 |
rtrn = _Uxbuild_errorDialog1(); |
| 144 |
|
| 145 |
return(rtrn); |
| 146 |
} |
| 147 |
|
| 148 |
/******************************************************************************* |
| 149 |
The following is the 'Interface function' which is the |
| 150 |
external entry point for creating this interface. |
| 151 |
This function should be called from your application or from |
| 152 |
a callback function. |
| 153 |
*******************************************************************************/ |
| 154 |
|
| 155 |
swidget create_errorDialog1() |
| 156 |
{ |
| 157 |
swidget _Uxrtrn; |
| 158 |
|
| 159 |
_Uxrtrn = _Ux_create_errorDialog1(); |
| 160 |
|
| 161 |
return ( _Uxrtrn ); |
| 162 |
} |
| 163 |
|
| 164 |
/******************************************************************************* |
| 165 |
END OF FILE |
| 166 |
*******************************************************************************/ |
| 167 |
|