示例#1
0
void SkTextView::onInflate(const SkDOM& dom, const SkDOM::Node* node)
{
	this->INHERITED::onInflate(dom, node);

	const char* text = dom.findAttr(node, "text");
	if (text)
		this->setText(text);

	SkPoint	margin;
	if (dom.findScalars(node, "margin", (SkScalar*)&margin, 2))
		this->setMargin(margin);
	(void)dom.findBool(node, "do-interp", &fDoInterp);

	SkPaint_Inflate(&fPaint, dom, node);
}
示例#2
0
void SkGridView::onInflate(const SkDOM& dom, const SkDOM::Node* node)
{
	this->INHERITED::onInflate(dom, node);

	SkScalar			x[2];
	const SkDOM::Node*	child;

	if (dom.findScalars(node, "cell-size", x, 2))
		this->setCellSize(x[0], x[1]);

	if ((child = dom.getFirstChild(node, "hilite-paint")) != NULL)
		SkPaint_Inflate(&this->paint(kHiliteCell_Attr), dom, child);

	// look for a listsource
	{
		SkListSource* src = NULL;

		if ((child = dom.getFirstChild(node, "file-listsource")) != NULL)
		{
			const char* path = dom.findAttr(child, "path");
			if (path)
				src = SkListSource::CreateFromDir(	path,
													dom.findAttr(child, "filter"),
													dom.findAttr(child, "target"));
		}
		else if ((child = dom.getFirstChild(node, "xml-listsource")) != NULL)
		{
			src = SkListSource::CreateFromDOM(dom, child);
		}

		if (src)
		{
			this->setListSource(src)->unref();
			this->setSelection(0);
		}
	}
	this->onSizeChange();
}
示例#3
0
void SkListView::onInflate(const SkDOM& dom, const SkDOM::Node* node)
{
	this->INHERITED::onInflate(dom, node);

	SkScalar			x;
	const SkDOM::Node*	child;

	if (dom.findScalar(node, "row-height", &x))
		this->setRowHeight(x);

	if ((child = dom.getFirstChild(node, "hilite-paint")) != NULL)
		SkPaint_Inflate(&this->paint(kHiliteCell_Attr), dom, child);

	// look for a listsource
	{
		SkListSource* src = NULL;

		if ((child = dom.getFirstChild(node, "file-listsource")) != NULL)
		{
			const char* path = dom.findAttr(child, "path");
			if (path)
				src = SkListSource::CreateFromDir(	path,
													dom.findAttr(child, "filter"),
													dom.findAttr(child, "target"));
		}
		else if ((child = dom.getFirstChild(node, "xml-listsource")) != NULL)
		{
			src = SkListSource::CreateFromDOM(dom, child);
		}

		if (src)
		{
			this->setListSource(src)->unref();
			this->setSelection(0);
		}
	}
}
示例#4
0
void SkBGViewArtist::onInflate(const SkDOM& dom, const SkDOM::Node* node)
{
    SkPaint_Inflate(&fPaint, dom, node);
}