Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Friends
IlvCursor Class Reference

Cursor class. More...

#include <ilviews/base/resource.h>

Inheritance diagram for IlvCursor:
IlvResource

Public Member Functions

 IlvCursor (IlvDisplay *display, IlvPos hotX, IlvPos hotY, const char *name, IlvBitmap *image, IlvBitmap *mask)
 Constructor. More...
 
IlBoolean isBad () const
 Checks the validity of that IlvCursor. More...
 
- Public Member Functions inherited from IlvResource
IlvDisplaygetDisplay () const
 Gets the IlvDisplay instance. More...
 
const char * getName () const
 Gets the resource name. More...
 
void lock ()
 Locks the resource. More...
 
virtual void setName (const char *name)
 Sets the name of the resource. More...
 
virtual void unLock ()
 Unlocks the resource. More...
 

Friends

class IlvDisplay
 

Detailed Description

Cursor class.

Library: xviews or winviews or mviews (mutually exclusive)

A Rogue Wave Views cursor is an icon appearing on the screen and following mouse movement.


- Cursor resources -

The IlvDisplay::getCursor() member function returns a previously-defined cursor. The IlvDisplay::defaultCursor() member function returns a predefined cursor.

You can access predefined cursors by their name. Once a new IlvCursor has a name, it can be identified by the display.


- Predefined cursors and their names -

See also
IlvAbstractView::getCursor(), IlvAbstractView::setCursor(), IlvDisplay::getCursor().

Constructor & Destructor Documentation

◆ IlvCursor()

IlvCursor::IlvCursor ( IlvDisplay display,
IlvPos  hotX,
IlvPos  hotY,
const char *  name,
IlvBitmap image,
IlvBitmap mask 
)

Constructor.

Initializes a new IlvCursor with a given shape. The shape of the cursor is defined by two bitmaps that must be monochrome, and have the same size: the image bitmap, that defines the shape of the new cursor, and mask that indicates, by setting a pixel to 0, that the image should be transparent at this point, or opaque if the mask pixel is set to 1.

Parameters
displayThe display for which this cursor was created.
hotXThe x coordinate, relative to the upper-left corner of this cursor, that indicates the real location of the pointing device (the hot spot).
hotYThe x coordinate, relative to the upper-left corner of this cursor, that indicates the real location of the pointing device (the hot spot).
nameThe name of this cursor. This string is used by IlvDisplay::getCursor() to find this cursor. This string is copied.
imageThe image bitmap that defines this cursor.
maskThe mask bitmap that defines this cursor.
See also
IlvDisplay::getCursor().

Member Function Documentation

◆ isBad()

IlBoolean IlvCursor::isBad ( ) const

Checks the validity of that IlvCursor.

This method should be called before any other, right after the cursor was created, to make sure it is valid.

Returns
IlFalse if the cursor is valid, and IlTrue if it is not (usually because the parameters provided to the constructor were not valid). In the latter case, simply delete this IlvCursor without using it any further.