nbkTitles = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
tabGeneral = new wxPanel( nbkTitles, 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( 2, 2, 0, 0 );
+ szrGeneral->AddGrowableCol( 1 );
+ szrGeneral->SetFlexibleDirection( wxBOTH );
+ szrGeneral->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
lblTitle = new wxStaticText( tabGeneral, wxID_ANY, wxT("Title:"), wxDefaultPosition, wxDefaultSize, 0 );
lblTitle->Wrap( -1 );
- fgSizer6->Add( lblTitle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+ szrGeneral->Add( lblTitle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
txtTitle = new wxTextCtrl( tabGeneral, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- fgSizer6->Add( txtTitle, 0, wxALL|wxEXPAND, 5 );
+ szrGeneral->Add( txtTitle, 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 );
nbkTitles->AddPage( tabGeneral, wxT("General"), false );
bSizer251->Add( nbkTitles, 1, wxEXPAND | wxALL, 5 );
this->Centre( wxBOTH );
// Connect Events
- chkUsePref->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( frmContactEditorTitlesADT::EnablePriority ), NULL, this );
btnAction->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorTitlesADT::ProcessAction ), NULL, this );
btnClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorTitlesADT::CloseWindow ), NULL, this );
}
frmContactEditorTitlesADT::~frmContactEditorTitlesADT()
{
// Disconnect Events
- chkUsePref->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( frmContactEditorTitlesADT::EnablePriority ), NULL, this );
btnAction->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorTitlesADT::ProcessAction ), NULL, this );
btnClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorTitlesADT::CloseWindow ), NULL, this );
// Setup the window.
EditorMode = FALSE;
- sliPriority->Disable();
-}
-
-void frmContactEditorTitles::EnablePriority( wxCommandEvent& event )
-{
-
- // Enable/disable the priority setting.
-
- if (chkUsePref->IsChecked()){
- sliPriority->Enable();
- } else {
- sliPriority->Disable();
- }
-
+ priorityCtrl = new XABPriorityCtrl(tabGeneral);
+ szrGeneral->Add(priorityCtrl, 1, wxEXPAND, 5);
}
void frmContactEditorTitles::ProcessAction( wxCommandEvent& event )
// Add the website priority.
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- TitlesListPrefPtr->insert(std::make_pair(TitlesListIndex, sliPriority->GetValue()));
+ TitlesListPrefPtr->insert(std::make_pair(TitlesListIndex, priorityCtrl->GetValue()));
} else {
coldata.SetText(txtTitle->GetValue());
ListCtrlIndex = TitlesListCtrlPtr->InsertItem(coldata);
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- TitlesListCtrlPtr->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), sliPriority->GetValue()));
+ TitlesListCtrlPtr->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));
}
TitlesListPrefPtr->erase(TitlesListIndex);
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- TitlesListPrefPtr->insert(std::make_pair(TitlesListIndex, sliPriority->GetValue()));
+ TitlesListPrefPtr->insert(std::make_pair(TitlesListIndex, priorityCtrl->GetValue()));
} else {
TitlesListCtrlPtr->SetItem(longSelected, 0, txtTitle->GetValue());
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- TitlesListCtrlPtr->SetItem(longSelected, 1, wxString::Format(wxT("%i"), sliPriority->GetValue()));
+ TitlesListCtrlPtr->SetItem(longSelected, 1, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));
} else {
if (intiter->first == TitlesListIndex && intiter->second > 0 &&
intiter != TitlesListPrefPtr->end()){
- sliPriority->SetValue(intiter->second);
- sliPriority->Enable();
- chkUsePref->SetValue(TRUE);
+ priorityCtrl->SetValue(intiter->second);
+ priorityCtrl->EnablePriority(true);
}