X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorTelephone.cpp;h=0df8d2bce72d3b426b50fb5cea5ee5bfa58d8cd4;hb=f5037048f656e6578bac2f32eb851c57584ac636;hp=d6d8399fa4c0c69258ed2cecf69c534a71158e73;hpb=804f162ac221af8c1dc9fbdf5ff623d8c2880c9e;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditorTelephone.cpp b/source/contacteditor/frmContactEditorTelephone.cpp index d6d8399..0df8d2b 100644 --- a/source/contacteditor/frmContactEditorTelephone.cpp +++ b/source/contacteditor/frmContactEditorTelephone.cpp @@ -24,21 +24,32 @@ frmContactEditorTelephone::frmContactEditorTelephone( wxWindow* parent ) : frmContactEditorTelephoneADT( parent ) { + + // Setup the window. + EditorMode = FALSE; sliPriority->Disable(); + } void frmContactEditorTelephone::EnablePriority( wxCommandEvent& event ) { + + // Enable/disable the priority setting. + if (chkUsePref->IsChecked()){ sliPriority->Enable(); } else { sliPriority->Disable(); } + } void frmContactEditorTelephone::ProcessAction( wxCommandEvent& event ) { + + // Process action. + long ListCtrlIndex; if (EditorMode == FALSE){ @@ -175,7 +186,9 @@ void frmContactEditorTelephone::ProcessAction( wxCommandEvent& event ) } - TelephoneListTypePtr->insert(std::make_pair(TelephoneListIndex, strTelTypes)); + TelephoneListTypePtr->insert(std::make_pair(TelephoneListIndex, strTelTypes)); + + TelephoneListTypeInfoPtr->insert(std::make_pair(TelephoneListIndex, strTelTypes)); // Add Telephone Priority. @@ -351,6 +364,9 @@ void frmContactEditorTelephone::ProcessAction( wxCommandEvent& event ) TelephoneListTypePtr->erase(TelephoneListIndex); TelephoneListTypePtr->insert(std::make_pair(TelephoneListIndex, strTelTypes)); + TelephoneListTypeInfoPtr->erase(TelephoneListIndex); + TelephoneListTypeInfoPtr->insert(std::make_pair(TelephoneListIndex, strTelTypes)); + // Edit the Telephone Priority. TelephoneListPrefPtr->erase(TelephoneListIndex); @@ -397,12 +413,17 @@ void frmContactEditorTelephone::ProcessAction( wxCommandEvent& event ) void frmContactEditorTelephone::CloseWindow( wxCommandEvent& event ) { + // Close the window. + this->Close(); } void frmContactEditorTelephone::SetEditorMode(bool EditMode, SectionType SectType) { + + // Set the editor mode. + // Set if the editor is adding or editing an address. // FALSE = Add // TRUE = Edit @@ -517,7 +538,8 @@ void frmContactEditorTelephone::SetEditorMode(bool EditMode, SectionType SectTyp intiter = TelephoneListPrefPtr->find(TelephoneListIndex); - if (intiter->first == TelephoneListIndex && intiter->second > 0){ + if (intiter->first == TelephoneListIndex && intiter->second > 0 && + intiter != TelephoneListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); @@ -542,6 +564,8 @@ void frmContactEditorTelephone::SetupPointers(std::map *Telephone int TelephoneIndex ) { + // Setup the pointers. + TelephoneListPtr = TelephoneList; TelephoneListAltIDPtr = TelephoneListAltID; TelephoneListPIDPtr = TelephoneListPID;