0ad/source/tools/atlas/AtlasUI/CustomControls/Buttons/ActionButton.h
Ykkrosh cf37e9cbe6 Atlas: Added a button. Reorganised game<->UI communication system.
main.cpp: Allowed correct operation when not calling Init/Shutdown.
Game.cpp: Stopped complaint when starting game with no GUI.

This was SVN commit r2446.
2005-06-27 23:04:34 +00:00

26 lines
489 B
C++

class ActionButton : public wxButton
{
typedef void (*actionFun)();
public:
ActionButton(wxWindow *parent,
const wxString& label,
actionFun fun,
const wxSize& size = wxDefaultSize,
long style = 0)
: wxButton(parent, wxID_ANY, label, wxDefaultPosition, size, style),
m_Fun(fun)
{
}
protected:
virtual void OnClick(wxCommandEvent&)
{
m_Fun();
}
private:
actionFun m_Fun;
DECLARE_EVENT_TABLE();
};