Xojo Conferences
XDCMay2019MiamiUSA

RE: Window Variable (Real Studio getting started Mailinglist archive)

Back to the thread list
Previous thread: Look at origin in 3D
Next thread: Click-thru window Win32


RB Database   -   tom.russell transport.alstom.com
  RE: Window Variable   -   Carlos M
   Re: Window Variable   -   Chuck Pelto
    Window Variable   -   Chuck Pelto
     Re: Window Variable   -   CV
     Re: Window Variable   -   Chuck Pelto
      Re: Window Variable   -   Fargo Holiday
     Re: Window Variable   -   Norman Palardy
     Re: Window Variable   -   Charles Yeomans
     Re: Window Variable   -   CV
     Re: Window Variable   -   Chuck Pelto
     Re: Window Variable   -   Norman Palardy
     Re: Window Variable   -   Chuck Pelto
     Re: Window Variable   -   Norman Palardy
     Re: Window Variable   -   Chuck Pelto
      Re: Window Variable   -   Phil Heycock
       RE: Window Variable   -   Carlos M
     Re: Window Variable   -   Chuck Pelto
     Re: Window Variable   -   Norman Palardy
     Re: Window Variable   -   CV
     Re: Window Variable   -   Arnaud Nicolet
     Re: Window Variable   -   CV
     Re: Window Variable   -   Arnaud Nicolet

RE: Window Variable
Date: 02.01.07 21:11 (Tue, 2 Jan 2007 20:11:11 -0000)
From: Carlos M
I'm sending the email below again, as I received the following error:
The following message could not be delivered to "Getting Started"
<<email address removed>> because the domain
lists.realsoftware.com> does not exist.

For those that are receiving this email in duplicate, sorry.

Carlos

-----Original Message-----
From: Carlos M
Sent: Saturday, December 30, 2006 8:06 PM
To: Getting Started
Subject: RE: Window Variable

Phil's suggestion is a good one and you can do more with that approach:
- You can for example create a different class for each window (2 and 3) if you
have different properties on each window.
- You can create methods on the classes to execute code on Window 2 and 3, from
Window 1.
- You can even create new events for each window and fire them from window 1.

If you have common code for both windows 2 and 3 you can create a main class
with the common code and then create subclasses of the main class for each
window to implement specific code for each one.

If Window 2 and 3 have some methods that are specific for an app and that you
don't want to include on the classes but you need to execute them via Window 1,
you can implement a class interface for each Window (2 and 3).

Carlos

On Dec 30, 2006 1:26 PM, Phil Heycock wrote:
> Create a subclass of Window: flexibleWindow, or some such.
>
> Give flexibleWindow the properties that you will want to be addressing via
> the 'relatedWindow' reference in Window1.
>
> Give Window1 a property: relatedWindow As flexibleWindow
>
> Make flexibleWindow the SUPER for Window2 and Window3.
>
> HTH
>
> P.
> ****************
>
> on 12/29/06 4:42 PM, Chuck Pelto at <email address removed> wrote:
>
> > Hi Fargo,
> >
> > On Dec 29, 2006, at 1:38 PM, Fargo Holiday wrote:
> >
> >> Honestly, I'm not tracking what the heck you're trying to do, but
> >> why not just subclass Window and add whatever variables and methods
> >> you'll need to your class?
> >> I may, as stated, not be following this well enough to grasp why
> >> this won't work, but it certainly seems like it would.
> >
> > What I'm trying to do is come up with a more reusable set of Windows
> > in which I can readily shift emphasis from one to another.
> >
> > The windows are to be part of a relational DB, each window holding
> > data for a particular Table (V4RB).
> >
> > Window1 holds data from the Parent table.
> > Window2 and Window3 hold data from the child tables.
> >
> > Window1 has a TabPanel in it. A number of different tabs do different
> > views.
> >
> > Tab1 - form view of Window1 record
> > Tab2 - list view (using ListBox) of Window1 records
> > Tab3 - part of form view info with list view (using ListBox) of some
> > of related records in Window2; click on a row in the LB and Window2
> > comes up in a form view showing that related record.
> > Tab4 - part of form view info with list view (using ListBox) of some
> > of related records in Window3; click on a row in the LB and Window3
> > comes up in a form view showing that related record.
> >
> > [Note: The click on an empty/non-existant record in the ListBox from
> > earlier was a way to generate a new related record. Click on a blank/
> > non-existant record row in the LB and it would generate a new record
> > in the related table. Still working on what to do about that.]
> >
> > My idea is to develop a proto-type or 'shell' system that can be
> > readily made into a completely different database system, cutting
> > down on development time by eliminating as much hard-wiring of
> > information as possible.
> >
> > My thought was that if RB had a way to recognize Windows as I am
> > pushing for, it would eliminate the need to write:
> >
> > Window2.fooProperty
> >
> > by putting in
> >
> > fooWindow.fooProperty // where fooWindow is a Window Property of
> > Window1 that I can set on the fly to either Window2 or Window3.
> >
> > Then, when the user clicks on Tab3 or Tab4 the system would
> > immediately recognize which is the Window/Table it should be
> > targeting based on something in the tab.
> >
> > Hope that alleviates your confusion. Better still, hope that gives
> > someone an idea on how to achieve what I'm trying to accomplish. Even
> > better, if they share that with me; neo-phyte that I am....

