1 // CanvasWidget -- Using Canvas inside PUI dialogs
3 // Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef CANVASWIDGET_HXX_
20 #define CANVASWIDGET_HXX_
22 #include <Main/fg_props.hxx>
25 #include <simgear/canvas/canvas_fwd.hxx>
33 CanvasWidget( int x, int y,
34 int width, int height,
35 SGPropertyNode* props,
36 const std::string& module );
37 virtual ~CanvasWidget();
39 virtual void doHit (int button, int updown, int x, int y);
40 virtual int checkKey(int key, int updown);
42 virtual void setSize ( int w, int h );
43 virtual void draw(int dx, int dy);
47 CanvasMgr *_canvas_mgr; // TODO maybe we should store this in some central
48 // location or make it static...
50 simgear::canvas::CanvasPtr _canvas;
54 bool _auto_viewport; //!< Set true to get the canvas view dimensions
55 // automatically resized if the size of the widget
58 SGPropertyNode_ptr _time,
62 #endif /* CANVASWIDGET_HXX_ */