Restricted Subclass

I need to create ControlType2 as a subclass of ControlType1 …

But ControlType1 has various methods and properties that I want exposed in instances of ControlType1 but NOT in instances of ControlType2
HOWEVER… other methods that are unique to ControlType2 need to access these restricted methods/properties

For Example. ControlType1 has a BORDER property that can accept various values.
In ControlType2 the BORDER property should not be exposed, but it needs to be manipulated by other actions that are unique to ControlType2

So when creating the subclass, how can I “hide” certain methods/properties
and then how can I access them from the subclass

I tried something like

x=control.super.border
  • ControlType1 has property BORDER
  • ControlType2 is a subclass of ControlType1
  • BORDER should not be exposed to instances of ControlType2
  • ControlType2 has a Property XYZ that needs to alter BORDER of its superclass

You can create control type 2 as a normal subclass then, mark those items you do not want exposed in ControlType2 as “hidden” using an attribute.

except it seems (according to the docs) to only hide them in the compiled app…

so what I did was created a shadowed property with a private scope… it still shows, but gives an error if you attempt to access it

[quote=421199:@Dave S]except it seems (according to the docs) to only hide them in the compiled app…

so what I did was created a shadowed property with a private scope… it still shows, but gives an error if you attempt to access it[/quote]
The hidden attribute hides an item from autocomplete and the debugger.

Well either it doesn’t (as it was still visible when I did it)… or I applied the attribute incorrectly

Read up on Class inheritance and marking Methods and Properties Public, Private and Protected.
Should get you most of what you want.

[quote=421221:@Robin Lauryssen-Mitchell]Read up on Class inheritance and marking Methods and Properties Public, Private and Protected.
Should get you most of what you want.[/quote]
I know all about those attributes… and no they don’t

If I understand what you’re asking, it sounds a bit like a friend function. If so, then this technique might work, taken from Aaron Ballman’s excellent Ramblings on Realbasic book. To create a “friend” pattern:

Interfaces only work with methods not properties, so you’ll need to wrap properties as methods.