DownloadRequesterView::DownloadRequesterView( const Rect& cFrame, const std::string& cURL, const std::string& cPreferredName, const std::string& cType, off_t nContentSize, const os::Messenger& cMsgTarget, const os::Message& cOkMsg, const os::Message& cCancelMessage ) : LayoutView( cFrame, "download_diag", NULL, CF_FOLLOW_ALL ), m_cMsgTarget( cMsgTarget ), m_cOkMsg( cOkMsg ), m_cCancelMsg( cCancelMessage ), m_cPreferredName(cPreferredName) { VLayoutNode* pcRoot = new VLayoutNode( "root" ); m_pcTermMsg = &m_cCancelMsg; m_pcOkBut = new Button( Rect(0,0,0,0), "ok", "Ok", new Message( ID_OK ) ); m_pcCancelBut = new Button( Rect(0,0,0,0), "cancel", "Cancel", new Message( ID_CANCEL ) ); HLayoutNode* pcButtonBar = new HLayoutNode( "button_bar" ); StatusView* m_pcStatusView = new StatusView( Rect(), "status_view" ); m_pcStatusView->AddLabel( "Location:", cURL ); m_pcStatusView->AddLabel( "File type:", cType ); if ( nContentSize != -1 ) { m_pcStatusView->AddLabel( "File size:", get_size_str( nContentSize ) ); } else { m_pcStatusView->AddLabel( "File size:", "UNKNOWN" ); } pcButtonBar->AddChild( new HLayoutSpacer( "space" ) ); pcButtonBar->AddChild( m_pcOkBut )->SetBorders( Rect( 0, 0, 10, 10 ) ); pcButtonBar->AddChild( m_pcCancelBut )->SetBorders( Rect( 0, 0, 10, 10 ) ); pcRoot->AddChild( new VLayoutSpacer( "space" ) ); pcRoot->AddChild( m_pcStatusView )->SetBorders( Rect( 10.0f, 5.0f, 5.0f, 5.0f ) ); pcRoot->AddChild( new VLayoutSpacer( "space" ) ); pcRoot->AddChild( pcButtonBar ); pcRoot->SameWidth( "ok", "cancel", NULL ); SetRoot( pcRoot ); }
DownloadProgressView::DownloadProgressView( const Rect& cFrame, const std::string& cURL, const std::string& cPath, off_t nTotalSize, bigtime_t nStartTime, const os::Messenger& cMsgTarget, const os::Message& cCancelMessage ) : LayoutView( cFrame, "download_progress_diag", NULL, CF_FOLLOW_ALL ), m_cMsgTarget( cMsgTarget ), m_cCancelMsg( cCancelMessage ) { m_nTotalSize = nTotalSize; m_nStartTime = nStartTime; m_pcTermMsg = &m_cCancelMsg; VLayoutNode* pcRoot = new VLayoutNode( "root" ); m_pcProgressBar = new ProgressBar( Rect(0,0,0,0), "progress_bar" ); m_pcCancelBut = new Button( Rect(0,0,0,0), "cancel", "Cancel", new Message( ID_CANCEL ) ); HLayoutNode* pcButtonBar = new HLayoutNode( "button_bar" ); m_pcStatusView = new StatusView( Rect(), "status_view" ); m_pcStatusView->AddLabel( "Download to:", cPath ); m_pcStatusView->AddLabel( "Progress:", (m_nTotalSize==-1) ? "0" : String().Format( "0/%s", get_size_str( m_nTotalSize ).c_str() ) ); m_pcStatusView->AddLabel( "Transfer rate:", "" ); pcButtonBar->AddChild( new HLayoutSpacer( "space" ) ); pcButtonBar->AddChild( m_pcCancelBut )->SetBorders( Rect( 0, 0, 10, 10 ) ); pcRoot->AddChild( new VLayoutSpacer( "space" ) ); pcRoot->AddChild( new StringView( Rect(), "", "Saving:" ) ); pcRoot->AddChild( new StringView( Rect(), "", cURL.c_str() ) )->SetBorders( Rect( 10.0f, 5.0f, 10.0f, 5.0f ) ); pcRoot->AddChild( m_pcProgressBar )->SetBorders( Rect( 10.0f, 5.0f, 10.0f, 5.0f ) ); pcRoot->AddChild( new VLayoutSpacer( "space" ) ); pcRoot->AddChild( m_pcStatusView )->SetBorders( Rect( 10.0f, 5.0f, 5.0f, 5.0f ) ); pcRoot->AddChild( new VLayoutSpacer( "space" ) ); pcRoot->AddChild( pcButtonBar ); SetRoot( pcRoot ); }
/************************************************* * 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); }
FindDialogView::FindDialogView( const os::Rect& cFrame, const os::Messenger& cMsgTarget, const Message& cSearchMsg, const Message& cCloseMsg ) : LayoutView( cFrame, "search_dialog", NULL, CF_FOLLOW_ALL ), m_cMsgTarget(cMsgTarget), m_cSearchMsg(cSearchMsg), m_cCloseMsg(cCloseMsg) { VLayoutNode* pcRoot = new VLayoutNode( "root" ); m_pcSearchStr = new TextView( Rect(), "src_str", g_cSearchStr.c_str() ); m_pcSearchBut = new Button( Rect(), "src_but", "Search", new Message( ID_SEARCH ) ); m_pcContinueBut = new Button( Rect(), "cont_but", "Repeat", new Message( ID_CONTINUE ) ); m_pcCloseBut = new Button( Rect(), "close_but", "Close", new Message( M_QUIT ) ); m_pcCaseSensCB = new CheckBox( Rect(), "case_sens_cb", "Case sensitive", NULL ); m_pcSearchStr->SetEventMask( TextView::EI_ESC_PRESSED ); m_pcSearchStr->SetMessage( new Message( ID_SEARCH_STR ) ); if ( g_cSearchStr.empty() == false ) { m_pcSearchStr->SetCursor( -1, 0 ); m_pcSearchStr->SelectAll(); } m_pcCaseSensCB->SetValue( g_bCaseSensitive ); HLayoutNode* pcButtonPanel = new HLayoutNode( "but_panel" ); HLayoutNode* pcCBPanel = new HLayoutNode( "cb_panel" ); pcCBPanel->AddChild( m_pcCaseSensCB ); pcCBPanel->AddChild( new HLayoutSpacer( "space" ) ); pcCBPanel->SetBorders( Rect( 10.0f, 0.0f, 10.0f, 10.0f ) ); pcButtonPanel->AddChild( new HLayoutSpacer( "space" ) ); pcButtonPanel->AddChild( m_pcSearchBut )->SetBorders( Rect( 20.0f, 0.0f, 0.0f, 10.0f ) ); pcButtonPanel->AddChild( m_pcContinueBut )->SetBorders( Rect( 10.0f, 0.0f, 0.0f, 10.0f ) ); pcButtonPanel->AddChild( m_pcCloseBut )->SetBorders( Rect( 10.0f, 0.0f, 10.0f, 10.0f ) ); pcRoot->AddChild( m_pcSearchStr )->SetBorders( Rect( 10.0f, 10.0f, 10.0f, 10.0f ) ); pcRoot->AddChild( pcCBPanel ); pcRoot->AddChild( pcButtonPanel ); SetRoot( pcRoot ); }
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())); }
SettingsWindow::SettingsWindow( const Rect &cFrame, const String cTitle, Handler *pcParent, WebSettings *pcWebSettings, Settings *pcSettings, Settings *pcGuiSettings ) : Window( cFrame, "whisper_settings", cTitle ) { m_pcParent = pcParent; m_pcWebSettings = pcWebSettings; m_pcSettings = pcSettings; m_pcGuiSettings = pcGuiSettings; SetSizeLimits( Point( 500, 400 ), Point( 4096, 4096 ) ); Rect cBounds = GetBounds(); Rect cIconListFrame( 10, 10, 140, cBounds.Height() - 45 ); m_pcIconList = new IconList( cIconListFrame, CF_FOLLOW_TOP | CF_FOLLOW_BOTTOM, this ); AddChild( m_pcIconList ); /* The selected panel is displayed inside this FrameView */ Rect cFrameViewFrame( 150, 10, cBounds.Width() - 10, cBounds.Height() - 45 ); m_pcFrameView = new FrameView( cFrameViewFrame, "settings_window_frame", "Settings", CF_FOLLOW_ALL ); AddChild( m_pcFrameView ); /* Add panel icons & associated views */ BitmapImage *pcImage; ResStream *pcStream; Resources cRes( get_image_id() ); SettingsView *pcView; Rect cViewFrame( 10, 20, cFrameViewFrame.Width() - 10, cFrameViewFrame.Height() - 10 ); /* General */ pcImage = new BitmapImage(); pcStream = cRes.GetResourceStream( "general.png" ); pcImage->Load( pcStream ); m_pcIconList->AddIcon( pcImage, "General" ); delete( pcStream ); pcView = new GeneralView( cViewFrame, m_pcSettings, m_pcWebSettings, m_pcParent ); m_vViews.push_back( pcView ); /* Proxies */ pcImage = new BitmapImage(); pcStream = cRes.GetResourceStream( "proxy.png" ); pcImage->Load( pcStream ); m_pcIconList->AddIcon( pcImage, "Proxies" ); delete( pcStream ); pcView = new ProxyView( cViewFrame, m_pcSettings, m_pcWebSettings, m_pcParent ); m_vViews.push_back( pcView ); /* The Apply/Save/Cancel buttons live in a layoutview of their own */ Rect cButtonFrame = cBounds; cButtonFrame.top = cButtonFrame.bottom - 25; m_pcLayoutView = new LayoutView( cButtonFrame, "settings_window" ); VLayoutNode *pcNode = new VLayoutNode( "settings_window_root" ); pcNode->SetBorders( Rect( 5, 4, 5, 4 ) ); pcNode->AddChild( new VLayoutSpacer( "settings_window_v_spacer", 1.0f ) ); HLayoutNode *pcButtons = new HLayoutNode( "settings_window_buttons" ); pcButtons->AddChild( new HLayoutSpacer( "settings_window_h_spacer" ) ); Button *pcOkButton = new Button( Rect(), "settings_window_save", "Save", new Message( ID_SETTINGS_SAVE ) ); pcButtons->AddChild( pcOkButton, 0.0f ); pcButtons->AddChild( new HLayoutSpacer( "settings_window_h_spacer", 0.5f, 0.5f, pcButtons, 0.1f ) ); pcButtons->AddChild( new Button( Rect(), "settings_window_apply", "Apply", new Message( ID_SETTINGS_APPLY ) ), 0.0f ); pcButtons->AddChild( new HLayoutSpacer( "settings_window_h_spacer", 0.5f, 0.5f, pcButtons, 0.1f ) ); pcButtons->AddChild( new Button( Rect(), "settings_window_cancel", "Cancel", new Message( ID_SETTINGS_CANCEL ) ), 0.0f ); pcNode->AddChild( pcButtons ); m_pcLayoutView->SetRoot( pcNode ); AddChild( m_pcLayoutView ); /* Focus the controls */ /* XXXKV: The default button always swallows Enter, which is no use if we have a multiline TextView (E.g. the signature text). SetDefaultButton( pcOkButton ); */ /* Select first view by default */ m_pcSelected = NULL; m_pcIconList->Select( 0, true ); }
//BrowserWindow::BrowserWindow( BRect cFrame, std::vector<HistoryEntry*>* pcHistory, bool bLoadPos ) : BrowserWindow::BrowserWindow( BRect cFrame, bool /*bLoadPos*/ ) :BWindow( cFrame, "ABrowse", B_TITLED_WINDOW, 0 ) ,m_pcHTMLPart( NULL ) ,m_pcStatusBar( NULL ) ,m_pcURLView( NULL ) { atomic_add( &s_nWndCount, 1 ); // BAutolock al( GlobalMutex::GetMutex() ); // GlobalMutex::Lock(); RootView *pcRoot = new RootView( Bounds() ); AddChild( pcRoot ); // AddChild( pcRoot ); // AddTimer( this, 1, 100000, false ); // GlobalMutex::Unlock(); //-------------------------------------------------------------------------- #if 0 LayoutView* pcFrame = new LayoutView( cWndBounds, "frame_view" ); VLayoutNode* pcRoot = new VLayoutNode( "root" ); FrameView* pcNavBarFrame = new FrameView( Rect(0,0,0,0), "nav_bar_frame", "" ); HLayoutNode* pcNavBar = new HLayoutNode( "nav_bar" ); m_pcURLView = new TextView( Rect(0,0,0,0), "url_view", ""/*g_pzDefaultURL*/ ); m_pcURLView->SetEventMask( os::TextView::EI_ENTER_PRESSED | os::TextView::EI_ESC_PRESSED ); m_pcURLView->SetMultiLine( false ); m_pcURLView->SetMessage( new Message( ID_URL_CHANGED ) ); m_pcToolBar = new ToolBar( Rect(0,0,0,0), "tool_bar" ); m_pcStatusBar = new StatusBar( Rect(), "status_bar" ); m_pcToolBar->AddButton( "hi16-action-back.png", os::Message( ID_PREV_URL ) ); m_pcToolBar->AddButton( "hi16-action-forward.png", os::Message( ID_NEXT_URL ) ); m_pcToolBar->AddButton( "hi16-action-gohome.png", os::Message( ID_GOHOME ) ); m_pcToolBar->AddButton( "hi16-action-reload.png", os::Message( ID_RELOAD ) ); m_pcToolBar->AddButton( "hi16-action-find.png", os::Message( ID_FIND ) ); m_pcToolBar->AddButton( "hi16-action-editcopy.png", os::Message( ID_COPY ) ); pcNavBar->AddChild( m_pcToolBar )->SetBorders( Rect( 4, 2, 10, 2 ) ); pcNavBar->AddChild( m_pcURLView ); pcNavBarFrame->SetRoot( pcNavBar ); pcRoot->AddChild( pcNavBarFrame ); QWidget* pcTopView = new TopView; pcTopView->show(); pcTopView->SetResizeMask( CF_FOLLOW_ALL ); pcTopView->SetFrame( cWndBounds.Bounds() ); pcRoot->AddChild( pcTopView ); pcRoot->AddChild( m_pcStatusBar ); pcFrame->SetRoot( pcRoot ); m_pcHTMLPart = new KHTMLPart( pcTopView, "khtmlpart" ); // ### frame name m_pcHTMLPart->browserExtension()->SetCallback( this ); AddChild( pcFrame ); KHTMLView* pcView = m_pcHTMLPart->view(); pcView->SetResizeMask( CF_FOLLOW_ALL ); pcView->SetFrame( pcTopView->GetBounds() ); pcView->MakeFocus(); pcView->SetMsgTarget( Messenger( this ) ); pcView->show(); m_pcURLView->SetTarget( this ); m_pcToolBar->SetTarget( Messenger( this ) ); m_pcToolBar->EnableButton( BI_BACK, false ); m_pcToolBar->EnableButton( BI_FORWARD, false ); m_pcToolBar->EnableButton( BI_COPY, false ); char* pzHome = getenv( "HOME" ); if ( bLoadPos && NULL != pzHome ) { FILE* hFile; char zPath[ 256 ]; strcpy( zPath, pzHome ); strcat( zPath, "/config/abrowse.cfg" ); hFile = fopen( zPath, "rb" ); if ( NULL != hFile ) { Rect cNewFrame; fread( &cNewFrame, sizeof( cNewFrame ), 1, hFile ); fclose( hFile ); SetFrame( cNewFrame ); } } if ( pcHistory != NULL ) { for ( uint i = 0 ; i < pcHistory->size() ; ++i ) { HistoryEntry* pcEntry = new HistoryEntry; // *pcEntry = *(*pcHistory)[i]; pcEntry->m_cURL = (*pcHistory)[i]->m_cURL; pcEntry->m_cState = (*pcHistory)[i]->m_cState; m_cHistory.push_back( pcEntry ); } m_nCurHistoryPos = m_cHistory.size() - 1; m_pcToolBar->EnableButton( BI_BACK, true ); } // AddTimer( this, 1, 100000, false ); GlobalMutex::PopLooper(); // GlobalMutex::Unlock(); #endif }
IFaceWin::IFaceWin( Window * pcParent, Interface * pcIFace, bool bReadOnly ):Window( Rect( 0, 0, 180, 180 ), "IFaceWin", "" ) { m_pcIFace = pcIFace; m_bReadOnly = bReadOnly; m_pcParent = pcParent; SetTitle( MSG_IFWIN_TITLE + " " + pcIFace->GetName() ); LayoutView *pcLayout; VLayoutNode *pcRoot; HLayoutNode *pcTypeRow; StringView *pcLblType; HLayoutNode *pcAddressRow; StringView *pcLblAddress; HLayoutNode *pcNetmaskRow; StringView *pcLblNetmask; HLayoutNode *pcGatewayRow; StringView *pcLblGateway; HLayoutNode *pcEnabledRow; StringView *pcLblEnabled; HLayoutNode *pcBtnRow; HLayoutSpacer *pcSpacer; Button *pcBtnApply; Button *pcBtnClose; pcRoot = new VLayoutNode( "pcRoot" ); pcLayout = new LayoutView( Rect( 0, 0, 180, 180 ), "pcLayout", pcRoot ); pcTypeRow = new HLayoutNode( "pcTypeRow" ); pcLblType = new StringView( Rect(), "pcLblType", MSG_IFWIN_TYPE ); m_pcDdmType = new DropdownMenu( Rect(), "m_pcDdmType" ); m_pcDdmType->SetReadOnly( true ); m_pcDdmType->AppendItem( MSG_IFWIN_TYPE_STATIC ); m_pcDdmType->AppendItem( MSG_IFWIN_TYPE_DHCP ); m_pcDdmType->SetSelectionMessage( new Message( ChangeType ) ); m_pcDdmType->SetTarget( this ); m_pcDdmType->SetTabOrder( 0 ); pcTypeRow->AddChild( pcLblType ); pcTypeRow->AddChild( m_pcDdmType ); pcTypeRow->LimitMaxSize( Point( INT_MAX, m_pcDdmType->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcTypeRow ); pcAddressRow = new HLayoutNode( "pcAddressRow" ); pcLblAddress = new StringView( Rect(), "pcLblAddress", MSG_IFWIN_ADDRESS ); m_pcTxtAddress = new TextView( Rect(), "m_pcTxtAddress", "" ); m_pcTxtAddress->SetMaxLength( 15 ); m_pcTxtAddress->SetTabOrder( 1 ); pcAddressRow->AddChild( pcLblAddress ); pcAddressRow->AddChild( m_pcTxtAddress ); pcAddressRow->LimitMaxSize( Point( INT_MAX, m_pcTxtAddress->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcAddressRow ); pcNetmaskRow = new HLayoutNode( "pcNetmaskRow" ); pcLblNetmask = new StringView( Rect(), "pcLblNetmask", MSG_IFWIN_NETMASK ); m_pcTxtNetmask = new TextView( Rect(), "m_pcTxtNetmask", "" ); m_pcTxtNetmask->SetMaxLength( 15 ); m_pcTxtNetmask->SetTabOrder( 2 ); pcNetmaskRow->AddChild( pcLblNetmask ); pcNetmaskRow->AddChild( m_pcTxtNetmask ); pcNetmaskRow->LimitMaxSize( Point( INT_MAX, m_pcTxtNetmask->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcNetmaskRow ); pcGatewayRow = new HLayoutNode( "pcGatewayRow" ); pcLblGateway = new StringView( Rect(), "pcLblGateway", MSG_IFWIN_GATEWAY ); m_pcTxtGateway = new TextView( Rect(), "m_pcTxtGateway", "" ); m_pcTxtGateway->SetMaxLength( 15 ); m_pcTxtGateway->SetTabOrder( 3 ); pcGatewayRow->AddChild( pcLblGateway ); pcGatewayRow->AddChild( m_pcTxtGateway ); pcGatewayRow->LimitMaxSize( Point( INT_MAX, m_pcTxtGateway->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcGatewayRow ); pcEnabledRow = new HLayoutNode( "pcEnabledRow" ); pcLblEnabled = new StringView( Rect(), "pcLblEnabled", MSG_IFWIN_ENABLED ); m_pcCbEnabled = new CheckBox( Rect(), "m_pcCbEnabled", "", new Message( ChangeEnabled ) ); m_pcCbEnabled->SetTabOrder( 4 ); pcEnabledRow->AddChild( pcLblEnabled ); pcEnabledRow->AddChild( m_pcCbEnabled ); pcEnabledRow->LimitMaxSize( Point( INT_MAX, m_pcCbEnabled->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcEnabledRow ); pcBtnRow = new HLayoutNode( "pcBtnRow" ); pcSpacer = new HLayoutSpacer( "pcSpacer" ); pcBtnApply = new Button( Rect(), "pcBtnApply", MSG_IFWIN_APPLY, new Message( Apply ) ); pcBtnApply->SetTabOrder( 5 ); pcBtnClose = new Button( Rect(), "pcBtnClose", MSG_IFWIN_CLOSE, new Message( Close ) ); pcBtnClose->SetTabOrder( 6 ); pcBtnRow->AddChild( pcSpacer ); pcBtnRow->AddChild( pcBtnApply ); pcBtnRow->AddChild( pcBtnClose ); pcBtnRow->LimitMaxSize( Point( INT_MAX, pcBtnApply->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcBtnRow ); pcRoot->SameWidth( "pcLblEnabled", "pcLblGateway", "pcLblNetmask", "pcLblAddress", "pcLblType", NULL ); pcRoot->SameWidth( "m_pcTxtGateway", "m_pcTxtNetmask", "m_pcTxtAddress", "m_pcDdmType", "m_pcCbEnabled", NULL ); pcRoot->SetBorders( Rect( 2, 2, 2, 2 ), "pcLblEnabled", "pcLblGateway", "pcLblNetmask", "pcLblAddress", "pcLblType", "m_pcTxtGateway", "m_pcTxtNetmask", "m_pcTxtAddress", "m_pcDdmType", "m_pcCbEnabled", "pcBtnApply", "pcBtnClose", NULL ); AddChild( pcLayout ); Load(); if( m_bReadOnly ) { m_pcDdmType->SetEnable( false ); m_pcTxtAddress->SetEnable( false ); m_pcTxtNetmask->SetEnable( false ); m_pcTxtGateway->SetEnable( false ); m_pcCbEnabled->SetEnable( false ); pcBtnApply->SetEnable( false ); } }