00001
00002
00003
00004
00005
00006
00007
00008
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(const char *t, const 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(GViewI *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, const char *Str, ...);
00080 void Write(COLOUR c, const char *Str, int Len = -1, char *Desc = 0);
00081 };
00082
00083 #endif