Row color when mouse over

User avatar
FranciscoA
Posts: 2163
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Row color when mouse over

Post by FranciscoA »

Friends of the forum,

What is the way to shade a line in xBrowse when the mouse is over it?

That is, we have the currently selected line with their respective colors, but when moves the mouse over other line, we want to shade this line with a different color. (something like this forum page)


Someone with an example?

Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Row color when mouse over

Post by hag »

That would be great. Awaiting an answer.
Thank you
Harvey
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: Row color when mouse over

Post by cnavarro »

http://forums.fivetechsupport.com/viewtopic.php?f=6&t=26903#p149365

I've tried several times, without success
It should be as simple as putting a function in the DATA OnMouseMove

Code: Select all | Expand


    oBrw:OnMouseMove      := { | oB , nR, nC, nK | PintaOverLine( oB, nR, nC, nK ) }

    ... / ...
   oBrw:CreateFromCode()
Return oBrw

function PintaOverLine( oB, nR, nC, nK )
   local nOldRowPos := oB:nRowSel
   local nOldColPos := oB:nColSel
   local nMouseRow  := oB:MouseRowPos( nR )
   local nMouseCol  := oB:MouseColPos( nC )

//if !oB:lPressed .and. !oB:lCaptured
 //if nOldRowPos <> nMouseRow .and. nOldColPos <> nMouseCol   //No estoy en la misma posicion que la seleccionada
    oB:Descripcion:cFooter := Str(nMouseRow ,4 )+" / "+Str( nMouseCol, 4 )+" / "+;
                              Str( nOldRowPos , 4 )+" / "+Str( nOldColPos, 4 )
    oB:RefreshFooters()
 //endif
//endif

return .t.
 

But I have found that the MouseMove not run this DATA Browse until you go through the Header (any), which should not be to my understanding of normal behavior. I only updated when you go through the header. For that reason I can not find the row in which it is located. SI column updates the number passing through the column header.
If a refresh and position correctly when performing the Browse OVER costase not think much paint the cell / line which the mouse was positioned.
I've left open, like other things, to make sure that when I upgrade to the new version (currently use FWH 12.03) remains the same behavior. If so I'll have to make a class that inherits from xBrowse and modify the MouseMove to check it because I need it too.

Maybe your classmates or, have other ideas that lead out of the error of this appreciation.
regards
Last edited by cnavarro on Mon Aug 05, 2013 1:16 pm, edited 1 time in total.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Row color when mouse over

Post by hag »

Can you translate the thread to English.
Thank you
Harvey
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Row color when mouse over

Post by ukoenig »

Hello,

would be a nice solution as well, only for a cell if :

:nMarqueeStyle := MARQSTYLE_SOLIDCELL

Best Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: Row color when mouse over

Post by cnavarro »

Uwe
¿That works without pressing the mouse button?
He has to paint the cell or line to move the mouse over the control (xbrowse) without pressing click
regards

Uwe
¿Eso funciona sin pulsar click con el mouse?
Ha de pintar la celda o la linea al mover el raton sobre el control (xbrowse) sin pulsar click
Saludos
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Row color when mouse over

Post by ukoenig »

Cristobal,

I'm looking for a cell-solution.
Like displaying a cell-tooltip on mousecapture,
i would like to change the cellcolor as well.

Best Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Row color when mouse over

Post by hag »

in the code provided by cnavarro what do the oB, nR,nC,nK values come from?
Thank you
Harvey
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: Row color when mouse over

Post by cnavarro »

oBrw:OnMouseMove := { | oB , nR, nC, nK | PintaOverLine( oB, nR, nC, nK ) }

oBrw:OnMouseMove := { | oBrowse, nRow, nCol, nKey | PintaOverLine( oBrowse, nRow, nCol, nKey ) }

Regards

Code: Select all | Expand


METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TWindow

   if ::oCursor != nil
      SetCursor( ::oCursor:hCursor )
   else
      CursorArrow()
   endif

   ::SetMsg( ::cMsg )

   ::CheckToolTip()

   if ::OnMouseMove != nil
      if ValType( ::OnMouseMove ) == "B"
         Eval( ::OnMouseMove, Self, nRow, nCol, nKeyFlags )
      endif
      if ValType( ::OnMouseMove ) == "C"
         OSend( Self, ::OnMouseMove, Self, nRow, nCol, nKeyFlags )
      endif
   endif

..../...

 
Last edited by cnavarro on Tue Aug 06, 2013 4:18 pm, edited 1 time in total.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Row color when mouse over

Post by hag »

Thanks.
Thank you
Harvey
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Row color when mouse over

Post by hag »

I get the following error message.

Path and name: f:\color\cashvr11.exe (32 bits)
Size: ********* bytes
Time from start: 0 hours 0 mins 11 secs
Error occurred at: 08/06/13, 09:20:56
Error description: Error BASE/1100 Argument error: TRIM
Args:
[ 1] = U

Stack Calls
===========
Called from: => TRIM(0)
Called from: => (b)OCOL(1364)
Called from: => ASCAN(0)
Called from: => TXBROWSE:OCOL(1364)
Called from: => TXBROWSE:DESCRIPCION(4615)
Called from: .\JBROWSE.PRG => PINTAOVERLINE(13421)
Called from: .\JBROWSE.PRG => (b)PLBROW(1174)


Any suggestions how to fix this. I believe the problem is in xbrowse.prg. In the method.
Thank you
Harvey
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: Row color when mouse over

Post by cnavarro »

Harvey
DESCRIPTION You have to change the name of your xbrowse column in which you want your foot in the message.
regards

Code: Select all | Expand


   // Descripcion -> change with you column
   oB:Descripcion:cFooter := Str(nMouseRow ,4 )+" / "+Str( nMouseCol, 4 )+" / "+;
                                         Str( nOldRowPos , 4 )+" / "+Str( nOldColPos, 4 )

 


Sorry for the translation -> Google Translate
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Row color when mouse over

Post by hag »

Maybe I'm confused: Francisco wrote

" Row color when mouse over
Friends of the forum,
What is the way to shade a line in xBrowse when the mouse is over it?
That is, we have the currently selected line with their respective colors, but when moves the mouse over other line, we want to shade this line with a different color. (something like this forum page)
Someone with an example?"


is the code we are talking about for that purpose. Looking at the code it seems to be for something else. What am I missing?
Thank you
Harvey
User avatar
FranciscoA
Posts: 2163
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Row color when mouse over

Post by FranciscoA »

hag,

It's the same, but the code of Cristobal is a work in progress. He has not yet been completed.
In other words, is just an example of what he has done about it.

I am trying to found the correct code, also.
Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
hag
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California
Contact:

Re: Row color when mouse over

Post by hag »

Now I understand. When you get the code works let me know.
Thank you
Harvey
Post Reply