Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclass a Page
Message
De
05/12/2003 10:13:31
 
 
À
03/12/2003 16:20:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00855620
Message ID:
00856257
Vues:
15
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform