Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

GLog.h

00001 /*
00002 **  FILE:           GLog.h
00003 **  AUTHOR:         Matthew Allen
00004 **  DATE:           28/6/99
00005 **  DESCRIPTION:    Reality logging system
00006 **
00007 **  Copyright (C) 1999, Matthew Allen
00008 **      fret@memecode.com
00009 */
00010 
00011 #ifndef __RLOG_H
00012 #define __RLOG_H
00013 
00014 class RLogEntry;
00015 class RLogView;
00016 class GLog;
00017 
00018 class RLogEntry
00019 {
00020 friend class RLogView;
00021 friend class GLog;
00022 
00023     char *Desc;
00024     char *Text;
00025     COLOUR c;
00026 
00027 public:
00028     RLogEntry(char *t, char *desc = 0, int Len = -1, COLOUR c = 0);
00029     ~RLogEntry();
00030 };
00031 
00032 class RLogView : public GLayout
00033 {
00034 friend class RLogEntry;
00035 friend class GLog;
00036 
00037 protected:
00038     GLog *Log;
00039     bool HasBorder;
00040     bool IsTopDown;
00041     int SplitPos;
00042 
00043     void UpdateScrollBar();
00044     int GetScreenItems();
00045     int GetTotalItems();
00046 
00047 public:
00048     RLogView(GLog *log);
00049 
00050     void OnPaint(GSurface *pDC);
00051     void OnNcPaint(GSurface *pDC);
00052     void OnNcCalcClient(long &x1, long &y1, long & x2, long &y2);
00053     int OnEvent(GMessage *Msg);
00054     void OnPosChange();
00055     int OnNotify(GView *Ctrl, int Flags);
00056 
00057     bool Border() { return HasBorder; }
00058     void Border(bool i) { HasBorder = i; }
00059     bool TopDown() { return IsTopDown; }
00060     void TopDown(bool i) { IsTopDown = i; }
00061     int Split() { return SplitPos; }
00062     void Split(int i) { SplitPos = i; }
00063 };
00064 
00065 class GLog
00066 {
00067 friend class RLogEntry;
00068 friend class RLogView;
00069 
00070     char *FileName;
00071     RLogView *LogView;
00072     List<RLogEntry> Entries;
00073 
00074 public:
00075     GLog(char *File = 0);
00076     ~GLog();
00077 
00078     void SetView(RLogView *View);
00079     void Print(COLOUR c, char *Str, ...);
00080     void Write(COLOUR c, char *Str, int Len = -1, char *Desc = 0);
00081 };
00082 
00083 #endif

Generated on Wed Oct 26 14:46:49 2005 for Lgi by  doxygen 1.4.1