X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorKey.cpp;h=01de31813e355750aa363850a11a3ea08a13efd3;hp=fb6319b8591b73a289983382c78a99ccceee2c1b;hb=ada42724cf083b0a311cf22260485d61516c25c8;hpb=27d8c45d1c229cbed71073ee9fc3e93b60373e94 diff --git a/source/contacteditor/frmContactEditorKey.cpp b/source/contacteditor/frmContactEditorKey.cpp index fb6319b..01de318 100644 --- a/source/contacteditor/frmContactEditorKey.cpp +++ b/source/contacteditor/frmContactEditorKey.cpp @@ -29,7 +29,9 @@ frmContactEditorKeyADT( parent ) // Setup the window. EditorMode = FALSE; - sliPriority->Disable(); + priorityCtrl = new XABPriorityCtrl(tabGeneral); + szrGeneral->Add(priorityCtrl, 1, wxEXPAND, 5); + szrGeneral->Layout(); // Setup the control boxes and hide tabs unless they are // needed. @@ -52,19 +54,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 +197,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 +284,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 +295,6 @@ void frmContactEditorKey::ProcessAction( wxCommandEvent& event ) } - if (chkUsePref->IsChecked()){ - - } - this->Close(); } else if (EditorMode == TRUE){ @@ -388,10 +372,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 {