Subclass confusion in modules?

Is anyone else seeing this?

I opened an older project (RS2012R2.1) which has a module Module1 with
TF1 <- subclass of TextField
TF2 <- subclass of TF1
TF3 <- subclass of TF2

in Xojo 2015 R3.3. I add a textfield to my window but I can’t set the TextField to TF1 or TF2.

Clicking on the pencil beside super only shows TextField, not the subclasses.

To investigate I create a new project. To make it work I have to add Module1. like this

TF1 <- subclass of TextField
TF2 <- subclass of Module1.TF1
TF3 <- subclass of Module1.TF2

This works.

HOWEVER adding Module1. to the super in the older project does not work. The subclasses simply refuse to “change” their super. Clicking on the pencil only shows TextField, none of the subclasses.

So in the older project it is impossible to set a TextField to the subclass TF1 or TF2.

Something screwy in the import of older projects?

The problem has something to do with modules not “using” their own scope. I’ve had similar issues. Not sure if there is a bug report on this yet. Does adding a “using” clause to the module, referencing itself, fix the issue?

I presume it still works to type the super in rather than selecting it from the dropdown. If it doesn’t, then that is a serious bug. Otherwise, it’s a less serious bug. Have you submitted a feedback report?

No, typing it in does not help. No feedback report yet as I wanted to ask here first.

Have you stored the project as xojo_binary_project and re-opened it? That solved it for me.

Try deleting the Super field (Select all content, press Delete). Then click the pencil. That will enable you to select whatever you want.

Don’t be alarmed to see the control disappear while it has no Super. It will appear as object at the bottom of the window, like a Timer would. It will come back when you select a new one.

Unfortunately no.

This is how it looks like

I can neither select the custom class nor type it in (even using Module1.NumericField_with_Min_Max)

Where would I add it? It is not some code that is the problem, it is the IDE …

[quote=209299:@Markus Winter]Unfortunately no.

This is how it looks like

I can neither select the custom class nor type it in (even using Module1.NumericField_with_Min_Max)[/quote]

You are trying to change the super without deleting the field.

Please do this exactly :

  1. Click in the Super field
  2. Press Command-A
  3. Press Delete (Backspace)
  4. Press Return ; At that point the control becomes invisible and shows as an object in the bottom part of the IDE
  5. Click the pencil to the right of the Super field : you have access to all classes.

Have you set the scope of your TextField subclass to Global?

I deleted the field. But as soon as I click on the pencil then the field is filled again with TextField.

By deleting and pressing return twice I can delete it and click the pencil without it being filled in, but then no subclasses of TextField are shown.

I can’t repeat it in a demo project I made so I’m putting it down to some unspecified corruption in this project.

Makes no difference.

I just created a project in RB latest release with your setup (Module with TextField subclass, subclass thereof and subclass of the latter) and opened it in the most recent Xojo version and it worked (the TextField subclass hierarchy is shown in the “Select Super” dialog. Btw this is a silly title, Xojo Inc., it should say “Select Class”, not “Select Super”.

Another thing you could try: Add one instance more to the window (in Xojo, not in RB) and see if this one works.

Can you drag the subclass from the left pane to the window?