Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

How to set tip for a StatusBarItem?

Visto 0 veces
Saltar al primer mensaje no leído

Dmitry Zamotkin

no leída,
26 jul 2001, 9:09:1226/7/01
a
Hello, all!

I have tried to use StatusBar>>setItem:tipText: but without any results.
It's calling from StatusBarItemAbstract>>updateTipText and that has comment:

"Private - Update the receiver's tool tip text.
We set this to be the same as the receiver's text so that full text can be
viewed when
truncated."

I also have increased a string to display in StatusBarItem but tooltip text
not wanted to show.

Thanks in advance,
Dmitry Zamotkin


Ian Bartholomew

no leída,
26 jul 2001, 19:20:5926/7/01
a
Dmitry,

> I have tried to use StatusBar>>setItem:tipText: but without any results.

I had a look at this and came up with the following ...

There is one error (at least) as StatusBarItem>>getTipText should answer a
String rather than self as it does at the moment - a missing ^.

The bad news is that even if you do fix the above method you still don't see
any tool tips.

I can't find it documented anywhere (I didn't do an exhaustive search
though) but it appears that the method that Dolphin uses to draw the
StatusBarItems, using the SBT_OWNERDRAW style, is not compatible with the
use of ToolTips [1]. I came to this conclusion as I found that making a
small modification to one method, so that Windows became responsible for
drawing the StatusBar, made ToolTips work correctly. The downside is that
you no longer get Icons displayed and there may well be other differences
that I didn't spot.

The change is very simple, just the above fix to #getTipText and the
following modification.

StatusBar>>setText: aStatusOwnerDraw
| index text |
index := self indexOfItem: aStatusOwnerDraw.
text := aStatusOwnerDraw model isNil
ifTrue: [String new]
ifFalse: [aStatusOwnerDraw model value].
(self
sendMessage: SB_SETTEXT
wParam: (aStatusOwnerDraw border | index-1)
lParam: text yourAddress) == 0
ifTrue: [^self errorInCommonControlCall].

Be careful though as I haven't fully tested it.

Ian

[1] It does make some sense though as the ToolTip is only displayed in
certain circumstances, mainly when the text is too wide to fit in the status
box. If Windows doesn't know what text is being displayed, because the view
was drawn by Dolphin, then it won't know whether to pop up the ToolTip or
not?


Dmitry Zamotkin

no leída,
27 jul 2001, 1:59:0127/7/01
a
Hello Ian,

"Ian Bartholomew" <ne...@iandb.org.uk> wrote in message
news:9jq8kd$12m0l$1...@ID-27443.news.dfncis.de...


> Dmitry,
>
> > I have tried to use StatusBar>>setItem:tipText: but without any results.
>
> I had a look at this and came up with the following ...
>
> There is one error (at least) as StatusBarItem>>getTipText should answer a
> String rather than self as it does at the moment - a missing ^.


OK, I fix it


> The bad news is that even if you do fix the above method you still don't
see
> any tool tips.


:-(


> I can't find it documented anywhere (I didn't do an exhaustive search
> though) but it appears that the method that Dolphin uses to draw the
> StatusBarItems, using the SBT_OWNERDRAW style, is not compatible with the
> use of ToolTips [1]. I came to this conclusion as I found that making a
> small modification to one method, so that Windows became responsible for
> drawing the StatusBar, made ToolTips work correctly. The downside is that
> you no longer get Icons displayed and there may well be other differences
> that I didn't spot.
>
> The change is very simple, just the above fix to #getTipText and the
> following modification.
>
> StatusBar>>setText: aStatusOwnerDraw
> | index text |
> index := self indexOfItem: aStatusOwnerDraw.
> text := aStatusOwnerDraw model isNil
> ifTrue: [String new]
> ifFalse: [aStatusOwnerDraw model value].
> (self
> sendMessage: SB_SETTEXT
> wParam: (aStatusOwnerDraw border | index-1)


If you write like in an original method:
wParam: (aStatusOwnerDraw border|SBT_OWNERDRAW|index-1)
icons will be displayed!


> lParam: text yourAddress) == 0
> ifTrue: [^self errorInCommonControlCall].
>
> Be careful though as I haven't fully tested it.
>
> Ian
>
> [1] It does make some sense though as the ToolTip is only displayed in
> certain circumstances, mainly when the text is too wide to fit in the
status
> box. If Windows doesn't know what text is being displayed, because the
view
> was drawn by Dolphin, then it won't know whether to pop up the ToolTip or
> not?
>

Anyway, it does not work... Thanks, Ian, for your comments, now I khow the
way to go on.


--
Dmitry Zamotkin


0 mensajes nuevos