FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Clausula "ON CHANGE" en xbrowse
Posts: 131
Joined: Tue Dec 26, 2006 04:50 PM
Clausula "ON CHANGE" en xbrowse
Posted: Wed Aug 01, 2012 01:47 AM
Buenas noches compa帽eros del foro, espero puedan ayudarme, estoy usan un xbrowse y necesito usar la clausula "ON CHANGE" (o la que sea equivalente) para mostrar algunos datos dependiendo del registro seleccionado de la base de datos.

Code (fw): Select all Collapse
聽 聽 聽 DEFINE DIALOG oDlg resource "dlgverdb9" of oVentprinc title "Llamadas" font oFont1g
聽 聽 聽 redefine say prompt"Lista de llamadas realizadas, selecciona la llamada a consultar" ID 1 of oDlg
聽 聽 聽 define font oFont1 聽name "TIMES NEW ROMAN" size 0,-12 bold
聽 聽 聽 oBrw := TXBrowse():New( oDlg )
聽 聽 聽 oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW //barra selectora
聽 聽 聽 oBrw:nColDividerStyle := LINESTYLE_INSET
聽 聽 聽 oBrw:nRowDividerStyle := LINESTYLE_INSET
聽 聽 聽 oBrw:lColDividerComplete := .t. 聽 聽 聽 //HEADERS Y FOOTERS
聽 聽 聽 oBrw:nHeaderHeight := 22 //Altura cabeceras de col
聽 聽 聽 oBrw:lRecordSelector := .t. //poner o no, COL de la flechita de la izq
聽 聽 聽 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

聽 聽 聽 oCol = oBrw:AddCol()
聽 聽 聽 oCol:bStrData = { || market->idmarket }
聽 聽 聽 oCol:nDataStrAlign := 0
聽 聽 聽 oCol:cHeader = "ID de llamada"
聽 聽 聽 oCol:nWidth = 110
聽 聽 聽 oCol:bLClickHeader:= {|| DbSetorder(1),oBrw:Gotop(),letbus:="ID de llamada",odlg:update(),nord:=1}
聽 聽 聽 oCol:oHeaderFont := oFont1
聽 聽 聽 oCol:bClrHeader := { || { 聽65535, nRGB(47, 79, 79) } }

..... (Ms columnas)

聽 聽 聽 oBrw:SetRDD()

聽 聽 聽 oBrw:CreatefromResource(0)

聽 聽 聽 REDEFINE say oSay1 prompt "Buscar en "+letbus ID 5 OF oDlg UpDate
聽 聽 聽 Redefine get Oget1 VAR cBusca ID 4 OF oDlg PICTURE "@!"

聽 聽 聽 redefine button oBtn1 ID 6 of oDlg action (busyfil()) update
聽 聽 聽 redefine button oBtn2 ID 7 of oDlg action sinfil()

聽 聽 聽 REDEFINE Button oBtn3 ID 2 OF oDlg prompt "Revisar tareas" ACTION ( revmar:=idmarket,revtar(), oDlg:end() )
聽 聽 聽 REDEFINE Button oBtn4 ID 3 OF oDlg prompt "Registrar ventas" ACTION ( revmar:=idmarket,regven(), oDlg:end() )
聽 聽 聽 redefine button oBtn5 ID 4 of oDlg action (oDlg:end(), ciccc:="N")
聽 聽 聽 ACTIVATE DIALOG oDlg CENTERED
聽 聽enddo
聽 聽oFont1:end()
RETURN NIL


Como dec铆a, necesito desplegar informaci贸n en el di谩logo, dependiendo del registro seleccionado, misma que cambiara a cada cambio en el No. de registro.

