X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorEmail.cpp;h=aaaab18459320e21338a4a7bcad2d889359d6b27;hb=cb31afce9cc7f778ed1519c8d3b17cce6f7bc1a3;hp=2830a651f85a99e23976f0692b716769b0220c5d;hpb=da64d37d0a13895554e4ad945c46dd0af6d1c0e6;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditorEmail.cpp b/source/contacteditor/frmContactEditorEmail.cpp index 2830a65..aaaab18 100644 --- a/source/contacteditor/frmContactEditorEmail.cpp +++ b/source/contacteditor/frmContactEditorEmail.cpp @@ -24,21 +24,32 @@ frmContactEditorEmail::frmContactEditorEmail( wxWindow* parent ) : frmContactEditorEmailADT( parent ) { + + // Setup the window. + EditorMode = FALSE; sliPriority->Disable(); + } void frmContactEditorEmail::EnablePriority( wxCommandEvent& event ) { + + // Enable/disable the priority setting. + if (chkUsePref->IsChecked()){ sliPriority->Enable(); } else { sliPriority->Disable(); } + } void frmContactEditorEmail::ProcessData( wxCommandEvent& event ) { + + // Process action. + long ListCtrlIndex; if (EditorMode == FALSE){ @@ -148,12 +159,18 @@ void frmContactEditorEmail::ProcessData( wxCommandEvent& event ) void frmContactEditorEmail::CloseWindow( wxCommandEvent& event ) { + + // Close this window. + this->Close(); + } void frmContactEditorEmail::SetEditorMode(bool EditMode, SectionType SectType) { + // Set the editor mode. + // Set the editor mode for adding or editing an email address. if (EditMode == FALSE){ @@ -188,13 +205,14 @@ void frmContactEditorEmail::SetEditorMode(bool EditMode, SectionType SectType) intiter = EmailListPrefPtr->find(EmailListIndex); - if (intiter->first == EmailListIndex && intiter->second > 0){ + if (intiter->first == EmailListIndex && intiter->second > 0 && + intiter != EmailListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); chkUsePref->SetValue(TRUE); - } + } } @@ -223,4 +241,5 @@ void frmContactEditorEmail::SetupPointers(std::map *EmailList, EmailListPrefPtr = EmailListPref; EmailListCtrlPtr = EmailListCtrl; EmailListIndex = EmailIndex; + } \ No newline at end of file