コード例 #1
0
/*----------------------------------------------------------------------*/
/* extern */ void
_XfeMoveWidget(Widget w,int x,int y)
{
    assert( _XfeIsAlive(w) );

#if 0
	printf("_XfeMoveWidget(%s,%d,%d)\n",XtName(w),width,height);
#endif

#if 0
	assert( x >= 0 );
	assert( y >= 0 );
#endif

	/* Make sure the positions are different */
	if ((_XfeX(w) == x) && (_XfeY(w) == y))
	{
		return;
	}

	/* Configure XfePrimitive or XfeManager classes */
	if (XfeIsPrimitive(w) || XfeIsManager(w))
	{
		XtMoveWidget(w,x,y);
	}

	/* Configure any other class */
	else
	{
		_XmMoveObject(w,x,y);
	}
}
コード例 #2
0
/*----------------------------------------------------------------------*/
/* extern */ void
_XfePreferredGeometry(Widget w,Dimension *width_out,Dimension *height_out)
{
	Dimension width;
	Dimension height;

    assert( _XfeIsAlive(w) );

	if (XfeIsPrimitive(w))
	{
		width  = _XfePreferredWidth(w);
		height = _XfePreferredHeight(w);
	}
	else if (XfeIsManager(w))
	{
		width  = _XfemPreferredWidth(w);
		height = _XfemPreferredHeight(w);
	}
	else
	{
		XtWidgetGeometry reply;

		XtQueryGeometry(w,NULL,&reply);

		if (reply.request_mode & CWWidth)
		{
			width = reply.width;
		}
		else
		{
			width = _XfeWidth(w);
		}


		if (reply.request_mode & CWHeight)
		{
			height = reply.height;
		}
		else
		{
			height = _XfeHeight(w);
		}
	}

	if (width_out)
	{
		*width_out = width;
	}

	if (height_out)
	{
		*height_out = height;
	}
}
コード例 #3
0
/*----------------------------------------------------------------------*/
/* extern */ Boolean
XfeIsPretendSensitive(Widget w)
{
	assert( XfeIsPrimitive(w) );

	if (!_XfeIsAlive(w))
	{
		return False;
	}

	return _XfePretendSensitive(w);
}
コード例 #4
0
/*----------------------------------------------------------------------*/
/* extern */ Boolean
XfeIsSensitive(Widget w)
{
	if (!_XfeIsAlive(w))
	{
		return False;
	}

	if (XfeIsPrimitive(w))
	{
		return _XfeIsSensitive(w);
	}

	return _XfeSensitive(w);
}
コード例 #5
0
/*----------------------------------------------------------------------*/
/* extern */ void
XfeSetPretendSensitive(Widget w,Boolean state)
{
	Arg xargs[1];

	assert( _XfeIsAlive(w) );
	assert( XfeIsPrimitive(w) );

	if (!_XfeIsAlive(w))
	{
		return;
	}

	/* Make sure the state is different */
	if (_XfePretendSensitive(w) == state)
	{
		return;
	}

	XtSetArg(xargs[0],XmNpretendSensitive,state);

	XtSetValues(w,xargs,1);
}
コード例 #6
0
/*----------------------------------------------------------------------*/
/* extern */ void
_XfeConfigureWidget(Widget w,int x,int y,int width,int height)
{
    assert( _XfeIsAlive(w) );

#if 0
	printf("_XfeConfigureWidget(%s,%d,%d,%d,%d)\n",XtName(w),x,y,width,height);
#endif

#if 0
	assert( x >= 0 );
	assert( y >= 0 );

	assert( width > 0 );
	assert( height > 0 );
#endif

	/* Ignore this request if width or height are 0 */
	if (!width || !height)
	{
		return;
	}

	/* Make sure the positions and dimensions are different */
	if ((_XfeX(w) == x) && (_XfeY(w) == y) && 
		(_XfeWidth(w) == width) && (_XfeHeight(w) == height))
	{
		return;
	}

	/* Configure XfePrimitive class */
	if (XfeIsPrimitive(w))
	{
		Boolean use_preferred_height;
		Boolean use_preferred_width;
		
		use_preferred_width = _XfeUsePreferredWidth(w);
		use_preferred_height = _XfeUsePreferredHeight(w);
		
		_XfeUsePreferredWidth(w) = False;
		_XfeUsePreferredHeight(w) = False;
		
		XtConfigureWidget(w,x,y,width,height,_XfeBorderWidth(w));
		
		_XfeUsePreferredWidth(w) = use_preferred_width;
		_XfeUsePreferredHeight(w) = use_preferred_height;
	}
	/* Configure XfeManager class */
	else if (XfeIsManager(w))
	{
		Boolean use_preferred_height;
		Boolean use_preferred_width;

		_XfemOldWidth(w) = _XfeWidth(w);
		_XfemOldHeight(w) = _XfeHeight(w);
		
		use_preferred_width = _XfemUsePreferredWidth(w);
		use_preferred_height = _XfemUsePreferredHeight(w);
		
		_XfemUsePreferredWidth(w) = False;
		_XfemUsePreferredHeight(w) = False;
		
		XtConfigureWidget(w,x,y,width,height,_XfeBorderWidth(w));
		
		_XfemUsePreferredWidth(w) = use_preferred_width;
		_XfemUsePreferredHeight(w) = use_preferred_height;
	}
	/* Configure any other class */
	else
	{
		_XmConfigureObject(w,x,y,width,height,_XfeBorderWidth(w));
	}
}