Esempio n. 1
0
Vector2 Horizontal_paned_view::Request_size(const Widget& widget) const
{
	const Horizontal_paned& horizontal_paned = dynamic_cast<const Horizontal_paned&>(widget);
	Widget* left = horizontal_paned.Get_left();
	Widget* right = horizontal_paned.Get_right();

	Vector2 size;
	Widget_view* view;
	if(left)
	{
		Vector2 ws = left->Request_size();
		size.x += ws.x;
		if(ws.y>size.y)
			size.y = ws.y;
	}
	if(right)
	{
		Vector2 ws = right->Request_size();
		size.x += ws.x;
		if(ws.y>size.y)
			size.y = ws.y;
	}
	size.x+=7;
	return size;
}
Esempio n. 2
0
Vector2 Vertical_paned_view::Request_size(const Widget& widget) const
{
	const Vertical_paned& vertical_paned = dynamic_cast<const Vertical_paned&>(widget);
	Widget* top = vertical_paned.Get_top();
	Widget* bottom = vertical_paned.Get_bottom();

	Vector2 size;
	Widget_view* view;
	if(top)
	{
		Vector2 ws = top->Request_size();
		size.y += ws.y;
		if(ws.x>size.x)
			size.x = ws.x;
	}
	if(bottom)
	{
		Vector2 ws = bottom->Request_size();
		size.y += ws.y;
		if(ws.x>size.x)
			size.x = ws.x;
	}
	size.y+=7;
	return size;
}