Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class string_box

boost::ui::string_box — Single-line text editor widget.

Synopsis

// In header: <boost/ui/text_box.hpp>


class string_box : public boost::ui::text_box_base {
public:
  // construct/copy/destruct
  explicit string_box(widget &, const uistring & = uistring());
  string_box();

  // public member functions
  string_box & placeholder(const uistring &);
  uistring placeholder() const;
};

Description

Usage example:

ui::string_box string_box = ui::string_box(parent, "Initial text");
string_box.on_edit([&]
{
    ui::log::info() << "Edited text: " << string_box.text();
});

See Also:

Text box (Wikipedia)

string_box public construct/copy/destruct

  1. explicit string_box(widget & parent, const uistring & text = uistring());
    Creates widget.

    Parameters:

    parent

    Parent widget

    text

    Initial text in the editor

  2. string_box();

string_box public member functions

  1. string_box & placeholder(const uistring & text);
    Sets placeholder text into the editor.
  2. uistring placeholder() const;
    Returns placeholder text from the editor.

PrevUpHomeNext