#ifndef __BUTTON_H
#define __BUTTON_H

#ifdef __cplusplus
extern "C" {
#endif

#include <wiisprite.h>
#include "widget.h"
#include "label.h"
#include "image.h"

class Button : public Widget
{
	public:
		Button();
		~Button();
		
		void setCaption(const char *caption);
		void downCallback(void (*callback)(void *), void *data);
		
		void setColor(Color c);
		void setFont(const char *font);
		void setSize(int size);
		
		virtual void draw();
		
		virtual void cursorDown(int x, int y, Action a);
		virtual void cursorMove(int x, int y);
		virtual void cursorUp(int x, int y, Action a);
		virtual void cursorOut();
	private:
		void reskin();
		
		int _state;
		int _offset;
		int _depressHint;
		
		Label *_label;
		
		static LoadableImage *_image;
		static int _instance;
		int _whichinstance;
		
		Theme windowManager;
		
		int _divisions;
		
		void (*_callbackdown)(void *);
		void *_datadown;
};

#ifdef __cplusplus
}
#endif

#endif
