Boost C++ Libraries Home Libraries People FAQ More

Next

Chapter 1. Boost.UI

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Table of Contents

Reference
Header <boost/ui.hpp>
Header <boost/ui/application.hpp>
Header <boost/ui/audio.hpp>
Header <boost/ui/button.hpp>
Header <boost/ui/canvas.hpp>
Header <boost/ui/check_box.hpp>
Header <boost/ui/choice.hpp>
Header <boost/ui/color.hpp>
Header <boost/ui/color_io.hpp>
Header <boost/ui/combo_box.hpp>
Header <boost/ui/config.hpp>
Header <boost/ui/coord.hpp>
Header <boost/ui/coord_io.hpp>
Header <boost/ui/datetime.hpp>
Header <boost/ui/def.hpp>
Header <boost/ui/dialog.hpp>
Header <boost/ui/event.hpp>
Header <boost/ui/event_loop.hpp>
Header <boost/ui/font.hpp>
Header <boost/ui/frame.hpp>
Header <boost/ui/group_box.hpp>
Header <boost/ui/hyperlink.hpp>
Header <boost/ui/image.hpp>
Header <boost/ui/image_widget.hpp>
Header <boost/ui/label.hpp>
Header <boost/ui/layout.hpp>
Header <boost/ui/line.hpp>
Header <boost/ui/list_box.hpp>
Header <boost/ui/locale.hpp>
Header <boost/ui/log.hpp>
Header <boost/ui/menu.hpp>
Header <boost/ui/message.hpp>
Header <boost/ui/notebook.hpp>
Header <boost/ui/painter.hpp>
Header <boost/ui/panel.hpp>
Header <boost/ui/progress_bar.hpp>
Header <boost/ui/slider.hpp>
Header <boost/ui/status_bar.hpp>
Header <boost/ui/stream.hpp>
Header <boost/ui/string.hpp>
Header <boost/ui/string_io.hpp>
Header <boost/ui/strings_box.hpp>
Header <boost/ui/text_box.hpp>
Header <boost/ui/thread.hpp>
Header <boost/ui/web_widget.hpp>
Header <boost/ui/widget.hpp>

Reference

Header <boost/ui.hpp>

Master Boost.UI file.

Application class.

namespace boost {
  namespace ui {
    int entry(int(*)(int, char *[]), int, char *);
    int entry(int(*)(), int, char *);
    template<typename Rep, typename Period, typename F, class ... Args> 
      void on_timeout(const std::chrono::duration< Rep, Period > &, F &&, 
                      Args &&...);
  }
}

Audio.

namespace boost {
  namespace ui {
    void beep();
  }
}

Button widget.

namespace boost {
  namespace ui {
    class button;
  }
}

Canvas widget.

namespace boost {
  namespace ui {
    class canvas;
  }
}

Check box widget.

namespace boost {
  namespace ui {
    class check_box;
    class check_box_base;
    class tri_state_check_box;
  }
}

Choice widget.

namespace boost {
  namespace ui {
    class choice;
  }
}

Color class.

namespace boost {
  namespace ui {
    class color;

    // Compares two colors. 
    bool operator==(const color & lhs, const color & rhs);

    // Compares two colors. 
    bool operator!=(const color & lhs, const color & rhs);
  }
}

Color I/O operations.

namespace boost {
  namespace ui {

    // Writes color into the stream. 
    template<typename CharT, typename Traits> 
      std::basic_ostream< CharT, Traits > & 
      operator<<(std::basic_ostream< CharT, Traits > & os, 
                 const boost::ui::color & c);
  }
}

Combo box widget.

namespace boost {
  namespace ui {
    class combo_box;
  }
}

Coordinates classes.


BOOST_UI_USE_GEOMETRY
BOOST_UI_USE_POLYGON
namespace boost {
  namespace ui {
    template<typename T> class basic_point;
    template<typename T> class basic_rect;
    template<typename T> class basic_size;

    typedef int coord_type;  // Widget coordinates signed number type. 
    typedef basic_size< coord_type > size;  // 2D size coordinates 
    typedef basic_point< coord_type > point;  // 2D point coordinates 
    typedef basic_rect< coord_type > rect;  // 2D rectangle coordinates 

    // Arithmetic operation. 
    template<typename T> 
      basic_size< T > operator*(const T & value, const basic_size< T > & rhs);

    // Arithmetic operation. 
    template<typename T> 
      basic_size< T > operator*(const basic_size< T > & lhs, const T & value);

    // Arithmetic operation. 
    template<typename T> 
      basic_size< T > operator/(const basic_size< T > & lhs, const T & value);

