×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to use spinner?
3

How to use spinner?

How to use spinner?

(OP)
Hi all... still trying to enhance my application, i have seen some of the sample application done in vfp9 has a spinner? What is the use of spinner? how to use it? Can you please give a simple code and if its not too much to ask with explanation? Thanks and God bless...

RE: How to use spinner?

Hi Mandy,
The spinner control allows users to select numeric values by clicking up or down arrows. You can set the range and the increment in the control.
There are properties in the control to set the high and low values (and these can be done by either keyboard input or "spinner input". These are found in the DATA tab of the control.
Like any other control, give it a name and then you can reference it's value through properties like: MySpinner.Value
That value can be used then as input to other items.

For instance, I use this control on one of my apps for scanning business cards. Some cards have VERY light color inks, so if they don't OCR right I have the option to change the contrast and brightness values of the scan, so that those colors show up better. I change their increment by 50 (with a range of 0 to 1000). That is then fed to variables in the call to my scanning routine (which is a library that I use).

Anything numeric can be made a spinner, and used for that input.

Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCAP, CDCP, CDCS, CDCE, CTDC, CTIA, ATS, ATD

"I try to be nice, but sometimes my mouth doesn't cooperate."

RE: How to use spinner?

Mandy, I'm sure you will have seen spinners in many Windows applications - even if yo don't recognise the term. For a quick example in VFP, go to Tools / Options / View. In the resulting dialogue, you will see two examples, for "Most recently used list" and "List display count". Just experiment with those examples to see how they work (you won't cause any damage anywhere if you do so).

Personally,I don't much like using spinners. I find it easier simply to type a number. But some users will feel differently.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: How to use spinner?

Mike/Mandy,
Mike makes a good point, I'm the same way, BUT... the spinner class allows that too. It's an editable text box if you just put the cursor in the box, and type the range. It still validates the range so if my limit is set to 1000 and I enter 3000 it will provide the response message of "Invalid Data". Not real clear, but it does let the user know if they've entered a number out of range. Of course you could implement your own user message in the LostFocus() event (or VALID() event if you wanted something more clear like:
MESSAGEBOX("The value you've entered is <too high, or too low), please reenter") for example.

So the spinner has the advantage of using different inputs, and might be more user friendly on a touch screen application, but power users might like to tab through fields and enter specific values. But the spinner does provide both choices.

Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCAP, CDCP, CDCS, CDCE, CTDC, CTIA, ATS, ATD

"I try to be nice, but sometimes my mouth doesn't cooperate."

RE: How to use spinner?

Hello Mandy,

I just want to point out the most important properties you will use when you use a spinner:

SpinnerHighValue and SpinnerLowValue determine the range of allowed values. And as Scott pointed out the user can also key in value. Notice the spinner also has a secondary set of range limits, the KeyboardHighValue and KeyBoardLowValue. So they could even differ. Then you also have the Increment. That defaults to 1 so using the up and down arrows on the right side of the spinner you increase or decrease the value by 1, but that can be a higher change, which is obviously useful for larger ranges of allowed values.

You also have some events specific to the spinner control UpClick and DownClick. In them, you could for example also change the Increment after each value change of the spinner. It could be convenient to lower the increment when the value comes closer to the upper or lower range limits and increase it when you're nearer to the middle of the range.

I have to say I didn't make much use of it, but as Scott said its use case might be Windows tablet users that can easier change a value with the up/down buttons than by tapping into the textbox portion and using the touch keyboard to enter a value. You also could use a slider (ActiveX) control with a min max range and a user can slide to the value they want. This would only take up more area on a form for the convenience of more precision of the slider position and thus the value.

Chriss

RE: How to use spinner?

(OP)
Thank you all for answering my question on spinner... It made me think twice wether to use or not... Thank you Scott, Mike and Chriss.... as ive said my application is working completely now... this is all because of you all.... just trying to give some enhancements....

RE: How to use spinner?

Mandy,
Any time. There are many creative usages of objects in VFP that are often overlooked. The spinner in the right instances for specific user interface can be a great tool.
You should see what I do with a simple picture object applied to maps. :)

Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCAP, CDCP, CDCS, CDCE, CTDC, CTIA, ATS, ATD

"I try to be nice, but sometimes my mouth doesn't cooperate."

RE: How to use spinner?

(OP)
Let me see it Scott…

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close