Boost C++ Libraries Home Libraries People FAQ More

PrevUpHome

Class widget

boost::ui::widget — Base class for all widgets.

Synopsis

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


class widget {
public:
  // types
  typedef void * native_handle_type;  // Implementation-defined widget type. 

  // construct/copy/destruct
  widget();
  ~widget();

  // public member functions
  ui::layout::item layout();
  widget & resize(coord_type, coord_type);
  coord_type x() const;
  coord_type y() const;
  coord_type width() const;
  coord_type height() const;
  point pos() const;
  size dimensions() const;
  rect bounds() const;
  widget & enable(bool = true);
  widget & disable();
  bool is_enabled() const;
  widget & show(bool = true);
  widget & hide();
  bool is_shown() const;
  widget & tooltip(const uistring &);
  uistring tooltip() const;
  widget & font(const ui::font &);
  ui::font font() const;
  bool native_valid() const noexcept;

  // private member functions
  void delete_last_detail_impl();
  void on_resize_raw(const boost::function< void()> &);
  void on_key_press_raw(const boost::function< void()> &);
  void on_key_press_event_raw(const boost::function< void(key_event &)> &);
  void on_key_down_raw(const boost::function< void()> &);
  void on_key_down_event_raw(const boost::function< void(key_event &)> &);
  void on_key_up_raw(const boost::function< void()> &);
  void on_key_up_event_raw(const boost::function< void(key_event &)> &);
  void on_left_mouse_down_raw(const boost::function< void()> &);
  void on_left_mouse_down_event_raw(const boost::function< void(mouse_event &)> &);
  void on_left_mouse_up_raw(const boost::function< void()> &);
  void on_left_mouse_up_event_raw(const boost::function< void(mouse_event &)> &);
  void on_right_mouse_down_raw(const boost::function< void()> &);
  void on_right_mouse_down_event_raw(const boost::function< void(mouse_event &)> &);
  void on_right_mouse_up_raw(const boost::function< void()> &);
  void on_right_mouse_up_event_raw(const boost::function< void(mouse_event &)> &);
  void on_middle_mouse_down_raw(const boost::function< void()> &);
  void on_middle_mouse_down_event_raw(const boost::function< void(mouse_event &)> &);
  void on_middle_mouse_up_raw(const boost::function< void()> &);
  void on_middle_mouse_up_event_raw(const boost::function< void(mouse_event &)> &);
  void on_left_mouse_double_click_raw(const boost::function< void()> &);
  void on_left_mouse_double_click_event_raw(const boost::function< void(mouse_event &)> &);
  void on_right_mouse_double_click_raw(const boost::function< void()> &);
  void on_right_mouse_double_click_event_raw(const boost::function< void(mouse_event &)> &);
  void on_middle_mouse_double_click_raw(const boost::function< void()> &);
  void on_middle_mouse_double_click_event_raw(const boost::function< void(mouse_event &)> &);
  void on_mouse_move_raw(const boost::function< void()> &);
  void on_mouse_move_event_raw(const boost::function< void(mouse_event &)> &);
  void on_mouse_drag_raw(const boost::function< void()> &);
  void on_mouse_drag_event_raw(const boost::function< void(mouse_event &)> &);
  void on_mouse_enter_raw(const boost::function< void()> &);
  void on_mouse_enter_event_raw(const boost::function< void(mouse_event &)> &);
  void on_mouse_leave_raw(const boost::function< void()> &);
  void on_mouse_leave_event_raw(const boost::function< void(mouse_event &)> &);
  void on_context_menu_raw(const boost::function< void()> &);
  void on_context_menu_event_raw(const boost::function< void(mouse_event &)> &);
  void on_mouse_wheel_raw(const boost::function< void()> &);
  void on_mouse_wheel_event_raw(const boost::function< void(wheel_event &)> &);
};

Description

See Also:

Graphical_widget (Wikipedia)

See Also:

List of graphical user interface elements (Wikipedia)

widget public construct/copy/destruct

  1. widget();
  2. ~widget();

