2012-07-04 11:15:12 +00:00
|
|
|
/*
|
|
|
|
* CanvasWidget.hxx
|
|
|
|
*
|
|
|
|
* Created on: 03.07.2012
|
|
|
|
* Author: tom
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CANVASWIDGET_HXX_
|
|
|
|
#define CANVASWIDGET_HXX_
|
|
|
|
|
|
|
|
#include <Main/fg_props.hxx>
|
|
|
|
#include <plib/pu.h>
|
|
|
|
|
2012-11-18 15:38:35 +00:00
|
|
|
#include <simgear/canvas/canvas_fwd.hxx>
|
|
|
|
|
2012-07-04 11:15:12 +00:00
|
|
|
class CanvasMgr;
|
|
|
|
|
|
|
|
class CanvasWidget:
|
|
|
|
public puObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CanvasWidget( int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
SGPropertyNode* props,
|
|
|
|
const std::string& module );
|
|
|
|
virtual ~CanvasWidget();
|
|
|
|
|
|
|
|
virtual void doHit (int button, int updown, int x, int y);
|
2012-12-02 12:27:37 +00:00
|
|
|
virtual int checkKey(int key, int updown);
|
2012-07-04 11:15:12 +00:00
|
|
|
|
|
|
|
virtual void setSize ( int w, int h );
|
|
|
|
virtual void draw(int dx, int dy);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
CanvasMgr *_canvas_mgr; // TODO maybe we should store this in some central
|
|
|
|
// location or make it static...
|
|
|
|
|
2012-11-18 15:38:35 +00:00
|
|
|
simgear::canvas::CanvasPtr _canvas;
|
2012-12-02 12:27:37 +00:00
|
|
|
|
2012-12-02 22:59:44 +00:00
|
|
|
float _last_x,
|
|
|
|
_last_y;
|
2012-12-06 22:27:25 +00:00
|
|
|
|
2012-12-08 14:02:15 +00:00
|
|
|
static SGPropertyNode_ptr _time,
|
|
|
|
_view_height;
|
2012-07-04 11:15:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* CANVASWIDGET_HXX_ */
|