Add scrollbar (bug when add month ...)

Fix bug on account deletion
This commit is contained in:
Grégory Soutadé 2010-07-01 20:28:43 +02:00
parent 224e1e6d99
commit 1d1164ef02
3 changed files with 15 additions and 9 deletions

View File

@ -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)

View File

@ -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 ;
}

View File

@ -6,6 +6,7 @@
#include <wx/treectrl.h>
#include <wx/pie/pieplot.h>
#include <wx/chartpanel.h>
#include <wx/scrolwin.h>
#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);