X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Logo.cpp;h=e4f7c966f8a2532cf9ded2fdc1512b2f6a94c29a;hb=ee9b71949005734012f18251774807c38b989ae2;hp=2f02a8a399238a9f6c56957a2180c456f2642f07;hpb=99e320d3cb52177083c68fc13b635deae380b4cf;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Logo.cpp b/source/contacteditor/frmContactEditor-Logo.cpp index 2f02a8a..e4f7c96 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, @@ -103,16 +104,19 @@ void frmContactEditor::AddLogo( wxCommandEvent& event ) frameCELogo->ShowModal(); delete frameCELogo; frameCELogo = NULL; - + intValueSeek++; + } 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 +145,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 +174,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)){