Categories fonts not updated for new category

New category had read only fields in PreferencesPanel
Scrollbar for PreferencesPanel
This commit is contained in:
2011-01-29 12:24:07 +01:00
parent e477e3a70c
commit 9985412790
3 changed files with 18 additions and 6 deletions

View File

@@ -230,6 +230,7 @@ wxString KissCount::AddCategory(Category& category)
category.id = id;
_user->_categories.push_back(category);
_user->_categoriesFonts.push_back(ExtractFont(wxT("")));
return id;
}

View File

@@ -52,6 +52,7 @@ PreferencesPanel::PreferencesPanel(KissCount* kiss, wxUI *parent) : KissPanel(ki
wxStaticBoxSizer * staticBoxSizer;
std::list<wxString> users;
std::list<wxString>::iterator it;
wxRect rect = wxDisplay().GetGeometry();
SetSizer(vbox);
@@ -159,7 +160,10 @@ PreferencesPanel::PreferencesPanel(KissCount* kiss, wxUI *parent) : KissPanel(ki
vbox->Add(hbox2, 0, wxALL, 10);
Fit();
SetMinSize(GetSize());
SetMinSize(wxSize(rect.width-rect.x-15, rect.height-rect.y-128-25));
SetMaxSize(wxSize(rect.width-rect.x-15, rect.height-rect.y-128-25));
SetScrollbars(10, 10, 100/10, 100/10);
}
KissPanel* PreferencesPanel::CreatePanel()
@@ -437,7 +441,7 @@ void PreferencesPanel::OnAccountModified(wxGridEvent& event)
_accountsGrid->SetCellValue(0, ACCOUNT_DEFAULT, wxT("1"));
}
_wxUI->Layout();
Fit();
inModification = false;
_wxUI->NeedReload();
return;
@@ -505,7 +509,7 @@ void PreferencesPanel::OnAccountModified(wxGridEvent& event)
AddAccount(row+1, new_account);
}
_wxUI->Layout();
Fit();
_wxUI->NeedReload();
inModification = false;
}
@@ -680,7 +684,7 @@ void PreferencesPanel::OnCategoryModified(wxGridEvent& event)
_kiss->DeleteCategory(user->_categories[row]);
}
_wxUI->Layout();
Fit();
_wxUI->NeedReload();
inModification = false;
return;
@@ -716,12 +720,17 @@ void PreferencesPanel::OnCategoryModified(wxGridEvent& event)
_kiss->AddCategory(new_cat);
AddCategory(row, new_cat);
_categoriesGrid->SetReadOnly(row, CATEGORY_BACKGROUND_COLOR, false);
_categoriesGrid->SetReadOnly(row, CATEGORY_FOREGROUND_COLOR, false);
_categoriesGrid->SetReadOnly(row, CATEGORY_FONT, false);
_categoriesGrid->SetReadOnly(row, CATEGORY_DELETE, false);
new_cat.id = wxT("0");
_categoriesGrid->AppendRows();
AddCategory(++row, new_cat);
}
_wxUI->Layout();
Fit();
_wxUI->NeedReload();
inModification = false;