X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorRelated.cpp;h=6d94ef53e67fd93b014289b7cb61916ae0669b06;hb=66582143bc7b3e31b38abcb86da63fd8f2f61415;hp=a9f774aa99458656db8bfcb5f810b832f323f362;hpb=45729fca56479bd9158486e0cda0c4a94b4dd1dc;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditorRelated.cpp b/source/contacteditor/frmContactEditorRelated.cpp index a9f774a..6d94ef5 100644 --- a/source/contacteditor/frmContactEditorRelated.cpp +++ b/source/contacteditor/frmContactEditorRelated.cpp @@ -1,3 +1,21 @@ +// frmContactEditorRelated.cpp - frmContactEditorRelated form. +// +// (c) 2012-2015 Xestia Software Development. +// +// This file is part of Xestia Address Book. +// +// Xestia Address Book is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by the +// Free Software Foundation, version 3 of the license. +// +// Xestia Address Book is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with Xestia Address Book. If not, see + #include "frmContactEditorRelated.h" #include #include "../common/textprocessing.h" @@ -8,6 +26,8 @@ frmContactEditorRelated::frmContactEditorRelated( wxWindow* parent ) frmContactEditorRelatedADT( parent ) { + // Setup the window. + EditorMode = FALSE; sliPriority->Disable(); @@ -38,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; @@ -81,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; @@ -177,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(); @@ -193,6 +222,9 @@ void frmContactEditorRelated::SetEditorMode(bool EditMode, SectionType SectType) void frmContactEditorRelated::ProcessData( wxCommandEvent& event ) { + + // Process data. + long ListCtrlIndex; if (EditorMode == FALSE){ @@ -482,7 +514,11 @@ void frmContactEditorRelated::ProcessData( wxCommandEvent& event ) void frmContactEditorRelated::CloseWindow( wxCommandEvent& event ) { + + // Close this window. + this->Close(); + } void frmContactEditorRelated::SetupPointers(std::map *RelatedList, @@ -496,6 +532,8 @@ void frmContactEditorRelated::SetupPointers(std::map *RelatedList int RelatedIndex ) { + // Setup the pointers. + RelatedListPtr = RelatedList; RelatedListRelTypePtr = RelatedListRelType; RelatedListAltIDPtr = RelatedListAltID;