X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorNotes.cpp;h=b2b6983848b1e59d7450f92d7c1cdbe2ebc8cfcc;hb=cb31afce9cc7f778ed1519c8d3b17cce6f7bc1a3;hp=f4aaef48248bf520a61eefca090ca9ff8815737c;hpb=45729fca56479bd9158486e0cda0c4a94b4dd1dc;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditorNotes.cpp b/source/contacteditor/frmContactEditorNotes.cpp index f4aaef4..b2b6983 100644 --- a/source/contacteditor/frmContactEditorNotes.cpp +++ b/source/contacteditor/frmContactEditorNotes.cpp @@ -1,3 +1,21 @@ +// frmContactEditorNotes.cpp - frmContactEditorNotes 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 "frmContactEditorNotes.h" #include "../common/textprocessing.h" #include @@ -6,21 +24,31 @@ frmContactEditorNotes::frmContactEditorNotes( wxWindow* parent ) : frmContactEditorNotesADT( parent ) { + + // Setup the editor window. + EditorMode = FALSE; sliPriority->Disable(); } void frmContactEditorNotes::EnablePriority( wxCommandEvent& event ) { + + // Enable/disable the priority setting. + if (chkUsePref->IsChecked()){ sliPriority->Enable(); } else { sliPriority->Disable(); } + } void frmContactEditorNotes::ProcessAction( wxCommandEvent& event ) { + + // Process action. + long ListCtrlIndex; if (EditorMode == FALSE){ @@ -166,6 +194,9 @@ void frmContactEditorNotes::ProcessAction( wxCommandEvent& event ) void frmContactEditorNotes::SetEditorMode(bool EditMode, SectionType SectType) { + + // Set the editor mode. + // Set if the editor is adding or editing an address. // FALSE = Add // TRUE = Edit @@ -202,7 +233,8 @@ void frmContactEditorNotes::SetEditorMode(bool EditMode, SectionType SectType) striter = NotesListLangPtr->find(NotesListIndex); - if (striter->first == NotesListIndex){ + if (striter->first == NotesListIndex && + striter != NotesListLangPtr->end()){ strValue = striter->second; @@ -214,7 +246,8 @@ void frmContactEditorNotes::SetEditorMode(bool EditMode, SectionType SectType) intiter = NotesListPrefPtr->find(NotesListIndex); - if (intiter->first == NotesListIndex && intiter->second > 0){ + if (intiter->first == NotesListIndex && intiter->second > 0 && + intiter != NotesListPrefPtr->end()){ sliPriority->SetValue(intiter->second); sliPriority->Enable(); @@ -230,7 +263,11 @@ void frmContactEditorNotes::SetEditorMode(bool EditMode, SectionType SectType) void frmContactEditorNotes::CloseWindow( wxCommandEvent& event ) { + + // Close the window. + this->Close(); + } @@ -245,6 +282,8 @@ void frmContactEditorNotes::SetupPointers(std::map *NotesList, int NotesIndex ) { + // Setup the pointers. + NotesListPtr = NotesList; NotesListLangPtr = NotesListLang; NotesListAltIDPtr = NotesListAltID;