You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Tushar Kale <ts...@gmail.com> on 2010/01/24 02:41:15 UTC
Using Tool tip
Hello:
I need to show multi-line tool tip on an image and control the horizontal
position of the tool tip window when it is displayed.
If the image is close to the window border, I would like to shift the tool
tip window so complete tool tip is visible.
Is there a way to access component's tool tip window and set its location?
I tried to use \n in the text string but that is ignored.
What is the best way to achieve this?
Thanks!
~ Tushar
Re: Using Tool tip
Posted by Greg Brown <gk...@mac.com>.
Scratch that - what I was thinking won't work. I had planned to set a maximum preferred width on the label so that it wraps when it gets to the given width. However, LabelSkin doesn't currently respect the min/max preferred width value when it is asked for its unconstrained preferred size (in fact, this limitation applies to most components).
This is a bigger change that we'll have to address in a future release. Best we can probably do short-term is make sure the tooltip remains on screen. Sorry - hope that helps.
Greg
On Jan 24, 2010, at 9:36 AM, Tushar Kale wrote:
> Yes that will work.
> I was thinking of changing the skin but not sure how to do that.
> If you could suggest the modification that will be great help.
> Thanks!
> ~Tushar
>
> On Sun, Jan 24, 2010 at 8:19 AM, Greg Brown <gk...@mac.com> wrote:
> Actually, I'm wrong about hiding the tooltip - your application would only need to show and position it. The tooltip will hide itself when the user moves the mouse.
>
> On Jan 24, 2010, at 8:08 AM, Greg Brown wrote:
>
> > Hi Tushar,
> >
> > The default tooltip provided by the component does not support multi-line tooltips. Ensuring that tooltips always remain visible is actually a to-do for Pivot 1.4.1:
> >
> > http://issues.apache.org/jira/browse/PIVOT-23
> >
> > However, you could potentially create an instance of Tooltip yourself. With a small modification we get the tooltip text to wrap. However, your application code would be responsible for showing, hiding, and positioning the tooltip. If this would be sufficient, I can suggest some code you might use to accomplish it.
> >
> > Greg
> >
> > On Jan 23, 2010, at 8:41 PM, Tushar Kale wrote:
> >
> >> Hello:
> >>
> >> I need to show multi-line tool tip on an image and control the horizontal position of the tool tip window when it is displayed.
> >> If the image is close to the window border, I would like to shift the tool tip window so complete tool tip is visible.
> >>
> >> Is there a way to access component's tool tip window and set its location?
> >> I tried to use \n in the text string but that is ignored.
> >> What is the best way to achieve this?
> >> Thanks!
> >>
> >> ~ Tushar
> >
>
>
Re: Using Tool tip
Posted by Tushar Kale <ts...@gmail.com>.
Yes that will work.
I was thinking of changing the skin but not sure how to do that.
If you could suggest the modification that will be great help.
Thanks!
~Tushar
On Sun, Jan 24, 2010 at 8:19 AM, Greg Brown <gk...@mac.com> wrote:
> Actually, I'm wrong about hiding the tooltip - your application would only
> need to show and position it. The tooltip will hide itself when the user
> moves the mouse.
>
> On Jan 24, 2010, at 8:08 AM, Greg Brown wrote:
>
> > Hi Tushar,
> >
> > The default tooltip provided by the component does not support multi-line
> tooltips. Ensuring that tooltips always remain visible is actually a to-do
> for Pivot 1.4.1:
> >
> > http://issues.apache.org/jira/browse/PIVOT-23
> >
> > However, you could potentially create an instance of Tooltip yourself.
> With a small modification we get the tooltip text to wrap. However, your
> application code would be responsible for showing, hiding, and positioning
> the tooltip. If this would be sufficient, I can suggest some code you might
> use to accomplish it.
> >
> > Greg
> >
> > On Jan 23, 2010, at 8:41 PM, Tushar Kale wrote:
> >
> >> Hello:
> >>
> >> I need to show multi-line tool tip on an image and control the
> horizontal position of the tool tip window when it is displayed.
> >> If the image is close to the window border, I would like to shift the
> tool tip window so complete tool tip is visible.
> >>
> >> Is there a way to access component's tool tip window and set its
> location?
> >> I tried to use \n in the text string but that is ignored.
> >> What is the best way to achieve this?
> >> Thanks!
> >>
> >> ~ Tushar
> >
>
>
Re: Using Tool tip
Posted by Greg Brown <gk...@mac.com>.
Actually, I'm wrong about hiding the tooltip - your application would only need to show and position it. The tooltip will hide itself when the user moves the mouse.
On Jan 24, 2010, at 8:08 AM, Greg Brown wrote:
> Hi Tushar,
>
> The default tooltip provided by the component does not support multi-line tooltips. Ensuring that tooltips always remain visible is actually a to-do for Pivot 1.4.1:
>
> http://issues.apache.org/jira/browse/PIVOT-23
>
> However, you could potentially create an instance of Tooltip yourself. With a small modification we get the tooltip text to wrap. However, your application code would be responsible for showing, hiding, and positioning the tooltip. If this would be sufficient, I can suggest some code you might use to accomplish it.
>
> Greg
>
> On Jan 23, 2010, at 8:41 PM, Tushar Kale wrote:
>
>> Hello:
>>
>> I need to show multi-line tool tip on an image and control the horizontal position of the tool tip window when it is displayed.
>> If the image is close to the window border, I would like to shift the tool tip window so complete tool tip is visible.
>>
>> Is there a way to access component's tool tip window and set its location?
>> I tried to use \n in the text string but that is ignored.
>> What is the best way to achieve this?
>> Thanks!
>>
>> ~ Tushar
>
Re: Using Tool tip
Posted by Greg Brown <gk...@mac.com>.
Hi Tushar,
The default tooltip provided by the component does not support multi-line tooltips. Ensuring that tooltips always remain visible is actually a to-do for Pivot 1.4.1:
http://issues.apache.org/jira/browse/PIVOT-23
However, you could potentially create an instance of Tooltip yourself. With a small modification we get the tooltip text to wrap. However, your application code would be responsible for showing, hiding, and positioning the tooltip. If this would be sufficient, I can suggest some code you might use to accomplish it.
Greg
On Jan 23, 2010, at 8:41 PM, Tushar Kale wrote:
> Hello:
>
> I need to show multi-line tool tip on an image and control the horizontal position of the tool tip window when it is displayed.
> If the image is close to the window border, I would like to shift the tool tip window so complete tool tip is visible.
>
> Is there a way to access component's tool tip window and set its location?
> I tried to use \n in the text string but that is ignored.
> What is the best way to achieve this?
> Thanks!
>
> ~ Tushar