Yes, you can do that. But it is maybe not quite as straightforward as you might think at first blush. Because the system won't think that the properties and methods are the same.

if you have a property TheWindow as Window
you can have it point to either MyDocumentWindow or MyPaletteWidow.
So far, so good.

Because TheWindow is defined as Window, you can refer to all the methods and properties that apply to Window. But if you want to refer to properties or methods that are defined by MyDocumentWindow or MyPaletteWidow, you need to know which one.

So, for example:

dim mdw as new MyDocumentWindow
dim mpw as new MyPaletteWidow
dim TheWindow as Window
'...
TheWindow = mdw '(maybe)
'...

if TheWindow isa MyDocumentWindow then
// code using mdw
elseif TheWindow isa MyPaletteWindow then
// code using mpw
end

HTH

Russ

On May 18, 2006, at 7:03 PM, FreeFL wrote:

Hello!


I have built a window, set its frame property as document, its name is MyDocumentWindow. I have made a clone of this and set the frame propery to global palette, its name is MyPaletteWindow. So now I have two "versions" of the same window. I would like to use either one of them, with the same reference in my globals module.

Is it possible to use in code a reference, say TheWindow, to a window and have this reference set to point to either MyDocumentWindow or MyPaletteWindow, assuming all other properties and methods are exactly the same in both ?

Thanks!

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to