RdiaCreate Function

Microchip Graphics Library

Microchip Graphics Library
RdiaCreate Function
C
ROUNDDIAL * RdiaCreate(
    WORD ID, 
    SHORT x, 
    SHORT y, 
    SHORT radius, 
    WORD state, 
    SHORT res, 
    SHORT value, 
    SHORT max, 
    GOL_SCHEME * pScheme
);
Overview

This function creates a ROUNDDIAL object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters 
Description 
WORD ID 
Unique user defined ID for the object instance. 
SHORT x 
Location of the center of the dial in the x coordinate. 
SHORT y 
Location of the center of the dial in the y coordinate. 
SHORT radius 
Defines the radius of the dial. 
WORD state 
Sets the initial state of the object. 
SHORT res 
Sets the resolution of the dial when rotating clockwise or counter clockwise. 
SHORT value 
Sets the initial value of the dial. 
SHORT max 
Sets the maximum value of the dial. 
GOL_SCHEME * pScheme 
Pointer to the style scheme used. 
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
GOL_SCHEME *pScheme;
ROUNDDIAL *pDial;
WORD state;

    pScheme = GOLCreateScheme();
    state = RDIA_DRAW;

    // creates a dial at (50,50) x,y location, with an initial value
    // of 50, a resolution of 2 and maximum value of 100.
    pDial = RdiaCreate(1,50,50,25,118,0, state, 2, 50, 100, pScheme);
    // check if dial was created
    if (pDial == NULL)      
       return 0;

    return 1;
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved