1 | // Aseprite UI Library |
2 | // Copyright (C) 2001-2017 David Capello |
3 | // |
4 | // This file is released under the terms of the MIT license. |
5 | // Read LICENSE.txt for more information. |
6 | |
7 | #ifndef UI_BOX_H_INCLUDED |
8 | #define UI_BOX_H_INCLUDED |
9 | #pragma once |
10 | |
11 | #include "ui/widget.h" |
12 | |
13 | namespace ui { |
14 | |
15 | class Box : public Widget { |
16 | public: |
17 | Box(int align); |
18 | |
19 | protected: |
20 | // Events |
21 | void onSizeHint(SizeHintEvent& ev) override; |
22 | void onResize(ResizeEvent& ev) override; |
23 | }; |
24 | |
25 | class VBox : public Box { |
26 | public: |
27 | VBox() : Box(VERTICAL) { } |
28 | }; |
29 | |
30 | class HBox : public Box { |
31 | public: |
32 | HBox() : Box(HORIZONTAL) { } |
33 | }; |
34 | |
35 | class BoxFiller : public Box { |
36 | public: |
37 | BoxFiller() : Box(HORIZONTAL) { |
38 | this->setExpansive(true); |
39 | } |
40 | }; |
41 | |
42 | } // namespace ui |
43 | |
44 | #endif |
45 | |