00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(AFX_ConsoleLINES_H__2DA65C94_3E52_43C6_B75B_D0CEDBF6A9DE__INCLUDED_)
00022 #define AFX_ConsoleLINES_H__2DA65C94_3E52_43C6_B75B_D0CEDBF6A9DE__INCLUDED_
00023
00024 #include <GLEXT/GLFont2d.h>
00025 #include <deque>
00026 #include <string>
00027
00028 class ConsoleLine
00029 {
00030 public:
00031 enum LineType
00032 {
00033 eNone,
00034 eCommand,
00035 eCommandCont
00036 };
00037
00038 ConsoleLine();
00039 virtual ~ConsoleLine();
00040
00041 void set(const LangString &line, LineType type);
00042 void drawLine(float x, float y, GLFont2d *font);
00043
00044 LineType getLineType() { return lineType_; }
00045 const LangString &getLine() { return line_; }
00046
00047 protected:
00048 unsigned int lineNumber_;
00049 LangString line_;
00050 LangString lineNumberStr_;
00051 static unsigned nextLineNumber_;
00052 LineType lineType_;
00053
00054 };
00055
00056 class ConsoleLines
00057 {
00058 public:
00059 ConsoleLines(int maxLines);
00060 virtual ~ConsoleLines();
00061
00062 void addLine(const std::string &line, bool showPointer);
00063 void drawLines(GLFont2d *font, float startHeight, float totalHeight, float totalWidth);
00064
00065 void clear();
00066
00067 void resetScroll() { currentLine_ = 0; }
00068 void scroll(int lines);
00069
00070 std::deque<ConsoleLine *> &getLines() { return lines_; }
00071
00072 protected:
00073 std::deque<ConsoleLine *> lines_;
00074 int maxLines_;
00075 int currentLine_;
00076
00077 void addSmallLine(int section, const LangString &line, bool showPointer);
00078
00079 };
00080
00081 #endif // !defined(AFX_ConsoleLINES_H__2DA65C94_3E52_43C6_B75B_D0CEDBF6A9DE__INCLUDED_)