X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorIM.cpp;h=cfee2d3125ae1432e5fba2c0e7e35dcbecd2351b;hp=9d22d94e0fae784dee8fe78d8b1114a81533ce1e;hb=ada42724cf083b0a311cf22260485d61516c25c8;hpb=c612fb7241f0e7b8736745da18af62458e2c2e32 diff --git a/source/contacteditor/frmContactEditorIM.cpp b/source/contacteditor/frmContactEditorIM.cpp index 9d22d94..cfee2d3 100644 --- a/source/contacteditor/frmContactEditorIM.cpp +++ b/source/contacteditor/frmContactEditorIM.cpp @@ -26,8 +26,13 @@ frmContactEditorIM::frmContactEditorIM( wxWindow* parent ) : frmContactEditorIMADT( parent ) { + + // Setup the window. + EditorMode = FALSE; - sliPriority->Disable(); + priorityCtrl = new XABPriorityCtrl(tabGeneral); + szrGeneral->Add(priorityCtrl, 1, wxEXPAND, 5); + szrGeneral->Layout(); // Add some values to the drop down box for IM types. @@ -41,18 +46,11 @@ frmContactEditorIMADT( parent ) } -void frmContactEditorIM::EnablePriority( wxCommandEvent& event ) -{ - if (chkUsePref->IsChecked()){ - sliPriority->Enable(); - } else { - sliPriority->Disable(); - } -} - void frmContactEditorIM::ProcessAction( wxCommandEvent& event ) { + // Process the action. + long ListCtrlIndex; // Check if IM type is empty and if it is then @@ -142,9 +140,9 @@ void frmContactEditorIM::ProcessAction( wxCommandEvent& event ) // Set the priority. - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - IMListPrefPtr->insert(std::make_pair(IMListIndex, sliPriority->GetValue())); + IMListPrefPtr->insert(std::make_pair(IMListIndex, priorityCtrl->GetValue())); } else { @@ -163,9 +161,9 @@ void frmContactEditorIM::ProcessAction( wxCommandEvent& event ) IMListCtrlPtr->SetItem(ListCtrlIndex, 1, txtUsername->GetValue()); - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - IMListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), sliPriority->GetValue())); + IMListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue())); } @@ -222,9 +220,9 @@ void frmContactEditorIM::ProcessAction( wxCommandEvent& event ) IMListPrefPtr->erase(IMListIndex); - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - IMListPrefPtr->insert(std::make_pair(IMListIndex, sliPriority->GetValue())); + IMListPrefPtr->insert(std::make_pair(IMListIndex, priorityCtrl->GetValue())); } else { @@ -245,9 +243,9 @@ void frmContactEditorIM::ProcessAction( wxCommandEvent& event ) IMListCtrlPtr->SetItem(longSelected, 0, cmbIMType->GetValue()); IMListCtrlPtr->SetItem(longSelected, 1, txtUsername->GetValue()); - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - IMListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), sliPriority->GetValue())); + IMListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue())); } else { @@ -263,11 +261,18 @@ void frmContactEditorIM::ProcessAction( wxCommandEvent& event ) void frmContactEditorIM::CloseWindow( wxCommandEvent& event ) { + + // Close the window. + this->Close(); + } void frmContactEditorIM::SetEditorMode(bool EditMode, SectionType SectType) { + + // Set the editor mode. + // Set if the editor is adding or editing an address. // FALSE = Add // TRUE = Edit @@ -360,9 +365,8 @@ void frmContactEditorIM::SetEditorMode(bool EditMode, SectionType SectType) if (intiter->first == IMListIndex && intiter->second > 0 && intiter != IMListPrefPtr->end()){ - sliPriority->SetValue(intiter->second); - sliPriority->Enable(); - chkUsePref->SetValue(TRUE); + priorityCtrl->SetValue(intiter->second); + priorityCtrl->EnablePriority(true); } @@ -384,6 +388,8 @@ void frmContactEditorIM::SetupPointers( std::map *IMList, int IMIndex ) { + // Setup the pointers. + IMListPtr = IMList; IMListAltIDPtr = IMListAltID; IMListPIDPtr = IMListPID;