Proper way of using Super and Sub Class events

I have a Super class, PTextArea, and a subclass called CREdit. The Super implements the GotFocus event. How do I refer to the subclass in the Super. I am not sure of the terminology and know how to use ISA,
The equation is
If (Missing Name) ISA CREdit then

What is the missing name?

Create an event GotFocus in your super. (You can right-click on your GotFocus event to help with that). Have it return a Boolean.

In your GotFocus event, include code like this:

var handled as boolean = RaiseEvent GotFocus
if handled then
end if
// ... otherwise, do what you do

In the subclass, implement GotFocus, then return True if you want the Super to stop handling the event, or False to let the Super continue.

In the way I interpreted your question, your answer should be “self”

System.DebugLog "TextClass focus"
If self isA TextClassSub Then 
  System.DebugLog "This class is a TextClassSub"
  System.DebugLog "This class is a TextClass"

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.