widget public member functions

  1. ui::layout::item layout();
    Returns layout::item with this widget.
  2. widget & resize(coord_type width, coord_type height);
    Changes widget size to specified values.
  3. coord_type x() const;
    Returns x coordinate relative to the parent widget client area.
  4. coord_type y() const;
    Returns y coordinate relative to the parent widget client area.
  5. coord_type width() const;
    Returns widget width.
  6. coord_type height() const;
    Returns widget height.
  7. point pos() const;
    Returns widget position relative to the parent widget client area.
  8. size dimensions() const;
    Returns widget size.
  9. rect bounds() const;
    Returns widget bounds in client coordinates.
  10. widget & enable(bool do_enable = true);
    Enables widget if do_enable is true, disables otherwise.
  11. widget & disable();
    Disables widget.
  12. bool is_enabled() const;
    Returns true if widget is enabled, false otherwise.
  13. widget & show(bool do_show = true);
    Shows widget if do_show is true, hides otherwise.
  14. widget & hide();
    Hides widget.
  15. bool is_shown() const;
    Returns true if widget is shown on screen, false otherwise.
  16. widget & tooltip(const uistring & text);
    Sets tooltip text.

    See Also:

    Tooltip (Wikipedia)

  17. uistring tooltip() const;
    Returns tooltip text.
  18. widget & font(const ui::font & f);
    Sets font.
  19. ui::font font() const;
    Returns font.
  20. bool native_valid() const noexcept;
    Returns true only if native widget was created.

widget private member functions

  1. void delete_last_detail_impl();
  2. void on_resize_raw(const boost::function< void()> & hanlder);
  3. void on_key_press_raw(const boost::function< void()> & handler);
  4. void on_key_press_event_raw(const boost::function< void(key_event &)> & handler);
  5. void on_key_down_raw(const boost::function< void()> & handler);
  6. void on_key_down_event_raw(const boost::function< void(key_event &)> & handler);
  7. void on_key_up_raw(const boost::function< void()> & handler);
  8. void on_key_up_event_raw(const boost::function< void(key_event &)> & handler);
  9. void on_left_mouse_down_raw(const boost::function< void()> & handler);
  10. void on_left_mouse_down_event_raw(const boost::function< void(mouse_event &)> & handler);
  11. void on_left_mouse_up_raw(const boost::function< void()> & handler);
  12. void on_left_mouse_up_event_raw(const boost::function< void(mouse_event &)> & handler);
  13. void on_right_mouse_down_raw(const boost::function< void()> & handler);
  14. void on_right_mouse_down_event_raw(const boost::function< void(mouse_event &)> & handler);
  15. void on_right_mouse_up_raw(const boost::function< void()> & handler);
  16. void on_right_mouse_up_event_raw(const boost::function< void(mouse_event &)> & handler);
  17. void on_middle_mouse_down_raw(const boost::function< void()> & handler);
  18. void on_middle_mouse_down_event_raw(const boost::function< void(mouse_event &)> & handler);
  19. void on_middle_mouse_up_raw(const boost::function< void()> & handler);
  20. void on_middle_mouse_up_event_raw(const boost::function< void(mouse_event &)> & handler);
  21. void on_left_mouse_double_click_raw(const boost::function< void()> & handler);
  22. void on_left_mouse_double_click_event_raw(const boost::function< void(mouse_event &)> & handler);
  23. void on_right_mouse_double_click_raw(const boost::function< void()> & handler);
  24. void on_right_mouse_double_click_event_raw(const boost::function< void(mouse_event &)> & handler);
  25. void on_middle_mouse_double_click_raw(const boost::function< void()> & handler);
  26. void on_middle_mouse_double_click_event_raw(const boost::function< void(mouse_event &)> & handler);
  27. void on_mouse_move_raw(const boost::function< void()> & handler);
  28. void on_mouse_move_event_raw(const boost::function< void(mouse_event &)> & handler);
  29. void on_mouse_drag_raw(const boost::function< void()> & handler);
  30. void on_mouse_drag_event_raw(const boost::function< void(mouse_event &)> & handler);
  31. void on_mouse_enter_raw(const boost::function< void()> & handler);
  32. void on_mouse_enter_event_raw(const boost::function< void(mouse_event &)> & handler);
  33. void on_mouse_leave_raw(const boost::function< void()> & handler);
  34. void on_mouse_leave_event_raw(const boost::function< void(mouse_event &)> & handler);
  35. void on_context_menu_raw(const boost::function< void()> & handler);
  36. void on_context_menu_event_raw(const boost::function< void(mouse_event &)> & handler);
  37. void on_mouse_wheel_raw(const boost::function< void()> & handler);
  38. void on_mouse_wheel_event_raw(const boost::function< void(wheel_event &)> & handler);

PrevUpHome