Hola,
tengo un xbrowse sobre un DIALOG, que con 18.04 se ve asi :
[img]
http://www.mediafire.com/view/iouc8qxz6 ... rw1804.jpg
[/img]
al solo compilar con la nueva 18.05 (sin cambiar nada) sale asi :
[img]
http://www.mediafire.com/view/97a48dwtp ... rw1805.jpg
[/img]
si vuelvo a la 18.04 y recompilo, funcionar correctamente como la imagen1
HAY Q CAMBIAR ALGO EN EL CODIGO????!!!!
Error GRAVE en xbrowse 18.05
- nageswaragunupudi
- Posts: 10733
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 11 times
- Contact:
Re: Error GRAVE en xbrowse 18.05
Please provide important parts of your source code please.
In particular, I would like to know the datasouce, i.e., dbf, ado, dolphin, tmysql, etc. and how the browse is created.
This information helps where did we commit mistake in our recent changes.
In particular, I would like to know the datasouce, i.e., dbf, ado, dolphin, tmysql, etc. and how the browse is created.
This information helps where did we commit mistake in our recent changes.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Error GRAVE en xbrowse 18.05
Mr. Rao,
uso mysql con tdolphin y el codigo es :
Saludos.
uso mysql con tdolphin y el codigo es :
Code: Select all | Expand
if ( ::lModal ) DEFINE DIALOG ::oDlg RESOURCE cDlg ; TITLE ::cTitle COLOR ::nFrontColor, ::nBackColor REDEFINE TASKPANEL ::oTaskPanel ID 100 OF ::oDlg PLAIN if ::nTypeAbm>0 .and. ::lModal ::oStBar:= TC5StBar():Redefine( 101, ::oDlg, oApp:nStBarColor1, oApp:nStBarColor2, .f., ::oFont1 ) ::oStBar:lBorder:= oApp:BarC5StBorder REDEFINE XBROWSE ::oBrw ; COLUMNS aFld ; HEADERS aHdr; FIELDSIZES aSz ; JUSTIFY aJustifyDat ; PICTURES aPic ; ID 4001 ; OF ::oDlg ; DATASOURCE ::oSql FOR n:= 1 TO Len(::oBrw:aCols) // aField) cPicture:= nSize:= nHeadAlign:= nDataAlign:= NIL if VALTYPE( ::aField[n,01] ) == "A" oCol:= ::oBrw:InsCol(n) xTitle:= ::aField[n,01] oCol:Cargo:= xTitle[01] if LEN( ::aField[n] ) > 4 cPicture:= ::aField[ n,05 ] else cPicture:= Nil endif nSize:= ::aField[ n,04 ] if LEN( ::aField ) > 5 if ::aField[ n,06 ] # Nil if VALTYPE( ::aField[ n,06] ) == "A" xTitle:= ::aField[ n,06] if VALTYPE( ::aField[ n,01] ) == "A" nHeadAlign:= xTitle[ 01 ] nDataAlign:= AL_LEFT else nHeadAlign:= xTitle[ 01 ] nDataAlign:= xTitle[ 02 ] endif else nHeadAlign:= AL_LEFT nDataAlign:= ::aField[ n,06 ] endif else nHeadAlign:= AL_LEFT nDataAlign:= AL_LEFT endif else nHeadAlign:= AL_LEFT nDataAlign:= AL_LEFT endif else oCol := ::oBrw:aCols[n] oCol:Cargo:= ::aField[n,01] if LEN( ::aField[n] ) > 5 if ::aField[ n,06 ] # Nil if VALTYPE( ::aField[ n,06] ) == "A" xTitle:= ::aField[ n,06] if VALTYPE( ::aField[ n,01] ) == "A" nHeadAlign:= xTitle[ 01 ] else nHeadAlign:= xTitle[ 01 ] endif else nHeadAlign:= AL_LEFT endif else nHeadAlign:= AL_LEFT endif else nHeadAlign:= AL_LEFT endif/* cPicture := oCol:cEditPicture nSize := oCol:nWidth nHeadAlign:= oCol:nHeadStrAlign nDataAlign:= oCol:nDataStrAlign*/ endif WITH OBJECT oCol if nDataAlign # NIL :nHeadStrAlign:= nHeadAlign :nDataStrAlign:= nDataAlign :cEditPicture := cPicture :nWidth := nSize else :nHeadStrAlign:= nHeadAlign endif if VALTYPE( ::aField[n,01] ) == "A" AEval( ::aField[n,01], { |cBmp| :AddResource(cBmp) }, 2 ) :bBmpData := SetBmpData( ::oBrw, oCol:Cargo ) :bStrData := { || "" } cOrder:= "" else cOrder:= ::aField[ n,01 ] endif if LEN( ::aField[n] ) > 6 .AND. LEN(::aField[n])#10 :nFooterType:= AGGR_TOTAL endif if LEN( ::aField[n] ) == 10 :cTooltip:= ::aField[ n,10 ] endif IF !EMPTY( cOrder ) :cSortOrder:= cOrder endif END NEXT WITH OBJECT ::oBrw if ::nIdent == ABMArticulos :bClrStd:= { || If( ::oSql:oferta==1, { CLR_BLACK, CLR_OFERTA }, If( ::oSql:apedido==1, { CLR_BLACK, CLR_HGREEN }, { CLR_BLACK, GetSysColor( COLOR_WINDOW )} )) } endif :nMarqueeStyle := MARQSTYLE_HIGHLWIN7 :lMultiSelect := .f. END WITH ::lRedefine:= .f. endif ACTIVATE DIALOG ::oDlg ; ON INIT ( this:body(), this:elxbrowse(), /*this:wSplitter(),*/ this:movedgrid(),; if(this:lModal.and.this:nTypeAbm>0,,If(this:oBrwRb#Nil,BringWindowToTop( this:oPanel:hWnd ),BringWindowToTop( this:oBrw:hWnd ) )),; if(this:lModal.and.this:nTypeAbm>0,,if(this:oBrwRb#Nil.and.this:oSplit#Nil,this:oSplit:Adjust( .f., .t., .f., .t. ),)),; if(this:lFocusxRubro, oSetFocus(this:oBrwRb), if( this:oSql:LastRec()>0,; ( if(this:oBrwRb#Nil,this:oBrwRb:PostMsg(WM_KILLFOCUS),),; this:oBrw:PostMsg(WM_SETFOCUS)),; oSetFocus(this:aGet[1]) ) ),; // this:aGet[1]:PostMsg(WM_SETFOCUS) )),; .F. ) ; // ,oSetFocus(this:oBrw) VALID this:lExit// if(this:oBrwRb#NIL,this:oSqlRb:Seek(),),;// if(this:oBrwRb#NIL,oSetFocus(this:oBrwRb), if(this:oSql:LastRec()>0,this:oBrw:PostMsg(WM_SETFOCUS),oSetFocus(this:aGet[1]))),;// oSetFocus(this:aGet[1]))),; else DEFINE WINDOW ::oDlg MDICHILD; FROM 0, 0 TO 400, 800 PIXEL ; TITLE ::cTitle COLOR ::nFrontColor, ::nBackColor ; ICON ::oWnd:oIcon ; OF ::oWnd ::hLays["MAIN"] = TLayout():new( ::oDlg ) ::hLays["H1"] = ::hLays["MAIN"]:addHLayout(240) ::hLays["H2"] = ::hLays["MAIN"]:addHLayout() DEFINE DIALOG ::oDlg RESOURCE cDlg ; // OF ::oWnd ; TITLE ::cTitle COLOR ::nFrontColor, ::nBackColor REDEFINE TASKPANEL ::oTaskPanel ID 100 OF ::oDlg PLAIN if ::nTypeAbm>0 .and. ::lModal ::oStBar:= TC5StBar():Redefine( 101, ::oDlg, oApp:nStBarColor1, oApp:nStBarColor2, .f., ::oFont1 ) ::oStBar:lBorder:= oApp:BarC5StBorder REDEFINE XBROWSE ::oBrw ; COLUMNS aFld ; HEADERS aHdr; FIELDSIZES aSz ; JUSTIFY aJustifyDat ; PICTURES aPic ; // SIZE 148,60 PIXEL OF oDlg ; ID 4001 ; OF ::oDlg ; DATASOURCE ::oSql FOR n:= 1 TO Len(::oBrw:aCols) // aField) cPicture:= nSize:= nHeadAlign:= nDataAlign:= NIL if VALTYPE( ::aField[n,01] ) == "A" oCol:= ::oBrw:InsCol(n) xTitle:= ::aField[n,01] oCol:Cargo:= xTitle[01] if LEN( ::aField[n] ) > 4 cPicture:= ::aField[ n,05 ] else cPicture:= Nil endif nSize:= ::aField[ n,04 ] if LEN( ::aField ) > 5 if ::aField[ n,06 ] # Nil if VALTYPE( ::aField[ n,06] ) == "A" xTitle:= ::aField[ n,06] if VALTYPE( ::aField[ n,01] ) == "A" nHeadAlign:= xTitle[ 01 ] nDataAlign:= AL_LEFT else nHeadAlign:= xTitle[ 01 ] nDataAlign:= xTitle[ 02 ] endif else nHeadAlign:= AL_LEFT nDataAlign:= ::aField[ n,06 ] endif else nHeadAlign:= AL_LEFT nDataAlign:= AL_LEFT endif else nHeadAlign:= AL_LEFT nDataAlign:= AL_LEFT endif else oCol := ::oBrw:aCols[n] oCol:Cargo:= ::aField[n,01] if LEN( ::aField[n] ) > 5 if ::aField[ n,06 ] # Nil if VALTYPE( ::aField[ n,06] ) == "A" xTitle:= ::aField[ n,06] if VALTYPE( ::aField[ n,01] ) == "A" nHeadAlign:= xTitle[ 01 ] else nHeadAlign:= xTitle[ 01 ] endif else nHeadAlign:= AL_LEFT endif else nHeadAlign:= AL_LEFT endif else nHeadAlign:= AL_LEFT endif/* cPicture := oCol:cEditPicture nSize := oCol:nWidth nHeadAlign:= oCol:nHeadStrAlign nDataAlign:= oCol:nDataStrAlign*/ endif WITH OBJECT oCol if nDataAlign # NIL :nHeadStrAlign:= nHeadAlign :nDataStrAlign:= nDataAlign :cEditPicture := cPicture :nWidth := nSize else :nHeadStrAlign:= nHeadAlign endif if VALTYPE( ::aField[n,01] ) == "A" AEval( ::aField[n,01], { |cBmp| :AddResource(cBmp) }, 2 ) :bBmpData := SetBmpData( ::oBrw, oCol:Cargo ) :bStrData := { || "" } cOrder:= "" else cOrder:= ::aField[ n,01 ] endif if LEN( ::aField[n] ) > 6 .AND. LEN(::aField[n])#10 :nFooterType:= AGGR_TOTAL endif if LEN( ::aField[n] ) == 10 :cTooltip:= ::aField[ n,10 ] endif IF !EMPTY( cOrder ) :cSortOrder:= cOrder endif END NEXT#else REDEFINE XBROWSE ::oBrw ; ID 4001 ; OF ::oDlg ; DATASOURCE ::oSql#endif WITH OBJECT ::oBrw if ::nIdent == ABMArticulos :bClrStd:= { || If( ::oSql:oferta==1, { CLR_BLACK, CLR_OFERTA }, If( ::oSql:apedido==1, { CLR_BLACK, CLR_HGREEN }, { CLR_BLACK, GetSysColor( COLOR_WINDOW )} )) } endif :nMarqueeStyle := MARQSTYLE_HIGHLWIN7 :lMultiSelect := .f. END WITH ::lRedefine:= .f. endif ACTIVATE DIALOG ::oDlg ; ON INIT ( this:body(), this:elxbrowse(),; .F. ) ; VALID this:lExit else DEFINE WINDOW ::oDlg MDICHILD; FROM 0, 0 TO 400, 800 PIXEL ; TITLE ::cTitle COLOR ::nFrontColor, ::nBackColor ; ICON ::oWnd:oIcon ; OF ::oWnd ::hLays["MAIN"] = TLayout():new( ::oDlg ) ::hLays["H1"] = ::hLays["MAIN"]:addHLayout(240) ::hLays["H2"] = ::hLays["MAIN"]:addHLayout() ::body() // TASKPANEL A.Reyes ::elxbrowse() ::oDlg:bGotFocus:= { || ::oDlg:Maximize() } ACTIVATE WINDOW ::oDlg MAXIMIZED ; ON INIT if(this:lLanzoQuery,this:Lanzar(),) ; VALID this:lExit endifRETURN NIL/* ::lModal: .T.-> Dialog, .f. -> WndChild ::aFields:= 1. Field/Array({field,bmp1,bmp2,etc}) 2. Text Header 3. sin uso 4. nWidth 5. Picture 6. Numeric/Array, if is Numeric :nDataStrAlign, is Array Pos[1]:nHeadStrAlign, Pos[2]: nDataStrAlign 7. sin uso 8. sin uso 9. sin uso 10. Tooltip Ej.: { { {"field","bmp1","bmp2","bmp3"},' ',, 30,, AL_CENTER,,,, 'Producto en Oferta' },; { 'codart', 'Codigo',, 90 },; { 'cArticulo', "Descripcion",, ii },; { {"moneda","flag_peso","flag_eeuu","flag_euro"}, " ",, 30,, AL_CENTER },; { 'precos', "Costo",, 75, oApp:PrecioPict, {AL_CENTER,AL_RIGHT} },; { 'stock', "Stock",, 90,, {AL_CENTER,AL_RIGHT} },; { 'cProveedor', "Proveedor",,150 },; { 'cRubro', "Rubro",,150 } }*/static function elxbrowse( LOCAL oWnd := if(::lModal,::oTaskPanel:oWnd,if(::lSplitter,::oPanel,::oDlg)), oDlg IF !( ::lModal ) ::hLays["H2"]:addVLayout() endif if ( ::lRedefine ) ::oBrw:= TXBrowse():new( if(::lModal,oWnd,::hLays["H2"]:aVLayout[nPag]) ) endif lAddCol:= !::lModal WITH OBJECT ::oBrw :SetDolphin( ::oSql, lAddCol, .t., ::aField, {| xField, oBrw | ::SetDolphin( xField, oBrw ) } ) :l2007 := .t. if ::nIdent == ABMArticulos :bClrStd:= { || If( ::oSql:oferta==1, { CLR_BLACK, CLR_OFERTA }, If( ::oSql:apedido==1, { CLR_BLACK, CLR_HGREEN }, { CLR_BLACK, GetSysColor( COLOR_WINDOW )} )) } endif if ( ::lStrech ) ADD oCol TO ::oBrw HEADER " " oCol:bStrData:= { || " " } :nStretchCol := STRETCHCOL_LAST endif :lHScroll := .t. :lVScroll := .t. :lAllowColSwapping := .t. // !( ::lModal ) :lRecordSelector := .f. :lAllowRowSizing := .f. :lFooter := ::lFooter :nFreeze := ::nFreeze :nMarqueeStyle := MARQSTYLE_HIGHLWIN7 :lMultiSelect := .f. :nColDividerStyle := LINESTYLE_INSET if ::aGHead # NIL :nHeaderLines:= 2 FOR EACH xItem IN ::aGHead :SetGroupHeader( xItem[1], xItem[2], xItem[3] ) NEXT elseif nGroupIni+nGroupFin # 0 :nHeaderLines:= 2 :SetGroupHeader( cGroupTxt, nGroupIni, nGroupFin ) endif if ( ::lFooter ) :MakeTotals() endif :bLDblClick := {|| ::pulsekey( VK_RETURN )} :bKeyDown := {|nKey| ::pulsekey( nKey )} if ( ::lRedefine ) :CreateFromCode() else :Refresh() endif END AEval( ::oBrw:aCols, { |o| o:bLClickHeader := { |r,c,f,oCol| if(::nident==EmisionChequesPropios, ::ReOrdeno( oCol:cHeader ),) } } ) if !( ::lModal ) ::hLays["H2"]:aVLayout[if(nPag==1,1,2)]:oClient:= ::oBrw nPag++ endif if ( ::lModal ) .AND. ::nTypeAbm == 0 oWnd:oLeft := ::oTaskPanel oWnd:oClient:= ::oBrw oWnd:Resize() endifRETURN NIL////----------------------------------------------------------------------------//METHOD SetDolphin( xfield, oBrw, lSeek, lView ) CLASS TWGrid Local oSelf:= Self local aLast:= {}, aItem:= {} local oCol, cCol, cHeader, xTitle, cOrder DEFAULT lSeek:= .f.,; lView:= .f. IF xfield # NIL // aField if xfield[1] # NIL if VALTYPE( xfield[1] ) == "A" cCol := xfield[1,1] cOrder:= "" else cCol := xfield[ 1 ] cOrder := xfield[ 1 ] endif cHeader := xfield[ 2 ] oCol:= oBrw:SetColFromMySQL( cCol, cHeader, .t. ) if VALTYPE( xfield[1] ) == "A" AEval( xfield[1], { |cBmp| oCol:AddResource(cBmp) }, 2 ) oCol:bBmpData := SetBmpData( oBrw, cCol ) oCol:bStrData := { || "" } endif oCol:nWidth:= xfield[ 4 ] if LEN( xfield ) > 4 oCol:cEditPicture:= xfield[ 5 ] endif if LEN( xfield ) > 5 if xfield[ 6 ] # NIL if VALTYPE( xfield[6] ) == "A" xTitle:= xfield[6] if VALTYPE( xfield[1] ) == "A" oCol:nHeadStrAlign:= xTitle[ 1 ] else oCol:nHeadStrAlign:= xTitle[ 1 ] oCol:nDataStrAlign:= xTitle[ 2 ] endif else oCol:nDataStrAlign:= xfield[ 6 ] endif endif if LEN( xfield ) > 6 .AND. LEN(xfield)#10 oCol:nFooterType:= AGGR_TOTAL endif if LEN( xfield ) == 10 oCol:cTooltip:= xfield[ 10 ] endif IF !EMPTY( cOrder ) oCol:cSortOrder := cOrder endif endif else ADD oCol TO oBrw HEADER " " oCol:bStrData:= { || " " } endif else cCol := xfield[ MYSQL_FS_NAME ] cHeader := xfield[ MYSQL_FS_NAME ] oCol = SetColFromMySQL( cCol, cHeader, ::oSql, oBrw ) oCol:bLClickHeader:= Build_CodeBlock_Order( oSelf:oSql ) endifRETURN NIL//--------------------------------------------------------------------------------------------------------------------------------------------------------//function SetBmpData( oBrw, cCol )return {|| oBrw:oMySql:FieldGet( cCol ) }//----------------------------------------------------------------------------//FUNCTION Build_CodeBlock_Order( oQry )RETURN {| nMRow, nMCol, nFlags, oCol | SetOrderDolphin( oCol, oQry ) }//--------------------------------------//FUNCTION SetColFromMySQL( cnCol, cHeader, oQry , oBrw ) LOCAL nType, cType, nLen, nDec, cName LOCAL oCol, nCol IF ValType( cnCol ) == "C" nCol := oQry:FieldPos( cnCol ) ENDIF cName := oQry:FieldName( nCol ) DEFAULT ; nCol := cnCol oCol := oBrw:AddCol() oCol:cHeader := cHeader cType := oQry:FieldType( nCol ) nLen := 0 nDec := 0 DO CASE CASE cType == 'N' nLen := oQry:FieldLen( nCol ) nDec := oQry:FieldDec( nCol ) oCol:cEditPicture := NumPict( nLen, nDec, .F., .f. ) CASE cType == 'C' nLen := MIN( 100, oQry:FieldLen( nCol ) ) CASE cType == 'M' nLen := MIN( 100, Len(AllTrim(oQry:FieldGet( nCol ))) ) nLen := IF(nLen < 30, 30, nLen ) CASE cType == 'D' oCol:nHeadStrAlign := 2 oCol:nDataStrAlign := 0 CASE cType == NIL oCol:bEditValue := { || "..." } OTHERWISE // just in case. this will not be executed oCol:bEditValue := { || "..." } ENDCASE oCol:bEditValue := { || oQry:FieldGet( nCol ) } oCol:cDataType := If( cType == nil, 'C', cType ) oCol:bOnPostEdit := { |o,x,n| If( n == VK_RETURN, oBrw:onedit( o, x, n, cType, nCol ), NIL ) }RETURN oCol
Saludos.
- nageswaragunupudi
- Posts: 10733
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 11 times
- Contact:
Re: Error GRAVE en xbrowse 18.05
Mr. Ariel
So you are using a class derived from XBrowse.
Right?
We made some changes to all Set... methods and they are all working correctly (to the extent we tested), including SetDolphin() and retain full backward compatibility.
Your xGrid class overrides parent class's method SetDolphin(). So any changes made to method SetDolphin() in the parent class should not affect your program. Am I right? Please let me know.
I request you to please check the changes in xbrowse and see the compatibility of your inherited class with the parent class. You may feel free to ask us for any clarification or explanation.
So you are using a class derived from XBrowse.
Right?
We made some changes to all Set... methods and they are all working correctly (to the extent we tested), including SetDolphin() and retain full backward compatibility.
Your xGrid class overrides parent class's method SetDolphin(). So any changes made to method SetDolphin() in the parent class should not affect your program. Am I right? Please let me know.
I request you to please check the changes in xbrowse and see the compatibility of your inherited class with the parent class. You may feel free to ask us for any clarification or explanation.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India