X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-General.cpp;h=9f892eb24549b85e30526dde364c973666cc7bf8;hb=bac054ea5eda94fe663d8b1a7c680ae80de8075c;hp=75ececb7e68014e439287c26c2abc6375d0a8a78;hpb=c6694e56236cca9741afafb6c62ce5e11053cefc;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-General.cpp b/source/contacteditor/frmContactEditor-General.cpp index 75ececb..9f892eb 100644 --- a/source/contacteditor/frmContactEditor-General.cpp +++ b/source/contacteditor/frmContactEditor-General.cpp @@ -36,11 +36,10 @@ void frmContactEditor::AddGeneralNickname( wxCommandEvent& event ) { - int intResult = 0; - + // Bring up the window for adding a nickname. + frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this ); frameCENickname->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralNicknamesList); frameCENickname->SetupPointers(&ContactEditorData.GeneralNicknamesList, &ContactEditorData.GeneralNicknamesListAltID, &ContactEditorData.GeneralNicknamesListPID, @@ -53,16 +52,19 @@ void frmContactEditor::AddGeneralNickname( wxCommandEvent& event ) frameCENickname->ShowModal(); delete frameCENickname; frameCENickname = NULL; + intValueSeek++; } void frmContactEditor::ModifyGeneralNickname( wxCommandEvent& event ) { + // Bring up the window for modifying a nickname. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboNicknames, + if (lboNicknames->GetItemCount() == 0 || !GetSelectedItem(lboNicknames, &longSelected, &intSelectedData)){ return; @@ -88,10 +90,12 @@ void frmContactEditor::ModifyGeneralNickname( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralNickname( wxCommandEvent& event ) { + // Bring up the window for deleting a nickname. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboNicknames, + if (lboNicknames->GetItemCount() == 0 || !GetSelectedItem(lboNicknames, &longSelected, &intSelectedData)){ return; @@ -113,11 +117,10 @@ void frmContactEditor::DeleteGeneralNickname( wxCommandEvent& event ) void frmContactEditor::AddGeneralAddress( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding an address. frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this ); frameCEAddress->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralAddressList); frameCEAddress->SetupPointers(&ContactEditorData.GeneralAddressList, &ContactEditorData.GeneralAddressListTown, &ContactEditorData.GeneralAddressListCounty, @@ -138,16 +141,19 @@ void frmContactEditor::AddGeneralAddress( wxCommandEvent& event ) frameCEAddress->ShowModal(); delete frameCEAddress; frameCEAddress = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralAddress( wxCommandEvent& event ) { + + // Bring up the window for editing an address. long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboAddresses, + if (lboAddresses->GetItemCount() == 0 || !GetSelectedItem(lboAddresses, &longSelected, &intSelectedData)){ @@ -189,10 +195,12 @@ void frmContactEditor::ModifyGeneralAddress( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralAddress( wxCommandEvent& event ) { + // Bring up the window for deleting a nickname. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboAddresses, + if (lboAddresses->GetItemCount() == 0 || !GetSelectedItem(lboAddresses, &longSelected, &intSelectedData)){ @@ -217,11 +225,10 @@ void frmContactEditor::DeleteGeneralAddress( wxCommandEvent& event ) void frmContactEditor::AddGeneralEmail( wxCommandEvent& event ) { - int intResult = 0; - + // Bring up the window for adding an email. + frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this ); frameCEEmail->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralAddressList); frameCEEmail->SetupPointers(&ContactEditorData.GeneralEmailList, &ContactEditorData.GeneralEmailListAltID, &ContactEditorData.GeneralEmailListPID, @@ -233,16 +240,19 @@ void frmContactEditor::AddGeneralEmail( wxCommandEvent& event ) frameCEEmail->ShowModal(); delete frameCEEmail; frameCEEmail = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralEmail( wxCommandEvent& event ) { + // Bring up the window for modifying an email. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboEmails, + if (lboEmails->GetItemCount() == 0 || !GetSelectedItem(lboEmails, &longSelected, &intSelectedData)){ @@ -269,10 +279,12 @@ void frmContactEditor::ModifyGeneralEmail( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralEmail( wxCommandEvent& event ) { + // Bring up the window for deleting an email. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboEmails, + if (lboEmails->GetItemCount() == 0 || !GetSelectedItem(lboEmails, &longSelected, &intSelectedData)){ @@ -292,11 +304,10 @@ void frmContactEditor::DeleteGeneralEmail( wxCommandEvent& event ) void frmContactEditor::AddGeneralIM( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding a IM address. frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this ); frameCEIM->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralIMList); frameCEIM->SetupPointers(&ContactEditorData.GeneralIMList, &ContactEditorData.GeneralIMListAltID, &ContactEditorData.GeneralIMListPID, @@ -310,16 +321,19 @@ void frmContactEditor::AddGeneralIM( wxCommandEvent& event ) frameCEIM->ShowModal(); delete frameCEIM; frameCEIM = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralIM( wxCommandEvent& event ) { + // Bring up the window for editing a IM address. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboIM, + if (lboIM->GetItemCount() == 0 || !GetSelectedItem(lboIM, &longSelected, &intSelectedData)){ @@ -348,10 +362,12 @@ void frmContactEditor::ModifyGeneralIM( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralIM( wxCommandEvent& event ) { + // Bring up the window for deleting an IM address. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboIM, + if (lboIM->GetItemCount() == 0 || !GetSelectedItem(lboIM, &longSelected, &intSelectedData)){ @@ -371,11 +387,10 @@ void frmContactEditor::DeleteGeneralIM( wxCommandEvent& event ) void frmContactEditor::AddGeneralTelephone( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding a telephone. frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this ); frameCETel->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralTelephoneList); frameCETel->SetupPointers(&ContactEditorData.GeneralTelephoneList, &ContactEditorData.GeneralTelephoneListAltID, &ContactEditorData.GeneralTelephoneListPID, @@ -388,16 +403,19 @@ void frmContactEditor::AddGeneralTelephone( wxCommandEvent& event ) frameCETel->ShowModal(); delete frameCETel; frameCETel = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralTelephone( wxCommandEvent& event ) { + // Bring up the window for editing a telephone. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboTelephone, + if (lboTelephone->GetItemCount() == 0 || !GetSelectedItem(lboTelephone, &longSelected, &intSelectedData)){ @@ -425,10 +443,12 @@ void frmContactEditor::ModifyGeneralTelephone( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralTelephone( wxCommandEvent& event ) { + // Bring up the window for deleting a telephone. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboTelephone, + if (lboTelephone->GetItemCount() == 0 || !GetSelectedItem(lboTelephone, &longSelected, &intSelectedData)){ @@ -448,11 +468,10 @@ void frmContactEditor::DeleteGeneralTelephone( wxCommandEvent& event ) void frmContactEditor::AddGeneralLanguages( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding a language. frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this ); frameCELang->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralLanguageList); frameCELang->SetupPointers(&ContactEditorData.GeneralLanguageList, &ContactEditorData.GeneralLanguageListAltID, &ContactEditorData.GeneralLanguageListPID, @@ -464,16 +483,19 @@ void frmContactEditor::AddGeneralLanguages( wxCommandEvent& event ) frameCELang->ShowModal(); delete frameCELang; frameCELang = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralLanguages( wxCommandEvent& event ) { + // Bring up the window for modifying a language. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboLanguages, + if (lboLanguages->GetItemCount() == 0 || !GetSelectedItem(lboLanguages, &longSelected, &intSelectedData)){ @@ -500,10 +522,12 @@ void frmContactEditor::ModifyGeneralLanguages( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralLanguage( wxCommandEvent& event ) { + // Bring up the window for deleting a language. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboLanguages, + if (lboLanguages->GetItemCount() == 0 || !GetSelectedItem(lboLanguages, &longSelected, &intSelectedData)){ @@ -522,11 +546,10 @@ void frmContactEditor::DeleteGeneralLanguage( wxCommandEvent& event ) void frmContactEditor::AddGeneralTimezone( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding a timezone. frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this ); frameCETZ->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralTZList); frameCETZ->SetupPointers(&ContactEditorData.GeneralTZList, &ContactEditorData.GeneralTZListAltID, &ContactEditorData.GeneralTZListPID, @@ -539,16 +562,19 @@ void frmContactEditor::AddGeneralTimezone( wxCommandEvent& event ) frameCETZ->ShowModal(); delete frameCETZ; frameCETZ = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralTimezone( wxCommandEvent& event ) { + // Bring up a window for editing a timezone. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboTimezones, + if (lboTimezones->GetItemCount() == 0 || !GetSelectedItem(lboTimezones, &longSelected, &intSelectedData)){ @@ -575,10 +601,12 @@ void frmContactEditor::ModifyGeneralTimezone( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralTimezone( wxCommandEvent& event ) { + // Bring up the window for deleting a timezone. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboTimezones, + if (lboTimezones->GetItemCount() == 0 || !GetSelectedItem(lboTimezones, &longSelected, &intSelectedData)){ @@ -598,11 +626,10 @@ void frmContactEditor::DeleteGeneralTimezone( wxCommandEvent& event ) void frmContactEditor::AddGeneralGeoposition( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding a geoposition location. frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this ); frameCEGeo->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralGeographyList); frameCEGeo->SetupPointers(&ContactEditorData.GeneralGeographyList, &ContactEditorData.GeneralGeographyListAltID, &ContactEditorData.GeneralGeographyListPID, @@ -616,16 +643,19 @@ void frmContactEditor::AddGeneralGeoposition( wxCommandEvent& event ) frameCEGeo->ShowModal(); delete frameCEGeo; frameCEGeo = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralGeoposition( wxCommandEvent& event ) { + // Bring up the window for editing a geoposition location. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboGeoposition, + if (lboGeoposition->GetItemCount() == 0 || !GetSelectedItem(lboGeoposition, &longSelected, &intSelectedData)){ @@ -655,10 +685,12 @@ void frmContactEditor::ModifyGeneralGeoposition( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralGeoposition( wxCommandEvent& event ) { + // Bring up the window for deleting a geoposition location. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboGeoposition, + if (lboGeoposition->GetItemCount() == 0 || !GetSelectedItem(lboGeoposition, &longSelected, &intSelectedData)){ @@ -679,11 +711,10 @@ void frmContactEditor::DeleteGeneralGeoposition( wxCommandEvent& event ) void frmContactEditor::AddGeneralRelated( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding a relation. frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this ); frameCERel->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralRelatedList); frameCERel->SetupPointers(&ContactEditorData.GeneralRelatedList, &ContactEditorData.GeneralRelatedListRelType, &ContactEditorData.GeneralRelatedListAltID, @@ -696,16 +727,19 @@ void frmContactEditor::AddGeneralRelated( wxCommandEvent& event ) frameCERel->ShowModal(); delete frameCERel; frameCERel = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralRelated( wxCommandEvent& event ) { + // Bring up the window for editing a relation. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboRelated, + if (lboRelated->GetItemCount() == 0 || !GetSelectedItem(lboRelated, &longSelected, &intSelectedData)){ @@ -733,10 +767,12 @@ void frmContactEditor::ModifyGeneralRelated( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralRelated( wxCommandEvent& event ) { + // Bring up a window for deleting a relation. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboRelated, + if (lboRelated->GetItemCount() == 0 || !GetSelectedItem(lboRelated, &longSelected, &intSelectedData)){ @@ -756,11 +792,10 @@ void frmContactEditor::DeleteGeneralRelated( wxCommandEvent& event ) void frmContactEditor::AddGeneralWebsite( wxCommandEvent& event ) { - int intResult = 0; + // Bring up a window for adding a website. frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this ); frameCEWeb->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralWebsiteList); frameCEWeb->SetupPointers(&ContactEditorData.GeneralWebsiteList, &ContactEditorData.GeneralWebsiteListAltID, &ContactEditorData.GeneralWebsiteListPID, @@ -773,16 +808,19 @@ void frmContactEditor::AddGeneralWebsite( wxCommandEvent& event ) frameCEWeb->ShowModal(); delete frameCEWeb; frameCEWeb = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralWebsite( wxCommandEvent& event ) { + // Bring up a window for editing a website. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboWebsites, + if (lboWebsites->GetItemCount() == 0 || !GetSelectedItem(lboWebsites, &longSelected, &intSelectedData)){ @@ -810,10 +848,12 @@ void frmContactEditor::ModifyGeneralWebsite( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralWebsite( wxCommandEvent& event ) { + // Bring up a window for deleting a website. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboWebsites, + if (lboWebsites->GetItemCount() == 0 || !GetSelectedItem(lboWebsites, &longSelected, &intSelectedData)){ @@ -833,11 +873,10 @@ void frmContactEditor::DeleteGeneralWebsite( wxCommandEvent& event ) void frmContactEditor::AddGeneralTitle( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding a title. frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this ); frameCETitle->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralTitleList); frameCETitle->SetupPointers(&ContactEditorData.GeneralTitleList, &ContactEditorData.GeneralTitleListLanguage, &ContactEditorData.GeneralTitleListAltID, @@ -850,16 +889,19 @@ void frmContactEditor::AddGeneralTitle( wxCommandEvent& event ) frameCETitle->ShowModal(); delete frameCETitle; frameCETitle = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralTitle( wxCommandEvent& event ) { + // Bring up the window for editing a title. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboTitles, + if (lboTitles->GetItemCount() == 0 || !GetSelectedItem(lboTitles, &longSelected, &intSelectedData)){ @@ -887,10 +929,12 @@ void frmContactEditor::ModifyGeneralTitle( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralTitle( wxCommandEvent& event ) { + // Bring up the window for deleting a title. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboTitles, + if (lboTitles->GetItemCount() == 0 || !GetSelectedItem(lboTitles, &longSelected, &intSelectedData)){ @@ -910,11 +954,10 @@ void frmContactEditor::DeleteGeneralTitle( wxCommandEvent& event ) void frmContactEditor::AddGeneralRole( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding a role. frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this ); frameCERole->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralRoleList); frameCERole->SetupPointers(&ContactEditorData.GeneralRoleList, &ContactEditorData.GeneralRoleListLanguage, &ContactEditorData.GeneralRoleListAltID, @@ -927,16 +970,19 @@ void frmContactEditor::AddGeneralRole( wxCommandEvent& event ) frameCERole->ShowModal(); delete frameCERole; frameCERole = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralRole( wxCommandEvent& event ) { + // Bring up the window for editing a role. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboRoles, + if (lboRoles->GetItemCount() == 0 || !GetSelectedItem(lboRoles, &longSelected, &intSelectedData)){ @@ -964,10 +1010,12 @@ void frmContactEditor::ModifyGeneralRole( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralRole( wxCommandEvent& event ) { + // Bring up the window for deleting a role. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboRoles, + if (lboRoles->GetItemCount() == 0 || !GetSelectedItem(lboRoles, &longSelected, &intSelectedData)){ @@ -987,11 +1035,10 @@ void frmContactEditor::DeleteGeneralRole( wxCommandEvent& event ) void frmContactEditor::AddGeneralOrganisation( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding an organisation. frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this ); frameCEOrg->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralOrganisationsList); frameCEOrg->SetupPointers(&ContactEditorData.GeneralOrganisationsList, &ContactEditorData.GeneralOrganisationsListLanguage, &ContactEditorData.GeneralOrganisationsListSortAs, @@ -1005,16 +1052,19 @@ void frmContactEditor::AddGeneralOrganisation( wxCommandEvent& event ) frameCEOrg->ShowModal(); delete frameCEOrg; frameCEOrg = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralOrganisation( wxCommandEvent& event ) { + // Bring up the window for editing an organisation. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboOrganisations, + if (lboOrganisations->GetItemCount() == 0 || !GetSelectedItem(lboOrganisations, &longSelected, &intSelectedData)){ @@ -1043,10 +1093,12 @@ void frmContactEditor::ModifyGeneralOrganisation( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralOrganisation( wxCommandEvent& event ) { + // Bring up the window for deleting an organisation. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboOrganisations, + if (lboOrganisations->GetItemCount() == 0 || !GetSelectedItem(lboOrganisations, &longSelected, &intSelectedData)){ @@ -1067,11 +1119,10 @@ void frmContactEditor::DeleteGeneralOrganisation( wxCommandEvent& event ) void frmContactEditor::AddGeneralNote( wxCommandEvent& event ) { - int intResult = 0; + // Bring up the window for adding a note. frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this ); frameCENote->SetEditorMode(FALSE, CE_GENERAL); - intResult = GetLastInt(&ContactEditorData.GeneralNoteList); frameCENote->SetupPointers(&ContactEditorData.GeneralNoteList, &ContactEditorData.GeneralNoteListLanguage, &ContactEditorData.GeneralNoteListAltID, @@ -1084,16 +1135,19 @@ void frmContactEditor::AddGeneralNote( wxCommandEvent& event ) frameCENote->ShowModal(); delete frameCENote; frameCENote = NULL; - + intValueSeek++; + } void frmContactEditor::ModifyGeneralNote( wxCommandEvent& event ) { + // Bring up the window for editing a note. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboNotes, + if (lboNotes->GetItemCount() == 0 || !GetSelectedItem(lboNotes, &longSelected, &intSelectedData)){ @@ -1121,10 +1175,12 @@ void frmContactEditor::ModifyGeneralNote( wxCommandEvent& event ) void frmContactEditor::DeleteGeneralNote( wxCommandEvent& event ) { + // Bring up a window for deleting a note. + long longSelected = -1; int intSelectedData = 0; - if (!GetSelectedItem(lboNotes, + if (lboBusinessNotes->GetItemCount() == 0 || !GetSelectedItem(lboNotes, &longSelected, &intSelectedData)){