libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UILayered.hpp
Go to the documentation of this file.
1 #ifndef UILAYERED_HPP
2 #define UILAYERED_HPP
3 /*
4 This file is part of AlgAudio.
5 
6 AlgAudio, Copyright (C) 2015 CeTA - Audiovisual Technology Center
7 
8 AlgAudio is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License as
10 published by the Free Software Foundation, either version 3 of the
11 License, or (at your option) any later version.
12 
13 AlgAudio is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public License
19 along with AlgAudio. If not, see <http://www.gnu.org/licenses/>.
20 */
21 #include "UIContainer.hpp"
22 
23 namespace AlgAudio{
24 
26 public:
27  static std::shared_ptr<UILayered> Create(std::weak_ptr<Window> parent_window);
28  void Insert(const std::shared_ptr<UIWidget>& child);
29  virtual void Clear() override;
30  virtual void CustomDraw(DrawContext& c) override;
31  virtual void CustomResize(Size2D) override;
32  virtual void OnChildRequestedSizeChanged() override;
33  virtual void OnChildVisibilityChanged() override;
34  virtual bool CustomMousePress(bool,MouseButton,Point2D) override;
35  virtual void CustomMouseEnter(Point2D) override;
36  virtual void CustomMouseLeave(Point2D) override;
37  virtual void CustomMouseMotion(Point2D p1, Point2D p2) override;
38  virtual Point2D GetChildPos(std::shared_ptr<UIWidget>) const override {return Point2D(0,0);}
39 private:
40  UILayered(std::weak_ptr<Window> parent_window);
41  std::list<std::shared_ptr<UIWidget>> children;
42  void RecalculateSize();
43  std::shared_ptr<UIWidget> GetTopChild() const;
44 };
45 
46 } // namespace AlgAudio
47 
48 #endif // UILAYERED_HPP
Definition: DrawContext.hpp:65
Point2D_< int > Point2D
Definition: Utilities.hpp:35
virtual bool CustomMousePress(bool, MouseButton, Point2D) override
void Insert(const std::shared_ptr< UIWidget > &child)
MouseButton
Definition: Utilities.hpp:190
virtual void Clear() override
static std::shared_ptr< UILayered > Create(std::weak_ptr< Window > parent_window)
virtual void CustomMouseEnter(Point2D) override
virtual void CustomMouseLeave(Point2D) override
virtual void CustomDraw(DrawContext &c) override
virtual void CustomMouseMotion(Point2D p1, Point2D p2) override
Definition: UIContainer.hpp:60
virtual void OnChildVisibilityChanged() override
Definition: Alertable.hpp:26
virtual Point2D GetChildPos(std::shared_ptr< UIWidget >) const override
Definition: UILayered.hpp:38
Definition: UILayered.hpp:25
virtual void OnChildRequestedSizeChanged() override
virtual void CustomResize(Size2D) override
Definition: Utilities.hpp:40