In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

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

Xailer professional forum in English
Responder
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

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

Mensaje 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
jlalin
Mensajes: 926
Registrado: Sab Dic 25, 2010 11:10 pm

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

Mensaje 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
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

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

Mensaje 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
jlalin
Mensajes: 926
Registrado: Sab Dic 25, 2010 11:10 pm

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

Mensaje 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
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

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

Mensaje 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
jlalin
Mensajes: 926
Registrado: Sab Dic 25, 2010 11:10 pm

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

Mensaje por jlalin »

Chris,
glad to see it helped!
Regards,
José Lalí­n
Responder