Skip to content

ModernUI_Spinner Control

mrfearless edited this page Jun 29, 2019 · 1 revision

ModernUI_Spinner Functions

MUISpinnerRegister

Description: Registers the ModernUI_Spinner class, which allows the control to be created via dialog resources or via CreateWindowEx and specifying the classname ModernUI_Spinner. If using the RadASM custom class control instead of a the ModernUI RadASM Design Time Controls specify ModernUI_Spinner as the classname.

Parameters: None

MUISpinnerCreate

Description: Creates a ModernUI_Spinner control. Returns in eax the handle of the newly created control or NULL.

Parameters: hWndParent, xpos, ypos, qwWidth, qwHeight, qwResourceID, qwStyle

MUISpinnerSetProperty

Description: Set a ModernUI_Spinner property with a value, which is stored in the external properties structure. Properties are defined as equates and are actually offsets into the memory location used to store the properties.

Parameters: hModernUI_Spinner, qwProperty, qwPropertyValue

MUISpinnerGetProperty

Description: Get a ModernUI_Spinner property from the external properties structure. Properties are defined as equates and are actually offsets into the memory location used to store the properties.

Parameters: hModernUI_Spinner, qwProperty

MUISpinnerAddFrame

Description: Add an image handle (bitmap, icon or png) as a spinner frame image.

Parameters: hModernUI_Spinner, qwImageType, hImage

MUISpinnerAddFrames

Description: Add an array of image handles (bitmap, icon or png) as spinner frame images.

Parameters: hModernUI_Spinner, qwCount, qwImageType, lpArrayImageHandles

MUISpinnerLoadFrame

Description: Load an image resource id (bitmap, icon or png) as a spinner frame image.

Parameters: hModernUI_Spinner, qwImageType, idResImage

MUISpinnerLoadFrames

Description: Load an array of image resource id (bitmap, icon or png) as spinner frame images.

Parameters: hModernUI_Spinner, qwCount, qwImageType, lpArrayResourceIDs

MUISpinnerAddImage

Description: Create a series of spinner frame images from an individual png image handle.

Parameters: hModernUI_Spinner, hImage, qwNoFramesToCreate, bReverse

MUISpinnerLoadImage

Description: Create a series of spinner frame images from an individual png resource id.

Parameters: hModernUI_Spinner, idResImage, qwNoFramesToCreate, bReverse

MUISpinnerAddSpriteSheet

Description: Create a series of spinner frame images from a sprite sheet image handle.

Parameters: hModernUI_Spinner, qwSpriteCount, qwImageType, hImageSpriteSheet, bReverse

MUISpinnerLoadSpriteSheet

Description: Create a series of spinner frame images from a sprite sheet loaded from a resource id.

Parameters: hModernUI_Spinner, qwSpriteCount, qwImageType, idResSpriteSheet, bReverse

MUISpinnerEnable

Description: Enables and shows the ModernUI_Spinner control.

Parameters: hModernUI_Spinner

MUISpinnerDisable

Description: Disables and hides the ModernUI_Spinner control.

Parameters: hModernUI_Spinner

MUISpinnerReset

Description: Resets the ModernUI_Spinner control current frame.

Parameters: hModernUI_Spinner

MUISpinnerPause

Description: Disables but does not hide the ModernUI_Spinner control. Resume the control with MUISpinnerResume.

Parameters: hModernUI_Spinner

MUISpinnerResume

Description: Resumes the ModernUI_Spinner control that was paused with MUISpinnerPause.

Parameters: hModernUI_Spinner

ModernUI_Spinner Styles

The ModernUI_Spinner control supports a number of style flags (defined in the .inc include file) that allow you to customize the behavior of the control.

  • MUISPNS_HAND - Show a hand instead of an arrow when mouse over control.

ModernUI_Spinner Properties

  • @SpinnerBackColor - RGBCOLOR for spinner background
  • @SpinnerSpeed - QWORD milliseconds until next spin stage or rotation occurs
  • @SpinnerDllInstance - QWORD reserved for future use

ModernUI_Spinner Frames

There are a number of ways of adding image frames to the ModernUI_Spinner control.

The most basic level is to add individual images to construct the spinner animation. This can be done with the MUISpinnerAddFrame or MUISpinnerLoadFrame - using an image handle that is already loaded or using a resource id of an image.

For images that are circular, it can be more convenient to use the MUISpinnerAddImage or MUISpinnerLoadImage functions, as these only require one image. The image is copied a number of times into frame images - as specified by the dwNoFramesToCreate parameter. Each new frame image is incrementally rotated - based on the angle calculated for each new frame image. The bReverse parameter if set to TRUE will set the spinner animation to counter-clockwise. Note: the MUISpinnerAddImage or MUISpinnerLoadImage functions only work with png images or png's stored as RCDATA resources.

For more complicated spinners, or spinners that are not circular in nature, the MUISpinnerAddSpriteSheet and MUISpinnerLoadSpriteSheet functions are provided. These allow you to provide a long (wide) image (bitmap, icon or png) handle (or resource id) that contains all the spinner frames in the one image. The image frames are extracted out of this image. The amount of frame images in the spritesheet is passed via the dwSpriteCount parameter.