I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled.
See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
--- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
I suspect these new pages are based off the default class, not the custom class you expect.
Is the original pageframe based on a class from a library?
It's been a long time since I ran in to something like this.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of MB Software Solutions, LLC Sent: Wednesday, July 03, 2019 4:03 PM To: profoxtech@leafe.com Subject: Super bizarre page.init bug on form.pageframe -- it never runs! (VFP9SP2)
I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled.
See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
--- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
Are you sure that what you are running is what you are editing?
On 3 July 2019 16:03:21 GMT-04:00, "MB Software Solutions, LLC" mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled.
See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
Frank -- Yep. That frmEditJob is the most popular form in this app. In the demo, I edit that form, save it, recompile all files with immediate run, then run the code that runs that form.
Tracy -- yeah I wondered that too. Pageframe is using my pgfbase class, which has a MemberClass of pagbase and MemberClassLibrary of e:\dev\fabnet\classes\mjbbase.vcx. Using the SCX like a tab, here is the Properties of that main pgf:
ErasePage = .T. PageCount = 13 Anchor = 15 ActivePage = 1 Top = 0 Left = 0 Width = 888 Height = 600 TabIndex = 1 Name = "pgf" Pagbase1.Caption = "Job Info" Pagbase1.PageOrder = 1 Pagbase1.ToolTipText = "General Job Information" Pagbase1.Name = "pagJobInfo" Pagbase2.Caption = "People" Pagbase2.PageOrder = 3 Pagbase2.ToolTipText = "Key people assigned to roles for this Job" Pagbase2.Name = "pagPeople" Pagbase3.Caption = "Notes" Pagbase3.PageOrder = 4 Pagbase3.ToolTipText = "Various notes for this Job" Pagbase3.Name = "pagNotes" Pagbase4.Caption = "Recipients" Pagbase4.PageOrder = 5 Pagbase4.ToolTipText = "Proposal report receipients (possibly customers or general contractors)" Pagbase4.Name = "pagRecipients" Pagbase5.Caption = "Items" Pagbase5.PageOrder = 7 Pagbase5.ToolTipText = "Items for this Job" Pagbase5.Name = "pagItems" Pagbase6.Caption = "Fees/Discounts" Pagbase6.PageOrder = 6 Pagbase6.ToolTipText = "Fees for this Job" Pagbase6.Name = "pagFees" Pagbase7.Caption = "Rates" Pagbase7.PageOrder = 2 Pagbase7.ToolTipText = "Rates for this Job" Pagbase7.Name = "pagRates" Pagbase8.Caption = "Special Rates" Pagbase8.PageOrder = 8 Pagbase8.ToolTipText = "Special rates placeholders" Pagbase8.Name = "pagSpecialRates" Pagbase9.Caption = "Access" Pagbase9.PageOrder = 10 Pagbase9.ToolTipText = "User access history to this Job" Pagbase9.Name = "pagAccess" Pagbase10.Caption = "Dates" Pagbase10.PageOrder = 9 Pagbase10.ToolTipText = "Key dates for this Job" Pagbase10.Name = "pagDates" Pagbase11.Caption = "Differences" Pagbase11.PageOrder = 11 Pagbase11.ToolTipText = "Factor/Rate differences across the job (checking for outdated pricing)" Pagbase11.Name = "pagDifferences" Pagbase12.Caption = "Released" Pagbase12.PageOrder = 12 Pagbase12.Name = "pagReleased" Pagbase13.Caption = "Billing" Pagbase13.PageOrder = 13 Pagbase13.Name = "pagBilling"
Like I said...other pages besides pagReleased and pagBilling seem to have their Init events respected. One interesting note though: I put a MESSAGEBOX in one of the page.Init's that is working correctly, and the msgbox DID NOT SHOW. The line afterwards to RETURN SomeFalseCondition did work though, as the page properly didn't show then. WEIRD!!!!!!
On 7/3/2019 4:27 PM, Frank Cazabon wrote:
Are you sure that what you are running is what you are editing?
On 3 July 2019 16:03:21 GMT-04:00, "MB Software Solutions, LLC" mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled. See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
But if you make a visual change to that page and then run the form again, is your visual change there?
On 3 July 2019 22:00:06 GMT-04:00, "MB Software Solutions, LLC" mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
Frank -- Yep. That frmEditJob is the most popular form in this app. In the demo, I edit that form, save it, recompile all files with immediate
run, then run the code that runs that form.
Tracy -- yeah I wondered that too. Pageframe is using my pgfbase class, which has a MemberClass of pagbase and MemberClassLibrary of e:\dev\fabnet\classes\mjbbase.vcx. Using the SCX like a tab, here is the Properties of that main pgf:
ErasePage = .T. PageCount = 13 Anchor = 15 ActivePage = 1 Top = 0 Left = 0 Width = 888 Height = 600 TabIndex = 1 Name = "pgf" Pagbase1.Caption = "Job Info" Pagbase1.PageOrder = 1 Pagbase1.ToolTipText = "General Job Information" Pagbase1.Name = "pagJobInfo" Pagbase2.Caption = "People" Pagbase2.PageOrder = 3 Pagbase2.ToolTipText = "Key people assigned to roles for this Job" Pagbase2.Name = "pagPeople" Pagbase3.Caption = "Notes" Pagbase3.PageOrder = 4 Pagbase3.ToolTipText = "Various notes for this Job" Pagbase3.Name = "pagNotes" Pagbase4.Caption = "Recipients" Pagbase4.PageOrder = 5 Pagbase4.ToolTipText = "Proposal report receipients (possibly customers
or general contractors)" Pagbase4.Name = "pagRecipients" Pagbase5.Caption = "Items" Pagbase5.PageOrder = 7 Pagbase5.ToolTipText = "Items for this Job" Pagbase5.Name = "pagItems" Pagbase6.Caption = "Fees/Discounts" Pagbase6.PageOrder = 6 Pagbase6.ToolTipText = "Fees for this Job" Pagbase6.Name = "pagFees" Pagbase7.Caption = "Rates" Pagbase7.PageOrder = 2 Pagbase7.ToolTipText = "Rates for this Job" Pagbase7.Name = "pagRates" Pagbase8.Caption = "Special Rates" Pagbase8.PageOrder = 8 Pagbase8.ToolTipText = "Special rates placeholders" Pagbase8.Name = "pagSpecialRates" Pagbase9.Caption = "Access" Pagbase9.PageOrder = 10 Pagbase9.ToolTipText = "User access history to this Job" Pagbase9.Name = "pagAccess" Pagbase10.Caption = "Dates" Pagbase10.PageOrder = 9 Pagbase10.ToolTipText = "Key dates for this Job" Pagbase10.Name = "pagDates" Pagbase11.Caption = "Differences" Pagbase11.PageOrder = 11 Pagbase11.ToolTipText = "Factor/Rate differences across the job (checking for outdated pricing)" Pagbase11.Name = "pagDifferences" Pagbase12.Caption = "Released" Pagbase12.PageOrder = 12 Pagbase12.Name = "pagReleased" Pagbase13.Caption = "Billing" Pagbase13.PageOrder = 13 Pagbase13.Name = "pagBilling"
Like I said...other pages besides pagReleased and pagBilling seem to have their Init events respected. One interesting note though: I put a MESSAGEBOX in one of the page.Init's that is working correctly, and the
msgbox DID NOT SHOW. The line afterwards to RETURN SomeFalseCondition did work though, as the page properly didn't show then. WEIRD!!!!!!
On 7/3/2019 4:27 PM, Frank Cazabon wrote:
Are you sure that what you are running is what you are editing?
On 3 July 2019 16:03:21 GMT-04:00, "MB Software Solutions, LLC"
mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled. See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
Sadly, yes...just confirmed after I stuck obvious label on to test that theory: https://www.screencast.com/t/WgGyQIBhNGSV
My money is on the order of records in the SCX table causing something hokey here.
On 7/3/2019 10:10 PM, Frank Cazabon wrote:
But if you make a visual change to that page and then run the form again, is your visual change there?
On 3 July 2019 22:00:06 GMT-04:00, "MB Software Solutions, LLC" mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
Frank -- Yep. That frmEditJob is the most popular form in this app. In the demo, I edit that form, save it, recompile all files with immediate
run, then run the code that runs that form.
Tracy -- yeah I wondered that too. Pageframe is using my pgfbase class, which has a MemberClass of pagbase and MemberClassLibrary of e:\dev\fabnet\classes\mjbbase.vcx. Using the SCX like a tab, here is the Properties of that main pgf:
ErasePage = .T. PageCount = 13 Anchor = 15 ActivePage = 1 Top = 0 Left = 0 Width = 888 Height = 600 TabIndex = 1 Name = "pgf" Pagbase1.Caption = "Job Info" Pagbase1.PageOrder = 1 Pagbase1.ToolTipText = "General Job Information" Pagbase1.Name = "pagJobInfo" Pagbase2.Caption = "People" Pagbase2.PageOrder = 3 Pagbase2.ToolTipText = "Key people assigned to roles for this Job" Pagbase2.Name = "pagPeople" Pagbase3.Caption = "Notes" Pagbase3.PageOrder = 4 Pagbase3.ToolTipText = "Various notes for this Job" Pagbase3.Name = "pagNotes" Pagbase4.Caption = "Recipients" Pagbase4.PageOrder = 5 Pagbase4.ToolTipText = "Proposal report receipients (possibly customers
or general contractors)" Pagbase4.Name = "pagRecipients" Pagbase5.Caption = "Items" Pagbase5.PageOrder = 7 Pagbase5.ToolTipText = "Items for this Job" Pagbase5.Name = "pagItems" Pagbase6.Caption = "Fees/Discounts" Pagbase6.PageOrder = 6 Pagbase6.ToolTipText = "Fees for this Job" Pagbase6.Name = "pagFees" Pagbase7.Caption = "Rates" Pagbase7.PageOrder = 2 Pagbase7.ToolTipText = "Rates for this Job" Pagbase7.Name = "pagRates" Pagbase8.Caption = "Special Rates" Pagbase8.PageOrder = 8 Pagbase8.ToolTipText = "Special rates placeholders" Pagbase8.Name = "pagSpecialRates" Pagbase9.Caption = "Access" Pagbase9.PageOrder = 10 Pagbase9.ToolTipText = "User access history to this Job" Pagbase9.Name = "pagAccess" Pagbase10.Caption = "Dates" Pagbase10.PageOrder = 9 Pagbase10.ToolTipText = "Key dates for this Job" Pagbase10.Name = "pagDates" Pagbase11.Caption = "Differences" Pagbase11.PageOrder = 11 Pagbase11.ToolTipText = "Factor/Rate differences across the job (checking for outdated pricing)" Pagbase11.Name = "pagDifferences" Pagbase12.Caption = "Released" Pagbase12.PageOrder = 12 Pagbase12.Name = "pagReleased" Pagbase13.Caption = "Billing" Pagbase13.PageOrder = 13 Pagbase13.Name = "pagBilling"
Like I said...other pages besides pagReleased and pagBilling seem to have their Init events respected. One interesting note though: I put a MESSAGEBOX in one of the page.Init's that is working correctly, and the
msgbox DID NOT SHOW. The line afterwards to RETURN SomeFalseCondition did work though, as the page properly didn't show then. WEIRD!!!!!!
On 7/3/2019 4:27 PM, Frank Cazabon wrote:
Are you sure that what you are running is what you are editing?
On 3 July 2019 16:03:21 GMT-04:00, "MB Software Solutions, LLC"
mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled. See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
The Init code that runs is always from the page class unless you have the chance of setting it up before the PageFrame is instantiated. It must be part of a class.
You have two ways of doing this that I know of.
In a PRG:
[Start of code] LOCAL Test AS FRM
m.Test = CREATEOBJECT("FRM") m.Test.Show(1)
DEFINE CLASS FRM AS Form
ADD OBJECT PGF AS PGF1 WITH PageCount = 3
PROCEDURE PGF.PG1_3.Init MESSAGEBOX("It fires!") ENDPROC
ENDDEFINE
DEFINE CLASS PGF1 AS PageFrame
MemberClass = "PG1_" MemberClassLibrary = SYS(16)
ENDDEFINE
DEFINE CLASS PG1_ AS Page
PROCEDURE Init MESSAGEBOX(TEXTMERGE("Initing page <<This.Name >>")) ENDPROC
ENDDEFINE [end of code]
Visually, as it is the case in your scenario, save your form as a class with the init code of the pages in place. Then, create your actual form from the class. The Init of the pages will fire.
On Thu, Jul 4, 2019 at 5:50 AM MB Software Solutions, LLC < mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
Sadly, yes...just confirmed after I stuck obvious label on to test that theory: https://www.screencast.com/t/WgGyQIBhNGSV
My money is on the order of records in the SCX table causing something hokey here.
On 7/3/2019 10:10 PM, Frank Cazabon wrote:
But if you make a visual change to that page and then run the form
again, is your visual change there?
On 3 July 2019 22:00:06 GMT-04:00, "MB Software Solutions, LLC" <
mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
Frank -- Yep. That frmEditJob is the most popular form in this app. In the demo, I edit that form, save it, recompile all files with immediate
run, then run the code that runs that form.
Tracy -- yeah I wondered that too. Pageframe is using my pgfbase class, which has a MemberClass of pagbase and MemberClassLibrary of e:\dev\fabnet\classes\mjbbase.vcx. Using the SCX like a tab, here is the Properties of that main pgf:
ErasePage = .T. PageCount = 13 Anchor = 15 ActivePage = 1 Top = 0 Left = 0 Width = 888 Height = 600 TabIndex = 1 Name = "pgf" Pagbase1.Caption = "Job Info" Pagbase1.PageOrder = 1 Pagbase1.ToolTipText = "General Job Information" Pagbase1.Name = "pagJobInfo" Pagbase2.Caption = "People" Pagbase2.PageOrder = 3 Pagbase2.ToolTipText = "Key people assigned to roles for this Job" Pagbase2.Name = "pagPeople" Pagbase3.Caption = "Notes" Pagbase3.PageOrder = 4 Pagbase3.ToolTipText = "Various notes for this Job" Pagbase3.Name = "pagNotes" Pagbase4.Caption = "Recipients" Pagbase4.PageOrder = 5 Pagbase4.ToolTipText = "Proposal report receipients (possibly customers
or general contractors)" Pagbase4.Name = "pagRecipients" Pagbase5.Caption = "Items" Pagbase5.PageOrder = 7 Pagbase5.ToolTipText = "Items for this Job" Pagbase5.Name = "pagItems" Pagbase6.Caption = "Fees/Discounts" Pagbase6.PageOrder = 6 Pagbase6.ToolTipText = "Fees for this Job" Pagbase6.Name = "pagFees" Pagbase7.Caption = "Rates" Pagbase7.PageOrder = 2 Pagbase7.ToolTipText = "Rates for this Job" Pagbase7.Name = "pagRates" Pagbase8.Caption = "Special Rates" Pagbase8.PageOrder = 8 Pagbase8.ToolTipText = "Special rates placeholders" Pagbase8.Name = "pagSpecialRates" Pagbase9.Caption = "Access" Pagbase9.PageOrder = 10 Pagbase9.ToolTipText = "User access history to this Job" Pagbase9.Name = "pagAccess" Pagbase10.Caption = "Dates" Pagbase10.PageOrder = 9 Pagbase10.ToolTipText = "Key dates for this Job" Pagbase10.Name = "pagDates" Pagbase11.Caption = "Differences" Pagbase11.PageOrder = 11 Pagbase11.ToolTipText = "Factor/Rate differences across the job (checking for outdated pricing)" Pagbase11.Name = "pagDifferences" Pagbase12.Caption = "Released" Pagbase12.PageOrder = 12 Pagbase12.Name = "pagReleased" Pagbase13.Caption = "Billing" Pagbase13.PageOrder = 13 Pagbase13.Name = "pagBilling"
Like I said...other pages besides pagReleased and pagBilling seem to have their Init events respected. One interesting note though: I put a MESSAGEBOX in one of the page.Init's that is working correctly, and the
msgbox DID NOT SHOW. The line afterwards to RETURN SomeFalseCondition did work though, as the page properly didn't show then. WEIRD!!!!!!
On 7/3/2019 4:27 PM, Frank Cazabon wrote:
Are you sure that what you are running is what you are editing?
On 3 July 2019 16:03:21 GMT-04:00, "MB Software Solutions, LLC"
mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled. See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
Antonio,
I edited the SCX form and did a "Save As" and saved it to my VCX. Upon invoking, it chokes on the pageframe within a pageframe with error 2005:
Error loading file - record number 265. Pgfbase1 <or one of its members>. Parent : Cannot add PGFBASE1. Class definition is cyclical.
I'm going to try to alter the code I guess to have it instantiate the pgf on that particular page in the highest page.activate event I guess. Something akin to Marcia Atkins & Andy Kramek's "delayed instantiation" trick I think from the 1001 Tips book eons ago. Will see if that fixes it.
On 7/4/2019 2:50 AM, António Tavares Lopes wrote:
The Init code that runs is always from the page class unless you have the chance of setting it up before the PageFrame is instantiated. It must be part of a class.
You have two ways of doing this that I know of.
In a PRG:
[Start of code] LOCAL Test AS FRM
m.Test = CREATEOBJECT("FRM") m.Test.Show(1)
DEFINE CLASS FRM AS Form
ADD OBJECT PGF AS PGF1 WITH PageCount = 3
PROCEDURE PGF.PG1_3.Init MESSAGEBOX("It fires!") ENDPROC
ENDDEFINE
DEFINE CLASS PGF1 AS PageFrame
MemberClass = "PG1_" MemberClassLibrary = SYS(16)
ENDDEFINE
DEFINE CLASS PG1_ AS Page
PROCEDURE Init MESSAGEBOX(TEXTMERGE("Initing page <<This.Name >>")) ENDPROC
ENDDEFINE [end of code]
Visually, as it is the case in your scenario, save your form as a class with the init code of the pages in place. Then, create your actual form from the class. The Init of the pages will fire.
On Thu, Jul 4, 2019 at 5:50 AM MB Software Solutions, LLC < mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
Sadly, yes...just confirmed after I stuck obvious label on to test that theory: https://www.screencast.com/t/WgGyQIBhNGSV
My money is on the order of records in the SCX table causing something hokey here.
On 7/3/2019 10:10 PM, Frank Cazabon wrote:
But if you make a visual change to that page and then run the form
again, is your visual change there?
On 3 July 2019 22:00:06 GMT-04:00, "MB Software Solutions, LLC" <
mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
Frank -- Yep. That frmEditJob is the most popular form in this app. In the demo, I edit that form, save it, recompile all files with immediate
run, then run the code that runs that form.
Tracy -- yeah I wondered that too. Pageframe is using my pgfbase class, which has a MemberClass of pagbase and MemberClassLibrary of e:\dev\fabnet\classes\mjbbase.vcx. Using the SCX like a tab, here is the Properties of that main pgf:
ErasePage = .T. PageCount = 13 Anchor = 15 ActivePage = 1 Top = 0 Left = 0 Width = 888 Height = 600 TabIndex = 1 Name = "pgf" Pagbase1.Caption = "Job Info" Pagbase1.PageOrder = 1 Pagbase1.ToolTipText = "General Job Information" Pagbase1.Name = "pagJobInfo" Pagbase2.Caption = "People" Pagbase2.PageOrder = 3 Pagbase2.ToolTipText = "Key people assigned to roles for this Job" Pagbase2.Name = "pagPeople" Pagbase3.Caption = "Notes" Pagbase3.PageOrder = 4 Pagbase3.ToolTipText = "Various notes for this Job" Pagbase3.Name = "pagNotes" Pagbase4.Caption = "Recipients" Pagbase4.PageOrder = 5 Pagbase4.ToolTipText = "Proposal report receipients (possibly customers
or general contractors)" Pagbase4.Name = "pagRecipients" Pagbase5.Caption = "Items" Pagbase5.PageOrder = 7 Pagbase5.ToolTipText = "Items for this Job" Pagbase5.Name = "pagItems" Pagbase6.Caption = "Fees/Discounts" Pagbase6.PageOrder = 6 Pagbase6.ToolTipText = "Fees for this Job" Pagbase6.Name = "pagFees" Pagbase7.Caption = "Rates" Pagbase7.PageOrder = 2 Pagbase7.ToolTipText = "Rates for this Job" Pagbase7.Name = "pagRates" Pagbase8.Caption = "Special Rates" Pagbase8.PageOrder = 8 Pagbase8.ToolTipText = "Special rates placeholders" Pagbase8.Name = "pagSpecialRates" Pagbase9.Caption = "Access" Pagbase9.PageOrder = 10 Pagbase9.ToolTipText = "User access history to this Job" Pagbase9.Name = "pagAccess" Pagbase10.Caption = "Dates" Pagbase10.PageOrder = 9 Pagbase10.ToolTipText = "Key dates for this Job" Pagbase10.Name = "pagDates" Pagbase11.Caption = "Differences" Pagbase11.PageOrder = 11 Pagbase11.ToolTipText = "Factor/Rate differences across the job (checking for outdated pricing)" Pagbase11.Name = "pagDifferences" Pagbase12.Caption = "Released" Pagbase12.PageOrder = 12 Pagbase12.Name = "pagReleased" Pagbase13.Caption = "Billing" Pagbase13.PageOrder = 13 Pagbase13.Name = "pagBilling"
Like I said...other pages besides pagReleased and pagBilling seem to have their Init events respected. One interesting note though: I put a MESSAGEBOX in one of the page.Init's that is working correctly, and the
msgbox DID NOT SHOW. The line afterwards to RETURN SomeFalseCondition did work though, as the page properly didn't show then. WEIRD!!!!!!
On 7/3/2019 4:27 PM, Frank Cazabon wrote:
Are you sure that what you are running is what you are editing?
On 3 July 2019 16:03:21 GMT-04:00, "MB Software Solutions, LLC"
mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled. See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
At 13:27 2019-07-03, Frank Cazabon frank.cazabon@gmail.com wrote:
Are you sure that what you are running is what you are editing?
I second this.
I am currently suffering from something like this. I have to hack my form handling for a special case. I have some methods of my form handling that are not usually overridden being overridden, some to doing nothing. It is great fun jumping between the two classes. There is a lot of event handling, too. SET STEP ON and ON and ON.
[snip]
Sincerely,
Gene Wirchenko
As long as you have no MemberClass from a MemberClassLibrary defined in your pageframe, new pages are always plain stock standard pages from VFP's internal baseclass. I have a simple PRG for those nonvisual Memberclasses, which is basically just a
DEFINE MyPage AS PAGE ENDDEFINE
Save that as MyGrdPages.prg.
Assign that to your MyPageFrame class as MemberClass = "MyPage" MemberClassLibrary = "MyGrdPages.prg"
VFP then will warn you that any code assigned to your existing pages will get lost, thus you better copy that to a temporary file and add it back afterwards.
Some things you may want to add to your MyPage class:
PROCEDURE ACTIVATE This.FontBold = .T. ENDPROC
PROCEDURE DEACTIVATE This.FontBold = .F. ENDPROC
Makes a more visual effect to the current page-Caption. You could also change the FontColor.
wOOdy
-----Ursprüngliche Nachricht----- Von: ProFox profox-bounces@leafe.com Im Auftrag von MB Software Solutions, LLC Gesendet: Mittwoch, 3. Juli 2019 22:03 An: profox@leafe.com Betreff: Super bizarre page.init bug on form.pageframe -- it never runs! (VFP9SP2)
I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled.
See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
--- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
Hi wOOdy,
The pageframe does have its MemberClass settings set here: https://www.screencast.com/t/sFIpL8MLFeC
I tried to (re-)define the SCX Properties field but VFP didn't like it for some reason.
Here's the code from the Class Browser of my pagbase class, doing pretty much what you said:
************************************************** *-- Class: pagbase (e:\dev\fabnet\classes\mjbbase.vcx) *-- ParentClass: page *-- BaseClass: page *-- Time Stamp: 07/03/19 01:15:11 PM * DEFINE CLASS pagbase AS page
Caption = "Page1" Height = 188 Width = 188 *-- has the page's backcolor stored in this property in the Init event so as to be reverted to this in the activate/deactivate events. initialbackcolor = "" *-- checks to see if there's a grid on this page in the UIEnable and calls its autofit if found. lgridautofit = .T. *-- XML Metadata for customizable properties _memberdata = [<VFPData><memberdata name="lgridautofit" display="lGridAutofit"/></VFPData>] Name = "pagbase"
PROCEDURE Deactivate thisform.LockScreen = .t. WITH this .fontbold = .f. IF PEMSTATUS(this,"InitialBackColor",5) THEN .BackColor = .InitialBackColor ELSE .ResetToDefault("Backcolor") ENDIF && pemstatus
.ResetToDefault("FontSize") ENDWITH thisform.LockScreen = .f. ENDPROC
PROCEDURE Activate WITH this .fontbold = .t.
IF PEMSTATUS(this,"InitialBackColor",5) THEN .BackColor = .InitialBackColor ELSE .ResetToDefault("Backcolor") ENDIF && pemstatus()
.ResetToDefault("FontSize") .FontSize = this.FontSize + 2
IF .BackColor > RGB(0,0,0) + 50 THEN && could have just said 10, but put the RGB in to illustrate the point and in case I go the opposite direction later .BackColor = .BackColor - 50 && make slightly lighter ENDIF .refresh() ENDWITH
*** mjb 07/02/2019 - added for FabNet grids seemingly not autofitting for some reason despite calls elsewhere LOCAL oControl as Control FOR EACH oControl IN this.Controls FOXOBJECT IF LOWER(oControl.BaseClass) = "grid" AND PEMSTATUS(oControl,'lAutofit',5) AND oControl.lAutoFit THEN oControl.Autofit() ENDIF ENDFOR ENDPROC
PROCEDURE Init DODEFAULT() this.Initialbackcolor = this.BackColor
*** mjb 05/16/2019 - added to help accentuate difference between Production and not IF VARTYPE(oUtils) = "O" AND PEMSTATUS(oUtils,'SetFontName',5) THEN oUtils.SetFontName(this) ENDIF ENDPROC
ENDDEFINE * *-- EndDefine: pagbase **************************************************
On 7/4/2019 3:32 AM, juergen@wondzinski.de wrote:
As long as you have no MemberClass from a MemberClassLibrary defined in your pageframe, new pages are always plain stock standard pages from VFP's internal baseclass. I have a simple PRG for those nonvisual Memberclasses, which is basically just a
DEFINE MyPage AS PAGE ENDDEFINE
Save that as MyGrdPages.prg.
Assign that to your MyPageFrame class as MemberClass = "MyPage" MemberClassLibrary = "MyGrdPages.prg"
VFP then will warn you that any code assigned to your existing pages will get lost, thus you better copy that to a temporary file and add it back afterwards.
Some things you may want to add to your MyPage class:
PROCEDURE ACTIVATE This.FontBold = .T. ENDPROC
PROCEDURE DEACTIVATE This.FontBold = .F. ENDPROC
Makes a more visual effect to the current page-Caption. You could also change the FontColor.
wOOdy
-----Ursprüngliche Nachricht----- Von: ProFox profox-bounces@leafe.com Im Auftrag von MB Software Solutions, LLC Gesendet: Mittwoch, 3. Juli 2019 22:03 An: profox@leafe.com Betreff: Super bizarre page.init bug on form.pageframe -- it never runs! (VFP9SP2)
I added 2 pages to my existing pageframe so that I could add more functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled.
See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
Have you looked at what class is actually instantiated?
On July 4, 2019 7:53:52 AM EDT, "MB Software Solutions, LLC" mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
Hi wOOdy,
The pageframe does have its MemberClass settings set here: https://www.screencast.com/t/sFIpL8MLFeC
I tried to (re-)define the SCX Properties field but VFP didn't like it for some reason.
Here's the code from the Class Browser of my pagbase class, doing pretty much what you said:
*-- Class: pagbase (e:\dev\fabnet\classes\mjbbase.vcx) *-- ParentClass: page *-- BaseClass: page *-- Time Stamp: 07/03/19 01:15:11 PM
DEFINE CLASS pagbase AS page
Caption = "Page1" Height = 188 Width = 188 *-- has the page's backcolor stored in this property in the Init event so as to be reverted to this in the activate/deactivate events. initialbackcolor = "" *-- checks to see if there's a grid on this page in the UIEnable and calls its autofit if found. lgridautofit = .T. *-- XML Metadata for customizable properties _memberdata = [<VFPData><memberdata name="lgridautofit" display="lGridAutofit"/></VFPData>] Name = "pagbase"
PROCEDURE Deactivate thisform.LockScreen = .t. WITH this .fontbold = .f. IF PEMSTATUS(this,"InitialBackColor",5) THEN .BackColor = .InitialBackColor ELSE .ResetToDefault("Backcolor") ENDIF && pemstatus
.ResetToDefault("FontSize") ENDWITH thisform.LockScreen = .f. ENDPROC
PROCEDURE Activate WITH this .fontbold = .t.
IF PEMSTATUS(this,"InitialBackColor",5) THEN .BackColor = .InitialBackColor ELSE .ResetToDefault("Backcolor") ENDIF && pemstatus()
.ResetToDefault("FontSize") .FontSize = this.FontSize + 2
IF .BackColor > RGB(0,0,0) + 50 THEN && could have just said 10, but put the RGB in to illustrate the point and in case I go the opposite direction later .BackColor = .BackColor - 50 && make slightly lighter ENDIF .refresh() ENDWITH
*** mjb 07/02/2019 - added for FabNet grids seemingly not autofitting for some reason despite calls elsewhere LOCAL oControl as Control FOR EACH oControl IN this.Controls FOXOBJECT IF LOWER(oControl.BaseClass) = "grid" AND PEMSTATUS(oControl,'lAutofit',5) AND oControl.lAutoFit THEN oControl.Autofit() ENDIF ENDFOR ENDPROC
PROCEDURE Init DODEFAULT() this.Initialbackcolor = this.BackColor
*** mjb 05/16/2019 - added to help accentuate difference between Production and not IF VARTYPE(oUtils) = "O" AND PEMSTATUS(oUtils,'SetFontName',5) THEN oUtils.SetFontName(this) ENDIF ENDPROC
ENDDEFINE
*-- EndDefine: pagbase
On 7/4/2019 3:32 AM, juergen@wondzinski.de wrote:
As long as you have no MemberClass from a MemberClassLibrary defined
in your pageframe, new pages are always plain stock standard pages from VFP's internal baseclass.
I have a simple PRG for those nonvisual Memberclasses, which is
basically just a
DEFINE MyPage AS PAGE ENDDEFINE
Save that as MyGrdPages.prg.
Assign that to your MyPageFrame class as MemberClass = "MyPage" MemberClassLibrary = "MyGrdPages.prg"
VFP then will warn you that any code assigned to your existing pages
will get lost, thus you better copy that to a temporary file and add it back afterwards.
Some things you may want to add to your MyPage class:
PROCEDURE ACTIVATE This.FontBold = .T. ENDPROC
PROCEDURE DEACTIVATE This.FontBold = .F. ENDPROC
Makes a more visual effect to the current page-Caption. You could
also change the FontColor.
wOOdy
-----Ursprüngliche Nachricht----- Von: ProFox profox-bounces@leafe.com Im Auftrag von MB Software
Solutions, LLC
Gesendet: Mittwoch, 3. Juli 2019 22:03 An: profox@leafe.com Betreff: Super bizarre page.init bug on form.pageframe -- it never
runs! (VFP9SP2)
I added 2 pages to my existing pageframe so that I could add more
functionality to this form. There are pages that I conditionally instantiate based on user settings. But for these 2 new pages (automatically added via the IDE after I set the pageframe.PageCount from 11 to 13), their Init events never run. I'm baffled.
See soundless Camtasia demo I put together to show this: https://www.screencast.com/t/eZ1EyfDewnw
I'm hoping somebody can see something obvious that is eluding me!
tia, --Mike
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]
Hi,
Maybe this can help (from help > "Member Classes")
"On an .scx form, if you add instantiation code to the member class's Init event, Visual FoxPro disregards that code and only the Init code for the member class definition runs. However, with visual class library (.vcx) forms, Visual FoxPro creates a true subclass. You can safely add instantiation code for other events such as Click."
Thierry Nivelet
Le 04/07/2019 à 13:53, MB Software Solutions, LLC a écrit :
I tried to (re-)define the SCX Properties field but VFP didn't like it for some reason.