52 lines
1.5 KiB
C++
52 lines
1.5 KiB
C++
#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_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);
|
|
_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));
|
|
|
|
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::OnButtonAccount(wxCommandEvent& event)
|
|
{
|
|
_wxUI->ShowAccount();
|
|
}
|
|
|
|
void ButtonPanel::OnButtonPreferences(wxCommandEvent& event)
|
|
{
|
|
_wxUI->ShowPreferences();
|
|
}
|
|
|
|
void ButtonPanel::OnButtonChangeUser(wxCommandEvent& event)
|
|
{
|
|
_wxUI->ChangeUser();
|
|
}
|