xtd - Reference Guide  0.1.0
Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.
xtd::forms::cursor Class Reference

Represents the image used to paint the mouse pointer. More...

#include <cursor.h>

Public Member Functions

 cursor ()
 Initializes a new instance of the Cursor class. More...
 
 cursor (intptr_t handle)
 Initializes a new instance of the Cursor class from the specified Windows handle. More...
 
intptr_t copy_handle () const
 
intptr_t handle () const
 Gets the handle of the cursor. More...
 
drawing::point hot_spot () const
 Gets the cursor hot spot. More...
 
drawing::size size () const
 Gets the size of the cursor object. More...
 
std::any tag () const
 Gets the object that contains data about the control. More...
 
void tag (std::any tag)
 Sets the object that contains data about the control. More...
 
std::string to_string () const
 

Static Public Member Functions

static xtd::forms::cursor current ()
 Gets a cursor object that represents the mouse cursor. More...
 
static void current (const xtd::forms::cursor &cursor)
 Sets a cursor object that represents the mouse cursor. More...
 
static cursor from_bitmap (const xtd::drawing::bitmap &bitmap, const xtd::drawing::point &hot_spot)
 
static cursor from_bitmap (const xtd::drawing::bitmap &bitmap)
 
static void hide ()
 Hides the cursor. More...
 
static drawing::point position ()
 Gets the cursor's position. More...
 
static void position (const drawing::point &position)
 Sets the cursor's position. More...
 
static void show ()
 Displays the cursor. More...
 

Static Public Attributes

static cursor none
 

Friends

class cursors
 

Detailed Description

Represents the image used to paint the mouse pointer.

Remarks
A cursor is a small picture whose location on the screen is controlled by a pointing device, such as a mouse, pen, or trackball. When the user moves the pointing device, the operating system moves the cursor accordingly.
Different cursor shapes are used to inform the user what operation the mouse will have. For example, when editing or selecting text, a cursors::ibeam cursor is typically displayed. A wait cursor is commonly used to inform the user that a process is currently running. Examples of processes you might have the user wait for are opening a file, saving a file, or filling a control such as a data_grid, list_box or tree_view with a large amount of data.
All controls that derive from the Control class have a Cursor property. To change the cursor displayed by the mouse pointer when it is within the bounds of the control, assign a Cursor to the Cursor property of the control. Alternatively, you can display cursors at the application level by assigning a Cursor to the Current property. For example, if the purpose of your application is to edit a text file, you might set the Current property to Cursors.WaitCursor to display a wait cursor over the application while the file loads or saves to prevent any mouse events from being processed. When the process is complete, set the Current property to Cursors.Default for the application to display the appropriate cursor over each control type.

The documentation for this class was generated from the following file: