SimpleMenu.cpp
/*	Function Name: MoveMenu
 *	Description: Actually moves the menu, may force it to
 *                   to be fully visable if menu_on_screen is TRUE.
 *	Arguments: w - the simple menu widget.
 *                 x, y - the current location of the widget.
 *	Returns: none 
 */
Function Name: MoveMenu
Description: Actually moves the menu, may force it to
to be fully visable if menu_on_screen is TRUE.
Arguments: w - the simple menu widget.
x, y - the current location of the widget.
Returns: none
Function Name : MoveMenu Description : Actually moves the menu may force it to to be fully visable if menu_on_screen is TRUE . Arguments : w - the simple menu widget . x y - the current location of the widget . Returns : none
static void
MoveMenu(Widget w, Position x, Position y)
{
    Arg arglist[2];
    Cardinal num_args = 0;
    SimpleMenuWidget smw = (SimpleMenuWidget) w;
    if (smw->simple_menu.menu_on_screen) {
	int width = w->core.width + 2 * w->core.border_width;
	int height = w->core.height + 2 * w->core.border_width;
	if (x >= 0) {
	    int scr_width = WidthOfScreen(XtScreen(w));
	    if (x + width > scr_width)
		x = scr_width - width;
	}
	if (x < 0) 
	    x = 0;
	if (y >= 0) {
	    int scr_height = HeightOfScreen(XtScreen(w));
	    if (y + height > scr_height)
		y = scr_height - height;
	}
	if (y < 0)
	    y = 0;
    }
    XtSetArg(arglist[num_args], XtNx, x); num_args++;
    XtSetArg(arglist[num_args], XtNy, y); num_args++;
    XtSetValues(w, arglist, num_args);
}
static void MoveMenu ( Widget w , Position x , Position y ) { Arg arglist [ 2 ] ; Cardinal num_args = 0 ; SimpleMenuWidget smw = ( SimpleMenuWidget ) w ; if ( smw -> simple_menu . menu_on_screen ) { int width = w -> core . width + 2 * w -> core . border_width ; int height = w -> core . height + 2 * w -> core . border_width ; if ( x >= 0 ) { int scr_width = WidthOfScreen ( XtScreen ( w ) ) ; if ( x + width > scr_width ) x = scr_width - width ; } if ( x < 0 ) x = 0 ; if ( y >= 0 ) { int scr_height = HeightOfScreen ( XtScreen ( w ) ) ; if ( y + height > scr_height ) y = scr_height - height ; } if ( y < 0 ) y = 0 ; } XtSetArg ( arglist [ num_args ] , XtNx , x ) ; num_args ++ ; XtSetArg ( arglist [ num_args ] , XtNy , y ) ; num_args ++ ; XtSetValues ( w , arglist , num_args ) ; }
Function Name: MoveMenu
      Description: Actually moves the menu, may force it to
                   to be fully visable if menu_on_screen is TRUE.
Function Name : MoveMenu Description : Actually moves the menu may force it to to be fully visable if menu_on_screen is TRUE .