Console.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 //
00003 //  REGCOM: Regimental Command
00004 //  Copyright (C) 2008 Randi J. Relander
00005 //    <rjrelander@users.sourceforge.net>
00006 //
00007 //  This program is free software; you can redistribute it and/or
00008 //  modify it under the terms of the GNU General Public License
00009 //  as published by the Free Software Foundation; either version 3
00010 //  of the License, or (at your option) any later version.
00011 //  
00012 //  This program is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU General Public License for more details.
00016 //  
00017 //  You should have received a copy of the GNU General Public
00018 //  License along with this program.  If not, see 
00019 //  <http://www.gnu.org/licenses/>.
00020 //  
00021 //**********************************************************************
00022 
00023 #ifndef REGCOM_CLIENT_CONSOLE_H
00024 #define REGCOM_CLIENT_CONSOLE_H
00025 
00026 // SYSTEM INCLUDES
00027 #include <string>
00028 
00029 // PROJECT INCLUDES
00030 #include "regcom/client/ButtonInfo.h"
00031 
00032 #include "regcom/gui/Surface.h"
00033 #include "regcom/gui/Window.h"
00034 #include "regcom/gui/Rect.h"
00035 #include "regcom/gui/Font.h"
00036 #include "regcom/gui/Button.h"
00037 #include "regcom/gui/StringView.h"
00038 
00039 #include "regcom/common/Map.h"
00040 
00041 // NAMESPACES
00042 namespace regcom {
00043 namespace client {
00044 
00045 // FORWARD REFERENCES
00046 class RadarView;
00047 class MapView;
00048 
00050 //  CLASS: Console
00056 class Console : public gui::Window
00057 {
00058 public:
00059 
00060     // PUBLIC METHODS
00061 
00063     Console();
00064 
00066     virtual ~Console();
00067 
00069     virtual void Draw(gui::Rect rect);
00070 
00072     virtual void OnMouseMove(gui::Point point);
00073 
00075     virtual void OnMouseDown(int n, gui::Point point);
00076 
00078     virtual void OnMouseUp(int n, gui::Point point);
00079 
00081     void SetStatus(const std::string& rStatus);
00082 
00084     void SetMapView(MapView* pView);
00085 
00087     void SetRadarCursor(gui::Rect rect);
00088 
00090     void ScanMap(regcom::common::Map* pMap);
00091 
00093     virtual int Contains(gui::Point point);
00094 
00095 private:
00096     
00097     // PRIVATE ATTRIBUTES
00098 
00100     RadarView* m_pRadarView;
00101 
00103     gui::StringView* m_Status;
00104 
00106     gui::Surface* m_pFrameImage;
00107 
00109     gui::Button* m_pButtonTable[8];
00110     
00112     bool m_Dragging;
00113 
00115     int m_DragX;
00116 
00118     int m_DragY;
00119 
00120     // STATIC PRIVATE ATTRIBUTES
00121 
00123     static const int BUTTON_COUNT = 5;
00124 
00126     static const int BUTTON_X0 = 6;
00127 
00129     static const int BUTTON_Y0 = 156;
00130 
00132     static const int BUTTON_WIDTH = 40;
00133 
00135     static const int BUTTON_HEIGHT = 16;
00136 
00138     static const ButtonInfo s_ButtonInfo[BUTTON_COUNT];
00139 };
00140 
00141 } // namespace client
00142 } // namespace regcom
00143 
00144 #endif