Hi all,
I have a problem with tooltips.
On a ChildAppWindow a draw a schedule. The schedule shows the hirers of a
s****ts hall. Form left to right the hours of a day, from top to bottom the
days of a week. The hirers are reprecented by different colors, for this
RectangleObjects are drawn.
Recently I added a tooltip at moveover showing the name of the hirer.
Problem is that on about the lower 1/3 this does not work, no tooltip is
shown. HitTest returns true however.
As all drawing is relative to the size of the window, I can draw it in any
size. Strange thing is that If I resize my screen to a smaller height, it
all works fine.
Does somebody has any clue where to look for ?
Tia,
Erik
The Tooltip is initialized in the postinit like this:
hTooltip := CreateWindowEx( WS_EX_TOPMOST,;
String2Psz(TOOLTIPS_CLASS),;
NULL_PTR,;
_OR(WS_POPUP, TTS_NOPREFIX, TTS_ALWAYSTIP , TTS_BALLOON),;
CW_USEDEFAULT,;
CW_USEDEFAULT,;
CW_USEDEFAULT,;
CW_USEDEFAULT,;
SELF:Handle(),;
NULL_PTR,;
_GetInst(),;
NULL_PTR)
SELF:AddToolTip( SELF:Handle(),4711, "Test" )
SendMessage( hTooltip,TTM_ACTIVATE, 1, 0)
SendMessage(hTooltip, TTM_SETMAXTIPWIDTH, 0, 200)
SendMessage(hTooltip, TTM_SETDELAYTIME, TTDT_AUTOPOP, 1500)
SendMessage(hTooltip, TTM_SETDELAYTIME, TTDT_RESHOW, 1)
METHOD AddToolTip(hW AS PTR, nID AS INT, cT AS STRING) AS VOID PASCAL
CLASS
Color_Rooster_Window
LOCAL rc IS _winRECT
IF hTooltip == NULL_PTR
//? "Error"
RETURN
ENDIF
GetClientRect(hW, @[EMAIL PROTECTED]
)
ti.cbSize := _SIZEOF(_winTOOLINFO)
ti.uFlags := TTF_SUBCLASS
ti.hwnd := hW
ti.hinst := _GetInst()
ti.uId := nID
ti.rect.left := rc.left
ti.rect.top := rc.top
ti.rect.right := rc.right
ti.rect.bottom := rc.bottom
ti.lpszText := String2Psz("Testdertest") //LPSTR_TEXTCALLBACK
SendMessage(hTooltip, TTM_ADDTOOL, 0L, LONG(_CAST, @[EMAIL PROTECTED]
))
RETURN
And this is the MouseMove Method
METHOD MouseMove(oMouseEvent) CLASS Color_Rooster_Window
LOCAL nButtonID AS INT
LOCAL xPos, yPos AS INT
LOCAL cAllText AS STRING
nButtonID := IIF(oMouseEvent == NULL_OBJECT, 0, oMouseEvent:ButtonID)
SUPER:MouseMove(oMouseEvent)
xPos := oMouseEvent:Position:x
yPos := oMouseEvent:Position:y
IF SELF:Hittest( xPos, yPos, @[EMAIL PROTECTED]
)
// returns true, cAllText contains a name so everything is fine
// but the tooltip is not shown on the lower part of the screen
ti.lpszText := String2Psz( cAllText )
SendMessage(hTooltip, TTM_ADDTOOL, 0L, LONG(_CAST, @[EMAIL PROTECTED]
))
SendMessage(hTooltip, TTM_UPDATETIPTEXT, 0L, LONG(_CAST, @[EMAIL PROTECTED]
))
ELSE
ti.lpszText := String2Psz( "")
SendMessage(hTooltip, TTM_DELTOOL, 0L, LONG(_CAST, @[EMAIL PROTECTED]
))
ENDIF
RETURN NIL


|