I'm trying to create a tooltip for a small panel and anchor it how I desire. This seems to be very doable by creating a tooltip, then attaching it to the previously made panel. That works, but I can't seem to add text to the custom tooltip. I'd expect Set Dialog Item Text to do the trick, but it does not. I tried Set Dialog Item Tooltip just for good measure but also to no avail.
Again this setup works and anchors the tooltip properly, but I can't find any way to add text. What am I missing?
Setting dialog item size does not visibly change the size of the dialog, nor does it cause the text to appear. Setting size to parent also has no affect on this.
I'm not sure what you mean, I'm already using that action. It is the last line in my first image.
Here is a setup that shows what I do from start to finish.
This is the results of the above trigger. I can move where the tooltip appears by modifying the highlighted line, so I know that part is being referenced properly.
AFAIK you are not supposed to set tooltip text directly within the tooltip dialog item, as tooltip inherits its text from the dialog item that had triggered it. What i want to say is that tooltips are pretty much just containers. One tooltip can serve many dialog items printing different texts.
So try to set tooltip text on the label, not on the tooltip itself.
Dialog-CreateaModaldialogofsize(500,400)at(0,0)relativetoCenterofscreenDialog-Createalabelfordialog(Lastcreateddialog)withthedimensions(200,50)anchoredtoCenterwithanoffsetof(0,0)withthetext"This is a label in the Dialog"colorsettoAutomatictextwriteoutsettoFalsewithawriteoutdurationof2.0Dialog-Set(Lastcreateddialogitem)tooltipto"This is a really really useful tool..."for(Allplayers)Dialog-Show(Lastcreateddialog)for(Allplayers)
This sounded promising, but it does not appear to work. Setting the text for the label tooltip had no affect on the custom tooltip text. With the Dialog - Set Custom Tooltip action enabled, the custom tooltip does overwrite the default one by not causing it to show up, but does not seem to inherit anything. With that action disabled, the default tooltip does appear with text as you would expect.
Did some testing and you are right, custom tooltip indeed doesn't inherits text from the control that had triggered it. It appears to work only for default tooltips, i suspect that behaviour might be controlled by some property that could also be set for custom tooltips, or it's internally handled by SC2..
Tooltip frame by default has 2 childs. "BackgroundImage" and "Label". It's probably created from the StandardTooltip template that looks like this:
So you must hook the label item within created custom tooltip and set text for it. Tested and works for me: http://peeeq.de/gui.php?id=3798
Relevant part:
EDIT:
One more thing worth to mention is that custom tooltip didin't show up for me until i've set the "tooltip text" property within the label that is supposed to trigger it, even though the text i set there isn't even displayed....
EDIT2:
Ah i know why it didin't display without setting the tooltip text for label that is supposed to trigger the tooltip. Cause i had "accept mouse" flag set to false, and apparently setting "tooltip text" property forces it to be true. I noticed you already have it in your snippet though.
Ohhhhhhhhhhhhhhh. This all makes sense in retrospect. A tooltip is a frame containing a label, not a label itself, and naturally you need to reference the actual label for text. Not sure I would have figured that one out on my own as it never occurred to me to look at the XML for a default tooltip template.
I'm trying to create a tooltip for a small panel and anchor it how I desire. This seems to be very doable by creating a tooltip, then attaching it to the previously made panel. That works, but I can't seem to add text to the custom tooltip. I'd expect Set Dialog Item Text to do the trick, but it does not. I tried Set Dialog Item Tooltip just for good measure but also to no avail.
Again this setup works and anchors the tooltip properly, but I can't find any way to add text. What am I missing?
Might want to set a size for the tooltip item, otherwise it's 0x0
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Setting dialog item size does not visibly change the size of the dialog, nor does it cause the text to appear. Setting size to parent also has no affect on this.
Set dialog item custom tooltip, this lets you set tooltip items for a dialog items tooltip
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
I'm not sure what you mean, I'm already using that action. It is the last line in my first image.
Here is a setup that shows what I do from start to finish.
This is the results of the above trigger. I can move where the tooltip appears by modifying the highlighted line, so I know that part is being referenced properly.
AFAIK you are not supposed to set tooltip text directly within the tooltip dialog item, as tooltip inherits its text from the dialog item that had triggered it.
What i want to say is that tooltips are pretty much just containers. One tooltip can serve many dialog items printing different texts.
So try to set tooltip text on the label, not on the tooltip itself.
@SomeoneTookMyNameTT: Go
This sounded promising, but it does not appear to work. Setting the text for the label tooltip had no affect on the custom tooltip text. With the Dialog - Set Custom Tooltip action enabled, the custom tooltip does overwrite the default one by not causing it to show up, but does not seem to inherit anything. With that action disabled, the default tooltip does appear with text as you would expect.
@Rohime: Go
The main thing I'm wanting to do is reanchor the tooltip, which is why I'm trying to work with custom tooltips.
Did some testing and you are right, custom tooltip indeed doesn't inherits text from the control that had triggered it. It appears to work only for default tooltips, i suspect that behaviour might be controlled by some property that could also be set for custom tooltips, or it's internally handled by SC2..
Tooltip frame by default has 2 childs. "BackgroundImage" and "Label". It's probably created from the StandardTooltip template that looks like this:
So you must hook the label item within created custom tooltip and set text for it. Tested and works for me: http://peeeq.de/gui.php?id=3798
Relevant part:
EDIT:
One more thing worth to mention is that custom tooltip didin't show up for me until i've set the "tooltip text" property within the label that is supposed to trigger it, even though the text i set there isn't even displayed....
EDIT2:
Ah i know why it didin't display without setting the tooltip text for label that is supposed to trigger the tooltip. Cause i had "accept mouse" flag set to false, and apparently setting "tooltip text" property forces it to be true. I noticed you already have it in your snippet though.
@SomeoneTookMyNameTT: Go
Ohhhhhhhhhhhhhhh. This all makes sense in retrospect. A tooltip is a frame containing a label, not a label itself, and naturally you need to reference the actual label for text. Not sure I would have figured that one out on my own as it never occurred to me to look at the XML for a default tooltip template.
Thanks for once again fixing my UI! :D