Author Topic: Spinner Control  (Read 4768 times)

fearless

  • Member
  • ***
  • Posts: 271
    • LetTheLightIn
Spinner Control
« on: December 30, 2012, 02:25:24 AM »
A spinner control. Source code and 2 examples included.




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.
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI, Samsung 256GB + 1TB SSD, WD Black 2TB x2 + 4TB HDD, Asus 27" LCD

www.LetTheLight.in  My Github

six_L

  • Member
  • **
  • Posts: 76
Re: Spinner Control
« Reply #1 on: January 03, 2013, 01:44:32 PM »
nice interface.
thanks for sharing.

guga

  • Member
  • ****
  • Posts: 826
  • Assembly is a state of art.
    • RosAsm
Re: Spinner Control
« Reply #2 on: August 10, 2014, 12:28:04 PM »
Very, very nice :t
Many tks
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

José Roca

  • Regular Member
  • *
  • Posts: 2
Re: Spinner Control
« Reply #3 on: October 22, 2014, 06:11:43 AM »
Thanks for sharing.

jj2007

  • Member
  • *****
  • Posts: 7444
  • Assembler is fun ;-)
    • MasmBasic
Re: Spinner Control
« Reply #4 on: October 22, 2014, 08:50:46 AM »
Your name rings a bell, José - is that you?

dedndave

  • Member
  • *****
  • Posts: 8732
  • Still using Abacus 2.0
    • DednDave
Re: Spinner Control
« Reply #5 on: October 22, 2014, 08:57:52 AM »
that's him - a great site to learn from - many great examples   :t

Gunther

  • Member
  • *****
  • Posts: 3515
  • Forgive your enemies, but never forget their names
Re: Spinner Control
« Reply #6 on: October 22, 2014, 09:09:48 AM »
Your name rings a bell, José - is that you?

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

Gunther
Get your facts first, and then you can distort them.