Btk
lable.hpp
1 #if !defined(_BTK_LABLE_HPP_)
2 #define _BTK_LABLE_HPP_
3 #include <string>
4 #include <string_view>
5 #include "widget.hpp"
6 #include "pixels.hpp"
7 #include "rect.hpp"
8 #include "font.hpp"
9 namespace Btk{
14  class BTKAPI Lable:public Widget{
15  public:
16  Lable(Container&);
17  Lable(Container&,std::string_view text);
26  Lable(Container&,int x,int y,int w,int h);
27  ~Lable();
28  std::string text() const{
29  return text_;
30  };
31  //Set Lable text
32  void set_text(std::string_view text);
33  void draw(Renderer&);
34  private:
35  std::string text_;//text
36  Font font_;//font
37 
38  PixBuf text_buf;//text pixels buf
39  Texture texture;//text texture
40  Color text_color;//text color
41 
42  Align v_align = Align::Left;
43  Align h_align = Align::Center;
44  };
45 };
46 
47 #endif // _BTK_LABLE_HPP_
Definition: pixels.hpp:191
Definition: widget.hpp:219
This header include many useful containers.
Definition: async.hpp:7
Font Class.
Definition: font.hpp:26
Definition: pixels.hpp:32
Color structure.
Definition: pixels.hpp:19
A Container of Widget.
Definition: widget.hpp:108
Lable widget.
Definition: lable.hpp:14