LMMS
Loading...
Searching...
No Matches
juce::MouseCursor Class Referencefinal

#include <juce_MouseCursor.h>

Classes

class  PlatformSpecificHandle
class  SharedCursorHandle

Public Types

enum  StandardCursorType {
  ParentCursor = 0 , NoCursor , NormalCursor , WaitCursor ,
  IBeamCursor , CrosshairCursor , CopyingCursor , PointingHandCursor ,
  DraggingHandCursor , LeftRightResizeCursor , UpDownResizeCursor , UpDownLeftRightResizeCursor ,
  TopEdgeResizeCursor , BottomEdgeResizeCursor , LeftEdgeResizeCursor , RightEdgeResizeCursor ,
  TopLeftCornerResizeCursor , TopRightCornerResizeCursor , BottomLeftCornerResizeCursor , BottomRightCornerResizeCursor ,
  NumStandardCursorTypes
}

Public Member Functions

 MouseCursor () noexcept
 MouseCursor (StandardCursorType)
 MouseCursor (const Image &image, int hotSpotX, int hotSpotY)
 MouseCursor (const Image &image, int hotSpotX, int hotSpotY, float scaleFactor)
 MouseCursor (const ScaledImage &image, Point< int > hotSpot)
 MouseCursor (const MouseCursor &)
MouseCursoroperator= (const MouseCursor &)
 ~MouseCursor ()
 MouseCursor (MouseCursor &&) noexcept
MouseCursoroperator= (MouseCursor &&) noexcept
bool operator== (const MouseCursor &) const noexcept
bool operator!= (const MouseCursor &) const noexcept
bool operator== (StandardCursorType type) const noexcept
bool operator!= (StandardCursorType type) const noexcept

Static Public Member Functions

static void showWaitCursor ()
static void hideWaitCursor ()

Private Member Functions

void showInWindow (ComponentPeer *) const
PlatformSpecificHandlegetHandle () const noexcept

Private Attributes

std::shared_ptr< SharedCursorHandlecursorHandle

Friends

class MouseInputSourceInternal

Detailed Description

Represents a mouse cursor image.

This object can either be used to represent one of the standard mouse cursor shapes, or a custom one generated from an image.

@tags{GUI}

Member Enumeration Documentation

◆ StandardCursorType

enum juce::MouseCursor::StandardCursorType

The set of available standard mouse cursors.

Enumerator
ParentCursor 

Indicates that the component's parent's cursor should be used.

NoCursor 

An invisible cursor.

NormalCursor 

The standard arrow cursor.

WaitCursor 

The normal hourglass or spinning-beachball 'busy' cursor.

IBeamCursor 

A vertical I-beam for positioning within text.

CrosshairCursor 

A pair of crosshairs.

CopyingCursor 

The normal arrow cursor, but with a "+" on it to indicate that you're dragging a copy of something.

PointingHandCursor 

A hand with a pointing finger, for clicking on web-links.

DraggingHandCursor 

An open flat hand for dragging heavy objects around.

LeftRightResizeCursor 

An arrow pointing left and right.

UpDownResizeCursor 

an arrow pointing up and down.

UpDownLeftRightResizeCursor 

An arrow pointing up, down, left and right.

TopEdgeResizeCursor 

A platform-specific cursor for resizing the top-edge of a window.

BottomEdgeResizeCursor 

A platform-specific cursor for resizing the bottom-edge of a window.

LeftEdgeResizeCursor 

A platform-specific cursor for resizing the left-edge of a window.

RightEdgeResizeCursor 

A platform-specific cursor for resizing the right-edge of a window.

TopLeftCornerResizeCursor 

A platform-specific cursor for resizing the top-left-corner of a window.

TopRightCornerResizeCursor 

A platform-specific cursor for resizing the top-right-corner of a window.

BottomLeftCornerResizeCursor 

A platform-specific cursor for resizing the bottom-left-corner of a window.

BottomRightCornerResizeCursor 

A platform-specific cursor for resizing the bottom-right-corner of a window.

NumStandardCursorTypes 

Constructor & Destructor Documentation

◆ MouseCursor() [1/7]

juce::MouseCursor::MouseCursor ( )
defaultnoexcept

Creates the standard arrow cursor.

◆ MouseCursor() [2/7]

