X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorTelephone.cpp;h=68d65620ab40534180c7a3f8abeee23e0afa601d;hp=0df8d2bce72d3b426b50fb5cea5ee5bfa58d8cd4;hb=ada42724cf083b0a311cf22260485d61516c25c8;hpb=f5037048f656e6578bac2f32eb851c57584ac636 diff --git a/source/contacteditor/frmContactEditorTelephone.cpp b/source/contacteditor/frmContactEditorTelephone.cpp index 0df8d2b..68d6562 100644 --- a/source/contacteditor/frmContactEditorTelephone.cpp +++ b/source/contacteditor/frmContactEditorTelephone.cpp @@ -28,20 +28,9 @@ 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); + szrGeneral->Layout(); } @@ -192,9 +181,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 +204,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 +360,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 +383,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 +530,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); }