Row color when mouse over

Row color when mouse over

Postby FranciscoA » Sat Aug 03, 2013 9:04 pm

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
User avatar
FranciscoA
 
Posts: 2132
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Row color when mouse over

Postby hag » Sun Aug 04, 2013 10:17 pm

That would be great. Awaiting an answer.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Row color when mouse over

Postby cnavarro » Sun Aug 04, 2013 11:21 pm

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
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
User avatar
cnavarro
 
Posts: 6515
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Row color when mouse over

Postby hag » Mon Aug 05, 2013 3:26 am

Can you translate the thread to English.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Row color when mouse over

Postby ukoenig » Mon Aug 05, 2013 7:40 am

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Row color when mouse over

Postby cnavarro » Mon Aug 05, 2013 9:59 am

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
cnavarro
 
Posts: 6515
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Row color when mouse over

Postby ukoenig » Mon Aug 05, 2013 10:06 am

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Row color when mouse over

Postby hag » Tue Aug 06, 2013 12:21 am

in the code provided by cnavarro what do the oB, nR,nC,nK values come from?
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Row color when mouse over

Postby cnavarro » Tue Aug 06, 2013 5:43 am

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

..../...

 
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
User avatar
cnavarro
 
Posts: 6515
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Row color when mouse over

Postby hag » Tue Aug 06, 2013 3:06 pm

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

Re: Row color when mouse over

Postby hag » Tue Aug 06, 2013 4:22 pm

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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Row color when mouse over

Postby cnavarro » Tue Aug 06, 2013 8:32 pm

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
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
cnavarro
 
Posts: 6515
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Row color when mouse over

Postby hag » Tue Aug 06, 2013 9:15 pm

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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Row color when mouse over

Postby FranciscoA » Tue Aug 06, 2013 10:55 pm

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
User avatar
FranciscoA
 
Posts: 2132
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Row color when mouse over

Postby hag » Tue Aug 06, 2013 11:14 pm

Now I understand. When you get the code works let me know.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 127 guests