Questions on TrayItem

Hey everyone

I am working on an app and I am using TrayItem. I was able to get the basics running, except for one thing: Is there any way to make the HelpTag dynamic? For example, could the text in the HelpTag change based on information supplied by the software? I think the best option would be that, when the mouse hovers over the icon, the text would be updated right before it is displayed.

Thanks

Richard

I don’t think a TrayItem has a MouseOver event.
Maybe an option is to update the HelpTag every xxx milliseconds using a timer?

Hello Marco

Thanks for your reply. From what I understand, when the mouse passes over the icon, the software will show whatever is set in the HelpTag. The thing is that it is constructed at the start of the application. I am probably missing something because I cannot find a way to update the HelpTag text once the software is running…

Thanks again

Richard

Finally found it…

I do have another question: On one of the notification I have one my computer, actually the wireless network one, the first line of the HelpTag is in regular text and the second one is in italic. Is there a way to recreate that in Xojo?

Thanks again

Richard

[quote=233421:@Richard Hille]Finally found it…

I do have another question: On one of the notification I have one my computer, actually the wireless network one, the first line of the HelpTag is in regular text and the second one is in italic. Is there a way to recreate that in Xojo?[/quote]

Use a window instead of a regular notification.

[quote=233421:@Richard Hille]Finally found it…
[/quote]
Maybe it’s good to share for future searchers.

As for your second question, what Michel said.
Since the Xojo Tooltip doesn’t work anymore when compiled as 64 bits, I made my own MouseTip Class using a Window. I use that everywhere instead of Helptags now. The only tricky part was to prevent the window from grabbing the focus.
Unfortunately, I made it for OS X and it uses quite some declares but if you think you can still use it, let me know.

[quote=233431:@Marco Hof]Maybe it’s good to share for future searchers.

As for your second question, what Michel said.
Since the Xojo Tooltip doesn’t work anymore when compiled as 64 bits, I made my own MouseTip Class using a Window. I use that everywhere instead of Helptags now. The only tricky part was to prevent the window from grabbing the focus.
Unfortunately, I made it for OS X and it uses quite some declares but if you think you can still use it, let me know.[/quote]

I believe a Windows solution is to use a floating window and place a originatingwindow.show where originatingwindow is the window that tiptool is displayed from, in its Activate event. Now the tricky part is that a floating window cannot be a simple box in Windows. So it is necessary to make the bar invisible. Fortunately, there is a goo example of transparent window in the Platform Specific examples/Windows.

@Marco: You are right about sharing. So I actually used a timer as you suggested and updated the HelpTag regularly.

@Marco and Michel: From what I can gather, the HelpTag for a TrayItem is still usable on a 64-bit because that is what I am using on Windows 7 Ultimate and it works well. As for using a window, that could do the trick, but there is no event hander checking for a mouse over. The only thing that will show is the HelpTag.

Thanks again

Richard

Ah, I used a Window of type ‘shadowed box’. I guess that doesn’t work on Windows then?

[quote=233433:@Richard Hille]As for using a window, that could do the trick, but there is no event hander checking for a mouse over. The only thing that will show is the HelpTag.
[/quote]
If that’s the case, I cannot think of anything else than trying to see if the WindowsSystemTrayMBS Class from Christian can help out.

I use my own notifications and tiptools in Windows to conform to the Modern UI rules. The tooltip is much bigger and yellow. Notifications are showing on the right just like they do in Mac OS X.

To show the tooltip I use MouseEnter on the controls of windows, and hide them with MouseExit. The tooltip follows automatically the mouse cursor with a built-in timer.