_______________________________________________
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>

Re: Window Variable
Date: 03.01.07 00:01 (Tue, 2 Jan 2007 16:01:59 -0700)
From: Chuck Pelto
Hi Carlos and Phil and Arnaud,

On Jan 2, 2007, at 1:11 PM, Carlos M wrote:

> Phil's suggestion is a good one and you can do more with that
> approach:
> - You can for example create a different class for each window (2
> and 3) if you
> have different properties on each window.
> - You can create methods on the classes to execute code on Window 2
> and 3, from
> Window 1.
> - You can even create new events for each window and fire them from
> window 1.
>
> If you have common code for both windows 2 and 3 you can create a
> main class
> with the common code and then create subclasses of the main class
> for each
> window to implement specific code for each one.
>
> If Window 2 and 3 have some methods that are specific for an app
> and that you
> don't want to include on the classes but you need to execute them
> via Window 1,
> you can implement a class interface for each Window (2 and 3).

I'm wrapping my mind around the concept, as I found a very good
reference up on Getting Started Archive. Something written back in
2005 by Mark Nutter; http://support.realsoftware.com/listarchives/
gettingstarted/2005-10/msg00796.html.

This gives a much better information than what some others around
here were offering.

It certainly isn't blatantly obvious how to go about achieving what
I'm after, but that item was a big help.

Have a Happy New Year.

Regards,

Chuck
_______________________________________________
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>

Window Variable
Date: 29.12.06 15:19 (Fri, 29 Dec 2006 07:19:49 -0700)
From: Chuck Pelto
Greetings All,

Has REALbasic developed a variable that can be used to hold a
reference to a Window?

I asked this about a year ago as it seemed to me that such a
capability would be beneficial for creating reusable objects; instead
of having to hardwire in a window reference you established the
variable as a property and then loaded that property with whatever
window you wanted to refer to.

Happy New Year....

Chuck
_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 16:18 (Fri, 29 Dec 2006 07:18:56 -0800)
From: CV

On Dec 29, 2006, at 6:19 AM, Chuck Pelto wrote:

> Greetings All,
>
> Has REALbasic developed a variable that can be used to hold a
> reference to a Window?
>
> I asked this about a year ago as it seemed to me that such a
> capability would be beneficial for creating reusable objects;
> instead of having to hardwire in a window reference you established
> the variable as a property and then loaded that property with
> whatever window you wanted to refer to.
>
> Happy New Year....
>

As described above, this has always been possible and is commonly
done. Perhaps you're suggesting a new wrinkle that I'm not grasping:

Add a property to Window2, for example: MyWindow as Window1

Then initialize it as you wish, for example:

MyWindow = new Window1 // MyWindow now holds a ref to Window1

Then you can access Window1 elements within Window2 as:
self.MyWindow.Whatever.

Or, from outside Window2 as: Window2.MyWindow.Whatever

If you want a more generic property, dim the property in Window2 as:

MyWindow as Window

You can assign any Window instance to MyWindow, and access any
element of the Window as for example:

MyWindow.Top = 5

But if you want access to a unique element that you have added to
say, Window1, then you need to cast MyWindow to a Window1:

If MyWindow IsA Window1 then
Window1(MyWindow).MyWindow1Method
End

Best,

Jack
_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 18:46 (Fri, 29 Dec 2006 10:46:13 -0700)
From: Chuck Pelto

On Dec 29, 2006, at 8:18 AM, CV wrote:

>
> On Dec 29, 2006, at 6:19 AM, Chuck Pelto wrote:
>
>> Greetings All,
>>
>> Has REALbasic developed a variable that can be used to hold a
>> reference to a Window?
>>
>> I asked this about a year ago as it seemed to me that such a
>> capability would be beneficial for creating reusable objects;
>> instead of having to hardwire in a window reference you
>> established the variable as a property and then loaded that
>> property with whatever window you wanted to refer to.
>>
>> Happy New Year....
>>
> As described above, this has always been possible and is commonly
> done. Perhaps you're suggesting a new wrinkle that I'm not grasping:
>
> Add a property to Window2, for example: MyWindow as Window1
>
> Then initialize it as you wish, for example:
>
> MyWindow = new Window1 // MyWindow now holds a ref to Window1
>
> Then you can access Window1 elements within Window2 as:
> self.MyWindow.Whatever.
>
> Or, from outside Window2 as: Window2.MyWindow.Whatever
>
> If you want a more generic property, dim the property in Window2 as:
>
> MyWindow as Window
>
> You can assign any Window instance to MyWindow, and access any
> element of the Window as for example:
>
> MyWindow.Top = 5
>
> But if you want access to a unique element that you have added to
> say, Window1, then you need to cast MyWindow to a Window1:
>
> If MyWindow IsA Window1 then
> Window1(MyWindow).MyWindow1Method
> End

Perhaps I'm not describing it properly.

I understand the new Window1 approach.

What I'm dealing with here is an existing Window.

I have several Windows.

Window1
Window2
Window3

In Window1 I have declared a property known as relatedWindow as Window

I set relatedWIndow to Window2 by the following:

relatedWindow = Window2

Then I try to set values of properties, e.g., a string property, in
Window2 via the relatedWindow property by:

relatedWindow.aProperty = "Something or other...."

This does not compile.

Hope that explains my situation better.

Regards,

Chuck

_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 21:38 (Fri, 29 Dec 2006 12:38:42 -0800)
From: Fargo Holiday
Howdy,
Honestly, I'm not tracking what the heck you're trying to do, but why
not just subclass Window and add whatever variables and methods you'll
need to your class?
I may, as stated, not be following this well enough to grasp why this
won't work, but it certainly seems like it would.

Later,
Fargo

Chuck Pelto wrote:
>
> On Dec 29, 2006, at 8:18 AM, CV wrote:
>
>>
>> On Dec 29, 2006, at 6:19 AM, Chuck Pelto wrote:
>>
>>> Greetings All,
>>>
>>> Has REALbasic developed a variable that can be used to hold a
>>> reference to a Window?
>>>
>>> I asked this about a year ago as it seemed to me that such a
>>> capability would be beneficial for creating reusable objects;
>>> instead of having to hardwire in a window reference you established
>>> the variable as a property and then loaded that property with
>>> whatever window you wanted to refer to.
>>>
>>> Happy New Year....
>>>
>> As described above, this has always been possible and is commonly
>> done. Perhaps you're suggesting a new wrinkle that I'm not grasping:
>>
>> Add a property to Window2, for example: MyWindow as Window1
>>
>> Then initialize it as you wish, for example:
>>
>> MyWindow = new Window1 // MyWindow now holds a ref to Window1
>>
>> Then you can access Window1 elements within Window2 as:
>> self.MyWindow.Whatever.
>>
>> Or, from outside Window2 as: Window2.MyWindow.Whatever
>>
>> If you want a more generic property, dim the property in Window2 as:
>>
>> MyWindow as Window
>>
>> You can assign any Window instance to MyWindow, and access any
>> element of the Window as for example:
>>
>> MyWindow.Top = 5
>>
>> But if you want access to a unique element that you have added to
>> say, Window1, then you need to cast MyWindow to a Window1:
>>
>> If MyWindow IsA Window1 then
>> Window1(MyWindow).MyWindow1Method
>> End
>
> Perhaps I'm not describing it properly.
>
> I understand the new Window1 approach.
>
> What I'm dealing with here is an existing Window.
>
> I have several Windows.
>
> Window1
> Window2
> Window3
>
> In Window1 I have declared a property known as relatedWindow as Window
>
> I set relatedWIndow to Window2 by the following:
>
> relatedWindow = Window2
>
> Then I try to set values of properties, e.g., a string property, in
> Window2 via the relatedWindow property by:
>
> relatedWindow.aProperty = "Something or other...."
>
> This does not compile.
>
> Hope that explains my situation better.
>
> Regards,
>
> Chuck
>
> _______________________________________________
> 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>
_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 19:03 (Fri, 29 Dec 2006 11:03:02 -0700)
From: Norman Palardy

On Dec 29, 2006, at 10:46 AM, Chuck Pelto wrote:

> Perhaps I'm not describing it properly.
>
> I understand the new Window1 approach.
>
> What I'm dealing with here is an existing Window.
>
> I have several Windows.
>
> Window1
> Window2
> Window3
>
> In Window1 I have declared a property known as relatedWindow as Window
>
> I set relatedWIndow to Window2 by the following:
>
> relatedWindow = Window2
>
> Then I try to set values of properties, e.g., a string property, in
> Window2 via the relatedWindow property by:
>
> relatedWindow.aProperty = "Something or other...."
>
> This does not compile.
>
> Hope that explains my situation better.

The relatedWindow is not JUST a plain Window, it is a Window2
A Window does not have a property called "aProperty" but a Window2 does
The problem is that you're not using the right kind of variable

If you declare relatedWindow as Window2 this would work



_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 19:03 (Fri, 29 Dec 2006 13:03:18 -0500)
From: Charles Yeomans

On Dec 29, 2006, at 12:46 PM, Chuck Pelto wrote:

>
> On Dec 29, 2006, at 8:18 AM, CV wrote:
>
>>
>> On Dec 29, 2006, at 6:19 AM, Chuck Pelto wrote:
>>
>>> Greetings All,
>>>
>>> Has REALbasic developed a variable that can be used to hold a
>>> reference to a Window?
>>>
>>> I asked this about a year ago as it seemed to me that such a
>>> capability would be beneficial for creating reusable objects;
>>> instead of having to hardwire in a window reference you
>>> established the variable as a property and then loaded that
>>> property with whatever window you wanted to refer to.
>>>
>>> Happy New Year....
>>>
>> As described above, this has always been possible and is commonly
>> done. Perhaps you're suggesting a new wrinkle that I'm not grasping:
>>
>> Add a property to Window2, for example: MyWindow as Window1
>>
>> Then initialize it as you wish, for example:
>>
>> MyWindow = new Window1 // MyWindow now holds a ref to Window1
>>
>> Then you can access Window1 elements within Window2 as:
>> self.MyWindow.Whatever.
>>
>> Or, from outside Window2 as: Window2.MyWindow.Whatever
>>
>> If you want a more generic property, dim the property in Window2 as:
>>
>> MyWindow as Window
>>
>> You can assign any Window instance to MyWindow, and access any
>> element of the Window as for example:
>>
>> MyWindow.Top = 5
>>
>> But if you want access to a unique element that you have added to
>> say, Window1, then you need to cast MyWindow to a Window1:
>>
>> If MyWindow IsA Window1 then
>> Window1(MyWindow).MyWindow1Method
>> End
>
> Perhaps I'm not describing it properly.
>
> I understand the new Window1 approach.
>
> What I'm dealing with here is an existing Window.
>
> I have several Windows.
>
> Window1
> Window2
> Window3
>
> In Window1 I have declared a property known as relatedWindow as Window
>
> I set relatedWIndow to Window2 by the following:
>
> relatedWindow = Window2
>
> Then I try to set values of properties, e.g., a string property, in
> Window2 via the relatedWindow property by:
>
> relatedWindow.aProperty = "Something or other...."
>
> This does not compile.

The compiler only knows that relatedWindow is of type Window. Thus
it does not recognize any Window2 properties. You can define
relatedWindow to be of type Window2. Or you can cast the reference
as follows.

Window2(relatedWindow).aProperty

Charles Yeomans
_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 19:39 (Fri, 29 Dec 2006 10:39:04 -0800)
From: CV

On Dec 29, 2006, at 9:46 AM, Chuck Pelto wrote:

>
> On Dec 29, 2006, at 8:18 AM, CV wrote:
>
>>
>> On Dec 29, 2006, at 6:19 AM, Chuck Pelto wrote:
>>
>>> Greetings All,
>>>
>>> Has REALbasic developed a variable that can be used to hold a
>>> reference to a Window?
>>>
>>> I asked this about a year ago as it seemed to me that such a
>>> capability would be beneficial for creating reusable objects;
>>> instead of having to hardwire in a window reference you
>>> established the variable as a property and then loaded that
>>> property with whatever window you wanted to refer to.
>>>
>>> Happy New Year....
>>>
>>>
>> As described above, this has always been possible and is commonly
>> done. Perhaps you're suggesting a new wrinkle that I'm not grasping:
>>
>> Add a property to Window2, for example: MyWindow as Window1
>>
>> Then initialize it as you wish, for example:
>>
>> MyWindow = new Window1 // MyWindow now holds a ref to Window1
>>
>> Then you can access Window1 elements within Window2 as:
>> self.MyWindow.Whatever.
>>
>> Or, from outside Window2 as: Window2.MyWindow.Whatever
>>
>> If you want a more generic property, dim the property in Window2 as:
>>
>> MyWindow as Window
>>
>> You can assign any Window instance to MyWindow, and access any
>> element of the Window as for example:
>>
>> MyWindow.Top = 5
>>
>> But if you want access to a unique element that you have added to
>> say, Window1, then you need to cast MyWindow to a Window1:
>>
>> If MyWindow IsA Window1 then
>> Window1(MyWindow).MyWindow1Method
>> End
>>
> Perhaps I'm not describing it properly.
>
> I understand the new Window1 approach.
>
> What I'm dealing with here is an existing Window.
>
> I have several Windows.
>
> Window1
> Window2
> Window3
>
> In Window1 I have declared a property known as relatedWindow as Window
>
> I set relatedWIndow to Window2 by the following:
>
> relatedWindow = Window2
>
> Then I try to set values of properties, e.g., a string property, in
> Window2 via the relatedWindow property by:
>
> relatedWindow.aProperty = "Something or other...."
>

Right, that reflects what I was trying to explain. RelatedWindow is
declared as Window, so it exposes <only> the properties/methods
belonging to Rb's Window class(those listed in the
LanguageReference). So you can do things like RelatedWindow.Top = 5.
But to expose methods/properties that that you have added to Window2,
which are not part of Rb's Window class, you have to cast
RelatedWindow from a Window to a Window2:

Window2(RelatedWindow).aProperty = "Something or other..."

That works provided RelatedWindow actually holds an instance of
Window2 at the time of the reference call. Otherwise the compiler
will balk. Since you may also intend to assign Window2 and Window3
into RelatedWindow then you will probably need to check using IsA
before addressing methods/properties unique to them or if assigning
unique values:

If RelatedWindow IsA Window2 then
Window2(RelatedWindow).aProperty = "Hansel" // elements or
assignments unique to Window2
Elseif RelatedWindow IsA Window3 then
Window3(RelatedWindow).aProperty = "Gretel" // elements or
assignments unique to Window3
End

The point to keep in mind is that the dim statement controls the
elements that the object can expose directly within the inheritance
hierarchy.

Best,

Jack

_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 21:15 (Fri, 29 Dec 2006 13:15:07 -0700)
From: Chuck Pelto

