I'm having a problem with the code bellow where I'm showing a rowset content and trying allow to edit two fields(Columns 3 and 9). But the EDIT_GET is only working for the column 3. For the other column(9) double click is not activating the edit.
I have already tried with EDIT_GET_BUTTON, but don't work too. Do you know what am I doing wrong ?
- Code: Select all Expand view RUN
#include "fivewin.ch"
#include "Splitter.ch"
FUNCTION Main()
LOCAL oCn, oRs,nSec:=Seconds(),oQryMvg,aCols,oLbx[3],oWndAgd,oCol,oPanel[2],oVSplit,oPanelExplorer,oExBar,oMenu
oCn := Connect()
//QUERY DE GUIAS
oQryMvg := oCN:Query("SELECT mvg.*,cli.fantasia,cli.end_fatu,cli.no_fatu,loc.descricao,loc.zs,pes.nome,ttp.descricao AS tipo,ttp.natureza,mps.hora_ini "+;
"FROM tmovguias AS mvg LEFT JOIN clientes AS cli ON mvg.ccliente=cli.ccliente LEFT JOIN tlocais AS loc ON mvg.clocal=loc.clocal "+;
"LEFT JOIN ttipoviag AS ttp ON mvg.ctipo=ttp.ctipo LEFT JOIN tmovgpes AS mps ON mps.data = ? AND mps.funcao IN('F','O') AND "+;
"mvg.cequipto=mps.cequipto LEFT JOIN tpessoal AS pes ON mps.cmat=pes.cmat WHERE mvg.data = ?",{Date()-2,Date()-2})
DEFINE WINDOW oWndAgd TITLE "Ordens de Serviço para "+Dtoc(date()) MENU oMenu
oExBar := TExplorerBar():New( 0, 0, 255, 300, oPanelExplorer )
//CRIA BROWSE DE VEÍCULOS
oPanel[1] := oExBar:AddPanel( "Veículos",,255 )
//CRIA BROWSE DE EQUIPES
oPanel[2] := oExBar:AddPanel( "Equipe" ,,165 )
//BROWSE DE OS
aCols := {{"IF(natureza='R' AND cterno=NIL,[Recolhimento],cterno)","Nº Terminal",,85,0},{{|| oQryMvg:fantasia+CRLF+IF(oQryMvg:descricao=NIL.OR.Empty(oQryMvg:descricao),Rtrim(oQryMvg:end_fatu)+","+oQryMvg:no_fatu,oQryMvg:descricao)},"Cliente/Local",,300,0},;
{"cequipto","Viatura","!!!!!",70,0},{"nome","Operador/Fiel",,200,0},{"hora_ini","Hr.Inicio","@R 99:99",50,0,"hora_ini"},{"hora_fim","Hr.Término","@R 99:99",60,0,"hora_fim"},{"hora_lim","Hr.Limite","@R 99:99",50,0,"hora_lim"},;
{"tipo","Tipo de OS",,120,0,"tipo"},{"zs","Rota","@!",120,0},{{|| aSituacao[Max(At(oQryMvg:situacao,"NEIFTC"),1)]},"Situação",,100,0},{"clote","Lote",,45,0,"clote"},{"valordin","Valor","999,999,999.99",80,1}}
@ 00,255 XBROWSE oLbx[3] OF oWndAgd COLUMNS aCols DATASOURCE oQryMvg CELL LINES FASTEDIT AUTOSORT PIXEL
oLbx[3]:nRowHeight := 35
oLbx[3]:nMarqueeStyle := 3
oLbx[3]:nStretchCol := STRETCHCOL_LAST
oCol:= oLbx[3]:aCols[ 3 ]
oCol:nEditType := EDIT_GET
//the problem is happening in this column
oCol:= oLbx[3]:aCols[ 9 ]
oCol:nEditType := EDIT_GET
oLbx[3]:CreateFromCode()
@ 0,255 SPLITTER oVSplit ;
VERTICAL ;
PREVIOUS CONTROLS oExBar ;
HINDS CONTROLS oLbx[3];
LEFT MARGIN 250 ;
RIGHT MARGIN 80 ;
SIZE 4, 355 PIXEL ;
OF oWndAgd ;
_3DLOOK
ACTIVATE WINDOW oWndAgd MAXIMIZED ;
ON RESIZE (oVSplit:AdjRight() )
oItalic:End()
oBold:End()
oCn:Close()
return nil