Button::Button(int x, int y, int width, int height, const char* text, MenuAction action, bool enabled, bool confirmation) : sf::Shape()
{
	m_x = x;
	m_y = y;
	m_width = width;
	m_height = height;
	
	m_text = text;
	m_confirm = confirmation;
	
	m_enabled = enabled;
	
	if(m_enabled)
		SetColor(sf::Color(200, 200, 200));
	else
		SetColor(sf::Color(100, 100, 100));
	
	m_str = sf::String(text, sf::Font::GetDefaultFont(), 12.0);
	m_str.SetColor(sf::Color(50, 50, 50));
	m_str.SetX(m_x);
	m_str.SetY(m_y);
	
	m_action = action;
	
	EnableFill(true);
	AddPoint(x, y);
	AddPoint(x+width, y);
	AddPoint(x+width, y+height);
	AddPoint(x, y+height);
}
OP_STATUS SVGCanvasState::SetDecorationPaint()
{
	SVGCanvasState* decostate = GetDecorationState();
	if (decostate == this)
		return OpStatus::OK;

	if (decostate != NULL)
	{
		SetFillColor(decostate->m_fillcolor);
		switch (decostate->m_use_fill)
		{
#ifdef SVG_SUPPORT_PAINTSERVERS
		case USE_PSERVER:
			SVGPaintServer::IncRef(decostate->m_fill_pserver);
			SetFillPaintServer(decostate->m_fill_pserver);
			break;
#endif // SVG_SUPPORT_PAINTSERVERS
		}
		EnableFill(decostate->m_use_fill);

		SetStrokeColor(decostate->m_strokecolor);
		switch (decostate->m_use_stroke)
		{
#ifdef SVG_SUPPORT_PAINTSERVERS
		case USE_PSERVER:
			SVGPaintServer::IncRef(decostate->m_stroke_pserver);
			SetStrokePaintServer(decostate->m_stroke_pserver);
			break;
#endif // SVG_SUPPORT_PAINTSERVERS
		}
		EnableStroke(decostate->m_use_stroke);
	}
	else
	{
		// Use default paint
		EnableFill(SVGCanvasState::USE_COLOR);
		SetFillColorRGB(0,0,0);
		SetFillOpacity(0xff);

		EnableStroke(SVGCanvasState::USE_NONE);
	}
	return OpStatus::OK;
}
Exemple #3
0
void TestOLED()
{
	/* if your display isn't working, this is a good place to start -- see
	   if you can read the command register */
	TestReadStatus();

	EnableFill(true);

//	FindEdges();
	DrawEdges();
	DrawFullRect();
	ScrollDisplay();
//	DrawColorBars();
	FillScreenPixels();
	DrawCircles();
	
	TestReadPixel();
}