Esempio n. 1
0
/*----------------------------------------------------------------------*/
static Boolean
SetValues(Widget ow,Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
    XfeArrowPart *	np = _XfeArrowPart(nw);
    XfeArrowPart *	op = _XfeArrowPart(ow);

    /* arrow_direction */
    if (np->arrow_direction != op->arrow_direction)
    {
        /* Make sure arrow direction is ok */
        XfeRepTypeCheck(nw,XmRArrowDirection,&np->arrow_direction,
                        XmARROW_DOWN);

        _XfeConfigFlags(nw) |= XfeConfigExpose;
    }

    /* arrow_width */
    if ((np->arrow_width != op->arrow_width) ||
            (np->arrow_height != op->arrow_height))
    {
        _XfeConfigFlags(nw) |= XfeConfigGLE;
    }

    /* foreground or background */
    if ((_XfeForeground(nw) != _XfeForeground(ow)) ||
            (_XfeBackgroundPixel(nw) != _XfeBackgroundPixel(ow)))
    {
        XtReleaseGC(nw,np->arrow_insens_GC);

        np->arrow_insens_GC = XfeAllocateColorGc(nw,_XfeForeground(nw),_XfeBackgroundPixel(nw),False);

    }

    return _XfePrimitiveChainSetValues(ow,rw,nw,xfeArrowWidgetClass);
}
Esempio n. 2
0
/*----------------------------------------------------------------------*/
static void
Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
    /* Make sure the shadow is ok */
    XfeRepTypeCheck(nw,XmRShadowType,&_XfeShadowType(nw),XfeDEFAULT_SHADOW_TYPE);
    
    /* Make sure the buffer is ok */
    XfeRepTypeCheck(nw,XmRBufferType,&_XfeBufferType(nw),XfeDEFAULT_BUFFER_TYPE);

    /* Initialize private members */
    _XfeBufferPixmap(nw) = XmUNSPECIFIED_PIXMAP;
    _XfeBackgroundGC(nw) = NULL;

    /* Allocate the background gc if needed */
    if (_XfeBufferType(nw) != XmBUFFER_NONE)
    {
		_XfePrimitiveAllocateBackgroundGC(nw);
    }

	/* Finish initialization */
	_XfePrimitiveChainInitialize(rw,nw,xfePrimitiveWidgetClass);
}
Esempio n. 3
0
/*----------------------------------------------------------------------*/
static void
Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
    XfeArrowPart *	ap = _XfeArrowPart(nw);

    /* Make sure rep types are ok */
    XfeRepTypeCheck(nw,XmRArrowDirection,&ap->arrow_direction,XmARROW_DOWN);

    /* Allocate the insensitve GC  */
    ap->arrow_insens_GC = XfeAllocateColorGc(nw,_XfeForeground(nw),_XfeBackgroundPixel(nw),False);

    /* Finish of initialization */
    _XfePrimitiveChainInitialize(rw,nw,xfeArrowWidgetClass);
}
Esempio n. 4
0
/*----------------------------------------------------------------------*/
static Boolean
SetValues(Widget ow,Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
    XfeComboBoxPart *		np = _XfeComboBoxPart(nw);
    XfeComboBoxPart *		op = _XfeComboBoxPart(ow);

	/* title */
	if (np->title != op->title)
	{
		_XmWarning(nw,MESSAGE2);

		np->title = op->title;
	}

	/* list */
	if (np->list != op->list)
	{
		_XmWarning(nw,MESSAGE3);

		np->list = op->list;
	}

	/* shell */
	if (np->shell != op->shell)
	{
		_XmWarning(nw,MESSAGE4);

		np->shell = op->shell;
	}

	/* combo_box_type */
	if (np->combo_box_type != op->combo_box_type)
	{
		TitleConfigure(nw);

		_XfemConfigFlags(nw) |= XfeConfigExpose;

#if 0
		_XmWarning(nw,MESSAGE6);

		np->combo_box_type = op->combo_box_type;
#endif
	}

	/* title_shadow_thickness */
	if (np->title_shadow_thickness != op->title_shadow_thickness)
	{
		_XfemConfigFlags(nw) |= XfeConfigGLE;
	}

	/* title_shadow_type */
	if (np->title_shadow_type != op->title_shadow_type)
	{
		/* Make sure the new shadow type is ok */
		XfeRepTypeCheck(nw,XmRShadowType,&np->title_shadow_type,XmSHADOW_IN);

		_XfemConfigFlags(nw) |= XfeConfigExpose;
	}

    return _XfeManagerChainSetValues(ow,rw,nw,xfeComboBoxWidgetClass);
}
Esempio n. 5
0
/*----------------------------------------------------------------------*/
static void
Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
    XfeComboBoxPart *		cp = _XfeComboBoxPart(nw);

    /* Make sure rep types are ok */
	XfeRepTypeCheck(nw,XmRShadowType,&cp->title_shadow_type,
					XmSHADOW_IN);

	XfeRepTypeCheck(nw,XmRComboBoxType,&cp->combo_box_type,
					XmCOMBO_BOX_READ_ONLY);

	/* Make sure read-only resources aren't set */
	if (cp->title)
	{
		_XmWarning(nw,MESSAGE2);

		cp->title = NULL;
	}

	if (cp->list)
	{
		_XmWarning(nw,MESSAGE3);

		cp->list = NULL;
	}

	if (cp->shell)
	{
		_XmWarning(nw,MESSAGE4);

		cp->shell = NULL;
	}

	if (cp->arrow)
	{
		_XmWarning(nw,MESSAGE5);

		cp->arrow = NULL;
	}
	
    /* Create components */
	cp->arrow		= ArrowCreate(nw);
	cp->title		= TitleCreate(nw);
	cp->shell		= ShellCreate(nw);
	cp->list		= ListCreate(nw);

	/* Configure the title */
	TitleConfigure(nw);

    /* Initialize private members */
	cp->highlighted			= False;
	cp->delay_timer_id		= 0;

	/* Manage the children */
	XtManageChild(cp->title);
	XtManageChild(cp->list);
	XtManageChild(cp->arrow);

 	XfeOverrideTranslations(nw,_XfeComboBoxExtraTranslations);

    /* Finish of initialization */
    _XfeManagerChainInitialize(rw,nw,xfeComboBoxWidgetClass);
}
Esempio n. 6
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);
}