The MASM Forum

Projects => Rarely Used Projects => Custom Interface Components => Topic started by: fearless on December 30, 2012, 02:25:24 AM

Title: Spinner Control
Post by: fearless on December 30, 2012, 02:25:24 AM
A spinner control. Source code and 2 examples included.

(http://i265.photobucket.com/albums/ii214/nwofearless/Asm%20Projects/Spinner/squares-circle-transparent_zpsc5892910.gif) (http://i265.photobucket.com/albums/ii214/nwofearless/Asm%20Projects/Spinner/Indicator-lite-transparent_zpsfd7d7465.gif)
(http://i265.photobucket.com/albums/ii214/nwofearless/Asm%20Projects/Spinner/SpinnerExample1_zps102d24cb.gif)

Add the following to your project:
Code: [Select]
include Spinner.inc
includelib Spinner.lib

The spinner is comprised of a number of images, that when incremented via a timer, step to the next image. Add each spinner step to the control before enabling it. For example:
Code: [Select]
; Call to create and initialize spinner control
Invoke SpinnerControlCreate, hWin, 125, 86, 32, 32
mov hSpinner1, eax
       
; Add spinner step images to your newly created control
Invoke LoadBitmap, hInstance, 101
mov hBitmap, eax
Invoke SpinnerAddStepImage, hSpinner1, hBitmap
Invoke LoadBitmap, hInstance, 102
mov hBitmap, eax
Invoke SpinnerAddStepImage, hSpinner1, hBitmap
Invoke LoadBitmap, hInstance, 103
mov hBitmap, eax
Invoke SpinnerAddStepImage, hSpinner1, hBitmap
Invoke LoadBitmap, hInstance, 104
mov hBitmap, eax
Invoke SpinnerAddStepImage, hSpinner1, hBitmap
Invoke LoadBitmap, hInstance, 105
mov hBitmap, eax
Invoke SpinnerAddStepImage, hSpinner1, hBitmap
Invoke LoadBitmap, hInstance, 106
mov hBitmap, eax
Invoke SpinnerAddStepImage, hSpinner1, hBitmap
Invoke LoadBitmap, hInstance, 107
mov hBitmap, eax
Invoke SpinnerAddStepImage, hSpinner1, hBitmap
Invoke LoadBitmap, hInstance, 108
mov hBitmap, eax
Invoke SpinnerAddStepImage, hSpinner1, hBitmap

Enable (start & show) or disable (stop & hide) the spinner control with SpinnerEnable or SpinnerDisable.

All spinners where generated from http://www.ajaxload.info, saved as a gif and each frame extracted to a bmp. See that site for more examples of types of spinners that can be generated.
Title: Re: Spinner Control
Post by: six_L on January 03, 2013, 01:44:32 PM
nice interface.
thanks for sharing.
Title: Re: Spinner Control
Post by: guga on August 10, 2014, 12:28:04 PM
Very, very nice :t
Many tks
Title: Re: Spinner Control
Post by: José Roca on October 22, 2014, 06:11:43 AM
Thanks for sharing.
Title: Re: Spinner Control
Post by: jj2007 on October 22, 2014, 08:50:46 AM
Your name rings a bell, José - is that you? (http://www.jose.it-berater.org/gdiplus/iframe/index.htm)
Title: Re: Spinner Control
Post by: dedndave on October 22, 2014, 08:57:52 AM
that's him - a great site to learn from - many great examples   :t
Title: Re: Spinner Control
Post by: Gunther on October 22, 2014, 09:09:48 AM
Your name rings a bell, José - is that you? (http://www.jose.it-berater.org/gdiplus/iframe/index.htm)

Yes he's José Roca from the PowerBasic forum. He's a rock solid coder.

Gunther