Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP7/8 wish - for classes
Message
From
29/06/2001 09:21:30
 
 
To
29/06/2001 08:39:33
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00525091
Message ID:
00525146
Views:
22
Maybe it can be done in 6!
    1  Create a custom visual class for a textbox
    2  Add a property for PrgClass
    3  Add a property for PrgClassSourcePrg
    4  Add a this._access method
    5  In the instanciate method add code

       this.PrgClass = newobj(this.prgclass,this.prgclasssourceprg)
       this.prgClass.cParent = sys(1272, this)

    6  In the this._access

      lparameters cPropMeth
      if cPropMeth <> 'prgclass'
          return this.prgclass
      endif
      return this

    7  In the programatic class add property for cParent
    8  Add method cParent_assign
    9  In the cParent_assign
      lparameter xVal
      xVal = 'thisform.' + right(xVal,at('.',xVal))
      this.cParent = xVal
  10. in any methods of the programmatic class which should affect the visual
      attributes of the textbox use the following
      store visualattribute to ( this.cParent + '.visualattribute')
  11. Make sure programmatic class has all event functions defined.
this way with one generic text box any functionality can be had using programatic classes. I don't know if this is possible but it seems feasable.


This is only a theory and not tested or proven to be effective, nor is this an effective way to code for performance only a "RASH" idea while reading this thread.


>It can't be done in 7.
>
>>Hi,
>>
>>Perhaps they've done this in VFP7 - which would be great - but if not, I'd love to see it as soon as possible.
>>
>>I would like to be able to visually subclass or instantiate (i.e. on a form) prg defined classes. For example, I wish I could write all my base controls (txt, cbo, etc) in code, and then somehow "drop" them on a form where they would, of course, be visual.
>>
>>Also - I would love to have a class ot two 'above' the current base classes on which they were based. That way, code that is common to txt, cbo, edt, etc. could be written once and shared among all of the current base classes.
>>
>>Any word on these ideas?
>>
>>thanks,
Previous
Reply
Map
View

Click here to load this message in the networking platform