Exemplo n.º 1
0
static
void ob_text(XA_TREE *wt, RECT *r, RECT *o, OBJC_COLOURS *c, char *t, int state, int und)
{
	if (t)
	if (*t)
	{
		OBJECT *ob = wt->tree + wt->current;
		bool fits = !o or (o and (o->h >= r->h - (d3_foreground(ob) ? 4 : 0)));	/* HR 300602 */

		if (c)		/* set according to circumstances. */
		{
/*			HR 051002: more restrictions	*/
			if (    c->opaque
			    and !MONO
			    and d3_any(ob)
			    and (
			                 c->pattern eq IP_HOLLOW
			         or (    c->pattern eq IP_SOLID
			             and c->fillc eq WHITE
			            )
			        )
			   )
			{
				f_color(screen.dial_colours.bg_col);
				wr_mode(MD_REPLACE);
				gbar(0, o ? o : r);
				wr_mode(MD_TRANS);
			}
			else
				wr_mode(c->opaque ? MD_REPLACE : MD_TRANS);
		}

		if (!MONO and (state&DISABLED) != 0)
		{
			done(DISABLED);
			if (fits)
			{
				t_color(screen.dial_colours.lit_col);
				v_gtext(C.vh, r->x+1, r->y+1, t);
				t_color(screen.dial_colours.shadow_col);
			}
		}

		if (fits)
			v_gtext(C.vh, r->x, r->y, t);

		/* Now underline the shortcut character, if any. */
		if (und >= 0)
		{
			int l = strlen(t);
			if (und < l)
			{
				G_i x = r->x + und*screen.c_max_w,
				    y = r->y + screen.c_max_h - 1;
				line(x, y, x + screen.c_max_w - 1, y, RED);
			}
		}
	}
}
Exemplo n.º 2
0
global
void write_selection(int d, RECT *r)
{
	wr_mode(MD_XOR);
	f_color(BLACK);
	f_interior(FIS_SOLID);
	gbar(d, r);
	wr_mode(MD_TRANS);
}
Offset<TimeLineColorFrame> FlatBuffersSerialize::createTimeLineColorFrame(const tinyxml2::XMLElement *objectData)
{
    int frameIndex = 0;
    bool tween = true;
    Color4B color;
    
    const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
    while (attribute)
    {
        std::string name = attribute->Name();
        std::string value = attribute->Value();
        
        if (name == "FrameIndex")
        {
            frameIndex = atoi(value.c_str());
        }
        else if (name == "Alpha")
        {
            color.a = atoi(value.c_str());
        }
        else if (name == "Tween")
        {
            tween = (value == "True") ? true : false;
        }
        
        attribute = attribute->Next();
    }
    
    // color
    const tinyxml2::XMLElement* child = objectData->FirstChildElement();
    while (child)
    {
        attribute = child->FirstAttribute();
        while (attribute)
        {
            std::string name = attribute->Name();
            std::string value = attribute->Value();
            
            if (name == "R")
            {
                color.r = atoi(value.c_str());
            }
            else if (name == "G")
            {
                color.g = atoi(value.c_str());
            }
            else if (name == "B")
            {
                color.b = atoi(value.c_str());
            }			
            
            attribute = attribute->Next();
        }
        
        child = child->NextSiblingElement();
    }
    
    Color f_color(color.a, color.r, color.g, color.b);
    
    return CreateTimeLineColorFrame(*_builder,
                                    frameIndex,
                                    tween,
                                    &f_color);
}
Exemplo n.º 4
0
global
void d3_pushbutton(int d, RECT *r, OBJC_COLOURS *col, int state, int thick, int mode)
{
	G_u selected = state&SELECTED;
	int t, j, outline;

	thick = -thick;		/* make thick same direction as d (positive value --> LARGER!) */

	if (thick > 0)		/* outside thickness */
		d += thick;
	d += 2;
	
	if (mode&1)			/* fill ? */
	{
		if (col == nil)
			f_color(screen.dial_colours.bg_col);
		/* otherwise set by set_colours() */
		gbar(d, r);						/* inside bar */
	}

	j = d;
	t = abs(thick);
	outline = j;

#if NAES3D
	if (default_options.naes and !(mode&2))
	{	
		l_color(screen.dial_colours.fg_col);
		
		while (t > 0)
		{
			gbox(j, r);					/* outside box */
			t--, j--;
		}
	
		br_hook(j, r, selected ? screen.dial_colours.lit_col : screen.dial_colours.shadow_col);
		tl_hook(j, r, selected ? screen.dial_colours.shadow_col : screen.dial_colours.lit_col);
	}
	else
#endif
	{
		do
		{
			br_hook(j, r, selected ? screen.dial_colours.lit_col : screen.dial_colours.shadow_col);
			tl_hook(j, r, selected ? screen.dial_colours.shadow_col : screen.dial_colours.lit_col);
			t--, j--;
		} while (t >= 0);
	
	    if (    thick
	        and !(mode&2)		/* full outline ? */
	       )
		{
			l_color(screen.dial_colours.fg_col);
			gbox(outline, r);					/* outside box */
		}
	}

	shadow_object(outline, state, r, screen.dial_colours.border_col, thick);

	l_color(screen.dial_colours.border_col);
}