diff --git a/controller/KissCount.cpp b/controller/KissCount.cpp index 6f783c2..1b11d3a 100644 --- a/controller/KissCount.cpp +++ b/controller/KissCount.cpp @@ -127,7 +127,10 @@ void KissCount::DeleteAccount(struct Account ac) _db->DeleteAccount(ac); for (i=0, it=_user->_accounts.begin(); it !=_user->_accounts.end(); it++, i++) if (it->id == ac.id) - _user->_accounts.erase(_user->_accounts.begin()+i); + { + _user->_accounts.erase(_user->_accounts.begin()+i); + break; + } } wxString KissCount::AddCategory(struct category category) diff --git a/view/AccountPanel.cpp b/view/AccountPanel.cpp index 1e2fd70..357a1bc 100644 --- a/view/AccountPanel.cpp +++ b/view/AccountPanel.cpp @@ -19,7 +19,7 @@ EVT_TREE_KEY_DOWN(CALENDAR_TREE_ID, AccountPanel::OnTreeChange) EVT_CALENDAR_SEL_CHANGED(CALENDAR_ID, AccountPanel::OnCalendarChange) END_EVENT_TABLE() -AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), _curMonth(-1), _curYear(-1), _kiss(kiss), _wxUI(parent), _tree(this, CALENDAR_TREE_ID, wxDefaultPosition, wxDefaultSize, wxTR_HIDE_ROOT) +AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : wxScrolledWindow(&(*parent)), _curMonth(-1), _curYear(-1), _kiss(kiss), _wxUI(parent), _tree(this, CALENDAR_TREE_ID, wxDefaultPosition, wxDefaultSize, wxTR_HIDE_ROOT) { wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *hbox2 = new wxBoxSizer(wxHORIZONTAL); @@ -44,8 +44,9 @@ AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), wxColour(0xC5, 0x00, 0x0D), wxColour(0x00, 0x84, 0xD1)}; wxBitmap bitmap(_(DELETE_ICON)); - SetSizer(hbox); + SetSizer(hbox); + ColorScheme* colorScheme = new ColorScheme(categoryColors, WXSIZEOF(categoryColors)); _pie = new PiePlot(); @@ -143,9 +144,11 @@ AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), hbox->Add(vbox, 0); ChangeUser(); - + Fit(); - SetMinSize(GetSize()); + + SetMinSize(wxSize(1024, 640)); + SetScrollbars(10, 10, 100/10, 100/10); } AccountPanel::~AccountPanel() @@ -367,8 +370,8 @@ void AccountPanel::ShowMonth(int month, int year) _calendar->EnableYearChange(false); _calendar->SetSize(_calendar->GetMinSize()); - Fit(); - SetMinSize(GetSize()); + // Fit(); + // SetMinSize(GetSize()); } void AccountPanel::InsertOperation(User* user, operation* op, int line, bool fix) @@ -797,7 +800,6 @@ void AccountPanel::OnOperationModified(wxGridEvent& event) } UpdateStats(); - inModification = false ; } diff --git a/view/AccountPanel.h b/view/AccountPanel.h index 53752b3..cc83a74 100644 --- a/view/AccountPanel.h +++ b/view/AccountPanel.h @@ -6,6 +6,7 @@ #include #include #include +#include #include "CalendarEditor.h" #include "wxGridCellBitmapRenderer.h" @@ -28,7 +29,7 @@ class wxUI; class KissCount; -class AccountPanel: public wxPanel +class AccountPanel: public wxScrolledWindow { public: AccountPanel(KissCount* kiss, wxUI *parent);