// 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.
}
-void frmContactEditorKey::EnablePriority( wxCommandEvent& event )
-{
-
- // Enable/disable the priority setting.
-
- if (chkUsePref->IsChecked()){
- sliPriority->Enable();
- } else {
- sliPriority->Disable();
- }
-
-}
-
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);
}
// 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 {
}
- if (chkUsePref->IsChecked()){
-
- }
-
this->Close();
} else if (EditorMode == TRUE){
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 {
{
// Process the key type (via wxCommandEvent).
-
- int intKeyType = 0;
-
- intKeyType = cmbKeyMainType->GetCurrentSelection();
-
- if (intKeyType == 0){
-
- tabURL->Show();
- tabKey->Hide();
-
- } else if (intKeyType == 1){
-
- tabURL->Hide();
- tabKey->Show();
-
- }
+ ProcessKeyType();
+
}
void frmContactEditorKey::ProcessKeyType()