tabGeneral->SetSizer( bSizer353 );
tabGeneral->Layout();
bSizer353->Fit( tabGeneral );
- nbkNotes->AddPage( tabGeneral, wxT("General"), true );
+ nbkNotes->AddPage( tabGeneral, wxT("General"), false );
tabPriority = new wxPanel( nbkNotes, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
- wxFlexGridSizer* fgSizer61;
- fgSizer61 = new wxFlexGridSizer( 0, 2, 0, 0 );
- fgSizer61->AddGrowableCol( 1 );
- fgSizer61->SetFlexibleDirection( wxVERTICAL );
- fgSizer61->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
-
- lblPriority = new wxStaticText( tabPriority, wxID_ANY, wxT("Priority:"), wxDefaultPosition, wxDefaultSize, 0 );
- lblPriority->Wrap( -1 );
- fgSizer61->Add( lblPriority, 0, wxALL, 5 );
-
- wxBoxSizer* bSizer2601;
- bSizer2601 = new wxBoxSizer( wxHORIZONTAL );
-
- chkUsePref = new wxCheckBox( tabPriority, wxID_ANY, wxT("Use"), wxDefaultPosition, wxDefaultSize, 0 );
- bSizer2601->Add( chkUsePref, 0, wxALL, 5 );
-
- wxBoxSizer* bSizer2541;
- bSizer2541 = new wxBoxSizer( wxVERTICAL );
-
- wxBoxSizer* bSizer2561;
- bSizer2561 = new wxBoxSizer( wxHORIZONTAL );
-
- sliPriority = new wxSlider( tabPriority, wxID_ANY, 0, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
- bSizer2561->Add( sliPriority, 1, wxALL|wxEXPAND, 5 );
-
-
- bSizer2541->Add( bSizer2561, 1, wxEXPAND, 5 );
-
- wxBoxSizer* bSizer2551;
- bSizer2551 = new wxBoxSizer( wxHORIZONTAL );
-
- lblHigh = new wxStaticText( tabPriority, wxID_ANY, wxT("High"), wxDefaultPosition, wxDefaultSize, 0 );
- lblHigh->Wrap( -1 );
- bSizer2551->Add( lblHigh, 0, wxALIGN_LEFT|wxALL, 5 );
-
-
- bSizer2551->Add( 0, 0, 1, wxEXPAND, 5 );
-
- lblLow = new wxStaticText( tabPriority, wxID_ANY, wxT("Low"), wxDefaultPosition, wxDefaultSize, 0 );
- lblLow->Wrap( -1 );
- bSizer2551->Add( lblLow, 0, wxALIGN_RIGHT|wxALL, 5 );
-
-
- bSizer2541->Add( bSizer2551, 1, wxEXPAND, 0 );
-
-
- bSizer2601->Add( bSizer2541, 1, wxEXPAND, 5 );
-
-
- fgSizer61->Add( bSizer2601, 1, wxEXPAND, 5 );
-
-
- fgSizer61->Add( 0, 0, 1, wxEXPAND, 5 );
+ szrPriority = new wxFlexGridSizer( 1, 1, 0, 0 );
+ szrPriority->SetFlexibleDirection( wxBOTH );
+ szrPriority->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
- tabPriority->SetSizer( fgSizer61 );
+ tabPriority->SetSizer( szrPriority );
tabPriority->Layout();
- fgSizer61->Fit( tabPriority );
- nbkNotes->AddPage( tabPriority, wxT("Priority"), false );
+ szrPriority->Fit( tabPriority );
+ nbkNotes->AddPage( tabPriority, wxT("Priority"), true );
tabLanguage = new wxPanel( nbkNotes, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxFlexGridSizer* fgSizer611;
fgSizer611 = new wxFlexGridSizer( 0, 2, 0, 0 );
this->Centre( wxBOTH );
// Connect Events
- chkUsePref->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( frmContactEditorNotesADT::EnablePriority ), NULL, this );
btnAction->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorNotesADT::ProcessAction ), NULL, this );
btnClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorNotesADT::CloseWindow ), NULL, this );
}
frmContactEditorNotesADT::~frmContactEditorNotesADT()
{
// Disconnect Events
- chkUsePref->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( frmContactEditorNotesADT::EnablePriority ), NULL, this );
btnAction->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorNotesADT::ProcessAction ), NULL, this );
btnClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmContactEditorNotesADT::CloseWindow ), NULL, this );
// Setup the editor window.
EditorMode = FALSE;
- sliPriority->Disable();
+ priorityCtrl = new XABPriorityCtrl(tabPriority);
+ szrPriority->Add(priorityCtrl, 1, wxEXPAND, 5);
// Setup the language combo box.
}
-void frmContactEditorNotes::EnablePriority( wxCommandEvent& event )
-{
-
- // Enable/disable the priority setting.
-
- if (chkUsePref->IsChecked()){
- sliPriority->Enable();
- } else {
- sliPriority->Disable();
- }
-
-}
-
void frmContactEditorNotes::ProcessAction( wxCommandEvent& event )
{
// Add note priority.
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- NotesListPrefPtr->insert(std::make_pair(NotesListIndex, sliPriority->GetValue()));
+ NotesListPrefPtr->insert(std::make_pair(NotesListIndex, priorityCtrl->GetValue()));
} else {
coldata.SetText(txtNote->GetValue());
ListCtrlIndex = NotesListCtrlPtr->InsertItem(coldata);
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- NotesListCtrlPtr->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), sliPriority->GetValue()));
+ NotesListCtrlPtr->SetItem(ListCtrlIndex, 1, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));
}
NotesListPrefPtr->erase(NotesListIndex);
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- NotesListPrefPtr->insert(std::make_pair(NotesListIndex, sliPriority->GetValue()));
+ NotesListPrefPtr->insert(std::make_pair(NotesListIndex, priorityCtrl->GetValue()));
} else {
NotesListCtrlPtr->SetItem(longSelected, 0, txtNote->GetValue());
- if (chkUsePref->IsChecked()){
+ if (priorityCtrl->IsPriorityChecked()){
- NotesListCtrlPtr->SetItem(longSelected, 1, wxString::Format(wxT("%i"), sliPriority->GetValue()));
+ NotesListCtrlPtr->SetItem(longSelected, 1, wxString::Format(wxT("%i"), priorityCtrl->GetValue()));
} else {
if (intiter->first == NotesListIndex && intiter->second > 0 &&
intiter != NotesListPrefPtr->end()){
- sliPriority->SetValue(intiter->second);
- sliPriority->Enable();
- chkUsePref->SetValue(TRUE);
+ priorityCtrl->SetValue(intiter->second);
+ priorityCtrl->EnablePriority(true);
}