Hello, i have a problem
The idea is to type the code by hand or from a listbox, and update the description column
for this use the codeblock Helppre()
-----------
oLbxp:aCols[ 5 ]:nEditType := EDIT_GET_BUTTON //
// oLbxp:aCols[ 5 ]:bEditBlock := {||HelpcPres(oLbxp)}
oLbxp:aCols[ 5 ]:bEditBlock := {||(if(Helppre(),VolHpre(.t.),VolHpre(.f.)),.t.)}
---------------------------
Pressing the button displays the browse to select code, return it and put the description column 7
if I put this code in the VOLPRE functions, not updated anything
If lVol
oLbxp:aCols[ 5 ]:Value := cpres->pr_codi
oLbxp:aCols[ 7 ]:Value := cpres->pr_desc
Else
if I put this other code (I have seen it is not advisable to use it) but updated code and description of the two lines
If lVol
oLbxp:aCols[ 5 ]:bStrData := cpres->pr_codi
oLbxp:aCols[ 7 ]:bStrData := cpres->pr_desc
Else
Code: Select all
Static Function Lineas()
local codpre :=" "
XbrNumFormat( "E", .t. )
DbSelectArea("pliva")
pliva->(DBGOTOP())
DbSelectArea("bliva")
bliva->(ORDSETFOCUS("obra"))
DEFINE DIALOG oDDAbmLins OF oWndIva RESOURCE "IVA_LINS"
REDEFINE XBROWSE oLbx ID 110 OF oDDAbmlins;
HEADERS "N.Obra","Asiento","Fecha","Cuenta","Cpto.","Descripcion","Base","Tipo";
COLUMNS "Obra", "Asiento", "fecha","Cuenta","Concepto","Descrip","Base","tipo" ;
SIZES 50,50,65,55,30,210,90,33;
ALIAS ("bliva");
ON CHANGE (Toma_Lin(),PonerScope("bliva","Pliva",oLbxp))
olBx:lHScroll:=.F. //windows style en el recurso = 0x50210000 en .f. no funciona
REDEFINE XBROWSE oLbxp ID 120 OF oDDAbmlinp;
HEADERS "N.Obra","Asiento","Fecha","Cuenta","Prespto.","Natu","Descripcion","Importe";
COLUMNS "PL_OBRA", "PL_NUMASI", "PL_FECHA","PL_CUENTA","PL_PRES","PL_NATU","PL_DESC","PL_IMPORT" ;
SIZES 50,50,60,55,40,30,210,85;
AUTOSORT AUTOCOLS FASTEDIT LINES CELL FOOTERS;
ALIAS "pliva";
ON CHANGE (oLbxp:MakeTotals(), oLbxp:refresh ())
oLbxp:aCols[ 5 ]:nEditType := EDIT_GET_BUTTON
// oLbxp:aCols[ 5 ]:bEditBlock := {||HelpcPres(oLbxp)}
oLbxp:aCols[ 5 ]:bEditBlock := {||(if(Helppre(),VolHpre(.t.),VolHpre(.f.)),.t.)}
oLbxp:aCols[ 8 ]:nEditType := EDIT_GET
oLbxp:aCols[ 8 ]:nFooterType := AGGR_TOTAL
ACTIVATE DIALOG oDDAbmLins NOWAIT;
ON INIT ( oLbx:SetFocus(),PonerScope("bliva","pliva",oLbxp) )
DbSelectArea("bliva")
return nil
//----------------------------------------------------------------------
Static Function VolHpre(lVol)
If lVol
oLbxp:aCols[ 5 ]:Value := cpres->pr_codi
oLbxp:aCols[ 7 ]:Value := cpres->pr_desc
Else
oLbxp:gotocol( 5 )
EndIf
oLbxp:gotocol( 8 )
DbSelectArea("pliva")
return nil
the code for Helppre(), thir work fine in other cases
Code: Select all
#Include "FiveWin.ch"
Static lSel,oDlg, oLbxhpPre
FUNCTION HelpPre()
DbSelectArea("cPres")
lSel:=.F.
SetKey_Hlp()
DEFINE DIALOG oDlg RESOURCE "HLP1" TITLE "Ayuda Conceptos Presupuestarios"
REDEFINE XBROWSE oLbxhpPre ID 110 OF oDlg;
HEADERS "Codigo","Naturaleza","Descripcion";
COLUMNS "pr_codi", "pr_natu", "pr_desc";
SIZES 50,50,210;
AUTOSORT FOOTERS LINES CELL ;
ON LEFT DBLCLICK (lSel:=.T.,oDlg:End());
ALIAS "cPres";
ACTIVATE DIALOG oDlg CENTERED;
ON INIT olbxhpPre:SetFocus();
VALID (DelKey_Hlp(),.t.)
RETURN lSel
//------------------------------------//
Static Function SetKey_Hlp()
SET KEY VK_RETURN TO Hlp_Ok()
Return nil
Static Function Hlp_OK()
lSel:=.t.
oDlg:End()
Return nil
Static Function DelKey_Hlp()
SET KEY VK_RETURN TO
Return nil