Static Function I_CriaBrowseMat(nlTotItens)
REDEFINE XBROWSE oBrw3021 ID 4049 OF oFld3021:aDialogs[1] ;
ARRAY oClassVen:aDados FOOTERS LINES ; //FONT oFntN10 COLOR nRgb(0,0,0),nRgb(180,200,230) ;
COLUMNS 2,30,3,31,4,5,6,9,7,28,38,26,27,8,39,40,41,42,43,44,45; //21 colunas
HEADERS "Seq","Cj","Código","Código Auxiliar","Descrição","Unid" ,"Qtde","Origem","Preço" ,"Ncm","CFOP","Base ST" ,"ICMS ST","O.R.I.",;
"B ICMS Dest","% FCP ","%ICMS Dest","%ICMS Inter","Vlr FCP Destino","Vlr ICMS Destino","Vlr ICMS Origem";
PICTURES ,"9","9999999","999999999999999","@!","!!", "@E 999999.999","@E 999,999.99","@E 999,999.9999","9999",,"@E 999,999.9999","@E 999,999.9999","@E 999,999.9999",;
"@E 999,999.9999","99.99","99.99","99.99","@E 999,999.9999","@E 999,999.9999","@E 999,999.9999"
oBrw3021:lAllowColHiding := .F. // Não Mostra o Menu
oBrw3021:cToolTip := "Para Incluir Pressione INSERT"+CRLF+"Para Excluir Pressione DELETE"
oBrw3021:lRecordSelector := .F.
oBrw3021:nColDividerStyle := LINESTYLE_BLACK
oBrw3021:nRowDividerStyle := LINESTYLE_BLACK
oBrw3021:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw3021:lAllowColSwapping:= .F. //----------------------------> Trocar Colunas
oBrw3021:lAllowRowSizing := .F. //----------------------------> Nao move as Linhas
oBrw3021:nFreeze := 5
oBrw3021:nColSel := 2
oBrw3021:bClrSel := {|| {CLR_BLACK,CLR_WHITE}}
oBrw3021:bClrSelFocus := {|| {CLR_BLACK,nRGB( 160, 180, 255 )}}
oBrw3021:bValid := {|| IF(dVenAberta(),IF(oClassVen:Confere(),olObj302:I_Imposto(.t.),.F.),.T.) }
// oBrw3021:bWhen := {||.f.}
oBrw3021:aCols[ 1 ]:nWidth := 42 //32
oBrw3021:aCols[ 1 ]:nDataStrAlign := AL_RIGHT
oBrw3021:aCols[ 1 ]:nHeadStrAlign := AL_CENTER
oBrw3021:aCols[ 1 ]:AddResource("BrwSem")
oBrw3021:aCols[ 1 ]:AddResource("BrwInc")
oBrw3021:aCols[ 1 ]:AddResource("BrwAlt")
oBrw3021:aCols[ 1 ]:AddResource("BrwExc")
oBrw3021:aCols[ 1 ]:bBmpData := {|| LEN(oClassVen:aDados[oBrw3021:nArrayAt]:Status) }
oBrw3021:aCols[ 1 ]:nDataBmpAlign := AL_LEFT
oBrw3021:aCols[ 1 ]:cToolTip := "Clique Duplo na coluna sequência, edita o item"
oBrw3021:aCols[ 1 ]:blDClickData := {|oGet, oCol| I_EditaItem(oClassVen:aDados, oBrw3021:nArrayAt,oBrw3021:aCols[ 3 ] ) } //I_EditaItem(oClassVen:aDados, oBrw3021:nArrayAt )
oBrw3021:aCols[ 1 ]:AddResource( "EDITA" )
oBrw3021:aCols[ 1 ]:nHeadBmpNo := 5
oBrw3021:aCols[ 1 ]:nHeadBmpAlign := AL_RIGHT
// Quarta Coluna
oBrw3021:aCols[ 2 ]:nWidth := 15
oBrw3021:aCols[ 2 ]:nDataStrAlign := AL_CENTER
oBrw3021:aCols[ 2 ]:nHeadStrAlign := AL_CENTER
oBrw3021:aCols[ 2 ]:bEditValid := { | oGet, oCol | ( F_AlteraArray( oClassVen:aDados, oBrw3021, oGet, 30 ),oClassVen:AgrupaConjunto( oGet ),.t.) }
// Segunda Coluna
oBrw3021:aCols[ 3 ]:nWidth := 75
oBrw3021:aCols[ 3 ]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN,,) }
oBrw3021:aCols[ 3 ]:bEditBlock := { | oGet, oCol| F_PesqCom2( oBrw3021,oGet , oCol, oClassVen, "PED" ) }
oBrw3021:aCols[ 3 ]:bEditValid := { | oGet, oCol | IF(I_VerificaCodigo( oGet ),IF(F_PesqMat2(oGet:Value(), oBrw3021, oGet, oCol, oClassVen, "PED" ), (oBrw3021:nColSel := 7,F_AlteraArray( oClassVen:aDados, oBrw3021, oGet, 3 ),.T.),.F.),.F.) }
oBrw3021:aCols[ 3 ]:Cargo := .T.
oBrw3021:aCols[ 3 ]:addResource( "LUPA2" )
oBrw3021:aCols[ 3 ]:nBtnBmp := 1
oBrw3021:aCols[ 3 ]:bRClickData := {|nRow, nCol | I_BrowseItemMenu(nRow, nCol, oBrw3021) }
oBrw3021:bRClicked := { | nRow, nCol | I_BrowseItemMenu( nRow, nCol, oBrw3021 ) }
// Segunda Coluna
oBrw3021:aCols[ 4 ]:nWidth := 85
oBrw3021:aCols[ 4 ]:bEditBlock := { | oGet, oCol| F_PesqCom2( oBrw3021, , oCol, oClassVen, "PED" ) }
oBrw3021:aCols[ 4 ]:bEditValid := { | oGet, oCol | IF(I_VerificaCodigo( oGet ),IF(F_PesqMat2(oGet:Value(), oBrw3021, oGet, oCol, oClassVen, "PED" ), F_AlteraArray( oClassVen:aDados, oBrw3021, oGet, 4 ),.F.),.F.) }
oBrw3021:aCols[ 4 ]:Cargo := .T.
oBrw3021:aCols[ 4 ]:addResource( "LUPA2" )
oBrw3021:aCols[ 4 ]:nBtnBmp := 1
oBrw3021:aCols[3]:cFooter := "Total de Itens:"
oBrw3021:aCols[4]:lTotal := .T.
oBrw3021:aCols[ 4 ]:cFooter := TRANS( nlTotItens, "@E 999" )
// Terceita Coluna
oBrw3021:aCols[ 5 ]:nHeadStrAlign := AL_CENTER
oBrw3021:aCols[ 5 ]:nDataStrAlign := AL_LEFT
oBrw3021:aCols[ 5 ]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, oClassVen:aDados[ oBrw3021:nArrayAt ]:NomMat := IF( "@" $ oClassVen:aDados[ oBrw3021:nArrayAt ]:NomMat, xVal, oClassVen:aDados[ oBrw3021:nArrayAt ]:NomMat),) }
oBrw3021:aCols[ 5 ]:bEditBlock := { || I_MostraProdutos( oClassVen:aDados[ oBrw3021:nArrayAt ]:CodMat ) }
oBrw3021:aCols[ 5 ]:addResource( "olho" )
oBrw3021:aCols[ 5 ]:nBtnBmp := 1
// Quarta Coluna
oBrw3021:aCols[ 6 ]:nWidth := 30
oBrw3021:aCols[ 6 ]:cEditPicture := "!!"
oBrw3021:aCols[ 6 ]:nDataStrAlign := AL_CENTER
oBrw3021:aCols[ 6 ]:nHeadStrAlign := AL_CENTER
// Quinta Coluna
oBrw3021:aCols[ 7 ]:nWidth := 63
oBrw3021:aCols[ 7 ]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, (oClassVen:aDados[ oBrw3021:nArrayAt ]:QtdMat := xVal,olObj302:I_Imposto(.t.)),) }
oBrw3021:aCols[ 7 ]:bEditValid := { | oGet, oCol | I_VerSaldo(),F_AlteraArray( oClassVen:aDados, oBrw3021, oGet, 6 ) }
oBrw3021:aCols[ 7 ]:nDataStrAlign := AL_RIGHT
oBrw3021:aCols[ 7 ]:nHeadStrAlign := AL_CENTER
oBrw3021:aCols[ 7 ]:AddResource("BrwSem")
oBrw3021:aCols[ 7 ]:AddResource("BrwExc")
oBrw3021:aCols[ 7 ]:nHeadBmpNo := 1
oBrw3021:aCols[ 7 ]:nHeadBmpAlign := AL_RIGHT
oBrw3021:aCols[ 7 ]:bClrStd := {|| IF( oClassVen:aDados[oBrw3021:nArrayAt]:EstMat .AND. EMPTY(oClassVen:dvDatNot), {CLR_WHITE, CLR_HRED},{CLR_BLACK,CLR_WHITE }) }
// Sétima Coluna
oBrw3021:aCols[ 8 ]:nDataStrAlign := AL_RIGHT
oBrw3021:aCols[ 8 ]:nHeadStrAlign := AL_CENTER
// _ Coluna
oBrw3021:aCols[ 9 ]:nWidth := 75
oBrw3021:aCols[ 9 ]:nDataStrAlign := AL_RIGHT
oBrw3021:aCols[ 9 ]:nHeadStrAlign := AL_CENTER
oBrw3021:aCols[ 9 ]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, (oClassVen:aDados[ oBrw3021:nArrayAt ]:PreUni := oClassVen:aDados[ oBrw3021:nArrayAt ]:PreOri := xVal,olObj302:I_Imposto(.t.)),) }
oBrw3021:aCols[ 9 ]:bEditValid := { | oGet, oCol | F_AlteraArray( oClassVen:aDados, oBrw3021, oGet, 7 ) }
// Quarta Coluna
oBrw3021:aCols[ 10 ]:AddResource( "OLHOP" )
oBrw3021:aCols[ 10 ]:nHeadBmpNo := 1
oBrw3021:aCols[ 10 ]:nHeadBmpAlign := AL_RIGHT
oBrw3021:aCols[ 10 ]:nWidth := 44
oBrw3021:aCols[ 10 ]:nDataStrAlign := AL_CENTER
oBrw3021:aCols[ 10 ]:nHeadStrAlign := AL_LEFT
oBrw3021:aCols[ 10 ]:cToolTip := "Clique Duplo na coluna NCM, mostra dados NCM"
oBrw3021:aCols[ 10 ]:blDClickData := {|| sup303():I_MostraNBM(oClassVen:aDados,oBrw3021,oClassVen:aDados[ oBrw3021:nArrayAt ]:CodNbm ) }
oBrw3021:aCols[ 11 ]:nWidth := 34
oBrw3021:aCols[ 11 ]:nHeadStrAlign := AL_CENTER
oBrw3021:aCols[ 11 ]:bEditValid := { | oGet, oCol | F_AlteraArray( oClassVen:aDados, oBrw3021, oGet, 38 ) }
// Quarta Coluna
oBrw3021:aCols[ 12 ]:nWidth := 75
oBrw3021:aCols[ 12 ]:nDataStrAlign := AL_RIGHT
oBrw3021:aCols[ 12 ]:nHeadStrAlign := AL_CENTER
// Quarta Coluna
oBrw3021:aCols[ 13 ]:nWidth := 75
oBrw3021:aCols[ 13 ]:nDataStrAlign := AL_RIGHT
oBrw3021:aCols[ 13 ]:nHeadStrAlign := AL_CENTER
// Oitava Coluna
oBrw3021:aCols[ 14 ]:nDataStrAlign := AL_RIGHT
oBrw3021:aCols[ 14 ]:nHeadStrAlign := AL_CENTER
for klCont:=15 to 21
oBrw3021:aCols[ klcont ]:nDataStrAlign := AL_RIGHT
oBrw3021:aCols[ klcont ]:nHeadStrAlign := AL_CENTER
next
// Ajustes da Browse
FOR klcont:=2 TO LEN( oBrw3021:aCols )
oBrw3021:aCols[ klcont ]:lAllowSizing := .F.
oBrw3021:aCols[ klcont ]:bRClickHeader = {|| NIL }
oBrw3021:aCols[ klcont ]:cToolTip := "Para Incluir Pressione INSERT"+CRLF+"Para Excluir Pressione DELETE"
NEXT
oBrw3021:aCols[ 3 ]:cToolTip := "Clique Botão Direito do Mouse na coluna Código, abre menu Item"
oBrw3021:aCols[ 10 ]:cToolTip := "Clique Duplo na coluna NCM, mostra dados NCM"
*
return .t.
oBrw3021:aArrayData := oClassVen:aDados
oBrw3021:nFreeze := 5
oBrw3021:nColSel := 2
oBrw3021:nMarqueeStyle := IF(!EMPTY(oClassVen:cvCtrFat), MARQSTYLE_HIGHLROWRC, MARQSTYLE_HIGHLCELL )
oBrw3021:bKeyDown := IF(!EMPTY(oClassVen:cvCtrFat), {|| NIL}, {|nKey| olObj302:I_BrwKey( nkey,1 ) } )
oBrw3021:lFastEdit := IF(!EMPTY(oClassVen:cvCtrFat), .F., .T. )
oBrw3021:lAutoAppend := IF(!EMPTY(oClassVen:cvCtrFat), .F., .T. )
oBrw3021:aCols[ 2 ]:nEditType := IF(!EMPTY(oClassVen:cvCtrFat), EDIT_NONE, EDIT_GET )
oBrw3021:aCols[ 3 ]:nEditType := IF(!EMPTY(oClassVen:cvCtrFat), EDIT_NONE, EDIT_GET_BUTTON )
oBrw3021:aCols[ 4 ]:nEditType := IF(!EMPTY(oClassVen:cvCtrFat), EDIT_NONE, EDIT_GET_BUTTON )
oBrw3021:aCols[ 5 ]:nEditType := EDIT_GET_BUTTON //IF(!EMPTY(oClassVen:cvCtrFat), EDIT_NONE, EDIT_GET_BUTTON )
oBrw3021:aCols[ 7 ]:nEditType := IF(!EMPTY(oClassVen:cvCtrFat), EDIT_NONE, EDIT_GET )
oBrw3021:aCols[ 9 ]:nEditType := IF(!EMPTY(oClassVen:cvCtrFat), EDIT_NONE, EDIT_GET )
oBrw3021:aCols[4]:lTotal := .T.
oBrw3021:aCols[ 4 ]:cFooter := TRANS( nlTotItens, "@E 999" )
oBrw3021:aCols[ 5 ]:RefreshFooter()
oBrw3021:aCols[ 11 ]:nEditType := IF(!EMPTY(oClassVen:cvCtrFat), EDIT_NONE, EDIT_GET )
oBrw3021:Refresh(.T.)
In this code, if I take the pictures the error does not occur.
But in Windows XP the error continues, in WIN7, WIN8 and WIN10 error does not occur when you remove the resouces, bitmaps
oBrw3021:lGDIP := .f.
friend if u move the button , you will see that the will to respond to close
oBrw3021:aCols[ 3 ]]: nEditType: = EDIT_GET_BUTTON
oBrw3021:aCols[ 3 ]:addResource( "LUPA2")
oBrw3021:aCols[ 3 ]:nBtnBmp := 1
oBrw3021:aCols[ 3 ]: nEditType: = EDIT_GET_BUTTON
oBrw3021:aCols[ 3 ]:addbitmap( "C:\desenv\fwh\bitmaps\16x16\about.bmp" )
oBrw3021:aCols[ 3 ]:nBtnBmp := 1
oBrw3021:aCols[ 3 ]: nEditType: = EDIT_GET_BUTTON
oBrw3021:aCols[ 3 ]:addResource( "LUPA2")
oBrw3021:aCols[ 3 ]:nBtnBmp := 1
oBrw3021:aCols[ 3 ]: nEditType: = EDIT_GET_BUTTON
oBrw3021:aCols[ 3 ]:addbitmap( "C:\desenv\fwh\bitmaps\16x16\about.bmp" )
oBrw3021:aCols[ 3 ]:nBtnBmp := 1
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 28 guests