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, [email protected] 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 <[email protected]> Im Auftrag von MB Software Solutions, LLC
Gesendet: Mittwoch, 3. Juli 2019 22:03
An: [email protected]
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]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message:
https://leafe.com/archives/byMID/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.