Página 1 de 1

Mouseover ArrayBrowse cells - Popup window or tooltip or balloon showing extra info ?

Publicado: Dom Oct 23, 2011 10:52 pm
por ChrisGillard
I am wanting to display some extra data in a small window or tooltip or
balloon when mouse is over a cell in an ArrayBrowse.
I can detect which cell my mouse is over with this code ........... and
LogDisplay some data.
METHOD ArrayBrowse1MouseMove( oSender, nKeyFlags, nPosX, nPosY ) CLASS
TForm1
local nRow := 0
local nCol := 0
IF ! oSender:SelectCellFromPoint( nPosX, nPosY )
return nil
ENDIF
nRow := oSender:MouseRowPos( nPosY )
nCol := oSender:MouseColPos( nPosX )
// This works ... but I want a small window/tooltip/balloon
if nCol > 2 // Only want to do this for cells in Column 3, 4
etc ...
Logdisplay( nRow, nCol, CStr( oSender:aArrayData[nRow, nCol] ) )
endif
Any thoughts on how to do this as a small Window or Tooltip or Balloon would
be appreciated.
Chris

Mouseover ArrayBrowse cells - Popup window or tooltip or balloon showing extra info ?

Publicado: Lun Oct 24, 2011 11:10 am
por jlalin
Chris,
try this (not tested):
CLASS TArrayBrowse FROM XArrayBrowse
DATA lShowing INIT .F.
METHOD WMMouseMove( oSender, nKeyFlags, nPosX, nPosY )
METHOD WMMouseLeave( nWParam, nLParam )
ENDCLASS
METHOD WMMouseMove( oSender, nKeyFlags, nPosX, nPosY ) CLASS TArrayBrowse
local nRow := 0
local nCol := 0
local cData :=
IF ! ::lShowing
IF ! oSender:SelectCellFromPoint( nPosX, nPosY )
RETURN Nil
ENDIF
nRow := oSender:MouseRowPos( nPosY )
nCol := oSender:MouseColPos( nPosX )
IF nCol> 2
cData := CStr( oSender:aArrayData[nRow, nCol] )
::ShowBalloon( aPos[1], aPos[2], cData )
//::ShowTooltip( aPos[1], aPos[2], cData )
TrackMouseEvent( ::Handle, TME_LEAVE )
::lShowing := .T.
ENDIF
ENDIF
RETURN Nil
METHOD WMMouseLeave( nWParam, nLParam ) CLASS TArrayBrowse
::HideBalloon()
::lShowing := .F.
RETURN Nil
Regards,
José Lalí­n

Mouseover ArrayBrowse cells - Popup window or tooltip or balloon showing extra info ?

Publicado: Lun Oct 24, 2011 7:14 pm
por ChrisGillard
Jose,
Thanks for your impressive code ... I have it working 95%.
The balloon is displayed correctly in the same place but if you move another
window like IE over the balloon area the balloon stays on top of IE! Its
like its 'always on top'.
Possibly a 'parent' issue.
Other than that doing exactly what I want.
Thanks
Chris
"José Lalín" <dezac@corevia.com> wrote in message
news:4ea52b68$[email=2@svctag-j7w3v3j....]2@svctag-j7w3v3j....[/email]
Chris,
try this (not tested):
CLASS TArrayBrowse FROM XArrayBrowse
DATA lShowing INIT .F.
METHOD WMMouseMove( oSender, nKeyFlags, nPosX, nPosY )
METHOD WMMouseLeave( nWParam, nLParam )
ENDCLASS
METHOD WMMouseMove( oSender, nKeyFlags, nPosX, nPosY ) CLASS TArrayBrowse
local nRow := 0
local nCol := 0
local cData :=
IF ! ::lShowing
IF ! oSender:SelectCellFromPoint( nPosX, nPosY )
RETURN Nil
ENDIF
nRow := oSender:MouseRowPos( nPosY )
nCol := oSender:MouseColPos( nPosX )
IF nCol> 2
cData := CStr( oSender:aArrayData[nRow, nCol] )
::ShowBalloon( aPos[1], aPos[2], cData )
//::ShowTooltip( aPos[1], aPos[2], cData )
TrackMouseEvent( ::Handle, TME_LEAVE )
::lShowing := .T.
ENDIF
ENDIF
RETURN Nil
METHOD WMMouseLeave( nWParam, nLParam ) CLASS TArrayBrowse
::HideBalloon()
::lShowing := .F.
RETURN Nil
Regards,
José Lalín

Mouseover ArrayBrowse cells - Popup window or tooltip or balloon showing extra info ?

Publicado: Lun Oct 24, 2011 7:37 pm
por jlalin
Chris,
> Thanks for your impressive code ... I have it working 95%.
You are welcome.
> The balloon is displayed correctly in the same place but if you move another
> window like IE over the balloon area the balloon stays on top of IE! Its
> like its 'always on top'.
The systems usually sends a WM_KILLFOCUS to any window loosing the focus so
maybe this helps:
METHOD WMKillFocus() CLASS TArrayBrowse
::HideBalloon()
RETURN Nil
Regards,
José Lalí­n

Mouseover ArrayBrowse cells - Popup window or tooltip or balloon showing extra info ?

Publicado: Mar Oct 25, 2011 7:36 pm
por ChrisGillard
Jose,
Thanks for that extra help.
That has made things work perfectly.
I am just about to post another question on a different problem though!
Thanks for your help again.
Regards
Chris
"José Lalín" <dezac@corevia.com> wrote in message
news:4ea5a21a$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
Chris,
> Thanks for your impressive code ... I have it working 95%.
You are welcome.
> The balloon is displayed correctly in the same place but if you move
> another
> window like IE over the balloon area the balloon stays on top of IE! Its
> like its 'always on top'.
The systems usually sends a WM_KILLFOCUS to any window loosing the focus so
maybe this helps:
METHOD WMKillFocus() CLASS TArrayBrowse
::HideBalloon()
RETURN Nil
Regards,
José Lalín

Mouseover ArrayBrowse cells - Popup window or tooltip or balloon showing extra info ?

Publicado: Mar Oct 25, 2011 9:26 pm
por jlalin
Chris,
glad to see it helped!
Regards,
José Lalí­n