Beispiel #1
0
void LoginView::Layout()
{
	VLayoutNode* pcRoot = new VLayoutNode("root");
	
	pcUserIconView = new os::IconView(Rect(1,2,2000,82),"",CF_FOLLOW_ALL);
	pcUserIconView->SetSelChangeMsg(new Message(M_SEL_CHANGED));
	PopulateIcons();
	pcUserIconView->SetTabOrder( 1 );

	FrameView* pcFrameView = new FrameView(Rect(0,0,2000,84),"","");
	pcFrameView->AddChild(pcUserIconView);
	AddChild(pcFrameView);
	
	pcLayoutView = new LayoutView(Rect(0,89,GetBounds().Width(),GetBounds().Height()),"layout_view",NULL);
	
	HLayoutNode* pcPassNode = new HLayoutNode("pass_node");
	pcPassNode->AddChild(new HLayoutSpacer("",2,2));
	pcPassNode->AddChild(pcPassString = new StringView(Rect(),"pass_string","Password:"));
	pcPassNode->AddChild(new HLayoutSpacer("",2,2));
	pcPassNode->AddChild(pcPassText = new TextView(Rect(),"pass_text",""));
	pcPassText->SetPasswordMode(true);
	pcPassText->SetMaxPreferredSize(28,1);
	pcPassText->SetMinPreferredSize(28,1);
	pcPassText->SetTabOrder( 2 );
	pcPassNode->AddChild(new HLayoutSpacer("",5,5));
	pcPassNode->AddChild(pcLoginButton = new Button(Rect(),"login_but","_Login",new Message(M_LOGIN)));
	pcLoginButton->SetTabOrder( 3 );
	pcPassNode->AddChild(new HLayoutSpacer("",2,2));
	pcPassNode->SameHeight("login_but",NULL);
	pcPassNode->ExtendMaxSize(pcPassNode->GetPreferredSize(false));
	

	HLayoutNode* pcKeymapNode = new HLayoutNode("keymap_node");
	pcKeymapNode->AddChild(selector = new KeymapSelector(os::Messenger(pcParentWindow)));
	
	
	HLayoutNode* pcOtherNode = new HLayoutNode("other_node");
	pcOtherNode->SetHAlignment(ALIGN_RIGHT);	
	pcOtherNode->AddChild(pcShutdownButton = new Button(Rect(),"shut_but","_Shutdown",new Message(M_SHUTDOWN)));
	pcShutdownButton->SetTabOrder( 4 );
	pcOtherNode->AddChild(new HLayoutSpacer("",150,150));
	pcOtherNode->AddChild(pcDateString = new StringView(Rect(),"","9 Aug 05, 10:00am"));
	UpdateTime();
	
	pcRoot->AddChild(pcPassNode);
	pcRoot->AddChild(new os::VLayoutSpacer("",10,10));
	pcRoot->AddChild(pcKeymapNode);
	pcRoot->AddChild(new os::VLayoutSpacer("",10,10));
	pcRoot->AddChild(pcOtherNode);
	
	pcRoot->SameHeight("shut_but","login_but",NULL);
	pcRoot->SameWidth("shut_but","login_but",NULL);
	
	pcLayoutView->SetRoot(pcRoot);
	AddChild(pcLayoutView);
	
	ResizeTo(os::Point(pcLayoutView->GetPreferredSize(false).x,GetBounds().Height()));
}