Enum from external window: a bug?

I created an Enum

Ok, now inside Event Handlers Open I wrote:

Msgbox(Str(Window1.TipoIcona.Warning))

Good job. Works fine.

But this not work:

Msgbox(Str(Window1.TipoIcona.Warning))

Error: Type “Window1.Window1” has no member named “TipoIcona”

Infact, if I need reclaim from external window TipoIcona.NoIcona, I can’t because I call it outside Window1 !

A bug ?!?

What version of Xojo?

The Last (2014 - 3.1).

both lines above are same, so maybe it’s the location?
Where did you put second line of code?

Ho my God !
I have confused the Window… Sorry Sorry !! Really…
I need stop code in the night ! :frowning:
Really sorry!

NO NO Boys… I’m not crazy !
HERE a link to example:
download it and tell me where I wrong !

Okay, let’s see.

if implicit instance is off, the identifier Window2 refers only to the class, so Window2.TipoIcona.Warning will work.
If you turn implicit instance on (like I love it), the identifier Window2 refers to both the class and the global function to return the shared instance of the window. In that case Xojo compiler sees this function and complains that enum name is not part of that window object. Which is correct in some way.

For theWin2.TipoIcona.Warning, the instance certainly has no enum. The compiler doesn’t see it.

Solution 1: Fix compiler to look both in class and object instance for enum identifiers.
Solution 2: Put enums in modules or classes, but not in windows.

feel free to write Feedback cases for the issue.

OK, solved.
I use implicit instance is off :slight_smile:

I’ll open a feedback tomorrow…
Thanks very lot.