X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Picture.cpp;h=e2eeae7089591f9095f11a8d5ebbf1a2fb732ea0;hb=f69e09d827e06435ea94bb73aa71ab5f9d5c035b;hp=c1751ea248dd9b26914de79a23657af8af84884c;hpb=4443fd0e346fdea4770cca961274b03147f210fe;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Picture.cpp b/source/contacteditor/frmContactEditor-Picture.cpp index c1751ea..e2eeae7 100644 --- a/source/contacteditor/frmContactEditor-Picture.cpp +++ b/source/contacteditor/frmContactEditor-Picture.cpp @@ -24,11 +24,10 @@ void frmContactEditor::AddPicture( wxCommandEvent& event ) { - int intResult = 0; - + // Bring up window for adding a picture. + frmContactEditorPicture *frameCEPicture = new frmContactEditorPicture ( this ); frameCEPicture->SetEditorMode(FALSE); - intResult = GetLastInt(&ContactEditorData.PicturesList); frameCEPicture->SetupPointers(&ContactEditorData.PicturesList, &ContactEditorData.PicturesListAltID, &ContactEditorData.PicturesListPID, @@ -44,16 +43,19 @@ void frmContactEditor::AddPicture( wxCommandEvent& event ) frameCEPicture->ShowModal(); delete frameCEPicture; frameCEPicture = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyPicture( wxCommandEvent& event ) { + // Bring up window for modifying a picture. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboPictures, + if (lboPictures->GetItemCount() == 0 || !GetSelectedItem(lboPictures, &longSelected, &intSelectedData)){ return; @@ -82,10 +84,12 @@ void frmContactEditor::ModifyPicture( wxCommandEvent& event ) void frmContactEditor::DeletePicture( wxCommandEvent& event ) { + // Bring up window for deleting a picture. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboPictures, + if (lboPictures->GetItemCount() == 0 || !GetSelectedItem(lboPictures, &longSelected, &intSelectedData)){ return; @@ -109,10 +113,12 @@ void frmContactEditor::DeletePicture( wxCommandEvent& event ) void frmContactEditor::LoadPicture( wxListEvent& event ) { + // Load the picture. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboPictures, + if (lboPictures->GetItemCount() == 0 || !GetSelectedItem(lboPictures, &longSelected, &intSelectedData)){ return; @@ -130,7 +136,6 @@ void frmContactEditor::LoadPicture( 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")){ @@ -170,10 +175,12 @@ void frmContactEditor::LoadPicture( wxListEvent& event ) void frmContactEditor::SavePicture( wxCommandEvent &event ) { + // Save the picture to a file. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboPictures, + if (lboPictures->GetItemCount() == 0 || !GetSelectedItem(lboPictures, &longSelected, &intSelectedData)){