Adding a Top Level Form to an app object based on a formset 
Author Message
 Adding a Top Level Form to an app object based on a formset

I've changed my application object to be based on a formset--from container,
from custom :-(.  When I

    AddObject( 'MainForm', 'MainForm' )

I expect to be able to refer to it as

    thisApp.Mainform

But it's actually named something like _R000283whatever--an auto unique
name.

Is it because it's a toplevel form?  I can't test it as a not-TopLevel
because of other dependancies--and it doesn't much matter anyway, because it
should be a top level form.  I need to be able to refer to it fairly
directly.  Any suggestions that don't involve a lot of gyrations?

TIA
--

Nancy Folsom
(abqnfatdamescom--replace the word at and put a dot before the com)



Sun, 27 Aug 2000 03:00:00 GMT  
 Adding a Top Level Form to an app object based on a formset

HI Nancy,

I am not sure that I understand completely but here is a shot....

Can you create the object and then add it to the formset?  Kinda like:

set classlib to <whatever>
lObj  :=  createobject('MainForm')
MyApp.AddObject('MainForm')
lObj.DoWhatever

Come to think of it, that may not work either.  There may be no need to add
the object to the container at all.

Could you create a MainForm property of your App object and put a reference
to your main form in it? Then you should be able to manipulate it through
the App hierarchy.

--
Donald

--
Donald Orphanidys

Quote:

>I've changed my application object to be based on a formset--from
container,
>from custom :-(.  When I

>    AddObject( 'MainForm', 'MainForm' )

>I expect to be able to refer to it as

>    thisApp.Mainform

>But it's actually named something like _R000283whatever--an auto unique
>name.

>Is it because it's a toplevel form?  I can't test it as a not-TopLevel
>because of other dependancies--and it doesn't much matter anyway, because
it
>should be a top level form.  I need to be able to refer to it fairly
>directly.  Any suggestions that don't involve a lot of gyrations?

>TIA
>--

>Nancy Folsom
>(abqnfatdamescom--replace the word at and put a dot before the com)



Sun, 27 Aug 2000 03:00:00 GMT  
 Adding a Top Level Form to an app object based on a formset

Thanks, Donald.  I ended up doing exactly as you suggested and it works
fine.  Instead of

    thisApp.AddObject( 'MainForm', 'MainForm' )

I added a property called MainForm to my App class (which is based on
formset) and do

    thisApp.MainForm = CREATEOBJECT( 'MainForm' )

And this is working really well.  I'm confused a bit and a little
frustrated.  The reason I switched to an app object based on a formset was
because of (excellent) advice I got on a problem I was having managing my
app's toolbars with a container-based app object.  I couldn't ADDOBJECT the
toolbars, which resulted in some kinks.  The word I got was "anything can be
added to a formset object, except another formset."  This solved my problem
with the toolbars, and I could addobject the top level form, but the naming
got weird.

So, I'm very glad to have your suggestion--I was wondering if it was
sensible.  I'm starting to doubt my sanity, and am even wondering why I'm
set on using a top level form!  Oh well.  Onward.

Thanks again.

--

Nancy Folsom
(abqnfatdamescom--replace the word at and put a dot before the com)

...snip

Quote:

>Could you create a MainForm property of your App object and put a reference
>to your main form in it? Then you should be able to manipulate it through
>the App hierarchy.

...snip


Mon, 28 Aug 2000 03:00:00 GMT  
 Adding a Top Level Form to an app object based on a formset

Quote:
>So, I'm very glad to have your suggestion--I was wondering if it was
>sensible.  I'm starting to doubt my sanity, and am even wondering why I'm
>set on using a top level form!  Oh well.  Onward.

Glad I could help!  And being a programmer, I never *doubt* my sanity, on
some days I doubt it's existence!

--
Donald



Mon, 28 Aug 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Specifying top-level form in formset (VFP 5.0)

2. Formset as Top-Level Form?

3. Problems with calling Forms from Forms witihin a Top Level App

4. Strange problem with modal forms and Application in top-level form

5. addressing form from menu on top level form ?

6. Top level form menu & active form

7. release form - from menubar of top level form ?

8. Top Level form/Modal form conflict.

9. Question: Forms displayed inside other top-level forms

10. Top level form - modal form ??

11. Form not appearing in top-level form.

12. Form not appearing in top-level form.

 

 
Powered by phpBB® Forum Software