File: dashboard.h

package info (click to toggle)
asc 2.6.1.0-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 81,740 kB
  • sloc: cpp: 158,704; sh: 11,544; ansic: 6,736; makefile: 604; perl: 138
file content (111 lines) | stat: -rw-r--r-- 3,416 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/***************************************************************************
                          dashboard.h  -  description
                             -------------------
    begin                : Sat Jan 27 2001
    copyright            : (C) 2001 by Martin Bickel
    email                : bickel@asc-hq.org
 ***************************************************************************/

/*! \file dashboard.h
    \brief The box displaying unit information
*/


/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/



#ifndef dashboardH
 #define dashboardH

#include "paradialog.h"
#include "windowing.h"

class ContainerBase;
class VehicleType;
class Vehicle;
class Building;
class SingleWeapon;
class MapDisplay;
class GameMap;
class MapField;

class DashboardPanel : public LayoutablePanel {
   private:
      void containerDeleted( ContainerBase* c );
   protected:
       Vehicle* veh;
       Building* bld;
       
      DashboardPanel ( PG_Widget *parent, const PG_Rect &r, const ASCString& panelName_, bool loadTheme );

      void painter ( const PG_Rect &src, const ASCString& name, const PG_Rect &dst);
      void registerSpecialDisplay( const ASCString& name );

      void reset(GameMap& map);

      bool containerRenamed( PG_LineEdit* lineEdit );

      bool viewExperienceOverview();

   public:
      void eval();
      void showUnitData( Vehicle* veh, Building* bld, MapField* fld, bool redraw = false );

};

class WindInfoPanel : public DashboardPanel {
        Surface windArrow;
        int dir;
     protected:
        void painter ( const PG_Rect &src, const ASCString& name, const PG_Rect &dst);
     public:
        WindInfoPanel (PG_Widget *parent, const PG_Rect &r ) ;
};

class UnitInfoPanel : public DashboardPanel {
     protected:
        bool onClick ( PG_MessageObject* obj, const SDL_MouseButtonEvent* event );
        void showUnitInfo( const VehicleType* vt );
        bool unitNaming();
     public:
        UnitInfoPanel (PG_Widget *parent, const PG_Rect &r ) ;
};


class MapDisplayPG;

class MapInfoPanel : public DashboardPanel {
        MapDisplayPG* mapDisplay;
        PG_Slider* zoomSlider;
        bool changeActive;
        
        void layerChanged( bool state, const ASCString& label );        
        bool scrollTrack( long pos );
        bool checkBox( PG_Widget* w, bool state, const char* name );
        void zoomChanged( int zoom );

        bool showWeaponRange();
        bool showMovementRange();
   protected:
        void painter ( const PG_Rect &src, const ASCString& name, const PG_Rect &dst);
     public:
        MapInfoPanel (PG_Widget *parent, const PG_Rect &r, MapDisplayPG* mapDisplay ) ;
};


class ActionInfoPanel : public DashboardPanel {
   public:
      ActionInfoPanel (PG_Widget *parent, const PG_Rect &r ) ;
      
      void update( GameMap* map );
};

#endif