Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

fieldmarker.h

Go to the documentation of this file.
00001 /*
00002      This file is part of Advanced Strategic Command; http://www.asc-hq.de
00003      Copyright (C) 1994-1999  Martin Bickel  and  Marc Schellenberger
00004  
00005      This program is free software; you can redistribute it and/or modify
00006      it under the terms of the GNU General Public License as published by
00007      the Free Software Foundation; either version 2 of the License, or
00008      (at your option) any later version.
00009  
00010      This program is distributed in the hope that it will be useful,
00011      but WITHOUT ANY WARRANTY; without even the implied warranty of
00012      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013      GNU General Public License for more details.
00014  
00015      You should have received a copy of the GNU General Public License
00016      along with this program; see the file COPYING. If not, write to the 
00017      Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
00018      Boston, MA  02111-1307  USA
00019 */
00020 
00021 
00022 #ifndef fieldmarkerH
00023 #define fieldmarkerH
00024 
00025 #include "../paradialog.h"
00026 
00027 class MapDisplayPG;
00028 class OverviewMapPanel;
00029 class GameMap;
00030 
00031 class SelectFromMap : public ASC_PG_Dialog{
00032    private:
00033       MapDisplayPG* md;
00034       OverviewMapPanel* omp;
00035 
00036       PG_ListBox* listbox;
00037       bool justOne;
00038       bool readOnly;
00039 
00040       bool markField2( const MapCoordinate& pos, const SPoint& mouse, bool cursorChanged, int button, int prio );
00041       int oldprio;
00042       
00043    public:
00044       typedef vector<MapCoordinate> CoordinateList;
00045    protected:
00046       GameMap* actmap;
00047       CoordinateList& coordinateList;
00048       
00049       bool ProcessEvent ( const SDL_Event *   event,bool   bModal = false  );
00050       virtual bool accept( const MapCoordinate& pos );
00051       virtual void showFieldMarking( const CoordinateList& coordinateList );
00052       virtual bool mark();
00053       virtual bool markField( const MapCoordinate& pos );
00054       bool eventKeyDown (const SDL_KeyboardEvent *key);
00055       void updateList();
00056       bool listItemClicked( PG_ListBoxBaseItem* item );
00057       virtual bool isOk() { return true; };
00058       bool closeDialog() { if ( isOk()) QuitModal(); return true; };
00059    public:   
00060       SelectFromMap( CoordinateList& list, GameMap* map, bool justOne = false, bool readOnly = false );
00061       void Show( bool fade = false );
00062       ~SelectFromMap();
00063          
00064 };
00065 
00066 
00067 class SelectBuildingFromMap : public SelectFromMap {
00068    protected:
00069       virtual bool accept( const MapCoordinate& pos );
00070       virtual bool isOk() { return !coordinateList.empty(); };
00071    public:
00072       SelectBuildingFromMap ( CoordinateList& list, GameMap* map ) : SelectFromMap ( list, map, true ) {};
00073 };
00074 
00075 class SelectUnitFromMap : public SelectFromMap {
00076    protected:
00077       virtual bool accept( const MapCoordinate& pos );
00078       virtual bool isOk() { return !coordinateList.empty(); };
00079    public:
00080       SelectUnitFromMap ( CoordinateList& list, GameMap* map ) : SelectFromMap ( list, map, true ) {};
00081 };
00082 
00083 
00084 
00085 
00086 #endif
00087 

Generated on Tue Jun 24 01:27:41 2008 for Advanced Strategic Command by  doxygen 1.4.2