Luiz Arruda (ICO) Posted May 13, 2005 Report Share Posted May 13, 2005 Como estou começando, gostaria de criar apenas uma tela bem simples para lancamentos de documentos. FUNCTION LANCAR() Local oDlg Local oget1 :=ctod("\\") Local oGet2 :=space(50) Local oGet3 :=0 Use Diario DEFINE DIALOG ODLG RESOURCE "LANCAMENTO" TITLE " 1.1 Lancamentos Genericos !" REDEFINE BUTTON ID 170 OF ODLG ACTION REGISTRAR() REDEFINE BUTTON ID 180 OF ODLG ACTION CONTINUAR() REDEFINE BUTTON ID 240 OF ODLG ACTION(ODLG:END()) REDEFINE GET OGET1 ID 15 OF ODLG REDEFINE GET OGET2 ID 16 OF ODLG REDEFINE GET OGET3 ID 14 OF ODLG PICTURE "99,999.99" ACTIVATE DIALOG ODLG CENTERED RETURN ( NIL ) GOSTARIA DE OBTER INFORMACOES SOBRE O SEGUINTE: 1)-Quanto abrir a DIALOG o registro sempre for em branco 2)-Depois de digitado só registrar no arquivo quando press. ID 170 3)-Quando press. ID 180 voltar no campo data COMO NO CLIPPER "ENDDO" CRIEI FUNCTION REGISTAR() COM "APPEND BLANK", FUNCTION REGISTRAR() APPEND BLANK DIARIO->DATA :=OGET1 DIARIO->HISTORICO :=OGET2 DIARIO->VALOR :=OGET3 DA PAU, NAO RECONHECE OGET1,OGET2 NEM OGET3 COMO POSSO RESOLVER ISSO SEM CRIAR DIALOG COM @SAY, USANDO APENAS A TELA CRIADA NO WS ?? OBRIGADO. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 13, 2005 Report Share Posted May 13, 2005 Use o REPLACE CAMPO WITH VARIAVEL. Se vai continuar cadastrando, tire o oDlg:End() Deixe um Botao de cancelar... Bad Boy - The HuntsMan Of E.A.J. Automação Comercial. kapiaba@brfree.com.br FW 2.3C CLIPPER 5.3B BLINKER 7.0 WORKSHOP.EXE Editado por - kapiaba on 13/05/2005 17:06:57 Quote Link to comment Share on other sites More sharing options...
marcelo Posted May 13, 2005 Report Share Posted May 13, 2005 Ola 1-Crie esta Funcao no seu aplicativo Func XSetFocus(oObj) Local oTempo := "" Define Timer oTempo Interval 10 Of oObj:oWnd Action (oObj:SetFocus(),oObj:SetPos(0),oTempo:Deactivate()) Activate Timer oTempo Retu("") 2-Não precisa do Button Continuar (180), o xsetefocus() faz isso 3-Crie as variaveis com os nomes (Ex.,wdata,wnome,wvalor) 4-Redefine oNome var Wnome id 15 (crie id > 100)picture '@! update. etc, etc. 5-Quanto mandar Gravar (registrar) mande com o parametro registrar(odlg) ** Funcao Registrar(odlg1) appe blan repla nome with wnome,data with wdata,valor with wvalor wnome=space(40) wdata=ctod(' / / ') wvalor=0 xsetfocus(odata) // focu na data odlg1:update() return(.t.) * Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted May 13, 2005 Author Report Share Posted May 13, 2005 MARCELO. Sua dica foi a que mais se aproximou. se excluir a linha do REPLACE, funciona uma beleza. é só inclui-la que aparece o erro; ERROR BASE/1003 VARIABLE DOES NOT EXIST WNOME, ja mudei para oNome ja eliminei e deixao apenas wdata e wvalor mais continua dando pau. obs: no REDEFINE SERIA: REDEFINE GET oNome Var... ou é realmente como vc. postou ?. obrigado ico Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 13, 2005 Report Share Posted May 13, 2005 LOCAL oNome REDEFINE GET oGet1 VAR oNome Bad Boy - The HuntsMan Of E.A.J. Automação Comercial. kapiaba@brfree.com.br FW 2.3C CLIPPER 5.3B BLINKER 7.0 WORKSHOP.EXE Editado por - kapiaba on 13/05/2005 19:56:55 Quote Link to comment Share on other sites More sharing options...
fluna Posted May 13, 2005 Report Share Posted May 13, 2005 wvalor:=diario->valor DEFINE DIALOG ODLG RESOURCE "LANCAMENTO" TITLE " 1.1 Lancamentos Genericos !" REDEFINE BUTTON ID 170 OF ODLG ACTION CONTROLE(1) // GRAVA E CONTINUA REDEFINE BUTTON ID 180 OF ODLG ACTION CONTTROLE(2) // GRAVA E SAI REDEFINE BUTTON ID 240 OF ODLG ACTION(ODLG:END()) REDEFINE GET odata var wdata ID 15 OF ODLG REDEFINE GET ohisgorico var whistorico ID 16 OF ODLG REDEFINE GET ovalor var wvalor ID 14 OF ODLG PICTURE "99,999.99" ACTIVATE DIALOG ODLG CENTERED RETURN ( NIL ) FUNCTION CONTROLE(NN) if status="C" APPE BLANK // bloqueio automatico... else if !rlock() MsgAlert("Hiiii, tem boi na linha... não var dá para alterar não!!!","Opps") return(.t.) endif REPL DIARIO->DATA WITH WDATA REPL DIARIO->HISTORICO WITH WHISTORICO REPL DIARIO->VALOR WITH WVALOR GOTO BOTT // serve tambem de unlock... skip // registro fantasma wdata:=diario->data whistorico:=diario->historico wvalor:=diario->valor odata:refresh() ohistorico:refresh() ovalor:refresh() odata:setfocus() // apos salvar, leva o cursor para este campo! if nn = 1 odlg:end() else odata:setfocus() // apos salvar, leva o cursor para este campo! endif return( .t. ) Quote Link to comment Share on other sites More sharing options...
fluna Posted May 13, 2005 Report Share Posted May 13, 2005 ops, não foi direito... apaga a de cima... a certa é esta!!! chame lancar("C") para cadastrar novo registro chame lancar("A") para alterar registro FUNCTION LANCAR(status) // status="C"-cadastra "A"-altera public odata,ohistorico,ovalor,wdata,whistorico,wvalor,odlg use Diario if status="C" goto bott // vai para o ultimo registro skip // registro fantasma endif wdata:=diario->data whistorico:=diario->historico wvalor:=diario->valor DEFINE DIALOG ODLG RESOURCE "LANCAMENTO" TITLE " 1.1 Lancamentos Genericos !" REDEFINE BUTTON ID 170 OF ODLG ACTION CONTROLE(1) // GRAVA E CONTINUA REDEFINE BUTTON ID 180 OF ODLG ACTION CONTTROLE(2) // GRAVA E SAI REDEFINE BUTTON ID 240 OF ODLG ACTION(ODLG:END()) REDEFINE GET odata var wdata ID 15 OF ODLG REDEFINE GET ohisgorico var whistorico ID 16 OF ODLG REDEFINE GET ovalor var wvalor ID 14 OF ODLG PICTURE "99,999.99" ACTIVATE DIALOG ODLG CENTERED RETURN ( NIL ) FUNCTION CONTROLE(NN) if status="C" APPE BLANK // bloqueio automatico... else if !rlock() MsgAlert("Hiiii, tem boi na linha... não var dá para alterar não!!!","Opps") return(.t.) endif REPL DIARIO->DATA WITH WDATA REPL DIARIO->HISTORICO WITH WHISTORICO REPL DIARIO->VALOR WITH WVALOR GOTO BOTT // serve tambem de unlock... skip // registro fantasma wdata:=diario->data whistorico:=diario->historico wvalor:=diario->valor odata:refresh() ohistorico:refresh() ovalor:refresh() odata:setfocus() // apos salvar, leva o cursor para este campo! if nn = 1 odlg:end() else odata:setfocus() // apos salvar, leva o cursor para este campo! endif return( .t. ) Quote Link to comment Share on other sites More sharing options...
marcelo Posted May 13, 2005 Report Share Posted May 13, 2005 Ola FUNCTION LANCAR() Local oDlg Local wdata :=ctod("\\") Local whistorico :=space(50) Local wvalor :=0 Sele 70 Use Diario DEFINE DIALOG ODLG RESOURCE "LANCAMENTO" TITLE " 1.1 Lancamentos Genericos !" Redefine get odata var wdata ID 101 of odlg update Redefine get onome var whistorico Picture '@!' ID 102 of odlg update Redefine Get ovalor var wvalor ID 103 Picture '99,999.99' of odlg update REDEFINE BUTTON ID 170 OF ODLG ACTION REGISTRAR(odlg) **REDEFINE BUTTON ID 180 OF ODLG ACTION CONTINUAR() REDEFINE BUTTON ID 240 OF ODLG ACTION(ODLG:END()) Activate Dialog oDlg Centered * FUNCTION REGISTRAR(odlg1) Sele Diario Do While !Rlock() Enddo APPEND BLANK Replace DATA with wdata,Historico with whistorico,valor with wvalor whistorico=space(40) wdata=ctod(' / / ') wvalor=0 xsetfocus(odata) // focu na data odlg1:update() return(.t.) * Func XSetFocus(oObj) Local oTempo := "" Define Timer oTempo Interval 10 Of oObj:oWnd Action (oObj:SetFocus(),oObj:SetPos(0),oTempo:Deactivate()) Activate Timer oTempo Retu("") Tem que Funcionar Yrece Quote Link to comment Share on other sites More sharing options...
vagner Posted May 14, 2005 Report Share Posted May 14, 2005 Olá Ico, Seja muito bem vindo ao fórum Esse "tar" de XSetFocus(), tá fazendo o maior sucesso (hehehehe), tenho q lembrar quem montou , realmente uma saida bem original Vagner Wirts Clipper 5.2 Lib 5.3 - Blinker 5.0 FW 2.0, Harbour 43.0 (Flex), xHarbour 99.1 99.2 99.3 (Simplex) FW 2.5 Quote Link to comment Share on other sites More sharing options...
elitenet Posted May 14, 2005 Report Share Posted May 14, 2005 Vagner Vou remeter para ti uma alteracao que fiz no xsetfocus, para poder utilizar com todos os tipos de classe. Pois a que baixei em dicas da erro com algumas classes. Marcelo Gomes elitenet@terra.com.br FW 2.3C/CLIPPER 5.2E/BLINKER 7.0 Quote Link to comment Share on other sites More sharing options...
evandro Posted May 14, 2005 Report Share Posted May 14, 2005 Olá, citação: Vou remeter para ti uma alteracao que fiz no xsetfocus, para poder utilizar com todos os tipos de classe.id=quote>id=quote>Poste em "Dicas". []s, Evandro G. de Paula Curvelo - MG evandro@skillnet.com.br (Escr. - na Cidade) imortal@skillnet.com.br (Res. - na Roça) FWH 2.5+PellesC+xBuild+xHarbour.org 0.99.3 Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted May 16, 2005 Author Report Share Posted May 16, 2005 Obrigado a todos pelo esforço em tentar me ajudar, FLUNA colei o seu codigo sem fazer alterações deu o seguinte erro: error description: error BASE/1003 Variable does not exist: STATUS MARCELO fiz o mesmo com o seu codigo continou dando o o mesmo erro error description: error BASE/1003 Variable does not exist: WDATA nao sei mais o que fazer, teria alguma coisa a ver com a versao do FW ? Editado por - ico on 16/05/2005 08:58:55 Quote Link to comment Share on other sites More sharing options...
pauloaraujo Posted May 16, 2005 Report Share Posted May 16, 2005 Bom Dia Ico, Vode deve estar errando na chamada da FUNÇÃO LANCAR() - No botão de Inclusão --- ACTION LANCAR("C") - No botão de Alteração --- ACTION LANCAR("A") Paulo/CONTATO SISTEMAS Clipper53b / FW26 / Blinker70 Quote Link to comment Share on other sites More sharing options...
vagner Posted May 16, 2005 Report Share Posted May 16, 2005 Olá Ico, Retire os "Local" Local wdata :=ctod("\\") Local whistorico :=space(50) Local wvalor :=0 Fazendo isso ela fica local dentro da sua função e não consegue passar para a outra, coloque assim : FUNCTION LANCAR() oDlg wdata :=ctod("\\") whistorico :=space(50) wvalor :=0 ou então passe ela por referência assim : FUNCTION LANCAR() Local oDlg Local wdata :=ctod("\\") Local whistorico :=space(50) Local wvalor :=0 REDEFINE BUTTON ID 170 OF ODLG ACTION REGISTRAR(odlg,@wdata,@wHistorico,@wvalor) FUNCTION REGISTRAR(odlg1,wdata,whistorico,wvalor) Vagner Wirts Clipper 5.2 Lib 5.3 - Blinker 5.0 FW 2.0, Harbour 43.0 (Flex), xHarbour 99.1 99.2 99.3 (Simplex) FW 2.5 Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted May 16, 2005 Author Report Share Posted May 16, 2005 UFA, Segui o codigo do Vagner, retirei os "local" e PIMBA!!, na bucha, esta funcionando perfeitamente. obrigadão a todos... me aguardem ainda vou perguntar muitas coisas he!he! he! 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.