On Dec 29, 2006, at 11:03 AM, Norman Palardy wrote:

>
> On Dec 29, 2006, at 10:46 AM, Chuck Pelto wrote:
>
>> Perhaps I'm not describing it properly.
>>
>> I understand the new Window1 approach.
>>
>> What I'm dealing with here is an existing Window.
>>
>> I have several Windows.
>>
>> Window1
>> Window2
>> Window3
>>
>> In Window1 I have declared a property known as relatedWindow as
>> Window
>>
>> I set relatedWIndow to Window2 by the following:
>>
>> relatedWindow = Window2
>>
>> Then I try to set values of properties, e.g., a string property,
>> in Window2 via the relatedWindow property by:
>>
>> relatedWindow.aProperty = "Something or other...."
>>
>> This does not compile.
>>
>> Hope that explains my situation better.
>
> The relatedWindow is not JUST a plain Window, it is a Window2
> A Window does not have a property called "aProperty" but a Window2
> does
> The problem is that you're not using the right kind of variable

Actually, aProperty is just a generic name for any sort of property
that one could declare. Sort of like myFoo.

> If you declare relatedWindow as Window2 this would work

The problem is that I want something that is more generic for ANY
sort of Window. Not just a Window2 or Window3. I'm looking for
something that can be set to either a Window2 or Window3 or WindowX.

Regards,

Chuck

_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 21:25 (Fri, 29 Dec 2006 13:25:36 -0700)
From: Norman Palardy

On Dec 29, 2006, at 1:15 PM, Chuck Pelto wrote:

>> The relatedWindow is not JUST a plain Window, it is a Window2
>> A Window does not have a property called "aProperty" but a Window2
>> does
>> The problem is that you're not using the right kind of variable
>
> Actually, aProperty is just a generic name for any sort of property
> that one could declare. Sort of like myFoo.
>
>> If you declare relatedWindow as Window2 this would work
>
> The problem is that I want something that is more generic for ANY
> sort of Window. Not just a Window2 or Window3. I'm looking for
> something that can be set to either a Window2 or Window3 or WindowX.

You can - a Window

BUT (as others have pointed out) this only gives you access to the
properties of an item that is of the Window Class and none of the
extra properties you added because they do not exist in a Window
They only exist in your new Window instances, which are both a
"Window" and maybe a "Window1", or "Window2" etc

In order to access those additional properties you have to know what
kind of Window it is and treat it as such

A property of that type OR a cast (as Charles and others pointe out)
is required

No magic required
_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 21:29 (Fri, 29 Dec 2006 13:29:47 -0700)
From: Chuck Pelto

On Dec 29, 2006, at 11:03 AM, Charles Yeomans wrote:

>
> On Dec 29, 2006, at 12:46 PM, Chuck Pelto wrote:
>
>>
>> On Dec 29, 2006, at 8:18 AM, CV wrote:
>>
>>>
>>> On Dec 29, 2006, at 6:19 AM, Chuck Pelto wrote:
>>>
>>>> Greetings All,
>>>>
>>>> Has REALbasic developed a variable that can be used to hold a
>>>> reference to a Window?
>>>>
>>>> I asked this about a year ago as it seemed to me that such a
>>>> capability would be beneficial for creating reusable objects;
>>>> instead of having to hardwire in a window reference you
>>>> established the variable as a property and then loaded that
>>>> property with whatever window you wanted to refer to.
>>>>
>>>> Happy New Year....
>>>>
>>>
>>> As described above, this has always been possible and is commonly
>>> done. Perhaps you're suggesting a new wrinkle that I'm not grasping:
>>>
>>> Add a property to Window2, for example: MyWindow as Window1
>>>
>>> Then initialize it as you wish, for example:
>>>
>>> MyWindow = new Window1 // MyWindow now holds a ref to Window1
>>>
>>> Then you can access Window1 elements within Window2 as:
>>> self.MyWindow.Whatever.
>>>
>>> Or, from outside Window2 as: Window2.MyWindow.Whatever
>>>
>>>
>>> If you want a more generic property, dim the property in Window2 as:
>>>
>>> MyWindow as Window
>>>
>>> You can assign any Window instance to MyWindow, and access any
>>> element of the Window as for example:
>>>
>>> MyWindow.Top = 5
>>>
>>> But if you want access to a unique element that you have added to
>>> say, Window1, then you need to cast MyWindow to a Window1:
>>>
>>> If MyWindow IsA Window1 then
>>> Window1(MyWindow).MyWindow1Method
>>> End
>>
>> Perhaps I'm not describing it properly.
>>
>> I understand the new Window1 approach.
>>
>> What I'm dealing with here is an existing Window.
>>
>> I have several Windows.
>>
>> Window1
>> Window2
>> Window3
>>
>> In Window1 I have declared a property known as relatedWindow as
>> Window
>>
>> I set relatedWIndow to Window2 by the following:
>>
>> relatedWindow = Window2
>>
>> Then I try to set values of properties, e.g., a string property,
>> in Window2 via the relatedWindow property by:
>>
>> relatedWindow.aProperty = "Something or other...."
>>
>> This does not compile.
>
> The compiler only knows that relatedWindow is of type Window. Thus
> it does not recognize any Window2 properties. You can define
> relatedWindow to be of type Window2. Or you can cast the reference
> as follows.
>
> Window2(relatedWindow).aProperty
THAT looks like an interesting idea. But I doubt if it will satisfy
what I'm attempting.

