CChangeLevelWnd::CChangeLevelWnd () { m_messageBox = xr_new<CUIMessageBox>(); m_messageBox->SetAutoDelete(true); AttachChild (m_messageBox); m_messageBox->Init ("message_box_change_level"); SetWndPos (m_messageBox->GetWndPos()); m_messageBox->SetWndPos (0.0f,0.0f); SetWndSize (m_messageBox->GetWndSize()); }
void UIInvUpgPropertiesWnd::set_upgrade_info( Upgrade_type& upgrade ) { if ( !upgrade.is_known() ) { SetWndSize( Fvector2().set( 0, 0 ) ); return; } m_temp_upgrade_vector.clear_not_free(); m_temp_upgrade_vector.push_back( upgrade.id() ); set_info( m_temp_upgrade_vector ); }
void CUIMessageBoxEx::InitMessageBox(LPCSTR xml_template) { //CUIDialogWnd::SetWndRect(Frect().set(0.0f,0.0f,1024.0f,768.0f)); m_pMessageBox->InitMessageBox(xml_template); SetWndPos( m_pMessageBox->GetWndPos() ); SetWndSize( m_pMessageBox->GetWndSize() ); m_pMessageBox->SetWndPos( Fvector2().set(0,0) ); AddCallback( m_pMessageBox->WindowName(), MESSAGE_BOX_YES_CLICKED, CUIWndCallback::void_function( this, &CUIMessageBoxEx::OnOKClicked ) ); }
void FrameForClient::InitInstance(){//Initialize Window /* //only use in In InitInstance(); BOOL SetWndText(LPWSTR title); if title = DEFAULT ,the title of window is default title BOOL SetSleepTime(UINT time); if time = DEFAULT , the sleep time is 10 ms BOOL SetWndSize(UINT width, UINT height); //if width(height) = DEFAULT , the width(height) will be default size BOOL SetAppIcon(UINT icon, UINT smicon); //if icon(smlicon) = DEFAULT , the icon(smlicon) will be default icon */ //To do something... SetAppIcon(IDI_ICON_BIRD,IDI_ICON_BIRD); SetWndText(_T(L"flappy bird")); SetWndSize(304, /*551*/510); SetSleepTime(20); }
void UIInvUpgPropertiesWnd::set_info( ItemUpgrades_type const& item_upgrades ) { Fvector2 new_size; new_size.x = GetWndSize().x; new_size.y = 0.0f; Properties_type::iterator ib = m_properties_ui.begin(); Properties_type::iterator ie = m_properties_ui.end(); for ( ; ib != ie ; ++ib ) { UIProperty* ui_property = (*ib); ui_property->Show( false ); if ( ui_property->compute_value( item_upgrades ) ) { ui_property->SetWndPos( Fvector2().set( ui_property->GetWndPos().x, new_size.y ) ); new_size.y += ui_property->GetWndSize().y; ui_property->Show( true ); } } new_size.y += 10.0f; SetWndSize( new_size ); }