Muchas gracias
Posts: 234
Joined: Tue Sep 01, 2009 07:55 AM
Re: Clausula "ON CHANGE" en xbrowse
Posted: Wed Aug 01, 2012 05:55 AM
Mario:
No se si esto te valdr谩, pero tengo un xbrowse en el que al desplazar el cursor por los registros hace que un objeto SAY me vaya mostrando la informaci贸n del registro algo as铆
Code (fw): Select all Collapse
    on change {osay1:settext( "Dorsal: "+alltrim(carrera[olbx:narrayat,11])+"  --  "+alltrim(carrera[olbx:narrayat,12])),osay1:hide(),osay1:show()}

en este caso el xbrowse me muestra una matriz (array) llamada carrera, y objeto say que modifica es osay1, y el objeto xbrowse es olbx.
Un saludo
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Re: Clausula "ON CHANGE" en xbrowse
Posted: Wed Aug 01, 2012 12:28 PM
Mario
Por si es de tu inter茅s, xBrowse incorpara el bloque
Code (fw): Select all Collapse
 oBrw:bToolTip:= {|| ShowToolTip( oBrw ) }
...
...

PROCEDURE ShowToolTip( oBrw )

聽 聽oBrw:oCol3:cTooltip:= if( !nCondicion == 0, "Tu mensaje", "mensaje alternativo" )

// Fin


Saludos
Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 131
Joined: Tue Dec 26, 2006 04:50 PM
Re: Clausula "ON CHANGE" en xbrowse
Posted: Wed Aug 01, 2012 02:24 PM
Muchas gracias por sus respuestas, tengo estas dudas:

Groiss, honestamente no se donde insertar la clausa "on chage", en mi xbrowse, podr铆as indicarme donde?

Mario G. Estoy usando la versi贸n 2.6 de Fivewin y me aparece el error de que no reconoce la sentencia tooltip, seguramente es por mi versi贸n de FWH

Nuevamente muchas gracias.
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Re: Clausula "ON CHANGE" en xbrowse
Posted: Wed Aug 01, 2012 02:55 PM
Mario

"on change" es una clausula, parte, de:
#xcommand @ <nRow>, <nCol> [ COLUMN ] XBROWSE <oBrw> ;
[ [ FIELDS ] <Flds,...>] ;
[ <dsrc: ALIAS, ARRAY, RECSET, RECORDSET, OBJECT, DATASOURCE> <uDataSrc> ] ;
[ <sizes:FIELDSIZES, SIZES, COLSIZES> <aColSizes,...> ] ;
[ <head:HEAD,HEADER,HEADERS> <aHeaders,...> ] ;
[ <pic: PICS, PICTURE, PICTURES> <aPics,...> ] ;
[ <cols: COLS, COLUMNS> <aCols,...> ] ;
[ <idx: SORT,ORDERS> <aSort,...> ] ;
[ JUSTIFY <aJust,...> ] ;
[ SIZE <nWidth>, <nHeigth> ] ;
[ ID <nID> ] ;
[ <dlg:OF,DIALOG> <oWnd> ] ;
[ SELECT <cField> FOR <uValue1> [ TO <uValue2> ] ] ;
[ <change: ON CHANGE, ON CLICK> <uChange> ] ;
...

Vos deber铆as usar oBrw:= {|| ... } (porque no declaras el comando, sino que llamas directamente a la clase)

En cuanto a la version. Creo que la version libre actual es superior a la que usas. La podes bajar de la pagina de Fivetech

Saludos
Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 131
Joined: Tue Dec 26, 2006 04:50 PM
Re: Clausula &quot;ON CHANGE&quot; en xbrowse
Posted: Wed Aug 01, 2012 06:31 PM

Mario, mil gracias por la orientaci贸n, funcion贸 de maravilla.

Hace un tiempo, cuando liberaron la versi贸n 6.12 (creo) de Fivewin la baj茅 e instale, pero me empez贸 a dar mil problemas con funciones que no exist铆an en esa versi贸n o que hab铆an cambiado de nombre, baj茅 las versiones de BCC y Harbour para esa versi贸n, pero me segu铆a dando miles de problemas y decidi regresarme a usar la versi贸n con la que originalmente hab铆a generado mis programas.

Muchas, muchas gracias nuevamente.

Continue the discussion