PDA

View Full Version : Setting tooltip if button is disabled


kmartin7
08-19-2004, 06:14 PM
Is it possible to set a different tooltip if a button is disabled?

TIA

kmartin7

JimS
08-20-2004, 12:47 AM
Not directly, but while the button is disabled, you might enable a hot spot above it, with the tool tip you want.

yosik
08-20-2004, 03:48 AM
Great idea Jim. You do have to plan how you reenable your button (click on the hotspot..which "erases" it or using another trigger).
Another way to achieve this would be using Flash instead of buttons in AMS.

Yossi

Corey
08-20-2004, 03:51 AM
That is clever... :yes

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

yosik
08-20-2004, 05:34 AM
Corey,
Don't you EVER sleep???

Yossi

kmartin7
08-20-2004, 06:14 AM
I like it. Thanks!

JimS
08-20-2004, 06:31 AM
Np


:)

kmartin7
08-20-2004, 08:09 AM
Actually, I cannot get this to work. I disable the hotspot in the properties dialog, then enable it if a certain state is true. But irregardles of whether the stata is true or false, I still get the hotspot's tooltip, and not the button's tooltip.

--Hotspot.SetEnabled("Hotspot1", false);
registry_value = Registry.GetValue(HKEY_CURRENT_USER, "Software\\DocSoft Quick.SVG Autorun", "Registered", true);
Audio.SetVolume(CHANNEL_ALL, 100);
if (registry_value == "EnableBtns") then
--Audio.Stop(CHANNEL_EFFECTS);
Button.SetEnabled("adobe", true);
Button.SetEnabled("install", true);
Button.SetEnabled("documentation", true);
Button.SetEnabled("website", true);
end
adobe_installed = Folder.DoesExist(_SystemFolder.."\\Adobe");
--adobe_installed = Folder.DoesExist(_SystemFolder.."\\Adobe\SVG Viewer 3.0");
if adobe_installed then
Hotspot.SetEnabled("Hotspot1", true);
Button.SetEnabled("adobe", false);
end

Also, I need some help with detecting a specific subfolder in the _SystemFolder. I can detect \\Adobe, but cannot detect \\Adobe\SVG Viewer 3.0. Any ideas?

Kurt

rhosk
08-20-2004, 08:45 AM
Hmm, another workaround - use two exact buttons (one with a tooltip; one without) and use the setVisible properties to toggle back and forth. A little more work, but it should give you the result you're expecting.

As for your System Folder, change -

(_SystemFolder.."\\Adobe\SVG Viewer 3.0");
to
(_SystemFolder.."\\Adobe\\SVG Viewer 3.0");

Can't forget the double-slashes :)

HTH

yosik
08-20-2004, 09:27 AM
Kurt,
I think it was discussed in a previous post. There is a ..bug..(yes, even in AMS, it happens) that has a disabled object still reacting to the mouse and the tooltip problem you described is the result.
If you would use two button objects one on top of the other, each one with a different tooltip and using the visible property and not the enabled one, you would get what you need.
Attached is a sample project for that.
As to the paths, you have to double slash your directories: adobe\\SVG.

Good luck

Yossi

rhosk
08-20-2004, 10:05 AM
I guess my post above is invisible? I pretty much suggested the same thing :wow

Intrigued
08-20-2004, 10:18 AM
I guess my post above is invisible? I pretty much suggested the same thing :wow
No, not at all. What happens and I believe we all do it sooner or later (I know I have a few times, sorry), is that we read the first post or two or three and do not see our idea being put forth and so then we post our comment(s).

So, in light of such, two points awarded rhosk team! (grin)

Sincerely,

JimS
08-20-2004, 02:07 PM
kmartin7, are you aware that starting a line of code with two dashes comments the line of code out?
In your example code above, three different lines of code are not processed because you have commented them out.

--Hotspot.SetEnabled("Hotspot1", false);
--Audio.Stop(CHANNEL_EFFECTS);
--adobe_installed = Folder.DoesExist(_SystemFolder.."\\Adobe\SVG Viewer 3.0");

rhosk
08-20-2004, 02:41 PM
kmartin7, are you aware that starting a line of code with two dashes comments the line of code out?
In your example code above, three different lines of code are not processed because you have commented them out.

