XBrowse: how to disable a line

XBrowse: how to disable a line

Postby Enrico Maria Giordano » Tue Oct 20, 2020 8:44 am

With XBrowse, Is it possible to disable all the lines satisfying a condition?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse: how to disable a line

Postby FranciscoA » Tue Oct 20, 2020 3:15 pm

The next code show us how to disable some lines on the browse, based on the column number 7 value.
I hope it's what you are looking for.

El siguiente código nos muestra cómo deshabilitar algunas líneas en el browser, según el valor de la columna número 7.
Espero sea lo que buscas.

Code: Select all  Expand view
//#include "FiveWin.ch"
//------------------------------------------// FAPSOFTWARE
Function LineaNoEditable()
local oDlg, oBrw, n
LOCAL aArray := { {1,5,8,4,5,6,7} ,;
                  {1,4,9,4,5,6,0} ,;
                  {1,2,3,4,5,6,0} ,;
                  {1,5,0,4,5,6,7} ,;
                  {1,2,3,4,5,6,7} }

  DEFINE DIALOG oDlg  SIZE 450,200 PIXEL TITLE "LINEAS EDITABLES O NO"
  @5, 10 SAY "Lineas no son editables si valor en Columna 7 == 0" SIZE 200,10 PIXEL OF oDlg

  @ 20, 10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg  DATASOURCE aArray ;
           COLUMNS 1,2,3,4,5,6,7  HEADERS "C1","C2","C3","C4","C5","C6","C7";
           CELL LINES

  AEVAL( oBrw:aCols,{|o| o:nWidth := 50 ,;
                         o:nEditType := 1 ,;
                         o:bEditWhen := {|| oBrw:aCols[7]:Value > 0 } } )

  oBrw:CreateFromCode()

  ACTIVATE DIALOG oDlg CENTERED
Return nil
 
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: XBrowse: how to disable a line

Postby Enrico Maria Giordano » Tue Oct 20, 2020 3:24 pm

Sorry, I express myself bad: I would want to disable a line so it cannot be selected. But never mind, I solved with bChange and trapping VK_UP and VK_DOWN inside it.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: XBrowse: how to disable a line

Postby FranciscoA » Tue Oct 20, 2020 3:27 pm

Enrico Maria Giordano wrote:Sorry, I express myself bad: I would want to disable a line so it cannot be selected. But never mind, I solved with bChange and trapping VK_UP and VK_DOWN inside it.

EMG

Good!
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 30 guests