Forbid to set cursor on column

Forbid to set cursor on column

Postby Natter » Fri Nov 18, 2016 2:39 pm

Hi, all !

I leaf through xbrowse horizontal arrows right or left while one or the other column becomes current. Is it possible to forbid to set the cursor on the selected column ?
Natter
 
Posts: 1144
Joined: Mon May 14, 2007 9:49 am

Re: Forbid to set cursor on column

Postby nageswaragunupudi » Sun Nov 20, 2016 12:03 pm

Please try this sample
Code: Select all  Expand view

#include "fivewin.ch"

function Main()

   local oBrw, oDlg
   local nCol  := 1
   local nSkipCol

   USE CUSTOMER NEW SHARED
   DEFINE DIALOG oDlg SIZE 900,400 PIXEL TRUEPIXEL

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" AUTOCOLS CELL LINES NOBORDER


   nSkipCol    := 3 // should be less than the last column number

   WITH OBJECT oBrw
      :lColChangeNotify := .t.
      :bChange    := { |brw,lColChange| OnChange( brw, lColChange, @nCol, nSkipCol ) }
      //
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED

return nil

//----------------------------------------------------------------------------//

static function OnChange( oBrw, lColChange, nCol, nSkipCol )

   local oCol := oBrw:SelectedCol()

   if oCol:nCreationOrder == nSkipCol
      if oCol:nPos == 1 .or. oCol:nPos > nCol
         oBrw:GoRight()
      else
         oBrw:GoLeft()
      endif
   else
      nCol  := oBrw:nColSel
   endif

return nil

//----------------------------------------------------------------------------//
 

But normally there should not be such a requirement. If what is wanted is to skip some columns during fastedit, if oCol:bEditWhen evaluates to .T. or oCol:lReadOnly is .T. or oCo:nEditType is 0 (default) such columns are jumped over during fastedit.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10322
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Forbid to set cursor on column

Postby Natter » Sun Nov 20, 2016 7:28 pm

Thank You, Mr. Rao, You are very help me !
Natter
 
Posts: 1144
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: cmsoft and 117 guests