CJK font, libhangul needed.
More...
#include <zgui.h>
|
| TextInput (cv::Rect2i r) |
|
std::string | value () const |
|
void | value (std::string s) |
|
void | enter (std::function< void(std::string)> f) |
|
void | move_cursor (bool right) |
|
std::string | type () const |
|
| Widget (cv::Rect_< int > r) |
|
Widget & | operator= (const Widget &r) |
|
bool | focus () const |
|
virtual void | focus (bool) |
|
virtual void | event_callback (int event, int x, int y) |
|
virtual void | show () |
|
void | resize (cv::Rect2i r) |
|
void | update () |
|
virtual void | on_register () |
| will be called when widget is added to a window
|
|
virtual bool | is_window () const |
|
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_) |
|
|
void | show_cursor () |
|
bool | draw () |
|
void | key_event (int key, int) |
|
virtual bool | on_overflow (std::string, std::string, std::string) |
|
|
std::string | fore_ |
|
std::string | back_ |
|
std::string | editting_ |
|
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.
|
|
|
static HangulInputContext * | hic_ = hangul_ic_new("2") |
|
static HanjaTable * | table_ = hanja_table_load(NULL) |
|
static bool | hangul_mode_ = false |
|
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
|
|
|
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.
|
|
Window * | parent_ = nullptr |
| pointer to parent window that is containing this widget
|
|
CJK font, libhangul needed.
◆ TextInput()
z::TextInput::TextInput |
( |
cv::Rect2i |
r | ) |
|
create a TextInput with a position and size of r
◆ draw()
bool z::TextInput::draw |
( |
| ) |
|
|
protected |
draw mat_ with inner states, if overflow returns false do not show cursor
◆ enter()
void z::TextInput::enter |
( |
std::function< void(std::string)> |
f | ) |
|
register a function that will be called when user stroke ENTER key.
◆ key_event()
void z::TextInput::key_event |
( |
int |
key, |
|
|
int |
|
|
) |
| |
|
protected |
called by gui_callback[EVENT_KEYBOARD]
◆ move_cursor()
void z::TextInput::move_cursor |
( |
bool |
right | ) |
|
◆ show_cursor()
void z::TextInput::show_cursor |
( |
| ) |
|
|
protected |
show rectangular cursor on editting_
◆ value()
string z::TextInput::value |
( |
| ) |
const |
The documentation for this class was generated from the following files:
- /home/zeta/Programming/opencv-gui/src/zgui.h
- /home/zeta/Programming/opencv-gui/src/textinput.cc