namespace canvas
{
class Window:
- public simgear::PropertyBasedElement
+ public simgear::canvas::Image
{
public:
+ static const std::string TYPE_NAME;
enum Resize
{
INIT = BOTTOM << 1
};
- Window(SGPropertyNode* node);
+ typedef simgear::canvas::Style Style;
+
+ /**
+ * @param node Property node containing settings for this window:
+ * capture-events Disable/Enable event capturing
+ * content-size[0-1] Size of content area (excluding
+ * decoration border)
+ * decoration-border Size of decoration border
+ * resize Enable resize cursor and properties
+ * shadow-inset Inset of shadow image
+ * shadow-radius Radius/outset of shadow image
+ */
+ Window( const simgear::canvas::CanvasWeakPtr& canvas,
+ const SGPropertyNode_ptr& node,
+ const Style& parent_style = Style(),
+ Element* parent = 0 );
virtual ~Window();
virtual void update(double delta_time_sec);
virtual void valueChanged(SGPropertyNode* node);
- virtual void childAdded(SGPropertyNode* parent, SGPropertyNode* child);
- virtual void childRemoved(SGPropertyNode* parent, SGPropertyNode* child);
osg::Group* getGroup();
- const SGRect<float>& getRegion() const;
const SGVec2<float> getPosition() const;
const SGRect<float> getScreenRegion() const;
- void setCanvas(simgear::canvas::CanvasPtr canvas);
- simgear::canvas::CanvasWeakPtr getCanvas() const;
+ void setCanvasContent(simgear::canvas::CanvasPtr canvas);
+ simgear::canvas::CanvasWeakPtr getCanvasContent() const;
simgear::canvas::CanvasPtr getCanvasDecoration();
- bool isVisible() const;
bool isResizable() const;
bool isCapturingEvents() const;
- bool handleMouseEvent(const simgear::canvas::MouseEventPtr& event);
+ /**
+ * Moves window on top of all other windows with the same z-index.
+ *
+ * @note If no z-index is set it defaults to 0.
+ */
+ void raise();
- void handleResize(uint8_t mode, const osg::Vec2f& delta = osg::Vec2f());
-
- void doRaise(SGPropertyNode* node_raise = 0);
+ void handleResize( uint8_t mode,
+ const osg::Vec2f& offset = osg::Vec2f() );
protected:
simgear::canvas::CanvasPtr _canvas_decoration;
simgear::canvas::CanvasWeakPtr _canvas_content;
- simgear::canvas::Image _image;
simgear::canvas::ImagePtr _image_content,
_image_shadow;