Ejemplo n.º 1
0
/*----------------------------------------------------------------------*/
static void
DrawShadow(Widget w,XEvent * event,Region region,XRectangle * clip_rect)
{
    /* Draw the shadow */
    _XmDrawShadows(XtDisplay(w),
				   _XfePrimitiveDrawable(w),
				   _XfeTopShadowGC(w),_XfeBottomShadowGC(w),
				   _XfeHighlightThickness(w),
				   _XfeHighlightThickness(w),
				   _XfeWidth(w) - 2 * _XfeHighlightThickness(w),
				   _XfeHeight(w) - 2 * _XfeHighlightThickness(w),
				   _XfeShadowThickness(w),
				   _XfeShadowType(w));
}
Ejemplo n.º 2
0
/*----------------------------------------------------------------------*/
static void
DrawArrow(Widget w,XEvent *event,Region region,XRectangle * clip_rect)
{
    XfeArrowPart *		ap = _XfeArrowPart(w);
    XfeButtonPart *		bp = _XfeButtonPart(w);
    Dimension			width = XfeMin(ap->arrow_width,_XfeRectWidth(w));
    Dimension			height = XfeMin(ap->arrow_height,_XfeRectHeight(w));
    Position			x = (_XfeWidth(w) - width) / 2;
    Position			y = (_XfeHeight(w) - height) / 2;

    /* Draw the arrow as an XmArrowButton would */
    if (bp->emulate_motif)
    {
        GC gc = _XfeBackgroundGC(w);

        if (bp->raised)
        {
            if (bp->raise_on_enter && bp->raised)
            {
                gc = bp->label_raised_GC;
            }
        }
        else if (bp->armed)
        {
            if (bp->fill_on_arm && bp->armed)
            {
                gc = bp->armed_GC;
            }
        }

        XfeDrawMotifArrow(XtDisplay(w),
                          _XfePrimitiveDrawable(w),
                          _XfeTopShadowGC(w),
                          _XfeBottomShadowGC(w),
                          gc,
                          x,
                          y,
                          width,
                          height,
                          ap->arrow_direction,
                          2, /* hard coded to be compatible with Motif */
                          bp->armed);
    }
    /* Draw the arrow as an XfeButton would */
    else
    {
#if 1
        XfeDrawArrow(XtDisplay(w),
                     _XfePrimitiveDrawable(w),
                     ARROW_GC(w,ap),
                     x,y,
                     width,height,
                     ap->arrow_direction);
#else
        XfeDrawMotifArrow(XtDisplay(w),
                          _XfePrimitiveDrawable(w),
                          NULL,
                          NULL,
                          ARROW_GC(w,ap),
                          x,y,
                          width,height,
                          ap->arrow_direction,
                          0,
                          False);
#endif
    }
}