X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorKey.cpp;h=78ee77a2438c8a9e3917928138085917e734a81b;hp=fb6319b8591b73a289983382c78a99ccceee2c1b;hb=bfe817b5bfae33a1eb666c463643ec119cd1d66d;hpb=a1e5a0c50e4081cd8db37acd168c5f045d2c6e81 diff --git a/source/contacteditor/frmContactEditorKey.cpp b/source/contacteditor/frmContactEditorKey.cpp index fb6319b..78ee77a 100644 --- a/source/contacteditor/frmContactEditorKey.cpp +++ b/source/contacteditor/frmContactEditorKey.cpp @@ -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 {