    // Arithmetic operation. 
    template<typename T> 
      basic_point< T > 
      operator+(const basic_point< T > & lhs, const basic_size< T > & rhs);

    // Arithmetic operation. 
    template<typename T> 
      basic_point< T > 
      operator-(const basic_point< T > & lhs, const basic_size< T > & rhs);

    // Arithmetic operation. 
    template<typename T> 
      basic_size< T > 
      operator-(const basic_point< T > & lhs, const basic_point< T > & rhs);
  }
}

Coordinates I/O.

namespace boost {
  namespace ui {

    // Writes basic_size into basic_size stream. 
    template<typename T, typename CharT, typename Traits> 
      std::basic_ostream< CharT, Traits > & 
      operator<<(std::basic_ostream< CharT, Traits > & os, 
                 const basic_size< T > & p);

    // Writes basic_point into the stream. 
    template<typename T, typename CharT, typename Traits> 
      std::basic_ostream< CharT, Traits > & 
      operator<<(std::basic_ostream< CharT, Traits > & os, 
                 const basic_point< T > & p);

    // Writes basic_rect into the stream. 
    template<typename T, typename CharT, typename Traits> 
      std::basic_ostream< CharT, Traits > & 
      operator<<(std::basic_ostream< CharT, Traits > & os, 
                 const basic_rect< T > & r);
  }
}

Date and time pickers.


BOOST_UI_USE_DATE_TIME
BOOST_UI_USE_CHRONO
namespace boost {
  namespace ui {
    class date_picker;
    class time_picker;
  }
}

Definitions.

Dialog widget.

namespace boost {
  namespace ui {
    class dialog;
  }
}

Event classes.

namespace boost {
  namespace ui {
    class event;
    class index_event;
    class key_event;
    class keyboard_state;
    class mouse_event;
    class wheel_event;

    typedef int index_type;  // Integral type for indexing items. 

    const index_type nindex;    // Invalid index value. 
  }
}

Event loop class.

namespace boost {
  namespace ui {
    class event_loop;
  }
}

Font class.

namespace boost {
  namespace ui {
    class font;
  }
}

Frame widget.

namespace boost {
  namespace ui {
    class frame;
  }
}

Group box widget.

namespace boost {
  namespace ui {
    class group_box;
  }
}

Hyperlink widget.

namespace boost {
  namespace ui {
    class hyperlink;
  }
}

Image class.

namespace boost {
  namespace ui {
    class image;
  }
}

Image widget.

namespace boost {
  namespace ui {
    class image_widget;
  }
}

Label widget.

namespace boost {
  namespace ui {
    class label;
  }
}

Layout classes.

namespace boost {
  namespace ui {
    class box_layout;
    class hbox;
    class layout;
    class vbox;
  }
}

line widget

namespace boost {
  namespace ui {
    class hline;
    class line_widget;
    class vline;
  }
}

List box widget.

namespace boost {
  namespace ui {
    class list_box;
  }
}

Localization.

namespace boost {
  namespace ui {

    // Returns the current locale associated with the user interface. 
    std::locale getloc();
  }
}

Classes for logging.

namespace boost {
  namespace ui {
    class log;
    class log_string;
  }
}

Menu classes.

namespace boost {
  namespace ui {
    class menu;
    class menu_bar;
    class separator;
  }
}

Display message file.


BOOST_UI_USE_FILESYSTEM
namespace boost {
  namespace ui {

    // Request user value using application-modal dialog. 
    BOOST_UI_DECL bool 
    prompt(const uistring & message, const uistring & title, 
           std::wstring & value);

    // Request user value using application-modal dialog. 
    BOOST_UI_DECL bool 
    prompt(const uistring & message, const uistring & title, uistring & value);

    // Request user password using application-modal dialog. 
    BOOST_UI_DECL bool 
    prompt_password(const uistring & message, const uistring & title, 
                    std::wstring & value);

    // Request user password using application-modal dialog. 
    BOOST_UI_DECL bool 
    prompt_password(const uistring & message, const uistring & title, 
                    uistring & value);
    BOOST_UI_DECL bool prompt_filename(const uistring &, std::wstring &);
    BOOST_UI_DECL bool prompt_filename(const uistring &, uistring &);
    bool prompt_filename(const uistring &, boost::filesystem::path &);
    BOOST_UI_DECL bool prompt_directory(const uistring &, std::wstring &);
    BOOST_UI_DECL bool prompt_directory(const uistring &, uistring &);
    bool prompt_directory(const uistring &, boost::filesystem::path &);

