ConsoleGump.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2003  The Pentagram Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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         // ConsoleGump doesn't have any 'effective' area
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 /*gain*/);
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 

Generated on Fri Jul 27 22:27:12 2007 for pentagram by  doxygen 1.4.7