2007-11-23 10:22 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/contrib/gtwvg/wvtutils.c
  * harbour/contrib/gtwvg/wvtcore.c
    * use lstrlen( text ) instead of strlen( hb_parc( 2 ) )
    * removed dummy casting
This commit is contained in:
Przemyslaw Czerpak
2007-11-23 09:22:22 +00:00
parent 3aa7a90209
commit 94cb1bb010
3 changed files with 26 additions and 20 deletions

View File

@@ -8,6 +8,12 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-11-23 10:22 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/gtwvg/wvtutils.c
* harbour/contrib/gtwvg/wvtcore.c
* use lstrlen( text ) instead of strlen( hb_parc( 2 ) )
* removed dummy casting
2007-11-23 09:47 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/common/hbwince.c
+ added dummy Arc(), FrameRect(), FloodFill() for WinCE builds

View File

@@ -893,7 +893,7 @@ HB_FUNC( WVT_DRAWLABEL )
hOldFont = ( HFONT ) SelectObject( _s->hdc, hFont );
//ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, hb_parcx( 3 ), strlen( hb_parcx( 3 ) ), NULL );
ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, text, strlen( hb_parcx( 3 ) ), NULL );
ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL );
SelectObject( _s->hdc, hOldFont );
@@ -905,7 +905,7 @@ HB_FUNC( WVT_DRAWLABEL )
hOldFontGui = ( HFONT ) SelectObject( _s->hGuiDC, hFont );
//ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, hb_parcx( 3 ), strlen( hb_parcx( 3 ) ), NULL );
ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, text, strlen( hb_parcx( 3 ) ), NULL );
ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL );
SelectObject( _s->hGuiDC, hOldFontGui );
}
HB_TCHAR_FREE( text );
@@ -1470,10 +1470,10 @@ HB_FUNC( WVT_DRAWBUTTON )
{
LPTSTR text = HB_TCHAR_CONVTO( hb_parc( 5 ) );
( HFONT ) SelectObject( _s->hdc, GetStockObject( DEFAULT_GUI_FONT ) );
SelectObject( _s->hdc, GetStockObject( DEFAULT_GUI_FONT ) );
//GetTextExtentPoint32( _s->hdc, hb_parcx( 5 ), strlen( hb_parcx( 5 ) ), &sz );
GetTextExtentPoint32( _s->hdc, text, strlen( hb_parcx( 5 ) ), &sz );
GetTextExtentPoint32( _s->hdc, text, lstrlen( text ), &sz );
// iTextWidth = sz.cx;
iTextHeight = sz.cy;
@@ -1502,7 +1502,7 @@ HB_FUNC( WVT_DRAWBUTTON )
SetTextColor( _s->hdc, textColor );
//ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, hb_parcx( 5 ), strlen( hb_parcx( 5 ) ), NULL );
ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, text, strlen( hb_parcx( 5 ) ), NULL );
ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL );
if ( _s->bGui )
{
SelectObject( _s->hGuiDC, GetStockObject( DEFAULT_GUI_FONT ) );
@@ -1511,7 +1511,7 @@ HB_FUNC( WVT_DRAWBUTTON )
SetTextColor( _s->hGuiDC, textColor );
//ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, hb_parcx( 5 ), strlen( hb_parcx( 5 ) ), NULL );
ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, text, strlen( hb_parcx( 5 ) ), NULL );
ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL );
}
HB_TCHAR_FREE( text );
}
@@ -1653,19 +1653,19 @@ HB_FUNC( WVT_DRAWLABELEX )
SetBkColor( _s->hdc, ISNIL( 6 ) ? _s->background : ( COLORREF ) hb_parnl( 6 ) );
SetTextColor( _s->hdc, ISNIL( 5 ) ? _s->foreground : ( COLORREF ) hb_parnl( 5 ) );
SetTextAlign( _s->hdc, ( ISNIL( 4 ) ? TA_LEFT : hb_parni( 4 ) ) );
( HFONT ) SelectObject( _s->hdc, _s->hUserFonts[ iSlot ] );
SelectObject( _s->hdc, _s->hUserFonts[ iSlot ] );
//ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, hb_parcx( 3 ), strlen( hb_parcx( 3 ) ), NULL );
ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, text, strlen( hb_parcx( 3 ) ), NULL );
ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL );
if ( _s->bGui )
{
SetBkColor( _s->hGuiDC, ISNIL( 6 ) ? _s->background : ( COLORREF ) hb_parnl( 6 ) );
SetTextColor( _s->hGuiDC, ISNIL( 5 ) ? _s->foreground : ( COLORREF ) hb_parnl( 5 ) );
SetTextAlign( _s->hGuiDC, ( ISNIL( 4 ) ? TA_LEFT : hb_parni( 4 ) ) );
( HFONT ) SelectObject( _s->hGuiDC, _s->hUserFonts[ iSlot ] );
SelectObject( _s->hGuiDC, _s->hUserFonts[ iSlot ] );
//ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, hb_parcx( 3 ), strlen( hb_parcx( 3 ) ), NULL );
ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, text, strlen( hb_parcx( 3 ) ), NULL );
ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL );
}
HB_TCHAR_FREE( text );
hb_retl( TRUE );
@@ -2194,10 +2194,10 @@ HB_FUNC( WVT_DRAWLABELOBJ )
SetTextColor( _s->hdc, ISNIL( 8 ) ? _s->foreground : ( COLORREF ) hb_parnl( 8 ) );
SetBkColor( _s->hdc, ISNIL( 9 ) ? _s->background : ( COLORREF ) hb_parnl( 9 ) );
( HFONT ) SelectObject( _s->hdc, ( HFONT ) hb_parnl( 10 ) );
SelectObject( _s->hdc, ( HFONT ) hb_parnl( 10 ) );
//GetTextExtentPoint32( _s->hdc, hb_parcx( 5 ), strlen( hb_parcx( 5 ) ), &sz );
GetTextExtentPoint32( _s->hdc, text, strlen( hb_parcx( 5 ) ), &sz );
GetTextExtentPoint32( _s->hdc, text, lstrlen( text ), &sz );
x = iLeft;
y = iTop;
@@ -2247,16 +2247,16 @@ HB_FUNC( WVT_DRAWLABELOBJ )
// Ground is Ready, Draw Text
//
//ExtTextOut( _s->hdc, x, y, uiOptions, &rect, hb_parcx( 5 ), strlen( hb_parcx( 5 ) ), NULL );
ExtTextOut( _s->hdc, x, y, uiOptions, &rect, text, strlen( hb_parcx( 5 ) ), NULL );
ExtTextOut( _s->hdc, x, y, uiOptions, &rect, text, lstrlen( text ), NULL );
if ( _s->bGui )
{
SetTextColor( _s->hGuiDC, ISNIL( 8 ) ? _s->foreground : ( COLORREF ) hb_parnl( 8 ) );
SetBkColor( _s->hGuiDC, ISNIL( 9 ) ? _s->background : ( COLORREF ) hb_parnl( 9 ) );
( HFONT ) SelectObject( _s->hGuiDC, ( HFONT ) hb_parnl( 10 ) );
SelectObject( _s->hGuiDC, ( HFONT ) hb_parnl( 10 ) );
SetTextAlign( _s->hGuiDC, iAlignH | iAlignV );
//ExtTextOut( _s->hGuiDC, x, y, uiOptions, &rect, hb_parcx( 5 ), strlen( hb_parcx( 5 ) ), NULL );
ExtTextOut( _s->hGuiDC, x, y, uiOptions, &rect, text, strlen( hb_parcx( 5 ) ), NULL );
ExtTextOut( _s->hGuiDC, x, y, uiOptions, &rect, text, lstrlen( text ), NULL );
}
HB_TCHAR_FREE( text );
hb_retl( TRUE );
@@ -2605,20 +2605,20 @@ HB_FUNC( WVT_DRAWTEXTBOX )
SetTextColor( _s->hdc, ISNIL( 9 ) ? _s->foreground : ( COLORREF ) hb_parnl( 9 ) );
SetBkColor( _s->hdc, ISNIL( 10 ) ? _s->background : ( COLORREF ) hb_parnl( 10 ) );
SetBkMode( _s->hdc, ISNIL( 11 ) ? OPAQUE : hb_parni( 11 ) );
( HFONT ) SelectObject( _s->hdc, ( HFONT ) hb_parnl( 12 ) );
SelectObject( _s->hdc, ( HFONT ) hb_parnl( 12 ) );
//DrawText( _s->hdc, hb_parcx( 6 ), strlen( hb_parcx( 6 ) ), &rc, iAlignH | DT_WORDBREAK | DT_TOP );
DrawText( _s->hdc, text, strlen( hb_parcx( 6 ) ), &rc, iAlignH | DT_WORDBREAK | DT_TOP );
DrawText( _s->hdc, text, lstrlen( text ), &rc, iAlignH | DT_WORDBREAK | DT_TOP );
if ( _s->bGui )
{
SetTextAlign( _s->hGuiDC, TA_TOP | TA_LEFT | TA_NOUPDATECP );
SetTextColor( _s->hGuiDC, ISNIL( 9 ) ? _s->foreground : ( COLORREF ) hb_parnl( 9 ) );
SetBkColor( _s->hGuiDC, ISNIL( 10 ) ? _s->background : ( COLORREF ) hb_parnl( 10 ) );
SetBkMode( _s->hGuiDC, ISNIL( 11 ) ? OPAQUE : hb_parni( 11 ) );
( HFONT ) SelectObject( _s->hGuiDC, ( HFONT ) hb_parnl( 12 ) );
SelectObject( _s->hGuiDC, ( HFONT ) hb_parnl( 12 ) );
//DrawText( _s->hGuiDC, hb_parcx( 6 ), strlen( hb_parcx( 6 ) ), &rc, iAlignH | DT_WORDBREAK | DT_TOP );
DrawText( _s->hGuiDC, text, strlen( hb_parc( 6 ) ), &rc, iAlignH | DT_WORDBREAK | DT_TOP );
DrawText( _s->hGuiDC, text, lstrlen( text ), &rc, iAlignH | DT_WORDBREAK | DT_TOP );
}
HB_TCHAR_FREE( text );
}

View File

@@ -2057,7 +2057,7 @@ HB_FUNC( WIN_DRAWTEXT )
rc.right = hb_parni( 3,3 );
rc.bottom = hb_parni( 3,4 );
hb_retl( DrawText( ( HDC ) hb_parnl( 1 ), lpBuffer, strlen( hb_parc( 2 ) ), &rc, hb_parni( 4 ) ) );
hb_retl( DrawText( ( HDC ) hb_parnl( 1 ), lpBuffer, lstrlen( lpBuffer ), &rc, hb_parni( 4 ) ) );
HB_TCHAR_FREE( lpBuffer );
}