Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class Code not fired without Scope Resolution
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01189501
Message ID:
01189516
Views:
6
>>>>I have a series of rec navigation button classes, set in a container, with .Click() code as, for example the below "Go to next record" button: mclNext
>>>>
>>>>Select ( thisform.cpAlias)
>>>>If not EOF()
>>>>    Skip 1
>>>>    If EOF()
>>>>	Go BOTTOM
>>>>	This.Enabled                 = .F.
>>>>	This.Parent.cmdLast.Enabled  = .F.
>>>>    Endif
>>>>    With This.Parent
>>>>      .cmdPrev.Enabled                = .T.
>>>>      .cmdFirst.Enabled               = .T.
>>>>    EndWith
>>>>EndIf not EOF()
>>>>Thisform.Refresh
>>>>
>>>>
>>>>thisform.cpAlias is a text prop bearing the name of the form's subject table
>>>>
>>>>Now I often use this is conjunction with other commands, e.g. when the user clicks the Next button, and the next record is reached, I want certain other data to be got, certain things diplayed, etc. So I often embed in the form button's .Click() things like:
>>>>
>>>>
>>>>mclNext::Click()
>>>>Thisform.lmGetRouteDetails()
>>>>
>>>>
>>>>On my latest form, though, all I want is the next record, so I leave the .click() empty, to do the default class code. But when I click the button nothing happens. In Trace it doesn't go into the class code. So I have to include
>>>>
>>>>mclNext::Click()
>>>>
>>>>in the .Click() method to make it work.
>>>>
>>>>Wassup with that?
>>>>
>>>>'ppreciate it
>>>>
>>>>Terry
>>>
>>>Make sure you don't have anything in that code. I mean Open Properties window, Select to see only Non-Default Properties Only and see if the Click Event of that button is there. If it is RightClick and choose Reset to default.
>>
>>Hi BB
>>
>>If you mean the button on the form, no, the only code is in the .click() event, and that's only there cos I had to, as indicated above. There are a few custom properties but nothing else
>
>Yes, button on the form. Reset its Click event to default and check to see what happens.

Although I know it's good practice to reset to default I've always found that just deleting any code one has put in a class method is just as good. Nevertheless, I did that, such that the Click Event now says:

"Inherited mclNavButtons ..." etc.).

It made no difference. Besides, before I was forced to put the scope resolution in, for the above stated reasons, the code WAS just the default code of the class.

Any other ideas.

Cheers

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform