guit  0.1
 All Classes Functions Variables Typedefs Enumerations Friends
gstackbox.hpp
1 //
2 // Boxes that stack gadgets.
3 // Guit GUI Toolkit
4 // Copyright © 2020 Eric Lecolinet. All rights reserved.
5 // http://www.telecom-paris.fr/~elc
6 //
7 
8 #ifndef Guit_StackBox_hpp
9 #define Guit_StackBox_hpp
10 #include <gchoicebox.hpp>
11 namespace guit {
12 
16 class GStackBox : public GChoiceBox {
17 protected:
18  GStackBox(GadgetType&, GString const& css_and_title);
19 
20 public:
21  GStackBox(GString const& css_and_title = "");
22  GStackBox& clone(GClone const&) override;
23 
25  static GType& Type();
26  GType& type() const override {return Type();}
27 };
28 
29 GStackBox& StackBox(GString const& css_and_title = "");
30 
31 
32 
37 class GTabBox : public GStackBox {
38 protected:
39  GTabBox(GadgetType&, GString const& css_and_title);
40 
41 public:
42  ~GTabBox();
43  GTabBox(GString const& css_and_title = "");
44  GTabBox& clone(GClone const&) override;
45 
46  GChoiceBox& tabs();
47 
48  using GChoiceBox::add;
49  void add(Gadget* child, int index = -1) override;
50  void add(Gadget& child, int index = -1) override {GTabBox::add(&child, index);}
51 
53  static GType& Type();
54  GType& type() const override {return Type();}
55 
56 protected:
57  void setChoiceImpl(GChoice& c, bool add_to_list) override;
58  gptr<GChoiceBox> tabs_;
59 };
60 
61 GTabBox& TabBox(GString const& css_and_title = "");
62 
63 }
64 #endif