Page 1 of 1

Problema con indices en un listbox

PostPosted: Wed Jun 13, 2007 11:22 pm
by dario
Hola a Todos...

Tengo un problema que no eh podido resolver.. Cuando habro 2 indices de un archivo .DBF me toma el 2º indice a que le hic referencia.... como haria con esto ¿¿??




*------------------------*
FUNCTION lista_productos()
*------------------------*
local oDlg7

DEFINE DIALOG oDlg7 TITLE "Folders" SIZE 240, 350 PIXEL STYLE nOr( WS_POPUP, WS_VISIBLE )

@ 2 , 40 SAY "Productos" OF oDlg7 SIZE 60, 13 PIXEL FONT oFont

@ 15 , -3 FOLDER oFld PROMPTS " X Tipos "," Favoritos "," Todos " SIZE 249, 300 PIXEL

// 1 = Pagina listado por tipo de productos //////////////////////////////////////////////////////////////////////////////////

Select MTIPO

@ 3 , 2 LISTBOX oBrw71 FIELDS MTIPO->NOMBRE;
COLSIZES 35 PIXEL OF oFld:aDialogs[ 1 ] HEADERS " Tipos ";
SIZE 120,115; //FONT oFont
ON DBLCLICK tipo_producto()

@ 124, 1 BUTTON "Volver" ACTION oDlg7:End() OF oFld:aDialogs[ 1 ] SIZE 60 , 12 PIXEL FONT oFont

// 2 = Pagina listado de productos Favoritos ////////////////////////////////////////////////////////////////////////////////


Select MINVEN
MINVEN->(ORDSETFOCUS("FAVORITO"))
MINVEN->(DBGOTOP())

@ 3 , 2 LISTBOX oBrw72 FIELDS MINVEN->CODIGO,MINVEN->DESCRIP,STR(MINVEN->PRECIO,8,2);
COLSIZES 35,135,30 PIXEL OF oFld:aDialogs[ 2 ] HEADERS " Cod"," Productos Favoritos"," Precio" SIZE 120,115;
ON DBLCLICK cantidad()

@ 124, 1 BUTTON "Volver" ACTION oDlg7:End() OF oFld:aDialogs[ 2 ] SIZE 60 , 12 PIXEL FONT oFont

// 3 = Paagina listado de todos los productos ///////////////////////////////////////////////////////////////////////////////

MINVEN->(ORDSETFOCUS("CODIGO"))
MINVEN->(DBGOTOP())

@ 3 , 2 redefine LISTBOX oBrw73 FIELDS MINVEN->CODIGO,MINVEN->DESCRIP,STR(MINVEN->PRECIO,8,2);
COLSIZES 35,135,30 PIXEL OF oFld:aDialogs[ 3 ] HEADERS " Cod"," Producto"," Precio";
SIZE 120,115;
ON DBLCLICK cantidad()

@ 124, 1 BUTTON "Volver" ACTION oDlg7:End() OF oFld:aDialogs[ 3 ] SIZE 60 , 12 PIXEL FONT oFont

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ACTIVATE DIALOG oDlg7 CENTERED

return ni

PostPosted: Thu Jun 14, 2007 8:47 am
by Antonio Linares
Prueba así:
Code: Select all  Expand view
@ 3 , 2 LISTBOX oBrw72 FIELDS ( MINVEN->(ORDSETFOCUS("FAVORITO")), MINVEN->CODIGO ),MINVEN->DESCRIP,STR(MINVEN->PRECIO,8,2);
COLSIZES 35,135,30 PIXEL OF oFld:aDialogs[ 2 ] HEADERS " Cod"," Productos Favoritos"," Precio" SIZE 120,115;
ON DBLCLICK cantidad()

...

@ 3 , 2 redefine LISTBOX oBrw73 FIELDS ( MINVEN->(ORDSETFOCUS("CODIGO")), MINVEN->CODIGO ),MINVEN->DESCRIP,STR(MINVEN->PRECIO,8,2);
COLSIZES 35,135,30 PIXEL OF oFld:aDialogs[ 3 ] HEADERS " Cod"," Producto"," Precio";
SIZE 120,115;
ON DBLCLICK cantidad()

gracias.. pero

PostPosted: Thu Jun 14, 2007 7:24 pm
by dario
Antonio muchas gracias funciono correctamente...!!!

pero ahora tengo otro problema como hago para que en el listbox una vez haciendo el SEEK TIPO el CODIGO sea IGUAL a PEPE y solo salgan los registros los CODIGOS igual a PEPE y no salgan en el LISTBOX los demas registros !!!



MINVEN->(DBSEEK("01"+cCODTIPO+cNOMBRE))


@ 40 , 2 LISTBOX oBrw72 FIELDS (MINVEN->(ORDSETFOCUS("TIPODES")), MINVEN->TIPO = ccodtipo, MINVEN->CODIGO),MINVEN->DESCRIP,STR(MINVEN->PRECIO,8,2);
COLSIZES 35,135,30 PIXEL OF oDlg9 HEADERS " Cod"," Producto"," Precio";
SIZE 120,100;
ON DBLCLICK cantidad()

PostPosted: Thu Jun 14, 2007 7:42 pm
by Antonio Linares
En vez de hacer:

