// ---------------------------------------------------------------------------
// 
//   Lily Engine alpha
// 
//   Copyright (c) 2010 Clifford Jolly
//     http://cliffjolly.com
//     cliff@cliffjolly.com
// 
// ---------------------------------------------------------------------------
// 
//   This program is free software; you can redistribute it and/or modify
//   it under the terms of the GNU General Public License as published by
//   the Free Software Foundation; either version 2 of the License, or
//   (at your option) any later version.
//  
//   This program is distributed in the hope that it will be useful, but
//   WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//   General Public License for more details.
// 
//   You should have received a copy of the GNU General Public License
//   along with this program; if not, write to the Free Software
//   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
//   USA
// -------------------------- END HEADER -------------------------------------

#ifndef WIDGETRADIOGROUP_H
#define WIDGETRADIOGROUP_H

#include "widgetsingleparent.h"

/// Radio group. WidgetButtons set as radio buttons that are children
/// to this (or children of children, etc) will be grouped together so
/// that only one will be on at a time. This restriction only works for
/// user input, so setting the values manually will not trigger
/// whatever is active to turn off.
LUA_WRAP class WidgetRadioGroup : public WidgetSingleParent {
	public:
	
		// Unique stuff
		
		/// Set the currently active WidgetButton (and set inactive
		/// whatever is currently active).
		LUA_WRAP void setSelectedOption(Widget *w);
		
		/// Get the currently selected WidgetButton.
		LUA_WRAP Widget *getSelectedOption(void);
		
		// Constructor/destructor
		WidgetRadioGroup(void);
		virtual ~WidgetRadioGroup(void);
	
		// Inherited stuff
		void draw(void);
		float getMinHeight(void);
		float getMinWidth(void);
		void setWidth(float newWidth);
		void setHeight(float newHeight);
		bool handleEvent(const WidgetEvent *event);
	
	private:
	
		std::string selectedObjectUID;
		
		std::vector<std::string> radioButtonUIDs;
	
};

#endif
