From 4b183345600974bc2a1e683a99c87875e94fd15b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 21 Jan 2011 15:47:47 +0000 Subject: [PATCH] 2011-01-21 16:47 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * config/hb_c.cfg * Changed to align assignments. ! Fixed to align case statments like it's done in Harbour. * contrib/gtwvg/wvgcuig.c * contrib/gtwvg/wvgwin.c * contrib/gtwvg/wvgutils.c * contrib/gtwvg/wvgcore.c * contrib/gtwvg/wvgwing.c * Reformatted with uncrustify. Results are fantastic with this tool. --- harbour/ChangeLog | 13 + harbour/config/hb_c.cfg | 4 +- harbour/contrib/gtwvg/wvgcore.c | 1834 +++++++++++++++--------------- harbour/contrib/gtwvg/wvgcuig.c | 1314 ++++++++++----------- harbour/contrib/gtwvg/wvgutils.c | 602 +++++----- harbour/contrib/gtwvg/wvgwin.c | 412 +++---- harbour/contrib/gtwvg/wvgwing.c | 618 +++++----- 7 files changed, 2397 insertions(+), 2400 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6a25e0d38d..9e98f0b063 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,19 @@ The license applies to all entries newer than 2009-04-28. */ +2011-01-21 16:47 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * config/hb_c.cfg + * Changed to align assignments. + ! Fixed to align case statments like it's done in Harbour. + + * contrib/gtwvg/wvgcuig.c + * contrib/gtwvg/wvgwin.c + * contrib/gtwvg/wvgutils.c + * contrib/gtwvg/wvgcore.c + * contrib/gtwvg/wvgwing.c + * Reformatted with uncrustify. + Results are fantastic with this tool. + 2011-01-21 16:31 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) - contrib/hbunix/hbposix.hbp + contrib/hbunix/hbunix.hbp diff --git a/harbour/config/hb_c.cfg b/harbour/config/hb_c.cfg index 09fe2d61e8..f1003f9256 100644 --- a/harbour/config/hb_c.cfg +++ b/harbour/config/hb_c.cfg @@ -15,7 +15,7 @@ align_on_tabstop = TRUE # align on tabstops input_tab_size = 8 # original tab size output_tab_size = 3 # new tab size indent_columns = output_tab_size - +indent_switch_case = indent_columns indent_label = 2 # pos: absolute col, neg: relative column @@ -558,7 +558,7 @@ align_var_def_span = 3 # align_var_def_inline = TRUE # align_var_def_star = FALSE # align_var_def_colon = TRUE -# align_assign_span = 1 +align_assign_span = 3 align_struct_init_span = 3 # align stuff in a structure init '= { }' align_right_cmt_span = 3 align_pp_define_span = 8; diff --git a/harbour/contrib/gtwvg/wvgcore.c b/harbour/contrib/gtwvg/wvgcore.c index 96058c0a48..03814564f2 100644 --- a/harbour/contrib/gtwvg/wvgcore.c +++ b/harbour/contrib/gtwvg/wvgcore.c @@ -115,8 +115,8 @@ void hb_wvt_GetStringAttrib( int top, int left, int bottom, int right, HB_BYTE * if( hb_gtGetScrChar( irow, icol, &iColor, &bAttr, &usChar ) == HB_FAILURE ) break; - sBuffer[ j ] = ( HB_BYTE ) usChar; - sAttrib[ j ] = ( HB_BYTE ) iColor; + sBuffer[ j ] = ( HB_BYTE ) usChar; + sAttrib[ j ] = ( HB_BYTE ) iColor; j++; } } @@ -150,10 +150,10 @@ void hb_wvt_PutStringAttrib( int top, int left, int bottom, int right, HB_BYTE * #if ! defined( HB_OS_WIN_CE ) IPicture * hb_wvt_gtLoadPictureFromResource( LPCSTR cResource, LPCSTR cSection ) { - HRSRC res = 0; - LPVOID iPicture = NULL; - LPTSTR resource = HB_TCHAR_CONVTO( ( LPSTR ) cResource ); - LPTSTR section = HB_TCHAR_CONVTO( ( LPSTR ) cSection ); + HRSRC res = 0; + LPVOID iPicture = NULL; + LPTSTR resource = HB_TCHAR_CONVTO( ( LPSTR ) cResource ); + LPTSTR section = HB_TCHAR_CONVTO( ( LPSTR ) cSection ); HANDLE hInstance; if( hb_winmainArgGet( &hInstance, NULL, NULL ) ) @@ -161,12 +161,12 @@ IPicture * hb_wvt_gtLoadPictureFromResource( LPCSTR cResource, LPCSTR cSection ) if( res ) { - IStream * iStream = NULL; - HGLOBAL mem = LoadResource( GetModuleHandle( NULL ), res ); - void * data = LockResource( mem ); - LONG nFileSize = ( LONG ) SizeofResource( GetModuleHandle( NULL ), res ); - HGLOBAL hGlobal = GlobalAlloc( GMEM_MOVEABLE, nFileSize ); - LPVOID pvData = GlobalLock( hGlobal ); + IStream * iStream = NULL; + HGLOBAL mem = LoadResource( GetModuleHandle( NULL ), res ); + void * data = LockResource( mem ); + LONG nFileSize = ( LONG ) SizeofResource( GetModuleHandle( NULL ), res ); + HGLOBAL hGlobal = GlobalAlloc( GMEM_MOVEABLE, nFileSize ); + LPVOID pvData = GlobalLock( hGlobal ); memcpy( pvData, data, nFileSize ); @@ -232,12 +232,12 @@ HB_BOOL hb_wvt_gtRenderPicture( int x1, int y1, int wd, int ht, IPicture * iPict LONG lWidth, lHeight; int x, y, xe, ye; - int c = x1; - int r = y1; - int dc = wd; - int dr = ht; - int tor = 0; - int toc = 0; + int c = x1; + int r = y1; + int dc = wd; + int dr = ht; + int tor = 0; + int toc = 0; HRGN hrgn1; POINT lpp; HB_BOOL bResult = HB_FALSE; @@ -263,10 +263,10 @@ HB_BOOL hb_wvt_gtRenderPicture( int x1, int y1, int wd, int ht, IPicture * iPict { toc = dc; } - x = c; - y = r; - xe = c + toc - 1; - ye = r + tor - 1; + x = c; + y = r; + xe = c + toc - 1; + ye = r + tor - 1; GetViewportOrgEx( _s->hdc, &lpp ); @@ -280,8 +280,8 @@ HB_BOOL hb_wvt_gtRenderPicture( int x1, int y1, int wd, int ht, IPicture * iPict HB_VTBL( iPicture )->Render( HB_THIS_( iPicture ) _s->hdc, x, y, dc, dr, 0, lHeight, lWidth, -lHeight, NULL ); y += dr; } - y = r; - x += dc; + y = r; + x += dc; } SelectClipRgn( _s->hdc, NULL ); @@ -289,10 +289,10 @@ HB_BOOL hb_wvt_gtRenderPicture( int x1, int y1, int wd, int ht, IPicture * iPict if( _s->bGui ) { - x = c; - y = r; - xe = c + toc - 1; - ye = r + tor - 1; + x = c; + y = r; + xe = c + toc - 1; + ye = r + tor - 1; GetViewportOrgEx( _s->hGuiDC, &lpp ); @@ -306,8 +306,8 @@ HB_BOOL hb_wvt_gtRenderPicture( int x1, int y1, int wd, int ht, IPicture * iPict HB_VTBL( iPicture )->Render( HB_THIS_( iPicture ) _s->hGuiDC, x, y, dc, dr, 0, lHeight, lWidth, -lHeight, NULL ); y += dr; } - y = r; - x += dc; + y = r; + x += dc; } SelectClipRgn( _s->hGuiDC, NULL ); @@ -357,11 +357,11 @@ POINT hb_wvt_gtGetXYFromColRow( int col, int row ) BOOL CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); int iIndex, iType; long int lReturn = 0; - PHB_ITEM pFunc = NULL; + PHB_ITEM pFunc = NULL; iType = 0; @@ -371,8 +371,8 @@ BOOL CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPA { if( _s->pFunc[ iIndex ] != NULL ) { - pFunc = _s->pFunc[ iIndex ]; - iType = _s->iType[ iIndex ]; + pFunc = _s->pFunc[ iIndex ]; + iType = _s->iType[ iIndex ]; } break; } @@ -382,81 +382,81 @@ BOOL CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPA { switch( iType ) { - case 1: /* Function Name */ - if( hb_vmRequestReenter() ) - { - hb_vmPushDynSym( ( PHB_DYNS ) pFunc ); - hb_vmPushNil(); - hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); - hb_vmPushNumInt( message ); - hb_vmPushNumInt( wParam ); - hb_vmPushNumInt( lParam ); - hb_vmDo( 4 ); - lReturn = hb_parnl( -1 ); - hb_vmRequestRestore(); - } - break; - - case 2: /* Block */ - /* eval the codeblock */ - if( HB_IS_BLOCK( pFunc ) ) - { + case 1: /* Function Name */ if( hb_vmRequestReenter() ) { - hb_vmPushEvalSym(); - hb_vmPush( _s->pFunc[ iIndex ] ); + hb_vmPushDynSym( ( PHB_DYNS ) pFunc ); + hb_vmPushNil(); hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); hb_vmPushNumInt( message ); hb_vmPushNumInt( wParam ); hb_vmPushNumInt( lParam ); - hb_vmSend( 4 ); + hb_vmDo( 4 ); lReturn = hb_parnl( -1 ); hb_vmRequestRestore(); } - } - else - { - /* TODO: internal error: missing codeblock */ - } - break; + break; + + case 2: /* Block */ + /* eval the codeblock */ + if( HB_IS_BLOCK( pFunc ) ) + { + if( hb_vmRequestReenter() ) + { + hb_vmPushEvalSym(); + hb_vmPush( _s->pFunc[ iIndex ] ); + hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); + hb_vmPushNumInt( message ); + hb_vmPushNumInt( wParam ); + hb_vmPushNumInt( lParam ); + hb_vmSend( 4 ); + lReturn = hb_parnl( -1 ); + hb_vmRequestRestore(); + } + } + else + { + /* TODO: internal error: missing codeblock */ + } + break; } } switch( message ) { - case WM_COMMAND: - switch( LOWORD( wParam ) ) - { - case IDOK: - DestroyWindow( hDlg ); - lReturn = 1; + case WM_COMMAND: + switch( LOWORD( wParam ) ) + { + case IDOK: + DestroyWindow( hDlg ); + lReturn = 1; + break; + + case IDCANCEL: + DestroyWindow( hDlg ); + lReturn = 0; + break; + } break; - case IDCANCEL: + case WM_CLOSE: DestroyWindow( hDlg ); lReturn = 0; break; - } - break; - - case WM_CLOSE: - DestroyWindow( hDlg ); - lReturn = 0; - break; #if ! defined( HB_OS_WIN_CE ) - case WM_NCDESTROY: + case WM_NCDESTROY: #else - case WM_DESTROY: + case WM_DESTROY: #endif - if( _s->pFunc[ iIndex ] != NULL && _s->iType[ iIndex ] == 2 ) - { - hb_itemRelease( ( PHB_ITEM ) _s->pFunc[ iIndex ] ); - } - _s->hDlgModeless[ iIndex ] = NULL; - _s->pFunc[ iIndex ] = NULL; - _s->iType[ iIndex ] = 0; - lReturn = 0; - break; + if( _s->pFunc[ iIndex ] != NULL && _s->iType[ iIndex ] == 2 ) + { + hb_itemRelease( ( PHB_ITEM ) _s->pFunc[ iIndex ] ); + } + _s->hDlgModeless[ iIndex ] = NULL; + _s->pFunc[ iIndex ] = NULL; + _s->iType[ iIndex ] = 0; + lReturn = 0; + break; } return lReturn; @@ -466,12 +466,12 @@ BOOL CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPA BOOL CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); int iIndex, iType; long int lReturn = 0; - PHB_ITEM pFunc = NULL; - int iFirst = ( int ) lParam; + PHB_ITEM pFunc = NULL; + int iFirst = ( int ) lParam; if( iFirst > 0 && iFirst <= WVT_DLGMD_MAX ) { @@ -488,8 +488,8 @@ BOOL CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPA { if( _s->pFuncModal[ iIndex ] != NULL ) { - pFunc = _s->pFuncModal[ iIndex ]; - iType = _s->iTypeModal[ iIndex ]; + pFunc = _s->pFuncModal[ iIndex ]; + iType = _s->iTypeModal[ iIndex ]; } break; } @@ -499,82 +499,82 @@ BOOL CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPA { switch( iType ) { - case 1: /* Function Name */ - if( hb_vmRequestReenter() ) - { - hb_vmPushDynSym( ( PHB_DYNS ) pFunc ); - hb_vmPushNil(); - hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); - hb_vmPushNumInt( message ); - hb_vmPushNumInt( wParam ); - hb_vmPushNumInt( lParam ); - hb_vmDo( 4 ); - lReturn = hb_parnl( -1 ); - hb_vmRequestRestore(); - } - break; - - case 2: /* Block */ - /* eval the codeblock */ - if( HB_IS_BLOCK( pFunc ) ) - { + case 1: /* Function Name */ if( hb_vmRequestReenter() ) { - hb_vmPushEvalSym(); - hb_vmPush( pFunc ); + hb_vmPushDynSym( ( PHB_DYNS ) pFunc ); + hb_vmPushNil(); hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); hb_vmPushNumInt( message ); hb_vmPushNumInt( wParam ); hb_vmPushNumInt( lParam ); - hb_vmSend( 4 ); + hb_vmDo( 4 ); lReturn = hb_parnl( -1 ); hb_vmRequestRestore(); } - } - else - { - /* TODO: internal error: missing codeblock */ - } - break; + break; + + case 2: /* Block */ + /* eval the codeblock */ + if( HB_IS_BLOCK( pFunc ) ) + { + if( hb_vmRequestReenter() ) + { + hb_vmPushEvalSym(); + hb_vmPush( pFunc ); + hb_vmPushNumInt( ( HB_MAXINT ) ( HB_PTRDIFF ) hDlg ); + hb_vmPushNumInt( message ); + hb_vmPushNumInt( wParam ); + hb_vmPushNumInt( lParam ); + hb_vmSend( 4 ); + lReturn = hb_parnl( -1 ); + hb_vmRequestRestore(); + } + } + else + { + /* TODO: internal error: missing codeblock */ + } + break; } } switch( message ) { - case WM_COMMAND: - switch( LOWORD( wParam ) ) - { - case IDOK: - EndDialog( hDlg, IDOK ); - lReturn = 0; + case WM_COMMAND: + switch( LOWORD( wParam ) ) + { + case IDOK: + EndDialog( hDlg, IDOK ); + lReturn = 0; + break; + + case IDCANCEL: + EndDialog( hDlg, IDCANCEL ); + lReturn = 0; + break; + } break; - case IDCANCEL: + case WM_CLOSE: EndDialog( hDlg, IDCANCEL ); lReturn = 0; break; - } - break; - - case WM_CLOSE: - EndDialog( hDlg, IDCANCEL ); - lReturn = 0; - break; #if ! defined( HB_OS_WIN_CE ) - case WM_NCDESTROY: + case WM_NCDESTROY: #else - case WM_DESTROY: + case WM_DESTROY: #endif - if( _s->pFuncModal[ iIndex ] != NULL && _s->iTypeModal[ iIndex ] == 2 ) - { - hb_itemRelease( ( PHB_ITEM ) _s->pFuncModal[ iIndex ] ); - } - _s->hDlgModal[ iIndex ] = NULL; - _s->pFuncModal[ iIndex ] = NULL; - _s->iTypeModal[ iIndex ] = 0; - lReturn = 0; - break; + if( _s->pFuncModal[ iIndex ] != NULL && _s->iTypeModal[ iIndex ] == 2 ) + { + hb_itemRelease( ( PHB_ITEM ) _s->pFuncModal[ iIndex ] ); + } + _s->hDlgModal[ iIndex ] = NULL; + _s->pFuncModal[ iIndex ] = NULL; + _s->iTypeModal[ iIndex ] = 0; + lReturn = 0; + break; } return lReturn; @@ -591,14 +591,14 @@ HB_BOOL hb_wvt_DrawImage( HDC hdc, int x1, int y1, int wd, int ht, const char * DWORD nReadByte; LONG lWidth, lHeight; int x, y, xe, ye; - int c = x1; - int r = y1; - int dc = wd; - int dr = ht; - int tor = 0; - int toc = 0; + int c = x1; + int r = y1; + int dc = wd; + int dr = ht; + int tor = 0; + int toc = 0; HRGN hrgn1; - POINT lpp = { 0, 0 }; + POINT lpp = { 0, 0 }; HB_BOOL bResult = HB_FALSE; LPTSTR lpImage = HB_TCHAR_CONVTO( image ); @@ -646,10 +646,10 @@ HB_BOOL hb_wvt_DrawImage( HDC hdc, int x1, int y1, int wd, int ht, const char * { toc = dc; } - x = c; - y = r; - xe = c + toc - 1; - ye = r + tor - 1; + x = c; + y = r; + xe = c + toc - 1; + ye = r + tor - 1; GetViewportOrgEx( hdc, &lpp ); @@ -664,8 +664,8 @@ HB_BOOL hb_wvt_DrawImage( HDC hdc, int x1, int y1, int wd, int ht, const char * lHeight, lWidth, -lHeight, NULL ); y += dr; } - y = r; - x += dc; + y = r; + x += dc; } SelectClipRgn( hdc, NULL ); @@ -987,11 +987,11 @@ HB_FUNC( WVT_SETPEN ) hb_retl( HB_FALSE ); } - iPenStyle = hb_parni( 1 ); - iPenWidth = hb_parni( 2 ); - crColor = ( COLORREF ) hb_parnldef( 3, RGB( 0, 0, 0 ) ); + iPenStyle = hb_parni( 1 ); + iPenWidth = hb_parni( 2 ); + crColor = ( COLORREF ) hb_parnldef( 3, RGB( 0, 0, 0 ) ); - hPen = CreatePen( iPenStyle, iPenWidth, crColor ); + hPen = CreatePen( iPenStyle, iPenWidth, crColor ); if( hPen ) { @@ -1015,10 +1015,10 @@ HB_FUNC( WVT_SETPEN ) */ HB_FUNC( WVT_SETBRUSH ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); HBRUSH hBrush; - LOGBRUSH lb = { 0, 0, 0 }; + LOGBRUSH lb = { 0, 0, 0 }; if( ! HB_ISNUM( 1 ) ) { @@ -1029,9 +1029,9 @@ HB_FUNC( WVT_SETBRUSH ) lb.lbColor = ( COLORREF ) hb_parnldef( 2, RGB( 0, 0, 0 ) ); lb.lbHatch = hb_parnl( 3 ); #if ! defined( HB_OS_WIN_CE ) - hBrush = CreateBrushIndirect( &lb ); + hBrush = CreateBrushIndirect( &lb ); #else - hBrush = CreateSolidBrush( lb.lbColor ); + hBrush = CreateSolidBrush( lb.lbColor ); #endif if( hBrush ) { @@ -1055,13 +1055,13 @@ HB_FUNC( WVT_SETBRUSH ) */ HB_FUNC( WVT_DRAWBOXGET ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; - POINT yz = { 0, 0 }; + POINT xy = { 0, 0 }; + POINT yz = { 0, 0 }; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); - yz = hb_wvt_gtGetXYFromColRow( ( hb_parni( 2 ) + hb_parni( 3 ) ), hb_parni( 1 ) + 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); + yz = hb_wvt_gtGetXYFromColRow( ( hb_parni( 2 ) + hb_parni( 3 ) ), hb_parni( 1 ) + 1 ); hb_wvt_DrawBoxGet( _s->hdc, xy.y, xy.x, yz.y, yz.x ); #if defined( __SETGUI__ ) @@ -1078,12 +1078,12 @@ HB_FUNC( WVT_DRAWBOXGET ) */ HB_FUNC( WVT_DRAWBOXRAISED ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); hb_wvt_DrawBoxRaised( _s->hdc, iTop - 1, iLeft - 1, iBottom + 1, iRight + 1 ); #if defined( __SETGUI__ ) @@ -1100,12 +1100,12 @@ HB_FUNC( WVT_DRAWBOXRAISED ) */ HB_FUNC( WVT_DRAWBOXRECESSED ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); hb_wvt_DrawBoxRecessed( _s->hdc, iTop - 1, iLeft - 1, iBottom + 1, iRight + 1 ); #if defined( __SETGUI__ ) @@ -1122,12 +1122,12 @@ HB_FUNC( WVT_DRAWBOXRECESSED ) */ HB_FUNC( WVT_DRAWBOXGROUP ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); hb_wvt_DrawBoxGroup( _s->hdc, iTop, iLeft, iBottom, iRight ); #if defined( __SETGUI__ ) @@ -1144,12 +1144,12 @@ HB_FUNC( WVT_DRAWBOXGROUP ) */ HB_FUNC( WVT_DRAWBOXGROUPRAISED ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); hb_wvt_DrawBoxGroupRaised( _s->hdc, iTop, iLeft, iBottom, iRight ); #if defined( __SETGUI__ ) @@ -1167,18 +1167,18 @@ HB_FUNC( WVT_DRAWBOXGROUPRAISED ) HB_FUNC( WVT_DRAWIMAGE ) { #if ! defined( HB_OS_WIN_CE ) - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; int iLeft, iTop, iRight, iBottom; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); - iTop = xy.y + hb_parvni( 6, 1 ); - iLeft = xy.x + hb_parvni( 6, 2 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); + iTop = xy.y + hb_parvni( 6, 1 ); + iLeft = xy.x + hb_parvni( 6, 2 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); iBottom = xy.y - 1 + hb_parvni( 6, 3 ); - iRight = xy.x - 1 + hb_parvni( 6, 4 ); + iRight = xy.x - 1 + hb_parvni( 6, 4 ); if( HB_ISNUM( 5 ) ) { @@ -1209,25 +1209,25 @@ HB_FUNC( WVT_DRAWIMAGE ) */ HB_FUNC( WVT_DRAWLABEL ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; HFONT hFont, hOldFont, hOldFontGui; LOGFONT logfont; /* = { 0 };*/ - logfont.lfEscapement = hb_parni( 5 ) * 10; - logfont.lfOrientation = 0; - logfont.lfWeight = hb_parni( 11 ); - logfont.lfItalic = ( BYTE ) hb_parl( 14 ); - logfont.lfUnderline = ( BYTE ) hb_parl( 15 ); - logfont.lfStrikeOut = ( BYTE ) hb_parl( 16 ); - logfont.lfCharSet = ( BYTE ) hb_parnidef( 13, _s->CodePage ); - logfont.lfOutPrecision = 0; - logfont.lfClipPrecision = 0; - logfont.lfQuality = ( BYTE ) hb_parnidef( 12, DEFAULT_QUALITY ); - logfont.lfPitchAndFamily = FF_DONTCARE; - logfont.lfHeight = hb_parnidef( 9, _s->fontHeight ); - logfont.lfWidth = hb_parnidef( 10, _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ); + logfont.lfEscapement = hb_parni( 5 ) * 10; + logfont.lfOrientation = 0; + logfont.lfWeight = hb_parni( 11 ); + logfont.lfItalic = ( BYTE ) hb_parl( 14 ); + logfont.lfUnderline = ( BYTE ) hb_parl( 15 ); + logfont.lfStrikeOut = ( BYTE ) hb_parl( 16 ); + logfont.lfCharSet = ( BYTE ) hb_parnidef( 13, _s->CodePage ); + logfont.lfOutPrecision = 0; + logfont.lfClipPrecision = 0; + logfont.lfQuality = ( BYTE ) hb_parnidef( 12, DEFAULT_QUALITY ); + logfont.lfPitchAndFamily = FF_DONTCARE; + logfont.lfHeight = hb_parnidef( 9, _s->fontHeight ); + logfont.lfWidth = hb_parnidef( 10, _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ); HB_TCHAR_COPYTO( logfont.lfFaceName, ( ! HB_ISCHAR( 8 ) ? _s->fontFace : hb_parcx( 8 ) ), HB_SIZEOFARRAY( logfont.lfFaceName ) - 1 ); @@ -1235,13 +1235,13 @@ HB_FUNC( WVT_DRAWLABEL ) hFont = CreateFontIndirect( &logfont ); if( hFont ) { - LPTSTR text = HB_TCHAR_CONVTO( hb_parc( 3 ) ); - COLORREF fgClr = hb_wvt_FgColorParam( 6 ), - bgClr = hb_wvt_BgColorParam( 7 ); + LPTSTR text = HB_TCHAR_CONVTO( hb_parc( 3 ) ); + COLORREF fgClr = hb_wvt_FgColorParam( 6 ), + bgClr = hb_wvt_BgColorParam( 7 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); - xy.x += hb_parvni( 17, 2 ); - xy.y += hb_parvni( 17, 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); + xy.x += hb_parvni( 17, 2 ); + xy.y += hb_parvni( 17, 1 ); SetBkColor( _s->hdc, bgClr ); SetTextColor( _s->hdc, fgClr ); @@ -1277,18 +1277,18 @@ HB_FUNC( WVT_DRAWLABEL ) */ HB_FUNC( WVT_DRAWOUTLINE ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); HPEN hPen, hOldPen, hOldPenGUI; - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; int iTop, iLeft, iBottom, iRight; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; - iTop = xy.y - 1 + hb_parvni( 8, 1 ); - iLeft = xy.x - 1 + hb_parvni( 8, 2 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); - iBottom = xy.y + hb_parvni( 8, 3 ); - iRight = xy.x + hb_parvni( 8, 4 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; + iTop = xy.y - 1 + hb_parvni( 8, 1 ); + iLeft = xy.x - 1 + hb_parvni( 8, 2 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + iBottom = xy.y + hb_parvni( 8, 3 ); + iRight = xy.x + hb_parvni( 8, 4 ); hOldPenGUI = hOldPen = 0; @@ -1339,12 +1339,12 @@ HB_FUNC( WVT_DRAWOUTLINE ) */ HB_FUNC( WVT_DRAWLINE ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 11, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 11, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 11, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 11, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 11, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 11, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 11, 4 ); int iOrient, iFormat, iAlign, iStyle, iThick; int x, y, iOffset; @@ -1354,180 +1354,180 @@ HB_FUNC( WVT_DRAWLINE ) /* Resolve Parameters */ iOrient = hb_parni( 5 ); iFormat = hb_parni( 6 ); - iAlign = hb_parni( 7 ); - iStyle = hb_parni( 8 ); - iThick = hb_parni( 9 ); - cr = ( COLORREF ) hb_parnl( 10 ); + iAlign = hb_parni( 7 ); + iStyle = hb_parni( 8 ); + iThick = hb_parni( 9 ); + cr = ( COLORREF ) hb_parnl( 10 ); - x = iLeft; - y = iTop; + x = iLeft; + y = iTop; switch( iAlign ) { - case 0: /* Center */ - if( iOrient == 0 ) /* Horizontal */ - { - iOffset = ( ( iBottom - iTop ) / 2 ); - y = iTop + iOffset; - } - else - { - iOffset = ( ( iRight - iLeft ) / 2 ); - x = iLeft + iOffset; - } - break; + case 0: /* Center */ + if( iOrient == 0 ) /* Horizontal */ + { + iOffset = ( ( iBottom - iTop ) / 2 ); + y = iTop + iOffset; + } + else + { + iOffset = ( ( iRight - iLeft ) / 2 ); + x = iLeft + iOffset; + } + break; - case 1: /* Top */ - break; + case 1: /* Top */ + break; - case 2: /* bottom */ - if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */ - { - y = iBottom - 1; - } - else - { - y = iBottom; - } - break; + case 2: /* bottom */ + if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */ + { + y = iBottom - 1; + } + else + { + y = iBottom; + } + break; - case 3: /* Left */ - break; + case 3: /* Left */ + break; - case 4: /* Right */ - if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */ - { - x = iRight - 1; - } - else - { - x = iRight; - } - break; + case 4: /* Right */ + if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */ + { + x = iRight - 1; + } + else + { + x = iRight; + } + break; } - hPen = CreatePen( iStyle, iThick, cr ); - hOldPen = ( HPEN ) SelectObject( _s->hdc, hPen ); + hPen = CreatePen( iStyle, iThick, cr ); + hOldPen = ( HPEN ) SelectObject( _s->hdc, hPen ); hOldPenGUI = _s->bGui ? ( HPEN ) SelectObject( _s->hGuiDC, hPen ) : 0; switch( iFormat ) { - case 0: /* Raised */ - if( iOrient == 0 ) /* Horizontal */ - { - SelectObject( _s->hdc, _s->pGUI->penWhite ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, iRight, y ); - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y + 1, NULL ); - LineTo( _s->hdc, iRight, y + 1 ); - #if defined( __SETGUI__ ) - if( _s->bGui ) + case 0: /* Raised */ + if( iOrient == 0 ) /* Horizontal */ { - SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, iRight, y ); - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y + 1, NULL ); - LineTo( _s->hGuiDC, iRight, y + 1 ); - } - #endif - } - else /* Vertical */ - { - SelectObject( _s->hdc, _s->pGUI->penWhite ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, x, iBottom ); - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x + 1, y, NULL ); - LineTo( _s->hdc, x + 1, iBottom ); + SelectObject( _s->hdc, _s->pGUI->penWhite ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, iRight, y ); + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y + 1, NULL ); + LineTo( _s->hdc, iRight, y + 1 ); #if defined( __SETGUI__ ) - if( _s->bGui ) - { - SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, x, iBottom ); - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x + 1, y, NULL ); - LineTo( _s->hGuiDC, x + 1, iBottom ); - } + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, iRight, y ); + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y + 1, NULL ); + LineTo( _s->hGuiDC, iRight, y + 1 ); + } #endif - } - break; + } + else /* Vertical */ + { + SelectObject( _s->hdc, _s->pGUI->penWhite ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, x, iBottom ); + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x + 1, y, NULL ); + LineTo( _s->hdc, x + 1, iBottom ); + #if defined( __SETGUI__ ) + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, x, iBottom ); + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x + 1, y, NULL ); + LineTo( _s->hGuiDC, x + 1, iBottom ); + } + #endif + } + break; - case 1: /* Recessed */ - if( iOrient == 0 ) /* Horizontal */ - { - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, iRight, y ); - SelectObject( _s->hdc, _s->pGUI->penWhite ); - MoveToEx( _s->hdc, x, y + 1, NULL ); - LineTo( _s->hdc, iRight, y + 1 ); - #if defined( __SETGUI__ ) - if( _s->bGui ) + case 1: /* Recessed */ + if( iOrient == 0 ) /* Horizontal */ { - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, iRight, y ); - SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); - MoveToEx( _s->hGuiDC, x, y + 1, NULL ); - LineTo( _s->hGuiDC, iRight, y + 1 ); - } - #endif - } - else /* Vertical */ - { - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, x, iBottom ); - SelectObject( _s->hdc, _s->pGUI->penWhite ); - MoveToEx( _s->hdc, x + 1, y, NULL ); - LineTo( _s->hdc, x + 1, iBottom ); + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, iRight, y ); + SelectObject( _s->hdc, _s->pGUI->penWhite ); + MoveToEx( _s->hdc, x, y + 1, NULL ); + LineTo( _s->hdc, iRight, y + 1 ); #if defined( __SETGUI__ ) - if( _s->bGui ) - { - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, x, iBottom ); - SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); - MoveToEx( _s->hGuiDC, x + 1, y, NULL ); - LineTo( _s->hGuiDC, x + 1, iBottom ); - } + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, iRight, y ); + SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); + MoveToEx( _s->hGuiDC, x, y + 1, NULL ); + LineTo( _s->hGuiDC, iRight, y + 1 ); + } #endif - } - break; + } + else /* Vertical */ + { + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, x, iBottom ); + SelectObject( _s->hdc, _s->pGUI->penWhite ); + MoveToEx( _s->hdc, x + 1, y, NULL ); + LineTo( _s->hdc, x + 1, iBottom ); + #if defined( __SETGUI__ ) + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, x, iBottom ); + SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); + MoveToEx( _s->hGuiDC, x + 1, y, NULL ); + LineTo( _s->hGuiDC, x + 1, iBottom ); + } + #endif + } + break; - case 2: /* Plain */ - if( iOrient == 0 ) /* Horizontal */ - { - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, iRight, y ); - #if defined( __SETGUI__ ) - if( _s->bGui ) + case 2: /* Plain */ + if( iOrient == 0 ) /* Horizontal */ { - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, iRight, y ); - } - #endif - } - else /* Vertical */ - { - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, x, iBottom ); + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, iRight, y ); #if defined( __SETGUI__ ) - if( _s->bGui ) - { - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, x, iBottom ); - } + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, iRight, y ); + } #endif - } - break; + } + else /* Vertical */ + { + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, x, iBottom ); + #if defined( __SETGUI__ ) + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, x, iBottom ); + } + #endif + } + break; } SelectObject( _s->hdc, hOldPen ); @@ -1546,12 +1546,12 @@ HB_FUNC( WVT_DRAWLINE ) */ HB_FUNC( WVT_DRAWELLIPSE ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); SelectObject( _s->hdc, _s->currentBrush ); SelectObject( _s->hdc, _s->currentPen ); @@ -1571,12 +1571,12 @@ HB_FUNC( WVT_DRAWELLIPSE ) */ HB_FUNC( WVT_DRAWRECTANGLE ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); SelectObject( _s->hdc, _s->currentBrush ); SelectObject( _s->hdc, _s->currentPen ); @@ -1596,16 +1596,16 @@ HB_FUNC( WVT_DRAWRECTANGLE ) */ HB_FUNC( WVT_DRAWROUNDRECT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); int iHt, iWd; - iHt = hb_parni( 6 ); - iWd = hb_parni( 7 ); + iHt = hb_parni( 6 ); + iWd = hb_parni( 7 ); SelectObject( _s->hdc, _s->currentBrush ); SelectObject( _s->hdc, _s->currentPen ); @@ -1625,18 +1625,18 @@ HB_FUNC( WVT_DRAWROUNDRECT ) */ HB_FUNC( WVT_DRAWFOCUSRECT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); - RECT rc = { 0, 0, 0, 0 }; + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + RECT rc = { 0, 0, 0, 0 }; - rc.left = iLeft; - rc.top = iTop; - rc.right = iRight; - rc.bottom = iBottom; + rc.left = iLeft; + rc.top = iTop; + rc.right = iRight; + rc.bottom = iBottom; hb_retl( DrawFocusRect( _s->hdc, &rc ) ); #if defined( __SETGUI__ ) @@ -1653,23 +1653,23 @@ HB_FUNC( WVT_DRAWFOCUSRECT ) */ HB_FUNC( WVT_DRAWCOLORRECT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); - RECT rc = { 0, 0, 0, 0 }; + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + RECT rc = { 0, 0, 0, 0 }; HBRUSH hBrush; hBrush = CreateSolidBrush( ( COLORREF ) hb_parnl( 6 ) ); if( hBrush ) { - rc.left = iLeft; - rc.top = iTop; - rc.right = iRight; - rc.bottom = iBottom; + rc.left = iLeft; + rc.top = iTop; + rc.right = iRight; + rc.bottom = iBottom; hb_retl( FillRect( _s->hdc, &rc, hBrush ) ); #if defined( __SETGUI__ ) @@ -1689,16 +1689,16 @@ HB_FUNC( WVT_DRAWCOLORRECT ) */ HB_FUNC( WVT_DRAWGRIDHORZ ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iAtRow = hb_parni( 1 ); - int iRows = hb_parni( 4 ); + int iAtRow = hb_parni( 1 ); + int iRows = hb_parni( 4 ); int i, y; int iLeft, iRight; - iLeft = ( hb_parni( 2 ) * _s->PTEXTSIZE.x ); - iLeft += hb_parvni( 5, 2 ); - iRight = ( ( ( hb_parni( 3 ) + 1 ) * _s->PTEXTSIZE.x ) - 1 ); + iLeft = ( hb_parni( 2 ) * _s->PTEXTSIZE.x ); + iLeft += hb_parvni( 5, 2 ); + iRight = ( ( ( hb_parni( 3 ) + 1 ) * _s->PTEXTSIZE.x ) - 1 ); iRight += hb_parvni( 5, 4 ); SelectObject( _s->hdc, _s->currentPen ); @@ -1740,23 +1740,23 @@ HB_FUNC( WVT_DRAWGRIDHORZ ) */ HB_FUNC( WVT_DRAWGRIDVERT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); int iTop, iBottom, x, i, iCharHeight, iCharWidth; - int iTabs = hb_parni( 4 ); + int iTabs = hb_parni( 4 ); if( ! iTabs ) { hb_retl( HB_FALSE ); } - iCharWidth = _s->PTEXTSIZE.x; - iCharHeight = _s->PTEXTSIZE.y; + iCharWidth = _s->PTEXTSIZE.x; + iCharHeight = _s->PTEXTSIZE.y; - iTop = ( hb_parni( 1 ) * iCharHeight ); - iTop += hb_parvni( 5, 1 ); - iBottom = ( ( hb_parni( 2 ) + 1 ) * iCharHeight ) - 1; - iBottom += hb_parvni( 5, 3 ); + iTop = ( hb_parni( 1 ) * iCharHeight ); + iTop += hb_parvni( 5, 1 ); + iBottom = ( ( hb_parni( 2 ) + 1 ) * iCharHeight ) - 1; + iBottom += hb_parvni( 5, 3 ); SelectObject( _s->hdc, _s->currentPen ); @@ -1790,44 +1790,44 @@ HB_FUNC( WVT_DRAWGRIDVERT ) */ HB_FUNC( WVT_DRAWBUTTON ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - SIZE sz = { 0, 0 }; - POINT xy = { 0, 0 }; - RECT rc = { 0, 0, 0, 0 }; + SIZE sz = { 0, 0 }; + POINT xy = { 0, 0 }; + RECT rc = { 0, 0, 0, 0 }; int iTop, iLeft, iBottom, iRight; int iAlign; int iTextHeight /*, iTextWidth */; - LOGBRUSH lb = { 0, 0, 0 }; + LOGBRUSH lb = { 0, 0, 0 }; HBRUSH hBrush; - HB_BOOL bText = HB_ISCHAR( 5 ); - HB_BOOL bImage = ( HB_ISNUM( 6 ) || HB_ISCHAR( 6 ) ); - int iFormat = hb_parni( 7 ); - COLORREF textColor = ( COLORREF ) hb_parnldef( 8, _s->COLORS[ 0 ] ); - COLORREF bkColor = ( COLORREF ) hb_parnldef( 9, _s->COLORS[ 7 ] ); + HB_BOOL bText = HB_ISCHAR( 5 ); + HB_BOOL bImage = ( HB_ISNUM( 6 ) || HB_ISCHAR( 6 ) ); + int iFormat = hb_parni( 7 ); + COLORREF textColor = ( COLORREF ) hb_parnldef( 8, _s->COLORS[ 0 ] ); + COLORREF bkColor = ( COLORREF ) hb_parnldef( 9, _s->COLORS[ 7 ] ); /* int iImageAt = hb_parni( 10 ); */ - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); - iTop = xy.y + hb_parvni( 11, 1 ); - iLeft = xy.x + hb_parvni( 11, 2 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); - iBottom = xy.y - 1 + hb_parvni( 11, 3 ); - iRight = xy.x - 1 + hb_parvni( 11, 4 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); + iTop = xy.y + hb_parvni( 11, 1 ); + iLeft = xy.x + hb_parvni( 11, 2 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + iBottom = xy.y - 1 + hb_parvni( 11, 3 ); + iRight = xy.x - 1 + hb_parvni( 11, 4 ); lb.lbStyle = BS_SOLID; lb.lbColor = bkColor; lb.lbHatch = 0; #if ! defined( HB_OS_WIN_CE ) - hBrush = CreateBrushIndirect( &lb ); + hBrush = CreateBrushIndirect( &lb ); #else - hBrush = CreateSolidBrush( lb.lbColor ); + hBrush = CreateSolidBrush( lb.lbColor ); #endif - rc.left = iLeft; - rc.top = iTop; - rc.right = iRight + 1; - rc.bottom = iBottom + 1; + rc.left = iLeft; + rc.top = iTop; + rc.right = iRight + 1; + rc.bottom = iBottom + 1; FillRect( _s->hdc, &rc, hBrush ); #if defined( __SETGUI__ ) @@ -1840,31 +1840,31 @@ HB_FUNC( WVT_DRAWBUTTON ) switch( iFormat ) { - case 1: - hb_wvt_DrawBoxRecessed( _s->hdc, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 ); - if( _s->bGui ) - { - hb_wvt_DrawBoxRecessed( _s->hGuiDC, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 ); - } - break; - case 2: - break; - case 3: - hb_wvt_DrawOutline( _s->hdc, iTop, iLeft, iBottom, iRight ); - if( _s->bGui ) - { - hb_wvt_DrawOutline( _s->hGuiDC, iTop, iLeft, iBottom, iRight ); - } - break; - case 4: - break; - default: - hb_wvt_DrawBoxRaised( _s->hdc, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 ); - if( _s->bGui ) - { - hb_wvt_DrawBoxRaised( _s->hGuiDC, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 ); - } - break; + case 1: + hb_wvt_DrawBoxRecessed( _s->hdc, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 ); + if( _s->bGui ) + { + hb_wvt_DrawBoxRecessed( _s->hGuiDC, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 ); + } + break; + case 2: + break; + case 3: + hb_wvt_DrawOutline( _s->hdc, iTop, iLeft, iBottom, iRight ); + if( _s->bGui ) + { + hb_wvt_DrawOutline( _s->hGuiDC, iTop, iLeft, iBottom, iRight ); + } + break; + case 4: + break; + default: + hb_wvt_DrawBoxRaised( _s->hdc, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 ); + if( _s->bGui ) + { + hb_wvt_DrawBoxRaised( _s->hGuiDC, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 ); + } + break; } if( bText ) @@ -1878,9 +1878,9 @@ HB_FUNC( WVT_DRAWBUTTON ) GetTextExtentPoint32( _s->hdc, text, lstrlen( text ), &sz ); /* iTextWidth = sz.cx; */ - iTextHeight = sz.cy; + iTextHeight = sz.cy; - xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); + xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); if( bImage ) { @@ -1928,8 +1928,8 @@ HB_FUNC( WVT_DRAWBUTTON ) if( bImage ) { #if ! defined( HB_OS_WIN_CE ) - int iImageWidth = ( iRight - iLeft + 1 - 8 ); - int iImageHeight = ( iBottom - iTop + 1 - 8 - iTextHeight ); + int iImageWidth = ( iRight - iLeft + 1 - 8 ); + int iImageHeight = ( iBottom - iTop + 1 - 8 - iTextHeight ); if( HB_ISNUM( 6 ) ) { @@ -1956,24 +1956,24 @@ HB_FUNC( WVT_DRAWBUTTON ) */ HB_FUNC( WVT_DRAWSTATUSBAR ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); int iPanels = hb_parni( 1 ); int i, iNext; int iTop, iLeft, iBottom, iRight; - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; iNext = 0; for( i = 0; i < iPanels; i++ ) { - xy = hb_wvt_gtGetXYFromColRow( hb_parvni( 2, iNext + 2 ), hb_parvni( 2, iNext + 1 ) ); - iTop = xy.y; - iLeft = xy.x + 1; + xy = hb_wvt_gtGetXYFromColRow( hb_parvni( 2, iNext + 2 ), hb_parvni( 2, iNext + 1 ) ); + iTop = xy.y; + iLeft = xy.x + 1; - xy = hb_wvt_gtGetXYFromColRow( hb_parvni( 2, iNext + 4 ), hb_parvni( 2, iNext + 3 ) + 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parvni( 2, iNext + 4 ), hb_parvni( 2, iNext + 3 ) + 1 ); iBottom = xy.y - 1; - iRight = xy.x - 2; + iRight = xy.x - 2; SelectObject( _s->hdc, _s->pGUI->penWhite ); @@ -1994,11 +1994,11 @@ HB_FUNC( WVT_DRAWSTATUSBAR ) iNext = iNext + 4; } - xy = hb_wvt_gtGetXYFromColRow( hb_parvni( 2, 4 * iPanels ), hb_parvni( 2, ( 4 * iPanels ) - 1 ) + 1 ); - iTop = xy.y - 2; - iLeft = xy.x - 2; + xy = hb_wvt_gtGetXYFromColRow( hb_parvni( 2, 4 * iPanels ), hb_parvni( 2, ( 4 * iPanels ) - 1 ) + 1 ); + iTop = xy.y - 2; + iLeft = xy.x - 2; iBottom = iTop; - iRight = iLeft; + iRight = iLeft; SelectObject( _s->hdc, _s->pGUI->penBlack ); @@ -2027,23 +2027,23 @@ HB_FUNC( WVT_DRAWSTATUSBAR ) HB_FUNC( WVT_DRAWPICTURE ) { #if ! defined( HB_OS_WIN_CE ) - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; int iTop, iLeft, iBottom, iRight; - int iSlot = hb_parni( 5 ) - 1; + int iSlot = hb_parni( 5 ) - 1; if( iSlot < WVT_PICTURES_MAX ) { if( _s->pGUI->iPicture[ iSlot ] ) { - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; - iTop = xy.y + hb_parvni( 6, 1 ); - iLeft = xy.x + hb_parvni( 6, 2 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; + iTop = xy.y + hb_parvni( 6, 1 ); + iLeft = xy.x + hb_parvni( 6, 2 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); iBottom = xy.y - 1 + hb_parvni( 6, 3 ); - iRight = xy.x - 1 + hb_parvni( 6, 4 ); + iRight = xy.x - 1 + hb_parvni( 6, 4 ); hb_retl( hb_wvt_gtRenderPicture( iLeft, iTop, iRight - iLeft + 1, iBottom - iTop + 1, _s->pGUI->iPicture[ iSlot ] ) ); } @@ -2057,20 +2057,20 @@ HB_FUNC( WVT_DRAWPICTURE ) */ HB_FUNC( WVT_DRAWLABELEX ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; - int iSlot = hb_parni( 7 ) - 1; + POINT xy = { 0, 0 }; + int iSlot = hb_parni( 7 ) - 1; if( _s->pGUI->hUserFonts[ iSlot ] ) { - LPTSTR text = HB_TCHAR_CONVTO( hb_parc( 3 ) ); - COLORREF fgClr = hb_wvt_FgColorParam( 5 ), - bgClr = hb_wvt_BgColorParam( 6 ); + LPTSTR text = HB_TCHAR_CONVTO( hb_parc( 3 ) ); + COLORREF fgClr = hb_wvt_FgColorParam( 5 ), + bgClr = hb_wvt_BgColorParam( 6 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; - xy.x += hb_parvni( 8, 2 ); - xy.y += hb_parvni( 8, 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; + xy.x += hb_parvni( 8, 2 ); + xy.y += hb_parvni( 8, 1 ); SetBkColor( _s->hdc, bgClr ); SetTextColor( _s->hdc, fgClr ); @@ -2102,195 +2102,195 @@ HB_FUNC( WVT_DRAWLABELEX ) */ HB_FUNC( WVT_DRAWLINEEX ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; int iTop, iLeft, iBottom, iRight, iOffset; int iOrient, iFormat, iAlign; int x, y; HPEN hPen; int iSlot = hb_parni( 8 ) - 1; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; - iTop = xy.y + hb_parvni( 9, 1 ); - iLeft = xy.x + hb_parvni( 9, 2 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; + iTop = xy.y + hb_parvni( 9, 1 ); + iLeft = xy.x + hb_parvni( 9, 2 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); iBottom = xy.y - 1 + hb_parvni( 9, 4 ); - iRight = xy.x - 1 + hb_parvni( 9, 4 ); + iRight = xy.x - 1 + hb_parvni( 9, 4 ); /* Resolve Parameters */ iOrient = hb_parni( 5 ); iFormat = hb_parni( 6 ); - iAlign = hb_parni( 7 ); + iAlign = hb_parni( 7 ); - x = iLeft; - y = iTop; + x = iLeft; + y = iTop; switch( iAlign ) { - case 0: /* Center */ - if( iOrient == 0 ) /* Horizontal */ - { - iOffset = ( ( iBottom - iTop ) / 2 ); - y = iTop + iOffset; - } - else - { - iOffset = ( ( iRight - iLeft ) / 2 ); - x = iLeft + iOffset; - } - break; + case 0: /* Center */ + if( iOrient == 0 ) /* Horizontal */ + { + iOffset = ( ( iBottom - iTop ) / 2 ); + y = iTop + iOffset; + } + else + { + iOffset = ( ( iRight - iLeft ) / 2 ); + x = iLeft + iOffset; + } + break; - case 1: /* Top */ - break; + case 1: /* Top */ + break; - case 2: /* bottom */ - if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */ - { - y = iBottom - 1; - } - else - { - y = iBottom; - } - break; + case 2: /* bottom */ + if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */ + { + y = iBottom - 1; + } + else + { + y = iBottom; + } + break; - case 3: /* Left */ - break; + case 3: /* Left */ + break; - case 4: /* Right */ - if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */ - { - x = iRight - 1; - } - else - { - x = iRight; - } - break; + case 4: /* Right */ + if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */ + { + x = iRight - 1; + } + else + { + x = iRight; + } + break; } hPen = _s->pGUI->hUserPens[ iSlot ]; switch( iFormat ) { - case 0: /* Raised */ - if( iOrient == 0 ) /* Horizontal */ - { - SelectObject( _s->hdc, _s->pGUI->penWhite ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, iRight, y ); - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y + 1, NULL ); - LineTo( _s->hdc, iRight, y + 1 ); - #if defined( __SETGUI__ ) - if( _s->bGui ) + case 0: /* Raised */ + if( iOrient == 0 ) /* Horizontal */ { - SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, iRight, y ); - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y + 1, NULL ); - LineTo( _s->hGuiDC, iRight, y + 1 ); - } - #endif - } - else /* Vertical */ - { - SelectObject( _s->hdc, _s->pGUI->penWhite ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, x, iBottom ); - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x + 1, y, NULL ); - LineTo( _s->hdc, x + 1, iBottom ); + SelectObject( _s->hdc, _s->pGUI->penWhite ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, iRight, y ); + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y + 1, NULL ); + LineTo( _s->hdc, iRight, y + 1 ); #if defined( __SETGUI__ ) - if( _s->bGui ) - { - SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, x, iBottom ); - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x + 1, y, NULL ); - LineTo( _s->hGuiDC, x + 1, iBottom ); - } + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, iRight, y ); + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y + 1, NULL ); + LineTo( _s->hGuiDC, iRight, y + 1 ); + } #endif - } - break; + } + else /* Vertical */ + { + SelectObject( _s->hdc, _s->pGUI->penWhite ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, x, iBottom ); + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x + 1, y, NULL ); + LineTo( _s->hdc, x + 1, iBottom ); + #if defined( __SETGUI__ ) + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, x, iBottom ); + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x + 1, y, NULL ); + LineTo( _s->hGuiDC, x + 1, iBottom ); + } + #endif + } + break; - case 1: /* Recessed */ - if( iOrient == 0 ) /* Horizontal */ - { - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, iRight, y ); - SelectObject( _s->hdc, _s->pGUI->penWhite ); - MoveToEx( _s->hdc, x, y + 1, NULL ); - LineTo( _s->hdc, iRight, y + 1 ); - #if defined( __SETGUI__ ) - if( _s->bGui ) + case 1: /* Recessed */ + if( iOrient == 0 ) /* Horizontal */ { - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, iRight, y ); - SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); - MoveToEx( _s->hGuiDC, x, y + 1, NULL ); - LineTo( _s->hGuiDC, iRight, y + 1 ); - } - #endif - } - else /* Vertical */ - { - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, x, iBottom ); - SelectObject( _s->hdc, _s->pGUI->penWhite ); - MoveToEx( _s->hdc, x + 1, y, NULL ); - LineTo( _s->hdc, x + 1, iBottom ); + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, iRight, y ); + SelectObject( _s->hdc, _s->pGUI->penWhite ); + MoveToEx( _s->hdc, x, y + 1, NULL ); + LineTo( _s->hdc, iRight, y + 1 ); #if defined( __SETGUI__ ) - if( _s->bGui ) - { - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, x, iBottom ); - SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); - MoveToEx( _s->hGuiDC, x + 1, y, NULL ); - LineTo( _s->hGuiDC, x + 1, iBottom ); - } + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, iRight, y ); + SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); + MoveToEx( _s->hGuiDC, x, y + 1, NULL ); + LineTo( _s->hGuiDC, iRight, y + 1 ); + } #endif - } - break; + } + else /* Vertical */ + { + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, x, iBottom ); + SelectObject( _s->hdc, _s->pGUI->penWhite ); + MoveToEx( _s->hdc, x + 1, y, NULL ); + LineTo( _s->hdc, x + 1, iBottom ); + #if defined( __SETGUI__ ) + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, x, iBottom ); + SelectObject( _s->hGuiDC, _s->pGUI->penWhite ); + MoveToEx( _s->hGuiDC, x + 1, y, NULL ); + LineTo( _s->hGuiDC, x + 1, iBottom ); + } + #endif + } + break; - case 2: /* Plain */ - if( iOrient == 0 ) /* Horizontal */ - { - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, iRight, y ); - #if defined( __SETGUI__ ) - if( _s->bGui ) + case 2: /* Plain */ + if( iOrient == 0 ) /* Horizontal */ { - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, iRight, y ); - } - #endif - } - else /* Vertical */ - { - SelectObject( _s->hdc, hPen ); - MoveToEx( _s->hdc, x, y, NULL ); - LineTo( _s->hdc, x, iBottom ); + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, iRight, y ); #if defined( __SETGUI__ ) - if( _s->bGui ) - { - SelectObject( _s->hGuiDC, hPen ); - MoveToEx( _s->hGuiDC, x, y, NULL ); - LineTo( _s->hGuiDC, x, iBottom ); - } + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, iRight, y ); + } #endif - } - break; + } + else /* Vertical */ + { + SelectObject( _s->hdc, hPen ); + MoveToEx( _s->hdc, x, y, NULL ); + LineTo( _s->hdc, x, iBottom ); + #if defined( __SETGUI__ ) + if( _s->bGui ) + { + SelectObject( _s->hGuiDC, hPen ); + MoveToEx( _s->hGuiDC, x, y, NULL ); + LineTo( _s->hGuiDC, x, iBottom ); + } + #endif + } + break; } hb_retl( HB_TRUE ); @@ -2302,18 +2302,18 @@ HB_FUNC( WVT_DRAWLINEEX ) */ HB_FUNC( WVT_DRAWOUTLINEEX ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; int iTop, iLeft, iBottom, iRight; - int iSlot = hb_parni( 5 ) - 1; + int iSlot = hb_parni( 5 ) - 1; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); - iTop = xy.y - 1 + hb_parvni( 6, 1 ); - iLeft = xy.x - 1 + hb_parvni( 6, 2 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); + iTop = xy.y - 1 + hb_parvni( 6, 1 ); + iLeft = xy.x - 1 + hb_parvni( 6, 2 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); iBottom = xy.y + hb_parvni( 6, 3 ); - iRight = xy.x + hb_parvni( 6, 4 ); + iRight = xy.x + hb_parvni( 6, 4 ); if( _s->pGUI->hUserPens[ iSlot ] ) { @@ -2339,24 +2339,24 @@ HB_FUNC( WVT_DRAWOUTLINEEX ) */ HB_FUNC( WVT_DRAWLABELOBJ ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; RECT rect = { 0, 0, 0, 0 }; int iTop, iLeft, iBottom, iRight, x, y; int iAlignHorz, iAlignVert, iAlignH, iAlignV; UINT uiOptions; - SIZE sz = { 0, 0 }; - LPTSTR text = HB_TCHAR_CONVTO( hb_parc( 5 ) ); - COLORREF fgClr = hb_wvt_FgColorParam( 8 ), - bgClr = hb_wvt_BgColorParam( 9 ); + SIZE sz = { 0, 0 }; + LPTSTR text = HB_TCHAR_CONVTO( hb_parc( 5 ) ); + COLORREF fgClr = hb_wvt_FgColorParam( 8 ), + bgClr = hb_wvt_BgColorParam( 9 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; - iTop = xy.y + hb_parvni( 11, 1 ); - iLeft = xy.x + hb_parvni( 11, 2 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); - iBottom = xy.y - 1 + hb_parvni( 11, 3 ); - iRight = xy.x - 1 + hb_parvni( 11, 4 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; + iTop = xy.y + hb_parvni( 11, 1 ); + iLeft = xy.x + hb_parvni( 11, 2 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + iBottom = xy.y - 1 + hb_parvni( 11, 3 ); + iRight = xy.x - 1 + hb_parvni( 11, 4 ); iAlignHorz = hb_parni( 6 ); /* default is 0 */ iAlignVert = hb_parni( 7 ); /* default is 0 */ @@ -2372,45 +2372,45 @@ HB_FUNC( WVT_DRAWLABELOBJ ) switch( iAlignHorz ) { - case 0: - iAlignH = TA_LEFT; - break; + case 0: + iAlignH = TA_LEFT; + break; - case 1: - iAlignH = TA_RIGHT; - x = iRight; - break; + case 1: + iAlignH = TA_RIGHT; + x = iRight; + break; - case 2: - iAlignH = TA_CENTER; - x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); - break; + case 2: + iAlignH = TA_CENTER; + x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); + break; - default: - iAlignH = 0; + default: + iAlignH = 0; } iAlignV = TA_TOP; switch( iAlignVert ) { - case 1: - y = iBottom - sz.cy; - break; + case 1: + y = iBottom - sz.cy; + break; - case 2: - y = iTop + ( ( iBottom - iTop + 1 - sz.cy ) / 2 ); - break; + case 2: + y = iTop + ( ( iBottom - iTop + 1 - sz.cy ) / 2 ); + break; } SetTextAlign( _s->hdc, iAlignH | iAlignV ); - rect.top = iTop; - rect.left = iLeft; - rect.bottom = iBottom; - rect.right = iRight; + rect.top = iTop; + rect.left = iLeft; + rect.bottom = iBottom; + rect.right = iRight; - uiOptions = ETO_CLIPPED | ETO_OPAQUE; + uiOptions = ETO_CLIPPED | ETO_OPAQUE; ExtTextOut( _s->hdc, x, y, uiOptions, &rect, text, lstrlen( text ), NULL ); #if defined( __SETGUI__ ) @@ -2435,44 +2435,44 @@ HB_FUNC( WVT_DRAWLABELOBJ ) */ HB_FUNC( WVT_DRAWTOOLBUTTONSTATE ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); switch( hb_parni( 6 ) ) { - case 0: /* Flat */ - hb_wvt_DrawToolButtonFlat( _s->hdc, iTop, iLeft, iBottom, iRight ); + case 0: /* Flat */ + hb_wvt_DrawToolButtonFlat( _s->hdc, iTop, iLeft, iBottom, iRight ); #if defined( __SETGUI__ ) - if( _s->bGui ) - { - hb_wvt_DrawToolButtonFlat( _s->hGuiDC, iTop, iLeft, iBottom, iRight ); - } + if( _s->bGui ) + { + hb_wvt_DrawToolButtonFlat( _s->hGuiDC, iTop, iLeft, iBottom, iRight ); + } #endif - break; + break; - case 1: /* Raised */ - hb_wvt_DrawToolButtonUp( _s->hdc, iTop, iLeft, iBottom, iRight ); + case 1: /* Raised */ + hb_wvt_DrawToolButtonUp( _s->hdc, iTop, iLeft, iBottom, iRight ); #if defined( __SETGUI__ ) - if( _s->bGui ) - { - hb_wvt_DrawToolButtonUp( _s->hGuiDC, iTop, iLeft, iBottom, iRight ); - } + if( _s->bGui ) + { + hb_wvt_DrawToolButtonUp( _s->hGuiDC, iTop, iLeft, iBottom, iRight ); + } #endif - break; + break; - case 2: /* Recessed */ - hb_wvt_DrawToolButtonDown( _s->hdc, iTop, iLeft, iBottom, iRight ); + case 2: /* Recessed */ + hb_wvt_DrawToolButtonDown( _s->hdc, iTop, iLeft, iBottom, iRight ); #if defined( __SETGUI__ ) - if( _s->bGui ) - { - hb_wvt_DrawToolButtonDown( _s->hGuiDC, iTop, iLeft, iBottom, iRight ); - } + if( _s->bGui ) + { + hb_wvt_DrawToolButtonDown( _s->hGuiDC, iTop, iLeft, iBottom, iRight ); + } #endif - break; + break; } hb_retl( HB_TRUE ); } @@ -2483,20 +2483,20 @@ HB_FUNC( WVT_DRAWTOOLBUTTONSTATE ) */ HB_FUNC( WVT_DRAWSCROLLBUTTON ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); - int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); POINT * Point; - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; int iHeight, iOff; HB_BOOL bDepressed = hb_parl( 7 ); - Point = ( POINT * ) hb_xgrab( 3 * sizeof( POINT ) ); - iOff = 6; + Point = ( POINT * ) hb_xgrab( 3 * sizeof( POINT ) ); + iOff = 6; iHeight = iBottom - iTop + 1; @@ -2523,49 +2523,49 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON ) switch( hb_parni( 6 ) ) { - case 1: /* Top */ - xy.y = iTop + iOff - 1; - xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); - Point[ 0 ] = xy; - xy.y = iBottom - iOff - 1; - xy.x = iLeft + iOff - 1; - Point[ 1 ] = xy; - xy.x = iRight - iOff + 1; - Point[ 2 ] = xy; - break; + case 1: /* Top */ + xy.y = iTop + iOff - 1; + xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); + Point[ 0 ] = xy; + xy.y = iBottom - iOff - 1; + xy.x = iLeft + iOff - 1; + Point[ 1 ] = xy; + xy.x = iRight - iOff + 1; + Point[ 2 ] = xy; + break; - case 2: /* Left */ - xy.y = iTop + ( ( iBottom - iTop + 1 ) / 2 ); - xy.x = iLeft + iOff; - Point[ 0 ] = xy; - xy.x = iRight - iOff - 1; - xy.y = iTop + iOff - 1; - Point[ 1 ] = xy; - xy.y = iBottom - iOff + 1; - Point[ 2 ] = xy; - break; + case 2: /* Left */ + xy.y = iTop + ( ( iBottom - iTop + 1 ) / 2 ); + xy.x = iLeft + iOff; + Point[ 0 ] = xy; + xy.x = iRight - iOff - 1; + xy.y = iTop + iOff - 1; + Point[ 1 ] = xy; + xy.y = iBottom - iOff + 1; + Point[ 2 ] = xy; + break; - case 3: /* Bottom */ - xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); - xy.y = iBottom - iOff; - Point[ 0 ] = xy; - xy.x = iLeft + iOff - 1; - xy.y = iBottom - iHeight + iOff + 1; - Point[ 1 ] = xy; - xy.x = iRight - iOff + 1; - Point[ 2 ] = xy; - break; + case 3: /* Bottom */ + xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); + xy.y = iBottom - iOff; + Point[ 0 ] = xy; + xy.x = iLeft + iOff - 1; + xy.y = iBottom - iHeight + iOff + 1; + Point[ 1 ] = xy; + xy.x = iRight - iOff + 1; + Point[ 2 ] = xy; + break; - case 4: /* Right */ - xy.x = iRight - iOff - 1; - xy.y = iTop + ( ( iBottom - iTop + 1 ) / 2 ); - Point[ 0 ] = xy; - xy.x = iLeft + iOff + 1; - xy.y = iTop + iOff - 1; - Point[ 1 ] = xy; - xy.y = iBottom - iOff + 1; - Point[ 2 ] = xy; - break; + case 4: /* Right */ + xy.x = iRight - iOff - 1; + xy.y = iTop + ( ( iBottom - iTop + 1 ) / 2 ); + Point[ 0 ] = xy; + xy.x = iLeft + iOff + 1; + xy.y = iTop + iOff - 1; + Point[ 1 ] = xy; + xy.y = iBottom - iOff + 1; + Point[ 2 ] = xy; + break; } SelectObject( _s->hdc, _s->pGUI->solidBrush ); @@ -2586,12 +2586,12 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON ) */ HB_FUNC( WVT_DRAWSCROLLTHUMBVERT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); int iTabTop, iTabLft, iTabBtm, iTabRgt; /* Background */ @@ -2642,16 +2642,16 @@ HB_FUNC( WVT_DRAWSCROLLTHUMBVERT ) */ HB_FUNC( WVT_DRAWSCROLLTHUMBHORZ ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); int iThumbLeft, iThumbRight; - iThumbLeft = _s->PTEXTSIZE.x * hb_parni( 6 ); - iThumbRight = iThumbLeft + ( _s->PTEXTSIZE.x * 2 ) - 1; + iThumbLeft = _s->PTEXTSIZE.x * hb_parni( 6 ); + iThumbRight = iThumbLeft + ( _s->PTEXTSIZE.x * 2 ) - 1; /* Background */ SetBkMode( _s->hdc, OPAQUE ); @@ -2697,40 +2697,40 @@ HB_FUNC( WVT_DRAWSCROLLTHUMBHORZ ) */ HB_FUNC( WVT_DRAWSHADEDRECT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - HB_BOOL bGF = HB_FALSE; + HB_BOOL bGF = HB_FALSE; if( _s->pGUI->hMSImg32 ) { TRIVERTEX vert[ 2 ]; - GRADIENT_RECT gRect = { 0, 0 }; + GRADIENT_RECT gRect = { 0, 0 }; - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); - int iMode = hb_parnidef( 6, GRADIENT_FILL_RECT_H ); + int iMode = hb_parnidef( 6, GRADIENT_FILL_RECT_H ); - vert[ 0 ].x = iLeft; - vert[ 0 ].y = iTop; - vert[ 0 ].Red = ( COLOR16 ) hb_parvni( 7, 1 ); - vert[ 0 ].Green = ( COLOR16 ) hb_parvni( 7, 2 ); - vert[ 0 ].Blue = ( COLOR16 ) hb_parvni( 7, 3 ); - vert[ 0 ].Alpha = ( COLOR16 ) hb_parvni( 7, 4 ); + vert[ 0 ].x = iLeft; + vert[ 0 ].y = iTop; + vert[ 0 ].Red = ( COLOR16 ) hb_parvni( 7, 1 ); + vert[ 0 ].Green = ( COLOR16 ) hb_parvni( 7, 2 ); + vert[ 0 ].Blue = ( COLOR16 ) hb_parvni( 7, 3 ); + vert[ 0 ].Alpha = ( COLOR16 ) hb_parvni( 7, 4 ); - vert[ 1 ].x = iRight; - vert[ 1 ].y = iBottom; - vert[ 1 ].Red = ( COLOR16 ) hb_parvni( 8, 1 ); - vert[ 1 ].Green = ( COLOR16 ) hb_parvni( 8, 2 ); - vert[ 1 ].Blue = ( COLOR16 ) hb_parvni( 8, 3 ); - vert[ 1 ].Alpha = ( COLOR16 ) hb_parvni( 8, 4 ); + vert[ 1 ].x = iRight; + vert[ 1 ].y = iBottom; + vert[ 1 ].Red = ( COLOR16 ) hb_parvni( 8, 1 ); + vert[ 1 ].Green = ( COLOR16 ) hb_parvni( 8, 2 ); + vert[ 1 ].Blue = ( COLOR16 ) hb_parvni( 8, 3 ); + vert[ 1 ].Alpha = ( COLOR16 ) hb_parvni( 8, 4 ); - gRect.UpperLeft = 0; + gRect.UpperLeft = 0; gRect.LowerRight = 1; - bGF = ( HB_BOOL ) _s->pGUI->pfnGF( _s->hdc, vert, 2, &gRect, 1, iMode ); + bGF = ( HB_BOOL ) _s->pGUI->pfnGF( _s->hdc, vert, 2, &gRect, 1, iMode ); #if defined( __SETGUI__ ) if( _s->bGui ) { @@ -2750,40 +2750,40 @@ HB_FUNC( WVT_DRAWSHADEDRECT ) */ HB_FUNC( WVT_DRAWTEXTBOX ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); - int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); int iAlignHorz = hb_parni( 7 ); /* default to 0 */ - int iAlignH = 0; + int iAlignH = 0; - RECT rc = { 0, 0, 0, 0 }; - LPTSTR text = HB_TCHAR_CONVTO( hb_parc( 6 ) ); - COLORREF fgClr = hb_wvt_FgColorParam( 9 ), - bgClr = hb_wvt_BgColorParam( 10 ); + RECT rc = { 0, 0, 0, 0 }; + LPTSTR text = HB_TCHAR_CONVTO( hb_parc( 6 ) ); + COLORREF fgClr = hb_wvt_FgColorParam( 9 ), + bgClr = hb_wvt_BgColorParam( 10 ); switch( iAlignHorz ) { - case 0: - iAlignH = DT_LEFT; - break; + case 0: + iAlignH = DT_LEFT; + break; - case 1: - iAlignH = DT_RIGHT; - break; + case 1: + iAlignH = DT_RIGHT; + break; - case 2: - iAlignH = DT_CENTER; - break; + case 2: + iAlignH = DT_CENTER; + break; } - rc.top = iTop; - rc.left = iLeft; - rc.bottom = iBottom; - rc.right = iRight; + rc.top = iTop; + rc.left = iLeft; + rc.bottom = iBottom; + rc.right = iRight; SetTextAlign( _s->hdc, TA_TOP | TA_LEFT | TA_NOUPDATECP ); SetTextColor( _s->hdc, fgClr ); @@ -2814,60 +2814,60 @@ HB_FUNC( WVT_DRAWTEXTBOX ) */ HB_FUNC( WVT_DRAWPROGRESSBAR ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); - int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); + int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5, 1 ); + int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parvni( 5, 2 ); int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5, 3 ); - int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); + int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5, 4 ); int iPercent, iBarUpto, iDirection; HB_BOOL bVertical, bImage; COLORREF crBarColor; HBRUSH hBrush; - LOGBRUSH lb = { 0, 0, 0 }; - RECT rc = { 0, 0, 0, 0 }; + LOGBRUSH lb = { 0, 0, 0 }; + RECT rc = { 0, 0, 0, 0 }; - iPercent = hb_parni( 6 ); - bImage = HB_ISCHAR( 9 ); - bVertical = hb_parl( 10 ); + iPercent = hb_parni( 6 ); + bImage = HB_ISCHAR( 9 ); + bVertical = hb_parl( 10 ); iDirection = hb_parni( 11 ); if( bVertical ) { if( iDirection == 0 ) { - iBarUpto = iTop + ( ( iBottom - iTop ) * iPercent / 100 ); - rc.top = iTop; - rc.left = iLeft; - rc.bottom = iBarUpto; - rc.right = iRight; + iBarUpto = iTop + ( ( iBottom - iTop ) * iPercent / 100 ); + rc.top = iTop; + rc.left = iLeft; + rc.bottom = iBarUpto; + rc.right = iRight; } else { - iBarUpto = iBottom - ( ( iBottom - iTop ) * iPercent / 100 ); - rc.top = iBarUpto; - rc.left = iLeft; - rc.bottom = iBottom; - rc.right = iRight; + iBarUpto = iBottom - ( ( iBottom - iTop ) * iPercent / 100 ); + rc.top = iBarUpto; + rc.left = iLeft; + rc.bottom = iBottom; + rc.right = iRight; } } else { if( iDirection == 0 ) { - iBarUpto = iLeft + ( ( iRight - iLeft ) * iPercent / 100 ); - rc.top = iTop; - rc.left = iLeft; - rc.bottom = iBottom; - rc.right = iBarUpto; + iBarUpto = iLeft + ( ( iRight - iLeft ) * iPercent / 100 ); + rc.top = iTop; + rc.left = iLeft; + rc.bottom = iBottom; + rc.right = iBarUpto; } else { - iBarUpto = iRight - ( ( iRight - iLeft ) * iPercent / 100 ); - rc.top = iTop; - rc.left = iBarUpto; - rc.bottom = iBottom; - rc.right = iRight; + iBarUpto = iRight - ( ( iRight - iLeft ) * iPercent / 100 ); + rc.top = iTop; + rc.left = iBarUpto; + rc.bottom = iBottom; + rc.right = iRight; } } @@ -2889,9 +2889,9 @@ HB_FUNC( WVT_DRAWPROGRESSBAR ) lb.lbColor = crBarColor; lb.lbHatch = 0; #if ! defined( HB_OS_WIN_CE ) - hBrush = CreateBrushIndirect( &lb ); + hBrush = CreateBrushIndirect( &lb ); #else - hBrush = CreateSolidBrush( lb.lbColor ); + hBrush = CreateSolidBrush( lb.lbColor ); #endif rc.bottom++; rc.right++; @@ -2918,19 +2918,19 @@ HB_FUNC( WVT_CREATEFONT ) LOGFONT logfont; /* = { 0,0,0 }; */ - logfont.lfEscapement = hb_parni( 10 ) * 10; - logfont.lfOrientation = 0; - logfont.lfWeight = ( hb_parni( 4 ) ); - logfont.lfItalic = ( BYTE ) hb_parl( 5 ); - logfont.lfUnderline = ( BYTE ) hb_parl( 6 ); - logfont.lfStrikeOut = ( BYTE ) hb_parl( 7 ); - logfont.lfCharSet = ( BYTE ) hb_parnidef( 8, _s->CodePage ); - logfont.lfOutPrecision = 0; - logfont.lfClipPrecision = 0; - logfont.lfQuality = ( BYTE ) hb_parnidef( 9, DEFAULT_QUALITY ); - logfont.lfPitchAndFamily = FF_DONTCARE; - logfont.lfHeight = hb_parnidef( 2, _s->fontHeight ); - logfont.lfWidth = hb_parnidef( 3, _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ); + logfont.lfEscapement = hb_parni( 10 ) * 10; + logfont.lfOrientation = 0; + logfont.lfWeight = ( hb_parni( 4 ) ); + logfont.lfItalic = ( BYTE ) hb_parl( 5 ); + logfont.lfUnderline = ( BYTE ) hb_parl( 6 ); + logfont.lfStrikeOut = ( BYTE ) hb_parl( 7 ); + logfont.lfCharSet = ( BYTE ) hb_parnidef( 8, _s->CodePage ); + logfont.lfOutPrecision = 0; + logfont.lfClipPrecision = 0; + logfont.lfQuality = ( BYTE ) hb_parnidef( 9, DEFAULT_QUALITY ); + logfont.lfPitchAndFamily = FF_DONTCARE; + logfont.lfHeight = hb_parnidef( 2, _s->fontHeight ); + logfont.lfWidth = hb_parnidef( 3, _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ); HB_TCHAR_COPYTO( logfont.lfFaceName, ( ! HB_ISCHAR( 1 ) ? _s->fontFace : hb_parcx( 1 ) ), HB_SIZEOFARRAY( logfont.lfFaceName ) - 1 ); @@ -2943,13 +2943,13 @@ HB_FUNC( WVT_CREATEFONT ) */ HB_FUNC( WVT_LOADPICTURE ) { - HB_BOOL bResult = HB_FALSE; + HB_BOOL bResult = HB_FALSE; #if ! defined( HB_OS_WIN_CE ) - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - IPicture * iPicture = hb_wvt_gtLoadPicture( hb_parcx( 2 ) ); - int iSlot = hb_parni( 1 ) - 1; + IPicture * iPicture = hb_wvt_gtLoadPicture( hb_parcx( 2 ) ); + int iSlot = hb_parni( 1 ) - 1; if( iPicture ) { @@ -2958,8 +2958,8 @@ HB_FUNC( WVT_LOADPICTURE ) hb_wvt_gtDestroyPicture( _s->pGUI->iPicture[ iSlot ] ); } - _s->pGUI->iPicture[ iSlot ] = iPicture; - bResult = HB_TRUE; + _s->pGUI->iPicture[ iSlot ] = iPicture; + bResult = HB_TRUE; } #endif hb_retl( bResult ); @@ -2969,13 +2969,13 @@ HB_FUNC( WVT_LOADPICTURE ) HB_FUNC( WVT_LOADPICTUREFROMRESOURCE ) { - HB_BOOL bResult = HB_FALSE; + HB_BOOL bResult = HB_FALSE; #if ! defined( HB_OS_WIN_CE ) - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - IPicture * iPicture = hb_wvt_gtLoadPictureFromResource( hb_parcx( 2 ), hb_parcx( 3 ) ); - int iSlot = hb_parni( 1 ) - 1; + IPicture * iPicture = hb_wvt_gtLoadPictureFromResource( hb_parcx( 2 ), hb_parcx( 3 ) ); + int iSlot = hb_parni( 1 ) - 1; if( iPicture ) { @@ -2984,8 +2984,8 @@ HB_FUNC( WVT_LOADPICTUREFROMRESOURCE ) hb_wvt_gtDestroyPicture( _s->pGUI->iPicture[ iSlot ] ); } - _s->pGUI->iPicture[ iSlot ] = iPicture; - bResult = HB_TRUE; + _s->pGUI->iPicture[ iSlot ] = iPicture; + bResult = HB_TRUE; } #endif hb_retl( bResult ); @@ -2998,25 +2998,25 @@ HB_FUNC( WVT_LOADPICTUREFROMRESOURCE ) */ HB_FUNC( WVT_LOADFONT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); LOGFONT logfont; /* = { 0 }; */ - int iSlot = hb_parni( 1 ) - 1; + int iSlot = hb_parni( 1 ) - 1; HFONT hFont; - logfont.lfEscapement = hb_parni( 11 ) * 10; - logfont.lfOrientation = 0; - logfont.lfWeight = hb_parni( 5 ); - logfont.lfItalic = ( BYTE ) hb_parl( 6 ); - logfont.lfUnderline = ( BYTE ) hb_parl( 7 ); - logfont.lfStrikeOut = ( BYTE ) hb_parl( 8 ); - logfont.lfCharSet = ( BYTE ) hb_parnidef( 9, _s->CodePage ); - logfont.lfOutPrecision = 0; - logfont.lfClipPrecision = 0; - logfont.lfQuality = ( BYTE ) hb_parnidef( 10, DEFAULT_QUALITY ); - logfont.lfPitchAndFamily = FF_DONTCARE; - logfont.lfHeight = hb_parnidef( 3, _s->fontHeight ); - logfont.lfWidth = hb_parnidef( 4, _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ); + logfont.lfEscapement = hb_parni( 11 ) * 10; + logfont.lfOrientation = 0; + logfont.lfWeight = hb_parni( 5 ); + logfont.lfItalic = ( BYTE ) hb_parl( 6 ); + logfont.lfUnderline = ( BYTE ) hb_parl( 7 ); + logfont.lfStrikeOut = ( BYTE ) hb_parl( 8 ); + logfont.lfCharSet = ( BYTE ) hb_parnidef( 9, _s->CodePage ); + logfont.lfOutPrecision = 0; + logfont.lfClipPrecision = 0; + logfont.lfQuality = ( BYTE ) hb_parnidef( 10, DEFAULT_QUALITY ); + logfont.lfPitchAndFamily = FF_DONTCARE; + logfont.lfHeight = hb_parnidef( 3, _s->fontHeight ); + logfont.lfWidth = hb_parnidef( 4, _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ); HB_TCHAR_COPYTO( logfont.lfFaceName, ( ! HB_ISCHAR( 2 ) ? _s->fontFace : hb_parcx( 2 ) ), HB_SIZEOFARRAY( logfont.lfFaceName ) - 1 ); @@ -3044,11 +3044,11 @@ HB_FUNC( WVT_LOADPEN ) HPEN hPen; int iSlot = hb_parni( 1 ) - 1; - iPenStyle = hb_parni( 2 ); - iPenWidth = hb_parni( 3 ); - crColor = ( COLORREF ) hb_parnldef( 4, RGB( 0, 0, 0 ) ); + iPenStyle = hb_parni( 2 ); + iPenWidth = hb_parni( 3 ); + crColor = ( COLORREF ) hb_parnldef( 4, RGB( 0, 0, 0 ) ); - hPen = CreatePen( iPenStyle, iPenWidth, crColor ); + hPen = CreatePen( iPenStyle, iPenWidth, crColor ); if( hPen ) { @@ -3076,25 +3076,25 @@ HB_FUNC( WVT_SAVESCREEN ) HDC hCompDC; HBITMAP hBmp, oldBmp; - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; int iTop, iLeft, iBottom, iRight, iWidth, iHeight; PHB_ITEM info = hb_itemArrayNew( 3 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); - iTop = xy.y; - iLeft = xy.x; + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); + iTop = xy.y; + iLeft = xy.x; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); iBottom = xy.y - 1; - iRight = xy.x - 1; + iRight = xy.x - 1; - iWidth = iRight - iLeft + 1; + iWidth = iRight - iLeft + 1; iHeight = iBottom - iTop + 1; - hBmp = CreateCompatibleBitmap( _s->hdc, iWidth, iHeight ); + hBmp = CreateCompatibleBitmap( _s->hdc, iWidth, iHeight ); hCompDC = CreateCompatibleDC( _s->hdc ); - oldBmp = ( HBITMAP ) SelectObject( hCompDC, hBmp ); + oldBmp = ( HBITMAP ) SelectObject( hCompDC, hBmp ); BitBlt( hCompDC, 0, 0, iWidth, iHeight, _s->hdc, iLeft, iTop, SRCCOPY ); SelectObject( hCompDC, oldBmp ); DeleteDC( hCompDC ); @@ -3112,29 +3112,29 @@ HB_FUNC( WVT_SAVESCREEN ) */ HB_FUNC( WVT_RESTSCREEN ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; int iTop, iLeft, iBottom, iRight, iWidth, iHeight; HBITMAP hBmp; HDC hCompDC; - HB_BOOL bResult = HB_FALSE; + HB_BOOL bResult = HB_FALSE; HB_BOOL bDoNotDestroyBMP = hb_parl( 6 ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; - iTop = xy.y; - iLeft = xy.x; + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );; + iTop = xy.y; + iLeft = xy.x; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); iBottom = xy.y - 1; - iRight = xy.x - 1; + iRight = xy.x - 1; - iWidth = iRight - iLeft + 1; + iWidth = iRight - iLeft + 1; iHeight = iBottom - iTop + 1; hCompDC = CreateCompatibleDC( _s->hdc ); - hBmp = ( HBITMAP ) SelectObject( hCompDC, ( HBITMAP ) ( HB_PTRDIFF ) hb_parvnint( 5, 3 ) ); + hBmp = ( HBITMAP ) SelectObject( hCompDC, ( HBITMAP ) ( HB_PTRDIFF ) hb_parvnint( 5, 3 ) ); if( hBmp ) { if( ( iWidth == hb_parvni( 5, 1 ) ) && ( iHeight == hb_parvni( 5, 2 ) ) ) diff --git a/harbour/contrib/gtwvg/wvgcuig.c b/harbour/contrib/gtwvg/wvgcuig.c index 59bc4c02ad..02f2011079 100644 --- a/harbour/contrib/gtwvg/wvgcuig.c +++ b/harbour/contrib/gtwvg/wvgcuig.c @@ -89,14 +89,14 @@ static PHB_GOBJS hb_wvg_ObjectNew( PHB_GTWVT pWVT ) { int iHandle = ( pWVT->gObjs ? pWVT->gObjs->iHandle + 1 : 1 ); - HB_GOBJS * gObj = ( HB_GOBJS * ) hb_xgrab( sizeof( HB_GOBJS ) ); + HB_GOBJS * gObj = ( HB_GOBJS * ) hb_xgrab( sizeof( HB_GOBJS ) ); memset( gObj, 0, sizeof( HB_GOBJS ) ); gObj->iHandle = iHandle; - gObj->iState = GOBJ_OBJSTATE_ENABLED; - gObj->lpText = NULL; - gObj->bBlock = NULL; + gObj->iState = GOBJ_OBJSTATE_ENABLED; + gObj->lpText = NULL; + gObj->bBlock = NULL; hb_retni( iHandle ); @@ -108,10 +108,10 @@ static void hb_wvg_RefreshRect( PHB_GTWVT pWVT, PHB_GOBJS gObj ) RECT rc = { 0, 0, 0, 0 }; /* Calculate the region occupied +- 3 pixels as most controls are outside of designated area */ - rc.top = ( pWVT->PTEXTSIZE.y * gObj->iTop ) + gObj->aOffset.iTop - 3; - rc.left = ( pWVT->PTEXTSIZE.x * gObj->iLeft ) + gObj->aOffset.iLeft - 3; - rc.bottom = ( pWVT->PTEXTSIZE.y * ( gObj->iBottom + 1 ) ) - 1 + gObj->aOffset.iBottom + 3; - rc.right = ( pWVT->PTEXTSIZE.x * ( gObj->iRight + 1 ) ) - 1 + gObj->aOffset.iRight + 3; + rc.top = ( pWVT->PTEXTSIZE.y * gObj->iTop ) + gObj->aOffset.iTop - 3; + rc.left = ( pWVT->PTEXTSIZE.x * gObj->iLeft ) + gObj->aOffset.iLeft - 3; + rc.bottom = ( pWVT->PTEXTSIZE.y * ( gObj->iBottom + 1 ) ) - 1 + gObj->aOffset.iBottom + 3; + rc.right = ( pWVT->PTEXTSIZE.x * ( gObj->iRight + 1 ) ) - 1 + gObj->aOffset.iRight + 3; InvalidateRect( pWVT->hWnd, &rc, FALSE ); } @@ -168,7 +168,7 @@ HB_FUNC( WVG_CLEARGUIOBJECTS ) /*----------------------------------------------------------------------*/ HB_FUNC( WVG_SETGOBJSTATE ) { - PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); + PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); int iHandle = hb_parni( 1 ); int iOState = 0; @@ -204,9 +204,9 @@ HB_FUNC( WVG_SETGOBJSTATE ) */ HB_FUNC( WVG_SETGOBJDATA ) { - PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); - int iHandle = hb_parni( 1 ); - HB_BOOL bSuccess = HB_FALSE; + PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); + int iHandle = hb_parni( 1 ); + HB_BOOL bSuccess = HB_FALSE; if( iHandle ) { @@ -222,77 +222,77 @@ HB_FUNC( WVG_SETGOBJDATA ) switch( iDataType ) { - case GOBJ_OBJDATA_TEXT: - if( gObj->lpText ) - HB_TCHAR_FREE( gObj->lpText ); - gObj->lpText = HB_TCHAR_CONVTO( HB_ISCHAR( 3 ) ? hb_parc( 3 ) : "" ); - break; + case GOBJ_OBJDATA_TEXT: + if( gObj->lpText ) + HB_TCHAR_FREE( gObj->lpText ); + gObj->lpText = HB_TCHAR_CONVTO( HB_ISCHAR( 3 ) ? hb_parc( 3 ) : "" ); + break; #if ! defined( HB_OS_WIN_CE ) - case GOBJ_OBJDATA_PICTURE: - if( HB_ISNUM( 3 ) && hb_parni( 3 ) <= WVT_PICTURES_MAX ) - gObj->iPicture = pWVT->pGUI->iPicture[ hb_parni( 3 ) - 1 ]; - break; - case GOBJ_OBJDATA_IMAGE: - { - IPicture * iPicture = NULL; + case GOBJ_OBJDATA_PICTURE: + if( HB_ISNUM( 3 ) && hb_parni( 3 ) <= WVT_PICTURES_MAX ) + gObj->iPicture = pWVT->pGUI->iPicture[ hb_parni( 3 ) - 1 ]; + break; + case GOBJ_OBJDATA_IMAGE: + { + IPicture * iPicture = NULL; - if( HB_ISNUM( 3 ) ) - { - if( hb_parni( 3 ) <= WVT_PICTURES_MAX ) - iPicture = pWVT->pGUI->iPicture[ hb_parni( 3 ) - 1 ]; + if( HB_ISNUM( 3 ) ) + { + if( hb_parni( 3 ) <= WVT_PICTURES_MAX ) + iPicture = pWVT->pGUI->iPicture[ hb_parni( 3 ) - 1 ]; + } + else + { + iPicture = hb_wvt_gtLoadPicture( hb_parc( 3 ) ); + if( ! iPicture ) + iPicture = hb_wvt_gtLoadPictureFromResource( hb_parc( 3 ), hb_parc( 4 ) ); + } + if( iPicture ) + { + if( gObj->bDestroyPicture && gObj->iPicture ) + HB_VTBL( gObj->iPicture )->Release( HB_THIS( gObj->iPicture ) ); + gObj->iPicture = iPicture; + gObj->bDestroyPicture = HB_TRUE; + } + break; } - else - { - iPicture = hb_wvt_gtLoadPicture( hb_parc( 3 ) ); - if( ! iPicture ) - iPicture = hb_wvt_gtLoadPictureFromResource( hb_parc( 3 ), hb_parc( 4 ) ); - } - if( iPicture ) - { - if( gObj->bDestroyPicture && gObj->iPicture ) - HB_VTBL( gObj->iPicture )->Release( HB_THIS( gObj->iPicture ) ); - gObj->iPicture = iPicture; - gObj->bDestroyPicture = HB_TRUE; - } - break; - } #endif - case GOBJ_OBJDATA_HFONT: - if( gObj->hFont && gObj->bDestroyFont ) - DeleteObject( gObj->hFont ); - gObj->hFont = ( HFONT ) ( HB_PTRDIFF ) hb_parnint( 3 ); - gObj->bDestroyFont = HB_FALSE; - break; - case GOBJ_OBJDATA_HPEN: - if( gObj->hPen && gObj->bDestroyPen ) - DeleteObject( gObj->hPen ); - gObj->hPen = ( HPEN ) ( HB_PTRDIFF ) hb_parnint( 3 ); - gObj->bDestroyPen = HB_FALSE; - break; - case GOBJ_OBJDATA_HBRUSH: - if( gObj->hBrush && gObj->bDestroyBrush ) - DeleteObject( gObj->hBrush ); - gObj->hBrush = ( HBRUSH ) ( HB_PTRDIFF ) hb_parnint( 3 ); - gObj->bDestroyBrush = HB_TRUE; - break; - case GOBJ_OBJDATA_COLORTEXT: - if( HB_ISNUM( 3 ) ) - gObj->crRGBText = ( COLORREF ) ( HB_PTRDIFF ) hb_parnint( 3 ); - else - bSuccess = HB_FALSE; - break; - case GOBJ_OBJDATA_COLORBK: - gObj->crRGBBk = ( COLORREF ) ( HB_PTRDIFF ) hb_parnint( 3 ); - break; - case GOBJ_OBJDATA_BLOCK: - if( gObj->bBlock ) - hb_itemRelease( gObj->bBlock ); - gObj->bBlock = hb_itemNew( hb_param( 3, HB_IT_BLOCK ) ); - break; - default: - bSuccess = HB_FALSE; - break; + case GOBJ_OBJDATA_HFONT: + if( gObj->hFont && gObj->bDestroyFont ) + DeleteObject( gObj->hFont ); + gObj->hFont = ( HFONT ) ( HB_PTRDIFF ) hb_parnint( 3 ); + gObj->bDestroyFont = HB_FALSE; + break; + case GOBJ_OBJDATA_HPEN: + if( gObj->hPen && gObj->bDestroyPen ) + DeleteObject( gObj->hPen ); + gObj->hPen = ( HPEN ) ( HB_PTRDIFF ) hb_parnint( 3 ); + gObj->bDestroyPen = HB_FALSE; + break; + case GOBJ_OBJDATA_HBRUSH: + if( gObj->hBrush && gObj->bDestroyBrush ) + DeleteObject( gObj->hBrush ); + gObj->hBrush = ( HBRUSH ) ( HB_PTRDIFF ) hb_parnint( 3 ); + gObj->bDestroyBrush = HB_TRUE; + break; + case GOBJ_OBJDATA_COLORTEXT: + if( HB_ISNUM( 3 ) ) + gObj->crRGBText = ( COLORREF ) ( HB_PTRDIFF ) hb_parnint( 3 ); + else + bSuccess = HB_FALSE; + break; + case GOBJ_OBJDATA_COLORBK: + gObj->crRGBBk = ( COLORREF ) ( HB_PTRDIFF ) hb_parnint( 3 ); + break; + case GOBJ_OBJDATA_BLOCK: + if( gObj->bBlock ) + hb_itemRelease( gObj->bBlock ); + gObj->bBlock = hb_itemNew( hb_param( 3, HB_IT_BLOCK ) ); + break; + default: + bSuccess = HB_FALSE; + break; } if( bSuccess ) hb_wvg_RefreshRect( pWVT, gObj ); @@ -313,25 +313,25 @@ HB_FUNC( WVG_BOXRAISED ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_BOXRAISED; + gObj->iObjType = GOBJ_OBJTYPE_BOXRAISED; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_BoxRaised( PHB_GTWVT pWVT, int iLeft, int iTop, int iRight, int iBottom ) { - HDC hdc = pWVT->hdc; + HDC hdc = pWVT->hdc; PHB_GUIDATA pGUI = pWVT->pGUI; SelectObject( hdc, pGUI->penWhiteDim ); @@ -367,25 +367,25 @@ HB_FUNC( WVG_BOXRECESSED ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_BOXRECESSED; + gObj->iObjType = GOBJ_OBJTYPE_BOXRECESSED; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_BoxRecessed( PHB_GTWVT pWVT, int iLeft, int iTop, int iRight, int iBottom ) { - HDC hdc = pWVT->hdc; + HDC hdc = pWVT->hdc; PHB_GUIDATA pGUI = pWVT->pGUI; SelectObject( hdc, pGUI->penWhiteDim ); @@ -421,26 +421,26 @@ HB_FUNC( WVG_BOXGET ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_BOXGET; + gObj->iObjType = GOBJ_OBJTYPE_BOXGET; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 1 ); - gObj->iRight = hb_parni( 2 ) + hb_parni( 3 ) - 1; + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 1 ); + gObj->iRight = hb_parni( 2 ) + hb_parni( 3 ) - 1; - gObj->aOffset.iTop = 0; - gObj->aOffset.iLeft = 0; - gObj->aOffset.iBottom = 0; - gObj->aOffset.iRight = 0; + gObj->aOffset.iTop = 0; + gObj->aOffset.iLeft = 0; + gObj->aOffset.iBottom = 0; + gObj->aOffset.iRight = 0; - gObj->gObjNext = pWVT->gObjs; + gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_BoxGet( PHB_GTWVT pWVT, int iLeft, int iTop, int iRight, int iBottom ) { - HDC hdc = pWVT->hdc; + HDC hdc = pWVT->hdc; PHB_GUIDATA pGUI = pWVT->pGUI; SelectObject( hdc, pGUI->penBlack ); @@ -464,25 +464,25 @@ HB_FUNC( WVG_BOXGROUP ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_BOXGROUP; + gObj->iObjType = GOBJ_OBJTYPE_BOXGROUP; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_BoxGroup( PHB_GTWVT pWVT, int iLeft, int iTop, int iRight, int iBottom ) { - HDC hdc = pWVT->hdc; + HDC hdc = pWVT->hdc; PHB_GUIDATA pGUI = pWVT->pGUI; SelectObject( hdc, pGUI->penDarkGray ); @@ -523,25 +523,25 @@ HB_FUNC( WVG_BOXGROUPRAISED ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_BOXGROUPRAISED; + gObj->iObjType = GOBJ_OBJTYPE_BOXGROUPRAISED; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*-------------------------------------------------------------------*/ static void hb_wvg_BoxGroupRaised( PHB_GTWVT pWVT, int iLeft, int iTop, int iRight, int iBottom ) { - HDC hdc = pWVT->hdc; + HDC hdc = pWVT->hdc; PHB_GUIDATA pGUI = pWVT->pGUI; SelectObject( hdc, pGUI->penWhite ); @@ -585,19 +585,19 @@ HB_FUNC( WVG_LABEL ) LOGFONT lf; HFONT hFont; - lf.lfEscapement = hb_parni( 6 ) * 10; - lf.lfOrientation = 0; - lf.lfWeight = hb_parni( 12 ); - lf.lfItalic = ( BYTE ) hb_parl( 15 ); - lf.lfUnderline = ( BYTE ) hb_parl( 16 ); - lf.lfStrikeOut = ( BYTE ) hb_parl( 17 ); - lf.lfCharSet = ( BYTE ) hb_parnidef( 14, pWVT->CodePage ); - lf.lfOutPrecision = 0; - lf.lfClipPrecision = 0; - lf.lfQuality = ( BYTE ) hb_parnidef( 13, DEFAULT_QUALITY ); + lf.lfEscapement = hb_parni( 6 ) * 10; + lf.lfOrientation = 0; + lf.lfWeight = hb_parni( 12 ); + lf.lfItalic = ( BYTE ) hb_parl( 15 ); + lf.lfUnderline = ( BYTE ) hb_parl( 16 ); + lf.lfStrikeOut = ( BYTE ) hb_parl( 17 ); + lf.lfCharSet = ( BYTE ) hb_parnidef( 14, pWVT->CodePage ); + lf.lfOutPrecision = 0; + lf.lfClipPrecision = 0; + lf.lfQuality = ( BYTE ) hb_parnidef( 13, DEFAULT_QUALITY ); lf.lfPitchAndFamily = FF_DONTCARE; - lf.lfHeight = hb_parnidef( 10, pWVT->fontHeight ); - lf.lfWidth = hb_parnidef( 11, pWVT->fontWidth < 0 ? -pWVT->fontWidth : pWVT->fontWidth ); + lf.lfHeight = hb_parnidef( 10, pWVT->fontHeight ); + lf.lfWidth = hb_parnidef( 11, pWVT->fontWidth < 0 ? -pWVT->fontWidth : pWVT->fontWidth ); HB_TCHAR_COPYTO( lf.lfFaceName, ( ! HB_ISCHAR( 9 ) ? pWVT->fontFace : hb_parc( 9 ) ), HB_SIZEOFARRAY( lf.lfFaceName ) - 1 ); @@ -606,32 +606,32 @@ HB_FUNC( WVG_LABEL ) { HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_LABEL; + gObj->iObjType = GOBJ_OBJTYPE_LABEL; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 1 ); - gObj->iRight = hb_parni( 2 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 1 ); + gObj->iRight = hb_parni( 2 ); - gObj->aOffset.iTop = hb_parvni( 3, 1 ); - gObj->aOffset.iLeft = hb_parvni( 3, 2 ); - gObj->aOffset.iBottom = hb_parvni( 3, 3 ); - gObj->aOffset.iRight = hb_parvni( 3, 4 ); + gObj->aOffset.iTop = hb_parvni( 3, 1 ); + gObj->aOffset.iLeft = hb_parvni( 3, 2 ); + gObj->aOffset.iBottom = hb_parvni( 3, 3 ); + gObj->aOffset.iRight = hb_parvni( 3, 4 ); #if defined( UNICODE ) - gObj->lpText = hb_mbtowc( hb_parcx( 4 ) ); + gObj->lpText = hb_mbtowc( hb_parcx( 4 ) ); #else - gObj->lpText = hb_strdup( hb_parcx( 4 ) ); + gObj->lpText = hb_strdup( hb_parcx( 4 ) ); #endif - gObj->iAlign = hb_parnidef( 5, TA_LEFT ); - gObj->crRGBText = ( COLORREF ) hb_parnint( 7 ); - gObj->crRGBBk = ( COLORREF ) hb_parnint( 8 ); - gObj->hFont = hFont; - gObj->bDestroyFont = HB_TRUE; + gObj->iAlign = hb_parnidef( 5, TA_LEFT ); + gObj->crRGBText = ( COLORREF ) hb_parnint( 7 ); + gObj->crRGBBk = ( COLORREF ) hb_parnint( 8 ); + gObj->hFont = hFont; + gObj->bDestroyFont = HB_TRUE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } } /*----------------------------------------------------------------------*/ @@ -643,33 +643,33 @@ HB_FUNC( WVG_LABELEX ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_LABEL; + gObj->iObjType = GOBJ_OBJTYPE_LABEL; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 1 ); - gObj->iRight = hb_parni( 2 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 1 ); + gObj->iRight = hb_parni( 2 ); - gObj->aOffset.iTop = hb_parvni( 3, 1 ); - gObj->aOffset.iLeft = hb_parvni( 3, 2 ); - gObj->aOffset.iBottom = hb_parvni( 3, 3 ); - gObj->aOffset.iRight = hb_parvni( 3, 4 ); + gObj->aOffset.iTop = hb_parvni( 3, 1 ); + gObj->aOffset.iLeft = hb_parvni( 3, 2 ); + gObj->aOffset.iBottom = hb_parvni( 3, 3 ); + gObj->aOffset.iRight = hb_parvni( 3, 4 ); #if defined( UNICODE ) - gObj->lpText = hb_mbtowc( hb_parcx( 4 ) ); + gObj->lpText = hb_mbtowc( hb_parcx( 4 ) ); #else - gObj->lpText = hb_strdup( hb_parcx( 4 ) ); + gObj->lpText = hb_strdup( hb_parcx( 4 ) ); #endif - gObj->iAlign = hb_parnidef( 5, TA_LEFT ); - gObj->crRGBText = ( COLORREF ) hb_parnint( 6 ); - gObj->crRGBBk = ( COLORREF ) hb_parnint( 7 ); + gObj->iAlign = hb_parnidef( 5, TA_LEFT ); + gObj->crRGBText = ( COLORREF ) hb_parnint( 6 ); + gObj->crRGBBk = ( COLORREF ) hb_parnint( 7 ); - gObj->hFont = pWVT->pGUI->hUserFonts[ hb_parni( 8 ) - 1 ]; - gObj->bDestroyFont = HB_FALSE; + gObj->hFont = pWVT->pGUI->hUserFonts[ hb_parni( 8 ) - 1 ]; + gObj->bDestroyFont = HB_FALSE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_Label( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iTop ) @@ -703,35 +703,35 @@ HB_FUNC( WVG_OUTLINE ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_OUTLINE; + gObj->iObjType = GOBJ_OBJTYPE_OUTLINE; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->iWidth = hb_parni( 6 ); /* iThick */ - gObj->iStyle = hb_parni( 7 ); /* iShape */ - gObj->crRGB = ( COLORREF ) hb_parnl( 8 ); + gObj->iWidth = hb_parni( 6 ); /* iThick */ + gObj->iStyle = hb_parni( 7 ); /* iShape */ + gObj->crRGB = ( COLORREF ) hb_parnl( 8 ); if( gObj->iWidth > 0 ) { - gObj->hPen = CreatePen( gObj->iWidth, gObj->iStyle, gObj->crRGB ); - gObj->bDestroyPen = HB_TRUE; + gObj->hPen = CreatePen( gObj->iWidth, gObj->iStyle, gObj->crRGB ); + gObj->bDestroyPen = HB_TRUE; } else { - gObj->hPen = pWVT->pGUI->penBlack; - gObj->bDestroyPen = HB_FALSE; + gObj->hPen = pWVT->pGUI->penBlack; + gObj->bDestroyPen = HB_FALSE; } - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ /* @@ -742,31 +742,31 @@ HB_FUNC( WVG_OUTLINEEX ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_OUTLINEEX; + gObj->iObjType = GOBJ_OBJTYPE_OUTLINEEX; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); if( pWVT->pGUI->hUserPens[ hb_parni( 6 ) - 1 ] ) { - gObj->hPen = pWVT->pGUI->hUserPens[ hb_parni( 6 ) - 1 ]; - gObj->bDestroyPen = HB_FALSE; + gObj->hPen = pWVT->pGUI->hUserPens[ hb_parni( 6 ) - 1 ]; + gObj->bDestroyPen = HB_FALSE; } else { - gObj->hPen = pWVT->pGUI->penBlack; - gObj->bDestroyPen = HB_FALSE; + gObj->hPen = pWVT->pGUI->penBlack; + gObj->bDestroyPen = HB_FALSE; } - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_Outline( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iTop, int iRight, int iBottom ) @@ -796,31 +796,31 @@ HB_FUNC( WVG_LINE ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_LINE; + gObj->iObjType = GOBJ_OBJTYPE_LINE; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->iOrient = hb_parni( 6 ); - gObj->iFormat = hb_parni( 7 ); - gObj->iAlign = hb_parni( 8 ); + gObj->iOrient = hb_parni( 6 ); + gObj->iFormat = hb_parni( 7 ); + gObj->iAlign = hb_parni( 8 ); - gObj->iStyle = hb_parni( 9 ); - gObj->iWidth = hb_parni( 10 ); /* iThick */ - gObj->crRGB = ( COLORREF ) hb_parnl( 11 ); + gObj->iStyle = hb_parni( 9 ); + gObj->iWidth = hb_parni( 10 ); /* iThick */ + gObj->crRGB = ( COLORREF ) hb_parnl( 11 ); - gObj->hPen = CreatePen( gObj->iStyle, gObj->iWidth, gObj->crRGB ); - gObj->bDestroyPen = HB_TRUE; + gObj->hPen = CreatePen( gObj->iStyle, gObj->iWidth, gObj->crRGB ); + gObj->bDestroyPen = HB_TRUE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ /* 1 2 3 4 5 6 7 8 9 @@ -831,27 +831,27 @@ HB_FUNC( WVG_LINEEX ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_LINE; + gObj->iObjType = GOBJ_OBJTYPE_LINE; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->iOrient = hb_parni( 6 ); - gObj->iFormat = hb_parni( 7 ); - gObj->iAlign = hb_parni( 8 ); + gObj->iOrient = hb_parni( 6 ); + gObj->iFormat = hb_parni( 7 ); + gObj->iAlign = hb_parni( 8 ); - gObj->hPen = pWVT->pGUI->hUserPens[ hb_parni( 9 ) - 1 ]; - gObj->bDestroyPen = HB_FALSE; + gObj->hPen = pWVT->pGUI->hUserPens[ hb_parni( 9 ) - 1 ]; + gObj->bDestroyPen = HB_FALSE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_Line( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iTop, int iRight, int iBottom ) @@ -865,101 +865,101 @@ static void hb_wvg_Line( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iTop, in switch( gObj->iAlign ) { - case 0: /* Center */ - if( gObj->iOrient == 0 ) /* Horizontal */ - { - iOffset = ( ( iBottom - iTop ) / 2 ); - y = iTop + iOffset; - } - else - { - iOffset = ( ( iRight - iLeft ) / 2 ); - x = iLeft + iOffset; - } - break; + case 0: /* Center */ + if( gObj->iOrient == 0 ) /* Horizontal */ + { + iOffset = ( ( iBottom - iTop ) / 2 ); + y = iTop + iOffset; + } + else + { + iOffset = ( ( iRight - iLeft ) / 2 ); + x = iLeft + iOffset; + } + break; - case 1: /* Top */ - break; + case 1: /* Top */ + break; - case 2: /* bottom */ - if( gObj->iFormat == 0 || gObj->iFormat == 1 ) /* Raised/Recessd */ - y = iBottom - 1; - else - y = iBottom; - break; + case 2: /* bottom */ + if( gObj->iFormat == 0 || gObj->iFormat == 1 ) /* Raised/Recessd */ + y = iBottom - 1; + else + y = iBottom; + break; - case 3: /* Left */ - break; + case 3: /* Left */ + break; - case 4: /* Right */ - if( gObj->iFormat == 0 || gObj->iFormat == 1 ) /* Raised/Recessd */ - x = iRight - 1; - else - x = iRight; - break; + case 4: /* Right */ + if( gObj->iFormat == 0 || gObj->iFormat == 1 ) /* Raised/Recessd */ + x = iRight - 1; + else + x = iRight; + break; } - hPen = gObj->hPen; + hPen = gObj->hPen; hOldPen = ( HPEN ) SelectObject( hdc, gObj->hPen ); switch( gObj->iFormat ) { - case 0: /* Raised */ - if( gObj->iOrient == 0 ) /* Horizontal */ - { - SelectObject( hdc, pWVT->pGUI->penWhite ); - MoveToEx( hdc, x, y, NULL ); - LineTo( hdc, iRight, y ); - SelectObject( hdc, hPen ); - MoveToEx( hdc, x, y + 1, NULL ); - LineTo( hdc, iRight, y + 1 ); - } - else /* Vertical */ - { - SelectObject( hdc, pWVT->pGUI->penWhite ); - MoveToEx( hdc, x, y, NULL ); - LineTo( hdc, x, iBottom ); - SelectObject( hdc, hPen ); - MoveToEx( hdc, x + 1, y, NULL ); - LineTo( hdc, x + 1, iBottom ); - } - break; + case 0: /* Raised */ + if( gObj->iOrient == 0 ) /* Horizontal */ + { + SelectObject( hdc, pWVT->pGUI->penWhite ); + MoveToEx( hdc, x, y, NULL ); + LineTo( hdc, iRight, y ); + SelectObject( hdc, hPen ); + MoveToEx( hdc, x, y + 1, NULL ); + LineTo( hdc, iRight, y + 1 ); + } + else /* Vertical */ + { + SelectObject( hdc, pWVT->pGUI->penWhite ); + MoveToEx( hdc, x, y, NULL ); + LineTo( hdc, x, iBottom ); + SelectObject( hdc, hPen ); + MoveToEx( hdc, x + 1, y, NULL ); + LineTo( hdc, x + 1, iBottom ); + } + break; - case 1: /* Recessed */ - if( gObj->iOrient == 0 ) /* Horizontal */ - { - SelectObject( hdc, hPen ); - MoveToEx( hdc, x, y, NULL ); - LineTo( hdc, iRight, y ); - SelectObject( hdc, pWVT->pGUI->penWhite ); - MoveToEx( hdc, x, y + 1, NULL ); - LineTo( hdc, iRight, y + 1 ); - } - else /* Vertical */ - { - SelectObject( hdc, hPen ); - MoveToEx( hdc, x, y, NULL ); - LineTo( hdc, x, iBottom ); - SelectObject( hdc, pWVT->pGUI->penWhite ); - MoveToEx( hdc, x + 1, y, NULL ); - LineTo( hdc, x + 1, iBottom ); - } - break; + case 1: /* Recessed */ + if( gObj->iOrient == 0 ) /* Horizontal */ + { + SelectObject( hdc, hPen ); + MoveToEx( hdc, x, y, NULL ); + LineTo( hdc, iRight, y ); + SelectObject( hdc, pWVT->pGUI->penWhite ); + MoveToEx( hdc, x, y + 1, NULL ); + LineTo( hdc, iRight, y + 1 ); + } + else /* Vertical */ + { + SelectObject( hdc, hPen ); + MoveToEx( hdc, x, y, NULL ); + LineTo( hdc, x, iBottom ); + SelectObject( hdc, pWVT->pGUI->penWhite ); + MoveToEx( hdc, x + 1, y, NULL ); + LineTo( hdc, x + 1, iBottom ); + } + break; - case 2: /* Plain */ - if( gObj->iOrient == 0 ) /* Horizontal */ - { - SelectObject( hdc, hPen ); - MoveToEx( hdc, x, y, NULL ); - LineTo( hdc, iRight, y ); - } - else /* Vertical */ - { - SelectObject( hdc, hPen ); - MoveToEx( hdc, x, y, NULL ); - LineTo( hdc, x, iBottom ); - } - break; + case 2: /* Plain */ + if( gObj->iOrient == 0 ) /* Horizontal */ + { + SelectObject( hdc, hPen ); + MoveToEx( hdc, x, y, NULL ); + LineTo( hdc, iRight, y ); + } + else /* Vertical */ + { + SelectObject( hdc, hPen ); + MoveToEx( hdc, x, y, NULL ); + LineTo( hdc, x, iBottom ); + } + break; } SelectObject( hdc, hOldPen ); } @@ -973,31 +973,31 @@ HB_FUNC( WVG_ELLIPSE ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_ELLIPSE; + gObj->iObjType = GOBJ_OBJTYPE_ELLIPSE; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->hPen = pWVT->currentPen; - gObj->bDestroyPen = HB_FALSE; - gObj->hBrush = pWVT->currentBrush; - gObj->bDestroyBrush = HB_FALSE; + gObj->hPen = pWVT->currentPen; + gObj->bDestroyPen = HB_FALSE; + gObj->hBrush = pWVT->currentBrush; + gObj->bDestroyBrush = HB_FALSE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_Ellipse( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iTop, int iRight, int iBottom ) { - HBRUSH hBrush = ( HBRUSH ) SelectObject( pWVT->hdc, gObj->hBrush ); - HPEN hPen = ( HPEN ) SelectObject( pWVT->hdc, gObj->hPen ); + HBRUSH hBrush = ( HBRUSH ) SelectObject( pWVT->hdc, gObj->hBrush ); + HPEN hPen = ( HPEN ) SelectObject( pWVT->hdc, gObj->hPen ); Ellipse( pWVT->hdc, iLeft, iTop, iRight, iBottom ); @@ -1013,31 +1013,31 @@ HB_FUNC( WVG_RECTANGLE ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_RECTANGLE; + gObj->iObjType = GOBJ_OBJTYPE_RECTANGLE; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->hPen = pWVT->currentPen; - gObj->bDestroyPen = HB_FALSE; - gObj->hBrush = pWVT->currentBrush; - gObj->bDestroyBrush = HB_FALSE; + gObj->hPen = pWVT->currentPen; + gObj->bDestroyPen = HB_FALSE; + gObj->hBrush = pWVT->currentBrush; + gObj->bDestroyBrush = HB_FALSE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_Rectangle( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iTop, int iRight, int iBottom ) { - HBRUSH hBrush = ( HBRUSH ) SelectObject( pWVT->hdc, gObj->hBrush ); - HPEN hPen = ( HPEN ) SelectObject( pWVT->hdc, gObj->hPen ); + HBRUSH hBrush = ( HBRUSH ) SelectObject( pWVT->hdc, gObj->hBrush ); + HPEN hPen = ( HPEN ) SelectObject( pWVT->hdc, gObj->hPen ); Rectangle( pWVT->hdc, iLeft, iTop, iRight, iBottom ); @@ -1053,34 +1053,34 @@ HB_FUNC( WVG_ROUNDRECT ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_ROUNDRECT; + gObj->iObjType = GOBJ_OBJTYPE_ROUNDRECT; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->iHeight = hb_parni( 6 ); - gObj->iWidth = hb_parni( 7 ); + gObj->iHeight = hb_parni( 6 ); + gObj->iWidth = hb_parni( 7 ); - gObj->hPen = pWVT->currentPen; - gObj->bDestroyPen = HB_FALSE; - gObj->hBrush = pWVT->currentBrush; - gObj->bDestroyBrush = HB_FALSE; + gObj->hPen = pWVT->currentPen; + gObj->bDestroyPen = HB_FALSE; + gObj->hBrush = pWVT->currentBrush; + gObj->bDestroyBrush = HB_FALSE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_RoundRect( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iTop, int iRight, int iBottom ) { - HBRUSH hBrush = ( HBRUSH ) SelectObject( pWVT->hdc, gObj->hBrush ); - HPEN hPen = ( HPEN ) SelectObject( pWVT->hdc, gObj->hPen ); + HBRUSH hBrush = ( HBRUSH ) SelectObject( pWVT->hdc, gObj->hBrush ); + HPEN hPen = ( HPEN ) SelectObject( pWVT->hdc, gObj->hPen ); RoundRect( pWVT->hdc, iLeft, iTop, iRight, iBottom, gObj->iWidth, gObj->iHeight ); @@ -1100,23 +1100,23 @@ HB_FUNC( WVG_COLORRECT ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_COLORRECT; + gObj->iObjType = GOBJ_OBJTYPE_COLORRECT; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->hBrush = hBrush; - gObj->bDestroyBrush = HB_TRUE; + gObj->hBrush = hBrush; + gObj->bDestroyBrush = HB_TRUE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } } /*----------------------------------------------------------------------*/ @@ -1139,36 +1139,36 @@ HB_FUNC( WVG_SHADEDRECT ) { HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_SHADEDRECT; + gObj->iObjType = GOBJ_OBJTYPE_SHADEDRECT; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->iData = hb_parnidef( 6, GRADIENT_FILL_RECT_H ); + gObj->iData = hb_parnidef( 6, GRADIENT_FILL_RECT_H ); - gObj->vert[ 0 ].x = 0; - gObj->vert[ 0 ].y = 0; - gObj->vert[ 0 ].Red = ( COLOR16 ) hb_parvni( 7, 1 ); - gObj->vert[ 0 ].Green = ( COLOR16 ) hb_parvni( 7, 2 ); - gObj->vert[ 0 ].Blue = ( COLOR16 ) hb_parvni( 7, 3 ); - gObj->vert[ 0 ].Alpha = ( COLOR16 ) hb_parvni( 7, 4 ); + gObj->vert[ 0 ].x = 0; + gObj->vert[ 0 ].y = 0; + gObj->vert[ 0 ].Red = ( COLOR16 ) hb_parvni( 7, 1 ); + gObj->vert[ 0 ].Green = ( COLOR16 ) hb_parvni( 7, 2 ); + gObj->vert[ 0 ].Blue = ( COLOR16 ) hb_parvni( 7, 3 ); + gObj->vert[ 0 ].Alpha = ( COLOR16 ) hb_parvni( 7, 4 ); - gObj->vert[ 1 ].x = 0; - gObj->vert[ 1 ].y = 0; - gObj->vert[ 1 ].Red = ( COLOR16 ) hb_parvni( 8, 1 ); - gObj->vert[ 1 ].Green = ( COLOR16 ) hb_parvni( 8, 2 ); - gObj->vert[ 1 ].Blue = ( COLOR16 ) hb_parvni( 8, 3 ); - gObj->vert[ 1 ].Alpha = ( COLOR16 ) hb_parvni( 8, 4 ); + gObj->vert[ 1 ].x = 0; + gObj->vert[ 1 ].y = 0; + gObj->vert[ 1 ].Red = ( COLOR16 ) hb_parvni( 8, 1 ); + gObj->vert[ 1 ].Green = ( COLOR16 ) hb_parvni( 8, 2 ); + gObj->vert[ 1 ].Blue = ( COLOR16 ) hb_parvni( 8, 3 ); + gObj->vert[ 1 ].Alpha = ( COLOR16 ) hb_parvni( 8, 4 ); - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } } /*----------------------------------------------------------------------*/ @@ -1177,16 +1177,16 @@ static void hb_wvg_ShadedRect( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iT HB_BOOL bGF; GRADIENT_RECT gRect = { 0, 0 }; - gRect.UpperLeft = 0; - gRect.LowerRight = 1; + gRect.UpperLeft = 0; + gRect.LowerRight = 1; - gObj->vert[ 0 ].x = iLeft; - gObj->vert[ 0 ].y = iTop; + gObj->vert[ 0 ].x = iLeft; + gObj->vert[ 0 ].y = iTop; - gObj->vert[ 1 ].x = iRight; - gObj->vert[ 1 ].y = iBottom; + gObj->vert[ 1 ].x = iRight; + gObj->vert[ 1 ].y = iBottom; - bGF = ( HB_BOOL ) pWVT->pGUI->pfnGF( pWVT->hGuiDC, gObj->vert, 2, &gRect, 1, gObj->iData ); + bGF = ( HB_BOOL ) pWVT->pGUI->pfnGF( pWVT->hGuiDC, gObj->vert, 2, &gRect, 1, gObj->iData ); HB_SYMBOL_UNUSED( bGF ); } @@ -1197,52 +1197,52 @@ static void hb_wvg_ShadedRect( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iT */ HB_FUNC( WVG_TEXTBOX ) { - PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); - HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); + PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); + HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); int iAlignH = 0; - gObj->iObjType = GOBJ_OBJTYPE_TEXTBOX; + gObj->iObjType = GOBJ_OBJTYPE_TEXTBOX; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->lpText = HB_TCHAR_CONVTO( hb_parc( 6 ) ); + gObj->lpText = HB_TCHAR_CONVTO( hb_parc( 6 ) ); switch( hb_parni( 7 ) ) { - case 0: - iAlignH = DT_LEFT; - break; - case 1: - iAlignH = DT_RIGHT; - break; - case 2: - iAlignH = DT_CENTER; - break; + case 0: + iAlignH = DT_LEFT; + break; + case 1: + iAlignH = DT_RIGHT; + break; + case 2: + iAlignH = DT_CENTER; + break; } - gObj->iAlign = iAlignH; + gObj->iAlign = iAlignH; - gObj->crRGBText = ( COLORREF ) hb_parnint( 9 ); - gObj->crRGBBk = ( COLORREF ) hb_parnint( 10 ); + gObj->crRGBText = ( COLORREF ) hb_parnint( 9 ); + gObj->crRGBBk = ( COLORREF ) hb_parnint( 10 ); - gObj->hFont = ( HFONT ) ( HB_PTRDIFF ) hb_parnint( 11 ); - gObj->bDestroyFont = HB_FALSE; + gObj->hFont = ( HFONT ) ( HB_PTRDIFF ) hb_parnint( 11 ); + gObj->bDestroyFont = HB_FALSE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ static void hb_wvg_TextBox( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iTop, int iRight, int iBottom ) { - RECT rc = { 0, 0, 0, 0 }; - HDC hdc = pWVT->hGuiDC; + RECT rc = { 0, 0, 0, 0 }; + HDC hdc = pWVT->hGuiDC; SetRect( &rc, iLeft, iTop, iRight, iBottom ); @@ -1272,23 +1272,23 @@ HB_FUNC( WVG_PICTURE ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_PICTURE; + gObj->iObjType = GOBJ_OBJTYPE_PICTURE; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->iPicture = pWVT->pGUI->iPicture[ hb_parni( 6 ) - 1 ]; - gObj->bDestroyPicture = HB_FALSE; + gObj->iPicture = pWVT->pGUI->iPicture[ hb_parni( 6 ) - 1 ]; + gObj->bDestroyPicture = HB_FALSE; - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } else { @@ -1305,9 +1305,9 @@ HB_FUNC( WVG_PICTURE ) HB_FUNC( WVG_IMAGE ) { #if ! defined( HB_OS_WIN_CE ) - PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); - int iSource = hb_parni( 6 ); - IPicture * iPicture = NULL; + PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); + int iSource = hb_parni( 6 ); + IPicture * iPicture = NULL; if( iSource == 0 ) { @@ -1317,37 +1317,37 @@ HB_FUNC( WVG_IMAGE ) switch( iSource ) { - case GOBJ_IMAGESOURCE_SLOT: - if( HB_ISNUM( 7 ) && hb_parni( 7 ) <= WVT_PICTURES_MAX ) - { - iPicture = pWVT->pGUI->iPicture[ hb_parni( 7 ) - 1 ]; - } - break; - case GOBJ_IMAGESOURCE_RESOURCE: - iPicture = hb_wvt_gtLoadPictureFromResource( hb_parc( 7 ), hb_parc( 8 ) ); - break; - case GOBJ_IMAGESOURCE_FILE: - iPicture = hb_wvt_gtLoadPicture( hb_parc( 7 ) ); - break; + case GOBJ_IMAGESOURCE_SLOT: + if( HB_ISNUM( 7 ) && hb_parni( 7 ) <= WVT_PICTURES_MAX ) + { + iPicture = pWVT->pGUI->iPicture[ hb_parni( 7 ) - 1 ]; + } + break; + case GOBJ_IMAGESOURCE_RESOURCE: + iPicture = hb_wvt_gtLoadPictureFromResource( hb_parc( 7 ), hb_parc( 8 ) ); + break; + case GOBJ_IMAGESOURCE_FILE: + iPicture = hb_wvt_gtLoadPicture( hb_parc( 7 ) ); + break; } if( iPicture ) { HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_PICTURE; + gObj->iObjType = GOBJ_OBJTYPE_PICTURE; - gObj->iTop = hb_parni( 1 ); - gObj->iLeft = hb_parni( 2 ); - gObj->iBottom = hb_parni( 3 ); - gObj->iRight = hb_parni( 4 ); + gObj->iTop = hb_parni( 1 ); + gObj->iLeft = hb_parni( 2 ); + gObj->iBottom = hb_parni( 3 ); + gObj->iRight = hb_parni( 4 ); - gObj->aOffset.iTop = hb_parvni( 5, 1 ); - gObj->aOffset.iLeft = hb_parvni( 5, 2 ); - gObj->aOffset.iBottom = hb_parvni( 5, 3 ); - gObj->aOffset.iRight = hb_parvni( 5, 4 ); + gObj->aOffset.iTop = hb_parvni( 5, 1 ); + gObj->aOffset.iLeft = hb_parvni( 5, 2 ); + gObj->aOffset.iBottom = hb_parvni( 5, 3 ); + gObj->aOffset.iRight = hb_parvni( 5, 4 ); - gObj->iPicture = iPicture; + gObj->iPicture = iPicture; if( iSource == GOBJ_IMAGESOURCE_SLOT ) { @@ -1358,8 +1358,8 @@ HB_FUNC( WVG_IMAGE ) gObj->bDestroyPicture = HB_TRUE; } - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } else { @@ -1375,16 +1375,16 @@ static void hb_wvg_RenderPicture( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int #if ! defined( HB_OS_WIN_CE ) LONG lWidth, lHeight; int x, y, xe, ye; - int c = iLeft; - int r = iTop; - int dc = iRight - iLeft + 1; - int dr = iBottom - iTop + 1; - int toc = 0; - int tor = 0; + int c = iLeft; + int r = iTop; + int dc = iRight - iLeft + 1; + int dr = iBottom - iTop + 1; + int toc = 0; + int tor = 0; HRGN hrgn1; POINT lpp; - HDC hdc = pWVT->hGuiDC; - IPicture * iPicture = gObj->iPicture; + HDC hdc = pWVT->hGuiDC; + IPicture * iPicture = gObj->iPicture; if( iPicture ) { @@ -1400,10 +1400,10 @@ static void hb_wvg_RenderPicture( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int if( tor == 0 ) tor = dr; - x = c; - y = r; - xe = c + toc - 1; - ye = r + tor - 1; + x = c; + y = r; + xe = c + toc - 1; + ye = r + tor - 1; GetViewportOrgEx( hdc, &lpp ); @@ -1417,8 +1417,8 @@ static void hb_wvg_RenderPicture( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int HB_VTBL( iPicture )->Render( HB_THIS_( iPicture ) hdc, x, y, dc, dr, 0, lHeight, lWidth, -lHeight, NULL ); y += dr; } - y = r; - x += dc; + y = r; + x += dc; } SelectClipRgn( hdc, NULL ); DeleteObject( hrgn1 ); @@ -1449,13 +1449,13 @@ HB_FUNC( WVG_OBJECT ) PHB_GTWVT pWVT = hb_wvt_gtGetWVT(); HB_GOBJS * gObj = hb_wvg_ObjectNew( pWVT ); - gObj->iObjType = GOBJ_OBJTYPE_OBJECT; + gObj->iObjType = GOBJ_OBJTYPE_OBJECT; - gObj->iData = hb_parni( 1 ); /* Object to be executed */ - gObj->bBlock = hb_itemNew( hb_param( 2, HB_IT_BLOCK ) ); + gObj->iData = hb_parni( 1 ); /* Object to be executed */ + gObj->bBlock = hb_itemNew( hb_param( 2, HB_IT_BLOCK ) ); - gObj->gObjNext = pWVT->gObjs; - pWVT->gObjs = gObj; + gObj->gObjNext = pWVT->gObjs; + pWVT->gObjs = gObj; } /*----------------------------------------------------------------------*/ /* @@ -1464,15 +1464,15 @@ HB_FUNC( WVG_OBJECT ) */ static void hb_wvg_GridVert( PHB_GTWVT pWVT, PHB_ITEM pArray, RECT * uRect ) { - PHB_ITEM pCols = hb_arrayGetItemPtr( pArray, 3 ); - HB_ISIZ iTabs = hb_arrayLen( pCols ); + PHB_ITEM pCols = hb_arrayGetItemPtr( pArray, 3 ); + HB_ISIZ iTabs = hb_arrayLen( pCols ); if( iTabs > 0 ) { int x, iTop, iBottom; HB_ISIZ i; - iTop = ( hb_arrayGetNI( pArray, 1 ) * ( int ) pWVT->PTEXTSIZE.y ); + iTop = ( hb_arrayGetNI( pArray, 1 ) * ( int ) pWVT->PTEXTSIZE.y ); iBottom = ( ( hb_arrayGetNI( pArray, 2 ) + 1 ) * ( int ) pWVT->PTEXTSIZE.y ) - 1; if( ( iTop >= uRect->top && iTop <= uRect->bottom ) || @@ -1506,14 +1506,14 @@ static void hb_wvg_GridVert( PHB_GTWVT pWVT, PHB_ITEM pArray, RECT * uRect ) static void hb_wvg_GridHorz( PHB_GTWVT pWVT, PHB_ITEM pArray, RECT * uRect ) { - int iAtRow = hb_arrayGetNI( pArray, 1 ); - int iRows = hb_arrayGetNI( pArray, 4 ); + int iAtRow = hb_arrayGetNI( pArray, 1 ); + int iRows = hb_arrayGetNI( pArray, 4 ); int i, y, iLeft, iRight, iTop, iBottom; HDC hdc; - iLeft = ( hb_arrayGetNI( pArray, 2 ) * pWVT->PTEXTSIZE.x ); - iRight = ( ( ( hb_arrayGetNI( pArray, 3 ) + 1 ) * pWVT->PTEXTSIZE.x ) - 1 ); - iTop = iAtRow * pWVT->PTEXTSIZE.y; + iLeft = ( hb_arrayGetNI( pArray, 2 ) * pWVT->PTEXTSIZE.x ); + iRight = ( ( ( hb_arrayGetNI( pArray, 3 ) + 1 ) * pWVT->PTEXTSIZE.x ) - 1 ); + iTop = iAtRow * pWVT->PTEXTSIZE.y; iBottom = ( iAtRow + iRows ) * pWVT->PTEXTSIZE.y; /* do not add 1 */ if( ( uRect->left > iRight ) || ( uRect->top > iBottom ) || @@ -1587,10 +1587,10 @@ void hb_gt_wvt_PaintGObjects( PHB_GTWVT pWVT, RECT * uRect ) else { /* Take care of offsets 5th element */ - iTop = ( pWVT->PTEXTSIZE.y * hb_arrayGetNI( pArray, 1 ) ); - iLeft = ( pWVT->PTEXTSIZE.x * hb_arrayGetNI( pArray, 2 ) ); + iTop = ( pWVT->PTEXTSIZE.y * hb_arrayGetNI( pArray, 1 ) ); + iLeft = ( pWVT->PTEXTSIZE.x * hb_arrayGetNI( pArray, 2 ) ); iBottom = ( pWVT->PTEXTSIZE.y * ( hb_arrayGetNI( pArray, 3 ) + 1 ) ) - 1; - iRight = ( pWVT->PTEXTSIZE.x * ( hb_arrayGetNI( pArray, 4 ) + 1 ) ) - 1; + iRight = ( pWVT->PTEXTSIZE.x * ( hb_arrayGetNI( pArray, 4 ) + 1 ) ) - 1; } } else @@ -1610,142 +1610,142 @@ void hb_gt_wvt_PaintGObjects( PHB_GTWVT pWVT, RECT * uRect ) } else { - iObjType = gObj->iObjType; + iObjType = gObj->iObjType; - iTop = ( pWVT->PTEXTSIZE.y * gObj->iTop ) + gObj->aOffset.iTop; - iLeft = ( pWVT->PTEXTSIZE.x * gObj->iLeft ) + gObj->aOffset.iLeft; - iBottom = ( pWVT->PTEXTSIZE.y * ( gObj->iBottom + 1 ) ) - 1 + gObj->aOffset.iBottom; - iRight = ( pWVT->PTEXTSIZE.x * ( gObj->iRight + 1 ) ) - 1 + gObj->aOffset.iRight; + iTop = ( pWVT->PTEXTSIZE.y * gObj->iTop ) + gObj->aOffset.iTop; + iLeft = ( pWVT->PTEXTSIZE.x * gObj->iLeft ) + gObj->aOffset.iLeft; + iBottom = ( pWVT->PTEXTSIZE.y * ( gObj->iBottom + 1 ) ) - 1 + gObj->aOffset.iBottom; + iRight = ( pWVT->PTEXTSIZE.x * ( gObj->iRight + 1 ) ) - 1 + gObj->aOffset.iRight; } switch( iObjType ) { - case GOBJ_OBJTYPE_BOXRAISED: - case GOBJ_OBJTYPE_BOXRECESSED: - case GOBJ_OBJTYPE_BOXGET: - case GOBJ_OBJTYPE_BOXGROUP: - case GOBJ_OBJTYPE_BOXGROUPRAISED: - if( ( uRect->left > iRight + 2 ) || ( uRect->top > iBottom + 2 ) || - ( uRect->bottom < iTop - 2 ) || ( uRect->right < iLeft - 2 ) ) - { - /* It is outside of the boundaries */ - } - else if( uRect->left >= iLeft && - uRect->right <= iRight && - uRect->top >= iTop && - uRect->bottom <= iBottom ) - { - /* It is inside of the boundaries */ - } - else - { - switch( iObjType ) + case GOBJ_OBJTYPE_BOXRAISED: + case GOBJ_OBJTYPE_BOXRECESSED: + case GOBJ_OBJTYPE_BOXGET: + case GOBJ_OBJTYPE_BOXGROUP: + case GOBJ_OBJTYPE_BOXGROUPRAISED: + if( ( uRect->left > iRight + 2 ) || ( uRect->top > iBottom + 2 ) || + ( uRect->bottom < iTop - 2 ) || ( uRect->right < iLeft - 2 ) ) { - case GOBJ_OBJTYPE_BOXRAISED: - hb_wvg_BoxRaised( pWVT, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); - break; - case GOBJ_OBJTYPE_BOXRECESSED: - hb_wvg_BoxRecessed( pWVT, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); - break; - case GOBJ_OBJTYPE_BOXGET: - hb_wvg_BoxGet( pWVT, iLeft, iTop, iRight + 1, iBottom + 1 ); - break; - case GOBJ_OBJTYPE_BOXGROUP: - hb_wvg_BoxGroup( pWVT, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); - break; - case GOBJ_OBJTYPE_BOXGROUPRAISED: - hb_wvg_BoxGroupRaised( pWVT, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); - break; + /* It is outside of the boundaries */ } - } - break; - - case GOBJ_OBJTYPE_PICTURE: - case GOBJ_OBJTYPE_LINE: - case GOBJ_OBJTYPE_LINEEX: - case GOBJ_OBJTYPE_ELLIPSE: - case GOBJ_OBJTYPE_RECTANGLE: - case GOBJ_OBJTYPE_ROUNDRECT: - case GOBJ_OBJTYPE_COLORRECT: - case GOBJ_OBJTYPE_SHADEDRECT: - case GOBJ_OBJTYPE_TEXTBOX: - if( ( uRect->left > iRight ) || ( uRect->top > iBottom ) || - ( uRect->bottom < iTop ) || ( uRect->right < iLeft ) ) - { - /* Nothing to do */ - } - else - { - switch( iObjType ) + else if( uRect->left >= iLeft && + uRect->right <= iRight && + uRect->top >= iTop && + uRect->bottom <= iBottom ) { - - case GOBJ_OBJTYPE_LINE: - case GOBJ_OBJTYPE_LINEEX: - hb_wvg_Line( pWVT, gObj, iLeft, iTop, iRight, iBottom ); - break; - case GOBJ_OBJTYPE_ELLIPSE: - hb_wvg_Ellipse( pWVT, gObj, iLeft, iTop, iRight, iBottom ); - break; - case GOBJ_OBJTYPE_RECTANGLE: - hb_wvg_Rectangle( pWVT, gObj, iLeft, iTop, iRight, iBottom ); - break; - case GOBJ_OBJTYPE_ROUNDRECT: - hb_wvg_RoundRect( pWVT, gObj, iLeft, iTop, iRight, iBottom ); - break; - case GOBJ_OBJTYPE_COLORRECT: - hb_wvg_ColorRect( pWVT, gObj, iLeft, iTop, iRight, iBottom ); - hb_wvg_RestFromBuffer( pWVT, iLeft, iTop, iRight, iBottom ); - break; - case GOBJ_OBJTYPE_SHADEDRECT: - hb_wvg_ShadedRect( pWVT, gObj, iLeft, iTop, iRight, iBottom ); - hb_wvg_RestFromBuffer( pWVT, iLeft, iTop, iRight, iBottom ); - break; - case GOBJ_OBJTYPE_PICTURE: - hb_wvg_RenderPicture( pWVT, gObj, iLeft, iTop, iRight, iBottom ); - hb_wvg_RestFromBuffer( pWVT, iLeft, iTop, iRight, iBottom ); - break; - case GOBJ_OBJTYPE_TEXTBOX: - hb_wvg_TextBox( pWVT, gObj, iLeft, iTop, iRight, iBottom ); - hb_wvg_RestFromBuffer( pWVT, iLeft, iTop, iRight, iBottom ); - break; + /* It is inside of the boundaries */ } - } - break; + else + { + switch( iObjType ) + { + case GOBJ_OBJTYPE_BOXRAISED: + hb_wvg_BoxRaised( pWVT, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); + break; + case GOBJ_OBJTYPE_BOXRECESSED: + hb_wvg_BoxRecessed( pWVT, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); + break; + case GOBJ_OBJTYPE_BOXGET: + hb_wvg_BoxGet( pWVT, iLeft, iTop, iRight + 1, iBottom + 1 ); + break; + case GOBJ_OBJTYPE_BOXGROUP: + hb_wvg_BoxGroup( pWVT, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); + break; + case GOBJ_OBJTYPE_BOXGROUPRAISED: + hb_wvg_BoxGroupRaised( pWVT, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); + break; + } + } + break; - case GOBJ_OBJTYPE_LABEL: - case GOBJ_OBJTYPE_LABELEX: + case GOBJ_OBJTYPE_PICTURE: + case GOBJ_OBJTYPE_LINE: + case GOBJ_OBJTYPE_LINEEX: + case GOBJ_OBJTYPE_ELLIPSE: + case GOBJ_OBJTYPE_RECTANGLE: + case GOBJ_OBJTYPE_ROUNDRECT: + case GOBJ_OBJTYPE_COLORRECT: + case GOBJ_OBJTYPE_SHADEDRECT: + case GOBJ_OBJTYPE_TEXTBOX: + if( ( uRect->left > iRight ) || ( uRect->top > iBottom ) || + ( uRect->bottom < iTop ) || ( uRect->right < iLeft ) ) + { + /* Nothing to do */ + } + else + { + switch( iObjType ) + { + + case GOBJ_OBJTYPE_LINE: + case GOBJ_OBJTYPE_LINEEX: + hb_wvg_Line( pWVT, gObj, iLeft, iTop, iRight, iBottom ); + break; + case GOBJ_OBJTYPE_ELLIPSE: + hb_wvg_Ellipse( pWVT, gObj, iLeft, iTop, iRight, iBottom ); + break; + case GOBJ_OBJTYPE_RECTANGLE: + hb_wvg_Rectangle( pWVT, gObj, iLeft, iTop, iRight, iBottom ); + break; + case GOBJ_OBJTYPE_ROUNDRECT: + hb_wvg_RoundRect( pWVT, gObj, iLeft, iTop, iRight, iBottom ); + break; + case GOBJ_OBJTYPE_COLORRECT: + hb_wvg_ColorRect( pWVT, gObj, iLeft, iTop, iRight, iBottom ); + hb_wvg_RestFromBuffer( pWVT, iLeft, iTop, iRight, iBottom ); + break; + case GOBJ_OBJTYPE_SHADEDRECT: + hb_wvg_ShadedRect( pWVT, gObj, iLeft, iTop, iRight, iBottom ); + hb_wvg_RestFromBuffer( pWVT, iLeft, iTop, iRight, iBottom ); + break; + case GOBJ_OBJTYPE_PICTURE: + hb_wvg_RenderPicture( pWVT, gObj, iLeft, iTop, iRight, iBottom ); + hb_wvg_RestFromBuffer( pWVT, iLeft, iTop, iRight, iBottom ); + break; + case GOBJ_OBJTYPE_TEXTBOX: + hb_wvg_TextBox( pWVT, gObj, iLeft, iTop, iRight, iBottom ); + hb_wvg_RestFromBuffer( pWVT, iLeft, iTop, iRight, iBottom ); + break; + } + } + break; + + case GOBJ_OBJTYPE_LABEL: + case GOBJ_OBJTYPE_LABELEX: #if 0 - if( ( uRect->top > iTop + gObj->lf->lfHeight ) || - ( uRect->bottom < iTop ) || ( uRect->right < iLeft ) ) - { - /* Nothing to do */ - } - else + if( ( uRect->top > iTop + gObj->lf->lfHeight ) || + ( uRect->bottom < iTop ) || ( uRect->right < iLeft ) ) + { + /* Nothing to do */ + } + else #endif - { - hb_wvg_Label( pWVT, gObj, iLeft, iTop ); - } - break; + { + hb_wvg_Label( pWVT, gObj, iLeft, iTop ); + } + break; - case GOBJ_OBJTYPE_OUTLINE: - case GOBJ_OBJTYPE_OUTLINEEX: - if( ( uRect->left > iRight ) || ( uRect->top > iBottom ) || - ( uRect->bottom < iTop ) || ( uRect->right < iLeft ) ) - { - /* It is outside of the boundaries */ - } - else if( uRect->left >= iLeft && - uRect->right <= iRight && - uRect->top >= iTop && - uRect->bottom <= iBottom ) - { - /* It is inside of the boundaries */ - } - else - { - hb_wvg_Outline( pWVT, gObj, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); - } - break; + case GOBJ_OBJTYPE_OUTLINE: + case GOBJ_OBJTYPE_OUTLINEEX: + if( ( uRect->left > iRight ) || ( uRect->top > iBottom ) || + ( uRect->bottom < iTop ) || ( uRect->right < iLeft ) ) + { + /* It is outside of the boundaries */ + } + else if( uRect->left >= iLeft && + uRect->right <= iRight && + uRect->top >= iTop && + uRect->bottom <= iBottom ) + { + /* It is inside of the boundaries */ + } + else + { + hb_wvg_Outline( pWVT, gObj, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 ); + } + break; } } gObj = gObj->gObjNext; diff --git a/harbour/contrib/gtwvg/wvgutils.c b/harbour/contrib/gtwvg/wvgutils.c index 2964c21f68..a6ace66df2 100644 --- a/harbour/contrib/gtwvg/wvgutils.c +++ b/harbour/contrib/gtwvg/wvgutils.c @@ -130,45 +130,45 @@ HB_FUNC( WVT_UTILS ) HB_FUNC( WVT_CHOOSEFONT ) { #if ! defined( HB_OS_WIN_CE ) - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); CHOOSEFONT cf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */ LOGFONT lf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */ - LONG PointSize = 0; + LONG PointSize = 0; if( HB_ISNUM( 2 ) ) { PointSize = -MulDiv( ( LONG ) hb_parnl( 2 ), GetDeviceCaps( _s->hdc, LOGPIXELSY ), 72 ); } - lf.lfHeight = PointSize; - lf.lfWidth = hb_parni( 3 ); - lf.lfWeight = hb_parni( 4 ); - lf.lfItalic = HB_ISNUM( 6 ) ? ( BYTE ) hb_parni( 6 ) : ( BYTE ) hb_parl( 6 ); - lf.lfUnderline = HB_ISNUM( 7 ) ? ( BYTE ) hb_parni( 7 ) : ( BYTE ) hb_parl( 7 ); - lf.lfStrikeOut = HB_ISNUM( 8 ) ? ( BYTE ) hb_parni( 8 ) : ( BYTE ) hb_parl( 8 ); - lf.lfCharSet = DEFAULT_CHARSET; - lf.lfQuality = ( BYTE ) hb_parnidef( 5, DEFAULT_QUALITY ); + lf.lfHeight = PointSize; + lf.lfWidth = hb_parni( 3 ); + lf.lfWeight = hb_parni( 4 ); + lf.lfItalic = HB_ISNUM( 6 ) ? ( BYTE ) hb_parni( 6 ) : ( BYTE ) hb_parl( 6 ); + lf.lfUnderline = HB_ISNUM( 7 ) ? ( BYTE ) hb_parni( 7 ) : ( BYTE ) hb_parl( 7 ); + lf.lfStrikeOut = HB_ISNUM( 8 ) ? ( BYTE ) hb_parni( 8 ) : ( BYTE ) hb_parl( 8 ); + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfQuality = ( BYTE ) hb_parnidef( 5, DEFAULT_QUALITY ); lf.lfPitchAndFamily = FF_DONTCARE; if( HB_ISCHAR( 1 ) ) { HB_TCHAR_COPYTO( lf.lfFaceName, hb_parc( 1 ), HB_SIZEOFARRAY( lf.lfFaceName ) - 1 ); } - cf.lStructSize = sizeof( CHOOSEFONT ); - cf.hwndOwner = _s->hWnd; - cf.hDC = ( HDC ) NULL; - cf.lpLogFont = &lf; - cf.iPointSize = 0; - cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_SHOWHELP | CF_INITTOLOGFONTSTRUCT; - cf.rgbColors = RGB( 0, 0, 0 ); - cf.lCustData = 0L; - cf.lpfnHook = ( LPCFHOOKPROC ) NULL; - cf.lpTemplateName = ( LPTSTR ) NULL; - cf.hInstance = ( HINSTANCE ) NULL; - cf.lpszStyle = ( LPTSTR ) NULL; - cf.nFontType = SCREEN_FONTTYPE; - cf.nSizeMin = 0; - cf.nSizeMax = 0; + cf.lStructSize = sizeof( CHOOSEFONT ); + cf.hwndOwner = _s->hWnd; + cf.hDC = ( HDC ) NULL; + cf.lpLogFont = &lf; + cf.iPointSize = 0; + cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_SHOWHELP | CF_INITTOLOGFONTSTRUCT; + cf.rgbColors = RGB( 0, 0, 0 ); + cf.lCustData = 0L; + cf.lpfnHook = ( LPCFHOOKPROC ) NULL; + cf.lpTemplateName = ( LPTSTR ) NULL; + cf.hInstance = ( HINSTANCE ) NULL; + cf.lpszStyle = ( LPTSTR ) NULL; + cf.nFontType = SCREEN_FONTTYPE; + cf.nSizeMin = 0; + cf.nSizeMax = 0; if( ChooseFont( &cf ) ) { @@ -224,11 +224,11 @@ HB_FUNC( WVT_CHOOSECOLOR ) crCustClr[ i ] = ( HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i + 1 ) : GetSysColor( COLOR_BTNFACE ) ); } - cc.lStructSize = sizeof( CHOOSECOLOR ); - cc.hwndOwner = _s->hWnd; - cc.rgbResult = ( COLORREF ) hb_parnl( 1 ); - cc.lpCustColors = crCustClr; - cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN ); + cc.lStructSize = sizeof( CHOOSECOLOR ); + cc.hwndOwner = _s->hWnd; + cc.rgbResult = ( COLORREF ) hb_parnl( 1 ); + cc.lpCustColors = crCustClr; + cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN ); if( ChooseColor( &cc ) ) { @@ -246,10 +246,10 @@ HB_FUNC( WVT_CHOOSECOLOR ) */ HB_FUNC( WVT_MESSAGEBOX ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - LPTSTR title = HB_TCHAR_CONVTO( hb_parc( 1 ) ); - LPTSTR msg = HB_TCHAR_CONVTO( hb_parc( 2 ) ); + LPTSTR title = HB_TCHAR_CONVTO( hb_parc( 1 ) ); + LPTSTR msg = HB_TCHAR_CONVTO( hb_parc( 2 ) ); hb_retni( MessageBox( _s->hWnd, title, msg, hb_parnidef( 3, MB_OK ) ) ); HB_TCHAR_FREE( title ); @@ -264,7 +264,7 @@ HB_FUNC( WVT_MESSAGEBOX ) HB_FUNC( WVT_SETTOOLTIPACTIVE ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); HB_BOOL bActive = _s->bToolTipActive; @@ -282,10 +282,10 @@ HB_FUNC( WVT_SETTOOLTIPACTIVE ) */ HB_FUNC( WVT_SETTOOLTIP ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); TOOLINFO ti; - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; int iTop, iLeft, iBottom, iRight; if( ! _s->bToolTipActive ) @@ -294,28 +294,28 @@ HB_FUNC( WVT_SETTOOLTIP ) } memset( &ti, 0, sizeof( ti ) ); - ti.cbSize = sizeof( TOOLINFO ); - ti.hwnd = _s->hWnd; - ti.uId = 100000; + ti.cbSize = sizeof( TOOLINFO ); + ti.hwnd = _s->hWnd; + ti.uId = 100000; if( SendMessage( _s->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) ) { LPTSTR text = HB_TCHAR_CONVTO( hb_parcx( 5 ) ); - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); - iTop = xy.y; - iLeft = xy.x; + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); + iTop = xy.y; + iLeft = xy.x; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); - iBottom = xy.y - 1; - iRight = xy.x - 1; + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + iBottom = xy.y - 1; + iRight = xy.x - 1; - ti.lpszText = text; + ti.lpszText = text; - ti.rect.left = iLeft; - ti.rect.top = iTop; - ti.rect.right = iRight; - ti.rect.bottom = iBottom; + ti.rect.left = iLeft; + ti.rect.top = iTop; + ti.rect.right = iRight; + ti.rect.bottom = iBottom; SendMessage( _s->hWndTT, TTM_SETTOOLINFO, 0, ( LPARAM ) &ti ); @@ -331,9 +331,9 @@ HB_FUNC( WVT_SETTOOLTIPTEXT ) TOOLINFO ti; - ti.cbSize = sizeof( TOOLINFO ); - ti.hwnd = _s->hWnd; - ti.uId = 100000; + ti.cbSize = sizeof( TOOLINFO ); + ti.hwnd = _s->hWnd; + ti.uId = 100000; if( SendMessage( _s->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) ) { @@ -349,14 +349,14 @@ HB_FUNC( WVT_SETTOOLTIPTEXT ) HB_FUNC( WVT_SETTOOLTIPMARGIN ) { #if ! defined( __WINCE__ ) - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - RECT rc = { 0, 0, 0, 0 }; + RECT rc = { 0, 0, 0, 0 }; - rc.left = hb_parni( 2 ); - rc.top = hb_parni( 1 ); - rc.right = hb_parni( 4 ); - rc.bottom = hb_parni( 3 ); + rc.left = hb_parni( 2 ); + rc.top = hb_parni( 1 ); + rc.right = hb_parni( 4 ); + rc.bottom = hb_parni( 3 ); SendMessage( _s->hWndTT, TTM_SETMARGIN, 0, ( LPARAM ) &rc ); #endif @@ -367,9 +367,9 @@ HB_FUNC( WVT_SETTOOLTIPMARGIN ) HB_FUNC( WVT_SETTOOLTIPWIDTH ) { #if ! defined( __WINCE__ ) - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iTipWidth = ( int ) SendMessage( _s->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 ); + int iTipWidth = ( int ) SendMessage( _s->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 ); if( HB_ISNUM( 1 ) ) { @@ -385,14 +385,13 @@ HB_FUNC( WVT_SETTOOLTIPWIDTH ) HB_FUNC( WVT_SETTOOLTIPBKCOLOR ) { #if ! defined( __WINCE__ ) - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - COLORREF cr = ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 ); + COLORREF cr = ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 ); if( HB_ISNUM( 1 ) ) - { SendMessage( _s->hWndTT, TTM_SETTIPBKCOLOR, ( WPARAM ) ( COLORREF ) hb_parnl( 1 ), 0 ); - } + hb_retnl( ( COLORREF ) cr ); #endif } @@ -402,14 +401,12 @@ HB_FUNC( WVT_SETTOOLTIPBKCOLOR ) HB_FUNC( WVT_SETTOOLTIPTEXTCOLOR ) { #if ! defined( __WINCE__ ) - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - COLORREF cr = ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 ); + COLORREF cr = ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 ); if( HB_ISNUM( 1 ) ) - { SendMessage( _s->hWndTT, TTM_SETTIPTEXTCOLOR, ( WPARAM ) ( COLORREF ) hb_parnl( 1 ), 0 ); - } hb_retnl( ( COLORREF ) cr ); #endif @@ -429,9 +426,8 @@ HB_FUNC( WVT_SETTOOLTIPTITLE ) { iIcon = hb_parni( 1 ); if( iIcon > 3 ) - { iIcon = 0; - } + SendMessage( _s->hWndTT, TTM_SETTITLE, ( WPARAM ) iIcon, ( LPARAM ) hb_parc( 2 ) ); } #endif @@ -475,14 +471,12 @@ HB_FUNC( WVT_GETTOOLTIPTEXTCOLOR ) HB_FUNC( WVT_SETGUI ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); HB_BOOL bGui = _s->bGui; if( HB_ISLOG( 1 ) ) - { _s->bGui = hb_parl( 1 ); - } hb_retl( bGui ); } @@ -491,27 +485,23 @@ HB_FUNC( WVT_SETGUI ) HB_FUNC( WVT_SETMOUSEPOS ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); if( ClientToScreen( _s->hWnd, &xy ) ) - { hb_retl( SetCursorPos( xy.x, xy.y + ( _s->PTEXTSIZE.y / 2 ) ) ); - } else - { hb_retl( HB_FALSE ); - } } /*----------------------------------------------------------------------*/ HB_FUNC( WVT_GETPAINTRECT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); PHB_ITEM info = hb_itemArrayNew( 4 ); @@ -527,80 +517,80 @@ HB_FUNC( WVT_GETPAINTRECT ) HB_FUNC( WVT_SETPOINTER ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); int iCursor = hb_parni( 1 ); HCURSOR hCursor; switch( iCursor ) { - case 1: - hCursor = LoadCursor( NULL, IDC_ARROW ); - break; + case 1: + hCursor = LoadCursor( NULL, IDC_ARROW ); + break; - case 2: - hCursor = LoadCursor( NULL, IDC_IBEAM ); - break; + case 2: + hCursor = LoadCursor( NULL, IDC_IBEAM ); + break; - case 3: - hCursor = LoadCursor( NULL, IDC_WAIT ); - break; + case 3: + hCursor = LoadCursor( NULL, IDC_WAIT ); + break; - case 4: - hCursor = LoadCursor( NULL, IDC_CROSS ); - break; + case 4: + hCursor = LoadCursor( NULL, IDC_CROSS ); + break; - case 5: - hCursor = LoadCursor( NULL, IDC_UPARROW ); - break; + case 5: + hCursor = LoadCursor( NULL, IDC_UPARROW ); + break; - case 6: - hCursor = LoadCursor( NULL, IDC_SIZE ); - break; + case 6: + hCursor = LoadCursor( NULL, IDC_SIZE ); + break; - case 7: - hCursor = LoadCursor( NULL, IDC_ICON ); - break; + case 7: + hCursor = LoadCursor( NULL, IDC_ICON ); + break; - case 8: - hCursor = LoadCursor( NULL, IDC_SIZENWSE ); - break; + case 8: + hCursor = LoadCursor( NULL, IDC_SIZENWSE ); + break; - case 9: - hCursor = LoadCursor( NULL, IDC_SIZENESW ); - break; + case 9: + hCursor = LoadCursor( NULL, IDC_SIZENESW ); + break; - case 10: - hCursor = LoadCursor( NULL, IDC_SIZEWE ); - break; + case 10: + hCursor = LoadCursor( NULL, IDC_SIZEWE ); + break; - case 11: - hCursor = LoadCursor( NULL, IDC_SIZENS ); - break; + case 11: + hCursor = LoadCursor( NULL, IDC_SIZENS ); + break; - case 12: - hCursor = LoadCursor( NULL, IDC_SIZEALL ); - break; + case 12: + hCursor = LoadCursor( NULL, IDC_SIZEALL ); + break; - case 13: - hCursor = LoadCursor( NULL, IDC_NO ); - break; + case 13: + hCursor = LoadCursor( NULL, IDC_NO ); + break; - case 14: - hCursor = LoadCursor( NULL, IDC_HAND ); - break; + case 14: + hCursor = LoadCursor( NULL, IDC_HAND ); + break; - case 15: - hCursor = LoadCursor( NULL, IDC_APPSTARTING ); - break; + case 15: + hCursor = LoadCursor( NULL, IDC_APPSTARTING ); + break; - case 16: - hCursor = LoadCursor( NULL, IDC_HELP ); - break; + case 16: + hCursor = LoadCursor( NULL, IDC_HELP ); + break; - default: - hCursor = LoadCursor( NULL, IDC_ARROW ); - break; + default: + hCursor = LoadCursor( NULL, IDC_ARROW ); + break; } #if ! defined( HB_ARCH_64BIT ) && ( defined( __WATCOMC__ ) || defined( __DMC__ ) || \ @@ -615,7 +605,7 @@ HB_FUNC( WVT_SETPOINTER ) HB_FUNC( WVT_SETMOUSEMOVE ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); HB_BOOL bMouseMove = _s->MouseMove; @@ -630,7 +620,7 @@ HB_FUNC( WVT_SETMOUSEMOVE ) HB_FUNC( WVT_GETXYFROMROWCOL ) { PHB_ITEM info = hb_itemArrayNew( 2 ); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); @@ -644,7 +634,7 @@ HB_FUNC( WVT_GETXYFROMROWCOL ) HB_FUNC( WVT_GETFONTINFO ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); PHB_ITEM info = hb_itemArrayNew( 7 ); @@ -671,11 +661,11 @@ HB_FUNC( WVT_GETFONTINFO ) HB_FUNC( WVT_SETMENU ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - RECT wi = { 0, 0, 0, 0 }; - RECT ci = { 0, 0, 0, 0 }; - RECT rc = { 0, 0, 0, 0 }; + RECT wi = { 0, 0, 0, 0 }; + RECT ci = { 0, 0, 0, 0 }; + RECT rc = { 0, 0, 0, 0 }; int height, width; SetMenu( _s->hWnd, ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ) ); @@ -683,16 +673,16 @@ HB_FUNC( WVT_SETMENU ) GetWindowRect( _s->hWnd, &wi ); GetClientRect( _s->hWnd, &ci ); - height = ( int ) ( _s->PTEXTSIZE.y * _s->ROWS ); - width = ( int ) ( _s->PTEXTSIZE.x * _s->COLS ); + height = ( int ) ( _s->PTEXTSIZE.y * _s->ROWS ); + width = ( int ) ( _s->PTEXTSIZE.x * _s->COLS ); - width += ( int ) ( wi.right - wi.left - ci.right ); + width += ( int ) ( wi.right - wi.left - ci.right ); height += ( int ) ( wi.bottom - wi.top - ci.bottom ); if( _s->CentreWindow && SystemParametersInfo( SPI_GETWORKAREA, 0, &rc, 0 ) ) { wi.left = rc.left + ( ( rc.right - rc.left - width ) / 2 ); - wi.top = rc.top + ( ( rc.bottom - rc.top - height ) / 2 ); + wi.top = rc.top + ( ( rc.bottom - rc.top - height ) / 2 ); } SetWindowPos( _s->hWnd, NULL, wi.left, wi.top, width, height, SWP_NOZORDER ); } @@ -701,9 +691,9 @@ HB_FUNC( WVT_SETMENU ) HB_FUNC( WVT_SETPOPUPMENU ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - HMENU hPopup = _s->hPopup; + HMENU hPopup = _s->hPopup; _s->hPopup = ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ); if( hPopup ) @@ -769,9 +759,9 @@ HB_FUNC( WVT_GETLASTMENUEVENT ) HB_FUNC( WVT_SETLASTMENUEVENT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iEvent = _s->LastMenuEvent; + int iEvent = _s->LastMenuEvent; if( HB_ISNUM( 1 ) ) _s->LastMenuEvent = hb_parni( 1 ); @@ -783,9 +773,9 @@ HB_FUNC( WVT_SETLASTMENUEVENT ) HB_FUNC( WVT_SETMENUKEYEVENT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - int iOldEvent = _s->MenuKeyEvent; + int iOldEvent = _s->MenuKeyEvent; if( HB_ISNUM( 1 ) ) _s->MenuKeyEvent = hb_parni( 1 ); @@ -806,7 +796,7 @@ HB_FUNC( WVT_DRAWMENUBAR ) HB_FUNC( WVT_ENABLESHORTCUTS ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); HB_BOOL bWas = _s->EnableShortCuts; @@ -820,17 +810,17 @@ HB_FUNC( WVT_ENABLESHORTCUTS ) HB_FUNC( WVT_INVALIDATERECT ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - RECT rc = { 0, 0, 0, 0 }; - POINT xy = { 0, 0 }; + RECT rc = { 0, 0, 0, 0 }; + POINT xy = { 0, 0 }; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); - rc.top = xy.y; - rc.left = xy.x; - xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); - rc.bottom = xy.y - 1; - rc.right = xy.x - 1; + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); + rc.top = xy.y; + rc.left = xy.x; + xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); + rc.bottom = xy.y - 1; + rc.right = xy.x - 1; InvalidateRect( _s->hWnd, &rc, TRUE ); } @@ -846,10 +836,10 @@ HB_FUNC( WVT_ISLBUTTONPRESSED ) HB_FUNC( WVT_CLIENTTOSCREEN ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); PHB_ITEM info = hb_itemArrayNew( 2 ); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); @@ -865,7 +855,7 @@ HB_FUNC( WVT_CLIENTTOSCREEN ) HB_FUNC( WVT_GETCURSORPOS ) { - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; PHB_ITEM info = hb_itemArrayNew( 2 ); GetCursorPos( &xy ); @@ -880,9 +870,9 @@ HB_FUNC( WVT_GETCURSORPOS ) HB_FUNC( WVT_TRACKPOPUPMENU ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; GetCursorPos( &xy ); @@ -916,15 +906,15 @@ HB_FUNC( WVT_GETMENU ) HB_FUNC( WVT_CREATEDIALOGDYNAMIC ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY ); - PHB_ITEM pFunc = NULL; + PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY ); + PHB_ITEM pFunc = NULL; PHB_DYNS pExecSym; - HWND hDlg = 0; - int iType = 0; + HWND hDlg = 0; + int iType = 0; int iIndex; - int iResource = hb_parni( 4 ); + int iResource = hb_parni( 4 ); /* check if we still have room for a new dialog */ for( iIndex = 0; iIndex < WVT_DLGML_MAX; iIndex++ ) @@ -945,8 +935,8 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC ) if( HB_IS_BLOCK( pFirst ) ) { /* pFunc is pointing to stored code block (later) */ - pFunc = hb_itemNew( pFirst ); - iType = 2; + pFunc = hb_itemNew( pFirst ); + iType = 2; } else if( hb_itemType( pFirst ) == HB_IT_STRING ) { @@ -972,31 +962,31 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC ) { switch( iResource ) { - case 0: - { - LPTSTR lpTemplate = HB_TCHAR_CONVTO( hb_parc( 1 ) ); - hDlg = CreateDialog( ( HINSTANCE ) wvg_hInstance(), - lpTemplate, - hb_parl( 2 ) ? _s->hWnd : NULL, - ( DLGPROC ) hb_wvt_gtDlgProcMLess ); - HB_TCHAR_FREE( lpTemplate ); - } - break; - - case 1: - hDlg = CreateDialog( ( HINSTANCE ) wvg_hInstance(), - MAKEINTRESOURCE( ( WORD ) hb_parni( 1 ) ), - hb_parl( 2 ) ? _s->hWnd : NULL, - ( DLGPROC ) hb_wvt_gtDlgProcMLess ); + case 0: + { + LPTSTR lpTemplate = HB_TCHAR_CONVTO( hb_parc( 1 ) ); + hDlg = CreateDialog( ( HINSTANCE ) wvg_hInstance(), + lpTemplate, + hb_parl( 2 ) ? _s->hWnd : NULL, + ( DLGPROC ) hb_wvt_gtDlgProcMLess ); + HB_TCHAR_FREE( lpTemplate ); + } break; - case 2: - /* hb_parc( 1 ) is already unicode compliant, so no conversion */ - hDlg = CreateDialogIndirect( ( HINSTANCE ) wvg_hInstance(), - ( LPDLGTEMPLATE ) hb_parc( 1 ), - hb_parl( 2 ) ? _s->hWnd : NULL, - ( DLGPROC ) hb_wvt_gtDlgProcMLess ); - break; + case 1: + hDlg = CreateDialog( ( HINSTANCE ) wvg_hInstance(), + MAKEINTRESOURCE( ( WORD ) hb_parni( 1 ) ), + hb_parl( 2 ) ? _s->hWnd : NULL, + ( DLGPROC ) hb_wvt_gtDlgProcMLess ); + break; + + case 2: + /* hb_parc( 1 ) is already unicode compliant, so no conversion */ + hDlg = CreateDialogIndirect( ( HINSTANCE ) wvg_hInstance(), + ( LPDLGTEMPLATE ) hb_parc( 1 ), + hb_parl( 2 ) ? _s->hWnd : NULL, + ( DLGPROC ) hb_wvt_gtDlgProcMLess ); + break; } } @@ -1026,9 +1016,8 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC ) { /* if codeblock item created earlier, release it */ if( iType == 2 && pFunc ) - { hb_itemRelease( pFunc ); - } + _s->hDlgModeless[ iIndex ] = NULL; } } @@ -1040,23 +1029,21 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC ) HB_FUNC( WVT_CREATEDIALOGMODAL ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY ); - PHB_ITEM pFunc = NULL; + PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY ); + PHB_ITEM pFunc = NULL; PHB_DYNS pExecSym; int iIndex; - int iResource = hb_parni( 4 ); - HB_PTRDIFF iResult = 0; - HWND hParent = HB_ISNUM( 5 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ) : _s->hWnd; + int iResource = hb_parni( 4 ); + HB_PTRDIFF iResult = 0; + HWND hParent = HB_ISNUM( 5 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ) : _s->hWnd; /* check if we still have room for a new dialog */ for( iIndex = 0; iIndex < WVT_DLGMD_MAX; iIndex++ ) { if( _s->hDlgModal[ iIndex ] == NULL ) - { break; - } } if( iIndex >= WVT_DLGMD_MAX ) @@ -1070,11 +1057,11 @@ HB_FUNC( WVT_CREATEDIALOGMODAL ) { /* pFunc is pointing to stored code block (later) */ - _s->pcbFuncModal[ iIndex ] = hb_itemNew( pFirst ); + _s->pcbFuncModal[ iIndex ] = hb_itemNew( pFirst ); - pFunc = _s->pcbFuncModal[ iIndex ]; - _s->pFuncModal[ iIndex ] = pFunc; - _s->iTypeModal[ iIndex ] = 2; + pFunc = _s->pcbFuncModal[ iIndex ]; + _s->pFuncModal[ iIndex ] = pFunc; + _s->iTypeModal[ iIndex ] = 2; } else if( hb_itemType( pFirst ) == HB_IT_STRING ) { @@ -1083,40 +1070,40 @@ HB_FUNC( WVT_CREATEDIALOGMODAL ) { pFunc = ( PHB_ITEM ) pExecSym; } - _s->pFuncModal[ iIndex ] = pFunc; - _s->iTypeModal[ iIndex ] = 1; + _s->pFuncModal[ iIndex ] = pFunc; + _s->iTypeModal[ iIndex ] = 1; } switch( iResource ) { - case 0: - { - LPTSTR lpTemplate = HB_TCHAR_CONVTO( hb_parc( 1 ) ); - iResult = DialogBoxParam( ( HINSTANCE ) wvg_hInstance(), - lpTemplate, - hParent, - ( DLGPROC ) hb_wvt_gtDlgProcModal, - ( LPARAM ) ( DWORD ) iIndex + 1 ); - HB_TCHAR_FREE( lpTemplate ); - } - break; - - case 1: - iResult = DialogBoxParam( ( HINSTANCE ) wvg_hInstance(), - MAKEINTRESOURCE( ( WORD ) hb_parni( 1 ) ), - hParent, - ( DLGPROC ) hb_wvt_gtDlgProcModal, - ( LPARAM ) ( DWORD ) iIndex + 1 ); + case 0: + { + LPTSTR lpTemplate = HB_TCHAR_CONVTO( hb_parc( 1 ) ); + iResult = DialogBoxParam( ( HINSTANCE ) wvg_hInstance(), + lpTemplate, + hParent, + ( DLGPROC ) hb_wvt_gtDlgProcModal, + ( LPARAM ) ( DWORD ) iIndex + 1 ); + HB_TCHAR_FREE( lpTemplate ); + } break; - case 2: - /* hb_parc( 1 ) is already unicode compliant, so no conversion */ - iResult = DialogBoxIndirectParam( ( HINSTANCE ) wvg_hInstance(), - ( LPDLGTEMPLATE ) hb_parc( 1 ), - hParent, - ( DLGPROC ) hb_wvt_gtDlgProcModal, - ( LPARAM ) ( DWORD ) iIndex + 1 ); - break; + case 1: + iResult = DialogBoxParam( ( HINSTANCE ) wvg_hInstance(), + MAKEINTRESOURCE( ( WORD ) hb_parni( 1 ) ), + hParent, + ( DLGPROC ) hb_wvt_gtDlgProcModal, + ( LPARAM ) ( DWORD ) iIndex + 1 ); + break; + + case 2: + /* hb_parc( 1 ) is already unicode compliant, so no conversion */ + iResult = DialogBoxIndirectParam( ( HINSTANCE ) wvg_hInstance(), + ( LPDLGTEMPLATE ) hb_parc( 1 ), + hParent, + ( DLGPROC ) hb_wvt_gtDlgProcModal, + ( LPARAM ) ( DWORD ) iIndex + 1 ); + break; } hb_retnint( iResult ); @@ -1137,22 +1124,22 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE ) /* 64k allow to build up to 255 items on the dialog */ /* */ - pdlgtemplate = p = ( PWORD ) LocalAlloc( LPTR, 65534 ); + pdlgtemplate = p = ( PWORD ) LocalAlloc( LPTR, 65534 ); - lStyle = hb_parvnl( 1, 3 ); + lStyle = hb_parvnl( 1, 3 ); /* start to fill in the dlgtemplate information. addressing by WORDs */ *p++ = 1; /* version */ *p++ = 0xFFFF; /* signature */ - *p++ = LOWORD ( hb_parvnl( 1, 1 ) ); /* Help Id */ - *p++ = HIWORD ( hb_parvnl( 1, 1 ) ); + *p++ = LOWORD( hb_parvnl( 1, 1 ) ); /* Help Id */ + *p++ = HIWORD( hb_parvnl( 1, 1 ) ); - *p++ = LOWORD ( hb_parvnl( 1, 2 ) ); /* ext. style */ - *p++ = HIWORD ( hb_parvnl( 1, 2 ) ); + *p++ = LOWORD( hb_parvnl( 1, 2 ) ); /* ext. style */ + *p++ = HIWORD( hb_parvnl( 1, 2 ) ); - *p++ = LOWORD ( lStyle ); - *p++ = HIWORD ( lStyle ); + *p++ = LOWORD( lStyle ); + *p++ = HIWORD( lStyle ); *p++ = ( WORD ) nItems; /* NumberOfItems */ *p++ = ( short ) hb_parvni( 1, 5 ); /* x */ @@ -1164,8 +1151,8 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE ) if( hb_parinfa( 1, 11 ) == HB_IT_STRING ) { - nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 1, 11 ) ); - p += nchar; + nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 1, 11 ) ); + p += nchar; } else { @@ -1175,40 +1162,40 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE ) if( ( lStyle & DS_SETFONT ) ) { - *p++ = ( short ) hb_parvni( 1, 12 ); - *p++ = ( short ) hb_parvni( 1, 13 ); - *p++ = ( short ) hb_parvni( 1, 14 ); + *p++ = ( short ) hb_parvni( 1, 12 ); + *p++ = ( short ) hb_parvni( 1, 13 ); + *p++ = ( short ) hb_parvni( 1, 14 ); - nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 1, 15 ) ); - p += nchar; + nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 1, 15 ) ); + p += nchar; } for( i = 1; i <= nItems; i++ ) { /* make sure each item starts on a DWORD boundary */ - p = lpwAlign ( p ); + p = lpwAlign( p ); - *p++ = LOWORD ( hb_parvnl( 2, i ) ); /* help id */ - *p++ = HIWORD ( hb_parvnl( 2, i ) ); + *p++ = LOWORD( hb_parvnl( 2, i ) ); /* help id */ + *p++ = HIWORD( hb_parvnl( 2, i ) ); - *p++ = LOWORD ( hb_parvnl( 3, i ) ); /* ext. style */ - *p++ = HIWORD ( hb_parvnl( 3, i ) ); + *p++ = LOWORD( hb_parvnl( 3, i ) ); /* ext. style */ + *p++ = HIWORD( hb_parvnl( 3, i ) ); - *p++ = LOWORD ( hb_parvnl( 4, i ) ); /* style */ - *p++ = HIWORD ( hb_parvnl( 4, i ) ); + *p++ = LOWORD( hb_parvnl( 4, i ) ); /* style */ + *p++ = HIWORD( hb_parvnl( 4, i ) ); *p++ = ( short ) hb_parvni( 5, i ); /* x */ *p++ = ( short ) hb_parvni( 6, i ); /* y */ *p++ = ( short ) hb_parvni( 7, i ); /* cx */ *p++ = ( short ) hb_parvni( 8, i ); /* cy */ - *p++ = LOWORD ( hb_parvnl( 9, i ) ); /* id */ - *p++ = HIWORD ( hb_parvnl( 9, i ) ); /* id */ + *p++ = LOWORD( hb_parvnl( 9, i ) ); /* id */ + *p++ = HIWORD( hb_parvnl( 9, i ) ); /* id */ if( hb_parinfa( 10, i ) == HB_IT_STRING ) { - nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 10, i ) ); /* class */ - p += nchar; + nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 10, i ) ); /* class */ + p += nchar; } else { @@ -1218,8 +1205,8 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE ) if( hb_parinfa( 11, i ) == HB_IT_STRING ) { - nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 11, i ) ); /* text */ - p += nchar; + nchar = nCopyAnsiToWideChar( p, ( LPCSTR ) hb_parvc( 11, i ) ); /* text */ + p += nchar; } else { @@ -1246,7 +1233,7 @@ LPWORD lpwAlign( LPWORD lpIn ) { HB_PTRDIFF ul = ( HB_PTRDIFF ) lpIn; - ul += 3; + ul += 3; ul >>= 2; ul <<= 2; return ( LPWORD ) ul; @@ -1354,10 +1341,10 @@ HB_FUNC( WVT_DLGSETICON ) HB_FUNC( WVT_GETFONTHANDLE ) { - PHB_GTWVT _s = hb_wvt_gtGetWVT(); + PHB_GTWVT _s = hb_wvt_gtGetWVT(); - HFONT hFont = 0; - int iSlot = hb_parni( 1 ) - 1; + HFONT hFont = 0; + int iSlot = hb_parni( 1 ) - 1; if( iSlot >= 0 && iSlot < WVT_PICTURES_MAX ) hFont = _s->pGUI->hUserFonts[ iSlot ]; @@ -1379,9 +1366,9 @@ HB_BOOL wvt_Array2Rect( PHB_ITEM aRect, RECT * rc ) { if( HB_IS_ARRAY( aRect ) && hb_arrayLen( aRect ) == 4 ) { - rc->left = hb_arrayGetNL( aRect, 1 ); - rc->top = hb_arrayGetNL( aRect, 2 ); - rc->right = hb_arrayGetNL( aRect, 3 ); + rc->left = hb_arrayGetNL( aRect, 1 ); + rc->top = hb_arrayGetNL( aRect, 2 ); + rc->right = hb_arrayGetNL( aRect, 3 ); rc->bottom = hb_arrayGetNL( aRect, 4 ); return HB_TRUE; } @@ -1408,8 +1395,8 @@ HB_BOOL wvt_Array2Point( PHB_ITEM aPoint, POINT * pt ) { if( HB_IS_ARRAY( aPoint ) && hb_arrayLen( aPoint ) == 2 ) { - pt->x = hb_arrayGetNL( aPoint, 1 ); - pt->y = hb_arrayGetNL( aPoint, 2 ); + pt->x = hb_arrayGetNL( aPoint, 1 ); + pt->y = hb_arrayGetNL( aPoint, 2 ); return HB_TRUE; } return HB_FALSE; @@ -1489,27 +1476,27 @@ HB_FUNC( WVT__GETOPENFILENAME ) LPTSTR lpFileName, lpstrTitle, lpstrFilter, lpstrInitialDir, lpstrDefExt; DWORD size = ( DWORD ) hb_parclen( 2 ); - size += size ? 1 : 1024; - lpFileName = ( LPTSTR ) hb_xgrab( size * sizeof( TCHAR ) ); + size += size ? 1 : 1024; + lpFileName = ( LPTSTR ) hb_xgrab( size * sizeof( TCHAR ) ); HB_TCHAR_COPYTO( lpFileName, hb_parcx( 2 ), size - 1 ); - lpstrTitle = HB_PARTSTR( 3 ); - lpstrFilter = HB_PARTSTR( 4 ); - lpstrInitialDir = HB_PARTSTR( 6 ); - lpstrDefExt = HB_PARTSTR( 7 ); + lpstrTitle = HB_PARTSTR( 3 ); + lpstrFilter = HB_PARTSTR( 4 ); + lpstrInitialDir = HB_PARTSTR( 6 ); + lpstrDefExt = HB_PARTSTR( 7 ); memset( &ofn, 0, sizeof( ofn ) ); - ofn.hInstance = GetModuleHandle( NULL ); - ofn.lStructSize = sizeof( ofn ); - ofn.hwndOwner = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow(); - ofn.lpstrTitle = lpstrTitle; - ofn.lpstrFilter = lpstrFilter; - ofn.Flags = hb_parnldef( 5, OFN_SHOWHELP | OFN_NOCHANGEDIR ); + ofn.hInstance = GetModuleHandle( NULL ); + ofn.lStructSize = sizeof( ofn ); + ofn.hwndOwner = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow(); + ofn.lpstrTitle = lpstrTitle; + ofn.lpstrFilter = lpstrFilter; + ofn.Flags = hb_parnldef( 5, OFN_SHOWHELP | OFN_NOCHANGEDIR ); ofn.lpstrInitialDir = lpstrInitialDir; - ofn.lpstrDefExt = lpstrDefExt; - ofn.nFilterIndex = hb_parni( 8 ); - ofn.lpstrFile = lpFileName; - ofn.nMaxFile = size; + ofn.lpstrDefExt = lpstrDefExt; + ofn.nFilterIndex = hb_parni( 8 ); + ofn.lpstrFile = lpFileName; + ofn.nMaxFile = size; if( GetOpenFileName( &ofn ) ) { @@ -1520,9 +1507,8 @@ HB_FUNC( WVT__GETOPENFILENAME ) HB_TCHAR_FREE( szFileName ); } else - { hb_retc_null(); - } + hb_xfree( lpFileName ); HB_PARTFREE( lpstrTitle ); HB_PARTFREE( lpstrFilter ); @@ -1539,24 +1525,24 @@ HB_FUNC( WVT__GETSAVEFILENAME ) TCHAR lpFileName[ MAX_PATH + 1 ]; HB_TCHAR_COPYTO( lpFileName, hb_parcx( 2 ), MAX_PATH ); - lpstrTitle = HB_PARTSTR( 3 ); - lpstrFilter = HB_PARTSTR( 4 ); - lpstrInitialDir = HB_PARTSTR( 6 ); - lpstrDefExt = HB_PARTSTR( 7 ); + lpstrTitle = HB_PARTSTR( 3 ); + lpstrFilter = HB_PARTSTR( 4 ); + lpstrInitialDir = HB_PARTSTR( 6 ); + lpstrDefExt = HB_PARTSTR( 7 ); memset( &ofn, 0, sizeof( ofn ) ); - ofn.hInstance = GetModuleHandle( NULL ); - ofn.lStructSize = sizeof( ofn ); - ofn.hwndOwner = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow(); - ofn.lpstrTitle = lpstrTitle; - ofn.lpstrFilter = lpstrFilter; - ofn.Flags = hb_parnldef( 5, OFN_FILEMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR ); + ofn.hInstance = GetModuleHandle( NULL ); + ofn.lStructSize = sizeof( ofn ); + ofn.hwndOwner = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow(); + ofn.lpstrTitle = lpstrTitle; + ofn.lpstrFilter = lpstrFilter; + ofn.Flags = hb_parnldef( 5, OFN_FILEMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR ); ofn.lpstrInitialDir = lpstrInitialDir; - ofn.lpstrDefExt = lpstrDefExt; - ofn.nFilterIndex = hb_parni( 8 ); - ofn.lpstrFile = lpFileName; - ofn.nMaxFile = MAX_PATH; + ofn.lpstrDefExt = lpstrDefExt; + ofn.nFilterIndex = hb_parni( 8 ); + ofn.lpstrFile = lpFileName; + ofn.nMaxFile = MAX_PATH; if( GetSaveFileName( &ofn ) ) { @@ -1566,9 +1552,7 @@ HB_FUNC( WVT__GETSAVEFILENAME ) HB_TCHAR_FREE( szFileName ); } else - { hb_retc_null(); - } HB_PARTFREE( lpstrTitle ); HB_PARTFREE( lpstrFilter ); diff --git a/harbour/contrib/gtwvg/wvgwin.c b/harbour/contrib/gtwvg/wvgwin.c index 0afc5f5e5f..0a2e79ebc0 100644 --- a/harbour/contrib/gtwvg/wvgwin.c +++ b/harbour/contrib/gtwvg/wvgwin.c @@ -143,14 +143,14 @@ HB_FUNC( WVG_SENDMESSAGE ) HB_FUNC( WVG_SENDDLGITEMMESSAGE ) { - PHB_ITEM pText = hb_param( 5, HB_IT_STRING ); - char * cText = NULL; - HB_ISIZ iLen = 0; + PHB_ITEM pText = hb_param( 5, HB_IT_STRING ); + char * cText = NULL; + HB_ISIZ iLen = 0; if( pText ) { - iLen = hb_itemGetCLen( pText ); - cText = ( char * ) hb_xgrab( iLen + 1 ); + iLen = hb_itemGetCLen( pText ); + cText = ( char * ) hb_xgrab( iLen + 1 ); hb_xmemcpy( cText, hb_itemGetCPtr( pText ), iLen + 1 ); } @@ -268,8 +268,8 @@ HB_FUNC( WVG_SETDLGITEMTEXT ) HB_FUNC( WVG_GETDLGITEMTEXT ) { - int iLen = ( int ) SendMessage( GetDlgItem( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ) ), WM_GETTEXTLENGTH, 0, 0 ) + 1; - LPTSTR cText = ( LPTSTR ) hb_xgrab( iLen * sizeof( TCHAR ) ); + int iLen = ( int ) SendMessage( GetDlgItem( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ) ), WM_GETTEXTLENGTH, 0, 0 ) + 1; + LPTSTR cText = ( LPTSTR ) hb_xgrab( iLen * sizeof( TCHAR ) ); char * szText; UINT iResult; @@ -280,7 +280,7 @@ HB_FUNC( WVG_GETDLGITEMTEXT ) ); cText[ iResult ] = '\0'; - szText = HB_TCHAR_CONVFROM( cText ); + szText = HB_TCHAR_CONVFROM( cText ); hb_retc( szText ); HB_TCHAR_FREE( szText ); hb_xfree( cText ); @@ -323,8 +323,8 @@ HB_FUNC( WVG_GETDLGITEM ) HB_FUNC( WVG_MESSAGEBOX ) { - HWND hWnd = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow(); - LPTSTR lpMsg = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); + HWND hWnd = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow(); + LPTSTR lpMsg = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); LPTSTR lpTitle = HB_TCHAR_CONVTO( HB_ISCHAR( 3 ) ? hb_parc( 3 ) : "Info" ); hb_retni( MessageBox( hWnd, lpMsg, lpTitle, hb_parnidef( 4, MB_OK ) ) ); @@ -341,10 +341,10 @@ HB_FUNC( WVG_INVALIDATERECT ) { RECT rc = { 0, 0, 0, 0 }; - rc.left = hb_parvni( 2, 1 ); - rc.top = hb_parvni( 2, 2 ); - rc.right = hb_parvni( 2, 3 ); - rc.bottom = hb_parvni( 2, 4 ); + rc.left = hb_parvni( 2, 1 ); + rc.top = hb_parvni( 2, 2 ); + rc.right = hb_parvni( 2, 3 ); + rc.bottom = hb_parvni( 2, 4 ); hb_retl( InvalidateRect( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), &rc, TRUE ) ); } @@ -383,23 +383,23 @@ HB_FUNC( WVG_LOADICON ) */ HB_FUNC( WVG_LOADIMAGE ) { - HBITMAP hImage = 0; - LPTSTR lpBuffer = HB_TCHAR_CONVTO( hb_parcx( 1 ) ); - int iSource = hb_parni( 2 ); + HBITMAP hImage = 0; + LPTSTR lpBuffer = HB_TCHAR_CONVTO( hb_parcx( 1 ) ); + int iSource = hb_parni( 2 ); switch( iSource ) { - case 0: - hImage = LoadBitmap( ( HINSTANCE ) wvg_hInstance(), MAKEINTRESOURCE( hb_parni( 1 ) ) ); - break; + case 0: + hImage = LoadBitmap( ( HINSTANCE ) wvg_hInstance(), MAKEINTRESOURCE( hb_parni( 1 ) ) ); + break; - case 1: - hImage = LoadBitmap( ( HINSTANCE ) wvg_hInstance(), lpBuffer ); - break; + case 1: + hImage = LoadBitmap( ( HINSTANCE ) wvg_hInstance(), lpBuffer ); + break; - case 2: - hImage = ( HBITMAP ) LoadImage( ( HINSTANCE ) NULL, lpBuffer, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); - break; + case 2: + hImage = ( HBITMAP ) LoadImage( ( HINSTANCE ) NULL, lpBuffer, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + break; } HB_TCHAR_FREE( lpBuffer ); @@ -410,7 +410,7 @@ HB_FUNC( WVG_LOADIMAGE ) HB_FUNC( WVG_GETCLIENTRECT ) { - RECT rc = { 0, 0, 0, 0 }; + RECT rc = { 0, 0, 0, 0 }; PHB_ITEM info = hb_itemArrayNew( 4 ); GetClientRect( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), &rc ); @@ -466,13 +466,13 @@ HB_FUNC( WVG_CREATEBRUSH ) */ HB_FUNC( WVG_DRAWTEXT ) { - RECT rc = { 0, 0, 0, 0 }; - LPTSTR lpBuffer = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); + RECT rc = { 0, 0, 0, 0 }; + LPTSTR lpBuffer = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); - rc.left = hb_parvni( 3, 1 ); - rc.top = hb_parvni( 3, 2 ); - rc.right = hb_parvni( 3, 3 ); - rc.bottom = hb_parvni( 3, 4 ); + rc.left = hb_parvni( 3, 1 ); + rc.top = hb_parvni( 3, 2 ); + rc.right = hb_parvni( 3, 3 ); + rc.bottom = hb_parvni( 3, 4 ); hb_retl( DrawText( ( HDC ) ( HB_PTRDIFF ) hb_parnint( 1 ), lpBuffer, lstrlen( lpBuffer ), &rc, hb_parni( 4 ) ) ); HB_TCHAR_FREE( lpBuffer ); @@ -637,13 +637,13 @@ HB_FUNC( WVG_NOT ) HB_FUNC( WVG_TRACKPOPUPMENU ) { - HMENU hMenu = ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ); - UINT uFlags = hb_parnldef( 2, TPM_CENTERALIGN | TPM_RETURNCMD ); - int x = hb_parni( 3 ); - int y = hb_parni( 4 ); - HWND hWnd = HB_ISNUM( 5 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ) : GetActiveWindow(); + HMENU hMenu = ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ); + UINT uFlags = hb_parnldef( 2, TPM_CENTERALIGN | TPM_RETURNCMD ); + int x = hb_parni( 3 ); + int y = hb_parni( 4 ); + HWND hWnd = HB_ISNUM( 5 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ) : GetActiveWindow(); - POINT xy = { 0, 0 }; + POINT xy = { 0, 0 }; if( ! HB_ISNUM( 3 ) ) { @@ -669,11 +669,11 @@ HB_FUNC( WVG_CHOOSECOLOR ) for( i = 0; i < ( int ) HB_SIZEOFARRAY( crCustClr ); i++ ) crCustClr[ i ] = ( HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i + 1 ) : GetSysColor( COLOR_BTNFACE ) ); - cc.lStructSize = sizeof( CHOOSECOLOR ); - cc.hwndOwner = HB_ISNUM( 4 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 4 ) : NULL; - cc.rgbResult = ( COLORREF ) hb_parnl( 1 ); - cc.lpCustColors = crCustClr; - cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN ); + cc.lStructSize = sizeof( CHOOSECOLOR ); + cc.hwndOwner = HB_ISNUM( 4 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 4 ) : NULL; + cc.rgbResult = ( COLORREF ) hb_parnl( 1 ); + cc.lpCustColors = crCustClr; + cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN ); if( ChooseColor( &cc ) ) hb_retnl( cc.rgbResult ); @@ -688,8 +688,8 @@ HB_FUNC( WVG_FINDWINDOW ) HWND hwnd; LPTSTR lpStr; - lpStr = HB_TCHAR_CONVTO( hb_parcx( 1 ) ); - hwnd = FindWindow( NULL, lpStr ); + lpStr = HB_TCHAR_CONVTO( hb_parcx( 1 ) ); + hwnd = FindWindow( NULL, lpStr ); HB_TCHAR_FREE( lpStr ); if( hwnd ) @@ -715,18 +715,18 @@ HB_FUNC( WVG_SETMENU ) #if 1 HB_BOOL bSet; - RECT wi = { 0, 0, 0, 0 }; - RECT ci = { 0, 0, 0, 0 }; + RECT wi = { 0, 0, 0, 0 }; + RECT ci = { 0, 0, 0, 0 }; int height, width; bSet = SetMenu( hWnd, ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 2 ) ); GetWindowRect( hWnd, &wi ); GetClientRect( hWnd, &ci ); - height = ( ci.bottom - ci.top ); - width = ( ci.right - ci.left ); + height = ( ci.bottom - ci.top ); + width = ( ci.right - ci.left ); - width += ( wi.right - wi.left - ci.right ); + width += ( wi.right - wi.left - ci.right ); height += ( wi.bottom - wi.top - ci.bottom ); SetWindowPos( hWnd, NULL, wi.left, wi.top, width, height, SWP_NOZORDER ); @@ -855,8 +855,8 @@ HB_FUNC( WVG_MAKELPARAM ) HB_FUNC( WVG_CREATEWINDOWEX ) { HWND hWnd; - LPTSTR szClassName = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); - LPTSTR szWinName = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); + LPTSTR szClassName = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); + LPTSTR szWinName = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); hWnd = CreateWindowEx( ( DWORD ) hb_parnint( 1 ), szClassName, @@ -904,7 +904,7 @@ HB_FUNC( WVG_GETMESSAGETEXT ) HB_FUNC( WVG_SETWNDPROC ) { - HWND hWnd = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ); + HWND hWnd = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ); WNDPROC wndProc = ( WNDPROC ) ( HB_PTRDIFF ) hb_parnint( 2 ); WNDPROC oldProc; @@ -1155,7 +1155,7 @@ HB_FUNC( WVG_SETLAYEREDWINDOWATTRIBUTES ) if( pfnLayered ) { HWND hWnd = hbwapi_par_raw_HWND( 1 ); - COLORREF cr = HB_ISNUM( 2 ) ? hbwapi_par_COLORREF( 2 ) : RGB( 255, 255, 255 ); + COLORREF cr = HB_ISNUM( 2 ) ? hbwapi_par_COLORREF( 2 ) : RGB( 255, 255, 255 ); SetWindowLong( hWnd, GWL_EXSTYLE, GetWindowLong( hWnd, GWL_EXSTYLE ) | WS_EX_LAYERED ); @@ -1174,173 +1174,173 @@ HB_FUNC( WVG_SETLAYEREDWINDOWATTRIBUTES ) HB_FUNC( WVG_SENDTOOLBARMESSAGE ) { /* #if ! defined( HB_OS_WIN_CE ) */ - HWND hTB = hbwapi_par_raw_HWND( 1 ); - int msg = hbwapi_par_INT( 2 ); + HWND hTB = hbwapi_par_raw_HWND( 1 ); + int msg = hbwapi_par_INT( 2 ); switch( msg ) { - case TB_ADDBITMAP: - { - TBADDBITMAP tbab; + case TB_ADDBITMAP: + { + TBADDBITMAP tbab; - tbab.hInst = NULL; + tbab.hInst = NULL; #if ( _WIN32_IE >= 0x0500 ) - tbab.nID = ( UINT_PTR ) hbwapi_par_raw_HBITMAP( 3 ); + tbab.nID = ( UINT_PTR ) hbwapi_par_raw_HBITMAP( 3 ); #else - tbab.nID = ( UINT ) hbwapi_par_raw_HBITMAP( 3 ); + tbab.nID = ( UINT ) hbwapi_par_raw_HBITMAP( 3 ); #endif - hbwapi_ret_NI( ( int ) SendMessage( hTB, TB_ADDBITMAP, ( WPARAM ) 1, ( LPARAM ) &tbab ) ); - break; - } - case TB_ADDBUTTONS: - { - TBBUTTON tbb; + hbwapi_ret_NI( ( int ) SendMessage( hTB, TB_ADDBITMAP, ( WPARAM ) 1, ( LPARAM ) &tbab ) ); + break; + } + case TB_ADDBUTTONS: + { + TBBUTTON tbb; - tbb.iBitmap = hbwapi_par_INT( 3 ); - tbb.idCommand = hbwapi_par_INT( 4 ); - tbb.fsState = TBSTATE_ENABLED; - tbb.fsStyle = TBSTYLE_BUTTON; - tbb.dwData = 0; - tbb.iString = hbwapi_par_INT( 5 ); + tbb.iBitmap = hbwapi_par_INT( 3 ); + tbb.idCommand = hbwapi_par_INT( 4 ); + tbb.fsState = TBSTATE_ENABLED; + tbb.fsStyle = TBSTYLE_BUTTON; + tbb.dwData = 0; + tbb.iString = hbwapi_par_INT( 5 ); - hbwapi_ret_L( SendMessage( hTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ) ); - break; - } - case TB_ADDSTRING: - { - int iString; - LPTSTR szCaption; + hbwapi_ret_L( SendMessage( hTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ) ); + break; + } + case TB_ADDSTRING: + { + int iString; + LPTSTR szCaption; - szCaption = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); - iString = ( int ) SendMessage( hTB, TB_ADDSTRING, ( WPARAM ) NULL, ( LPARAM ) szCaption ); - HB_TCHAR_FREE( szCaption ); + szCaption = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); + iString = ( int ) SendMessage( hTB, TB_ADDSTRING, ( WPARAM ) NULL, ( LPARAM ) szCaption ); + HB_TCHAR_FREE( szCaption ); - hbwapi_ret_NI( iString ); - break; - } - case TB_AUTOSIZE: - SendMessage( hTB, TB_AUTOSIZE, ( WPARAM ) 0, ( LPARAM ) 0 ); - break; - case TB_BUTTONCOUNT: - break; - case TB_BUTTONSTRUCTSIZE: - SendMessage( hTB, TB_BUTTONSTRUCTSIZE, sizeof( TBBUTTON ), 0 ); - break; - case TB_CHANGEBITMAP: - case TB_CHECKBUTTON: - case TB_COMMANDTOINDEX: - case TB_DELETEBUTTON: - case TB_ENABLEBUTTON: - case TB_GETBITMAP: - case TB_GETBITMAPFLAGS: - case TB_GETBUTTON: - case TB_GETBUTTONINFO: - case TB_GETBUTTONSIZE: - case TB_GETBUTTONTEXT: - case TB_GETDISABLEDIMAGELIST: - case TB_GETIMAGELIST: - case TB_GETITEMRECT: - case TB_GETRECT: - case TB_GETROWS: - case TB_GETSTATE: - case TB_GETSTYLE: - case TB_GETTEXTROWS: - case TB_GETTOOLTIPS: - case TB_HIDEBUTTON: - case TB_HITTEST: - case TB_INDETERMINATE: - case TB_INSERTBUTTON: - case TB_ISBUTTONCHECKED: - case TB_ISBUTTONENABLED: - case TB_ISBUTTONHIDDEN: - case TB_ISBUTTONHIGHLIGHTED: - case TB_ISBUTTONINDETERMINATE: - case TB_ISBUTTONPRESSED: - case TB_LOADIMAGES: - case TB_PRESSBUTTON: - case TB_REPLACEBITMAP: - break; - case TB_SETBITMAPSIZE: - SendMessage( hTB, TB_SETBITMAPSIZE, ( WPARAM ) 0, - ( LPARAM ) MAKELONG( hbwapi_par_INT( 3 ), hbwapi_par_INT( 4 ) ) ); - break; - case TB_SETBUTTONINFO: - break; - case TB_SETBUTTONSIZE: - SendMessage( hTB, TB_SETBUTTONSIZE, ( WPARAM ) 0, - ( LPARAM ) MAKELONG( hbwapi_par_INT( 3 ), hbwapi_par_INT( 4 ) ) ); - break; - case TB_SETBUTTONWIDTH: - SendMessage( hTB, TB_SETBUTTONWIDTH, ( WPARAM ) 0, - ( LPARAM ) MAKELONG( hbwapi_par_INT( 3 ), hbwapi_par_INT( 4 ) ) ); - break; - case TB_SETIMAGELIST: - SendMessage( hTB, TB_SETIMAGELIST, ( WPARAM ) 0, ( LPARAM ) hbwapi_par_raw_HIMAGELIST( 3 ) ); - break; - case TB_SETINDENT: - SendMessage( hTB, TB_SETINDENT, ( WPARAM ) hbwapi_par_INT( 3 ), ( LPARAM ) 0 ); - break; - case TB_SETMAXTEXTROWS: - SendMessage( hTB, TB_SETMAXTEXTROWS, ( WPARAM ) hbwapi_par_INT( 2 ), ( LPARAM ) 0 ); - break; - case TB_SETPARENT: - case TB_SETROWS: - case TB_SETSTATE: - case TB_SETSTYLE: - case TB_SETTOOLTIPS: - case TB_SETCMDID: - case TB_SETDISABLEDIMAGELIST: - case TB_SETDRAWTEXTFLAGS: - break; + hbwapi_ret_NI( iString ); + break; + } + case TB_AUTOSIZE: + SendMessage( hTB, TB_AUTOSIZE, ( WPARAM ) 0, ( LPARAM ) 0 ); + break; + case TB_BUTTONCOUNT: + break; + case TB_BUTTONSTRUCTSIZE: + SendMessage( hTB, TB_BUTTONSTRUCTSIZE, sizeof( TBBUTTON ), 0 ); + break; + case TB_CHANGEBITMAP: + case TB_CHECKBUTTON: + case TB_COMMANDTOINDEX: + case TB_DELETEBUTTON: + case TB_ENABLEBUTTON: + case TB_GETBITMAP: + case TB_GETBITMAPFLAGS: + case TB_GETBUTTON: + case TB_GETBUTTONINFO: + case TB_GETBUTTONSIZE: + case TB_GETBUTTONTEXT: + case TB_GETDISABLEDIMAGELIST: + case TB_GETIMAGELIST: + case TB_GETITEMRECT: + case TB_GETRECT: + case TB_GETROWS: + case TB_GETSTATE: + case TB_GETSTYLE: + case TB_GETTEXTROWS: + case TB_GETTOOLTIPS: + case TB_HIDEBUTTON: + case TB_HITTEST: + case TB_INDETERMINATE: + case TB_INSERTBUTTON: + case TB_ISBUTTONCHECKED: + case TB_ISBUTTONENABLED: + case TB_ISBUTTONHIDDEN: + case TB_ISBUTTONHIGHLIGHTED: + case TB_ISBUTTONINDETERMINATE: + case TB_ISBUTTONPRESSED: + case TB_LOADIMAGES: + case TB_PRESSBUTTON: + case TB_REPLACEBITMAP: + break; + case TB_SETBITMAPSIZE: + SendMessage( hTB, TB_SETBITMAPSIZE, ( WPARAM ) 0, + ( LPARAM ) MAKELONG( hbwapi_par_INT( 3 ), hbwapi_par_INT( 4 ) ) ); + break; + case TB_SETBUTTONINFO: + break; + case TB_SETBUTTONSIZE: + SendMessage( hTB, TB_SETBUTTONSIZE, ( WPARAM ) 0, + ( LPARAM ) MAKELONG( hbwapi_par_INT( 3 ), hbwapi_par_INT( 4 ) ) ); + break; + case TB_SETBUTTONWIDTH: + SendMessage( hTB, TB_SETBUTTONWIDTH, ( WPARAM ) 0, + ( LPARAM ) MAKELONG( hbwapi_par_INT( 3 ), hbwapi_par_INT( 4 ) ) ); + break; + case TB_SETIMAGELIST: + SendMessage( hTB, TB_SETIMAGELIST, ( WPARAM ) 0, ( LPARAM ) hbwapi_par_raw_HIMAGELIST( 3 ) ); + break; + case TB_SETINDENT: + SendMessage( hTB, TB_SETINDENT, ( WPARAM ) hbwapi_par_INT( 3 ), ( LPARAM ) 0 ); + break; + case TB_SETMAXTEXTROWS: + SendMessage( hTB, TB_SETMAXTEXTROWS, ( WPARAM ) hbwapi_par_INT( 2 ), ( LPARAM ) 0 ); + break; + case TB_SETPARENT: + case TB_SETROWS: + case TB_SETSTATE: + case TB_SETSTYLE: + case TB_SETTOOLTIPS: + case TB_SETCMDID: + case TB_SETDISABLEDIMAGELIST: + case TB_SETDRAWTEXTFLAGS: + break; #if 0 - case TB_TRANSLATEACCELERATOR: - case TB_SETPRESSEDIMAGELIST: - case TB_SETWINDOWTHEME: - case TB_GETIDEALSIZE: - case TB_GETIMAGELISTCOUNT: - case TB_GETMETRICS: - case TB_GETPRESSEDIMAGELIST: - case TB_GETSTRING: - case TB_SETLISTGAP: - case TB_GETITEMDROPDOWNRECT: - case TB_SETHOTITEM2: - case TB_SETMETRICS: - break; + case TB_TRANSLATEACCELERATOR: + case TB_SETPRESSEDIMAGELIST: + case TB_SETWINDOWTHEME: + case TB_GETIDEALSIZE: + case TB_GETIMAGELISTCOUNT: + case TB_GETMETRICS: + case TB_GETPRESSEDIMAGELIST: + case TB_GETSTRING: + case TB_SETLISTGAP: + case TB_GETITEMDROPDOWNRECT: + case TB_SETHOTITEM2: + case TB_SETMETRICS: + break; #endif #if ! defined( HB_OS_WIN_CE ) - case TB_SETPADDING: - SendMessage( hTB, TB_SETPADDING, ( WPARAM ) 0, - ( LPARAM ) MAKELPARAM( hbwapi_par_INT( 2 ), hbwapi_par_INT( 3 ) ) ); - break; - case TB_MARKBUTTON: - SendMessage( hTB, TB_MARKBUTTON, ( WPARAM ) hbwapi_par_INT( 3 ), ( LPARAM ) MAKELONG( hb_parl( 4 ), 0 ) ); - break; - case TB_SETINSERTMARK: - case TB_SETINSERTMARKCOLOR: - case TB_SETCOLORSCHEME: - case TB_SETEXTENDEDSTYLE: - case TB_SETHOTIMAGELIST: - case TB_SETHOTITEM: - case TB_INSERTMARKHITTEST: - case TB_MAPACCELERATOR: - case TB_MOVEBUTTON: - case TB_GETINSERTMARK: - case TB_GETCOLORSCHEME: - case TB_CUSTOMIZE: - case TB_GETANCHORHIGHLIGHT: - case TB_GETEXTENDEDSTYLE: - case TB_GETHOTIMAGELIST: - case TB_GETINSERTMARKCOLOR: - case TB_GETHOTITEM: - case TB_GETOBJECT: - case TB_GETUNICODEFORMAT: - case TB_GETMAXSIZE: - case TB_SAVERESTORE: - case TB_SETANCHORHIGHLIGHT: - case TB_SETUNICODEFORMAT: - break; + case TB_SETPADDING: + SendMessage( hTB, TB_SETPADDING, ( WPARAM ) 0, + ( LPARAM ) MAKELPARAM( hbwapi_par_INT( 2 ), hbwapi_par_INT( 3 ) ) ); + break; + case TB_MARKBUTTON: + SendMessage( hTB, TB_MARKBUTTON, ( WPARAM ) hbwapi_par_INT( 3 ), ( LPARAM ) MAKELONG( hb_parl( 4 ), 0 ) ); + break; + case TB_SETINSERTMARK: + case TB_SETINSERTMARKCOLOR: + case TB_SETCOLORSCHEME: + case TB_SETEXTENDEDSTYLE: + case TB_SETHOTIMAGELIST: + case TB_SETHOTITEM: + case TB_INSERTMARKHITTEST: + case TB_MAPACCELERATOR: + case TB_MOVEBUTTON: + case TB_GETINSERTMARK: + case TB_GETCOLORSCHEME: + case TB_CUSTOMIZE: + case TB_GETANCHORHIGHLIGHT: + case TB_GETEXTENDEDSTYLE: + case TB_GETHOTIMAGELIST: + case TB_GETINSERTMARKCOLOR: + case TB_GETHOTITEM: + case TB_GETOBJECT: + case TB_GETUNICODEFORMAT: + case TB_GETMAXSIZE: + case TB_SAVERESTORE: + case TB_SETANCHORHIGHLIGHT: + case TB_SETUNICODEFORMAT: + break; #endif } /* #endif */ diff --git a/harbour/contrib/gtwvg/wvgwing.c b/harbour/contrib/gtwvg/wvgwing.c index e9d7d6033e..7294057a15 100644 --- a/harbour/contrib/gtwvg/wvgwing.c +++ b/harbour/contrib/gtwvg/wvgwing.c @@ -182,11 +182,11 @@ static BITMAPINFO * PackedDibLoad( PTSTR szFileName ) return NULL; } - dwPackedDibSize = bmfh.bfSize - sizeof( BITMAPFILEHEADER ); + dwPackedDibSize = bmfh.bfSize - sizeof( BITMAPFILEHEADER ); - pbmi = ( BITMAPINFO * ) hb_xgrab( dwPackedDibSize ); + pbmi = ( BITMAPINFO * ) hb_xgrab( dwPackedDibSize ); - bSuccess = ReadFile( hFile, pbmi, dwPackedDibSize, &dwBytesRead, NULL ); + bSuccess = ReadFile( hFile, pbmi, dwPackedDibSize, &dwBytesRead, NULL ); CloseHandle( hFile ); if( ! bSuccess || ( dwBytesRead != dwPackedDibSize ) ) @@ -294,153 +294,153 @@ static HBITMAP hPrepareBitmap( const char * szBitmapX, UINT uiBitmap, switch( iMode ) { - case 0: + case 0: - if( szBitmapX ) - { - int iWidth, iHeight; + if( szBitmapX ) { - BITMAPINFO * pPackedDib = NULL; - HDC hdc; - TCHAR * szBitmap; - - szBitmap = HB_TCHAR_CONVTO( szBitmapX ); - - if( ! bMap3Dcolors ) - pPackedDib = PackedDibLoad( szBitmap ); - - if( pPackedDib || bMap3Dcolors ) + int iWidth, iHeight; { - hdc = GetDC( hCtrl ); + BITMAPINFO * pPackedDib = NULL; + HDC hdc; + TCHAR * szBitmap; + + szBitmap = HB_TCHAR_CONVTO( szBitmapX ); if( ! bMap3Dcolors ) + pPackedDib = PackedDibLoad( szBitmap ); + + if( pPackedDib || bMap3Dcolors ) { -#if ! defined( HB_OS_WIN_CE ) - hBitmap = CreateDIBitmap( hdc, - ( PBITMAPINFOHEADER ) pPackedDib, - CBM_INIT, - PackedDibGetBitsPtr( pPackedDib ), - pPackedDib, - DIB_RGB_COLORS ); - if( hBitmap == NULL ) - return NULL; + hdc = GetDC( hCtrl ); - iWidth = PackedDibGetWidth( pPackedDib ); - iHeight = PackedDibGetHeight( pPackedDib ); -#else - return NULL; -#endif - } - else - { - hBitmap = ( HBITMAP ) LoadImage( ( HINSTANCE ) NULL, - szBitmap, - IMAGE_BITMAP, - iExpWidth, - iExpHeight, - LR_LOADFROMFILE | LR_LOADMAP3DCOLORS ); - if( hBitmap == NULL ) - return NULL; - - iWidth = iExpWidth; - iHeight = iExpHeight; - } - - if( iExpWidth == 0 && iExpHeight == 0 ) - { - iWidth = iExpWidth; - iHeight = iExpHeight; - } - - if( iExpWidth != iWidth || iExpHeight != iHeight ) - { - HDC hdcSource, hdcTarget; - HBITMAP hBitmap2; - HB_BOOL bResult; - - hdcSource = CreateCompatibleDC( hdc ); - SelectObject( hdcSource, hBitmap ); - - hdcTarget = CreateCompatibleDC( hdc ); - hBitmap2 = CreateCompatibleBitmap( hdcSource, iExpWidth, iExpHeight ); - SelectObject( hdcTarget, hBitmap2 ); - - bResult = StretchBlt( - hdcTarget, /* handle to destination DC */ - 0, /* x-coord of destination upper-left corner */ - 0, /* y-coord of destination upper-left corner */ - iExpWidth, /* width of destination rectangle */ - iExpHeight, /* height of destination rectangle */ - hdcSource, /* handle to source DC */ - 0, /* x-coord of source upper-left corner */ - 0, /* y-coord of source upper-left corner */ - iWidth, /* width of source rectangle */ - iHeight, /* height of source rectangle */ - SRCCOPY /* raster operation code */ - ); - - if( ! bResult ) + if( ! bMap3Dcolors ) { - DeleteObject( hBitmap2 ); +#if ! defined( HB_OS_WIN_CE ) + hBitmap = CreateDIBitmap( hdc, + ( PBITMAPINFOHEADER ) pPackedDib, + CBM_INIT, + PackedDibGetBitsPtr( pPackedDib ), + pPackedDib, + DIB_RGB_COLORS ); + if( hBitmap == NULL ) + return NULL; + + iWidth = PackedDibGetWidth( pPackedDib ); + iHeight = PackedDibGetHeight( pPackedDib ); +#else + return NULL; +#endif } else { - DeleteObject( hBitmap ); - hBitmap = hBitmap2; + hBitmap = ( HBITMAP ) LoadImage( ( HINSTANCE ) NULL, + szBitmap, + IMAGE_BITMAP, + iExpWidth, + iExpHeight, + LR_LOADFROMFILE | LR_LOADMAP3DCOLORS ); + if( hBitmap == NULL ) + return NULL; + + iWidth = iExpWidth; + iHeight = iExpHeight; } - DeleteDC( hdcSource ); - DeleteDC( hdcTarget ); - } + if( iExpWidth == 0 && iExpHeight == 0 ) + { + iWidth = iExpWidth; + iHeight = iExpHeight; + } - HB_TCHAR_FREE( szBitmap ); - ReleaseDC( hCtrl, hdc ); - if( pPackedDib ) - hb_xfree( pPackedDib ); + if( iExpWidth != iWidth || iExpHeight != iHeight ) + { + HDC hdcSource, hdcTarget; + HBITMAP hBitmap2; + HB_BOOL bResult; + + hdcSource = CreateCompatibleDC( hdc ); + SelectObject( hdcSource, hBitmap ); + + hdcTarget = CreateCompatibleDC( hdc ); + hBitmap2 = CreateCompatibleBitmap( hdcSource, iExpWidth, iExpHeight ); + SelectObject( hdcTarget, hBitmap2 ); + + bResult = StretchBlt( + hdcTarget, /* handle to destination DC */ + 0, /* x-coord of destination upper-left corner */ + 0, /* y-coord of destination upper-left corner */ + iExpWidth, /* width of destination rectangle */ + iExpHeight, /* height of destination rectangle */ + hdcSource, /* handle to source DC */ + 0, /* x-coord of source upper-left corner */ + 0, /* y-coord of source upper-left corner */ + iWidth, /* width of source rectangle */ + iHeight, /* height of source rectangle */ + SRCCOPY /* raster operation code */ + ); + + if( ! bResult ) + { + DeleteObject( hBitmap2 ); + } + else + { + DeleteObject( hBitmap ); + hBitmap = hBitmap2; + } + + DeleteDC( hdcSource ); + DeleteDC( hdcTarget ); + } + + HB_TCHAR_FREE( szBitmap ); + ReleaseDC( hCtrl, hdc ); + if( pPackedDib ) + hb_xfree( pPackedDib ); + } } } + break; + case 1: + { + UINT uiOptions = bMap3Dcolors ? LR_LOADMAP3DCOLORS : LR_DEFAULTCOLOR; + TCHAR * szBitmap; + + szBitmap = HB_TCHAR_CONVTO( szBitmapX ); + + hBitmap = ( HBITMAP ) LoadImage( + ( HINSTANCE ) wvg_hInstance(), + ( LPCTSTR ) szBitmap, + IMAGE_BITMAP, + iExpWidth, + iExpHeight, + uiOptions ); + HB_TCHAR_FREE( szBitmap ); + if( hBitmap == NULL ) + { + return NULL; + } } break; - case 1: - { - UINT uiOptions = bMap3Dcolors ? LR_LOADMAP3DCOLORS : LR_DEFAULTCOLOR; - TCHAR * szBitmap; - - szBitmap = HB_TCHAR_CONVTO( szBitmapX ); - - hBitmap = ( HBITMAP ) LoadImage( - ( HINSTANCE ) wvg_hInstance(), - ( LPCTSTR ) szBitmap, - IMAGE_BITMAP, - iExpWidth, - iExpHeight, - uiOptions ); - HB_TCHAR_FREE( szBitmap ); - if( hBitmap == NULL ) + case 2: /* loading from resourceid */ { - return NULL; - } - } - break; - case 2: /* loading from resourceid */ - { - UINT uiOptions = bMap3Dcolors ? LR_LOADMAP3DCOLORS : LR_DEFAULTCOLOR; - char szResname[ MAX_PATH + 1 ]; + UINT uiOptions = bMap3Dcolors ? LR_LOADMAP3DCOLORS : LR_DEFAULTCOLOR; + char szResname[ MAX_PATH + 1 ]; - hb_snprintf( szResname, sizeof( szResname ), "?%u", uiBitmap ); + hb_snprintf( szResname, sizeof( szResname ), "?%u", uiBitmap ); - hBitmap = ( HBITMAP ) LoadImage( - ( HINSTANCE ) wvg_hInstance(), - ( LPCTSTR ) MAKEINTRESOURCE( ( WORD ) uiBitmap ), - IMAGE_BITMAP, - iExpWidth, - iExpHeight, - uiOptions ); - if( hBitmap == NULL ) - return NULL; + hBitmap = ( HBITMAP ) LoadImage( + ( HINSTANCE ) wvg_hInstance(), + ( LPCTSTR ) MAKEINTRESOURCE( ( WORD ) uiBitmap ), + IMAGE_BITMAP, + iExpWidth, + iExpHeight, + uiOptions ); + if( hBitmap == NULL ) + return NULL; - } /* loading from resources */ - break; + } /* loading from resources */ + break; } return hBitmap; @@ -484,8 +484,8 @@ HB_FUNC( WVG_PREPAREBITMAPFROMRESOURCENAME ) HB_FUNC( WVG_STATUSBARCREATEPANEL ) { - HWND hWndSB = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ); - int iMode = hb_parni( 2 ); + HWND hWndSB = ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ); + int iMode = hb_parni( 2 ); if( hWndSB == NULL || ! IsWindow( hWndSB ) ) { @@ -495,45 +495,45 @@ HB_FUNC( WVG_STATUSBARCREATEPANEL ) switch( iMode ) { - case 0: - { - int ptArray[ WIN_STATUSBAR_MAX_PARTS ]; - int iParts; - RECT rc = { 0, 0, 0, 0 }; - int n; - int width; - - iParts = ( int ) SendMessage( hWndSB, SB_GETPARTS, ( WPARAM ) WIN_STATUSBAR_MAX_PARTS, ( LPARAM ) ( LPINT ) ptArray ); - - GetClientRect( hWndSB, &rc ); - width = ( int ) ( rc.right / ( iParts + 1 ) ); - for( n = 0; n < iParts; n++ ) - ptArray[ n ] = ( width * ( n + 1 ) ); - - ptArray[ iParts ] = -1; - - if( SendMessage( hWndSB, SB_SETPARTS, ( WPARAM ) iParts + 1, ( LPARAM ) ( LPINT ) ptArray ) ) + case 0: { - hb_retl( HB_TRUE ); - return; - } - } - case -1: - { - RECT rc = { 0, 0, 0, 0 }; - int ptArray[ WIN_STATUSBAR_MAX_PARTS ]; + int ptArray[ WIN_STATUSBAR_MAX_PARTS ]; + int iParts; + RECT rc = { 0, 0, 0, 0 }; + int n; + int width; - if( GetClientRect( hWndSB, &rc ) ) + iParts = ( int ) SendMessage( hWndSB, SB_GETPARTS, ( WPARAM ) WIN_STATUSBAR_MAX_PARTS, ( LPARAM ) ( LPINT ) ptArray ); + + GetClientRect( hWndSB, &rc ); + width = ( int ) ( rc.right / ( iParts + 1 ) ); + for( n = 0; n < iParts; n++ ) + ptArray[ n ] = ( width * ( n + 1 ) ); + + ptArray[ iParts ] = -1; + + if( SendMessage( hWndSB, SB_SETPARTS, ( WPARAM ) iParts + 1, ( LPARAM ) ( LPINT ) ptArray ) ) + { + hb_retl( HB_TRUE ); + return; + } + } + case -1: { - ptArray[ 0 ] = rc.right; + RECT rc = { 0, 0, 0, 0 }; + int ptArray[ WIN_STATUSBAR_MAX_PARTS ]; - SendMessage( hWndSB, SB_SETPARTS, ( WPARAM ) 1, ( LPARAM ) ( LPINT ) ptArray ); + if( GetClientRect( hWndSB, &rc ) ) + { + ptArray[ 0 ] = rc.right; - hb_retl( HB_TRUE ); - return; + SendMessage( hWndSB, SB_SETPARTS, ( WPARAM ) 1, ( LPARAM ) ( LPINT ) ptArray ); + + hb_retl( HB_TRUE ); + return; + } } } - } hb_retl( HB_FALSE ); } @@ -551,11 +551,11 @@ HB_FUNC( WVG_STATUSBARSETTEXT ) int iFlags; TCHAR * szCaption; - iPart -= 1; /* Zero based */ + iPart -= 1; /* Zero based */ - iFlags = ( int ) HIWORD( SendMessage( hWndSB, SB_GETTEXT, ( WPARAM ) iPart, ( LPARAM ) szText ) ); + iFlags = ( int ) HIWORD( SendMessage( hWndSB, SB_GETTEXT, ( WPARAM ) iPart, ( LPARAM ) szText ) ); - szCaption = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); + szCaption = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); SendMessage( hWndSB, SB_SETTEXT, ( WPARAM ) iPart | iFlags, ( LPARAM ) szCaption ); HB_TCHAR_FREE( szCaption ); } @@ -573,9 +573,9 @@ HB_FUNC( WVG_STATUSBARREFRESH ) int ptArray[ WIN_STATUSBAR_MAX_PARTS ]; int iParts, i; - iParts = SendMessage( hWndSB, SB_GETPARTS, WIN_STATUSBAR_MAX_PARTS, ( LPARAM ) ( LPINT ) ptArray ); + iParts = SendMessage( hWndSB, SB_GETPARTS, WIN_STATUSBAR_MAX_PARTS, ( LPARAM ) ( LPINT ) ptArray ); - ptArray[ iParts - 1 ] = -1; + ptArray[ iParts - 1 ] = -1; if( SendMessage( hWndSB, SB_SETPARTS, iParts, ( LPARAM ) ( LPINT ) ptArray ) ) { @@ -593,8 +593,8 @@ HB_FUNC( WVG_STATUSBARREFRESH ) */ HB_FUNC( WVG_GETNMHDRINFO ) { - LPNMHDR lpnmh = ( LPNMHDR ) wvg_parlparam( 1 ); - PHB_ITEM pEvParams = hb_itemNew( NULL ); + LPNMHDR lpnmh = ( LPNMHDR ) wvg_parlparam( 1 ); + PHB_ITEM pEvParams = hb_itemNew( NULL ); hb_arrayNew( pEvParams, 3 ); @@ -610,9 +610,9 @@ HB_FUNC( WVG_GETNMHDRINFO ) */ HB_FUNC( WVG_GETNMMOUSEINFO ) { - LPNMMOUSE nmm = ( LPNMMOUSE ) wvg_parlparam( 1 ); - NMHDR nmh = nmm->hdr; - PHB_ITEM pEvParams = hb_itemNew( NULL ); + LPNMMOUSE nmm = ( LPNMMOUSE ) wvg_parlparam( 1 ); + NMHDR nmh = nmm->hdr; + PHB_ITEM pEvParams = hb_itemNew( NULL ); hb_arrayNew( pEvParams, 4 ); @@ -635,7 +635,7 @@ HB_FUNC( WVG_SETTOOLBARBUTTONTIP ) lptbgit->cchTextMax = strlen( hb_parcx( 2 ) ); /*memcpy( lptbgit->pszText, pszText, strlen( hb_parcx( 2 ) ) );*/ - lptbgit->pszText = pszText; + lptbgit->pszText = pszText; HB_TCHAR_FREE( pszText ); * / } #endif @@ -645,10 +645,10 @@ HB_FUNC( WVG_SETTOOLBARBUTTONTIP ) */ HB_FUNC( WVG_GETNMTREEVIEWINFO ) { - LPNMTREEVIEW pnmtv = ( LPNMTREEVIEW ) wvg_parlparam( 1 ); - NMHDR nmh = pnmtv->hdr; + LPNMTREEVIEW pnmtv = ( LPNMTREEVIEW ) wvg_parlparam( 1 ); + NMHDR nmh = pnmtv->hdr; - PHB_ITEM pEvParams = hb_itemNew( NULL ); + PHB_ITEM pEvParams = hb_itemNew( NULL ); hb_arrayNew( pEvParams, 4 ); @@ -666,8 +666,8 @@ HB_FUNC( WVG_GETNMTREEVIEWINFO ) */ HB_FUNC( WVG_TREEVIEW_GETSELECTIONINFO ) { - LPNMTREEVIEW pnmtv = ( LPNMTREEVIEW ) wvg_parlparam( 2 ); - HTREEITEM hSelected = pnmtv->itemNew.hItem; + LPNMTREEVIEW pnmtv = ( LPNMTREEVIEW ) wvg_parlparam( 2 ); + HTREEITEM hSelected = pnmtv->itemNew.hItem; if( hSelected != NULL ) { @@ -678,10 +678,10 @@ HB_FUNC( WVG_TREEVIEW_GETSELECTIONINFO ) hb_stornint( ( HB_PTRDIFF ) hSelected, 6 ); - item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_IMAGE; - item.hItem = hSelected; - item.pszText = text; - item.cchTextMax = MAX_PATH; + item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_IMAGE; + item.hItem = hSelected; + item.pszText = text; + item.cchTextMax = MAX_PATH; if( TreeView_GetItem( wvg_parhwnd( 1 ), &item ) ) { @@ -690,13 +690,13 @@ HB_FUNC( WVG_TREEVIEW_GETSELECTIONINFO ) HB_TCHAR_FREE( szText ); } - hParent = TreeView_GetParent( wvg_parhwnd( 1 ), hSelected ); + hParent = TreeView_GetParent( wvg_parhwnd( 1 ), hSelected ); hb_stornint( ( HB_PTRDIFF ) hParent, 5 ); - item.mask = TVIF_HANDLE | TVIF_TEXT; - item.hItem = hParent; - item.pszText = Parent; - item.cchTextMax = MAX_PATH; + item.mask = TVIF_HANDLE | TVIF_TEXT; + item.hItem = hParent; + item.pszText = Parent; + item.cchTextMax = MAX_PATH; if( TreeView_GetItem( wvg_parhwnd( 1 ), &item ) ) { @@ -716,16 +716,16 @@ HB_FUNC( WVG_TREEVIEW_ADDITEM ) TVINSERTSTRUCT tvis; LPTSTR text = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); - tvis.hInsertAfter = TVI_LAST; - HB_WIN_V_UNION( tvis, item.mask ) = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE; - HB_WIN_V_UNION( tvis, item.cchTextMax ) = MAX_PATH + 1; - HB_WIN_V_UNION( tvis, item.stateMask ) = TVIS_BOLD | TVIS_CUT | TVIS_DROPHILITED | - TVIS_EXPANDEDONCE | TVIS_SELECTED | TVIS_EXPANDPARTIAL | - TVIS_OVERLAYMASK | TVIS_STATEIMAGEMASK | TVIS_USERMASK; + tvis.hInsertAfter = TVI_LAST; + HB_WIN_V_UNION( tvis, item.mask ) = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE; + HB_WIN_V_UNION( tvis, item.cchTextMax ) = MAX_PATH + 1; + HB_WIN_V_UNION( tvis, item.stateMask ) = TVIS_BOLD | TVIS_CUT | TVIS_DROPHILITED | + TVIS_EXPANDEDONCE | TVIS_SELECTED | TVIS_EXPANDPARTIAL | + TVIS_OVERLAYMASK | TVIS_STATEIMAGEMASK | TVIS_USERMASK; - HB_WIN_V_UNION( tvis, item.state ) = 0; /* TVI_BOLD */ - tvis.hParent = HB_ISNUM( 2 ) ? ( HTREEITEM ) wvg_parhandle( 2 ) : NULL; - HB_WIN_V_UNION( tvis, item.pszText ) = text; + HB_WIN_V_UNION( tvis, item.state ) = 0; /* TVI_BOLD */ + tvis.hParent = HB_ISNUM( 2 ) ? ( HTREEITEM ) wvg_parhandle( 2 ) : NULL; + HB_WIN_V_UNION( tvis, item.pszText ) = text; hb_retnint( ( HB_PTRDIFF ) TreeView_InsertItem( wvg_parhwnd( 1 ), &tvis ) ); @@ -736,7 +736,7 @@ HB_FUNC( WVG_TREEVIEW_ADDITEM ) HB_FUNC( WVG_TREEVIEW_SHOWEXPANDED ) { - HWND hwnd = wvg_parhwnd( 1 ); + HWND hwnd = wvg_parhwnd( 1 ); HTREEITEM hroot, hitem, hitem1, hitem2, hitem3; int iExpand = ( hb_parl( 2 ) ? TVE_EXPAND : TVE_COLLAPSE ); int iLevels = hb_parni( 3 ) <= 0 ? 5 : hb_parni( 3 ); @@ -843,14 +843,14 @@ PHB_ITEM wvg_logfontTOarray( LPLOGFONT lf, HB_BOOL bEmpty ) BOOL CALLBACK WvgDialogProcChooseFont( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - HB_BOOL bret = HB_FALSE; - HB_BOOL binit = HB_FALSE; + HB_BOOL bret = HB_FALSE; + HB_BOOL binit = HB_FALSE; PHB_ITEM block; if( msg == WM_INITDIALOG ) { - CHOOSEFONT * cf = ( CHOOSEFONT * ) lParam; - PHB_ITEM pBlock = ( PHB_ITEM ) hb_itemNew( ( PHB_ITEM ) cf->lCustData ); + CHOOSEFONT * cf = ( CHOOSEFONT * ) lParam; + PHB_ITEM pBlock = ( PHB_ITEM ) hb_itemNew( ( PHB_ITEM ) cf->lCustData ); SetProp( hwnd, TEXT( "DIALOGPROC" ), pBlock ); binit = HB_TRUE; } @@ -891,8 +891,8 @@ HB_FUNC( WVG_CHOOSEFONT ) CHOOSEFONT cf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */ LOGFONT lf; /* = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; */ DWORD Flags; - LONG PointSize = 0; - HWND hWnd = wvg_parhwnd( 1 ); + LONG PointSize = 0; + HWND hWnd = wvg_parhwnd( 1 ); TCHAR szStyle[ MAX_PATH + 1 ]; if( HB_ISCHAR( 3 ) ) @@ -905,25 +905,25 @@ HB_FUNC( WVG_CHOOSEFONT ) PointSize = -MulDiv( ( LONG ) hb_parnl( 4 ), GetDeviceCaps( hdc, LOGPIXELSY ), 72 ); ReleaseDC( hWnd, hdc ); } - lf.lfHeight = PointSize; - lf.lfWidth = 0; - lf.lfWeight = 0; - lf.lfItalic = 0; - lf.lfUnderline = 0; - lf.lfStrikeOut = 0; - lf.lfCharSet = DEFAULT_CHARSET; - lf.lfQuality = DEFAULT_QUALITY; + lf.lfHeight = PointSize; + lf.lfWidth = 0; + lf.lfWeight = 0; + lf.lfItalic = 0; + lf.lfUnderline = 0; + lf.lfStrikeOut = 0; + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfQuality = DEFAULT_QUALITY; lf.lfPitchAndFamily = FF_DONTCARE; - Flags = CF_EFFECTS | CF_SHOWHELP | CF_APPLY | CF_INITTOLOGFONTSTRUCT | CF_ENABLEHOOK; + Flags = CF_EFFECTS | CF_SHOWHELP | CF_APPLY | CF_INITTOLOGFONTSTRUCT | CF_ENABLEHOOK; #if 0 - Flags |= CF_TTONLY; - Flags |= CF_FIXEDPITCHONLY; - Flags |= CF_SCALABLEONLY; - Flags |= CF_NOVECTORFONTS; - Flags |= CF_NOSCRIPTSEL; - Flags |= CF_NOSIMULATIONS; /* ::synthesizeFonts == .f. */ + Flags |= CF_TTONLY; + Flags |= CF_FIXEDPITCHONLY; + Flags |= CF_SCALABLEONLY; + Flags |= CF_NOVECTORFONTS; + Flags |= CF_NOSCRIPTSEL; + Flags |= CF_NOSIMULATIONS; /* ::synthesizeFonts == .f. */ #endif if( hb_parl( 5 ) ) @@ -931,28 +931,28 @@ HB_FUNC( WVG_CHOOSEFONT ) if( hb_parl( 6 ) ) Flags = Flags | CF_PRINTERFONTS; - cf.lStructSize = sizeof( CHOOSEFONT ); - cf.hwndOwner = hWnd; - cf.hDC = ( HDC ) NULL; /* only when ::oPrinterPS is defined */ - cf.lpLogFont = &lf; - cf.iPointSize = PointSize; - cf.Flags = Flags; - cf.rgbColors = RGB( 0, 0, 0 ); + cf.lStructSize = sizeof( CHOOSEFONT ); + cf.hwndOwner = hWnd; + cf.hDC = ( HDC ) NULL; /* only when ::oPrinterPS is defined */ + cf.lpLogFont = &lf; + cf.iPointSize = PointSize; + cf.Flags = Flags; + cf.rgbColors = RGB( 0, 0, 0 ); - cf.lCustData = ( HB_PTRDIFF ) hb_param( 2, HB_IT_BLOCK ); - cf.lpfnHook = ( LPCFHOOKPROC ) WvgDialogProcChooseFont; + cf.lCustData = ( HB_PTRDIFF ) hb_param( 2, HB_IT_BLOCK ); + cf.lpfnHook = ( LPCFHOOKPROC ) WvgDialogProcChooseFont; - cf.lpTemplateName = ( LPTSTR ) NULL; - cf.hInstance = ( HINSTANCE ) NULL; - cf.lpszStyle = ( LPTSTR ) szStyle; - cf.nFontType = SCREEN_FONTTYPE; /* ?? */ - cf.nSizeMin = 0; - cf.nSizeMax = 0; + cf.lpTemplateName = ( LPTSTR ) NULL; + cf.hInstance = ( HINSTANCE ) NULL; + cf.lpszStyle = ( LPTSTR ) szStyle; + cf.nFontType = SCREEN_FONTTYPE; /* ?? */ + cf.nSizeMin = 0; + cf.nSizeMax = 0; if( ChooseFont( &cf ) ) { - PHB_ITEM aFont = wvg_logfontTOarray( &lf, HB_FALSE ); - PHB_ITEM aInfo = hb_itemNew( NULL ); + PHB_ITEM aFont = wvg_logfontTOarray( &lf, HB_FALSE ); + PHB_ITEM aInfo = hb_itemNew( NULL ); hb_arrayNew( aInfo, 4 ); hb_arraySetNI( aInfo, 1, cf.iPointSize ); @@ -999,21 +999,21 @@ HB_FUNC( WVG_FONTCREATE ) memset( &lf, 0, sizeof( lf ) ); HB_TCHAR_COPYTO( lf.lfFaceName, hb_parvcx( 1, 1 ), HB_SIZEOFARRAY( lf.lfFaceName ) - 1 ); - lf.lfHeight = ( LONG ) hb_parvnl( 1, 2 ); - lf.lfWidth = ( LONG ) hb_parvnl( 1, 3 ); - lf.lfWeight = ( LONG ) hb_parvnl( 1, 4 ); - lf.lfItalic = ( BYTE ) hb_parvl( 1, 5 ); - lf.lfUnderline = ( BYTE ) hb_parvl( 1, 6 ); - lf.lfStrikeOut = ( BYTE ) hb_parvl( 1, 7 ); - lf.lfCharSet = ( BYTE ) hb_parvni( 1, 8 ); - lf.lfEscapement = ( BYTE ) hb_parvni( 1, 9 ); - lf.lfOrientation = ( BYTE ) hb_parvni( 1, 10 ); - lf.lfOutPrecision = ( BYTE ) hb_parvni( 1, 11 ); - lf.lfClipPrecision = ( BYTE ) hb_parvni( 1, 12 ); - lf.lfQuality = ( BYTE ) hb_parvni( 1, 13 ); + lf.lfHeight = ( LONG ) hb_parvnl( 1, 2 ); + lf.lfWidth = ( LONG ) hb_parvnl( 1, 3 ); + lf.lfWeight = ( LONG ) hb_parvnl( 1, 4 ); + lf.lfItalic = ( BYTE ) hb_parvl( 1, 5 ); + lf.lfUnderline = ( BYTE ) hb_parvl( 1, 6 ); + lf.lfStrikeOut = ( BYTE ) hb_parvl( 1, 7 ); + lf.lfCharSet = ( BYTE ) hb_parvni( 1, 8 ); + lf.lfEscapement = ( BYTE ) hb_parvni( 1, 9 ); + lf.lfOrientation = ( BYTE ) hb_parvni( 1, 10 ); + lf.lfOutPrecision = ( BYTE ) hb_parvni( 1, 11 ); + lf.lfClipPrecision = ( BYTE ) hb_parvni( 1, 12 ); + lf.lfQuality = ( BYTE ) hb_parvni( 1, 13 ); lf.lfPitchAndFamily = ( BYTE ) hb_parvni( 1, 14 ); - hFont = CreateFontIndirect( &lf ); + hFont = CreateFontIndirect( &lf ); if( hFont ) { @@ -1077,68 +1077,68 @@ HB_FUNC( WVG_ADDTOOLBARBUTTON ) TBBUTTON tbb; TBADDBITMAP tbab; HB_BOOL bSuccess; - HWND hWndTB = hbwapi_par_raw_HWND( 1 ); - int iCommand = hb_parni( 4 ); + HWND hWndTB = hbwapi_par_raw_HWND( 1 ); + int iCommand = hb_parni( 4 ); TCHAR * szCaption; switch( hb_parni( 5 ) ) { - case 1: /* button from image */ - { - int iNewBitmap, iNewString; + case 1: /* button from image */ + { + int iNewBitmap, iNewString; - /* set bitmap */ - tbab.hInst = NULL; + /* set bitmap */ + tbab.hInst = NULL; #if ( _WIN32_IE >= 0x0500 ) - tbab.nID = ( UINT_PTR ) ( HBITMAP ) ( HB_PTRDIFF ) hb_parnint( 2 ); + tbab.nID = ( UINT_PTR ) ( HBITMAP ) ( HB_PTRDIFF ) hb_parnint( 2 ); #else - tbab.nID = ( UINT ) ( HBITMAP ) hb_parnl( 2 ); + tbab.nID = ( UINT ) ( HBITMAP ) hb_parnl( 2 ); #endif - iNewBitmap = ( int ) SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 1, ( LPARAM ) &tbab ); + iNewBitmap = ( int ) SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 1, ( LPARAM ) &tbab ); - /* set string */ - szCaption = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); - iNewString = ( int ) SendMessage( hWndTB, TB_ADDSTRING, ( WPARAM ) 0, ( LPARAM ) szCaption ); - HB_TCHAR_FREE( szCaption ); + /* set string */ + szCaption = HB_TCHAR_CONVTO( hb_parcx( 3 ) ); + iNewString = ( int ) SendMessage( hWndTB, TB_ADDSTRING, ( WPARAM ) 0, ( LPARAM ) szCaption ); + HB_TCHAR_FREE( szCaption ); #if 1 - if( hb_parl( 6 ) ) - { - SendMessage( hWndTB, TB_SETMAXTEXTROWS, ( WPARAM ) 0, ( LPARAM ) 0 ); - } + if( hb_parl( 6 ) ) + { + SendMessage( hWndTB, TB_SETMAXTEXTROWS, ( WPARAM ) 0, ( LPARAM ) 0 ); + } #endif - /* add button */ - tbb.iBitmap = iNewBitmap; - tbb.idCommand = iCommand; - tbb.fsState = TBSTATE_ENABLED; - tbb.fsStyle = TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE; - tbb.dwData = 0; - tbb.iString = iNewString; + /* add button */ + tbb.iBitmap = iNewBitmap; + tbb.idCommand = iCommand; + tbb.fsState = TBSTATE_ENABLED; + tbb.fsStyle = TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE; + tbb.dwData = 0; + tbb.iString = iNewString; - /* TOFIX: Convertion of LRESULT to HB_BOOL */ - bSuccess = ( HB_BOOL ) SendMessage( hWndTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ); + /* TOFIX: Convertion of LRESULT to HB_BOOL */ + bSuccess = ( HB_BOOL ) SendMessage( hWndTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ); #if ! defined( HB_OS_WIN_CE ) - SendMessage( hWndTB, TB_SETPADDING, ( WPARAM ) 0, ( LPARAM ) MAKELPARAM( 10, 10 ) ); + SendMessage( hWndTB, TB_SETPADDING, ( WPARAM ) 0, ( LPARAM ) MAKELPARAM( 10, 10 ) ); #endif - hb_retl( bSuccess ); - return; - } + hb_retl( bSuccess ); + return; + } - case 2: /* system bitmap */ + case 2: /* system bitmap */ - case 3: /* separator */ - tbb.iBitmap = 0; /* Can be width of the separator */ - tbb.idCommand = 0; - tbb.fsState = TBSTATE_ENABLED; - tbb.fsStyle = TBSTYLE_SEP; - tbb.dwData = 0; - tbb.iString = 0; + case 3: /* separator */ + tbb.iBitmap = 0; /* Can be width of the separator */ + tbb.idCommand = 0; + tbb.fsState = TBSTATE_ENABLED; + tbb.fsStyle = TBSTYLE_SEP; + tbb.dwData = 0; + tbb.iString = 0; - /* TOFIX: Convertion of LRESULT to HB_BOOL */ - bSuccess = ( HB_BOOL ) SendMessage( hWndTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ); - hb_retl( bSuccess ); - return; + /* TOFIX: Convertion of LRESULT to HB_BOOL */ + bSuccess = ( HB_BOOL ) SendMessage( hWndTB, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ); + hb_retl( bSuccess ); + return; } } @@ -1152,13 +1152,13 @@ HB_FUNC( WVG_REGISTERCLASS_BYNAME ) LPTSTR szClass = HB_TCHAR_CONVTO( hb_parcx( 1 ) ); memset( &wndclass, 0, sizeof( WNDCLASS ) ); - wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; - wndclass.lpfnWndProc = DefWindowProc; - wndclass.hInstance = ( HINSTANCE ) wvg_hInstance(); - wndclass.hIcon = NULL; - wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ); + wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; + wndclass.lpfnWndProc = DefWindowProc; + wndclass.hInstance = ( HINSTANCE ) wvg_hInstance(); + wndclass.hIcon = NULL; + wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ); wndclass.hbrBackground = NULL; - wndclass.lpszMenuName = NULL; + wndclass.lpszMenuName = NULL; wndclass.lpszClassName = szClass; if( ! RegisterClass( &wndclass ) ) @@ -1177,10 +1177,10 @@ HB_FUNC( WVG_FILLRECT ) { RECT rc; - rc.left = hb_parvni( 2, 1 ); - rc.top = hb_parvni( 2, 2 ); - rc.right = hb_parvni( 2, 3 ); - rc.bottom = hb_parvni( 2, 4 ); + rc.left = hb_parvni( 2, 1 ); + rc.top = hb_parvni( 2, 2 ); + rc.right = hb_parvni( 2, 3 ); + rc.bottom = hb_parvni( 2, 4 ); FillRect( hbwapi_par_raw_HDC( 1 ), &rc, hbwapi_par_raw_HBRUSH( 3 ) ); } @@ -1192,10 +1192,10 @@ HB_FUNC( WVG_BEGINMOUSETRACKING ) #if ! defined( HB_OS_WIN_CE ) TRACKMOUSEEVENT tmi; - tmi.cbSize = sizeof( TRACKMOUSEEVENT ); - tmi.dwFlags = TME_LEAVE | TME_HOVER; - tmi.hwndTrack = hbwapi_par_raw_HWND( 1 ); - tmi.dwHoverTime = 1; + tmi.cbSize = sizeof( TRACKMOUSEEVENT ); + tmi.dwFlags = TME_LEAVE | TME_HOVER; + tmi.hwndTrack = hbwapi_par_raw_HWND( 1 ); + tmi.dwHoverTime = 1; hbwapi_ret_L( _TrackMouseEvent( &tmi ) ); #else hbwapi_ret_L( FALSE ); @@ -1237,8 +1237,8 @@ LRESULT CALLBACK ControlWindowProcedure( HWND hwnd, UINT msg, WPARAM wParam, LPA HB_FUNC( WVG_SETWINDOWPROCBLOCK ) { WNDPROC oldProc; - HWND hWnd = hbwapi_par_raw_HWND( 1 ); - PHB_ITEM pBlock = hb_itemNew( hb_param( 2, HB_IT_BLOCK ) ); + HWND hWnd = hbwapi_par_raw_HWND( 1 ); + PHB_ITEM pBlock = hb_itemNew( hb_param( 2, HB_IT_BLOCK ) ); SetProp( hWnd, TEXT( "BLOCKCALLBACK" ), pBlock ); @@ -1255,8 +1255,8 @@ HB_FUNC( WVG_SETWINDOWPROCBLOCK ) HB_FUNC( WVG_RELEASEWINDOWPROCBLOCK ) { - HWND hWnd = hbwapi_par_raw_HWND( 1 ); - PHB_ITEM pBlock = ( PHB_ITEM ) RemoveProp( hWnd, TEXT( "BLOCKCALLBACK" ) ); + HWND hWnd = hbwapi_par_raw_HWND( 1 ); + PHB_ITEM pBlock = ( PHB_ITEM ) RemoveProp( hWnd, TEXT( "BLOCKCALLBACK" ) ); if( pBlock ) hb_itemRelease( pBlock );