:
frmContactEditorPictureADT( parent )
{
+
+ // Setup the window.
+
EditorMode = FALSE;
- sliPriority->Disable();
+ priorityCtrl = new XABPriorityCtrl(tabGeneral);
+ szrGeneral->Add(priorityCtrl, 1, wxEXPAND, 5);
+ szrGeneral->Layout();
cmbType->Append(wxT(""));
cmbType->Append(_("Home"));
cmbType->Append(_("Work"));
-}
-
-void frmContactEditorPicture::EnablePriority( wxCommandEvent& event )
-{
- if (chkUsePref->IsChecked()){
- sliPriority->Enable();
- } else {
- sliPriority->Disable();
- }
+
}
void frmContactEditorPicture::ProcessData( wxCommandEvent& event )
{
+
+ // Process data.
+
long ListCtrlIndex;
if (EditorMode == FALSE){
// Setup Organisation Priority.
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- PictureListPrefPtr->insert(std::make_pair(PictureListIndex, sliPriority->GetValue()));
+ PictureListPrefPtr->insert(std::make_pair(PictureListIndex, priorityCtrl->GetValue()));
} else {
}
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- PictureListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), sliPriority->GetValue()));
+ PictureListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));
}
PictureListPrefPtr->erase(PictureListIndex);
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- PictureListPrefPtr->insert(std::make_pair(PictureListIndex, sliPriority->GetValue()));
+ PictureListPrefPtr->insert(std::make_pair(PictureListIndex, priorityCtrl->GetValue()));
} else {
return;
}
- if (PictureLogo == TRUE){
-
+ if (PictureLogo == TRUE){
PictureListCtrlPtr->SetItem(longSelected, 0, _("Picture"));
} else {
PictureListCtrlPtr->SetItem(longSelected, 1, strValue);
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- PictureListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), sliPriority->GetValue()));
+ PictureListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));
} else {
void frmContactEditorPicture::CloseWindow( wxCommandEvent& event )
{
+
+ // Close this window.
+
this->Close();
+
}
void frmContactEditorPicture::SetEditorMode(bool EditMode)
{
+
+ // Set the editor mode.
+
// Set if the editor is adding or editing an address.
// FALSE = Add
// TRUE = Edit
striter = PictureListTypePtr->find(PictureListIndex);
- if (striter->first == PictureListIndex){
+ if (striter->first == PictureListIndex &&
+ striter != PictureListTypePtr->end()){
strValue = striter->second;
intiter = PictureListPrefPtr->find(PictureListIndex);
- if (intiter->first == PictureListIndex && intiter->second > 0){
+ if (intiter->first == PictureListIndex && intiter->second > 0 &&
+ intiter != PictureListPrefPtr->end()){
- sliPriority->SetValue(intiter->second);
- sliPriority->Enable();
- chkUsePref->SetValue(TRUE);
+ priorityCtrl->SetValue(intiter->second);
+ priorityCtrl->EnablePriority(true);
}
bool PictureLogoIn )
{
+ // Setup the pointers.
+
PictureListPtr = PictureList;
PictureListAltIDPtr = PictureListAltID;
PictureListPIDPtr = PictureListPID;