Discussion:
using subform as a container
(too old to reply)
Jan Hoelterling
2008-12-04 19:18:08 UTC
Permalink
topMost = true
smallTitle = true
sizeable = false
moveable = false
sysMenu = false
escExit = false
maximize = false
minimize = false

Regards,

Jan
Glenn Johansen
2008-12-04 19:32:14 UTC
Permalink
Excelent! Thanks Jan.

This works and I can place a rectangle behind it for a border and scroll the
contents as well with the mouse. .

SWEET!

I'll post a turnkey for anyone that wants to play with this idea.


- g
Post by Jan Hoelterling
topMost = true
smallTitle = true
sizeable = false
moveable = false
sysMenu = false
escExit = false
maximize = false
minimize = false
Regards,
Jan
Greg Hill
2008-12-04 19:51:56 UTC
Permalink
Post by Glenn Johansen
Excelent! Thanks Jan.
This works and I can place a rectangle behind it for a border and scroll
the contents as well with the mouse. .
SWEET!
I'll post a turnkey for anyone that wants to play with this idea.
- g
Post by Jan Hoelterling
topMost = true
smallTitle = true
sizeable = false
moveable = false
sysMenu = false
escExit = false
maximize = false
minimize = false
I was pondering if that would work the other day. In c# there is a thing
called Panel, it is the Container for C# BUT it has an autoscroll bar
feature so that you can put a control on the panel that might grow beyond
the defined width and height.
So I thought the same thing could possibly be done with a subform as you
have done.

It would be convenient to have a sample<g>

Greg Hill
Greg Hill
2008-12-04 23:36:01 UTC
Permalink
Cool, I will take a look.
Thank you,

Greg Hill
Here you go, very rough, but works great.
Post by Greg Hill
Post by Glenn Johansen
Excelent! Thanks Jan.
This works and I can place a rectangle behind it for a border and scroll
the contents as well with the mouse. .
SWEET!
I'll post a turnkey for anyone that wants to play with this idea.
- g
Post by Jan Hoelterling
topMost = true
smallTitle = true
sizeable = false
moveable = false
sysMenu = false
escExit = false
maximize = false
minimize = false
I was pondering if that would work the other day. In c# there is a thing
called Panel, it is the Container for C# BUT it has an autoscroll bar
feature so that you can put a control on the panel that might grow beyond
the defined width and height.
So I thought the same thing could possibly be done with a subform as you
have done.
It would be convenient to have a sample<g>
Greg Hill
Greg Hill
2008-12-04 23:43:07 UTC
Permalink
It does the trick don't it<g>
I don't see drawbacks do you?

Greg Hill
Here you go, very rough, but works great.
Post by Greg Hill
Post by Glenn Johansen
Excelent! Thanks Jan.
This works and I can place a rectangle behind it for a border and scroll
the contents as well with the mouse. .
SWEET!
I'll post a turnkey for anyone that wants to play with this idea.
- g
Post by Jan Hoelterling
topMost = true
smallTitle = true
sizeable = false
moveable = false
sysMenu = false
escExit = false
maximize = false
minimize = false
I was pondering if that would work the other day. In c# there is a thing
called Panel, it is the Container for C# BUT it has an autoscroll bar
feature so that you can put a control on the panel that might grow beyond
the defined width and height.
So I thought the same thing could possibly be done with a subform as you
have done.
It would be convenient to have a sample<g>
Greg Hill
Glenn Johansen
2008-12-05 00:34:34 UTC
Permalink
The only issue that I have at this time, is the forms "activecontrol" does
not switch to the "subform".
When focus is on the subform, the parent form's activecontrol is the
pushbutton.

Bug maybe ?? Is a subform considered a control ?? I use the activecontrol
alot in global key routines.

