Author Topic: Spinner Control  (Read 11361 times)

fearless

  • Member
  • ****
  • Posts: 564
    • Github
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

ASUS Crosshair 8 Hero, AMD 5950X, 32GB, MSI 5700XT, NZXT Kraken Z73, Seasonic 1000W PSU

Github Twitter Mastodon Gitbook

six_L

  • Member
  • ***
  • Posts: 300
Re: Spinner Control
« Reply #1 on: January 03, 2013, 01:44:32 PM »
nice interface.
thanks for sharing.
Say you, Say me, Say the codes together for ever.

guga

  • Member
  • *****
  • Posts: 1451
  • 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

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

jj2007

  • Member
  • *****
  • Posts: 13341
  • Assembly 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: 8828
  • 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: 4119
  • 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
You have to know the facts before you can distort them.