void CAccountManagerInfoPage::OnPageChanging( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; CWizardAttach* pWA = ((CWizardAttach*)GetParent()); CAcctMgrListItem* pItem = (CAcctMgrListItem*)(m_pProjectListCtrl->GetClientData(m_pProjectListCtrl->GetSelection())); // Update authoritative data in CWizardAttach pWA->SetProjectURL(pItem->GetURL()); pWA->SetProjectName(pItem->GetName()); }
void CAccountManagerInfoPage::OnProjectSelected( wxCommandEvent& /*event*/ ) { int sel = m_pProjectListCtrl->GetSelection(); if (sel == wxNOT_FOUND) { m_pProjectUrlCtrl->SetValue(wxEmptyString); m_pProjectDetailsDescriptionCtrl->SetValue(wxEmptyString); } else { CAcctMgrListItem* pItem = (CAcctMgrListItem*)(m_pProjectListCtrl->GetClientData(sel)); m_pProjectUrlCtrl->SetValue(pItem->GetURL()); m_pProjectDetailsDescriptionCtrl->SetValue(pItem->GetDescription()); } }
void CAccountManagerInfoPage::OnPageChanged( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; wxLogTrace(wxT("Function Start/End"), wxT("CAccountManagerInfoPage::OnPageChanged - Function Begin")); unsigned int i; ALL_PROJECTS_LIST pl; CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(m_pTitleStaticCtrl); wxASSERT(m_pDescriptionStaticCtrl); wxASSERT(m_pProjectDetailsStaticCtrl); wxASSERT(m_pProjectDetailsDescriptionCtrl); wxASSERT(m_pOpenWebSiteButton); wxASSERT(m_pProjectUrlStaticCtrl); wxASSERT(m_pProjectUrlCtrl); m_pTitleStaticCtrl->SetLabel( _("Choose an account manager") ); m_pDescriptionStaticCtrl->SetLabel( _("To choose an account manager, click its name or \ntype its URL below.") ); m_pProjectDetailsStaticCtrl->SetLabel( _("Account manager details:") ); m_pProjectUrlStaticCtrl->SetLabel( _("Account manager &URL:") ); m_pOpenWebSiteButton->SetLabel( _("Open web page") ); m_pOpenWebSiteButton->SetToolTip( _("Visit this account manager's web site")); // Populate the list box with project information // if (!m_bAccountManagerListPopulated) { pDoc->rpc.get_all_projects_list(pl); for (i=0; i<pl.account_managers.size(); i++) { wxLogTrace( wxT("Function Status"), wxT("CAccountManagerInfoPage::OnPageChanged - Name: '%s', URL: '%s', Supported: '%d'"), wxString(pl.account_managers[i]->name.c_str(), wxConvUTF8).c_str(), wxString(pl.account_managers[i]->url.c_str(), wxConvUTF8).c_str(), true ); CAcctMgrListItem* pItem = new CAcctMgrListItem(); pItem->SetURL( pl.account_managers[i]->url.c_str() ); pItem->SetName( pl.account_managers[i]->name.c_str() ); pItem->SetImage( pl.account_managers[i]->image.c_str() ); pItem->SetDescription( pl.account_managers[i]->description.c_str() ); m_pProjectListCtrl->Append( wxString(pl.account_managers[i]->name.c_str(), wxConvUTF8), pItem ); } // Pre select the first element if (m_pProjectListCtrl->GetCount()) { m_pProjectListCtrl->SetSelection(0); CAcctMgrListItem* pItem = (CAcctMgrListItem*)(m_pProjectListCtrl->GetClientData(0)); SetProjectURL(pItem->GetURL()); m_pProjectDetailsDescriptionCtrl->SetValue(pItem->GetDescription()); } TransferDataToWindow(); m_bAccountManagerListPopulated = true; } Layout(); FitInside(); m_pProjectListCtrl->SetFocus(); wxLogTrace(wxT("Function Start/End"), wxT("CAccountManagerInfoPage::OnPageChanged - Function End")); }