2010-05-14 15:04:01 +02:00
|
|
|
#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)
|
2010-05-14 15:04:01 +02:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
ButtonPanel::ButtonPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), _kiss(kiss), _wxUI(parent)
|
|
|
|
{
|
|
|
|
wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
|
2010-05-27 21:09:02 +02:00
|
|
|
_account = new wxBitmapButton(this, ID_BUTTON_ACCOUNT, wxBitmap(_(ACCOUNT_ICON)), wxDefaultPosition, wxSize(128, 128));
|
|
|
|
_stats = new wxBitmapButton(this, ID_BUTTON_STATS, wxBitmap(_(STATS_ICON)), wxDefaultPosition, wxSize(128, 128));
|
|
|
|
_prefs = new wxBitmapButton(this, ID_BUTTON_PREFS, wxBitmap(_(PREFS_ICON)), wxDefaultPosition, wxSize(128, 128));
|
|
|
|
_changeUser = new wxBitmapButton(this, ID_BUTTON_CHANGE_USER, wxBitmap(_(CHANGE_USER_ICON)), wxDefaultPosition, wxSize(128, 128));
|
2010-05-14 15:04:01 +02:00
|
|
|
|
|
|
|
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)
|
2010-05-14 15:04:01 +02:00
|
|
|
{
|
|
|
|
_wxUI->ChangeUser();
|
|
|
|
}
|