00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CONSOLEGUMP_H_INCLUDED
00020 #define CONSOLEGUMP_H_INCLUDED
00021
00022 #include "Gump.h"
00023
00024 class ConsoleGump : public Gump
00025 {
00026 enum ConsoleScrollState {
00027 NORMAL_DISPLAY,
00028 WAITING_TO_HIDE,
00029 SCROLLING_TO_HIDE_1,
00030 SCROLLING_TO_HIDE_2,
00031 SCROLLING_TO_HIDE_3,
00032 SCROLLING_TO_HIDE_4,
00033 NOTIFY_OVERLAY,
00034 WAITING_TO_SHOW,
00035 SCROLLING_TO_SHOW_1,
00036 SCROLLING_TO_SHOW_2,
00037 SCROLLING_TO_SHOW_3,
00038 SCROLLING_TO_SHOW_4
00039 };
00040
00041 ConsoleScrollState scroll_state;
00042
00043 public:
00044 typedef void (*ConsoleFunction)(const Pentagram::istring &args);
00045
00046 ENABLE_RUNTIME_CLASSTYPE();
00047
00048 ConsoleGump();
00049 ConsoleGump(int x, int y, int w, int h);
00050 virtual ~ConsoleGump();
00051
00052 void ToggleConsole();
00053 void ShowConsole();
00054 void HideConsole();
00055 bool ConsoleIsVisible();
00056
00057
00058 virtual bool PointOnGump(int mx, int my) { return false; }
00059
00060 virtual bool Run(const uint32 framenum);
00061
00062 virtual void PaintThis(RenderSurface *surf, sint32 lerp_factor, bool scaled);
00063
00064 virtual void RenderSurfaceChanged();
00065
00066 virtual bool OnTextInput(int unicode);
00067 virtual void OnFocus(bool );
00068 virtual bool OnKeyDown(int key, int mod);
00069
00070 static void ConCmd_toggle(const Console::ArgvType &argv);
00071
00072 bool loadData(IDataSource* ids, uint32 version);
00073
00074 protected:
00075 virtual void saveData(ODataSource* ods);
00076
00077 private:
00078 };
00079
00080 #endif //CONSOLEGUMP_H_INCLUDED
00081