xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
font_picker.h
Go to the documentation of this file.
1 #pragma once
5 #include "control.h"
6 
8 namespace xtd {
10  namespace forms {
21  public:
24 
28  const drawing::color& color() const {return color_;}
33  control& color(const drawing::color& color);
34 
37  drawing::font font() const override {return font_;}
41  control& font(const drawing::font& font) override;
42 
43  drawing::size default_size() const override {return {100, 25};}
44 
48 
49  protected:
50  forms::create_params create_params() const override;
51 
54  void on_font_changed(const event_args& e) override;
55 
56  void on_handle_created(const event_args& e) override;
57 
61  void wnd_proc(message& message) override;
62 
63  private:
64  void wm_click(message& message);
65  drawing::color color_;
66  drawing::font font_ = default_font();
67  };
68  }
69 }
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:39
Defines a particular format for text, including font face, size, and style attributes....
Definition: font.h:39
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
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 event.
Definition: event.h:21
Defines the base class for controls, which are components with visual representation.
Definition: control.h:67
Represents a picker control that displays available fonts along with controls.
Definition: font_picker.h:20
drawing::size default_size() const override
Gets the default size of the control.
Definition: font_picker.h:43
control & color(const drawing::color &color)
Sets the color selected by the user.
forms::create_params create_params() const override
Gets the required creation parameters when the control handle is created.
void on_font_changed(const event_args &e) override
Raises the font_changed event.
drawing::font font() const override
Gets the selected font.
Definition: font_picker.h:37
void on_handle_created(const event_args &e) override
Raises the control::handle_created event.
const drawing::color & color() const
Gets the color selected by the user.
Definition: font_picker.h:28
void wnd_proc(message &message) override
Processes Windows messages.
control & font(const drawing::font &font) override
Sets the selected font.
font_picker()
Initializes a new instance of the font_picker class.
Implements a Windows message.
Definition: message.h:25
Contains xtd::forms::control control.
event< font_picker, event_handler > font_changed
Occurs when the value of the font property changes.
Definition: font_picker.h:47
#define forms_export_
Define shared library export.
Definition: forms_export.h:13
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17