HMG Graph based on Bos Taurus
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG Graph based on Bos Taurus
Thank you for the tip Grigory Filatov. Now I will check that up!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG Graph based on Bos Taurus
Yep! With Grigory's fix, the problem is gone!
Thank you Grigory.
Claudio, can you please leave a patch?
Thank you Grigory.
Claudio, can you please leave a patch?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: HMG Graph based on Bos Taurus
Hi Rathi,Rathinagiri wrote:Yep! With Grigory's fix, the problem is gone!
Thank you Grigory.
You are welcome.
FYI I've fixed the others memory leaks in the C-functions of BosTaurus library also.
It will be available at a next MiniguiEx build
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG Graph based on Bos Taurus
Thanks Grigory !gfilatov wrote:Hi Marek,mol wrote:What I need to change? Sources of Bos Taurus?
Yes, it is.
For example, there is the missed cleaning of hBrush variable in the C-function BT_DRAW_HDC_POLY
This function should be fixed as below
Please take a look for the needed additional stringsCode: Select all
HB_FUNC( BT_DRAW_HDC_POLY ) { HDC hDC; HPEN hPen; HBRUSH hBrush; HPEN OldPen; HBRUSH OldBrush; INT nCountX, nCountY; COLORREF ColorLine, ColorFill; INT nWidthLine, nLen; INT nPOLY, i; #ifndef __MINGW_H POINT aPoint [2048]; #endif hDC = (HDC) HB_PARNL (1); nCountX = (INT) hb_parinfa(2,0); nCountY = (INT) hb_parinfa(3,0); ColorLine = (COLORREF) hb_parnl (4); nWidthLine = (INT) hb_parni (5); ColorFill = (COLORREF) hb_parnl (6); nPOLY = (INT) hb_parni (7); nLen = min( nCountX, nCountY ); if ( nLen > 0 ) { #ifdef __MINGW_H POINT aPoint[ nLen ]; #endif for ( i=0; i < nLen; i++ ) { aPoint[ i ].x = hb_parvni ( 2, i + 1 ); aPoint[ i ].y = hb_parvni ( 3, i + 1 ); } SaveDC(hDC); hPen = CreatePen(PS_SOLID, nWidthLine, ColorLine); OldPen = ( HPEN ) SelectObject(hDC, hPen); hBrush = CreateSolidBrush( ColorFill ); OldBrush = ( HBRUSH ) SelectObject(hDC, hBrush); switch( nPOLY ) { case BT_DRAW_POLYLINE: Polyline( hDC, aPoint, nLen ); break; case BT_DRAW_POLYGON: Polygon( hDC, aPoint, nLen ); break; case BT_DRAW_POLYBEZIER: PolyBezier( hDC, aPoint, nLen ); break; } SelectObject( hDC, OldBrush ); DeleteObject(hBrush); SelectObject( hDC, OldPen ); DeleteObject(hPen); RestoreDC(hDC, -1); hb_retl( TRUE ); } else hb_retl( FALSE ); }
There are a similar bugs with the missed SelectObject calling in the others functions also.SelectObject( hDC, OldBrush );
...
SelectObject( hDC, OldPen );
Hope that helps
Re: HMG Graph based on Bos Taurus
It's working good now, I think. But, I'm still trying
Many thanks, Grigorij for your help!
Many thanks, Grigorij for your help!