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:"******"",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())); }
/************************************************* * Description: Lays out the Dialog * Author: Rick Caudill * Date: Thu Mar 18 20:17:32 2004 **************************************************/ void WallpaperChangerSettings::Layout() { pcImageView = new ImageView(Rect(50,5,GetBounds().Width()-50,95),"imgview",NULL); pcImageView->SetImage(pcImage); AddChild(pcImageView); pcLayoutView = new LayoutView(Rect(0,105,GetBounds().Width(),GetBounds().Height()),"LayoutView"); VLayoutNode* pcRoot = new VLayoutNode("root"); VLayoutNode* pcOptionsNode = new VLayoutNode("options"); pcOptionsNode->AddChild(new VLayoutSpacer("",30,30)); pcOptionsNode->AddChild(pcRandom = new CheckBox(Rect(),"random_check","Display Random",NULL)); pcRandom->SetEnable(false); pcOptionsNode->AddChild(new VLayoutSpacer("",10,10)); pcOptionsNode->AddChild(pcTimeString = new StringView(Rect(),"time_string","Load Every:")); pcOptionsNode->AddChild(pcTimeDrop = new DropdownMenu(Rect(),"time_drop")); pcTimeDrop->SetReadOnly(true); LoadTimeSettings(); pcOptionsNode->AddChild(new VLayoutSpacer("",50,50)); HLayoutNode* pcHLayoutNode = new HLayoutNode("directory_layout"); pcHLayoutNode->AddChild(pcDirectoryList = new ListView(Rect(),"DirectoryList",ListView::F_RENDER_BORDER)); pcDirectoryList->InsertColumn("File",(int)GetBounds().Width()); pcDirectoryList->SetHasColumnHeader(false); pcDirectoryList->SetSelChangeMsg(new Message(M_CHANGE_IMAGE)); pcHLayoutNode->AddChild(new HLayoutSpacer("",15,15)); pcHLayoutNode->AddChild(pcOptionsNode); LoadDirectoryList(); HLayoutNode* pcButtonNode = new HLayoutNode("buttons_layout"); pcButtonNode->AddChild(pcApplyButton = new Button(Rect(),"ok_but","_Apply",new Message(M_APPLY))); pcButtonNode->AddChild(new HLayoutSpacer("",20,20)); pcButtonNode->AddChild(pcDefaultButton = new Button(Rect(),"def_but","_Default",new Message(M_DEFAULT))); pcButtonNode->AddChild(new HLayoutSpacer("",20,20)); pcButtonNode->AddChild(pcCancelButton = new Button(Rect(),"cancel_but","_Cancel",new Message(M_CANCEL))); pcButtonNode->SameWidth("ok_but","def_but","cancel_but",NULL); pcButtonNode->SameHeight("ok_but","def_but","cancel_but",NULL); pcRoot->AddChild(pcHLayoutNode); pcRoot->AddChild(new VLayoutSpacer("",15,15)); pcRoot->AddChild(pcButtonNode); pcRoot->AddChild(new VLayoutSpacer("",5,5)); pcLayoutView->SetRoot(pcRoot); AddChild(pcLayoutView); SetDefaultButton(pcApplyButton); }