#ifndef lint
#endif /* lint */
/*
* Copyright 1989 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/***********************************************************************
*
* MenuButton Widget
*
***********************************************************************/
/*
* MenuButton.c - Source code for MenuButton widget.
*
* This is the source code for the Athena MenuButton widget.
* It is intended to provide an easy method of activating pulldown menus.
*
* Date: May 2, 1989
*
* By: Chris D. Peterson
* MIT X Consortium
* kit@expo.lcs.mit.edu
*/
#include <stdio.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <./Xaw3_1XawInit.h>
#include <./Xaw3_1MenuButtoP.h>
static void Realize();
static void PopupMenu();
static char defaultTranslations[] =
"<EnterWindow>: highlight() \n\
<LeaveWindow>: reset() \n\
<BtnDown>: reset() PopupMenu() ";
/****************************************************************
*
* Full class record constant
*
****************************************************************/
/* Private Data */
{
};
{
{"PopupMenu", PopupMenu}
};
/* %%% Export the actions list as a hack until an Intrinsics interface
* allows applications to call action procedures. Used in xmh: button.c
* Donna Converse, 7 July, 1989. To be removed before R4 public release.
*/
/* End of the hack */
{
"MenuButton", /* class_name */
sizeof(MenuButtonRec), /* size */
XawInitializeWidgetSet, /* class_initialize */
NULL, /* class_part_initialize */
FALSE, /* class_inited */
NULL, /* initialize */
NULL, /* initialize_hook */
Realize, /* realize */
actionsList, /* actions */
resources, /* resources */
NULLQUARK, /* xrm_class */
FALSE, /* compress_motion */
TRUE, /* compress_exposure */
TRUE, /* compress_enterleave */
FALSE, /* visible_interest */
NULL, /* destroy */
XtInheritResize, /* resize */
XtInheritExpose, /* expose */
NULL, /* set_values */
NULL, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
NULL, /* get_values_hook */
NULL, /* accept_focus */
XtVersion, /* version */
NULL, /* callback_private */
defaultTranslations, /* tm_table */
XtInheritQueryGeometry, /* query_geometry */
XtInheritDisplayAccelerator, /* display_accelerator */
NULL /* extension */
}, /* CoreClass fields initialization */
{
XtInheritChangeSensitive /* change_sensitive */
}, /* SimpleClass fields initialization */
{
0, /* field not used */
}, /* LabelClass fields initialization */
{
0, /* field not used */
}, /* CommandClass fields initialization */
{
0, /* field not used */
}, /* MenuButtonClass fields initialization */
};
/* for public consumption */
/****************************************************************
*
* Private Procedures
*
****************************************************************/
/* ARGSUSED */
static void
Widget w;
{
/* We have a window now. Register a grab. */
}
/* ARGSUSED */
static void
Widget w;
{
temp = w;
else
break;
}
return;
}
if (!XtIsRealized(menu))
if (menu_x < 0)
menu_x = 0;
else {
}
if (menu_y < 0)
menu_y = 0;
else {
}
num_args = 0;
}