Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmContactEditorKey: Implemented priority control
[xestiaab/.git] / source / contacteditor / frmContactEditorKey.cpp
index fb6319b..78ee77a 100644 (file)
@@ -29,7 +29,8 @@ frmContactEditorKeyADT( parent )
        // Setup the window.
        
        EditorMode = FALSE;
-       sliPriority->Disable();
+       priorityCtrl = new XABPriorityCtrl(tabGeneral);
+       szrGeneral->Add(priorityCtrl, 1, wxEXPAND, 5);
        
        // Setup the control boxes and hide tabs unless they are
        // needed.
@@ -52,19 +53,6 @@ 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)
 {
        
@@ -208,9 +196,8 @@ void frmContactEditorKey::SetEditorMode(bool EditMode)
                if (intiter->first == KeyListIndex && intiter->second > 0 &&
                        intiter != KeyListPrefPtr->end()){
                
-                       sliPriority->SetValue(intiter->second);
-                       sliPriority->Enable();
-                       chkUsePref->SetValue(TRUE);
+                       priorityCtrl->SetValue(intiter->second);
+                       priorityCtrl->EnablePriority(true);
                
                }
                
@@ -296,10 +283,10 @@ void frmContactEditorKey::ProcessAction( wxCommandEvent& event )
                
                // Get Key priority.
                
-               if (chkUsePref->IsChecked()){
+               if (priorityCtrl->IsPriorityChecked()){
                
-                       KeyListPrefPtr->insert(std::make_pair(KeyListIndex, sliPriority->GetValue()));
-                       KeyListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), sliPriority->GetValue()));                        
+                       KeyListPrefPtr->insert(std::make_pair(KeyListIndex, priorityCtrl->GetValue()));
+                       KeyListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));                       
                
                } else {
                
@@ -307,10 +294,6 @@ void frmContactEditorKey::ProcessAction( wxCommandEvent& event )
                
                }
                
-               if (chkUsePref->IsChecked()){
-               
-               }
-               
                this->Close();
                
        } else if (EditorMode == TRUE){
@@ -388,10 +371,10 @@ void frmContactEditorKey::ProcessAction( wxCommandEvent& event )
                
                KeyListPrefPtr->erase(KeyListIndex);            
                
-               if (chkUsePref->IsChecked()){
+               if (priorityCtrl->IsPriorityChecked()){
                
-                       KeyListPrefPtr->insert(std::make_pair(KeyListIndex, sliPriority->GetValue()));
-                       KeyListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), sliPriority->GetValue()));
+                       KeyListPrefPtr->insert(std::make_pair(KeyListIndex, priorityCtrl->GetValue()));
+                       KeyListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));
                
                } else {
                
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