xBrowse.Row.Disable

xBrowse.Row.Disable

Postby sysctrl2 » Tue Apr 30, 2024 10:13 pm

Señores del foro,

se puede poner disabled todo un renglón en xBrowse ?
algo asi como readonly :roll:
saludos :D

Image
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1011
Joined: Mon Feb 05, 2007 7:15 pm

Re: xBrowse.Row.Disable

Postby FranciscoA » Wed May 01, 2024 2:59 pm

Cesar, creo que este codigo puede ayudarte.
Code: Select all  Expand view
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,5,0,4,5,6,7} ,;
                  {1,5,0,4,5,6,7} ,;
                  {1,5,0,4,5,6,0} ,;
                  {1,2,3,4,5,6,7} }

  DEFINE DIALOG oDlg  SIZE 450,300 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,-20 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
 

Saludos.
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.Row.Disable

Postby sysctrl2 » Wed May 01, 2024 3:15 pm

Gracias Francisco, voy a probar :shock:
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1011
Joined: Mon Feb 05, 2007 7:15 pm

Re: xBrowse.Row.Disable

Postby sysctrl2 » Wed May 01, 2024 4:44 pm

Francisco, si me sirvió,
el check solo debe de funcionar cuando es .f.
saludos :D


Code: Select all  Expand view

#include "fivewin.ch"

Function LineaNoEditable()
   local oDlg, oBrw, n
   LOCAL aArray := { {.f.,5,8,4,5,6,7} ,;
      {.f.,4,9,4,5,6,0} ,;
      {.f.,2,3,4,5,6,0} ,;
      {.f.,5,0,4,5,6,7} ,;
      {.f.,5,0,4,5,6,7} ,;
      {.f.,5,0,4,5,6,7} ,;
      {.f.,5,0,4,5,6,0} ,;
      {.f.,2,3,4,5,6,7} }

   DEFINE DIALOG oDlg  SIZE 450,300 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,-20 PIXEL OF oDlg  DATASOURCE aArray ;
      COLUMNS 1,2,3,4,5,6,7  HEADERS "C1","C2","C3","C4","C5","C6","C7";
      CELL LINES

   WITH OBJECT oBrw:aCols[1]
      :SetLogical()
      :SetCheck( { FWBmpOn(), FWBmpOff() }, EDIT_GET  )
      :bEditWhen := {|| oBrw:aCols[1]:Value=.f. }
   END

   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED

Return nil

 
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1011
Joined: Mon Feb 05, 2007 7:15 pm

Re: xBrowse.Row.Disable

Postby sysctrl2 » Thu May 02, 2024 6:28 pm

Maestro Antonio, lo ideal es que para las próximas, versiones de FWH
se contemple un metodo:

Code: Select all  Expand view

oBrw:aArrayData[nRow]:Disabled() (color gris)
 


"el pedir no empobrece"

:D :D :D
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1011
Joined: Mon Feb 05, 2007 7:15 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests