+/**
+ * Abstract base class for a panel instrument.
+ *
+ * A panel instrument consists of zero or more actions, associated
+ * with mouse clicks in rectangular areas. Currently, the only
+ * concrete class derived from this is FGLayeredInstrument, but others
+ * may show up in the future (some complex instruments could be
+ * entirely hand-coded, for example).
+ */
+class FGPanelInstrument : public SGConditional
+{
+public:
+ FGPanelInstrument ();
+ FGPanelInstrument (int x, int y, int w, int h);
+ virtual ~FGPanelInstrument ();
+
+ virtual void draw (osg::State& state) = 0;
+ virtual void drawHotspots(osg::State& state);
+
+ virtual void setPosition(int x, int y);
+ virtual void setSize(int w, int h);
+
+ virtual int getXPos () const;
+ virtual int getYPos () const;
+ virtual int getWidth () const;
+ virtual int getHeight () const;
+
+ // Coordinates relative to centre.
+ // Transfer pointer ownership!!
+ virtual void addAction (FGPanelAction * action);
+
+ // Coordinates relative to centre.
+ virtual bool doMouseAction (int button, int updown, int x, int y);
+
+ void extendRect(IntRect& r) const;
+protected:
+ int _x, _y, _w, _h;
+ typedef std::vector<FGPanelAction *> action_list_type;
+ action_list_type _actions;
+};
+
+