Index
1998-05-02 19:17Jarod Tufts : Menu builder with SAVI v27
1998-06-12 14:28Ellen Whitney : Modal Forms and the Menu
1998-06-13 22:09Charles T. Blankenship : Re: Modal Forms and the Menu
1998-06-17 00:17Matthew L. Brazier : Re: Modal Forms and the Menu
1998-06-17 10:21Ellen Whitney : Re: Modal Forms and the Menu
1998-06-17 17:45Ed Leafe : Re: Modal Forms and the Menu
1998-07-10 15:45Matthew L. Brazier : Re: Modal Forms and the Menu
1998-07-11 04:43Marc Van Schandevijl : Re: Modal Forms and the Menu
1998-07-14 12:13Matthew L. Brazier : Re: Modal Forms and the Menu
1998-10-30 12:04Bob Archer : ActiveBar Menu and ToolBar Wrapper
Back to top
Menu builder with SAVI v27

Author: Jarod Tufts

Posted: 1998-05-02 19:17:07   Link

I'm starting a rewrite. I've got a new project started with SAVI's v27 of the CB framework. Basically, I've done nothing yet except add a database to the project. Now I'm trying to create the menus. Everytime I run the builder I get an error "Class definition SAVIFILEMEMUPWCHANGEBAR is not found". I can't find the problem. This class definition is in the CSECURE class library, and this library is in the project.

Please help.

Jarod

email: jarod.tufts@mmc-sil.com

©1998 Jarod Tufts
Back to top
Modal Forms and the Menu

Author: Ellen Whitney

Posted: 1998-06-12 14:28:02   Link

Hi -

I have a modal form in SAVI/CB5, and I'm having problems with the menu File option - all the options under File are disabled. This should not be the case since even tho it's modal, the user can still add/delete etc. Is this a CB problem, or something I've created?

And an even bigger question.... WHERE do I go to fix it? (I know it's not in the skip for - skip for is working properly - I THINK it's disabling it at the PAD level for all the children and not looking at the individual BARs).

TIA!!

ellen

©1998 Ellen Whitney
Back to top
Re: Modal Forms and the Menu

Author: Charles T. Blankenship

Posted: 1998-06-13 22:09:09   Link

<I>

I have a modal form in SAVI/CB5, and I'm having problems with the menu File option - all the options under File are disabled. This should not be the case since even tho it's modal, the user can still add/delete etc. Is this a CB problem, or something I've created?

And an even bigger question.... WHERE do I go to fix it? (I know it's not in the skip for - skip for is working properly - I THINK it's disabling it at the PAD level for all the children and not looking at the individual BARs).

TIA!!

</I>

Hi Ellen:

I have dinked with this thing for a while now, but I was never able to get the File|New and associated buttons to enable with a modal form. However, in the venue of "One click is better than two" I did get a toolbar to work successfully.

To do this, in the subclass of the modal form you are using, place "cNavToolbar" in the form's .cToolbar property. This associates a toolbar with your form. It comes up when the form instantiates ... see CBaseForm::Init() for the code that makes this happen.

In the Init() of your modal form make a call to the superclass Init, like so, (assuming you are using cBaseModalForm in cForms.VCX as a superclass that is).

LOCAL llRetVal

llRetVal = CBaseModalForm::Init()

IF llRetVal

IF .NOT. EMPTY( THIS.cToolbar )

THIS.oToolbar.SetEnabled( .T. )

ENDIF

ENDIF

The reason for this is that CBaseModalForm, in the Init() disables all toolbars, including the one that you identified in .cToolbar property. The above code re-enables it again.

You now have a toolbar whose buttons the user can press to navigate, add new, save, cancel, etc.

Phase Two is to make your modal form talk to the toolbar. You must add First(), Next(), Last(), Prior(), New(), Save(), Cancel(), etc. to the form. In each of these methods your must pass the message along to the form's oBizObj(). You now have a Modal form that allows a user to perform CRUD activities.

Notice that you may not want the user navigating using the FPNL buttons. In this case, do not use cNavToolbar, create your own that only contains the cmdNew, cmdCancel, cmdSave and cmdExit button containd in cToolbar.VCX

This is the hard way.

The easy way is to add command buttons onto the form that call the business object's New, Cancel, Save and Delete methods.

Hope this helps. I have used both methods to get around the fact that the File menu bars are not enabled when a modal form is active.

Best,

CT

Flash Creative Management, Inc. (FLASH)

http://www.flashcreative.com

ctb@flashcreative.com

tomandanna@erols.com

©1998 Charles T. Blankenship
Back to top
Re: Modal Forms and the Menu

Author: Matthew L. Brazier

Posted: 1998-06-17 00:17:02   Link

Hi -

I have a modal form in SAVI/CB5, and I'm having problems with the menu File option - all the options under File are disabled. This should not be the case since even tho it's modal, the user can still add/delete etc. Is this a CB problem, or something I've created?

And an even bigger question.... WHERE do I go to fix it? (I know it's not in the skip for - skip for is working properly - I THINK it's disabling it at the PAD level for all the children and not looking at the individual BARs).

TIA!!

ellen

Ellen,

I think modal forms should not generally be used for data entry of records. However, there are times when you may want a form to be modal and allow record entry. What I do in this situation is use the ebizobjform with WidowType set to modal. Although this does not enable the File menu options, it does give me my toolbar and ALL the methods to process the records (I don't have to add any special code!)

Matthew L. Brazier

Developing in VFP 5/6/7, Visual Studio 6

website: www.braziercomputerconsulting.com

email: mbrazier@braziercomputerconsulting.com

©1998 Matthew L. Brazier
Back to top
Re: Modal Forms and the Menu

Author: Ellen Whitney

Posted: 1998-06-17 10:21:08   Link

<<I think modal forms should not generally be used for data entry of records. However, there are times when you may want a form to be modal and allow record entry. What I do in this situation is use the ebizobjform with WidowType set to modal. Although this does not enable the File menu options, it does give me my toolbar and ALL the methods to process the records (I don't have to add any special code!)>>

Hi Matthew -

I suppose for the most part you are correct, that most of the time when you have a modal form, you don't want to allow data entry. In fact, in examining what I am trying to do, I guess you could say that I am compensating for a different problem by wanting to do DE from my modal form.... This modal form is a child form (ebizchildform). It actually could/should be non-modal, but the problem is I can't figure out how to keep it in synch w/the parent form, so I solved this by making it modal. So, does anyone know how to make my child form show the proper information as the user pages thru the records in the parent form? Is there native CB methods that automatically take care of this, or do I need to write my own?

Thanks!

ellen

©1998 Ellen Whitney
Back to top
Re: Modal Forms and the Menu

Author: Ed Leafe

Posted: 1998-06-17 17:45:11   Link

<FONT COLOR="#663300"><I>This modal form is a child form (ebizchildform). It actually could/should be non-modal, but the problem is I can't figure out how to keep it in synch w/the parent form, so I solved this by making it modal. So, does anyone know how to make my child form show the proper information as the user pages thru the records in the parent form? Is there native CB methods that automatically take care of this, or do I need to write my own?</I></FONT>

You could add code in either the AfterPointerMove() or the AfterRequery() methods of the parent bizobj on the one form to send a message to the dependent forms to requery themselves. There is currently no provision in Codebook for managing such messaging, but you could model it after the RegisterBizobj() method of eBizobjForm.

<font color="#cc0000"> ___/

/

__/

/

____/</font>

Ed Leafe

©1998 Ed Leafe
Back to top
Re: Modal Forms and the Menu

Author: Matthew L. Brazier

Posted: 1998-07-10 15:45:38   Link

<I><FONT COLOR="#663300">I think modal forms should not generally be used for data entry of records. However, there are times when you may want a form to be modal and allow record entry. What I do in this situation is use the ebizobjform with WidowType set to modal. Although this does not enable the File menu options, it does give me my toolbar and ALL the methods to process the records (I don't have to add any special code!)

Hi Matthew -

I suppose for the most part you are correct, that most of the time when you have a modal form, you don't want to allow data entry. In fact, in examining what I am trying to do, I guess you could say that I am compensating for a different problem by wanting to do DE from my modal form.... This modal form is a child form (ebizchildform). It actually could/should be non-modal, but the problem is I can't figure out how to keep it in synch w/the parent form, so I solved this by making it modal. So, does anyone know how to make my child form show the proper information as the user pages thru the records in the parent form? Is there native CB methods that automatically take care of this, or do I need to write my own?

Thanks!

ellen

</FONT></I>

Ellen,

Hello again. I have finally got back to re-thinking what I am doing in this situation and have come up with a good solution (at least for my situation) and I wanted to share it with you (well, share with all).

1) I have changed my sub-classed eBizObjForm form back to non-modal and have added a property myproperty_lFakeModalForm which I set to .T. in those forms that I want to be 'modal' but still behave as a data entry form.

2) I have added a property myproperty_lFakeModalMode to my aApp class.

3) I have created a sub-class of cbar which has the cSkipFor property set to goApp.myproperty_lFakeModalMode. This new class is used for menu option that should be dimmed when the 'Fake Modal' form is active.

