14#include "../forms_export.h"
32 using button_renderer = xtd::delegate<void(
xtd::drawing::graphics,
const xtd::drawing::rectangle&,
const xtd::ustring&,
const xtd::drawing::font&,
xtd::forms::text_format_flags,
const xtd::drawing::image&,
const xtd::drawing::rectangle&,
bool focused,
xtd::forms::visual_styles::push_button_state,
const std::optional<xtd::drawing::color>&,
const std::optional<xtd::drawing::color>&)>;
33 using check_box_renderer = xtd::delegate<void(
xtd::drawing::graphics,
const xtd::drawing::rectangle&,
const xtd::ustring&,
const xtd::drawing::font&,
xtd::forms::text_format_flags,
const xtd::drawing::image&,
const xtd::drawing::rectangle&,
bool focused,
xtd::forms::visual_styles::check_box_state,
const std::optional<xtd::drawing::color>&,
const std::optional<xtd::drawing::color>&)>;
34 using radio_button_renderer = xtd::delegate<void(
xtd::drawing::graphics,
const xtd::drawing::rectangle&,
const xtd::ustring&,
const xtd::drawing::font&,
xtd::forms::text_format_flags,
const xtd::drawing::image&,
const xtd::drawing::rectangle&,
bool focused,
xtd::forms::visual_styles::radio_button_state,
const std::optional<xtd::drawing::color>&,
const std::optional<xtd::drawing::color>&)>;
41 bool operator==(
const renderer& value)
const {
return name_ == value.name_;}
42 bool operator!=(
const renderer& value)
const {
return !operator==(value);}
52 button_renderer button_render()
const {
return button_renderer_;}
53 void button_render(button_renderer button_renderer) {button_renderer_ = button_renderer;}
55 check_box_renderer check_box_render()
const {
return check_box_renderer_;}
56 void check_box_render(check_box_renderer check_box_renderer) {check_box_renderer_ = check_box_renderer;}
58 radio_button_renderer radio_button_render()
const {
return radio_button_renderer_;}
59 void radio_button_render(radio_button_renderer radio_button_renderer) {radio_button_renderer_ = radio_button_renderer;}
61 void draw_button(
xtd::drawing::graphics g,
const xtd::drawing::rectangle& bounds,
const xtd::ustring& text,
const xtd::drawing::font& font,
xtd::forms::text_format_flags flags,
const xtd::drawing::image& image,
const xtd::drawing::rectangle& image_bounds,
bool focused,
xtd::forms::visual_styles::push_button_state state,
const std::optional<xtd::drawing::color>& back_color,
const std::optional<xtd::drawing::color>& fore_color) {button_renderer_(
g, bounds, text, font, flags, image, image_bounds, focused, state, back_color, fore_color);}
62 void draw_check_box(
xtd::drawing::graphics g,
const xtd::drawing::rectangle& bounds,
const xtd::ustring& text,
const xtd::drawing::font& font,
xtd::forms::text_format_flags flags,
const xtd::drawing::image& image,
const xtd::drawing::rectangle& image_bounds,
bool focused,
xtd::forms::visual_styles::check_box_state state,
const std::optional<xtd::drawing::color>& back_color,
const std::optional<xtd::drawing::color>& fore_color) {check_box_renderer_(
g, bounds, text, font, flags, image, image_bounds, focused, state, back_color, fore_color);}
63 void draw_radio_button(
xtd::drawing::graphics g,
const xtd::drawing::rectangle& bounds,
const xtd::ustring& text,
const xtd::drawing::font& font,
xtd::forms::text_format_flags flags,
const xtd::drawing::image& image,
const xtd::drawing::rectangle& image_bounds,
bool focused,
xtd::forms::visual_styles::radio_button_state state,
const std::optional<xtd::drawing::color>& back_color,
const std::optional<xtd::drawing::color>& fore_color) {radio_button_renderer_(
g, bounds, text, font, flags, image, image_bounds, focused, state, back_color, fore_color);}
66 if (!name_.empty())
return xtd::ustring::format(
"{}, name: {}", ustring::full_class_name(*
this), name_);
75 static void default_button_renderer(
xtd::drawing::graphics g,
const xtd::drawing::rectangle& bounds,
const xtd::ustring& text,
const xtd::drawing::font& font,
xtd::forms::text_format_flags flags,
const xtd::drawing::image& image,
const xtd::drawing::rectangle& image_bounds,
bool focused,
xtd::forms::visual_styles::push_button_state state,
const std::optional<xtd::drawing::color>& back_color,
const std::optional<xtd::drawing::color>& fore_color);
76 static void default_check_box_renderer(
xtd::drawing::graphics g,
const xtd::drawing::rectangle& bounds,
const xtd::ustring& text,
const xtd::drawing::font& font,
xtd::forms::text_format_flags flags,
const xtd::drawing::image& image,
const xtd::drawing::rectangle& image_bounds,
bool focused,
xtd::forms::visual_styles::check_box_state state,
const std::optional<xtd::drawing::color>& back_color,
const std::optional<xtd::drawing::color>& fore_color);
77 static void default_radio_button_renderer(
xtd::drawing::graphics g,
const xtd::drawing::rectangle& bounds,
const xtd::ustring& text,
const xtd::drawing::font& font,
xtd::forms::text_format_flags flags,
const xtd::drawing::image& image,
const xtd::drawing::rectangle& image_bounds,
bool focused,
xtd::forms::visual_styles::radio_button_state state,
const std::optional<xtd::drawing::color>& back_color,
const std::optional<xtd::drawing::color>& fore_color);
Contains xtd::forms::visual_styles::check_box_state enum class.
Defines a particular format for text, including font face, size, and style attributes....
Definition: font.h:39
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics.h:48
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition: image.h:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition: rectangle.h:25
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition: object.h:26
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
static ustring full_class_name()
Gets the fully qualified class name of the objec_t, including the namespace of the objec_t.
Definition: ustring.h:427
Contains xtd::drawing::color class.
Contains xtd::delegate delegate.
Contains xtd::drawing::font class.
Contains xtd::drawing::graphics class.
#define forms_export_
Define shared library export.
Definition: forms_export.h:13
Contains xtd::drawing::image class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::object class.
Contains xtd::drawing::rectangle class.
Contains xtd::forms::text_format_flags enum class.
Contains xtd::ustring class.