"Steve Waring" <
[hidden email]> wrote in message
news:b3htf1$1mcjvb$
[hidden email]...
> > pop up so the full text can be read. Does anyone know of a quick and
> > easy way to get tool tips working on push buttons?
>
> It is a hack, but check out:
>
>
http://www.stevewaring.net/blog/articles/ToolTipResuse.html>
Awesome! Thank you Steve and mm_aa. This saved me a lot of work and got me
pointed in the right direction. Bellow you will find my meager kludgy
contribution to this endeavor. I added your methods to PushButton, and then
borrowed from mm_aa's approach and added a method called
addToolTipToButton: to my presenter class that does what is says. I added
support for multiple lines, as that is what I needed (apparently by setting
a max width you can use cr's to force new lines).
==================
addToolTipToButton: aPushButton
"cdemers - 2/26/2003 Add tool tip support to aPushButton. This is based on
code from Steve Waring and mm_aa."
| toolTipHandle toolInfo |
toolTipHandle := UserLibrary default
createWindowEx: 8 "WS_EX_TOPMOST"
lpClassName: 'tooltips_class32'
lpWindowName: nil
dwStyle: WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP
x: CW_USEDEFAULT
y: CW_USEDEFAULT
nWidth: CW_USEDEFAULT
nHeight: CW_USEDEFAULT
hWndParent: aPushButton handle
hMenu: nil
hInstance: VMLibrary default applicationHandle
lpParam: nil.
(toolInfo := TOOLINFO new)
uFlags: TTF_IDISHWND | TTF_SUBCLASS;
hwnd: aPushButton handle;
uId: aPushButton handle;
textCallback.
UserLibrary default sendMessage: toolTipHandle msg: 1028 "TTM_ADDTOOL"
wParam: 0 lParam: toolInfo yourAddress.
"cdemers - 2/26/2003 Allow multiline."
UserLibrary default sendMessage: toolTipHandle msg: 1048
"TTM_SETMAXTIPWIDTH" wParam: 0 lParam: 500.
==================
Chris