************************************************** *-- Class: abutton (c:\dev\heat\classes\blender.vcx) *-- ParentClass: commandbutton *-- BaseClass: commandbutton *-- Time Stamp: 01/18/04 09:12:02 PM * DEFINE CLASS abutton AS commandbutton Height = 27 Width = 84 Caption = "Command" Name = "abutton" *-- If TRUE, this control is enabled if thisform.lEditMode = .T. leditenabled = .F. *-- If TRUE and thisform has an lEditMode property, this control's .Enabled property is affected by its .lEditEnabled property. leditaware = .F. PROCEDURE Refresh if this.lEditAware if type('thisform.lEditMode') <> 'U' if this.lEditEnabled this.enabled = thisform.lEditMode else this.enabled = not thisform.lEditMode endif endif endif ENDPROC ENDDEFINE * *-- EndDefine: abutton **************************************************cButton
************************************************** *-- Class: cbutton (c:\dev\heat\classes\blender.vcx) *-- ParentClass: abutton (c:\dev\heat\classes\blender.vcx) *-- BaseClass: commandbutton *-- Time Stamp: 01/08/04 09:07:00 PM * DEFINE CLASS cbutton AS abutton Name = "cbutton" ENDDEFINE * *-- EndDefine: cbutton **************************************************If I wanted to add some code to the Refresh event in cButton that runs, in addition to the code in aButton.Refresh(), I'd need to use a combination of NODEFAULT and DODEFAULT() like so:
************************************************** *-- Class: cbutton (c:\dev\heat\classes\blender.vcx) *-- ParentClass: abutton (c:\dev\heat\classes\blender.vcx) *-- BaseClass: commandbutton *-- Time Stamp: 01/08/04 09:07:00 PM * DEFINE CLASS cbutton AS abutton Name = "cbutton" PROCEDURE Refresh nodefault && Prevents aButton.Refresh code from firing after this method if this.lEditAware if type('thisform.lScanning') <> 'U' if thisform.lScanning this.enabled = .T. && Disable this control during scanning else DoDefault() && Perform normal enable check in parent class method endif endif endif ENDPROC ENDDEFINE * *-- EndDefine: cbutton **************************************************Hope it helps to see code. :)