00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KEOS_CONSOLELOOKDEFAULT_H
00022 #define KEOS_CONSOLELOOKDEFAULT_H
00023
00024 #include "KeosPrerequisites.h"
00025 #include "KeosMesh.h"
00026 #include "KeosConsoleLook.h"
00027 #include "KeosMatrix4.h"
00028 #include "KeosColor.h"
00029
00030 namespace Keos
00031 {
00032
00033 namespace Console
00034 {
00035
00036
00040 class KEOS_EXPORT CLookDefault : public ILook
00041 {
00042 public :
00043
00052 CLookDefault( const String& strFont, TVector2F Size, const String& strTexture,
00053 const CColor& TextColor = CColor::White, const CColor& TextOkColor = CColor(150, 200, 150),
00054 const CColor& TextErrorColor = CColor(200, 150, 150) );
00055
00059 virtual void Update();
00060
00064 virtual void Draw() const;
00065
00070 virtual void Show(bool bVisible);
00071
00076 virtual void CommandCalled(const String& strResult);
00077
00082 virtual void TextChanged(const String& strNewText);
00083
00088 virtual void Error(const String& strMessage);
00089
00095 void SetTextColors(const CColor& TextColor, const CColor& TextOkColor, const CColor& TextErrorColor)
00096 {
00097 m_TextColor = TextColor;
00098 m_TextOkColor = TextOkColor;
00099 m_TextErrorColor = TextErrorColor;
00100 }
00101
00102 private :
00103
00105 enum TState {STOPPED_VISIBLE, STOPPED_INVISIBLE, HIDDING, SHOWING};
00106
00111 void AddLine(const String& strLine, const CColor& Color);
00112
00114 TMeshPtr m_Background;
00116 std::list<CGraphicString> m_Lines;
00118 CMatrix4 m_Transfo;
00120 TState m_State;
00122 TVector2F m_nSize;
00123
00125 String m_strFont;
00127 size_t m_nFontHeight;
00129 CColor m_TextColor;
00131 CColor m_TextErrorColor;
00133 CColor m_TextOkColor;
00134 };
00135
00139 struct Print
00140 {
00141 Print(const std::string& Text) : m_Text(Text)
00142 {}
00143
00144 const std::string& operator ()() const
00145 {
00146 return m_Text;
00147 }
00148
00149 private :
00150
00151 std::string m_Text;
00152 };
00153
00154 }
00155
00156 }
00157
00158 #endif // KEOS_CONSOLELOOKDEFAULT_H