Revision 1 (by (no author), 2006/09/28 22:53:53) Initial import
/// \file widgets.h
/// Common widgets

#ifndef WIDGETS_H_INCLUDED
#define WIDGETS_H_INCLUDED

#include <string>
#include "widget.h"

class WidgetPanel: public Widget
{
	public: // Public variables
		std::list<WidgetRef> widgets;
		/// Color the widget manager this color when drawing (-1 = none)
		int background;
		
	public: // Public functions
		WidgetPanel(Widget* parent = NULL);
		
		void FocusChild(Widget* child);
		
		template <class Type, void (Widget::*Method)(Type*)> void PropagateEvent(Type* e);
		
		void Redraw(RedrawEventArgs* e);
		void KeyUp(KeyEventArgs* e);
		void KeyDown(KeyEventArgs* e);
		void MouseMove(MouseEventArgs* e);
		void MousePress(MouseEventArgs* e);
		void MouseRelease(MouseEventArgs* e);
		void MouseScroll(MouseEventArgs* e);
};

class Button: public Widget
{
	public: // Public variables
		std::string text;
		bool visible;
		
	public: // Public functions
		Button(Widget* parent = NULL);
		
		void Redraw(RedrawEventArgs* e);
		void MouseMove(MouseEventArgs* e);
		void MousePress(MouseEventArgs* e);
		void MouseRelease(MouseEventArgs* e);
		
		void MouseClick();
};

#endif

// The end