×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Tool Tip Question

Tool Tip Question

Tool Tip Question

(OP)
What is the best way to implement a "User" selectable tool tips display?  What I would like to do is have an option in my System menu that says something like:

Show Tips ON

or

Show Tips OFF

Then, every form would need to be able to "GET" the value of the Show Tips menu, and determine if Tips are on or off.

If there's a different philosophy for this that you can share, that would be much appreciated as well.

          Thanks,
           -Scott

Please let me know if this has helped!

RE: Tool Tip Question

I'm sure the method you mention would work fine.  I assume you know that the property you need to work with is the  .ShowTips property, which for forms defaults to false.  But I admit that I don't know if you can add properties to menus.  I haven't worked with them enough.  But it'd be easy to create some public variable which every form could query when it was loaded or initiated.  

Dave Dardinger

RE: Tool Tip Question

Hi,

Your approach is correct..
You can have a global variable..
glShowTips
You can set its value to
glShowTips = .t.

In your formBase class (your basic form which is subclassed by all your other forms), you can put the code in its InitEvent..
ThisForm.ShowTips = glShowTips

If the Menu Choice is available for a user.. after a form can be opened.. then you can put that same code in the Forms.. Refresh Event.

This way the Tool Tips will be turned ON or OFF

Hope this helps

ramani
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK

RE: Tool Tip Question

(OP)
Ramani,
   I've kind of done what you suggest above, but I'm having trouble with one part...  Refresh is not an Event, but rather a method, which must be called.  When I change the state of Show Tips on my menu, it does not update on my form.  The code in my Menu option looks like this:

plMarked = MRKBAR('System', BAR())
*
IF NOT plMarked
    SET MARK OF BAR BAR() OF SYSTEM TO .T.
    glTipState = .T.
ELSE
    SET MARK OF BAR BAR() OF SYSTEM TO .F.
    glTipState = .F.
ENDIF

This also sets the check mark next to the Show Tips to indicate state.
Is there a way for me to get my form to refresh from the menu code?  I tried putting in:

ThisForm.ShowTips = glTipState

but I get the error:
"THISFORM can only be used in a method".

I tried putting putting the same code in the GotFocus event of the form, but to my surprise, clicking on a top-line menu does not actually cause focus to be lost from a form!  So, when I click back on my form, the focus is still there.  If I click outside my form, and then back on my form, the state changes as I would expect.

Any other thoughts???

          Thanks,
           -Scott

Please let me know if this has helped!

RE: Tool Tip Question

Hi,
Refresh...event... method .. it is a typo... you are right !

Hi probably, you are putting the code in the MenuBars.. related to the form... (that is why.. said error is appearing.)

I suggest that the code be put in the form (your base form.. so that all your forms will inherit that piece of action).. suitably such that the refreshing takes effect.

You can probably have it in the 'ACTIVATE Event' method,
Probably.. in its Refresh Method,

I have not tried it, but you can try it this way as well...
In the ShowTips property of the Base form.. put the code...
=glTipState........ and then.. in the MenuBar Click event.., you can collect all open forms in an array.. and refresh them one by one using that array. (You are smart... you can use this idea).

Hope this helps

ramani
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK

RE: Tool Tip Question

(OP)
Ramani,
    Hmmmmm trickier than I thought this would be...  I get your idea in premise.  Two things:

1) The ShowTips property only allows .T. or .F. as a value, so I can't put it the =glTipState call as a Form Property... no big deal, there are other ways around that.

2) Having done little in this regard with VFP, to your suggestion of using the Array to get the forms, let's assume I have a form called ABOUT, and a form called CHARACTER on at the same time.  Once I get them in the array, would I do something like:

nNumWindows = ALEN(WINARRAY)
*
FOR X = 1 to nNumWindows
    WINARRAY(X).Refresh()
ENDFOR

Will this work???  The notion is that each element of the array is a window name.  Can a method for a specific form be called by supplying the Window name?  Or, would it require macro-sub?:

nNumWindows = ALEN(WINARRAY)
*
FOR X = 1 to nNumWindows
    lcWinRefresh = ALLTRIM(WINARRAY(X))+'.Refresh()'
    &lcWinRefresh