- glenn
Post by Greg Hill
It does the trick don't it<g>
I don't see drawbacks do you?
Greg Hill
Here you go, very rough, but works great.
Post by Greg Hill
Post by Glenn Johansen
Excelent! Thanks Jan.
This works and I can place a rectangle behind it for a border and scroll
the contents as well with the mouse. .
SWEET!
I'll post a turnkey for anyone that wants to play with this idea.
- g
Post by Jan Hoelterling
topMost = true
smallTitle = true
sizeable = false
moveable = false
sysMenu = false
escExit = false
maximize = false
minimize = false
I was pondering if that would work the other day. In c# there is a thing
called Panel, it is the Container for C# BUT it has an autoscroll bar
feature so that you can put a control on the panel that might grow beyond
the defined width and height.
So I thought the same thing could possibly be done with a subform as you
have done.
It would be convenient to have a sample<g>
Greg Hill
Greg Hill
2008-12-05 01:19:55 UTC
Permalink
Post by Glenn Johansen
The only issue that I have at this time, is the forms "activecontrol" does
not switch to the "subform".
When focus is on the subform, the parent form's activecontrol is the
pushbutton.
Bug maybe ?? Is a subform considered a control ?? I use the activecontrol
alot in global key routines.
I think that it is WAD, you will probably have to write a function for the
enterkey at the subform level or maybe a simple loop that will add an onkey
event to each entryfield. I wonder how menus respond or even if they can be
attached. I will check.
By the way, I found it a bit frustrating that one would have to use the
mouse to re-gain focus to the parent for or vice versa, so I think the
solution for that would be to decide which object in the zorder would be the
last one and then for that objects onLostFocus do something like following:

this.parent.activeControl.setFocus() // from subform
this.s.activeControl.setFocus() // from subform

What do you think?

Greg Hill
Glenn Johansen
2008-12-05 02:01:59 UTC
Permalink
so I think the solution for that would be to decide which object in the
zorder would be the last one and then for that objects onLostFocus do
and the first too...for shift tab

let me think about this, kind of a fun challenge though eh?
Post by Glenn Johansen
The only issue that I have at this time, is the forms "activecontrol"
does not switch to the "subform".
When focus is on the subform, the parent form's activecontrol is the
pushbutton.
Bug maybe ?? Is a subform considered a control ?? I use the
activecontrol alot in global key routines.
I think that it is WAD, you will probably have to write a function for the
enterkey at the subform level or maybe a simple loop that will add an
onkey event to each entryfield. I wonder how menus respond or even if
they can be attached. I will check.
By the way, I found it a bit frustrating that one would have to use the
mouse to re-gain focus to the parent for or vice versa, so I think the
solution for that would be to decide which object in the zorder would be
the last one and then for that objects onLostFocus do something like
this.parent.activeControl.setFocus() // from subform
this.s.activeControl.setFocus() // from subform
What do you think?
Greg Hill
Ken Mayer [dBVIPS]
2008-12-05 05:15:12 UTC
Permalink
Post by Glenn Johansen
The only issue that I have at this time, is the forms "activecontrol" does
not switch to the "subform".
When focus is on the subform, the parent form's activecontrol is the
pushbutton.
Bug maybe ?? Is a subform considered a control ?? I use the activecontrol
alot in global key routines.
A subform is not a control, it's literally another form. It's subclassed
(as I understand it) from the actual form class, but has special
modifications in the subclass. So no, it wouldn't be the parent form's
activeControl.

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Glenn Johansen
2008-12-05 05:21:07 UTC
Permalink
Tks Ken for your input, makes sense, but it is a child of the parent, and
when it get's focus, don't you think that it should be the active
"form"/"control" ??
Post by Ken Mayer [dBVIPS]
Post by Glenn Johansen
The only issue that I have at this time, is the forms "activecontrol"
does not switch to the "subform".
When focus is on the subform, the parent form's activecontrol is the
pushbutton.
Bug maybe ?? Is a subform considered a control ?? I use the
activecontrol alot in global key routines.
A subform is not a control, it's literally another form. It's subclassed
(as I understand it) from the actual form class, but has special
modifications in the subclass. So no, it wouldn't be the parent form's
activeControl.
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Ken Mayer [dBVIPS]
2008-12-05 13:47:48 UTC
Permalink
Post by Glenn Johansen
Tks Ken for your input, makes sense, but it is a child of the parent, and
when it get's focus, don't you think that it should be the active
"form"/"control" ??
I am not sure if it should or not ... while it does need/require a
PARENT property (which most forms do not), it is still a form, not a
standard "control".

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
DLS
2008-12-07 03:07:15 UTC
Permalink
Post by Ken Mayer [dBVIPS]
I am not sure if it should or not ... while it does need/require a
PARENT property (which most forms do not), it is still a form, not a
standard "control".
Ken, do you know if the subform is anything more than just an ordinary
form with a behind-the-scenes setParent() to assign it to its "parent" form?

