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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Class and Mouse Control 1

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,828
JP
I have a Page Frame class in my form, and when I click on the tabs, the Mouse icon changes to an hour glass, but if you move the mouse even a pixel, it goes back to a pointer... how can I keep the mouse pointer from changing to an hourglass?



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Scott,

This is not normal behaviour. I suspect you have some code somewhere that is slowing down the activation of a page. Check the code in the page's Activate event, and also any other code that might be triggered at that point.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,
There is code in the Acitvate Event, as I set the "Active Table" and "Bold" characteristics, but the hour glass appears litterally the instant I click the button... not something I would have thought would trigger a mouse icon change. Is there any way to stop it?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Scott :

Could you use class brower to open the form and the pageframe class to go through the codes....

Smarty
 
Smarty,
I'm sure I could... and look for what exactly???


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Dear Scott :

When I have a programming problem stucking there, here is a nice place to get some new ideas so that we can base on those input to think about a breakthrough solution to work on top of it.

Looking into the code might provide an incite, or at least another perspective to the same problem, to work on.

This is my believe.

Best regards,
Smarty
 

Scott,

Let's look at this from the other direction. If you ignore the hourglass, do you actually get to the page whose tab you have clicked on? If so, does that happen straight away, or is there a delay? How long a delay? A few seconds? A minute?

Also, is the debugger always open when you test this? If so, try closing it and see if that makes a difference. The reason I mention it is that the debugger is notorious for slowing down certain events, especially those that involve changing focus or repainting a form.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,
The debugger is not open during this time. The pages are instant. My big concern is my users will be confused by the hourglass, and sit without trying to do anything if they think they have to wait for it... its just behavior that is bad interface, in my view... I have noticed this from the instant that I put the pageframe on, even when the pages were empty. They switch instantly... but I'm left with this hourglass...



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Apparently, I'm going to have to dig deeper into this... I just did a test on a different machine with a simple form, using 2 page frame classes: the Fox base class, and an instance of my subclass, with 2 pages each, and no other items, just clicking between pages, and neither exhibitied the "Hourglass" behavior. I understand the "Automatic" nature of this mouse shape firing when the system is "busy", but I'm not sure what is taking place, when my other form's pages are loading instantly on a 1.8Ghz P4 with 768mb memory... Not the fastest machine on the planet, for certain, but MORE than fast enough to deal with a page change and still feel "immediate."

Hmmmmmmmm..... curious indeed.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Scott,

It sounds very peculiar. The only thing I can suggest now is that you create a new version of the form (the one that is showing the hourglass). Start with an empty form, then gradually copy the controls and codes from the original form until the behaviour comes back.

I agree that it's a bad interface and one that you don't want your users to see.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,
Well the strange thing here is, that it is a brand new form... the ONLY control on it was the page class... The pages themselves are all currently empty. I have since placed a couple of fields on the form in one of the pages, but this behaviour started immediatly... I'm a bit bumbed out by it actually, and as I mentioned, it happens the second you press the mouse button. Guess I'll have to just slowly go through it... I have not expierienced it using this class in another form from my older vfp7&8 development which was where I developed the class back about 4 years ago now...
Thanks for your suggestions. If anything else comes to mind, feel free to volunteer it!



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Thought about starting a new thread but this is still the same issue...

Okay, I've tracked down that I have a custom method on the PageFrame called "ActiveTab". It is called from the Activate event of each page. The following code:

ThisForm.LockScreen = .T.
ThisForm.Refresh()
ThisForm.LockScreen = .F.

is the last part of the code. I have discovered that if I take this out, the hour-glass mouse goes away. BUT, then my objects don't appear in the proper editing state (should be disabled if not editing, and when clicking the tab, the initial state can not be editing...) If I put the code in to the Activiate event for the page, I get the hourglass... I can't seem to find another event that takes place after the activate that doesn't cause this behavior... is there a better way?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Scott,

The way I handle this is to put THIS.Refresh in the Activate event of every page. Note that's THIS.Refresh, not THISFORM.Refresh, and I don't have the Lockscreen.

Refreshing just the individual page should be faster than refreshing the form, especially if you've got some time-consuming code in the form's Refresh method.

Apart from that, I still can't see any reason for the hourglass.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,
Well, looks like we have finally cracked this one... after playing around with the Page Class quite a lot, I have discoverd that if you issue a "ThisForm.Refresh()" as called in the activiation of the tab, it automatically assigns the Hourglass icon to the mouse, as it could "take a while" I gues... Using This.Refresh() in the tab's activation instead, (Even when surround by ThisForm.LockScreen, which I like to do to prevent any "Flashing" from occuring), it just behaves itself. So I have now adopted that as my "prefered method" of moving from tab to tab. I have 2 extra methods "ActivateTab" and "DeactivateTab" which mostly controls making the Font of the Tab that is selected BOLD our UNBOLD when lost. Is a nice touch, to help show which tab you are on...
Anyway, we can put this one to bed now. Thanks.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Scott,

Delighted to hear that you've got it sorted.

As well as avoiding the hourglass, the actual refresh should also be slightly faster this way. Obviously, the lockscreen issue was a red herring - I agree that it's cometically better to include 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