1#ifndef FGEVENTHANDLER_H
2#define FGEVENTHANDLER_H 1
6#include <osgGA/GUIEventHandler>
7#include <osgViewer/ViewerEventHandlers>
20 _font =
"Fonts/helvetica_medium.txf";
21 _characterSize = 12.0f;
31 virtual const char*
className()
const {
return "FGEventHandler"; }
33 virtual void init(
const osgGA::GUIEventAdapter& ea,
34 osgGA::GUIActionAdapter& us);
36 bool handle(
const osgGA::GUIEventAdapter& ea,
37 osgGA::GUIActionAdapter& us)
override;
108 static int translateKey(
const osgGA::GUIEventAdapter& ea);
121 void handleKey(
const osgGA::GUIEventAdapter& ea,
int& key,
int& modifiers);
131 bool m_setWindowRectangle_called =
false;
132 int m_setWindowRectangle_called_x = 0;
133 int m_setWindowRectangle_called_y = 0;
134 int m_setWindowRectangle_delta_x = 0;
135 int m_setWindowRectangle_delta_y = 0;
144 eventToViewport(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us,
147 bool isMainWindow(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
SGPropertyNode_ptr _print
void setIdleHandler(fgIdleHandler idleHandler)
fgIdleHandler idleHandler
void setMouseClickHandler(fgMouseClickHandler mouseClickHandler)
osg::ref_ptr< osg::Node > _node
int getCurrentModifiers() const
SGPropertyNode_ptr _display
static int translateModifiers(const osgGA::GUIEventAdapter &ea)
virtual ~FGEventHandler()
osg::ref_ptr< osgGA::GUIEventAdapter > statsEvent
fgMouseClickHandler getMouseClickHandler()
fgIdleHandler getIdleHandler() const
void handleStats(osgGA::GUIActionAdapter &us)
bool getResizable()
Whether or not resizing is supported.
void setChangeStatsCameraRenderOrder(bool c)
void setWindowRectangleInteriorWithCorrection(osgViewer::GraphicsWindow *window, int x, int y, int width, int height)
virtual const char * className() const
fgMouseClickHandler mouseClickHandler
static int translateKey(const osgGA::GUIEventAdapter &ea)
osg::ref_ptr< FGStatsHandler > statsHandler
fgMouseMotionHandler getMouseMotionHandler()
void handleKey(const osgGA::GUIEventAdapter &ea, int &key, int &modifiers)
void setKeyHandler(fgKeyHandler keyHandler)
void setMouseMotionHandler(fgMouseMotionHandler mouseMotionHandler)
fgKeyHandler getKeyHandler() const
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) override
bool changeStatsCameraRenderOrder
fgMouseMotionHandler mouseMotionHandler
void setResizable(bool _resizable)
void(* fgKeyHandler)(int key, int keymod, int mousex, int mousey)
void(* fgMouseClickHandler)(int button, int updown, int x, int y, bool mainWindow, const osgGA::GUIEventAdapter *)
void(* fgMouseMotionHandler)(int x, int y, const osgGA::GUIEventAdapter *)
FlightPlan.hxx - defines a full flight-plan object, including departure, cruise, arrival information ...
bool eventToWindowCoords(const osgGA::GUIEventAdapter *ea, double &x, double &y)