Evitar el avance a la izq. en xBrowse

Evitar el avance a la izq. en xBrowse

Postby acuellar » Fri Feb 10, 2017 1: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.
User avatar
acuellar
 
Posts: 1630
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Evitar el avance a la izq. en xBrowse

Postby FranciscoA » Sun Feb 12, 2017 12:07 am

Adhemar.
Prueba modificando el method GoLeft() de TxBrowse, de esta manera:
Code: Select all  Expand view
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
User avatar
FranciscoA
 
Posts: 2157
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Evitar el avance a la izq. en xBrowse

Postby nageswaragunupudi » Sun Feb 12, 2017 8: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: Select all  Expand view

   DATA lLockFreeze AS LOGICAL INIT .t.
 


2. Go to the end of METHOD Adjust()
Add these lines at the end of Adjust() method
Code: Select all  Expand view

   if ::lLockFreeze
      ::nColSel   := ::nFreeze + 1
   endif
 


3. Go to METHOD GoLeftMost(). and find this line at the beginning
Code: Select all  Expand view

   ::nColSel := 1
 

Modify this line as:
Code: Select all  Expand view

   ::nColSel   := If( ::lLockFreeze, ::nFreeze, 0 ) + 1
 


4. Go to METHOD GoLeft().
Locate these lines:
Code: Select all  Expand view
  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: Select all  Expand view
  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
User avatar
nageswaragunupudi
 
Posts: 10469
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Evitar el avance a la izq. en xBrowse

Postby acuellar » Mon Feb 13, 2017 10:55 pm

Thanks Mr. Rao

Worked perfect
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1630
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests