xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
paint_event_args.h
Go to the documentation of this file.
1 #pragma once
5 
6 #include <xtd/event_args.h>
7 #include <xtd/drawing/graphics.h>
9 #include "../forms_export.h"
10 #include "message.h"
11 
13 namespace xtd {
15  namespace forms {
17  class control;
19 
27  class forms_export_ paint_event_args : public event_args {
28  public:
32  paint_event_args(xtd::forms::control& control, const drawing::rectangle& clip_rectangle) : control_(&control), clip_rectangle_(clip_rectangle) {};
36  paint_event_args(xtd::drawing::graphics& graphics, const drawing::rectangle& clip_rectangle) : graphics_(&graphics), clip_rectangle_(clip_rectangle) {};
40 
43  const drawing::rectangle& clip_rectangle() const {return clip_rectangle_;}
44 
47  drawing::graphics& graphics();
48 
49  private:
50  friend class xtd::forms::control;
51  xtd::forms::control* control_ = nullptr;
52  mutable xtd::drawing::graphics* graphics_ = nullptr;
53  xtd::drawing::rectangle clip_rectangle_;
54  xtd::forms::message message_; // need for xtd::forms::control::on_paint_ xtd::forms::control::on_paint_background to call def_wnd_proc method.
55  };
56  }
57 }
paint_event_args(xtd::drawing::graphics &graphics, const drawing::rectangle &clip_rectangle)
Initializes a new instance of the paint_event_args class with the specified control, clipping rectangle.
Definition: paint_event_args.h:36
Contains xtd::event_args event args.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
const drawing::rectangle & clip_rectangle() const
Gets the rectangle in which to paint.
Definition: paint_event_args.h:43
Contains xtd::forms::message class.
Contains xtd::drawing::rectangle class.
Provides data for the paint event.
Definition: paint_event_args.h:27
Stores a set of four integers that represent the location and size of a rectangle.
Definition: rectangle.h:25
Implements a Windows message.
Definition: message.h:25
Defines the base class for controls, which are components with visual representation.
Definition: control.h:68
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics.h:48
Contains xtd::drawing::graphics class.
paint_event_args(xtd::forms::control &control, const drawing::rectangle &clip_rectangle)
Initializes a new instance of the paint_event_args class with the specified control, clipping rectangle.
Definition: paint_event_args.h:32
The left or right CTRL modifier key.