--Hotspot.SetEnabled("Hotspot1", false);
--Audio.Stop(CHANNEL_EFFECTS);
--adobe_installed = Folder.DoesExist(_SystemFolder.."\\Adobe\SVG Viewer 3.0");

Eh, he was probably in the middle of troubleshooting. The tooltips do perform erratically. Probably system-atic.

So, in light of such, two points awarded rhosk team! (grin)

I realize this. It was only rhetorical in nature actually :)

I think our (Mr. Yossi and I) workaround should do the trick for what he desires. I've had to use it with the Windows Buttons plugin as well.

PS,...Intrigued!! You sure do [grin] a lot. Is this hereditary, a nervous tick or are you just a happy guy? I think we need a smiley especially for you (with a mere grin). Just an observance (grin).

Intrigued
08-20-2004, 03:22 PM
Eh, he was probably in the middle of troubleshooting. The tooltips do perform erratically. Probably system-atic.



I realize this. It was only rhetorical in nature actually :)

I think our (Mr. Yossi and I) workaround should do the trick for what he desires. I've had to use it with the Windows Buttons plugin as well.

PS,...Intrigued!! You sure do [grin] a lot. Is this hereditary, a nervous tick or are you just a happy guy? I think we need a smiley especially for you (with a mere grin). Just an observance (grin).

Ah!

As far as the (grin), that's something I just started with. It was easy and got the point across. But, to ask me to stop would be like telling McDonalds not to show the Arches (if one wants to take it to that extreme). (smirk). Which brings me to others I have used and you should not discount the usefulness of them so quickly as well:

(frown)
(smirk)
(wink)

But, to show that I can put a happy face on, here is my first, drum roll, smilie insertion.

;)

Sincerely,

Corey
08-20-2004, 03:38 PM
Yossi: I dabble in sleep occassionally. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

longedge
08-20-2004, 04:21 PM
I dribble in my sleep occassionally. :)

Surely you can get help (http://www.modafinil.com/article/index.html) for that, at least to keep you awake so it doesn't happen.

JimS
08-21-2004, 12:33 AM
Kurt,
I think it was discussed in a previous post. There is a ..bug..(yes, even in AMS, it happens) that has a disabled object still reacting to the mouse and the tooltip problem you described is the result.
If you would use two button objects one on top of the other, each one with a different tooltip and using the visible property and not the enabled one, you would get what you need.
Attached is a sample project for that.
As to the paths, you have to double slash your directories: adobe\\SVG.

Good luck

Yossi

Good catch Yosik!
Now that you mention it, I do remember you mentioning this before. Looks like I got caught trying to give out pointers without actually building and testing my idea first. Good tip on using the two buttons, probably the easiest way to go.

If a person wanted to use the hotspot method I suggested, they could get what they want if they add actions to move the hotspot (Hotspot.SetPos) and size it down to 1 pixel X 1 pixel (Hotspot.SetSize) when the button is enabled. Seems like that would work (I haven’t actually tested it) although, it would probably take more lines of code than using the pair of buttons as you suggest doing.

Good call Yosik, this shows how experience (your) wins out, over a simple guess (my). :yes

Corey
08-21-2004, 01:10 AM
Naw, I'm just joking around, I get lots of sleep. Super deep too, I'm out within 10 seconds of hitting the pillow every night. It seems like I sleep less because I answer more late night posts, that's all. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

yosik
08-21-2004, 04:06 PM
Rhosk, my apologies. But you know, great minds...etc...
And Jim, each one of us has experience in different situation. As long as we share them among us and learn from each other, we will progress in our knowledge.
Your idea of changing the hotspot size does not work. I tried it and I still got the wrong tooltip, although logically, it should work.

Yossi

rhosk
08-21-2004, 04:17 PM
Not a problem at all, Yossi. It just looked almost like a duplicate post and I was really wondering if my post was actually visible, LOL. And yeah, I probably had that trick up my sleeve because of you. I do believe that you fashioned that workaround a while back and it stuck in my mind. Goes to show ya'...This forum is invaluable. I'm kind of curious if it worked out for kmartin7. Hope so.