X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorTelephone.cpp;h=0b609b238b088d729b82a6d77e69f6ab28b3d306;hp=0df8d2bce72d3b426b50fb5cea5ee5bfa58d8cd4;hb=cc75472a31e981886798377dbbbbdb77dfced96e;hpb=ce6b921249b87bb62df485af240697ba81cd409d diff --git a/source/contacteditor/frmContactEditorTelephone.cpp b/source/contacteditor/frmContactEditorTelephone.cpp index 0df8d2b..0b609b2 100644 --- a/source/contacteditor/frmContactEditorTelephone.cpp +++ b/source/contacteditor/frmContactEditorTelephone.cpp @@ -28,20 +28,8 @@ frmContactEditorTelephoneADT( parent ) // Setup the window. EditorMode = FALSE; - sliPriority->Disable(); - -} - -void frmContactEditorTelephone::EnablePriority( wxCommandEvent& event ) -{ - - // Enable/disable the priority setting. - - if (chkUsePref->IsChecked()){ - sliPriority->Enable(); - } else { - sliPriority->Disable(); - } + priorityCtrl = new XABPriorityCtrl(tabGeneral); + szrGeneral->Add(priorityCtrl, 1, wxEXPAND, 5); } @@ -192,9 +180,9 @@ void frmContactEditorTelephone::ProcessAction( wxCommandEvent& event ) // Add Telephone Priority. - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - TelephoneListPrefPtr->insert(std::make_pair(TelephoneListIndex, sliPriority->GetValue())); + TelephoneListPrefPtr->insert(std::make_pair(TelephoneListIndex, priorityCtrl->GetValue())); } else { @@ -215,9 +203,9 @@ void frmContactEditorTelephone::ProcessAction( wxCommandEvent& event ) TelephoneListCtrlPtr->SetItem(ListCtrlIndex, 1, strTelTypesLCtrl); - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - TelephoneListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), sliPriority->GetValue())); + TelephoneListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue())); } @@ -371,9 +359,9 @@ void frmContactEditorTelephone::ProcessAction( wxCommandEvent& event ) TelephoneListPrefPtr->erase(TelephoneListIndex); - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - TelephoneListPrefPtr->insert(std::make_pair(TelephoneListIndex, sliPriority->GetValue())); + TelephoneListPrefPtr->insert(std::make_pair(TelephoneListIndex, priorityCtrl->GetValue())); } else { @@ -394,9 +382,9 @@ void frmContactEditorTelephone::ProcessAction( wxCommandEvent& event ) TelephoneListCtrlPtr->SetItem(longSelected, 0, txtTelephone->GetValue()); TelephoneListCtrlPtr->SetItem(longSelected, 1, strTelTypesLCtrl); - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - TelephoneListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), sliPriority->GetValue())); + TelephoneListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue())); } else { @@ -541,9 +529,8 @@ void frmContactEditorTelephone::SetEditorMode(bool EditMode, SectionType SectTyp if (intiter->first == TelephoneListIndex && intiter->second > 0 && intiter != TelephoneListPrefPtr->end()){ - sliPriority->SetValue(intiter->second); - sliPriority->Enable(); - chkUsePref->SetValue(TRUE); + priorityCtrl->SetValue(intiter->second); + priorityCtrl->EnablePriority(true); }