View Full Version : UI Controls without tooltips
12-17-2008, 03:14 PM
I always thought .tooltip was a common rollout control property, but it turns out this isn't the case. Which I think is absolutely absurd, but is there a way to have tooltips on spinners and dropdowns? I know there is a dotnet tooltip, but I wouldn't have an easy way to check when the mouse enters the control, like a .net control has. Any solutions?
12-17-2008, 04:22 PM
I wanted a tooltip for a spinner too a while back. I guess the logic is that you wil have the mouse hovering over the controls much of the time so maybe this was deemed undesirable. Who knows. I dont think it's going to be possible with the current max controls, might have to use a numericupdown instead to get it. However you lose the controller property, which is why i still use the max version of these controls. My only thought is putting an imgtag below the spinner, perhaps it would allow you to use the mouseenter event to pop up something without obstructing the spinners functionality. If you maybe declare the imgtag first it would sit beneath. That's just a guess, Im sure it probably wouldnt work!
12-17-2008, 04:34 PM
Ack, i just tried it and the imgtag does blank out the operation of the spinner. My other thought was to sort of 'clad' around the spinner with 4 small imgtags, but that's getting just plain silly.
12-17-2008, 05:57 PM
Why not use .NET controls-only? That'll solve the problem from the get-go?
I've written a tooltip library for max's own controls without .NET use (see prior threads) - involves way too much code and still doesn't feel quite 'right'.. so unless you absolutely have to support 3ds Max 8 or below, or the .NET spinner makes you go cross-eyed, I'd say just go with .NET controls.
If you do want to keep the traditional UI controls, you can still use the .NET tooltip. The only bit you'll have to deal with is, as you say, figuring out whether the mouse is over a control; create a local array variable with a series of Box2's that correspond to the bounding boxes of the controls you want to tooltip (can easily bound a label and a spinner together), get the mouse coordinate within the dialog, check if that point falls within one of the Box2s, if it does, look up the corresponding tooltip from another local array variable and create the .net tooltip from there. Not sure if creating/manipulating the .net tooltip takes away spinner/edittext/etc. focus, though.
There's no automagic way of creating the Box2 array (there would be if every control had a .width and .height to go with their .pos - but alas) - and if you use offset positioning instead of absolute positioning, you're in for fun in measuring where things end up in the actual dialog, but if it's a fairly static rollout and you don't plan on changing the UI very often, then it's just a small 10 minute job.
12-17-2008, 06:35 PM
Thanks for the idea LR, sorry it doesn't work :(
Zeboxx: That's what I figured about using the .NET tooltip with a standard control. Actually it gave me an idea about auto-documenting rollouts as well, but I think for tooltips if I really need it I'll stick to .NET or no tooltip.
BTW I pity the fool who goes cross eyed from a .NET spinner and would rather use the solution with bounding boxes you described!
12-17-2008, 09:19 PM
haha.. no, I meant the .NET spinner (UpDown control) vs Max's spinners. I much, much prefer max's spinners in terms of visual presentation, input and interaction.
The box2 approach isn't too bad, honestly - it's a bunch of stuff that comes with it that is annoying. You have to disable the tooltip code if a dialog is opened (e.g. file open/save dialogs, etc.), if the user switches to another dialog, if the user is entering text (at least when using a dialog as a tooltip, instead of an imgtag / status bar message), etc.
Maybe the next max will have tooltip properties on everything. Then again, maybe the next max will force everybody to use inlined .NET forms %)
12-17-2008, 09:19 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.