    // Request color using application-modal dialog. 
    BOOST_UI_DECL bool prompt_color(const uistring & title, color & value);

    // Display information as an non intrusive notification. 
    BOOST_UI_DECL void 
    info_notify(const uistring & message, 
                const uistring & title = ascii("Information"));

    // Display warning as an non intrusive notification. 
    BOOST_UI_DECL void 
    warning_notify(const uistring & message, 
                   const uistring & title = ascii("Warning"));

    // Display error as an non intrusive notification. 
    BOOST_UI_DECL void 
    error_notify(const uistring & message, 
                 const uistring & title = ascii("Error"));

    // Display information in application-modal dialog. 
    BOOST_UI_DECL void 
    info_dialog(const uistring & message, 
                const uistring & title = ascii("Information"));

    // Display warning in application-modal dialog. 
    BOOST_UI_DECL void 
    warning_dialog(const uistring & message, 
                   const uistring & title = ascii("Warning"));

    // Display error in application-modal dialog. 
    BOOST_UI_DECL void 
    error_dialog(const uistring & message, 
                 const uistring & title = ascii("Error"));
    BOOST_UI_DECL bool 
    confirm(const uistring &, const uistring & = ascii("Confirmation"));

    // Request user answer using application-modal dialog. 
    BOOST_UI_DECL bool 
    question(const uistring & message, 
             const uistring & title = ascii("Question"));
  }
}

Notebook widget.

namespace boost {
  namespace ui {
    class notebook;
  }
}

Painter class.

namespace boost {
  namespace ui {
    class painter;

    // Enumaration of line endings types. 
    enum line_cap { butt, round, square };

    // Enumaration of line join types. 
    enum line_join { round, bevel, miter };

    typedef basic_size< painter::gcoord_type > gsize;  // 2D size geometry coordinates 
    typedef basic_point< painter::gcoord_type > gpoint;  // 2D point geometry coordinates 
    typedef basic_rect< painter::gcoord_type > grect;  // 2D rectangle geometry coordinates 
  }
}

Panel widget.

namespace boost {
  namespace ui {
    class panel;
  }
}

Progress bar widget.

namespace boost {
  namespace ui {
    class hprogress_bar;
    class progress_bar;
    class vprogress_bar;
  }
}

Slider widget.

namespace boost {
  namespace ui {
    class hslider;
    class slider;
    class vslider;
  }
}

Status bar class.

namespace boost {
  namespace ui {
    class status_bar;
  }
}

Stream class and manipulators.

namespace boost {
  namespace ui {
    class uiostringstream;
  }
}namespace std {

  // Specializes the std::swap algorithm. 
  void swap(boost::ui::uiostringstream & a, boost::ui::uiostringstream & b);

  // Manipulator that inserts newline character into stream. 
  boost::ui::uiostringstream & endl(boost::ui::uiostringstream & os);
}

String class and operations.

namespace boost {
  namespace ui {
    class uistring;

    // Constructs uistring from UTF-8 encoded string. 
    uistring u8uistring(const char * str);

    // Constructs uistring from UTF-8 encoded string. 
    uistring u8uistring(const std::string & str);

    // Constructs uistring from UTF-8 encoded string. 
    uistring utf8(const char * str);

    // Constructs uistring from UTF-8 encoded string. 
    uistring utf8(const std::string & str);

    // Constructs uistring from 7-bit ASCII encoded string. 
    uistring asciiuistring(const char * str);

    // Constructs uistring from 7-bit ASCII encoded string. 
    uistring asciiuistring(const std::string & str);

    // Constructs uistring from 7-bit ASCII encoded string. 
    uistring ascii(const char * str);