MINVEN->(DBSEEK("01"+cCODTIPO+cNOMBRE))

haz:

MINVEN->( OrdScope( 0, "01"+cCODTIPO+cNOMBRE ) )
MINVEN->( OrdScope( 1, "01"+cCODTIPO+cNOMBRE ) )
oBrw72:GoTop()

PostPosted: Fri Jun 15, 2007 3:58 am
by dario
Antonio muchas gracias funciono correctamente...!!!
l
pero en dos codigos que establesco la busqueda me da un error
de :

argumet error
+
Args:
1 = c 01
2 = u
stack calls.
en la primerra instruccion ordscope pareciera que la data tubiera un error.
que opinas tu que puede ser.

MINVEN->( OrdScope( 0, "01"+cCODTIPO+cNOMBRE ) ) / error de argument
MINVEN->( OrdScope( 1, "01"+cCODTIPO+cNOMBRE ) )
oBrw72:GoTop()
_________________


P.S Has got acquainted with the girl, http://cyberblady.com, how it to you? Only it is fair!

PostPosted: Fri Jun 15, 2007 9:32 am
by Antonio Linares
cCODTIPO es nil y por eso te da el error.

Comprueba el valor de cCODTIPO

PostPosted: Mon Jun 18, 2007 5:46 pm
by dario
ANTONIO

MINVEN->( OrdScope( 0, "01"+cCODTIPO+cNOMBRE ) )
MINVEN->( OrdScope( 1, "01"+cCODTIPO+cNOMBRE ) )

oBrw72:GoTop()
_________________


LA OPCION OBRW72:GOTOP() ME DA ERROR DE :

NO EXPORTED METHOD
GOTOP
ARGS: 1 = U

ANTES NO LO HABIA PUESTO EN EL PROGRAMA PERO PROBANDOLO
EL LISTBOX ALGUNAS VECES NO SE POSICIONA EN EL PRIMER REGISTRO
ENTIENDO QUE ESA INTRUCION ES PARA POSICIONAR EL LISTBOX


SALUDOS DARIO
HASTA QUE UNO NO OPRIMA LA BARRA DE DESPLAZAMIENTO



P.S Has got acquainted with the girl, http://cyberblady.com, how it to you? Only it is fair!

PostPosted: Mon Jun 18, 2007 6:02 pm
by Antonio Linares
Tienes que crear el browse antes de llamar a oBrw72:GoTop()

PostPosted: Wed Jun 20, 2007 4:52 pm
by dario
ANTONIO

DIME SI ES COMO LO ESTOY COLOCANDO

MINVEN->( OrdScope( 0, "01"+cCODTIPO+cNOMBRE ) )
MINVEN->( OrdScope( 1, "01"+cCODTIPO+cNOMBRE ) )

***** oBrw72:GoTop() ESTABA QUI ANTERIORMENTE

@ 3 , 2 LISTBOX oBrw72 FIELDS MINVEN->CODIGO,MINVEN->DESCRIP,STR(MINVEN->PRECIO,8,2);
COLSIZES 35,135,30 PIXEL OF oFld:aDialogs[ 2 ] HEADERS " Cod"," Productos Favoritos"," Precio" SIZE 120,115;
ON DBLCLICK cantidad()


oBrw72:GoTop()



**** LO COLOCO AQUI NO ME DA ERROR PERO NO SE POCIONA
AVECES EN EL BRIMER REGISTRO TENGO QUE MOVER LA BARRA DE DESPLAZAMIENTO

COMO HAGO PARA QUE LA BARRA DE DESPLAZAMIENTO DEL LISTBOX
SE PARA EN EL PRIMER REGISTRI, O LA BARRA SE PARE EN LA PRIMERA
POSION,


** TAMBIEN TENGO PROBLEMA PARA ELIMINAR UN REGISTRO DEL LISTBOX .

ME PODRIAS MANDAR UN EJEMPLO DE LISTBOX QUE LE DE MANTENIMENTO COMO ELIMINACION , AGREGAR Y MODIFICAR.


SALUDOS.

DARIO FERREIRA

P.S Has got acquainted with the girl, http://cyberblady.com, how it to you? Only it is fair!

PostPosted: Fri Jun 22, 2007 8:56 am
by Antonio Linares
Dario,

En este ejemplo se muestra como hacer mantenimientos usando browses, etc:

http://www.fivetechsoft.com/files/clients.zip

PostPosted: Sat Jun 23, 2007 1:24 am
by dario
antonio


el ejemplo que me diste ya lo habia visto.

realmente lo que necesito es hacer un mantenimento dentro de un listbox

una ves visualisado el listbox al oprimir doble clik dentro del lixbox
eliminar el registro del listbox y la barra de desplazamiento se posione
en el primer registro y resfrescar el listbox, he hecho varias pruebas
pero no he logrado que el listbox se refresque la pantalla.

si nienes un ejemplo que sea de five win me serveria.

saludos
dario ferreira

pos data no pongo mi foto en el foro porque me paresco mucho
a ti.

cuando vi la foto en el foro me parecio verme.


saludos dario ferreira.
.

P.S Has got acquainted with the girl, http://cyberblady.com, how it to you? Only it is fair!