+// 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 <http://www.gnu.org/licenses/>
+
#include "frmContactEditorNotes.h"
-#include "../common/textprocessing.h"
-#include <wx/tokenzr.h>
frmContactEditorNotes::frmContactEditorNotes( wxWindow* parent )
:
frmContactEditorNotesADT( parent )
{
+
+ // Setup the editor window.
+
EditorMode = FALSE;
sliPriority->Disable();
+
+ // Setup the language combo box.
+
+ std::vector<std::string> LanguageCodeList = GetLanguageCodeList();
+
+ wxArrayString LanguageList;
+
+ for (auto LanguageItem : LanguageCodeList){
+
+ LanguageList.Add((wxString)LanguageItem, 1);
+
+ }
+
+ cmbLanguage->Append(LanguageList);
+
}
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){
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
striter = NotesListLangPtr->find(NotesListIndex);
- if (striter->first == NotesListIndex){
+ strValue.clear();
+
+ if (striter->first == NotesListIndex &&
+ striter != NotesListLangPtr->end()){
strValue = striter->second;
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();
void frmContactEditorNotes::CloseWindow( wxCommandEvent& event )
{
+
+ // Close the window.
+
this->Close();
+
}
int NotesIndex )
{
+ // Setup the pointers.
+
NotesListPtr = NotesList;
NotesListLangPtr = NotesListLang;
NotesListAltIDPtr = NotesListAltID;