// ---------------------------------------------------------------------------
// 
//   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 WIDGETPADDEDBOX_H
#define WIDGETPADDEDBOX_H

#include "widget.h"
#include "widgetsingleparent.h"

/// Simple padded box. Widget contained within this one will have the
/// designated padding when drawn or taking mouse events.
LUA_WRAP class WidgetPaddedBox : public WidgetSingleParent {
	public:
		
		// Stuff unique to this class.
		
		/// Set all padding amounts at once.
		LUA_WRAP void setPadding(float allPadding);
		
		/// Set top padding.
		LUA_WRAP void setPaddingTop(float padding);
		
		/// Set bottom padding.
		LUA_WRAP void setPaddingBottom(float padding);
		
		/// Set left padding.
		LUA_WRAP void setPaddingLeft(float padding);
		
		/// Set right padding.
		LUA_WRAP void setPaddingRight(float padding);
		
		/// Get top padding.
		LUA_WRAP float getPaddingTop(void);
		
		/// Get bottom padding.
		LUA_WRAP float getPaddingBottom(void);
		
		/// Get left padding.
		LUA_WRAP float getPaddingLeft(void);
		
		/// Get right padding.
		LUA_WRAP float getPaddingRight(void);
		
		// Constructor/destructor
		WidgetPaddedBox(void);
		WidgetPaddedBox(TiXmlElement *xml);
		virtual ~WidgetPaddedBox(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:
	
		/// Top padding.
		float topPadding;
		
		/// Bottom padding.
		float bottomPadding;
		
		/// Left padding.
		float leftPadding;
		
		/// Right padding.
		float rightPadding;
};

void widgetPaddedBoxInitLua(lua_State *L);

#endif
