1 #ifndef MSP_GLTK_ENTRY_H_
2 #define MSP_GLTK_ENTRY_H_
18 text The current text of the widget. Graphics are ignored.
19 cursor Indicates the current input position. Fill_x is ignored.
20 slider A vertical slider for multiline entries.
22 class Entry: virtual public Widget, private Container
25 class Loader: public DataFile::DerivedObjectLoader<Entry, Widget::Loader>
34 sigc::signal<void, unsigned> signal_edit_position_changed;
35 sigc::signal<void, unsigned> signal_scroll_position_changed;
38 sigc::signal<void> signal_enter;
47 unsigned visible_rows;
48 const Part *text_part;
52 bool selection_active;
53 unsigned selection_pos;
56 Entry(const std::string & = std::string());
58 virtual const char *get_class() const { return "entry"; }
61 virtual void autosize_special(const Part &, Geometry &) const;
64 void set_text(const std::string &);
65 void insert(unsigned, const std::string &);
66 void erase(unsigned, unsigned);
67 const std::string &get_text() const { return text.get(); }
69 void set_edit_position(unsigned p) { set_edit_position(p, false); }
70 unsigned get_edit_position() const { return edit_pos; }
71 unsigned get_scroll_position() const { return first_row; }
72 unsigned get_visible_rows() const { return visible_rows; }
73 bool get_selection(unsigned &, unsigned &) const;
74 void translate_position(unsigned, unsigned &, unsigned &) const;
75 unsigned translate_position(unsigned, unsigned) const;
77 /** Sets the minimum size of the editing area, in characters and rows. This
78 only affects autosizing. */
79 void set_edit_size(unsigned w, unsigned h);
81 void set_multiline(bool);
82 bool is_multiline() const { return multiline; }
85 virtual void rebuild_special(const Part &);
86 virtual void render_special(const Part &, GL::Renderer &) const;
89 virtual void touch_press(int, int, unsigned);
90 virtual bool key_press(unsigned, unsigned);
91 virtual bool character(wchar_t);
92 virtual void focus_in();
93 virtual void focus_out();
94 virtual bool navigate(Navigation);
95 virtual void animate(const Time::TimeDelta &);
97 virtual void on_geometry_change();
98 virtual void on_style_change();
100 void move_edit_position(Navigation, bool);
101 void set_edit_position(unsigned, bool);
102 void erase_selection();
103 void check_cursor_blink();
104 void check_view_range();
105 void slider_value_changed(double);