guit  0.1
 All Classes Functions Variables Typedefs Enumerations Friends
gscrollbox.hpp
1 //
2 // Viewport for scrolling another gadget
3 // Guit GUI Toolkit
4 // Copyright © 2019/2020 Eric Lecolinet. All rights reserved.
5 // http://www.telecom-paris.fr/~elc
6 //
7 
8 #ifndef Guit_ScrollBox_hpp
9 #define Guit_ScrollBox_hpp
10 #include <gbox.hpp>
11 #include <gslider.hpp>
12 namespace guit {
13 
14 class GScrollBar;
15 
25 class GScrollBox : public GBox {
26 protected:
27  GScrollBox(GadgetType&, GString const& css_and_title);
28 
29 public:
30  ~GScrollBox();
31  GScrollBox(GString const& css_and_title = "");
32  GScrollBox& clone(GClone const&) override;
33 
34  GScrollBox* toScrollBox() override {return this;}
35 
37  void setScroll(float hscroll, float vscroll);
38 
40  void setScrollDelta(float dx, float dy);
41 
44  float hscroll() const;
45  float vscroll() const;
47 
51  GScrollBar& vscrollbar();
53 
55  static GType& Type();
56  GType& type() const override {return Type();}
57 
60  void pack(GRender* parent_render) override;
61  GRect scrollImpl(GRender& r, float dx, float dy);
62  gptr<GScrollBar> hscrollbar_, vscrollbar_;
64 };
65 
67 GScrollBox& ScrollBox(GString const& css_and_title = "");
68 
69 }
70 #endif