forked from 0ad/0ad
Ykkrosh
cf37e9cbe6
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.
26 lines
489 B
C++
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();
|
|
};
|