-// Adjustment action.
-//
-// This is an action to increase or decrease an FGFS value by a certain
-// increment within a certain range. If the wrap flag is true, the
-// value will wrap around if it goes below min or above max; otherwise,
-// it will simply stop at min or max.
-////////////////////////////////////////////////////////////////////////
-
-class FGAdjustAction : public FGPanelAction
-{
-public:
- FGAdjustAction (int button, int x, int y, int w, int h,
- SGPropertyNode * node, float increment,
- float min, float max, bool wrap=false);
- virtual ~FGAdjustAction ();
- virtual void doAction ();
-
-private:
- SGPropertyNode * _node;
- float _increment;
- float _min;
- float _max;
- bool _wrap;
-};
-
-
-\f
-////////////////////////////////////////////////////////////////////////
-// Swap action.
-//
-// This is an action to swap two values. It's currently used in the
-// navigation radios.
-////////////////////////////////////////////////////////////////////////
-
-class FGSwapAction : public FGPanelAction
-{
-public:
- FGSwapAction (int button, int x, int y, int w, int h,
- SGPropertyNode * node1, SGPropertyNode * node2);
- virtual ~FGSwapAction ();
- virtual void doAction ();
-
-private:
- SGPropertyNode * _node1;
- SGPropertyNode * _node2;
-};
-
-
-\f
-////////////////////////////////////////////////////////////////////////
-// Toggle action.
-//
-// This is an action to toggle a boolean value.
-////////////////////////////////////////////////////////////////////////
-
-class FGToggleAction : public FGPanelAction
-{
-public:
- FGToggleAction (int button, int x, int y, int w, int h,
- SGPropertyNode * node);
- virtual ~FGToggleAction ();
- virtual void doAction ();
-
-private:
- SGPropertyNode * _node;
-};
-
-
-\f
-////////////////////////////////////////////////////////////////////////
-// 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:
- FGPanelInstrument ();
- FGPanelInstrument (int x, int y, int w, int h);
- virtual ~FGPanelInstrument ();
-
- virtual void draw () = 0;
-
- 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 x, int y);
-
-protected:
- int _x, _y, _w, _h;
- typedef vector<FGPanelAction *> action_list_type;
- action_list_type _actions;
-};
-
-
-\f
-////////////////////////////////////////////////////////////////////////
-// Abstract base class for an instrument layer.
-//
-// The FGLayeredInstrument class builds up instruments by using layers
-// of textures or text. Each layer can have zero or more
-// transformations applied to it: for example, a needle layer can
-// rotate to show the altitude or airspeed.