OpenCV zGUI
CrossPlatform C++ GUI libarary based on OpenCV
z::TextBox Class Reference
Inheritance diagram for z::TextBox:
Collaboration diagram for z::TextBox:

Public Member Functions

 TextBox (cv::Rect2i r, int lines)
 
void set_max_character (int max)
 
std::string type () const
 
std::string value () const
 
void value (std::string s)
 
- Public Member Functions inherited from z::Window
 Window (std::string title, cv::Rect_< int > r)
 
void show ()
 draw mat_ More...
 
void popup (Window &w, std::function< void(int)> f=[](int){})
 
void popdown (int value)
 
int open (int flag=cv::WINDOW_AUTOSIZE, int x=-1, int y=-1)
 
void quit (int r)
 
void focus (bool v)
 
Windowoperator+ (Widget &w)
 
Windowoperator- (Widget &w)
 
Windowoperator<< (Widget &r)
 
Windowoperator>> (Widget &r)
 
int loop ()
 
std::vector< Widget * >::iterator begin ()
 
std::vector< Widget * >::iterator end ()
 
void close ()
 
void start (int flag=cv::WINDOW_AUTOSIZE|cv::WINDOW_KEEPRATIO)
 
void keyboard_callback (int key, int level=0)
 
std::string title () const
 
void tie (TextInput &t, Button &b, const std::vector< std::string > &v, int font_size)
 
template<class T >
auto tie (TextInput &t, Button &b1, Button &b2, T start, T step)
 
template<class... T>
void tabs (int xpos, int ypos, T &... wins)
 
void organize_accordingto_zindex ()
 
void move_widget (Widget &w, cv::Point2i p)
 
void on_register ()
 will be called when widget is added to a window
 
bool is_window () const
 
template<class... T>
auto tie (T &... checks)
 
template<class... T>
void wrap (const char *title, int font, int N, const T &... widgets)
 
void draw_all_wrapped ()
 
void scroll_to (cv::Rect2i r)
 
void set_ul (cv::Point2i p)
 
void set_br (cv::Point2i p)
 
- Public Member Functions inherited from z::Widget
 Widget (cv::Rect_< int > r)
 
Widgetoperator= (const Widget &r)
 
bool focus () const
 
virtual void event_callback (int event, int x, int y)
 
void resize (cv::Rect2i r)
 
void update ()
 
int zIndex ()
 
void zIndex (int v)
 
void hidden (bool v)
 
void activated (bool v)
 
bool hidden () const
 
bool activated () const
 
void hide ()
 
float alpha () const
 
void alpha (float f)
 
void shade_rect (cv::Rect2i r, int shade=3, cv::Vec3b color=widget_color_, cv::Vec3b upper_left=highlight_color_, cv::Vec3b lower_right=click_color_)
 

Protected Member Functions

void draw ()
 
- Protected Member Functions inherited from z::Window
void draw_wrapped (const Wrapped &wr)
 

Protected Attributes

int top_line_index_ = 0
 
int focus_line_ = 0
 
std::list< Line > contents_
 
std::vector< std::shared_ptr< TextInput2 > > inputs_
 
- Protected Attributes inherited from z::Window
std::string title_
 
bool closed_ = false
 
int result_ = -1
 
- Protected Attributes inherited from z::Widget
float alpha_ = 1
 alpha value of widget. Widgets can be overlapped. Alpha value will be calculated in such cases.
 
bool hidden_ = false
 if hidden, a widget will not show on window, but still can react to event.
 
bool activated_ = true
 deactivated widget cannot get focus so that it cannot react to events.
 
bool focus_ = false
 
int zIndex_ = 0
 higher zIndex widget will be in front of lower zIndex widget.
 

Additional Inherited Members

- Public Attributes inherited from z::Window
cv::Rect2i scrolled_rect_ = cv::Rect2i{0,0,0,0}
 
std::vector< Widget * > widgets_
 
std::vector< Widget * > backup_
 
- Public Attributes inherited from z::Widget
std::map< int, std::function< void(int, int)> > gui_callback_
 map<int : event, function(x, y)>. library will draw change in widget graphics after gui_callback
 
std::map< int, std::function< void(int, int)> > user_callback_
 
cv::Mat3b mat_
 Matrix that contains widget shape.
 
Windowparent_ = nullptr
 pointer to parent window that is containing this widget
 
- Static Protected Attributes inherited from z::Widget
static const cv::Vec3b background_color_ = {200, 200, 200}
 
static const cv::Vec3b widget_color_ = {220, 220, 220}
 
static const cv::Vec3b highlight_color_ = {240, 240, 240}
 
static const cv::Vec3b click_color_ = {180, 180, 180}
 
static cv::Ptr< cv::freetype::FreeType2 > ft2_
 freetype2 font. CJK font needed
 

The documentation for this class was generated from the following files: