|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* Motif
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* Copyright (c) 1987-2012, The Open Group. All rights reserved.
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* These libraries and programs are free software; you can
|
|
Packit |
b099d7 |
* redistribute them and/or modify them under the terms of the GNU
|
|
Packit |
b099d7 |
* Lesser General Public License as published by the Free Software
|
|
Packit |
b099d7 |
* Foundation; either version 2 of the License, or (at your option)
|
|
Packit |
b099d7 |
* any later version.
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* These libraries and programs are distributed in the hope that
|
|
Packit |
b099d7 |
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
|
Packit |
b099d7 |
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
Packit |
b099d7 |
* PURPOSE. See the GNU Lesser General Public License for more
|
|
Packit |
b099d7 |
* details.
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
b099d7 |
* License along with these librararies and programs; if not, write
|
|
Packit |
b099d7 |
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
|
Packit |
b099d7 |
* Floor, Boston, MA 02110-1301 USA
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* HISTORY
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
#ifdef REV_INFO
|
|
Packit |
b099d7 |
#ifndef lint
|
|
Packit |
b099d7 |
static char rcsid[] = "$XConsortium: ArrowBGad2.c /main/9 1995/07/13 17:27:29 drk $"
|
|
Packit |
b099d7 |
#endif
|
|
Packit |
b099d7 |
#endif
|
|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* (c) Copyright 1987, 1988, 1989 HEWLETT-PACKARD COMPANY */
|
|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* Create a drawing area with a set of arrow gadgets within it.
|
|
Packit |
b099d7 |
* Turn the highlight_thickness and highlight_on_enter resources on.
|
|
Packit |
b099d7 |
* Change the highlight color of the manager to see if it gets reflected
|
|
Packit |
b099d7 |
* in the gadgets.
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#include <signal.h>
|
|
Packit |
b099d7 |
#include <X11/StringDefs.h>
|
|
Packit |
b099d7 |
#include <testlib.h>
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
static void flushEvents();
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
void main (argc, argv)
|
|
Packit |
b099d7 |
unsigned int argc;
|
|
Packit |
b099d7 |
char **argv;
|
|
Packit |
b099d7 |
{
|
|
Packit |
b099d7 |
Widget drawarea;
|
|
Packit |
b099d7 |
Widget arrow[16];
|
|
Packit |
b099d7 |
Arg args[10];
|
|
Packit |
b099d7 |
Arg args2[10];
|
|
Packit |
b099d7 |
int n, i;
|
|
Packit |
b099d7 |
int x, y;
|
|
Packit |
b099d7 |
char buf[32];
|
|
Packit |
b099d7 |
Pixel top_shadow_color;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
CommonTestInit(argc, argv);
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
/* Set the focus-policy to pointer mode for the shell */
|
|
Packit |
b099d7 |
n = 0;
|
|
Packit |
b099d7 |
XtSetArg (args[n], XmNkeyboardFocusPolicy, XmPOINTER); n++;
|
|
Packit |
b099d7 |
XtSetValues (Shell1, args, n);
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
/* The drawing area creation. Contained in an outer frame. */
|
|
Packit |
b099d7 |
i = 0;
|
|
Packit |
b099d7 |
n = 0;
|
|
Packit |
b099d7 |
XtSetArg (args[n], XmNwidth, 400); n++;
|
|
Packit |
b099d7 |
XtSetArg (args[n], XmNheight, 400); n++;
|
|
Packit |
b099d7 |
drawarea = XmCreateDrawingArea (Shell1, "drawarea", args, n);
|
|
Packit |
b099d7 |
XtManageChild (drawarea);
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XtRealizeWidget (Shell1);
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
/* Create a matrix of arrows */
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
for (y = 10; y <= 175; y += 50) {
|
|
Packit |
b099d7 |
for (x = 10; x <= 175; x += 50) {
|
|
Packit |
b099d7 |
n = 0;
|
|
Packit |
b099d7 |
XtSetArg (args[n], XmNx, x); n++;
|
|
Packit |
b099d7 |
XtSetArg (args[n], XmNy, y); n++;
|
|
Packit |
b099d7 |
XtSetArg (args[n], XmNhighlightThickness, 4); n++;
|
|
Packit |
b099d7 |
XtSetArg (args[n], XmNhighlightOnEnter, True); n++;
|
|
Packit |
b099d7 |
sprintf(buf, "arrowButton%d", i );
|
|
Packit |
b099d7 |
arrow[i] = XmCreateArrowButtonGadget(drawarea, buf, args, n);
|
|
Packit |
b099d7 |
XtManageChild(arrow[i]);
|
|
Packit |
b099d7 |
i = i + 1;
|
|
Packit |
b099d7 |
}
|
|
Packit |
b099d7 |
}
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
n = 0;
|
|
Packit |
b099d7 |
XtSetArg (args[n], XmNtopShadowColor, &top_shadow_color); n++;
|
|
Packit |
b099d7 |
XtGetValues (drawarea, args, n);
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
n = 0;
|
|
Packit |
b099d7 |
XtSetArg (args2[n], XmNhighlightColor, top_shadow_color); n++;
|
|
Packit |
b099d7 |
XtSetValues (drawarea, args2, n);
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
CommonPause();
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XtAppMainLoop(app_context);
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
}
|