00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028 #ifndef PANELS_H
00029 #define PANELS_H
00030
00031 #include "FlyLegacy.h"
00032 #include "Gauges.h"
00033 #include <map>
00034 #include <vector>
00035
00036
00038
00039
00040
00041
00042
00043
00044
00046
00047 typedef enum {
00048 PANEL_STATIC,
00049 PANEL_INTERACTIVE
00050 } EPanelType;
00051
00052 typedef struct {
00053 int x;
00054 int y;
00055 } SPanelOffset;
00056
00057
00058
00059
00060
00061 class CPanel : public CStreamObject {
00062 public:
00063 CPanel (Tag id, const char* filename);
00064 ~CPanel (void);
00065
00066 virtual int Read (SStream *stream, Tag tag);
00067 virtual void ReadFinished (void);
00068
00069
00070 Tag GetId (void);
00071 void Draw (void);
00072 void Activate (void);
00073 void Deactivate (void);
00074
00075 void CreepUp (void);
00076 void CreepDown (void);
00077 void CreepLeft (void);
00078 void CreepRight (void);
00079
00080 bool GaugeHit (int mouseX, int mouseY, int& i, CGauge **gptr, int &x, int &y);
00081 void GaugeMouseClick (int mouseX, int mouseY);
00082 void GaugeTrackClick (int mouseX, int mouseY);
00083 void GaugeStopClick (int mouseX, int mouseY);
00084 void MouseMotion (int x, int y);
00085 void MouseClick (int button, int updown, int x, int y);
00086
00087 void ScrollUp (void);
00088 void ScrollDown (void);
00089 void ScrollLeft (void);
00090 void ScrollRight (void);
00091 void Home (void);
00092 void PageUp (void);
00093 void PageDown (void);
00094
00095 protected:
00096 Tag id;
00097 char filename[64];
00098 EPanelType type;
00099
00100
00101 char panl[64];
00102 int x_3Dxy, y_3Dxy;
00103 int x_3Dsz, y_3Dsz;
00104 int x_isiz, y_isiz;
00105
00106 std::map<int, int> hoff;
00107 std::map<int, SPanelOffset> home;
00108
00109 bool keep;
00110 bool scrl;
00111 bool clao;
00112 Tag dlid;
00113
00114 SBitmap bmPanl;
00115
00116 std::vector<CGauge*> gage;
00117
00118 SSurface *surface;
00119 int xScreen, yScreen;
00120 int xOffset;
00121 int yOffset;
00122 int xMinLimit, xMaxLimit, yMinLimit, yMaxLimit;
00123
00124
00125
00126 bool creep_up, creep_down, creep_left, creep_right;
00127
00128
00129 EClickResult track;
00130 int buttonsDown;
00131
00132
00134 int sfx_source;
00135 };
00136
00137
00138 #endif // PANELS_H
00139