We received a bug report
Steps to Reproduce :
1) Create MyButtonClass1 class of MyButtonLibrary1. Add code to click method.
2) Create MyFormClass1 class of MyFormLibrary1.
3) Add commandbutton of class created in step1. Add code to commandbutton's click method.
4) Create MyFormClass2 class of MyFormLibrary2. Add code to commandbutton's click method. Include DODEFAULT()
5) Create MyFormClass3 class of MyFormLibrary3. Press "View Parent Code" button in editor while viewing commandbutton click method.
Actual Results :
When the "View Parent Code" button is clicked in step 5 the parent class hierarchy shown does not include the subclass created in step 3. This is the faulty behavior.
However, when an object is created form class MyFormClass3 and the commandbutton clicked, the method is in fact executed. This is correct behavior.
Expected Results :
I would expect that "View Parent Code" would show all parent classes that in fact are executed as DODEFAULT() is issued.
While this is not a "show stopper" it is a clear and important error.
After some wrangling, manipulation and guessing, I managed to create code to reproduce the issue (below)
When the designer comes up, there are 2 entries in the View Parent Code
MYFORMCLASS2 (which shows “Step 4” in the code)
MYBUTTONCLASS1 (which shows “Baseclass” in the code)
When you click the button, this is output to the screen:
MYFORMCLASS3.CMD.CLICK Step 5
MYFORMCLASS2.CMD.CLICK Step 4
MYFORMCLASS1.CMD.CLICK Step 3
MYBUTTONCLASS1.CLICK Button Baseclass_
Is this a bug? If so, how many items do you expect to see when the View Parent Code button is clicked? What exactly should each of them say? What if there were more levels of inheritance?
Create CLASS MyButtonClass1 of MyButtonLibrary1 as commandbutton nowait
KEYBOARD 'y' && send a "Y" to "Do you want to save changes" dialog
RELEASE WINDOWS "Class Designer" && close the designer
Create CLASS MyFormClass1 of MyFormLibrary1 as form nowait
ox.AllowOutput=.f. && so output goes to screen
ox.left=300 && so form is not on top of output
Create class MyFormClass2 of MyFormLibrary2 as MyFormClass1 from MyFormLibrary1 NOWAIT
Create class MyFormClass3 of MyFormLibrary3 as MyFormClass2 from MyFormLibrary2 nowait
ox.cmd.writemethod("click",GenCode("Step 5. Examine 'View Parent Code' button"))
MODIFY CLASS MyFormClass3 of MyFormLibrary3 METHOD cmd.click
PROCEDURE gencode(str as String)
TEXT TO mycode NOSHOW TEXTMERGE