I still would have to hard-code in the window somewhere in the system
instead of passing the window name from someplace else in the
application. May as well just use Window2.aProperty = ..... The
relatedWindow is superfluous.

So, I take it that RB has not been modified to accept this sort of
passing of windows.

Too bad.....

Regards,

Chuck



_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 22:01 (Fri, 29 Dec 2006 14:01:33 -0700)
From: Norman Palardy

On Dec 29, 2006, at 1:29 PM, Chuck Pelto wrote:
>> The compiler only knows that relatedWindow is of type Window.
>> Thus it does not recognize any Window2 properties. You can define
>> relatedWindow to be of type Window2. Or you can cast the
>> reference as follows.
>>
>> Window2(relatedWindow).aProperty >
> THAT looks like an interesting idea. But I doubt if it will satisfy
> what I'm attempting.
>
> I still would have to hard-code in the window somewhere in the
> system instead of passing the window name from someplace else in
> the application. May as well just use Window2.aProperty = ..... The
> relatedWindow is superfluous.
>
> So, I take it that RB has not been modified to accept this sort of
> passing of windows.
>
> Too bad.....

And it probably will never be
You're trying to get the value of a property from a subclass via a
reference to the super class
There's a way to do this already

_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 22:42 (Fri, 29 Dec 2006 14:42:48 -0700)
From: Chuck Pelto
Hi Fargo,

On Dec 29, 2006, at 1:38 PM, Fargo Holiday wrote:

> Honestly, I'm not tracking what the heck you're trying to do, but
> why not just subclass Window and add whatever variables and methods
> you'll need to your class?
> I may, as stated, not be following this well enough to grasp why
> this won't work, but it certainly seems like it would.

What I'm trying to do is come up with a more reusable set of Windows
in which I can readily shift emphasis from one to another.

The windows are to be part of a relational DB, each window holding
data for a particular Table (V4RB).

Window1 holds data from the Parent table.
Window2 and Window3 hold data from the child tables.

Window1 has a TabPanel in it. A number of different tabs do different
views.

Tab1 - form view of Window1 record
Tab2 - list view (using ListBox) of Window1 records
Tab3 - part of form view info with list view (using ListBox) of some
of related records in Window2; click on a row in the LB and Window2
comes up in a form view showing that related record.
Tab4 - part of form view info with list view (using ListBox) of some
of related records in Window3; click on a row in the LB and Window3
comes up in a form view showing that related record.

[Note: The click on an empty/non-existant record in the ListBox from
earlier was a way to generate a new related record. Click on a blank/
non-existant record row in the LB and it would generate a new record
in the related table. Still working on what to do about that.]

My idea is to develop a proto-type or 'shell' system that can be
readily made into a completely different database system, cutting
down on development time by eliminating as much hard-wiring of
information as possible.

My thought was that if RB had a way to recognize Windows as I am
pushing for, it would eliminate the need to write:

Window2.fooProperty

by putting in

fooWindow.fooProperty // where fooWindow is a Window Property of
Window1 that I can set on the fly to either Window2 or Window3.

Then, when the user clicks on Tab3 or Tab4 the system would
immediately recognize which is the Window/Table it should be
targeting based on something in the tab.

Hope that alleviates your confusion. Better still, hope that gives
someone an idea on how to achieve what I'm trying to accomplish. Even
better, if they share that with me; neo-phyte that I am....

Have a Happy New Year....

Regards,

Chuck
_______________________________________________
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>

Re: Window Variable
Date: 30.12.06 14:25 (Sat, 30 Dec 2006 08:25:51 -0500)
From: Phil Heycock
Create a subclass of Window: flexibleWindow, or some such.

Give flexibleWindow the properties that you will want to be addressing via
the 'relatedWindow' reference in Window1.

Give Window1 a property: relatedWindow As flexibleWindow

Make flexibleWindow the SUPER for Window2 and Window3.

HTH

P.
****************

on 12/29/06 4:42 PM, Chuck Pelto at <email address removed> wrote:

