Es decir, si mi xbrowse tiene 22 campos y en pantalla inicialmente solo me caben 8, al seleccionar ualquier campo y consultar los detalles _ corresponderían con su posición "real", pero si me desplazo a la derecha _, entonces el campo3 será el nColsel=1, campo4=nColsel2 y así sucesivamente.
Code: Select all
Campo1,Campo2,Campo3,Campo4,Campo5,Campo6,Campo7,Campo8,campo9,campo10.....
Como le hago para saber el numero de campo "fisico" en que me encuentro para poder mostrar los detalles que necesito en forma correcta?
Aqui parte del código:
Code: Select all
DEFINE DIALOG oDlgins resource "dlgverdb5" of oVentprinc title "Incidencias para nomina semanal" icon "icono1" font oFont1g
cLeye1:=" Incidencias correspondientes al periodo del: "+cIpr+" al: "+cFpr+" de la sucursal "+alltrim(locncode)
redefine say prompt cLeye1 ID 1 of oDlgins font oFont1
oBrw := TXBrowse():New( oDlgins )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL //seleccion por celda
oBrw:nColDividerStyle := LINESTYLE_INSET
oBrw:nRowDividerStyle := LINESTYLE_INSET
oBrw:lColDividerComplete := .t. //completa pintado hasta el footer cuando lineas no llenan todo el browse
oBrw:nHeaderHeight := 44 //Altura cabeceras de col
oBrw:lRecordSelector := .t. //poner o no, COL de la flechita de la izq
oBrw:nHeaderLines := 3
oBrw:bClrHeader := {|| { nRGB(152, 251, 152), nRGB(47, 79, 79) } }//{|| { nRGB(140, 0, 0), nRGB(229,0,0) } } // VERDECITO
oBrw:bClrFooter := oBrw:bClrHeader
oBrw:bClrStd := {|| { nRGB( 0, 0, 0), nRGB(255,248,220) } } // colores para lineas normales
oBrw:bClrSel := {|| { nRGB( 0, 0,255), nRGB(241,222,088) } } // para barra de linea selecc cuando el control no tiene el foco
oBrw:bClrSelFocus := {|| { nRGB( 0, 0, 0), nRGB(248,195, 34) } } // para barra de linea selecc cuando el control tiene el foco
oBrw:nRowHeight := 19
oBrw:lFastEdit := .T.
oCol = oBrw:AddCol()
oCol:bStrData = { || nomina->sucursal }
oCol:nDataStrAlign := 0
oCol:nHeadStrAlign := AL_LEFT
oCol:cHeader = "Sucursal"
oCol:nWidth = 60
oCol:oHeaderFont := oFont1
oCol:bClrHeader := { || { color_1(),65535 } }
oCol:oHeaderFont := oFont1
oCol = oBrw:AddCol()
oCol:bStrData = { || nomina->Empleado }
oCol:nDataStrAlign := 0
oCol:nHeadStrAlign := AL_LEFT
oCol:cHeader = "Sucursal"
oCol:nWidth = 60
oCol:oHeaderFont := oFont1
oCol:bClrHeader := { || { color_1(),65535 } }
oCol:oHeaderFont := oFont1
oCol = oBrw:AddCol()
oCol:bStrData = { || nomina->Faltas }
oCol:nDataStrAlign := 0
oCol:nHeadStrAlign := AL_LEFT
oCol:cHeader = "Faltas del periodo"
oCol:nWidth = 60
oCol:oHeaderFont := oFont1
oCol:bClrHeader := { || { color_1(),65535 } }
oCol:oHeaderFont := oFont1
oBrw:SetRDD()
*oBrw:bLDblClick := {|| msgalert("VER DETALLES INCAPACIDAD","Detalles")}
oBrw:Sucursal:lMergeVert := .t.
*oBrw:nFreeze := 3
oBrw:CreatefromResource(3)
lSalpag:=.F.
redefine button oBtn4cs ID 13 of oDlgins prompt "Detalles" action(deta_inci(),oDlgins:refresh())
redefine button oBtn5cs ID 14 of oDlgins prompt "&Salvar resumen" action(oDlgins:end(),salvainsc())
redefine button oBtn6cs ID 15 of oDlgins prompt "&Cancelar" action(oDlgins:end())
activate dialog oDlgins center
oFont1:end()
endif
return
Function deta_inci
local oBrwDet
nColu:=oBrw:nColSel()
cNonodi:=alltrim(str(no_nomina))
do case
case nColu=5
cCadsql1di:="Select fechaincide,observaciones from &tInci_dia where no_nomina='&cNonodi' and incapacidad="+;
"'1' and fechaincide between '&cIpr' and '&cFpr'"
cTi:='"Incapacidad"'
deta1()
case nColu=6
cCadsql1di:="Select fechaincide,observaciones from &tInci_dia where no_nomina='&cNonodi' and vacaciones="+;
"'1' and fechaincide between '&cIpr' and '&cFpr'"
cTi:='"Vacaciones"'
deta1()
case nColu=7
cCadsql1di:="Select fechaincide,observaciones from &tInci_dia where no_nomina='&cNonodi' and permiso="+;
"'1' and fechaincide between '&cIpr' and '&cFpr'"
cTi:='"Permiso"'
deta1()
case nColu=8
cCadsql1di:="Select fechaincide,observaciones from &tInci_dia where no_nomina='&cNonodi' and falta="+;
"'1' and fechaincide between '&cIpr' and '&cFpr'"
cTi:='"Falta"'
deta1()
case ncolu>9 .and. nColu<16
cCadsql1di:="Select fecha_hrsext,horas_extra,horas_invent,hora_comida,monto_efectivo from &tHorase where "+;
"no_nomina='&cNonodi' and fecha_hrsext between '&cIpr' and '&cFpr'"
cTi:='"Falta"'
deta2()
otherwise
return(NIL)
endcase
return(NIL)
PD, como verán la línea:
*oBrw:bLDblClick := {|| msgalert("VER DETALLES INCAPACIDAD","Detalles")}
Está bloqueada, porque cuando le doy doble click al campo entra al modo edición ¿Como podría hacerle para que al darle doble click no entre a editar el campo y haga el llamado a la función "deta_inci"?
Gracias y saludos.