ENDFOR

Just not sure if the .Refresh method will work without the explicit concatination.

          Thanks,
           -Scott

Please let me know if this has helped!

RE: Tool Tip Question

Hi.. I am sorry... collect all forms.. etc etc.. seems 'crabs'... They are all just ideas flashing thru immediatelt on reading a question and putting the suggestion.

But the following works.. (I have tested it now)
In your basic form... in its ShowTips propert... hit the function button and enter.. glTipState
This will result in
ShowTips.. "=glTipState" without the quote marks.
So when you set this property.. all the forms subsequently initialised will obey this property.
Also you can put in the ActivateEvent..of the Base Form...
ThisForm.ShowTips = glTipState
So anyform which is open, will respond when it gets activated.
Hope this helps you

ramani
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK

RE: Tool Tip Question

Refining my previous posting...

In your basic form...
..Select its ShowTips propert
... Click on the Expression Builder Button
..... and enter.. glTipState
....... and click OK.

So your pont "1) The ShowTips property only allows .T. or .F. as a value, so I can't put it the =glTipState"
can be overcome.


ramani
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK

RE: Tool Tip Question

(OP)
Ramani,
    I think we are closer...  You hit the crux of the problem in your last statement, "All the forms SUBSEQUENTLY initialised will obey this property"...  That, I can do.  The problem is, if I have the form open already, and then change the state of the value on the menu bar.  How can I get the form to recognize this change?  I have not been able to find the "Magic Combination" that will cause my form to recognize this as soon as my mouse cursor returns to the form.  Is there some code at the menu level I am missing?  I tried the following:

CHARACTER.ShowTips = glTipState

in my Menu code, right after the change of glTipState, but it yields the error:

"Object Character is not found".

          Thanks,
           -Scott

Please let me know if this has helped!

RE: Tool Tip Question

Hi Scott

You havent mentioned about use of the code I suggested in Activate Event of the Base Form..
It works for me when I have the code...in the Actvate event of the form...

ThisForm.ShowTips=glTipState

The only little time the user will not have this effective is that .. when the form is on Top.. The menu bar to change the ToolTip status is clicked and the form hasnt got the focus (at that stage.. the previous condition exist... once the form gets the focus.. the activate event sets the property and so the results). But this is acceptable.

Hope this clears the matter


ramani
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK

RE: Tool Tip Question

(OP)
Ramani,
     Sorry, yes, I put the code in the Activate Event.  But Activate doesn't fire if all you do is click on a menu item, and then bring your mouse back over the form, which, as you mention, is on top.  So when I turn tool tips off, and simply drag my mouse back into the form, they are still on.  They won't go off until I click on something, or outside the form so that it specifically loses focus, and then back on it to get foucs.  It does make the tool tips go away, but I'm trying to create the ability to switch them on and off from my System Menu bar.  According to Fox Pro help file,

"A Form object is activated by a user action, such as clicking a form or a control or when the Show method for the Form object is called. "

So, this requires a click before Activate fires.  Because tool tips are a hover action, it needs a click first.  Any other ideas???

You've been very helpful, and I thank you.

          Thanks,
           -Scott

Please let me know if this has helped!

RE: Tool Tip Question

(OP)
Ramani,
    Thanks, I downloaded it, and I'll give it a try.  I'll let you know what happens.

          Thanks,
           -Scott

Please let me know if this has helped!

RE: Tool Tip Question

Hi Scott,

Iso using global variables to store your settings, I use a system settings manager, which is an invisible toolbar that has its own private datasession.
In this datasession, I opened a system settings table.
This system settings manager is globally available and has methods to set and get various settings.

When a setting is set, it is immediatley saved.

This works very handy since you can save settings in a table and have them still available when you restart your application.

In my CrownBase app the settings manager is a property of my application object, so I do not have to use another public variable to store the object reference to this system manager.

Hope this will give you some insight in 'how to use system settings'..

HTH,

Weedz (Wietze Veld)
My private project:www.crowncap.demon.nl\info\crwnbase
Download the CrownBase source code !!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close