Toolbar Icon Problem

Toolbar Icon Problem

Post by MAppell9 » Wed, 06 Oct 1999 04:00:00



I have a printer icon on my toolbar.  I have a property in my form's base class
lTbrPrint.  If it's true then I turn the toolbar on in the form's Activate
method.

I always turn it off when a form is closed.  In this way, the user can flip
between forms and the printer icon on the toolbar automatically is turned on or
off depending on whether I decide that there is information that can be printed
from a particular form.

Now the problem....If I decide in the INIT method to close a particular form
and I do a RETURN .F. then the form is closed and the printer icon on the
toolbar is disabled.  However (and unfortanately) the Activate method is not
executed.

For example, Form A has the printer toolbar on.  Now, the application decides
to attempt to do Form B and in the init method I decide to not instantiate the
form.  The toolbar is turned on when From B is destroyed but I think because
Form B's was never Activated, VFP does not do an Activate for Form A.

Can anyone think of a way to handle the problems I'm encountering here?
Thanks.
Mike

 
 
 

Toolbar Icon Problem

Post by Tim Witor » Wed, 06 Oct 1999 04:00:00


What is causing the toolbar button to be disabled when
your "Form B" is run?  If the form determines that it
will return .F. from the Init, then it should never
touch the toolbar because returning .F. from the Init
(as you know) causes the form never to display and is
as if (to the user) that the form never ran.

I'd add another property to your form class DisablePrintOnExit
and only set it to .T. on forms that should, when closing,
disable the toolbar button.  Then, in whatever form method
is disabling the button, check that property.  Since its
default value in the class is .F., only fully instantiated
forms that know they should disable the button on exit will
do so.

-- TRW


> I have a printer icon on my toolbar.  I have a property in my form's base class
> lTbrPrint.  If it's true then I turn the toolbar on in the form's Activate
> method.

> I always turn it off when a form is closed.  In this way, the user can flip
> between forms and the printer icon on the toolbar automatically is turned on or
> off depending on whether I decide that there is information that can be printed
> from a particular form.

> Now the problem....If I decide in the INIT method to close a particular form
> and I do a RETURN .F. then the form is closed and the printer icon on the
> toolbar is disabled.  However (and unfortanately) the Activate method is not
> executed.

> For example, Form A has the printer toolbar on.  Now, the application decides
> to attempt to do Form B and in the init method I decide to not instantiate the
> form.  The toolbar is turned on when From B is destroyed but I think because
> Form B's was never Activated, VFP does not do an Activate for Form A.

> Can anyone think of a way to handle the problems I'm encountering here?
> Thanks.
> Mike

--

--------------------------------------
Remove the "drop this" strings from my
e-mail address to reply.
--------------------------------------

 
 
 

Toolbar Icon Problem

Post by MAppell9 » Wed, 06 Oct 1999 04:00:00


Thank's Tim for your reply, I just found the problem.  What was happening was I
would always disable the printer icon on the toolbar in the form's unload
method.  That was a mistake.  Every form determines whether to activate the
printer icon in the form's activate method (in it's base form class of course).
 Then when the form is closed, I would disable the printer icon in the form's
unload method.

Anyway, I just learned that if I RETURN .F. from the form's init method then
the UNLOAD method is run but the DESTROY method is not run.  Therefore, all I
need to do is disable the printer icon in the destroy method instead of the
unload method.

Thanks again.

>Subject: Re: Toolbar Icon Problem

>Date: Tue, 05 October 1999 12:36 PM EDT

>What is causing the toolbar button to be disabled when
>your "Form B" is run?  If the form determines that it
>will return .F. from the Init, then it should never
>touch the toolbar because returning .F. from the Init
>(as you know) causes the form never to display and is
>as if (to the user) that the form never ran.

>I'd add another property to your form class DisablePrintOnExit
>and only set it to .T. on forms that should, when closing,
>disable the toolbar button.  Then, in whatever form method
>is disabling the button, check that property.  Since its
>default value in the class is .F., only fully instantiated
>forms that know they should disable the button on exit will
>do so.

Mike
 
 
 

Toolbar Icon Problem

Post by Kuido Kül » Fri, 28 Jan 2000 04:00:00


Quote:> Now the problem....If I decide in the INIT method to close a particular form
> and I do a RETURN .F. then the form is closed and the printer icon on the
> toolbar is disabled.  However (and unfortanately) the Activate method is not
> executed.

THISFORM.Activate
RETURN .F.

Try this
Kuido

 
 
 

1. Spelling icon on toolbar

I have the spell check icon on a custom toolbar. It works fine in the ADP.
When I compile and create the ADE, the spell icon is ALWAYS greyed out.

Why?

Access 2000 with SQL Server 2000 backend.

THanks for the help.

2. compress package in bzip2

3. Put Query Analyzer icon on toolbar?

4. portal madness

5. Toolbar Icon Crazy

6. REFOX for VFP?

7. VB: Toolbar icon

8. sp_password gone

9. Toolbar Icons

10. HELP!!! Toolbar Icons in Forms 4.5

11. icons for my toolbar in forms

12. Some icons do not appear on ADI toolbar

13. Icons for V7 toolbars