xtd 0.2.0
Loading...
Searching...
No Matches
cursor.h
Go to the documentation of this file.
1
4#pragma once
5#include "../forms_export.h"
6#include <xtd/drawing/bitmap>
7#include <xtd/drawing/point>
8#include <xtd/drawing/size>
9#include <xtd/any>
10#include <xtd/iequatable>
11#include <xtd/object>
12#include <cstdint>
13#include <memory>
14
16namespace xtd {
18 namespace forms {
20 class cursors;
22
38 class forms_export_ cursor : public object, public xtd::iequatable<cursor> {
39 struct data;
40
41 public:
43
46 static cursor none;
48
50
57 explicit cursor(intptr handle);
59
61 cursor(const cursor& value) = default;
62 cursor& operator =(const cursor& value) = default;
63 ~cursor();
65
67
72 intptr handle() const noexcept;
73
77 drawing::point hot_spot() const noexcept;
78
81 drawing::size size() const noexcept;
82
86 std::any tag() const noexcept;
87
91 void tag(std::any tag);
93
95
100 static xtd::forms::cursor current();
104 static void current(const xtd::forms::cursor& cursor);
105
109 static drawing::point position();
113 static void position(const drawing::point& position);
115
117
122 intptr copy_handle() const;
123
124 bool equals(const cursor& value) const noexcept override;
125
128 xtd::ustring to_string() const noexcept override;
130
132
138 static cursor from_bitmap(const xtd::drawing::bitmap& bitmap, const xtd::drawing::point& hot_spot);
143 static cursor from_bitmap(const xtd::drawing::bitmap& bitmap);
144
147 static void hide();
148
151 static void show();
153
154 private:
155 friend class xtd::forms::cursors;
156 cursor(const xtd::drawing::bitmap& bitmap, const xtd::drawing::point& hot_spot);
157 cursor(intptr handle, bool destroyable, const xtd::ustring& name);
158
159 std::shared_ptr<data> data_;
160 };
161 }
162}
Represents the image used to paint the mouse pointer.
Definition cursor.h:38
cursor()
Initializes a new instance of the cursor class.
intptr handle() const noexcept
Gets the handle of the cursor.
cursor(intptr handle)
Initializes a new instance of the Cursor class from the specified Windows handle.
static cursor none
Represent none cursor.
Definition cursor.h:46
Provides a collection of xtd::forms::cursor objects for use by a Windows Forms application.
Definition cursors.h:23
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:18
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define forms_export_
Define shared library export.
Definition forms_export.h:13
size_t size
Represents a size of any object in bytes.
Definition types.h:197
intmax_t intptr
Represent a pointer or a handle.
Definition types.h:153
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10