3 #include <wx/clipbrd.h>
4 #include <wx/dataobj.h>
6 #include "frmImportResults.h"
8 frmImportResults::frmImportResults( wxWindow* parent )
10 frmImportResultsADT( parent )
15 void frmImportResults::CopyClipboard( wxCommandEvent& event )
18 if (wxTheClipboard->Open()){
20 wxTextDataObject ResultData;
22 ResultData.SetText(txtResults->GetValue());
24 wxTheClipboard->Clear();
25 wxTheClipboard->AddData(&ResultData);
26 wxTheClipboard->Close();
27 wxTheClipboard->Flush();
29 wxMessageBox(_("The results have been copied to the clipboard."), _("Results copied to clipboard"));
33 wxMessageBox(_("The results have not been copied to the clipboard due to an error."), _("Results not copied to clipboard"));
39 void frmImportResults::CloseWindow( wxCommandEvent& event )
44 void frmImportResults::LoadData(std::map<int,wxString> *ResultDataInc, int ImportCount, int ImportErrorCount)
47 wxString ResultDataText;
49 for (std::map<int,wxString>::iterator iter = ResultDataInc->begin();
50 iter != ResultDataInc->end(); iter++){
52 ResultDataText.Append(iter->second + wxT("\n"));
56 // Display the results in the form.
58 txtResults->SetValue(ResultDataText);
59 lblText->SetLabel(wxString::Format(_("%i contacts imported. %i contacts had errors and could not be imported."), ImportCount, ImportErrorCount));