    // Constructs uistring from 7-bit ASCII encoded string. 
    uistring ascii(const std::string & str);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const uistring & lhs, const uistring & rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(uistring && lhs, const uistring & rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const uistring & lhs, uistring && rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(uistring && lhs, uistring && rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const uistring & lhs, wchar_t rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const uistring & lhs, const wchar_t * rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(wchar_t lhs, const uistring & rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const wchar_t * lhs, const uistring & rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const uistring & lhs, char16_t rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const uistring & lhs, const char16_t * rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(char16_t lhs, const uistring & rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const char16_t * lhs, const uistring & rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const uistring & lhs, char32_t rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const uistring & lhs, const char32_t * rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(char32_t lhs, const uistring & rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(const char32_t * lhs, const uistring & rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(uistring && lhs, wchar_t rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(uistring && lhs, const wchar_t * rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(uistring && lhs, char16_t rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(uistring && lhs, const char16_t * rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(uistring && lhs, char32_t rhs);

    // Concatenates two strings or the string and the character. 
    uistring operator+(uistring && lhs, const char32_t * rhs);

    // Converts numeric value to uistring. 
    uistring to_uistring(int value);

    // Converts numeric value to uistring. 
    uistring to_uistring(unsigned int value);

    // Converts numeric value to uistring. 
    uistring to_uistring(long value);

    // Converts numeric value to uistring. 
    uistring to_uistring(unsigned long value);

    // Converts numeric value to uistring. 
    uistring to_uistring(long long value);

    // Converts numeric value to uistring. 
    uistring to_uistring(unsigned long long value);

    // Converts numeric value to uistring. 
    uistring to_uistring(float value);

    // Converts numeric value to uistring. 
    uistring to_uistring(double value);

    // Converts numeric value to uistring. 
    uistring to_uistring(long double value);

    // Returns hash of uistring for boost::hash. 
    std::size_t hash_value(const uistring & value);
  }
}namespace std {
  template<> struct hash<boost::ui::uistring>;

  // Specializes the std::swap algorithm. 
  void swap(boost::ui::uistring & a, boost::ui::uistring & b);
}

String I/O operations.

namespace boost {
  namespace ui {

    // Writes string into the stream. 
    template<typename Traits> 
      std::basic_ostream< char, Traits > & 
      operator<<(std::basic_ostream< char, Traits > & os, 
                 const uistring & str);

    // Writes string into the stream. 
    template<typename Traits> 
      std::basic_ostream< wchar_t, Traits > & 
      operator<<(std::basic_ostream< wchar_t, Traits > & os, 
                 const uistring & str);

    // Writes string into the stream. 
    template<typename Traits> 
      std::basic_ostream< char16_t, Traits > & 
      operator<<(std::basic_ostream< char16_t, Traits > & os, 
                 const uistring & str);

    // Writes string into the stream. 
    template<typename Traits> 
      std::basic_ostream< char32_t, Traits > & 
      operator<<(std::basic_ostream< char32_t, Traits > & os, 
                 const uistring & str);

    // Reads string from the stream. 
    template<typename Traits> 
      std::basic_istream< char, Traits > & 
      operator>>(std::basic_istream< char, Traits > & is, ui::uistring & str);

    // Reads string from the stream. 
    template<typename Traits> 
      std::basic_istream< wchar_t, Traits > & 
      operator>>(std::basic_istream< wchar_t, Traits > & is, 
                 ui::uistring & str);

    // Reads string from the stream. 
    template<typename Traits> 
      std::basic_istream< char16_t, Traits > & 
      operator>>(std::basic_istream< char16_t, Traits > & is, 
                 ui::uistring & str);

    // Reads string from the stream. 
    template<typename Traits> 
      std::basic_istream< char32_t, Traits > & 
      operator>>(std::basic_istream< char32_t, Traits > & is, 
                 ui::uistring & str);
  }
}namespace std {

  // Reads characters from the stream into the string. 
  template<typename Traits> 
    std::basic_istream< char, Traits > & 
    getline(std::basic_istream< char, Traits > & is, 
            boost::ui::uistring & str, char ch = '\n');

  // Reads characters from the stream into the string. 
  template<typename Traits> 
    std::basic_istream< wchar_t, Traits > & 
    getline(std::basic_istream< wchar_t, Traits > & is, 
            boost::ui::uistring & str, wchar_t ch = L'\n');

  // Reads characters from the stream into the string. 
  template<typename Traits> 
    std::basic_istream< char16_t, Traits > & 
    getline(std::basic_istream< char16_t, Traits > & is, 
            boost::ui::uistring & str, char16_t ch = u'\n');

  // Reads characters from the stream into the string. 
  template<typename Traits> 
    std::basic_istream< char32_t, Traits > & 
    getline(std::basic_istream< char32_t, Traits > & is, 
            boost::ui::uistring & str, char32_t ch = U'\n');
}

Widget with array of strings.

namespace boost {
  namespace ui {
    class strings_box;
  }
}

Text editor widgets.

namespace boost {
  namespace ui {
    class password_box;
    class string_box;
    class text_box;
    class text_box_base;
  }
}

Thread support.

namespace boost {
  namespace ui {
    template<typename F, class ... Args> void call_async(F &&, Args &&...);
  }
}

Web widget.

namespace boost {
  namespace ui {
    class web_widget;
  }
}

Widget class.

namespace boost {
  namespace ui {
    class native_widget;
    class widget;
  }
}

Last revised: August 16, 2022 at 22:59:11 GMT


Next