juce::MouseCursor::MouseCursor ( StandardCursorType type)

Creates one of the standard mouse cursor

◆ MouseCursor() [3/7]

juce::MouseCursor::MouseCursor ( const Image & image,
int hotSpotX,
int hotSpotY )

Creates a custom cursor from an image.

Parameters
imagethe image to use for the cursor - if this is bigger than the system can manage, it might get scaled down first, and might also have to be turned to black-and-white if it can't do colour cursors.
hotSpotXthe x position of the cursor's hotspot within the image
hotSpotYthe y position of the cursor's hotspot within the image

◆ MouseCursor() [4/7]

juce::MouseCursor::MouseCursor ( const Image & image,
int hotSpotX,
int hotSpotY,
float scaleFactor )

Creates a custom cursor from an image.

Parameters
imagethe image to use for the cursor - if this is bigger than the system can manage, it might get scaled down first, and might also have to be turned to black-and-white if it can't do colour cursors.
hotSpotXthe x position of the cursor's hotspot within the image
hotSpotYthe y position of the cursor's hotspot within the image
scaleFactorthe factor by which this image is larger than the target screen size of the cursor.

◆ MouseCursor() [5/7]

juce::MouseCursor::MouseCursor ( const ScaledImage & image,
Point< int > hotSpot )

Creates a custom cursor from an image.

Parameters
imagethe image to use for the cursor - if this is bigger than the system can manage, it might get scaled down first, and might also have to be turned to black-and-white if it can't do colour cursors.
hotSpotthe position of the cursor's hotspot within the image

◆ MouseCursor() [6/7]

juce::MouseCursor::MouseCursor ( const MouseCursor & )
default

Creates a copy of another cursor object.

◆ ~MouseCursor()

juce::MouseCursor::~MouseCursor ( )
default

Destructor.

◆ MouseCursor() [7/7]

juce::MouseCursor::MouseCursor ( MouseCursor && )
defaultnoexcept

Move constructor

Member Function Documentation

◆ getHandle()

MouseCursor::PlatformSpecificHandle * juce::MouseCursor::getHandle ( ) const
privatenoexcept

◆ hideWaitCursor()

void juce::MouseCursor::hideWaitCursor ( )
static

If showWaitCursor has been called, this will return the mouse to its normal state.

This will look at what component is under the mouse, and update the cursor to be the correct one for that component.

See also
showWaitCursor

◆ operator!=() [1/2]

bool juce::MouseCursor::operator!= ( const MouseCursor & other) const
noexcept

Checks whether two mouse cursors are the same.

For custom cursors, two cursors created from the same image won't be recognised as the same, only MouseCursor objects that have been copied from the same object.

◆ operator!=() [2/2]

bool juce::MouseCursor::operator!= ( StandardCursorType type) const
noexcept

Checks whether this cursor is of the standard type mentioned.

◆ operator=() [1/2]

MouseCursor & juce::MouseCursor::operator= ( const MouseCursor & )
default

Copies this cursor from another object.

◆ operator=() [2/2]

MouseCursor & juce::MouseCursor::operator= ( MouseCursor && )
defaultnoexcept

Move assignment operator

◆ operator==() [1/2]

bool juce::MouseCursor::operator== ( const MouseCursor & other) const
noexcept

Checks whether two mouse cursors are the same.

For custom cursors, two cursors created from the same image won't be recognised as the same, only MouseCursor objects that have been copied from the same object.

◆ operator==() [2/2]

bool juce::MouseCursor::operator== ( StandardCursorType type) const
noexcept

Checks whether this cursor is of the standard type mentioned.

◆ showInWindow()

void juce::MouseCursor::showInWindow ( ComponentPeer * peer) const
private

◆ showWaitCursor()

void juce::MouseCursor::showWaitCursor ( )
static

Makes the system show its default 'busy' cursor.

This will turn the system cursor to an hourglass or spinning beachball until the next time the mouse is moved, or hideWaitCursor() is called.

This is handy if the message loop is about to block for a couple of seconds while busy and you want to give the user feedback about this.

◆ MouseInputSourceInternal

friend class MouseInputSourceInternal
friend

Member Data Documentation

◆ cursorHandle

std::shared_ptr<SharedCursorHandle> juce::MouseCursor::cursorHandle
private

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