Exemplo n.º 1
0
/*----------------------------------------------------------------------*/
static Widget
ArrowCreate(Widget w)
{
/*     XfeComboBoxPart *	cp  = _XfeComboBoxPart(w); */
	Widget				arrow = NULL;

	arrow = XtVaCreateWidget(ARROW_NAME,
							 xfeArrowWidgetClass,
							 w,
							 XmNbackground,			_XfeBackgroundPixel(w),
							 XmNbackgroundPixmap,	_XfeBackgroundPixmap(w),
 							 XmNshadowThickness,		1,
/*  							 XmNemulateMotif,			False, */
 							 XmNraiseBorderThickness,	0,
							 XmNraiseOnEnter,			False,
 							 XmNfillOnEnter,			False,
 							 XmNshadowThickness,		0,

							 XmNbuttonType,				XmBUTTON_TOGGLE,

							 NULL);


	XfeOverrideTranslations(arrow,_XfeComboBoxArrowTranslations);

#if 0
	XtAddCallback(arrow,XmNarmCallback,ArrowArmCB,w);
	XtAddCallback(arrow,XmNdisarmCallback,ArrowDisarmCB,w);
	XtAddCallback(arrow,XmNactivateCallback,ArrowActivateCB,w);
#endif

/* 	XtAddCallback(arrow,XmNactivateCallback,ArrowActivateCB,w); */

	return arrow;
}
Exemplo n.º 2
0
/*----------------------------------------------------------------------*/
void
_XfePrimitiveAllocateBackgroundGC(Widget w)
{
	/* Make sure the background gc gets allocated only once */
	if (_XfeBackgroundGC(w))
	{
		return;
	}

	if (_XfePixmapGood(_XfeBackgroundPixmap(w)))
	{
		_XfeBackgroundGC(w) = XfeAllocateTileGc(w,_XfeBackgroundPixmap(w));
	}
	else
	{
		_XfeBackgroundGC(w) = XfeAllocateColorGc(w,_XfeBackgroundPixel(w),
												 None,True);
	}
}
Exemplo n.º 3
0
/*----------------------------------------------------------------------*/
static Widget
TitleLabelCreate(Widget w)
{
/*     XfeComboBoxPart *	cp  = _XfeComboBoxPart(w); */
	Widget				label = NULL;

	label = XtVaCreateWidget(TITLE_NAME,
							 xfeLabelWidgetClass,
							 w,
							 XmNbackground,			_XfeBackgroundPixel(w),
							 XmNbackgroundPixmap,	_XfeBackgroundPixmap(w),
							 XmNshadowThickness,		0,
							 XmNlabelAlignment,		XmALIGNMENT_BEGINNING,
							 NULL);

	/* Add the extra combo box translations to the label */
/* 	XfeOverrideTranslations(label,_XfeComboBoxExtraTranslations); */

	return label;
}
Exemplo n.º 4
0
/*----------------------------------------------------------------------*/
static Widget
TitleTextCreate(Widget w)
{
/*     XfeComboBoxPart *	cp  = _XfeComboBoxPart(w); */
	Widget				text = NULL;

	text = XtVaCreateWidget(TITLE_NAME,
							xmTextFieldWidgetClass,
							w,
							XmNbackground,			_XfeBackgroundPixel(w),
							XmNbackgroundPixmap,	_XfeBackgroundPixmap(w),
							XmNhighlightThickness,	0,
							XmNshadowThickness,		0,
							NULL);


	XtAddCallback(text,XmNfocusCallback,TextFocusCB,w);
	XtAddCallback(text,XmNlosingFocusCallback,TextLosingFocusCB,w);

	return text;
}
Exemplo n.º 5
0
/*----------------------------------------------------------------------*/
static Boolean
SetValues(Widget ow,Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
    /* Reset the configuration Flags */
    _XfeConfigFlags(nw) = XfeConfigNone;
    
    /* Reset the preparation Flags */
    _XfePrepareFlags(nw) = XfePrepareNone;
    
    /* buffer_type */
    if (_XfeBufferType(nw) != _XfeBufferType(ow))
    {
		_XfeBufferType(nw) = _XfeBufferType(ow);
	
		_XfeWarning(nw,MESSAGE7);
    }
    
    /* preferred_height */
    if (_XfePreferredHeight(nw) != _XfePreferredHeight(ow))
    {
		_XfePreferredHeight(nw) = _XfePreferredHeight(ow);
	
		_XfeWarning(nw,MESSAGE2);
    }
    
    /* preferred_width */
    if (_XfePreferredWidth(nw) != _XfePreferredWidth(ow))
    {
		_XfePreferredWidth(nw) = _XfePreferredWidth(ow);
	
		_XfeWarning(nw,MESSAGE3);
    }
    
    /* pointer_inside */
    if (_XfePointerInside(nw) != _XfePointerInside(ow))
    {
		_XfePointerInside(nw) = _XfePointerInside(ow);
	
		_XfeWarning(nw,MESSAGE4);
    }
    
    /* num_popups */
    if (_XfeNumPopups(nw) != _XfeNumPopups(ow))
    {
		_XfeNumPopups(nw) = _XfeNumPopups(ow);
	
		_XfeWarning(nw,MESSAGE5);
    }
    
    /* popup_list */
    if (_XfePopupList(nw) != _XfePopupList(ow))
    {
		_XfePopupList(nw) = _XfePopupList(ow);
	
		_XfeWarning(nw,MESSAGE6);
    }

    /* resize_width */
    if (_XfeUsePreferredWidth(nw) != _XfeUsePreferredWidth(ow))
    {
		if(_XfeUsePreferredWidth(nw))
		{
			_XfeConfigFlags(nw) |= (XfeConfigLayout|
									XfeConfigGeometry|
									XfeConfigExpose);
		}
    }

    /* resize_height */
    if (_XfeUsePreferredHeight(nw) != _XfeUsePreferredHeight(ow))
    {
		if(_XfeUsePreferredHeight(nw))
		{
			_XfeConfigFlags(nw) |= (XfeConfigLayout|
									XfeConfigGeometry|
									XfeConfigExpose);
		}
    }
    
    /* height */
    if (_XfeHeight(nw) != _XfeHeight(ow))
    {
		/* if resize_heigh is True, we dont allow width changes */
		if (_XfeUsePreferredHeight(nw)) 
		{
			_XfeHeight(nw) = _XfeHeight(ow);
		}
		else
		{
			_XfeConfigFlags(nw) |= (XfeConfigLayout|XfeConfigExpose);
		}
    }
    
    /* width */
    if (_XfeWidth(nw) != _XfeWidth(ow))
    {
		/* if resize_width is True, we dont allow width changes */
		if (_XfeUsePreferredWidth(nw)) 
		{
			_XfeWidth(nw) = _XfeWidth(ow);
		}
		else
		{
			_XfeConfigFlags(nw) |= (XfeConfigLayout|XfeConfigExpose);
		}
    }
    
    /* cursor */
    if (_XfeCursor(nw) != _XfeCursor(ow))
    {
		/* If the new cursor is good, define it */
		if (_XfeCursorGood(_XfeCursor(nw)))
		{
			XfeCursorDefine(nw,_XfeCursor(nw));
		}
		else
		{
			XfeCursorUndefine(nw);
		}
    }
    
    /* Changes that affect the layout and geometry */
    if ((_XfeHighlightThickness(nw)	!= _XfeHighlightThickness(ow)) ||
		(_XfeMarginTop(nw)		!= _XfeMarginTop(ow)) ||
		(_XfeMarginBottom(nw)		!= _XfeMarginBottom(ow)) ||
		(_XfeMarginLeft(nw)		!= _XfeMarginLeft(ow)) ||
		(_XfeMarginRight(nw)		!= _XfeMarginRight(ow)) ||       
		(_XfeShadowThickness(nw)		!= _XfeShadowThickness(ow)) ||
		(_XfeUnitType(nw)			!= _XfeUnitType(ow)))
    {
		_XfeConfigFlags(nw) |= (XfeConfigLayout|XfeConfigGeometry|XfeConfigExpose);
    }
    
    /* shadow_type */
    if (_XfeShadowType(nw) != _XfeShadowType(ow))
    {
		/* Make sure the new shadow type is ok */
		XfeRepTypeCheck(nw,XmRShadowType,&_XfeShadowType(nw),XfeDEFAULT_SHADOW_TYPE);
	
		_XfeConfigFlags(nw) |= XfeConfigExpose;
    }
    
    /* sensitive */
    if (_XfeSensitive(nw) != _XfeSensitive(ow))
    {
		_XfeConfigFlags(nw) |= XfeConfigExpose;
    }

    /* pretend_sensitive */
    if (_XfeIsSensitive(nw) != _XfeIsSensitive(ow))
    {
		_XfeConfigFlags(nw) |= XfeConfigExpose;
    }
    
    /* background_pixel or background_pixmap */
    if (((_XfeBackgroundPixel(nw) != _XfeBackgroundPixel(ow)) ||
		 (_XfeBackgroundPixmap(nw) != _XfeBackgroundPixmap(ow))) &&
		(_XfeBufferType(nw) != XmBUFFER_NONE))
    {
		/* Release the old background GC */
		_XfePrimitiveReleaseBackgroundGC(nw);
		
		/* Allocate the new background GC */
		_XfePrimitiveAllocateBackgroundGC(nw);
    }
	
    return _XfePrimitiveChainSetValues(ow,rw,nw,xfePrimitiveWidgetClass);
}