X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorIM.cpp;h=87b8cb8d434f9926ddff82e31ecfd1b82487216e;hp=9d22d94e0fae784dee8fe78d8b1114a81533ce1e;hb=5c75ce1e9d668d15d65dcb541fb09c49f01de277;hpb=c612fb7241f0e7b8736745da18af62458e2c2e32 diff --git a/source/contacteditor/frmContactEditorIM.cpp b/source/contacteditor/frmContactEditorIM.cpp index 9d22d94..87b8cb8 100644 --- a/source/contacteditor/frmContactEditorIM.cpp +++ b/source/contacteditor/frmContactEditorIM.cpp @@ -26,8 +26,12 @@ frmContactEditorIM::frmContactEditorIM( wxWindow* parent ) : frmContactEditorIMADT( parent ) { + + // Setup the window. + EditorMode = FALSE; - sliPriority->Disable(); + priorityCtrl = new XABPriorityCtrl(tabGeneral); + szrGeneral->Add(priorityCtrl, 1, wxEXPAND, 5); // Add some values to the drop down box for IM types. @@ -41,18 +45,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 +139,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 +160,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 +219,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 +242,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 +260,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 +364,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 +387,8 @@ void frmContactEditorIM::SetupPointers( std::map *IMList, int IMIndex ) { + // Setup the pointers. + IMListPtr = IMList; IMListAltIDPtr = IMListAltID; IMListPIDPtr = IMListPID;