nbkAddress = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
tabGeneral = new wxPanel( nbkAddress, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
- wxFlexGridSizer* fgSizer6;
- fgSizer6 = new wxFlexGridSizer( 0, 2, 0, 0 );
- fgSizer6->AddGrowableCol( 1 );
- fgSizer6->SetFlexibleDirection( wxVERTICAL );
- fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+ szrGeneral = new wxFlexGridSizer( 6, 2, 0, 0 );
+ szrGeneral->AddGrowableCol( 1 );
+ szrGeneral->SetFlexibleDirection( wxBOTH );
+ szrGeneral->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
lblAddress = new wxStaticText( tabGeneral, wxID_ANY, wxT("Address:"), wxDefaultPosition, wxDefaultSize, 0 );
lblAddress->Wrap( -1 );
- fgSizer6->Add( lblAddress, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+ szrGeneral->Add( lblAddress, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
txtAddress = new wxTextCtrl( tabGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer6->Add( txtAddress, 0, wxALL|wxEXPAND, 5 );
+ szrGeneral->Add( txtAddress, 0, wxALL|wxEXPAND, 5 );
m_staticText61 = new wxStaticText( tabGeneral, wxID_ANY, wxT("Town/City:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText61->Wrap( -1 );
- fgSizer6->Add( m_staticText61, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+ szrGeneral->Add( m_staticText61, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
txtTownCity = new wxTextCtrl( tabGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer6->Add( txtTownCity, 0, wxALL|wxEXPAND, 5 );
+ szrGeneral->Add( txtTownCity, 0, wxALL|wxEXPAND, 5 );
lblCountyState = new wxStaticText( tabGeneral, wxID_ANY, wxT("County:"), wxDefaultPosition, wxDefaultSize, 0 );
lblCountyState->Wrap( -1 );
- fgSizer6->Add( lblCountyState, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+ szrGeneral->Add( lblCountyState, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
txtCounty = new wxTextCtrl( tabGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer6->Add( txtCounty, 0, wxALL|wxEXPAND, 5 );
+ szrGeneral->Add( txtCounty, 0, wxALL|wxEXPAND, 5 );
lblPostCode = new wxStaticText( tabGeneral, wxID_ANY, wxT("Post Code:"), wxDefaultPosition, wxDefaultSize, 0 );
lblPostCode->Wrap( -1 );
- fgSizer6->Add( lblPostCode, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+ szrGeneral->Add( lblPostCode, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
txtPostCode = new wxTextCtrl( tabGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer6->Add( txtPostCode, 0, wxALL, 5 );
+ szrGeneral->Add( txtPostCode, 0, wxALL, 5 );
lblCountry = new wxStaticText( tabGeneral, wxID_ANY, wxT("Country:"), wxDefaultPosition, wxDefaultSize, 0 );
lblCountry->Wrap( -1 );
- fgSizer6->Add( lblCountry, 0, wxALL, 5 );
+ szrGeneral->Add( lblCountry, 0, wxALL, 5 );
txtCountry = new wxTextCtrl( tabGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer6->Add( txtCountry, 0, wxALL|wxEXPAND, 5 );
+ szrGeneral->Add( txtCountry, 0, wxALL|wxEXPAND, 5 );
lblPriority = new wxStaticText( tabGeneral, wxID_ANY, wxT("Priority:"), wxDefaultPosition, wxDefaultSize, 0 );
lblPriority->Wrap( -1 );
- fgSizer6->Add( lblPriority, 0, wxALL, 5 );
-
- wxBoxSizer* bSizer260;
- bSizer260 = new wxBoxSizer( wxHORIZONTAL );
-
- chkUsePref = new wxCheckBox( tabGeneral, wxID_ANY, wxT("Use"), wxDefaultPosition, wxDefaultSize, 0 );
- bSizer260->Add( chkUsePref, 0, wxALL, 5 );
-
- wxBoxSizer* bSizer254;
- bSizer254 = new wxBoxSizer( wxVERTICAL );
-
- wxBoxSizer* bSizer256;
- bSizer256 = new wxBoxSizer( wxHORIZONTAL );
-
- sliPriority = new wxSlider( tabGeneral, wxID_ANY, 0, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
- bSizer256->Add( sliPriority, 1, wxALL|wxEXPAND, 5 );
-
-
- bSizer254->Add( bSizer256, 1, wxEXPAND, 5 );
-
- wxBoxSizer* bSizer255;
- bSizer255 = new wxBoxSizer( wxHORIZONTAL );
-
- lblHigh = new wxStaticText( tabGeneral, wxID_ANY, wxT("High"), wxDefaultPosition, wxDefaultSize, 0 );
- lblHigh->Wrap( -1 );
- bSizer255->Add( lblHigh, 0, wxALIGN_LEFT|wxALL, 5 );
-
-
- bSizer255->Add( 0, 0, 1, wxEXPAND, 5 );
-
- lblLow = new wxStaticText( tabGeneral, wxID_ANY, wxT("Low"), wxDefaultPosition, wxDefaultSize, 0 );
- lblLow->Wrap( -1 );
- bSizer255->Add( lblLow, 0, wxALIGN_RIGHT|wxALL, 5 );
-
-
- bSizer254->Add( bSizer255, 1, wxEXPAND, 0 );
-
-
- bSizer260->Add( bSizer254, 1, wxEXPAND, 5 );
-
-
- fgSizer6->Add( bSizer260, 1, wxEXPAND, 5 );
-
-
- fgSizer6->Add( 0, 0, 1, wxEXPAND, 5 );
+ szrGeneral->Add( lblPriority, 0, wxALL, 5 );
- tabGeneral->SetSizer( fgSizer6 );
+ tabGeneral->SetSizer( szrGeneral );
tabGeneral->Layout();
- fgSizer6->Fit( tabGeneral );
+ szrGeneral->Fit( tabGeneral );
nbkAddress->AddPage( tabGeneral, wxT("General"), true );
tabLabel = new wxPanel( nbkAddress, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer253;
// Connect Events
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( frmContactEditorAddressADT::InitAddressEditor ) );
- chkUsePref->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( frmContactEditorAddressADT::EnablePriority ), NULL, this );
btnCopyMailing->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorAddressADT::CopyAddress ), NULL, this );
btnAction->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorAddressADT::ProcessData ), NULL, this );
btnClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorAddressADT::CloseWindow ), NULL, this );
{
// Disconnect Events
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( frmContactEditorAddressADT::InitAddressEditor ) );
- chkUsePref->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( frmContactEditorAddressADT::EnablePriority ), NULL, this );
btnCopyMailing->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorAddressADT::CopyAddress ), NULL, this );
btnAction->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorAddressADT::ProcessData ), NULL, this );
btnClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorAddressADT::CloseWindow ), NULL, this );
// Setup the window.
EditorMode = FALSE;
- sliPriority->Disable();
+ priorityCtrl = new XABPriorityCtrl(tabGeneral);
+ szrGeneral->Add(priorityCtrl, 1, wxEXPAND, 5);
+ szrGeneral->Layout();
}
// Do nothing with this subroutine at this time.
}
-void frmContactEditorAddress::EnablePriority( wxCommandEvent& event )
-{
-
- // Enable/disable the priority setting.
-
- if (chkUsePref->IsChecked()){
- sliPriority->Enable();
- } else {
- sliPriority->Disable();
- }
-
-}
-
void frmContactEditorAddress::ProcessData( wxCommandEvent& event )
{
AddressListMediatypePtr->insert(std::make_pair(AddressListIndex, wxT("text/plain")));
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- AddressListPrefPtr->insert(std::make_pair(AddressListIndex, sliPriority->GetValue()));
+ AddressListPrefPtr->insert(std::make_pair(AddressListIndex, priorityCtrl->GetValue()));
} else {
AddressListCtrlPtr->SetItem(ListCtrlIndex, 2, txtCounty->GetValue());
AddressListCtrlPtr->SetItem(ListCtrlIndex, 3, txtPostCode->GetValue());
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- AddressListCtrlPtr->SetItem(ListCtrlIndex, 4, wxString::Format(wxT("%i"), sliPriority->GetValue()));
+ AddressListCtrlPtr->SetItem(ListCtrlIndex, 4, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));
}
AddressListPrefPtr->erase(AddressListIndex);
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- AddressListPrefPtr->insert(std::make_pair(AddressListIndex, sliPriority->GetValue()));
+ AddressListPrefPtr->insert(std::make_pair(AddressListIndex, priorityCtrl->GetValue()));
} else {
AddressListCtrlPtr->SetItem(longSelected, 2, txtCounty->GetValue());
AddressListCtrlPtr->SetItem(longSelected, 3, txtPostCode->GetValue());
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- AddressListCtrlPtr->SetItem(longSelected, 4, wxString::Format(wxT("%i"), sliPriority->GetValue()));
+ AddressListCtrlPtr->SetItem(longSelected, 4, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));
} else {
if (intiter->first == AddressListIndex && intiter->second > 0 && intiter != AddressListPrefPtr->end() &&
intiter != AddressListPrefPtr->end()){
- sliPriority->SetValue(intiter->second);
- sliPriority->Enable();
- chkUsePref->SetValue(TRUE);
+ priorityCtrl->SetValue(intiter->second);
+ priorityCtrl->EnablePriority(true);
}