jdmoura Posted February 7, 2008 Report Share Posted February 7, 2008 Ola galera estou devolta novamente, olha eu já postei este assunto e o Toya ficou de me ajudar, mais ainda não mandou nada acho que talvez ele esteja de férias. Porém estou precisando muito também se alguém puder me ajudar agradeço muito, pois quando digito algo ele busca certo o nome do cliente e os respectivos carros em seu nome, porém quando vou rola pela gride nas barras de rolagem a gride fica desconfigurada repetindo o ultimo registro duas vezes e quando uso a barra de rolagem ele cria uma linha em branco entre os registros meu cordigo é este: #include "FiveWin.ch" #include "dbtnBMP.ch" #include "Report.ch" extern Set static oWnd ******************************************* FUNCTION CLICONS1(oLbx,lAppend) ******************************************* local oDlg local lFivePro local lDialog local lSave := .f. local nOldRec := RecNo() local oNome_get local oRadioButtons local nOrden:=2 local aHBitMaps:= { ReadBitmap( 0, "Level1.bmp" ), ; // BitMaps de 14 x 32 ReadBitmap( 0, "Level2.bmp" ), ; ReadBitmap( 0, "Level3.bmp" ), ; ReadBitmap( 0, "Level4.bmp" ),; ReadBitmap( 0, "Level5.bmp" ) } * ----------- Abre Arquivos IF !ABREARQ('DATATEMP',.F.) .OR. EOF() CLOSE ALL RETURN ENDIF MDATEMIS=DATATEMPOR _DATEMIS=DATATEMPOR ZDATEMIS=DATATEMPOR JDATEMIS=DATATEMPOR VDATEMIS=DATATEMPOR XDATACXA=DATATEMPOR USE SELE 1 IF !ABREARQ('CLIENTES',.F.) .or. eof() CLOSE ALL RETURN ENDIF if ! neterr() *set inde to Alf_CLI,COD_CLI,CPF_CLI,FAN_CLI SET INDEX TO CLI1 else msginfo('Arquivo não DisponÃvel (Clientes)','Atenção') close all return nil endif SELE 2 IF !ABREARQ('VEICULOS',.F.) .or. eof() CLOSE ALL RETURN ENDIF if ! neterr() *set inde to PLA_VEI,DOC_VEI,NOME_VEI,FANT_VEI SET INDEX TO VEI1 else msginfo('Arquivo não DisponÃvel (Veiculos)','Atenção') close all return nil endif SET RELATION TO DOCCLI INTO CLIENTES SELE 1 SET ORDER TO TAG ALF_CLI PRIV oNomeCliCl,oCodClicl,oEndercl,oBairrocl,oCidadecl,oEstadoCl,oFonecl,oDocumen MNOMECLICL:=SPACE(40) MCODCLICL :=SPACE(09) MENDERCL :=SPACE(30) MBAIRROCL :=SPACE(20) MESTADOCL :=SPACE(02)+' ' MCIDADECL :=SPACE(20) MFONECL :=SPACE(13) MDOCUMEN :=SPACE(18) DEFINE DIALOG oDlg FROM 0, 1 TO 25,80 TITLE "Consulta de Clientes" of odlg @ 00,01 SAY OemToAnsi("RazÆo Social") @ 00,26 SAY OemToAnsi("C¢digo:") OF oDlg @ 01,01 SAY "Endere‡o:" @ 01,25 SAY "Bairro:" @ 01,41 SAY "UF:" @ 02,01 SAY "Cidade:" @ 02,16 SAY "Fone:" @ 02,26 SAY "Doc.:" @ 00,07 GET oNomeCliCl VAR MNomeCliCl PICT "@!K" Valid PesConsC1() OF oDlg @ 00,07 GET oNomeCliCl VAR MNomeCliCl PICT "@!" when .f. @ 00,30 GET oCodCliCl VAR MCodCliCl PICT "!!/9999-9" when .f. @ 01,06 GET oENDERCL VAR mEndercl PICT "@!" when .f. @ 01,28 GET oBAIRROCL VAR mBairrocl PICT "@!" when .f. @ 01,54 GET oEstadoCl VAR mEstadoCl PICT "@!" when .f. @ 02,05 GET oCIDADECL VAR mCidadecl PICT "@!" when .f. @ 02,19 GET oFONECL VAR mFonecl PICT "(!!)!999-9999" when .f. @ 02,29 GET odocumen VAR mdocumen PICT "@!" when .f. @047,100 DBUTTON "&1-Pequisar" FILE "edit2.BMP" OF oDlg ACTION (lSave:=.t.,oDlg:End()) SIZE 54,13 @047,160 DBUTTON "&2-Retorna" FILE "dbsalir.BMP" OF oDlg ACTION (odlg:end()) SIZE 54,13 ACTIVATE DIALOG oDlg CENTERED DEFINE DIALOG oDlg FROM 0, 1 TO 22,80 TITLE "Consulta de Clientes" of odlg @ 00,01 SAY OemToAnsi("RazÆo Social") @ 00,26 SAY OemToAnsi("C¢digo:") OF oDlg @ 01,01 SAY "Endere‡o:" @ 01,25 SAY "Bairro:" @ 01,41 SAY "UF:" @ 02,01 SAY "Cidade:" @ 02,16 SAY "Fone:" @ 02,26 SAY "Doc.:" @ 00,07 GET oNomeCliCl VAR MNomeCliCl PICT "@!K" when .f. @ 00,30 GET oCodCliCl VAR MCodCliCl PICT "!!/9999-9" when .f. @ 01,06 GET oENDERCL VAR mEndercl PICT "@!" when .f. @ 01,28 GET oBAIRROCL VAR mBairrocl PICT "@!" when .f. @ 01,54 GET oEstadoCl VAR mEstadoCl PICT "@!" when .f. @ 02,05 GET oCIDADECL VAR mCidadecl PICT "@!" when .f. @ 02,19 GET oFONECL VAR mFonecl PICT "(!!)!999-9999" when .f. @ 02,29 GET odocumen VAR mdocumen PICT "@!" when .f. *@150,120 DBUTTON "&2-Retorna" FILE "dbsalir.BMP" OF oDlg ACTION (odlg:end()) SIZE 54,13 *ACTIVATE DIALOG oDlg CENTERED ************************************************************ && Encontra os veiculos cadastrado com o CPF/CGC do Clientes ************************************************************ SELE 2 SET FILTER TO DOCCLI=MDOCUMEN @03,1 LISTBOX oLbx FIELDS Placa,Modelo,Ano,Cor,Combust HEADERS "Placa","Modelo","Ano","Cor","Comb." FIELDSIZES 70,90,300,90,90,90,90 SIZE 300,100 OF oDlg oLbx:UpStable() oLbx:Setfocus() oLbx:Refresh() @150,120 DBUTTON "&2-Retorna" FILE "dbsalir.BMP" OF oDlg ACTION (odlg:end()) SIZE 54,13 ACTIVATE DIALOG oDlg CENTERED set filter to sele 1 CLOSE ALL return .t. ************************************* function PesConsC1 && Pesquisa de Clientes por Nome/Veiculos ************************************* LOCAL oRadioButtons LOCAL nOrden:=2 SELE 1 SET ORDER TO TAG ALF_CLI Mnomecl:=Space(40) DEFINE DIALOG oDlg FROM 3, 3 TO 22, 80 TITLE OemToAnsi("Pesquisa de Clientes") @ 1, 1 SAY "Ordenar por:" @ 3, 1 LISTBOX oLbx FIELDS codigo,nome,telefone1 HEADERS "Codigo", "Nome do Cliente", "Fone" FIELDSIZES 90, 300, 30 SIZE 291, 74; ON LEFT DBLCLICK (EditConsCli1(oLbx, .F. ),oDlg:End()) @ 1, 7 RADIO oRadioButtons VAR nOrden PROMPT "&Codigo", "&Nome Cliente " ; // Duas opcoes em Radio botoes OF oDlg ON CHANGE OrdenConsCLi1(nOrden,oLbx) // Ao Selecionar uma upcao executar a fun‡ao @ 125,150 Say "Buscar por:" OF oDlg Pixel Size 040,012 @ 122,188 Get onomecl VAR mnomecl Picture "@!K" Of oDLG Pixel Size 100,012 ; on Change(ConteudoConsCli1(onomecl,nKey,oDlg)) ACTIVATE DIALOG oDlg CENTERED sele 1 Return .t. **---------------------------------------------** Static Function ConteudoConscli1(oGetP,xKey,oDlgg) **---------------------------------------------** Local RetornoChave:="" MontaConsCli1(oGetP,xKey,oDlgg,@RetornoChave) Clientes->(dbSeek(AllTrim(RetornoChave))) oLbx:Refresh() Return(.t.) **---------------------------------------------** STATIC FUNCTION OrdenConsCli1(nOrden,oLbx) **---------------------------------------------** IF nOrden=1 SET ORDER TO TAG Cod_cli ELSE SET ORDER TO TAG Alf_cli ENDIF oLbx:Refresh() RETURN NIL **----------------------------------------------------** Function MontaConsCli1(oGetP,xKey,oDlgg,RetornoChave) **----------------------------------------------------** Local cChave:=(oGetP:oGet:Buffer),nPosAnt:=Recno() If (xKey!=7 .and.xKey !=8) cChave:=Stuff(cChave,oGetP:nPos,If(Set(_SET_INSERT),0,1),Upper(Chr(xKey))) Endif RetornoChave:=cChave Return(RetornoChave) *************************************** function EditConsCli1(oLbx, lAppend) *************************************** SELE 1 *SET ORDER TO TAG ALF_CLI MCODCLICL =CODIGO oCodCliCl :VARPUT(MCODCLICL) oCodCliCl :REFRESH() MNOMECLICL=NOME oNomeCliCl:VARPUT(MNOMECLICL) oNomeCliCl:REFRESH() MENDERCL =ENDERECO oEnderCl :VARPUT(MENDERCL) oEnderCl :REFRESH() mCidadeCl =CIDADE oCidadeCl :VARPUT(mCidadeCl) oCidadeCl :REFRESH() mBAIRROCL =SUBSTR(BAIRRO,1,20) oBairroCl :VARPUT(mBAIRROCL) oBairroCl :REFRESH() mFONECL =TELEFONE1 oFoneCl :VARPUT(mFONECL) oFoneCl :REFRESH() IF CPF<> SPACE(14) MDOCUMEN:= CPF oDocumen:VARPUT(MDOCUMEN) oDocumen:REFRESH() ELSE MDOCUMEN:= CGC oDocumen:VARPUT(MDOCUMEN) oDocumen:REFRESH() ENDIF Return .t. id=code>id=code>Um clipperAbraço jdmoura Jdemourasilva@yahoo.com.br Londrina - Paraná Quote Link to comment Share on other sites More sharing options...
jdmoura Posted February 7, 2008 Author Report Share Posted February 7, 2008 Ola galera estou devolta novamente, olha eu já postei este assunto e o Toya ficou de me ajudar, mais ainda não mandou nada acho que talvez ele esteja de férias. Porém estou precisando muito também se alguém puder me ajudar agradeço muito, pois quando digito algo ele busca certo o nome do cliente e os respectivos carros em seu nome, porém quando vou rola pela gride nas barras de rolagem a gride fica desconfigurada repetindo o ultimo registro duas vezes e quando uso a barra de rolagem ele cria uma linha em branco entre os registros meu cordigo é este: #include "FiveWin.ch" #include "dbtnBMP.ch" #include "Report.ch" extern Set static oWnd ******************************************* FUNCTION CLICONS1(oLbx,lAppend) ******************************************* local oDlg local lFivePro local lDialog local lSave := .f. local nOldRec := RecNo() local oNome_get local oRadioButtons local nOrden:=2 local aHBitMaps:= { ReadBitmap( 0, "Level1.bmp" ), ; // BitMaps de 14 x 32 ReadBitmap( 0, "Level2.bmp" ), ; ReadBitmap( 0, "Level3.bmp" ), ; ReadBitmap( 0, "Level4.bmp" ),; ReadBitmap( 0, "Level5.bmp" ) } * ----------- Abre Arquivos IF !ABREARQ('DATATEMP',.F.) .OR. EOF() CLOSE ALL RETURN ENDIF MDATEMIS=DATATEMPOR _DATEMIS=DATATEMPOR ZDATEMIS=DATATEMPOR JDATEMIS=DATATEMPOR VDATEMIS=DATATEMPOR XDATACXA=DATATEMPOR USE SELE 1 IF !ABREARQ('CLIENTES',.F.) .or. eof() CLOSE ALL RETURN ENDIF if ! neterr() *set inde to Alf_CLI,COD_CLI,CPF_CLI,FAN_CLI SET INDEX TO CLI1 else msginfo('Arquivo não DisponÃvel (Clientes)','Atenção') close all return nil endif SELE 2 IF !ABREARQ('VEICULOS',.F.) .or. eof() CLOSE ALL RETURN ENDIF if ! neterr() *set inde to PLA_VEI,DOC_VEI,NOME_VEI,FANT_VEI SET INDEX TO VEI1 else msginfo('Arquivo não DisponÃvel (Veiculos)','Atenção') close all return nil endif SET RELATION TO DOCCLI INTO CLIENTES SELE 1 SET ORDER TO TAG ALF_CLI PRIV oNomeCliCl,oCodClicl,oEndercl,oBairrocl,oCidadecl,oEstadoCl,oFonecl,oDocumen MNOMECLICL:=SPACE(40) MCODCLICL :=SPACE(09) MENDERCL :=SPACE(30) MBAIRROCL :=SPACE(20) MESTADOCL :=SPACE(02)+' ' MCIDADECL :=SPACE(20) MFONECL :=SPACE(13) MDOCUMEN :=SPACE(18) DEFINE DIALOG oDlg FROM 0, 1 TO 25,80 TITLE "Consulta de Clientes" of odlg @ 00,01 SAY OemToAnsi("RazÆo Social") @ 00,26 SAY OemToAnsi("C¢digo:") OF oDlg @ 01,01 SAY "Endere‡o:" @ 01,25 SAY "Bairro:" @ 01,41 SAY "UF:" @ 02,01 SAY "Cidade:" @ 02,16 SAY "Fone:" @ 02,26 SAY "Doc.:" @ 00,07 GET oNomeCliCl VAR MNomeCliCl PICT "@!K" Valid PesConsC1() OF oDlg @ 00,07 GET oNomeCliCl VAR MNomeCliCl PICT "@!" when .f. @ 00,30 GET oCodCliCl VAR MCodCliCl PICT "!!/9999-9" when .f. @ 01,06 GET oENDERCL VAR mEndercl PICT "@!" when .f. @ 01,28 GET oBAIRROCL VAR mBairrocl PICT "@!" when .f. @ 01,54 GET oEstadoCl VAR mEstadoCl PICT "@!" when .f. @ 02,05 GET oCIDADECL VAR mCidadecl PICT "@!" when .f. @ 02,19 GET oFONECL VAR mFonecl PICT "(!!)!999-9999" when .f. @ 02,29 GET odocumen VAR mdocumen PICT "@!" when .f. @047,100 DBUTTON "&1-Pequisar" FILE "edit2.BMP" OF oDlg ACTION (lSave:=.t.,oDlg:End()) SIZE 54,13 @047,160 DBUTTON "&2-Retorna" FILE "dbsalir.BMP" OF oDlg ACTION (odlg:end()) SIZE 54,13 ACTIVATE DIALOG oDlg CENTERED DEFINE DIALOG oDlg FROM 0, 1 TO 22,80 TITLE "Consulta de Clientes" of odlg @ 00,01 SAY OemToAnsi("RazÆo Social") @ 00,26 SAY OemToAnsi("C¢digo:") OF oDlg @ 01,01 SAY "Endere‡o:" @ 01,25 SAY "Bairro:" @ 01,41 SAY "UF:" @ 02,01 SAY "Cidade:" @ 02,16 SAY "Fone:" @ 02,26 SAY "Doc.:" @ 00,07 GET oNomeCliCl VAR MNomeCliCl PICT "@!K" when .f. @ 00,30 GET oCodCliCl VAR MCodCliCl PICT "!!/9999-9" when .f. @ 01,06 GET oENDERCL VAR mEndercl PICT "@!" when .f. @ 01,28 GET oBAIRROCL VAR mBairrocl PICT "@!" when .f. @ 01,54 GET oEstadoCl VAR mEstadoCl PICT "@!" when .f. @ 02,05 GET oCIDADECL VAR mCidadecl PICT "@!" when .f. @ 02,19 GET oFONECL VAR mFonecl PICT "(!!)!999-9999" when .f. @ 02,29 GET odocumen VAR mdocumen PICT "@!" when .f. *@150,120 DBUTTON "&2-Retorna" FILE "dbsalir.BMP" OF oDlg ACTION (odlg:end()) SIZE 54,13 *ACTIVATE DIALOG oDlg CENTERED ************************************************************ && Encontra os veiculos cadastrado com o CPF/CGC do Clientes ************************************************************ SELE 2 SET FILTER TO DOCCLI=MDOCUMEN @03,1 LISTBOX oLbx FIELDS Placa,Modelo,Ano,Cor,Combust HEADERS "Placa","Modelo","Ano","Cor","Comb." FIELDSIZES 70,90,300,90,90,90,90 SIZE 300,100 OF oDlg oLbx:UpStable() oLbx:Setfocus() oLbx:Refresh() @150,120 DBUTTON "&2-Retorna" FILE "dbsalir.BMP" OF oDlg ACTION (odlg:end()) SIZE 54,13 ACTIVATE DIALOG oDlg CENTERED set filter to sele 1 CLOSE ALL return .t. ************************************* function PesConsC1 && Pesquisa de Clientes por Nome/Veiculos ************************************* LOCAL oRadioButtons LOCAL nOrden:=2 SELE 1 SET ORDER TO TAG ALF_CLI Mnomecl:=Space(40) DEFINE DIALOG oDlg FROM 3, 3 TO 22, 80 TITLE OemToAnsi("Pesquisa de Clientes") @ 1, 1 SAY "Ordenar por:" @ 3, 1 LISTBOX oLbx FIELDS codigo,nome,telefone1 HEADERS "Codigo", "Nome do Cliente", "Fone" FIELDSIZES 90, 300, 30 SIZE 291, 74; ON LEFT DBLCLICK (EditConsCli1(oLbx, .F. ),oDlg:End()) @ 1, 7 RADIO oRadioButtons VAR nOrden PROMPT "&Codigo", "&Nome Cliente " ; // Duas opcoes em Radio botoes OF oDlg ON CHANGE OrdenConsCLi1(nOrden,oLbx) // Ao Selecionar uma upcao executar a fun‡ao @ 125,150 Say "Buscar por:" OF oDlg Pixel Size 040,012 @ 122,188 Get onomecl VAR mnomecl Picture "@!K" Of oDLG Pixel Size 100,012 ; on Change(ConteudoConsCli1(onomecl,nKey,oDlg)) ACTIVATE DIALOG oDlg CENTERED sele 1 Return .t. **---------------------------------------------** Static Function ConteudoConscli1(oGetP,xKey,oDlgg) **---------------------------------------------** Local RetornoChave:="" MontaConsCli1(oGetP,xKey,oDlgg,@RetornoChave) Clientes->(dbSeek(AllTrim(RetornoChave))) oLbx:Refresh() Return(.t.) **---------------------------------------------** STATIC FUNCTION OrdenConsCli1(nOrden,oLbx) **---------------------------------------------** IF nOrden=1 SET ORDER TO TAG Cod_cli ELSE SET ORDER TO TAG Alf_cli ENDIF oLbx:Refresh() RETURN NIL **----------------------------------------------------** Function MontaConsCli1(oGetP,xKey,oDlgg,RetornoChave) **----------------------------------------------------** Local cChave:=(oGetP:oGet:Buffer),nPosAnt:=Recno() If (xKey!=7 .and.xKey !=8) cChave:=Stuff(cChave,oGetP:nPos,If(Set(_SET_INSERT),0,1),Upper(Chr(xKey))) Endif RetornoChave:=cChave Return(RetornoChave) *************************************** function EditConsCli1(oLbx, lAppend) *************************************** SELE 1 *SET ORDER TO TAG ALF_CLI MCODCLICL =CODIGO oCodCliCl :VARPUT(MCODCLICL) oCodCliCl :REFRESH() MNOMECLICL=NOME oNomeCliCl:VARPUT(MNOMECLICL) oNomeCliCl:REFRESH() MENDERCL =ENDERECO oEnderCl :VARPUT(MENDERCL) oEnderCl :REFRESH() mCidadeCl =CIDADE oCidadeCl :VARPUT(mCidadeCl) oCidadeCl :REFRESH() mBAIRROCL =SUBSTR(BAIRRO,1,20) oBairroCl :VARPUT(mBAIRROCL) oBairroCl :REFRESH() mFONECL =TELEFONE1 oFoneCl :VARPUT(mFONECL) oFoneCl :REFRESH() IF CPF<> SPACE(14) MDOCUMEN:= CPF oDocumen:VARPUT(MDOCUMEN) oDocumen:REFRESH() ELSE MDOCUMEN:= CGC oDocumen:VARPUT(MDOCUMEN) oDocumen:REFRESH() ENDIF Return .t. id=code>id=code>Um clipperAbraço jdmoura Jdemourasilva@yahoo.com.br Londrina - Paraná Quote Link to comment Share on other sites More sharing options...
toya Posted February 8, 2008 Report Share Posted February 8, 2008 Jocimar... desculpe, estava enrolado com a CAT52/SP... A noite seguirá tua ajuda... toya (Ahora en la version 5.8) toyasis@yahoo.com.br http://www.toyanet.com.br FWH 2.6+PellesC+xHarbour.org 0.99 - MySql 5.0.12 Beta - SqlLib - Rpv FW 2.4+WS 4.5+Blinker 7.0+Clipper 5.2E+Rpv Linux 2.4.29 - Slack 10.1 - (No@Say) Quote Link to comment Share on other sites More sharing options...
jdmoura Posted February 8, 2008 Author Report Share Posted February 8, 2008 Ok! estou no aguardo e agradeço desde já sua ajuda. Um clipperAbraço jdmoura Jdemourasilva@yahoo.com.br Londrina - Paraná Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.