Page 1 of 2

Row color when mouse over

PostPosted: Sat Aug 03, 2013 9:04 pm
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.

Re: Row color when mouse over

PostPosted: Sun Aug 04, 2013 10:17 pm
by hag
That would be great. Awaiting an answer.

Re: Row color when mouse over

PostPosted: Sun Aug 04, 2013 11:21 pm
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 view

    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

Re: Row color when mouse over

PostPosted: Mon Aug 05, 2013 3:26 am
by hag
Can you translate the thread to English.

Re: Row color when mouse over

PostPosted: Mon Aug 05, 2013 7:40 am
by ukoenig
Hello,

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

:nMarqueeStyle := MARQSTYLE_SOLIDCELL

Best Regards
Uwe :?:

Re: Row color when mouse over

PostPosted: Mon Aug 05, 2013 9:59 am
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

Re: Row color when mouse over

PostPosted: Mon Aug 05, 2013 10:06 am
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 :?:

Re: Row color when mouse over

PostPosted: Tue Aug 06, 2013 12:21 am
by hag
in the code provided by cnavarro what do the oB, nR,nC,nK values come from?

Re: Row color when mouse over

PostPosted: Tue Aug 06, 2013 5:43 am
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 view

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

..../...

 

Re: Row color when mouse over

PostPosted: Tue Aug 06, 2013 3:06 pm
by hag
Thanks.

Re: Row color when mouse over

PostPosted: Tue Aug 06, 2013 4:22 pm
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.

Re: Row color when mouse over

PostPosted: Tue Aug 06, 2013 8:32 pm
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 view

   // 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

Re: Row color when mouse over

PostPosted: Tue Aug 06, 2013 9:15 pm
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?

Re: Row color when mouse over

PostPosted: Tue Aug 06, 2013 10:55 pm
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.

Re: Row color when mouse over

PostPosted: Tue Aug 06, 2013 11:14 pm
by hag
Now I understand. When you get the code works let me know.