X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorRelated.cpp;h=6d94ef53e67fd93b014289b7cb61916ae0669b06;hb=bdeb1b14f7c371af5ffad2aa06a1f83ad7c53fa9;hp=31bbf7e9ce14fa53a74ebe0495421e2292b25456;hpb=da64d37d0a13895554e4ad945c46dd0af6d1c0e6;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditorRelated.cpp b/source/contacteditor/frmContactEditorRelated.cpp index 31bbf7e..6d94ef5 100644 --- a/source/contacteditor/frmContactEditorRelated.cpp +++ b/source/contacteditor/frmContactEditorRelated.cpp @@ -26,6 +26,8 @@ frmContactEditorRelated::frmContactEditorRelated( wxWindow* parent ) frmContactEditorRelatedADT( parent ) { + // Setup the window. + EditorMode = FALSE; sliPriority->Disable(); @@ -56,15 +58,22 @@ frmContactEditorRelatedADT( parent ) void frmContactEditorRelated::EnablePriority( wxCommandEvent& event ) { + + // Enable/disable the priority setting. + if (chkUsePref->IsChecked()){ sliPriority->Enable(); } else { sliPriority->Disable(); } + } void frmContactEditorRelated::SetEditorMode(bool EditMode, SectionType SectType) { + + // Set the editor mode. + if (EditMode == FALSE){ EditorMode = FALSE; @@ -99,7 +108,8 @@ void frmContactEditorRelated::SetEditorMode(bool EditMode, SectionType SectType) striter = RelatedListRelTypePtr->find(RelatedListIndex); - if (striter->first == RelatedListIndex){ + if (striter->first == RelatedListIndex && + striter != RelatedListRelTypePtr->end()){ strValue = striter->second; @@ -195,7 +205,8 @@ void frmContactEditorRelated::SetEditorMode(bool EditMode, SectionType SectType) intiter = RelatedListPrefPtr->find(RelatedListIndex); - if (intiter->first == RelatedListIndex && intiter->second > 0){ + if (intiter->first == RelatedListIndex && intiter->second > 0 && + intiter != RelatedListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); @@ -211,6 +222,9 @@ void frmContactEditorRelated::SetEditorMode(bool EditMode, SectionType SectType) void frmContactEditorRelated::ProcessData( wxCommandEvent& event ) { + + // Process data. + long ListCtrlIndex; if (EditorMode == FALSE){ @@ -500,7 +514,11 @@ void frmContactEditorRelated::ProcessData( wxCommandEvent& event ) void frmContactEditorRelated::CloseWindow( wxCommandEvent& event ) { + + // Close this window. + this->Close(); + } void frmContactEditorRelated::SetupPointers(std::map *RelatedList, @@ -514,6 +532,8 @@ void frmContactEditorRelated::SetupPointers(std::map *RelatedList int RelatedIndex ) { + // Setup the pointers. + RelatedListPtr = RelatedList; RelatedListRelTypePtr = RelatedListRelType; RelatedListAltIDPtr = RelatedListAltID;