X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Logo.cpp;h=ce5649abd0818ffb1c8252bf330c31edcb7d5a34;hb=bfe817b5bfae33a1eb666c463643ec119cd1d66d;hp=2f02a8a399238a9f6c56957a2180c456f2642f07;hpb=99e320d3cb52177083c68fc13b635deae380b4cf;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Logo.cpp b/source/contacteditor/frmContactEditor-Logo.cpp index 2f02a8a..ce5649a 100644 --- a/source/contacteditor/frmContactEditor-Logo.cpp +++ b/source/contacteditor/frmContactEditor-Logo.cpp @@ -23,10 +23,12 @@ void frmContactEditor::LoadLogo( wxListEvent& event ) { + // Load the logo. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboLogos, + if (lboLogos->GetItemCount() == 0 || !GetSelectedItem(lboLogos, &longSelected, &intSelectedData)){ return; @@ -44,8 +46,7 @@ void frmContactEditor::LoadLogo( wxListEvent& event ) wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size()); wxImage photo; - //wxMemoryInputStream istream(base64dec, (size_t)base64dec.size()); - + if (pictypeiter->second == wxT("image/jpeg")){ if (!photo.LoadFile(istream, wxBITMAP_TYPE_JPEG)){ @@ -83,11 +84,11 @@ void frmContactEditor::LoadLogo( wxListEvent& event ) void frmContactEditor::AddLogo( wxCommandEvent& event ) { - int intResult = 0; - + + // Bring up the window to add a logo. + frmContactEditorPicture *frameCELogo = new frmContactEditorPicture ( this ); frameCELogo->SetEditorMode(FALSE); - intResult = GetLastInt(&ContactEditorData.LogosList); frameCELogo->SetupPointers(&ContactEditorData.LogosList, &ContactEditorData.LogosListAltID, &ContactEditorData.LogosListPID, @@ -109,10 +110,12 @@ void frmContactEditor::AddLogo( wxCommandEvent& event ) void frmContactEditor::ModifyLogo( wxCommandEvent& event ) { + // Bring up the window to modify a logo. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboLogos, + if (lboLogos->GetItemCount() == 0 || !GetSelectedItem(lboLogos, &longSelected, &intSelectedData)){ return; @@ -141,10 +144,12 @@ void frmContactEditor::ModifyLogo( wxCommandEvent& event ) void frmContactEditor::DeleteLogo( wxCommandEvent& event ) { + // Bring up a window to delete a logo. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboLogos, + if (lboLogos->GetItemCount() == 0 || !GetSelectedItem(lboLogos, &longSelected, &intSelectedData)){ return; @@ -168,10 +173,12 @@ void frmContactEditor::DeleteLogo( wxCommandEvent& event ) void frmContactEditor::SaveLogo( wxCommandEvent &event ) { + // Save the logo to a file. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboLogos, + if (lboLogos->GetItemCount() == 0 || !GetSelectedItem(lboLogos, &longSelected, &intSelectedData)){