David
Ken Mayer [dBVIPS]
2008-12-07 07:06:38 UTC
Permalink
Post by DLS
Post by Ken Mayer [dBVIPS]
I am not sure if it should or not ... while it does need/require a
PARENT property (which most forms do not), it is still a form, not a
standard "control".
Ken, do you know if the subform is anything more than just an ordinary
form with a behind-the-scenes setParent() to assign it to its "parent" form?
My understanding is that it is subclassed from the main form class, has
some minor changes (requires the parent property and you can pass it a
title if I am remembering correctly), and cannot be run as a modal form.
I cannot really recall what else.

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Glenn Johansen
2008-12-07 16:18:04 UTC
Permalink
It has to be different than using setparent() on a regular form, There are
alot of focus issues with using setparent() that don't exist with the
subform.

- glenn
Post by DLS
I am not sure if it should or not ... while it does need/require a PARENT
property (which most forms do not), it is still a form, not a standard
"control".
Ken, do you know if the subform is anything more than just an ordinary
form with a behind-the-scenes setParent() to assign it to its "parent" form?
David
Greg Hill
2008-12-05 01:46:25 UTC
Permalink
One other area,,,press <ctrl>W when focus is on the subform and it closes,
leaving the parent form open.
Any idea how to get around that ?
I forgot to mention that menus can easily be controled too by enabling and
disabling their items.

Example:
When the focus goes to parent form, the onGotfocus event can do the
following

form.root.menu3.enabled = false // this will disable the shortcut keys
assigned to the menu too.

Greg Hill
Glenn Johansen
2008-12-05 02:05:03 UTC
Permalink
This does work, stand by, I think I found a way to throw away the CTRL-W
keystroke without the menu.

-glenn
One other area,,,press <ctrl>W when focus is on the subform and it
closes,
leaving the parent form open.
Any idea how to get around that ?
Try running this version of the form and scrolcnt.mnu together.
By the way you can arrange this menu in a more pleasing way.
Greg Hill
Jan Hoelterling
2008-12-05 18:54:19 UTC
Permalink
In the simple instance of this test form, this works perfect. Will not
work for me in production, but I have a new key handler that I will
replace for subforms vs regular forms. I do global key trapping for all
keystrokes on all forms.
-glenn
What won't work in production??

Jan
Glenn Johansen
2008-12-05 20:34:58 UTC
Permalink
I should have re-worded that.
I was refering to the fact that I was using the on key label command in this
test form and would have to remove those lines and check for the ctrl-w in
my forms onkey routine.

This is rather cool eh? I have already implemented this on a bunch of forms.
Makes it much easier to layout forms with LOTS of fields. Just scroll and
keep going......

- glenn
Post by Jan Hoelterling
In the simple instance of this test form, this works perfect. Will not
work for me in production, but I have a new key handler that I will
replace for subforms vs regular forms. I do global key trapping for all
keystrokes on all forms.
-glenn
What won't work in production??
Jan
Glenn Johansen
2008-12-05 01:16:18 UTC
Permalink
One other area,,,press <ctrl>W when focus is on the subform and it closes,
leaving the parent form open.
Any idea how to get around that ?
Post by Greg Hill
It does the trick don't it<g>
I don't see drawbacks do you?
Greg Hill
Here you go, very rough, but works great.
Post by Greg Hill
Post by Glenn Johansen
Excelent! Thanks Jan.
This works and I can place a rectangle behind it for a border and scroll
the contents as well with the mouse. .
SWEET!
I'll post a turnkey for anyone that wants to play with this idea.
- g
Post by Jan Hoelterling
topMost = true
smallTitle = true
sizeable = false
moveable = false
sysMenu = false
escExit = false
maximize = false
minimize = false
I was pondering if that would work the other day. In c# there is a thing
called Panel, it is the Container for C# BUT it has an autoscroll bar
feature so that you can put a control on the panel that might grow beyond
the defined width and height.
So I thought the same thing could possibly be done with a subform as you
have done.
It would be convenient to have a sample<g>
Greg Hill
Loading...