> Hi Fargo,
>
> On Dec 29, 2006, at 1:38 PM, Fargo Holiday wrote:
>
>> Honestly, I'm not tracking what the heck you're trying to do, but
>> why not just subclass Window and add whatever variables and methods
>> you'll need to your class?
>> I may, as stated, not be following this well enough to grasp why
>> this won't work, but it certainly seems like it would.
>
> What I'm trying to do is come up with a more reusable set of Windows
> in which I can readily shift emphasis from one to another.
>
> The windows are to be part of a relational DB, each window holding
> data for a particular Table (V4RB).
>
> Window1 holds data from the Parent table.
> Window2 and Window3 hold data from the child tables.
>
> Window1 has a TabPanel in it. A number of different tabs do different
> views.
>
> Tab1 - form view of Window1 record
> Tab2 - list view (using ListBox) of Window1 records
> Tab3 - part of form view info with list view (using ListBox) of some
> of related records in Window2; click on a row in the LB and Window2
> comes up in a form view showing that related record.
> Tab4 - part of form view info with list view (using ListBox) of some
> of related records in Window3; click on a row in the LB and Window3
> comes up in a form view showing that related record.
>
> [Note: The click on an empty/non-existant record in the ListBox from
> earlier was a way to generate a new related record. Click on a blank/
> non-existant record row in the LB and it would generate a new record
> in the related table. Still working on what to do about that.]
>
> My idea is to develop a proto-type or 'shell' system that can be
> readily made into a completely different database system, cutting
> down on development time by eliminating as much hard-wiring of
> information as possible.
>
> My thought was that if RB had a way to recognize Windows as I am
> pushing for, it would eliminate the need to write:
>
> Window2.fooProperty
>
> by putting in
>
> fooWindow.fooProperty // where fooWindow is a Window Property of
> Window1 that I can set on the fly to either Window2 or Window3.
>
> Then, when the user clicks on Tab3 or Tab4 the system would
> immediately recognize which is the Window/Table it should be
> targeting based on something in the tab.
>
> Hope that alleviates your confusion. Better still, hope that gives
> someone an idea on how to achieve what I'm trying to accomplish. Even
> better, if they share that with me; neo-phyte that I am....
>
> Have a Happy New Year....
>
> Regards,
>

_______________________________________________
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>

RE: Window Variable
Date: 30.12.06 21:06 (Sat, 30 Dec 2006 20:06:26 -0000)
From: Carlos M
Phil's suggestion is a good one and you can do more with that approach:
- You can for example create a different class for each window (2 and 3) if you
have different properties on each window.
- You can create methods on the classes to execute code on Window 2 and 3, from
Window 1.
- You can even create new events for each window and fire them from window 1.

If you have common code for both windows 2 and 3 you can create a main class
with the common code and then create subclasses of the main class for each
window to implement specific code for each one.

If Window 2 and 3 have some methods that are specific for an app and that you
don't want to include on the classes but you need to execute them via Window 1,
you can implement a class interface for each Window (2 and 3).

Carlos

On Dec 30, 2006 1:26 PM, Phil Heycock wrote:
> Create a subclass of Window: flexibleWindow, or some such.
>
> Give flexibleWindow the properties that you will want to be addressing via
> the 'relatedWindow' reference in Window1.
>
> Give Window1 a property: relatedWindow As flexibleWindow
>
> Make flexibleWindow the SUPER for Window2 and Window3.
>
> HTH
>
> P.
> ****************
>
> on 12/29/06 4:42 PM, Chuck Pelto at <email address removed> wrote:
>
> > Hi Fargo,
> >
> > On Dec 29, 2006, at 1:38 PM, Fargo Holiday wrote:
> >
> >> Honestly, I'm not tracking what the heck you're trying to do, but
> >> why not just subclass Window and add whatever variables and methods
> >> you'll need to your class?
> >> I may, as stated, not be following this well enough to grasp why
> >> this won't work, but it certainly seems like it would.
> >
> > What I'm trying to do is come up with a more reusable set of Windows
> > in which I can readily shift emphasis from one to another.
> >
> > The windows are to be part of a relational DB, each window holding
> > data for a particular Table (V4RB).
> >
> > Window1 holds data from the Parent table.
> > Window2 and Window3 hold data from the child tables.
> >
> > Window1 has a TabPanel in it. A number of different tabs do different
> > views.
> >
> > Tab1 - form view of Window1 record
> > Tab2 - list view (using ListBox) of Window1 records
> > Tab3 - part of form view info with list view (using ListBox) of some
> > of related records in Window2; click on a row in the LB and Window2
> > comes up in a form view showing that related record.
> > Tab4 - part of form view info with list view (using ListBox) of some
> > of related records in Window3; click on a row in the LB and Window3
> > comes up in a form view showing that related record.
> >
> > [Note: The click on an empty/non-existant record in the ListBox from
> > earlier was a way to generate a new related record. Click on a blank/
> > non-existant record row in the LB and it would generate a new record
> > in the related table. Still working on what to do about that.]
> >
> > My idea is to develop a proto-type or 'shell' system that can be
> > readily made into a completely different database system, cutting
> > down on development time by eliminating as much hard-wiring of
> > information as possible.
> >
> > My thought was that if RB had a way to recognize Windows as I am
> > pushing for, it would eliminate the need to write:
> >
> > Window2.fooProperty
> >
> > by putting in
> >
> > fooWindow.fooProperty // where fooWindow is a Window Property of
> > Window1 that I can set on the fly to either Window2 or Window3.
> >
> > Then, when the user clicks on Tab3 or Tab4 the system would
> > immediately recognize which is the Window/Table it should be
> > targeting based on something in the tab.
> >
> > Hope that alleviates your confusion. Better still, hope that gives
> > someone an idea on how to achieve what I'm trying to accomplish. Even
> > better, if they share that with me; neo-phyte that I am....

