Para Manuel Mercado - TSBROWSE

Post Reply
MGA
Posts: 1219
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

Para Manuel Mercado - TSBROWSE

Post by MGA »

Sr. Manuel, como posso fazer para depois de INSERIR uma nova linha no TSBROWSE, posiciona-lo na primeira coluna?



REDEFINE BROWSE oBrw CELLED ALIAS "SAIPRO" ID 46 OF oDlg

obRW:nHeightHead := 28
obRW:nHeightCell := 23
obRW:nHeightFoot := 26
obRW:nColPos := 1
obRW:lMChange := .f.
obRW:lDrawHeaders:= .t.
obRW:lFooting := .t.
obRW:lNoMoveCols := .t.
obRW:bKeyDown := {|nKey| TSTeclasEdit803(nKey,obRW,oDlg,odgets,.f.,nAliqForaUF, cConsFinal, lMesmoUF, cEstadoFil, cCliSimples,cModo,@aMatPri,cTipoFil99,cUsaPreVend2,@lF3) }
obRW:bGotFocus := {|| FW803LIGRES(odgets,.F.),oBBar:SetChecked( 6, .f. ),objdisable(odgets) }
obRW:bchange := {|| FW803MostraTotal(@nTotQtd,@nTotal,@nTotGer,cConsiEmbal,nAcreDes,cModo,obRW) }
bColor := {|| If(oBrw:nLogicPos() % 2 = 0, CLR_LGRAY , CLR_LGREEN ) }
obRW:SetColor( { 1, 3, 4, 5, 6,9,10 , 13, 15, 11,12 }, ;
{ CLR_BLACK,;
CLR_BLACK,;
nRGB(211, 227, 247),;
CLR_WHITE,;
CLR_HBLUE,;
CLR_BLACK,;
nRGB(211, 227, 247),;
CLR_WHITE,;
CLR_BLACK,;
CLR_WHITE,;
CLR_HBBLUE } )


ADD COLUMN TO oBrw TITLE "Código" DATA FieldWBlock("codpro",select()) SIZE 90 EDITABLE 3DLOOK FALSE, TRUE, TRUE ALIGN DT_CENTER, DT_CENTER, DT_CENTER;
COLORS CLR_BLACK, bColor MOVE DT_MOVE_NEXT ;
VALID {|uVar| IF(EMPTY(saipro->codpro),TSvalidaprod803(uVar,obrw,bAltera, cModo, nAliqForaUF, cTipoPreco, cUsaPreVend2, nFornCli, cConsFinal, lMesmoUF, cEstadoFil, cCliSimples,@aMsgsFisc,@lMsgRedParana),.t.) } ;
WHEN IF(EMPTY(saipro->codpro),.T.,.F.);
picture '999999' TOOLTIP "Digite o código do produto"


ADD COLUMN TO oBrw TITLE "Descrição do Produto" DATA FieldWBlock("descpro",select()) SIZE 290 EDITABLE 3DLOOK FALSE, TRUE, TRUE ALIGN DT_LEFT , DT_LEFT , DT_RIGHT;
COLORS CLR_BLACK, bColor MOVE DT_MOVE_NEXT;
VALID {|uVar| !empty(uVar)};
WHEN IF(!EMPTY(saipro->codpro),.T.,.F.) ;
FOOTER "Total:" TOOLTIP "Informe a descrição do produto"

ADD COLUMN TO oBrw TITLE "Quantidade" DATA FieldWBlock("qtde",select()) SIZE 60 EDITABLE 3DLOOK FALSE, TRUE, TRUE ALIGN DT_RIGHT , DT_RIGHT , DT_RIGHT;
COLORS CLR_BLACK, bColor MOVE DT_MOVE_NEXT;
VALID {|uVar| tsvalidaqtde803(uVar,cModo,oBrw)};
POSTEDIT FW803MostraTotal(@nTotQtd,@nTotal,@nTotGer,cConsiEmbal,nAcreDes,cModo,obRW);
WHEN IF(!EMPTY(saipro->codpro),.T.,.F.);
picture '99999.999' FOOTER {|| TRANSFORM(nTotQtd,"@E 99999.999") } TOOLTIP "Informe a quantidade"



*****************
function MYINSERT()
*****************
MyAppend('saipro')
olbx:gobottom()
olbx:refresh()
olbx:BUGUP()
olbx:setfocus()

***aqui Sr. Manuel, preciso posicionar na primeira coluna novamente
return(.t.)
ubiratanmga@gmail.com

FWH17.04
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
MGA
Posts: 1219
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

Post by MGA »

Sr. Manuel tentei com o olbx:gopos(), mais não funcionou... Ai consegui resolver o problema da maneira abaixo:

*****************
function MYINSERT()
*****************
MyAppend('saipro')
olbx:gobottom()
olbx:BUGUP()

***Aqui Sr. Manuel
do while .t.
if olbx:ncell#1
olbx:goleft()
else
exit
endif
enddo
***

olbx:refresh()
olbx:setfocus()
return(.t.)


Obrigado
ubiratanmga@gmail.com

FWH17.04
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
User avatar
mmercado
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Post by mmercado »

Hola José:

Que bien que encontraste la forma de hacerlo.

Aquí te doy otras 2 maneras:

oLbx:PanHome()
oLbx:HiliteCell( 1 )

Saludos

Manuel Mercado
MGA
Posts: 1219
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

Post by MGA »

Grato Sr. Manuel!

:)
ubiratanmga@gmail.com

FWH17.04
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
Post Reply