home *** CD-ROM | disk | FTP | other *** search
- /*
- File: LogWindow.h
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __WINDOWS__
- #include <Windows.h>
- #endif
-
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
-
- #ifndef __LIMITS__
- #include <Limits.h>
- #endif
-
- #ifdef __UNIVERSAL__
- #ifndef __LOWMEM__
- #include <LowMem.h>
- #endif
- #else
- #ifndef __SYSEQU__
- #include <SysEqu.h>
- #endif
- #endif
-
- #ifndef __EVENTS__
- #include <Events.h>
- #endif
-
- #ifndef __OSEVENTS__
- #include <OSEvents.h>
- #endif
-
- #ifndef __STDIO__
- #include <stdio.h>
- #endif
-
- /***********************************|****************************************/
-
- const short kLogWindowHMargin = 5;
- const short kLogWindowVMargin = 10;
-
- /***********************************|****************************************/
-
- class TLogWindow : public TDirectObject
- {
- public: TLogWindow ( short windowID );
- virtual ~TLogWindow ( );
-
- virtual void Show ( ) const;
- virtual void Hide ( ) const;
-
- virtual WindowPtr GetWindowPtr () const;
-
- virtual void WindowFocus(void);
- virtual void ContentFocus(void);
-
- virtual void InsertRow ( unsigned long beforeWhichRow, unsigned long count = 1 );
- virtual void DeleteRow ( unsigned long whichRow, unsigned long count = 1);
-
- virtual void Draw (void) const;
- virtual void Draw ( const Rect& rectToRedraw ) const;
-
- virtual void DrawRow ( unsigned long whichRow ) const;
- virtual void ValidateRow ( unsigned long whichRow ) const;
- virtual void InvalidateRow ( unsigned long whichRow ) const;
-
- virtual unsigned long GetRowCount () const;
- virtual unsigned long GetRowWidth ( ) const;
- virtual Rect GetRectForRow ( unsigned long whichRow ) const;
-
- static Boolean IsLogWindowEvent ( const EventRecord& event );
-
- /* Call before SizeWindow if you need to resize the debug window programmatically*/
- void InvalidateGrowBox () const ;
-
- /* Call after SizeWindow if you need to resize the debug window programmatically*/
- void Grown();
-
- void ShowPoint(Point pt);
- void Scroll(short howManyLines);
- void DoScrolling(void);
-
- protected:
- // Call the following procedures in response to events for the WriteLnWindow.
- // (Test the window receiving the event against gDebugWindowPtr.
-
- void ActivateEvent(short modifiers);
- void MouseDown(short where, Point pt, short modifiers);
- void UpdateEvent();
-
- friend pascal void LogWindowTrackControlCallback ( ControlHandle aControl, short partCode );
-
-
- protected:
-
- virtual Boolean Initialize ( );
-
- short fWindowResID ;
-
- WindowPtr fDebugWindowPtr;
-
- unsigned long fRowCount;
- short fHeight;
-
- ControlHandle fSBars[2]; // the window scroll bars
-
- Point fScrollOffset;
- Point fViewSize;
-
- Rect fStdDrag;
- Rect fStdSize;
- RgnHandle fARgn;
-
- Boolean fScrollWindowWhenTextIsAdded;
- };
-
- /***********************************|****************************************/
-
- void DrawString ( short x, short y, StringPtr s );
- void DrawNumber ( short x, short y, long n );
-
- void EraseLineTo ( short x, short y );
- void EraseLineTo ( short x, short y );
-
- void EraseLineToDrawString ( short x, short y, StringPtr s );
- void EraseLineToDrawNumber ( short x, short y, long n );
-
- /***********************************|****************************************/
-