Page 1 of 1

"Resize" event for tcbrowse column

Posted: Wed May 06, 2009 3:25 pm
by hterce
Hi,
What event gets triggered when the user resizes the column width of the tcbrowse control? I appreciate any help.

Bert

Re: "Resize" event for tcbrowse column

Posted: Thu May 07, 2009 12:56 am
by Antonio Linares
Bert,

Class TCBrowse does not send any specific notification for such event.

What action do you need to do on such event ? We may provide you some info about how to do it :-)

Re: "Resize" event for tcbrowse column

Posted: Thu May 07, 2009 1:40 am
by hterce
Hi,

This is just a cosmetic thing. I have a dialog with two "identical" grids. I want the grids to be of the same column widths all the time. So, I need to know if the user resizes the first grid so i can update the other one.

Thanks
Bert

Re: "Resize" event for tcbrowse column

Posted: Thu May 07, 2009 2:12 am
by Antonio Linares
Bert,

You could easily modify Class TWBrowse Method LButtonUp() to fire such notification. Here I show you how to modify it. You may need to add a new DATA bColResized:

Code: Select all

METHOD LButtonUp( nRow, nCol, nFlags ) CLASS TWBrowse

   if ::lDrag
      return Super:LButtonUp( nRow, nCol, nFlags )
   endif

   if ::lCaptured
      ::lCaptured = .f.
      ReleaseCapture()
      ::VertLine()
      If ! Empty( ::bColResized )  // new !
         Eval( ::bColResized, Self )  // new !
      endif  // new !
   endif

   Super:LButtonUp( nRow, nCol, nFlags )

return nil
 
oBrowse:bColResized = { | oBrowse | ... your code ... }

Re: "Resize" event for tcbrowse column

Posted: Thu May 07, 2009 2:58 am
by hterce
Antonio, thanks a lot. This should do it. Have a nice day.

Bert