Ejemplo n.º 1
0
/*----------------------------------------------------------------------*/
/* extern */ void
_XfeConfigureOrHideWidget(Widget w,int x,int y,int width,int height)
{
	assert( _XfeIsAlive(w) );

	/* Make sure the widget is alive */
	if (!_XfeIsAlive(w))
	{
		return;
	}

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

	/* Hide the widget if its dimensions are less thanb zero */
	if (!width || !height)
	{
		_XfeSetMappedWhenManaged(w,False);

		return;
	}

	_XfeConfigureWidget(w,x,y,width,height);

	/* Show the widget */
	_XfeSetMappedWhenManaged(w,True);
}
Ejemplo n.º 2
0
/*----------------------------------------------------------------------*/
/* extern */ void
_XfeResizeWidget(Widget w,int width,int height)
{
    assert( _XfeIsAlive(w) );

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

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

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

	/* Make sure the dimension are different */
	if ((_XfeWidth(w) == width) && (_XfeHeight(w) == height))
	{
		return;
	}

	_XfeConfigureWidget(w,_XfeX(w),_XfeY(w),width,height);
}
Ejemplo n.º 3
0
/*----------------------------------------------------------------------*/
static void
LayoutTitle(Widget w)
{
    XfeFancyBoxPart *	fp = _XfeFancyBoxPart(w);
    XfeComboBoxPart *	cp = _XfeComboBoxPart(w);
	int					x;
	int					total_icon_width = 0;

	if (_XfeIsAlive(fp->icon))
	{
		x = _XfeX(fp->icon) + _XfeWidth(fp->icon);

		total_icon_width = _XfeWidth(fp->icon) + cp->spacing;
	}
	else
	{
		x = CB_OFFSET_LEFT(w,cp) + cp->title_shadow_thickness;
	}

	_XfeConfigureWidget(cp->title,

						x,

						(_XfeHeight(w) - _XfeHeight(cp->title)) / 2,
						
						CB_RECT_WIDTH(w,cp) - 
						cp->spacing -
						_XfeWidth(cp->arrow) -
						total_icon_width -
						2 * cp->title_shadow_thickness,
						
						CB_RECT_HEIGHT(w,cp) - 
						2 * cp->title_shadow_thickness);
}
Ejemplo n.º 4
0
/*----------------------------------------------------------------------*/
static void
ActionPopup(Widget item,XEvent * event,char ** params,Cardinal * nparams)
{
	Widget				w = XfeIsComboBox(item) ? item : _XfeParent(item);
    XfeComboBoxPart *	cp = _XfeComboBoxPart(w);
	int					space_below = ScreenGetSpaceBelow(w);
	int					space_above = ScreenGetSpaceAbove(w);

#if 1
	printf("ActionPopup(%s,above = %d,below = %d)\n",
		   XtName(w),
		   space_above,
		   space_below);
#endif

	/* Check if we are already popped up */
	if (cp->popped_up)
	{
		printf("already popped up\n");

		StickRemoveTimeout(w);

		ListUnmanage(w);
		
		XtVaSetValues(cp->arrow,XmNarmed,False,NULL);

		return;
	}

	space_below = 200;

  	_XfeConfigureWidget(cp->shell,
						XfeRootX(w),
						XfeRootY(w) + _XfeHeight(w),
						_XfeWidth(w),
						space_below);

/*   	XtVaSetValues(cp->list, */
/* 				  XmNlistMarginWidth, 100, */
/* 				  NULL); */

/* 	XtVaSetValues(cp->arrow,XmCArmed,True,NULL); */

/* 	XtPopup(cp->shell,XtGrabNone); */
/* 	XMapRaised(XtDisplay(w),_XfeWindow(cp->shell)); */
/* 	XMapRaised(XtDisplay(w),_XfeWindow(cp->shell)); */

 	cp->remain_popped_up = False;

#if 1
	StickAddTimeout(w);
#endif

 	XtVaSetValues(cp->arrow,XmNarmed,True,NULL);

	ListManage(w);
}
Ejemplo n.º 5
0
/*----------------------------------------------------------------------*/
static void
LayoutArrow(Widget w)
{
    XfeComboBoxPart *	cp = _XfeComboBoxPart(w);

	_XfeConfigureWidget(cp->arrow,

						_XfeWidth(w) - 
						CB_OFFSET_RIGHT(w,cp) - 
						_XfeWidth(cp->arrow),

						(_XfeHeight(w) - _XfeHeight(cp->arrow)) / 2,

						_XfeWidth(cp->arrow),

						_XfeHeight(cp->arrow));
}
Ejemplo n.º 6
0
/*----------------------------------------------------------------------*/
static void
LayoutTitle(Widget w)
{
    XfeComboBoxPart *	cp = _XfeComboBoxPart(w);

	_XfeConfigureWidget(cp->title,

						CB_OFFSET_LEFT(w,cp) + cp->title_shadow_thickness,

						(_XfeHeight(w) - _XfeHeight(cp->title)) / 2,
						
						CB_RECT_WIDTH(w,cp) - 
						cp->spacing -
						_XfeWidth(cp->arrow) -
						2 * cp->title_shadow_thickness,
						
						CB_RECT_HEIGHT(w,cp) - 
						2 * cp->title_shadow_thickness);
}
Ejemplo n.º 7
0
/*----------------------------------------------------------------------*/
static void
IconLayout(Widget w)
{
    XfeFancyBoxPart *	fp = _XfeFancyBoxPart(w);
    XfeComboBoxPart *	cp = _XfeComboBoxPart(w);

	if (!_XfeIsAlive(fp->icon))
	{
		return;
	}

	_XfeConfigureWidget(fp->icon,

						CB_OFFSET_LEFT(w,cp) + 
						cp->title_shadow_thickness +
						cp->spacing,

						(_XfeHeight(w) - _XfeHeight(fp->icon)) / 2,

						_XfeWidth(fp->icon),

						_XfeHeight(fp->icon));
}