FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Evitar el avance a la izq. en xBrowse
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Evitar el avance a la izq. en xBrowse
Posted: Fri Feb 10, 2017 01:08 PM

Estimados

Existe en xBrowse un parámetro que evite mover el puntero a la izquierda
al haber bloqueado con oBrw:=nFreeze:=3

En TsBrowse existe oBrw:lLockFreeze:=.T.

Saludos,



Adhemar C.
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Evitar el avance a la izq. en xBrowse
Posted: Sun Feb 12, 2017 12:07 AM
Adhemar.
Prueba modificando el method GoLeft() de TxBrowse, de esta manera:
Code (fw): Select all Collapse
METHOD GoLeft( lOffset, lRefresh )  CLASS TXBrowse

   ::CancelEdit()

   if ::nMarqueeStyle == MARQSTYLE_NOMARQUEE  .or. ( ::nMarqueeStyle >= MARQSTYLE_HIGHLROW .and. ::bClrRowFocus == nil )
      lOffset := .t.
   endif

   DEFAULT lOffset  := .f.,;
           lRefresh := .t.

   if ::nFreeze > 0 .and. ::SelectedCol():nCreationOrder == ::nFreeze + 1   //<------
      return nil
   endif


Puede ser que tambien necesites modificar el method keyDown(), o solo enviarle el Bloque bKeyDowun
Mr. Nages tiene la ultima palabra.
Saludos.
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Evitar el avance a la izq. en xBrowse
Posted: Sun Feb 12, 2017 08:08 AM
It is a good idea to have this feature in xbrowse too. We provided this in FWH 17.02 to be released.

You can make these changes in the xbrowse.prg:

1) Please add new DATA
Code (fw): Select all Collapse
   DATA lLockFreeze AS LOGICAL INIT .t.


2. Go to the end of METHOD Adjust()
Add these lines at the end of Adjust() method
Code (fw): Select all Collapse
   if ::lLockFreeze
      ::nColSel   := ::nFreeze + 1
   endif


3. Go to METHOD GoLeftMost(). and find this line at the beginning
Code (fw): Select all Collapse
   ::nColSel := 1

Modify this line as:
Code (fw): Select all Collapse
   ::nColSel   := If( ::lLockFreeze, ::nFreeze, 0 ) + 1


4. Go to METHOD GoLeft().
Locate these lines:
Code (fw): Select all Collapse
   if ::lFreezeLikeExcel .and. ::nFreeze > 0 .and. ::nColOffSet > 1 .and. ::nColSel == ::nFreeze + 1
      lOffset := .t.
   endif

   if ( !lOffset .and. ::IsDisplayPosVisible( ::nColSel - 1 ) ) .or. ;
      ( ::nColOffset == 1 .and. ::nColSel > 1 )
      ::nColSel--
      if lRefresh
         if ::FullPaint()
            ::Super:Refresh( .t. )
         else
            ::DrawLine( .t. )
         endif
      endif
   elseif ::nColOffset > 1

Modify these lines as:
Code (fw): Select all Collapse
   if ( ::lLockFreeze .or. ::lFreezeLikeExcel ) .and. ::nFreeze > 0 .and. ::nColOffSet > 1 .and. ::nColSel == ::nFreeze + 1
      lOffset := .t.
   endif

   if ( !lOffset .and. ::IsDisplayPosVisible( ::nColSel - 1 ) ) .or. ;
      ( ::nColOffset == 1 .and. ::nColSel > 1 )

      if ::nColSel > If( ::lLockFreeze, ::nFreeze, 0 ) + 1
         ::nColSel--
         if lRefresh
            if ::FullPaint()
               ::Super:Refresh( .t. )
            else
               ::DrawLine( .t. )
            endif
         endif
      endif
   elseif ::nColOffset > 1

We would be glad to have your feedback and suggestions.

These changes prevent the user to navigate using arrow keys to the frozen cells. He can still go to the frozen cells by clicking with a mouse and the programmer can also position the cursor in a frozen field if he wants to.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: Evitar el avance a la izq. en xBrowse
Posted: Mon Feb 13, 2017 10:55 PM

Thanks Mr. Rao

Worked perfect

Saludos,



Adhemar C.

Continue the discussion