Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclass a Page
Message
From
05/12/2003 10:13:31
 
 
To
03/12/2003 16:20:57
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00855620
Message ID:
00856257
Views:
14
Hi Trish

>I've heard there is no class is foxpro that can't be subclassed. How can you subclass the page class?

Prior to VFP 8.0 which introduced the ability to subclass contained controls (Pages, Columns, OptionButtons etc) visually, the only way is to use code like this:
DEFINE CLASS mypage AS page
  FUNCTION Init()
    This.RefreshPage()
  ENDFUNC

  FUNCTION refreshpage
    LOCAL llRetVal, llScreenState
    llScreenSate = ThisForm.LockScreen
    ThisForm.LockScreen = .T.
    llRetVal = This.BeforeRefresh()
    IF llRetVal
      This.Refresh()
      llRetVal = This.AfterRefresh()
    ENDIF
    ThisForm.LockScreen = llScreenState
    RETURN llRetVal
  ENDFUNC

  [...etc...]
ENDDEFINE
The only snag with this is that you cannot pre-define your pageframes to use these classes and have to add thenm at runtime using AddObject().


This all changed with the new MemberClass properties in VFP 8.0 and it is now much simpler to use such customized classes.
----
Regards
Andy Kramek
Previous
Reply
Map
View

Click here to load this message in the networking platform