KissCount/view/ButtonPanel.cpp

52 lines
1.5 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)
2010-05-17 18:03:21 +02:00
EVT_BUTTON(ID_BUTTON_ACCOUNT, ButtonPanel::OnButtonAccount)
EVT_BUTTON(ID_BUTTON_PREFS, ButtonPanel::OnButtonPreferences)
EVT_BUTTON(ID_BUTTON_CHANGE_USER, ButtonPanel::OnButtonChangeUser)
END_EVENT_TABLE()
ButtonPanel::ButtonPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), _kiss(kiss), _wxUI(parent)
{
wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
2010-07-03 11:19:02 +02:00
_account = new wxBitmapButton(this, ID_BUTTON_ACCOUNT, wxBitmap(wxT(ACCOUNT_ICON)), wxDefaultPosition, wxSize(128, 128));
_stats = new wxBitmapButton(this, ID_BUTTON_STATS, wxBitmap(wxT(STATS_ICON)), wxDefaultPosition, wxSize(128, 128));
_prefs = new wxBitmapButton(this, ID_BUTTON_PREFS, wxBitmap(wxT(PREFS_ICON)), wxDefaultPosition, wxSize(128, 128));
_changeUser = new wxBitmapButton(this, ID_BUTTON_CHANGE_USER, wxBitmap(wxT(CHANGE_USER_ICON)), wxDefaultPosition, wxSize(128, 128));
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;
}
2010-05-17 18:03:21 +02:00
void ButtonPanel::OnButtonAccount(wxCommandEvent& event)
{
_wxUI->ShowAccount();
}
void ButtonPanel::OnButtonPreferences(wxCommandEvent& event)
{
_wxUI->ShowPreferences();
}
void ButtonPanel::OnButtonChangeUser(wxCommandEvent& event)
{
_wxUI->ChangeUser();
}