Discussion:
Window Variable
Chuck Pelto
2006-12-29 14:19:49 UTC
Permalink
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
CV
2006-12-29 15:18:56 UTC
Permalink
Post by 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....
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
Chuck Pelto
2006-12-29 17:46:13 UTC
Permalink
Post by CV
Post by 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....
As described above, this has always been possible and is commonly
Add a property to Window2, for example: MyWindow as Window1
MyWindow = new Window1 // MyWindow now holds a ref to Window1
self.MyWindow.Whatever.
Or, from outside Window2 as: Window2.MyWindow.Whatever
MyWindow as Window
You can assign any Window instance to MyWindow, and access any
MyWindow.Top = 5
But if you want access to a unique element that you have added to
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
Charles Yeomans
2006-12-29 18:03:18 UTC
Permalink
Post by Chuck Pelto
Post by CV
Post by 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....
As described above, this has always been possible and is commonly
Add a property to Window2, for example: MyWindow as Window1
MyWindow = new Window1 // MyWindow now holds a ref to Window1
self.MyWindow.Whatever.
Or, from outside Window2 as: Window2.MyWindow.Whatever
MyWindow as Window
You can assign any Window instance to MyWindow, and access any
MyWindow.Top = 5
But if you want access to a unique element that you have added to
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
relatedWindow = Window2
Then I try to set values of properties, e.g., a string property, in
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
Chuck Pelto
2006-12-29 20:29:47 UTC
Permalink
Post by Charles Yeomans
Post by Chuck Pelto
Post by CV
Post by 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....
As described above, this has always been possible and is commonly
Add a property to Window2, for example: MyWindow as Window1
MyWindow = new Window1 // MyWindow now holds a ref to Window1
self.MyWindow.Whatever.
Or, from outside Window2 as: Window2.MyWindow.Whatever
MyWindow as Window
You can assign any Window instance to MyWindow, and access any
MyWindow.Top = 5
But if you want access to a unique element that you have added to
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
relatedWindow = Window2
Then I try to set values of properties, e.g., a string property,
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
Norman Palardy
2006-12-29 21:01:33 UTC
Permalink
Post by Chuck Pelto
Post by Charles Yeomans
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
Chuck Pelto
2006-12-29 21:43:42 UTC
Permalink
Post by Norman Palardy
There's a way to do this already
And, praytell....

...what is that way?

Regards,

Chuck
Norman Palardy
2006-12-29 22:00:06 UTC
Permalink
Post by Chuck Pelto
Post by Norman Palardy
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
CV
2006-12-29 22:04:39 UTC
Permalink
Post by Chuck Pelto
Post by Norman Palardy
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
Norman Palardy
2006-12-29 18:03:02 UTC
Permalink
Post by Chuck Pelto
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
relatedWindow = Window2
Then I try to set values of properties, e.g., a string property, in
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
Chuck Pelto
2006-12-29 20:15:07 UTC
Permalink
Post by Norman Palardy
Post by Chuck Pelto
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
relatedWindow = Window2
Then I try to set values of properties, e.g., a string property,
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.
Post by Norman Palardy
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
Norman Palardy
2006-12-29 20:25:36 UTC
Permalink
Post by Chuck Pelto
Post by Norman Palardy
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.
Post by Norman Palardy
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
Arnaud Nicolet
2006-12-29 22:20:31 UTC
Permalink
Post by Chuck Pelto
Post by Norman Palardy
Post by Chuck Pelto
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
relatedWindow = Window2
Then I try to set values of properties, e.g., a string property,
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.
Post by Norman Palardy
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
CV
2006-12-30 12:31:21 UTC
Permalink
Post by Arnaud Nicolet
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
Arnaud Nicolet
2006-12-30 23:40:52 UTC
Permalink
Post by CV
Post by Arnaud Nicolet
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.
CV
2006-12-29 18:39:04 UTC
Permalink
Post by Chuck Pelto
Post by CV
Post by 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....
As described above, this has always been possible and is commonly
Add a property to Window2, for example: MyWindow as Window1
MyWindow = new Window1 // MyWindow now holds a ref to Window1
self.MyWindow.Whatever.
Or, from outside Window2 as: Window2.MyWindow.Whatever
MyWindow as Window
You can assign any Window instance to MyWindow, and access any
MyWindow.Top = 5
But if you want access to a unique element that you have added to
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
relatedWindow = Window2
Then I try to set values of properties, e.g., a string property, in
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
Fargo Holiday
2006-12-29 20:38:42 UTC
Permalink
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
Post by Chuck Pelto
Post by CV
Post by 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....
As described above, this has always been possible and is commonly
Add a property to Window2, for example: MyWindow as Window1
MyWindow = new Window1 // MyWindow now holds a ref to Window1
self.MyWindow.Whatever.
Or, from outside Window2 as: Window2.MyWindow.Whatever
MyWindow as Window
You can assign any Window instance to MyWindow, and access any
MyWindow.Top = 5
But if you want access to a unique element that you have added to
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
relatedWindow = Window2
Then I try to set values of properties, e.g., a string property, in
relatedWindow.aProperty = "Something or other...."
This does not compile.
Hope that explains my situation better.
Regards,
Chuck
_______________________________________________
<http://www.realsoftware.com/support/listmanager/>
<http://support.realsoftware.com/listarchives/lists.html>
Chuck Pelto
2006-12-29 21:42:48 UTC
Permalink
Hi Fargo,
Post by Fargo Holiday
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
Phil Heycock
2006-12-30 13:25:51 UTC
Permalink
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.
****************
Post by Chuck Pelto
Hi Fargo,
Post by Fargo Holiday
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
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,
Carlos M
2006-12-30 20:06:26 UTC
Permalink
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
Post by 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.
****************
Post by Chuck Pelto
Hi Fargo,
Post by Fargo Holiday
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
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....
Carlos M
2007-01-02 20:11:11 UTC
Permalink
I'm sending the email below again, as I received the following error:
The following message could not be delivered to "Getting Started"
<***@lists.realsoftware.com> 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
Post by 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.
****************
Post by Chuck Pelto
Hi Fargo,
Post by Fargo Holiday
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
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....
Chuck Pelto
2007-01-02 23:01:59 UTC
Permalink
Hi Carlos and Phil and Arnaud,
Post by Carlos M
Phil's suggestion is a good one and you can do more with that
- 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

Loading...