xtd 0.2.0
font_picker.h
Go to the documentation of this file.
1 #pragma once
5 #include "control.h"
7 
9 namespace xtd {
11  namespace forms {
28  class forms_export_ font_picker : public control {
29  struct data;
30 
31  public:
33 
36  font_picker();
38 
40 
45  virtual const drawing::color& color() const noexcept;
50  virtual font_picker& color(const drawing::color& color);
51 
54  drawing::font font() const noexcept override;
58  control& font(const drawing::font& font) override;
60 
62 
64  using control::create;
72  static font_picker create(const drawing::font& font, const xtd::drawing::color& color, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
81  static font_picker create(const control& parent, const drawing::font& font, const xtd::drawing::color& color, const drawing::point& location = {-1, -1}, const drawing::size& size = {-1, -1}, const xtd::ustring& name = xtd::ustring::empty_string);
83 
85 
91 
92  protected:
94 
96  forms::create_params create_params() const noexcept override;
98 
100 
104  void on_font_picker_changed(const font_picker_event_args& e);
105 
106  void on_handle_created(const event_args& e) override;
107 
111  void wnd_proc(message& message) override;
113 
114  private:
115  void wm_command_control(message& message);
116  void wm_command_control_selchange(message& message);
117 
118  std::shared_ptr<data> data_;
119  };
120  }
121 }
Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.
Definition: font.h:45
event< font_picker, font_picker_event_handler > font_picker_changed
Occurs when the value of the font property changes.
Definition: font_picker.h:89
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
Contains xtd::forms::font_picker_event_handler event handler.
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:31
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Encapsulates the information needed when creating a control.
Definition: create_params.h:27
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
Represents a picker control that displays available fonts along with controls.
Definition: font_picker.h:28
static control create(const drawing::point &location={-1, -1}, const drawing::size &size={-1, -1}, const xtd::ustring &name=xtd::ustring::empty_string)
A factory to create a specified control with specified location, size, and name.
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:45
Represents an event.
Definition: event.h:21
Implements a Windows message.
Definition: message.h:26
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
Contains xtd::forms::control control.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
static const ustring empty_string
Represents the empty string.
Definition: ustring.h:53
Specifies that both the x and y coordinates of the control are defined.
Provides data for the xtd::forms::font_picker::font_picker_changed events.
Definition: font_picker_event_args.h:26
size_t size
Represents a size of any object in bytes.
Definition: types.h:195