Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Override default hourglass behaviour

Status
Not open for further replies.

Mike Lewis

Programmer
Jan 10, 2003
17,516
Scotland
This is a bit of a long shot, but it's just possible there is a solution to this problem.

I want to be able to override the hourglass mouse pointer during a processor-intensive operation.

As you know, when VFP is running a piece of code that takes more than a second or so, it displays an hourglass. While that code is running, you can't change the MouseIcon or MousePointer properties of any controls. (Or, rather, you can change them, but the hourglass returns almost instantly.)

Normally, that's how it should be. However, suppose the code is running from a form, and the form has a Cancel button. You want to let the user click the button to interrupt the code. That's OK. You can do that with DOEVENTS.

My question is: Is there any way of fixing it so that, when the mouse pointer is over the Cancel button, I can change the pointer to a normal arrow -- to indicate to the user that they are able to click the button? As I said before, changing the MouseIcon or MousePointer is no good, because VFP simply changes it back to the hourglass.

Any suggestions gratefully received?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I cant do it either.
A suggestion: how about a prompt when the processing starts. i.e.
*** Processing start button click()
Wait "Press Cancel to stop processing" Window Nowait
thisform.command2.BackColor = RGB(255,0,0)
thisform.command2.SetFocus()
For x = 1 To 10000000
@10,20 Say Transform(x)
Endfor
Wait Clear

****Cancel button click()
this.resettodefault("Backcolor")
 
Imaginecorp,

Thanks for the suggestion. I'm willing to try it, but I don't think it will quite do it for me.

In my opinion, adding the wait window won't make it more intuitive for the user. After all, I have a button with the word Cancel on it. If the user doesn't understand that clicking on the button will cancel the process, I'm not convinced a wait window will add to their knoweldge.

For the same reason, I'm not convinced that changing the button's colour will help.

I think my form is as intuitive and obvious as it's going to be. I just need to get rid of that darned hourglass while the mouse is over the Cancel button.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Dont know if you can; unless it can be done through Windows... sorry nothing else come to mind...
 
On another forum I found the following answer: I can tell you this because we have programmed Pointer functions in FOCUS.FLL (in C, and valid at the level of an application). I remember that we were stunned because our code didn't appear to work in Visual FoxPro whereas in pure C it did the trick. We found out that as soon as you move the pointer Visual FoxPro is taking full control of it disregarding the changes you brought to it.

I simply relate our experience


So I assume you can not change this behavior.
 
Mike; I understand you do not want to diplay a message, nor change the color of the Cancel button...makes sense. Here is a scenerio:
In our apps, we decided we would enable hot tracking for our command buttons. This displays only the caption text when not selected, once selected or in focus() the button shape is displayed.
Try it you may like the look. Enable HotTracking for your buttons class in Special Effects.
Now in the click of the processing button set the focus to the Cancel button. This will draw the shape for the cancel button and this lets the user know that Cancel is an option. I am sure you get the idea...
 
Imaginecorp,

That's a good suggestion. Thanks. In fact, I already have hot tracking enabled by default, but the user has an option to switch it off (I gave them the option because a few users disliked hot tracking). But I like your idea of giving the Cancel button focus during the processing.

That said, I still feel that the presence of the hourglass is sending the wrong signal to the user. But it looks like I'll have to live with it.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top