/*	Sunny Day with Grass() program */

#include <gui_top.h>

using namespace std;	// October 5, 2001

void Grass(int x, int y)
/*	Draws a sprig of grass with base at x, y */
{
	SetColor(GREEN);
	SetThickness(1);
	Line(x, y, x+10, y-20);
	Line(x, y, x-10, y-20);
	Line(x-5, y, x+15, y-15);
}
//--------------------------------------------------------------------------------
class GuiClass {
	public:
	GuiClass();
	void GuiMouseClick(int x, int y); // Action if mouse click
	void GuiPaint();  // Repaint the entire window
	lvpstring Title();
	private:
	};
//--------------------------------------------------------------------------------
GuiClass::GuiClass()
{
}
//--------------------------------------------------------------------------------
lvpstring GuiClass::Title()
{
	return ("Grassy Sunny day!");
}
//--------------------------------------------------------------------------------
void GuiClass::GuiMouseClick(int x, int y)
{
}
//--------------------------------------------------------------------------------
void GuiClass::GuiPaint()
{
	// House
	SetColor(BLACK);
	SetThickness(2);
	Rectangle(100, 100, 200, 200);
	Line(100, 100, 150, 50);
	Line(150, 50, 200, 100);
	SetFillColor(RED);    // Paint house red
	FloodFill(150,110);
	SetFillColor(GRAY);    // Paint roof gray
	FloodFill(150,90);
 	
  	//  Lawn
	for (int x = 30; x <= 300; x += 12)
		Grass(x, 215);

	// Windows and door
	SetColor(BLACK);
	SetThickness(1);
	SetFillColor(GRAY);
	FilledRectangle(120, 120, 140, 140);
	FilledRectangle(160, 120, 180, 140);
	FilledRectangle(135, 160, 165, 200);
	SetColor(WHITE);
	SetPixel(160, 180);     // Doorknob!

	// Sun
	SetFillColor(YELLOW);
	SetColor(YELLOW);
	FilledCircle(280, 50, 30);

	// Label
	gotoxy(150, 230);
	SetTextColor(RED);
	SetTextFont("Times New Roman");
	SetTextSize(26);
	DrawCenteredText("Home, Sweet, Home");
}
//--------------------------------------------------------------------------------
#include <gui_bot.h>



