- Main Page
- Packages
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# smjg.libs.sdwf.cursor_icon.MouseCursor Class Reference

The smjg.libs.sdwf.cursor_icon.MouseCursor class represents a mouse cursor image. More...

Inheritance diagram for smjg.libs.sdwf.cursor_icon.MouseCursor:

List of all members.

## Public Member Functions
| this (Application app, uint id)
| Constructs a MouseCursor object from a cursor resource.
| this (Application app, string name)
| Constructs a MouseCursor object from a cursor resource.
| this (IDC stockCursor)
| Creates a MouseCursor wrapper around the specified stock cursor.
| this (Bitmap mask, Bitmap colour, int hotspotX, int hotspotY)
| Constructs a cursor from the given bitmaps.
| this (Bitmap mask, Bitmap colour, Point hotspot)
| Constructs a cursor from the given bitmaps.
| this (HCURSOR h, bool autoDelete)
| Constructs a MouseCursor object to wrap the given handle.
void | activate ()
| Makes this cursor active.
| ~this ()
Properties
Point | hotspot ()
| The coordinates of the cursor's hotspot.
override MouseCursor | dup ()
| Creates a copy of the cursor.
override MouseCursor | resize (int width, int height, bool monochrome=false, bool fromResource=true)
| Creates a resized image of the cursor.
override MouseCursor | resize (RectDim dim, bool monochrome=false, bool fromResource=true)
| Creates a resized image of the cursor.
## Protected Member Functions
| this (MouseCursor orig, int width, int height, uint flags)

## Detailed Description

The smjg.libs.sdwf.cursor_icon.MouseCursor class represents a mouse cursor image.

Since:
  0.51

## Constructor & Destructor Documentation

smjg.libs.sdwf.cursor_icon.MouseCursor.this | ( | Application | app,
|  | uint | id |
| ) |  |  |

Constructs a MouseCursor object from a cursor resource.

Parameters:

  | app | application containing the cursor resource.
  | id | numeric ID of the cursor resource.

smjg.libs.sdwf.cursor_icon.MouseCursor.this | ( | Application | app,
|  | string | name |
| ) |  |  |

Constructs a MouseCursor object from a cursor resource.

Parameters:

  | app | application containing the cursor resource.
  | name | name of the cursor resource.

smjg.libs.sdwf.cursor_icon.MouseCursor.this | ( | IDC | stockCursor | ) |

Creates a MouseCursor wrapper around the specified stock cursor.

Parameters:

  | stockCursor | value identifying the stock cursor to be obtained.

Status:
  done

smjg.libs.sdwf.cursor_icon.MouseCursor.this | ( | Bitmap | mask,
|  | Bitmap | colour,
|  | int | hotspotX,
|  | int | hotspotY |
| ) |  |  |

Constructs a cursor from the given bitmaps.

Parameters:

  | mask | the AND bitmask of the cursor. White pixels correspond to transparent pixels in the resulting cursor, and black pixels to opaque ones.
  | colour | the XOR bitmask of the cursor. This is the image of the cursor on a black background. White pixels in this bitmap corresponding to white pixels in `mask` can be used to create inverse-of-background pixels in the cursor.
  | hotspotX | the x-coordinate of the cursor's hotspot.
  | hotspotY | the y-coordinate of the cursor's hotspot.

Precondition:
  `mask` must be a monochrome bitmap.

Status:
  done

smjg.libs.sdwf.cursor_icon.MouseCursor.this | ( | Bitmap | mask,
|  | Bitmap | colour,
|  | Point | hotspot |
| ) |  |  |

Constructs a cursor from the given bitmaps.

Parameters:

  | mask | the AND bitmask of the cursor. White pixels correspond to transparent pixels in the resulting cursor, and black pixels to opaque ones.
  | colour | the XOR bitmask of the cursor. This is the image of the cursor on a black background. White pixels in this bitmap corresponding to white pixels in `mask` can be used to create inverse-of-background pixels in the cursor.
  | hotspot | the coordinates of the cursor's hotspot.

Precondition:
  `mask` must be a monochrome bitmap.

Status:
  done

smjg.libs.sdwf.cursor_icon.MouseCursor.this | ( | HCURSOR | h,
|  | bool | autoDelete |
| ) |  |  |

Constructs a MouseCursor object to wrap the given handle.

Parameters:

  | h | Windows handle of the cursor to be wrapped.
  | autoDelete | whether the Windows handle should be automatically deleted when the SDWF object is garbage collected.

smjg.libs.sdwf.cursor_icon.MouseCursor.this | ( | MouseCursor | orig,
|  | int | width,
|  | int | height,
|  | uint | flags |
| ) |  |  | `[protected]`

smjg.libs.sdwf.cursor_icon.MouseCursor.~this | ( |  | ) |

## Member Function Documentation

void smjg.libs.sdwf.cursor_icon.MouseCursor.activate | ( |  | ) |

Makes this cursor active.

The cursor will be displayed regardless of which window the mouse is within. However, calling this method will have no lasting effect unless mouse input is captured.

Point smjg.libs.sdwf.cursor_icon.MouseCursor.hotspot | ( |  | ) |

The coordinates of the cursor's hotspot.

Reimplemented from smjg.libs.sdwf.cursor_icon.CursorOrIcon.

override MouseCursor smjg.libs.sdwf.cursor_icon.MouseCursor.dup | ( |  | ) | `[virtual]`

Creates a copy of the cursor.

Status:
  test

Implements smjg.libs.sdwf.cursor_icon.CursorOrIcon.

override MouseCursor smjg.libs.sdwf.cursor_icon.MouseCursor.resize | ( | int | width,
|  | int | height,
|  | bool | monochrome = `false`,
|  | bool | fromResource = `true` |
| ) |  |  | `[virtual]`

Creates a resized image of the cursor.

Parameters:

  | width | the new width in pixels.
  | height | the new height in pixels.
  | monochrome | whether to convert the cursor to monochrome.
  | fromResource | whether to reload the cursor from the resource (if applicable) and look for an image of the desired size.

Status:
  test

Implements smjg.libs.sdwf.cursor_icon.CursorOrIcon.

override MouseCursor smjg.libs.sdwf.cursor_icon.MouseCursor.resize | ( | RectDim | dim,
|  | bool | monochrome = `false`,
|  | bool | fromResource = `true` |
| ) |  |  | `[virtual]`

Creates a resized image of the cursor.

Parameters:

  | dim | the new dimensions in pixels.
  | monochrome | whether to convert the cursor to monochrome.
  | fromResource | whether to reload the cursor from the resource (if applicable) and look for an image of the desired size.

Status:
  test

Implements smjg.libs.sdwf.cursor_icon.CursorOrIcon.

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

- cursor_icon.d