1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
/* $XConsortium: Display.c /main/2 1996/07/31 16:31:21 schuldy $ */
/* Test created to Check XmNenableThinThickness
*/
#include <testlib.h>
void
PrintValues( Widget w, char *label )
{
Arg args[4];
Dimension shadowThickness;
Dimension highlightThickness;
Dimension detailShadowThickness;
Dimension sashShadowThickness;
(void)printf( "For %s:\n", label );
if ( strcmp(label,"CascadeButton") == 0
|| strcmp(label,"CascadeButtonGadget") == 0
|| strcmp(label,"DrawnButton") == 0
|| strcmp(label,"PushButton") == 0
|| strcmp(label,"PushButtonGadget") == 0
|| strcmp(label,"Text") == 0
|| strcmp(label,"List") == 0
|| strcmp(label,"Scale") == 0 )
{
XtSetArg( args[0], XmNshadowThickness, &shadowThickness );
XtSetArg( args[1], XmNhighlightThickness, &highlightThickness );
XtGetValues( w, args, 2 );
(void)printf( "\tShadow thickness value is \"%d\"\n",
shadowThickness );
(void)printf( "\tHighlight thickness value is \"%d\"\n",
highlightThickness );
return;
}
else if ( strcmp(label,"PanedWindow") == 0 )
{
XtSetArg( args[0], XmNsashShadowThickness, &sashShadowThickness );
XtGetValues( w, args, 1 );
(void)printf( "\tSash Shadow thickness value is \"%d\"\n",
sashShadowThickness );
return;
}
else if ( strcmp(label,"ScrollBar") == 0
|| strcmp(label,"SelectionBox") == 0 )
{
XtSetArg( args[0], XmNshadowThickness, &shadowThickness );
XtGetValues( w, args, 1 );
(void)printf( "\tShadow thickness value is \"%d\"\n",
shadowThickness );
return;
}
else if ( strcmp(label,"ArrowButton") == 0
|| strcmp(label,"ArrowButtonGadget") == 0 )
{
XtSetArg( args[0], XmNdetailShadowThickness, &detailShadowThickness );
XtSetArg( args[1], XmNshadowThickness, &shadowThickness );
XtSetArg( args[2], XmNhighlightThickness, &highlightThickness );
XtGetValues( w, args, 3 );
(void)printf( "\tDetail shadow thickness value is \"%d\"\n",
detailShadowThickness );
(void)printf( "\tShadow thickness value is \"%d\"\n",
shadowThickness );
(void)printf( "\tHighlight thickness value is \"%d\"\n",
highlightThickness );
return;
}
else if ( strcmp(label,"ToggleButton") == 0
|| strcmp(label,"ToggleButtonGadget" ) == 0 )
{
XtSetArg( args[0], XmNdetailShadowThickness, &detailShadowThickness );
XtSetArg( args[1], XmNhighlightThickness, &highlightThickness );
XtGetValues( w, args, 2 );
(void)printf( "\tDetail shadow thickness value is \"%d\"\n",
detailShadowThickness );
(void)printf( "\tHighlight thickness value is \"%d\"\n",
highlightThickness );
return;
}
else
{
(void)fprintf( stderr, "Coding Error in test: Unknown type %s\n",
label );
exit(1);
}
/*NOTREACHED*/
return;
}
#define DoWidget( widname ) \
{ \
Widget widgetname; \
widgetname = XmCreate ## widname ( Shell1, #widname, NULL, 0 ); \
PrintValues( widgetname, #widname ); \
CommonPause (); \
XtDestroyWidget( widgetname ); \
}
#define DoGadget( gadname, parenttype ) \
{ \
Widget gadgetname; \
Widget manager; \
manager = XmCreate ## parenttype( Shell1, "GadgetManager", NULL, 0 ); \
gadgetname = XmCreate ## gadname ( manager, #gadname, NULL, 0 ); \
XtManageChild( gadgetname ); \
PrintValues( gadgetname, #gadname ); \
CommonPause(); \
XtDestroyWidget( gadgetname ); \
XtDestroyWidget( manager ); \
}
int
main (int argc, char **argv)
{
CommonTestInit (argc,argv);
XtRealizeWidget (Shell1);
DoWidget(List);
DoWidget(CascadeButton);
DoWidget(Text);
DoWidget(PanedWindow);
DoWidget(Scale);
DoWidget(ScrollBar);
DoWidget(SelectionBox);
DoWidget(ArrowButton);
DoWidget(ToggleButton);
DoWidget(DrawnButton);
DoWidget(PushButton);
DoGadget(CascadeButtonGadget, MenuBar);
DoGadget(PushButtonGadget, RowColumn);
DoGadget(ArrowButtonGadget, RowColumn);
DoGadget(ToggleButtonGadget, RowColumn);
CommonPause(); /* Just to clean up */
XtAppMainLoop (app_context);
/* Cleanup to simplify memory testing usage */
XtDestroyWidget( Shell1 );
return 0;
}
|