Table of Contents

 
ChangeCursor
 

Purpose

Changes the cursor that is currently displayed on the screen and returns old cursor or, if a handle is passed as the second parameter than the image of that cursor is changed and the old one returned

 

Protoype

string CCursorMngr::ChangeCursor (string str_new, string str_id = "")
 

Parameters

new the ID of the new cursor object to display or the ID of the image to assign a cursor
id the ID of the cursor to assign the new image
 

Description

This function serves a dual purpose. Depending on the way it's used it will do one of two things. It was designed this way to accomdate two uses of cursor switching. One is to create many cursor objects each with it's own image, and another is to create a few cursor objects with many images each.

Changing the Current Cursor

If you want to change the currently displayed cursor object to a new one, then you only have to pass the ID of the new cursor object in for str_new and ignore the second parameter. The function will then return the ID of the previous cursor object in case you want to restore it later.

Changing a Cursor Image

If you want to assign a new image to a cursor, then you would pass the image ID in for str_new and then pass in the ID of the cursor to assign that image to for str_id. This will change the appearance of the cursor object. The ID of the old image is then returned in case you want to restore it later.

 

Use

CCursorMngr cursor;
// change the current cursor, save the old one
string old_cursor = cursor.ChangeCursor("new_cursor");
// change a cursor image, save the old one
string old_img = cursor. ChangeCursor("new_image", "cursor");
 

Prev: Assign