4) In activate of my sub-classed eBizObjForm I have coded:

goApp.myproperty_lFakeModalMode = this.myproperty_lFakeModalForm

In deactivate I have coded:

goApp.myproperty_lFakeModalMode = .F.

This works wonderful. I now have a 'modal' form with a functional toolbar as well as working menu options!

I don't know about the keeping of multiple forms in synch as I don't do this. I always create forms with all the necessary parent and child bizobj's needed in the same form. Now, I do have forms that have multiple bizobj's where one bizobj may be allowed to save/delete/new, and another may only allow new, and then another that may only allow navigation. I accomplish this through properties in my bizobj which update the form's lAllowNew, lAllowDelete, and lAllowSave properties. Let me know if I need to post that information.

This still may not be what you want, but maybe it will give you some other ideas.

Hope this helped.

Matthew L. Brazier

Developing in VFP 5/6/7, Visual Studio 6

website: www.braziercomputerconsulting.com

email: mbrazier@braziercomputerconsulting.com

©1998 Matthew L. Brazier
Back to top
Re: Modal Forms and the Menu

Author: Marc Van Schandevijl

Posted: 1998-07-11 04:43:58   Link

>I don't know about the keeping of multiple forms in synch as I don't do this. I always create forms with all the necessary parent and child bizobj's needed in the same form. Now, I do have forms that have multiple bizobj's where one bizobj may be allowed to save/delete/new, and another may only allow new, and then another that may only allow navigation. I accomplish this through properties in my bizobj which update the form's lAllowNew, lAllowDelete, and lAllowSave properties. Let me know if I need to post that information.

I'm interested in this one, so could you post the information?

Many thanks in advance.

Marc Van Schandevijl

C-Luma--------------

©1998 Marc Van Schandevijl
Back to top
Re: Modal Forms and the Menu

Author: Matthew L. Brazier

Posted: 1998-07-14 12:13:41   Link

<I><FONT COLOR="#663300">>I don't know about the keeping of multiple forms in synch as I don't do this. I always create forms with all the necessary parent and child bizobj's needed in the same form. Now, I do have forms that have multiple bizobj's where one bizobj may be allowed to save/delete/new, and another may only allow new, and then another that may only allow navigation. I accomplish this through properties in my bizobj which update the form's lAllowNew, lAllowDelete, and lAllowSave properties. Let me know if I need to post that information.

I'm interested in this one, so could you post the information?

Many thanks in advance.

</FONT></I>

Marc,

In my sub-classed eBizObj I have:

1) added the properties bizobj_lAllowNew, bizobj_lAllowDelete, and bizobj_lAllowSave.

2) added the following code to the GotFocus event -

this.MakePrimaryBizObj()

DODEFAULT()

3) added the following code to the MakePrimaryBizObj event -

WITH thisform

.lAllowDelete = this.bizobj_lAllowDelete

.lAllowNew = this.bizobj_lAllowNew

.lAllowSave = this.bizobj_lAllowSave

DODEFAULT()

.RefreshForm()

ENDWITH

The code above seems to work in all situations except when you code bizobj's within bizobj's, which was the way the original CB3 worked.

Hope this helps.

Matthew L. Brazier

Developing in VFP 5/6/7, Visual Studio 6

website: www.braziercomputerconsulting.com

email: mbrazier@braziercomputerconsulting.com

©1998 Matthew L. Brazier
Back to top
ActiveBar Menu and ToolBar Wrapper

Author: Bob Archer

Posted: 1998-10-30 12:04:08   Link

Is anyone interested in some wrapper classes that allow you to use the ActiveBar ActiveX control from DataDynamics in your Codebook ap? I am trying to decide whether I should write them or not. Also, I don't know how well a wrapper class for a $150 control will fit into a free framework.

But, perhaps I am not the only one that thinks that VFP ToolBars and Menus have a kinda out dated look.

If you haven't seen the control check out the demos of ActiveBar at...

http://www.datadynamics.com/products/

BOb

©1998 Bob Archer