_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 22:43 (Fri, 29 Dec 2006 14:43:42 -0700)
From: Chuck Pelto

On Dec 29, 2006, at 2:01 PM, Norman Palardy wrote:

> There's a way to do this already

And, praytell....

...what is that way?

Regards,

Chuck
_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 23:00 (Fri, 29 Dec 2006 15:00:06 -0700)
From: Norman Palardy

On Dec 29, 2006, at 2:43 PM, Chuck Pelto wrote:

>
> On Dec 29, 2006, at 2:01 PM, Norman Palardy wrote:
>
>> There's a way to do this already
>
> And, praytell....
>
> ...what is that way?

We've already shown you
Several times

That IS how to do it and do it right

_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 23:04 (Fri, 29 Dec 2006 14:04:39 -0800)
From: CV

On Dec 29, 2006, at 1:43 PM, Chuck Pelto wrote:

>
> On Dec 29, 2006, at 2:01 PM, Norman Palardy wrote:
>
>> There's a way to do this already
>>
> And, praytell....
>
> ...what is that way?
>

Study the existing posts in this thread which explain how to do this
in some detail.

Best,

Jack
_______________________________________________
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>

Re: Window Variable
Date: 29.12.06 23:20 (Fri, 29 Dec 2006 23:20:31 +0100)
From: Arnaud Nicolet
Le 29 déc. 06 à 21:15 Soir, Chuck Pelto a écrit:

> On Dec 29, 2006, at 11:03 AM, Norman Palardy wrote:
>
>>
>> On Dec 29, 2006, at 10:46 AM, Chuck Pelto wrote:
>>
>>> Perhaps I'm not describing it properly.
>>>
>>> I understand the new Window1 approach.
>>>
>>> What I'm dealing with here is an existing Window.
>>>
>>> I have several Windows.
>>>
>>> Window1
>>> Window2
>>> Window3
>>>
>>> In Window1 I have declared a property known as relatedWindow as
>>> Window
>>>
>>> I set relatedWIndow to Window2 by the following:
>>>
>>> relatedWindow = Window2
>>>
>>> Then I try to set values of properties, e.g., a string property,
>>> in Window2 via the relatedWindow property by:
>>>
>>> relatedWindow.aProperty = "Something or other...."
>>>
>>> This does not compile.
>>>
>>> Hope that explains my situation better.
>>
>> The relatedWindow is not JUST a plain Window, it is a Window2
>> A Window does not have a property called "aProperty" but a Window2
>> does
>> The problem is that you're not using the right kind of variable
>
> Actually, aProperty is just a generic name for any sort of property
> that one could declare. Sort of like myFoo.
>
>> If you declare relatedWindow as Window2 this would work
>
> The problem is that I want something that is more generic for ANY
> sort of Window. Not just a Window2 or Window3. I'm looking for
> something that can be set to either a Window2 or Window3 or WindowX.

So, if I understand correctly, you have, say, 3 windows (Win1, Win2,
Win3). All have a property, say MyProperty As Boolean. In your main
window (an other window than Win1, Win2 and Win3), you have a
property, e.g MyWindow As window. MyWindow can be a Win1, Win2 or a
Win3. You want to modify the MyWindow.MyProperty since these 3
windows has a MyProperty property. Is that right?

Well, I already tried. The problem is that you can't subclass a
window (you can't have a class whose Super is "window", in RB).
You will have to do so (if I understood your question):

if MyWindow isa Win1 then
Win1(MyWindow).MyProperty=true
elseif MyWindow isa Win2 then
Win2(MyWindow).MyProperty=true
elseif MyWindow isa Win3 then
Win3(MyWindow).MyProperty=true
end if

Hope this help_______________________________________________
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>

Re: Window Variable
Date: 30.12.06 13:31 (Sat, 30 Dec 2006 04:31:21 -0800)
From: CV

On Dec 29, 2006, at 2:20 PM, Arnaud Nicolet wrote:

> Well, I already tried. The problem is that you can't subclass a
> window (you can't have a class whose Super is "window", in RB).
>

Since some versions ago, we can create a custom class whose super is
Window, then assign this custom class as the super of other windows.

Best,

Jack
_______________________________________________
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>

Re: Window Variable
Date: 31.12.06 00:40 (Sun, 31 Dec 2006 00:40:52 +0100)
From: Arnaud Nicolet
Le 30 déc. 06 à 13:31 Soir, CV a écrit:

>
> On Dec 29, 2006, at 2:20 PM, Arnaud Nicolet wrote:
>
>> Well, I already tried. The problem is that you can't subclass a
>> window (you can't have a class whose Super is "window", in RB).
>>
> Since some versions ago, we can create a custom class whose super
> is Window, then assign this custom class as the super of other
> windows.

Ok, that's good to know. Seems like RB 5.5 is getting always older
(sadly since I'll continue using it).

I made an application where 3 windows had 50 controls and provided
the same functions. I had to cast all these 50x3 controls in an
external class like in my example. Would have been easier with newer
versions!

Thank you for this information._______________________________________________
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>