Form hierarchy non-Modal, but non-Modeless ? :-( 
Author Message
 Form hierarchy non-Modal, but non-Modeless ? :-(

I'll take a stab at it... Seems like you might be able to do something like
the following in your activate events

IF WEXIST( childformC )
        NODEFAULT
ENDIF

However, forgive me for this question, but are you sure you want to set
this up (even granting it will work and not be a maintenance nightmare)?
The whole point of object oriented program (or one of 'em as I see it,
anyway) is to design little chunks that know what they have to do, but
don't have to care what else is happening around them or how they came to
be...If there's a relationship between forms, I generally use a formset to
keep stuff together.



Quote:
>    Is there any way to create a form hiearachy such that a child form
> prevents the uses from accessing the parent form (like modal), but does
not
> prevent the user from accessing a totally different root form (like
> modeless). I want to create two forms A and Z. Form A may start a child
> form B, which may start its own child C. When the user is accessing C, he
> should still be able to go to Z, but not B or A. Likewise, Z may start
> another form X, and X, start Y. The user should be able to jump from Y to
C
> and vice versa, but not to A, B, Z, or X.



Sun, 09 Apr 2000 03:00:00 GMT  
 Form hierarchy non-Modal, but non-Modeless ? :-(

what I do when I have forms which are related in a parent-child way
is to instantiate the chilled in a property of the parent
(something like this.oChildForm=CreateObject...)
no to make this semi-modal in the gotfocus of the form you can check the
type("this.oChildForm"#O and  !ISNULL(this.oChildForm)
the same will go for your 3rd form
you will not be able to go from form3 to form1 because form2 will still be
there as well

it even conforms with what Nancy said (about each form only knowing about
itself) <g>

Arnon


Quote:
>Hi there,

> I'll try to explain better what I need, so you'll see that I'm not that
>crazy... (or, you might end-up convinced that I really should be committed
>to a mental institution... :-))) Either way, let me digress...

> I have three tables which form a hiearchy of data. Let's say that table T1
>has fields A, B1,C1 & D1, where A is the primary key. Table T2 has fields
>A, B2, C, & D2, where C is the primary key, and A is a  regular key. Table
>T3 has fields A3, B3, C & D3, where C is its regular key. The
>data-relationship should be obvious now, i.e T1 relates to T2 through the A
>key (one-to-many), and T2 relates to T3 through the C key (one-to-many)
>relationship. In fact, each table has many other fields, enough to justify
>a form for each one individually.

> Let's say the user is inserting a record in T3. Well, half-way through his
>work he decides that he needs a new record in T2, before he can finish
>inserting the T3 record. I don't want him to close the T3 form, open the T2
>form, proceed with the insertion on T2, and then go back to T3 and re-do
>the insertion. Instead, I want him to be able to hit a button in the T3
>form, and open the T2 form, where he can add the new record. Likewise,
>half-way through T2's insertion, the user may realize that he'll need
>another T1 record, before he can complete T2. Well, sure enough a similar
>button in T2 should allow him to open the T1 form, insert the new record,
>close the T1 form and continue the T2 insertion. Close the T2 form and
>continue in the T3 form, until he completes his insertion work.

> However, the user should not be able to jump from the T1 form back to the
>T3 form before the T2 insertion is complete. Why ? That's a design
>decision, and has to do more with the nature of the data itself. He should
>not be able to give up inserting in T3, before he finishes T2, or T1 for
>that matter. But, he should be able to start a new T3 form all together,
>which could lead him to create a totally new hierarchy of forms like the
>one I just described. Why again ? Well, just imagine his boss walks to his
>desk and tells him to stop what he's doing and quickly insert this T3
>record in the Database.... ops, it also needs this T2 record.... ops... it
>also needs this T1 record... For this reason alone your suggestion on how
>to accomplish this might not work... ( I might need to have two
>childFormc's running...) Maybe a formset is the way to go... and I'll think
>about it.

> Maybe my data normalization is all wrong, and I'd appreciate any fresh
>approaches that anyone could give me to this problem, but, for those of you
>who are wondering why I would want to do something like this, well, that's
>a brief (sorry) explanation... :-))

> My best regards,

>/Kiko
>*******************************

>Francisco A. Camargo
>*******************************
>Attention: Use of the return address on this message for commercial
>purposes is prohibited.  The transmission of unsolicited commercial
>material is prohibited under federal laws (47 USC 227).  Civil penalties
>and claims of $500.00 per occurrence (47 USC 227[c]) may be
>assessed for violations.

>==============================================================



>> I'll take a stab at it... Seems like you might be able to do something
>like
>> the following in your activate events

>> IF WEXIST( childformC )
>> NODEFAULT
>> ENDIF

>> However, forgive me for this question, but are you sure you want to set
>> this up (even granting it will work and not be a maintenance nightmare)?
>> The whole point of object oriented program (or one of 'em as I see it,
>> anyway) is to design little chunks that know what they have to do, but
>> don't have to care what else is happening around them or how they came to
>> be...If there's a relationship between forms, I generally use a formset
>to
>> keep stuff together.



>> > Is there any way to create a form hiearachy such that a child form
>> > prevents the uses from accessing the parent form (like modal), but does
>not
>> > prevent the user from accessing a totally different root form (like
>> > modeless). I want to create two forms A and Z. Form A may start a child
>> > form B, which may start its own child C. When the user is accessing C,
>he
>> > should still be able to go to Z, but not B or A. Likewise, Z may start
>> > another form X, and X, start Y. The user should be able to jump from Y
>to
>> C
>> > and vice versa, but not to A, B, Z, or X.



Mon, 10 Apr 2000 03:00:00 GMT  
 Form hierarchy non-Modal, but non-Modeless ? :-(

when you close a form hide it instead of releasing it
then you can read its properties from the parent and close it then
you can still prevent access to the parent in the activate (if the child is
visible don't allow access  and if not allow access
because you don't allow access to the parent form while the child is active
you can know exactly where to return to

Arnon


Quote:
>Arnon & Nancy,

> While the suggestion of disabling the Activate method seems reasonable,
>the problem lies a little deeper. I forgot to say that each form in the
>hierachy will return a value to its parent, thus, the parent needs to stop
>at the Show invocation of its child. That's why I'd need to make the child
>form modal. However, I don't like that, for it prevents the user from being
>able to start a totally new hierachy.

> So, the question should be: is there a way to make a parent form invoke a
>child form in a modeless fashion, while forcing the parent form to stop at
>the point where the show method of the child was invoked ? (This is what a
>modal form does, isn't it ?)

> Well, there we go again...

>/Kiko
>*******************************

>Francisco A. Camargo
>*******************************
>Use of the return address on this message for commercial purposes
>is prohibited.  The transmission of unsolicited commercial material
>is prohibited under federal laws (47 USC 227).  Civil penalties and
>claims of $500.00 per occurrence (47 USC 227[c]) may be
>assessed for violations.

>===========================================================



>> what I do when I have forms which are related in a parent-child way
>> is to instantiate the chilled in a property of the parent
>> (something like this.oChildForm=CreateObject...)
>> no to make this semi-modal in the gotfocus of the form you can check the
>> type("this.oChildForm"#O and  !ISNULL(this.oChildForm)
>> the same will go for your 3rd form
>> you will not be able to go from form3 to form1 because form2 will still
>be
>> there as well

>> it even conforms with what Nancy said (about each form only knowing about
>> itself) <g>

>> Arnon

>================= previous thread messages deleted==============



Mon, 10 Apr 2000 03:00:00 GMT  
 Form hierarchy non-Modal, but non-Modeless ? :-(

Arnon & Nancy,

        While the suggestion of disabling the Activate method seems reasonable,
the problem lies a little deeper. I forgot to say that each form in the
hierachy will return a value to its parent, thus, the parent needs to stop
at the Show invocation of its child. That's why I'd need to make the child
form modal. However, I don't like that, for it prevents the user from being
able to start a totally new hierachy.

        So, the question should be: is there a way to make a parent form invoke a
child form in a modeless fashion, while forcing the parent form to stop at
the point where the show method of the child was invoked ? (This is what a
modal form does, isn't it ?)

        Well, there we go again...

/Kiko
*******************************

Francisco A. Camargo
*******************************
Use of the return address on this message for commercial purposes
is prohibited.  The transmission of unsolicited commercial material
is prohibited under federal laws (47 USC 227).  Civil penalties and
claims of $500.00 per occurrence (47 USC 227[c]) may be
assessed for violations.

===========================================================



Quote:
> what I do when I have forms which are related in a parent-child way
> is to instantiate the chilled in a property of the parent
> (something like this.oChildForm=CreateObject...)
> no to make this semi-modal in the gotfocus of the form you can check the
> type("this.oChildForm"#O and  !ISNULL(this.oChildForm)
> the same will go for your 3rd form
> you will not be able to go from form3 to form1 because form2 will still
be
> there as well

> it even conforms with what Nancy said (about each form only knowing about
> itself) <g>

> Arnon

================= previous thread messages deleted==============


Mon, 10 Apr 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Q: Form hierarchy non-Modal, but non-Modeless ? :-(

2. Modal/Non-Modal Programming FPW 2.6

3. calling a modeless form from a modeless form

4. Modal / modeless forms

5. Show Formset as modeless, form as modal

6. Form Modal or Modeless in EXE filer??????

7. Modeless and Modal form

8. Modal form becomes modeless

9. VFP6: Modal form becomes modeless at run-time?

10. Modal / Modeless Form depending on edit mode...

11. Making forms Modal or Modeless

12. Making forms Modal or Modeless

 

 
Powered by phpBB® Forum Software