KissCount/view/ButtonPanel.cpp

40 lines
1.0 KiB
C++
Raw Normal View History

#include "ButtonPanel.h"
enum {ID_BUTTON_ACCOUNT=1, ID_BUTTON_STATS, ID_BUTTON_PREFS, ID_BUTTON_CHANGE_USER};
BEGIN_EVENT_TABLE(ButtonPanel, wxPanel)
EVT_BUTTON(ID_BUTTON_CHANGE_USER, ButtonPanel::OnChangeUser)
END_EVENT_TABLE()
ButtonPanel::ButtonPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), _kiss(kiss), _wxUI(parent)
{
wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
_account = new wxBitmapButton(this, ID_BUTTON_ACCOUNT, wxBitmap(_(ACCOUNT_ICON)));
_stats = new wxBitmapButton(this, ID_BUTTON_STATS, wxBitmap(_(STATS_ICON)));
_prefs = new wxBitmapButton(this, ID_BUTTON_PREFS, wxBitmap(_(PREFS_ICON)));
_changeUser = new wxBitmapButton(this, ID_BUTTON_CHANGE_USER, wxBitmap(_(CHANGE_USER_ICON)));
SetSizer(hbox);
hbox->Add(_account);
hbox->Add(_stats);
hbox->Add(_prefs);
hbox->Add(_changeUser);
Fit();
SetMinSize(GetSize());
}
ButtonPanel::~ButtonPanel()
{
delete _account;
delete _stats;
delete _prefs;
delete _changeUser;
}
void ButtonPanel::OnChangeUser(wxCommandEvent& event)
{
_wxUI->ChangeUser();
}