// ===========================================================================
// Read Me
// ===========================================================================
/*
	These two classes are for help in debugging.  They will mirror whatever is in the
	LGWorld they are connected to.  There are three classes in the files:
		CGWorldView - Base class only
		CGWorldViewTimed - Draws the GWorld in the Idle cycle, every mDrawInterval ticks
		CGWorldViewListener - Draws the GWorld in response to a broadcasted message

Restrictions:
	This is freeware. I retain copyright and must be notified if the source is sold for profit.
If you use it in your code, credit would be appreciated.

Description (for MW Archive):
	This is two classes and a base class that mirror the contents of an LGWorld, probably for debugging purposes.  One version, requiring the least added code, redraws itself every n ticks in the idle cycle.  The other version, which lacks a flicker, redraws in response to a broadcasted message.
	A CTYP is provided for Constructor, as is a file with a couple of windows that make implementation easy - only 5 lines of code or so.

Disclaimer:
	I make no claims as to whether this works or is safe or nothin'!  (Bug reports are appreciated
at dhirsch@mail.utexas.edu).

Files:
	CGWorldView.cp - The classes
	CGWorldView.h - The headers
	CGWorldView.CTYP - Custom classes for Constructor
	CGWorldView.ppob - Two pre-made windows that make implementation really easy (see below)
		Note: I gave these windows odd Res ID numbers, but to be safe, when you use these,
		be sure your own ppob file doesn't have LWindow resources that use numbers 20023
		or 20024.

Easy implementation for CGWorldViewTimed, called from some window that "owns" the
mFoobarLGWorld:
	LWindow *debugGWWind = (LWindow *) LWindow::CreateWindow( kGWorldWindowTimed, this);
	debugGWWind->SetDescriptor("\pFoobar LGWorld Monitor Window");
	CGWorldViewTimed *theCGWView = (CGWorldViewTimed *) debugGWWind->FindPaneByID(kGWPaneID);
	theCGWView->SetMyGWorld(mFoobarLGWorld);
	theCGWView->SetDrawInterval(3); // Optional: sets to redraw every 3 seconds, if idle
									// time is available; current setting (via Constructor) is 1 second
	debugGWWind->Show();

Easy implementation for CGWorldViewListener, called from some window that "owns"
the mFoobarLGWorld and which is also an LBroadcaster:
	LWindow *debugGWWind = (LWindow *) LWindow::CreateWindow( kGWorldWindowListener, this);
	debugGWWind->SetDescriptor("\pFoobar LGWorld Monitor Window");
	CGWorldViewTimed *theCGWView = (CGWorldViewTimed *) debugGWWind->FindPaneByID(kGWPaneID);
	theCGWView->SetMyGWorld(mFoobarLGWorld);
	AddListener(theCGWView);
	debugGWWind->Show();

Version History:
1.0 - 2/16/98 - Initial Release
*/

- Dave Hirsch, dhirsch@mail.utexas.edu
