0ad/source/tools/atlas/AtlasUI/CustomControls/Buttons/ActionButton.h
Ykkrosh 52a8793450 Atlas: Bits of tool-related code.
Game: Large screenshots (with ctrl+alt+F2).

This was SVN commit r2994.
2005-10-24 01:53:03 +00:00

28 lines
561 B
C++

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