Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added comments to describe functions for frmContactEditorKey
[xestiaab/.git] / source / contacteditor / frmContactEditorKey.cpp
index c80642b..bc876d6 100644 (file)
@@ -25,6 +25,9 @@ frmContactEditorKey::frmContactEditorKey( wxWindow* parent )
 :
 frmContactEditorKeyADT( parent )
 {
+       
+       // Setup the window.
+       
        EditorMode = FALSE;
        sliPriority->Disable();
        
@@ -51,15 +54,22 @@ frmContactEditorKeyADT( parent )
 
 void frmContactEditorKey::EnablePriority( wxCommandEvent& event )
 {
+       
+       // Enable/disable the priority setting.
+       
        if (chkUsePref->IsChecked()){
                sliPriority->Enable();
        } else {
                sliPriority->Disable();
        }
+       
 }
 
 void frmContactEditorKey::SetEditorMode(bool EditMode)
 {
+       
+       // Set the editor mode.
+       
        // Set if the editor is adding or editing an address.
        // FALSE = Add
        // TRUE = Edit
@@ -113,7 +123,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
                        
                        striter = KeyListDataTypePtr->find(KeyListIndex);
                        
-                       if (striter->first == KeyListIndex){
+                       if (striter->first == KeyListIndex &&
+                               striter != KeyListDataTypePtr->end()){
                        
                                strValue = striter->second;
                        
@@ -152,7 +163,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
                        
                        striter = KeyListDataTypePtr->find(KeyListIndex);
                        
-                       if (striter->first == KeyListIndex){
+                       if (striter->first == KeyListIndex &&
+                               striter != KeyListDataTypePtr->end()){
                        
                                strValue = striter->second;
                        
@@ -168,7 +180,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
                
                striter = KeyListTypePtr->find(KeyListIndex);   
                
-               if (striter->first == KeyListIndex){
+               if (striter->first == KeyListIndex &&
+                       striter != KeyListTypePtr->end()){
                
                        strValue = striter->second;
                
@@ -192,7 +205,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
                
                intiter = KeyListPrefPtr->find(KeyListIndex);
                
-               if (intiter->first == KeyListIndex && intiter->second > 0){
+               if (intiter->first == KeyListIndex && intiter->second > 0 &&
+                       intiter != KeyListPrefPtr->end()){
                
                        sliPriority->SetValue(intiter->second);
                        sliPriority->Enable();
@@ -206,6 +220,9 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
 
 void frmContactEditorKey::ProcessAction( wxCommandEvent& event )
 {
+       
+       // Process action.
+       
        long ListCtrlIndex;
        int intKeyType = 0;
        
@@ -390,6 +407,8 @@ void frmContactEditorKey::ProcessAction( wxCommandEvent& event )
 void frmContactEditorKey::ProcessKeyType( wxCommandEvent& event )
 {
 
+       // Process the key type (via wxCommandEvent).
+       
        int intKeyType = 0;
        
        intKeyType = cmbKeyMainType->GetCurrentSelection();
@@ -411,6 +430,8 @@ void frmContactEditorKey::ProcessKeyType( wxCommandEvent& event )
 void frmContactEditorKey::ProcessKeyType()
 {
 
+       // Process the key type.
+       
        int intKeyType = 0;
        
        intKeyType = cmbKeyMainType->GetCurrentSelection();
@@ -432,6 +453,8 @@ void frmContactEditorKey::ProcessKeyType()
 void frmContactEditorKey::ConvertURLType( wxCommandEvent& event )
 {
 
+       // Convert the URL type.
+       
        wxString strValue;
 
        strValue = cmbURL->GetString(cmbURL->GetCurrentSelection());
@@ -447,6 +470,8 @@ void frmContactEditorKey::ConvertURLType( wxCommandEvent& event )
 void frmContactEditorKey::ConvertKeyType( wxCommandEvent& event )
 {
 
+       // Convert the key type.
+       
        wxString strValue;
 
        strValue = cmbKeyType->GetString(cmbKeyType->GetCurrentSelection());
@@ -461,7 +486,11 @@ void frmContactEditorKey::ConvertKeyType( wxCommandEvent& event )
 
 void frmContactEditorKey::CloseWindow( wxCommandEvent& event )
 {
+       
+       // Close this window.
+       
        this->Close();
+       
 }
 
 void frmContactEditorKey::SetupPointers(std::map<int, wxString> *KeyList,
@@ -476,6 +505,8 @@ void frmContactEditorKey::SetupPointers(std::map<int, wxString> *KeyList,
        int KeyIndex )
 {
 
+       // Setup the pointers.
+       
        KeyListPtr = KeyList;
        KeyListAltIDPtr = KeyListAltID;
        KeyListPIDPtr = KeyListPID;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy