diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 279ef80aec..5fa5c181eb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2012-11-05 02:22 UTC+0100 Viktor Szakats (harbour syenar.net) + * extras/gfspell/*.c + * extras/gtwvw/*.[c|h] + * extras/hbusb/*.c + * uncrustified automatically (rerun with new settings) + ! fixed some code/comments causing problems + 2012-11-05 01:03 UTC+0100 Viktor Szakats (harbour syenar.net) + contrib/hbtip/tests/gmail.hbp + added hbmk2 project for gmail.prg (picked up automatically diff --git a/harbour/extras/gfspell/spellc.c b/harbour/extras/gfspell/spellc.c index da4a33e896..da57a0c5a6 100644 --- a/harbour/extras/gfspell/spellc.c +++ b/harbour/extras/gfspell/spellc.c @@ -178,10 +178,10 @@ HB_FUNC( SP_RATE ) const uchar * cFound; int nFound; const uchar * cWord; - int nWord; - int nMinLen; - int x; - int lim; + int nWord; + int nMinLen; + int x; + int lim; uchar * cRating = "nZZ"; cFound = _parc( 1 ); @@ -242,7 +242,7 @@ HB_FUNC( SP_RATE ) HB_FUNC( C_METAFONE ) { - char * sReturn; /* Pointer to the return string. */ + char * sReturn; /* Pointer to the return string. */ const char * sMeta; /* Pointer to the passed string. */ unsigned int iRetLen; /* Length of the return string. */ unsigned int iStrLen; /* Length of the passed string. */ diff --git a/harbour/extras/gtwvw/gtwvw.c b/harbour/extras/gtwvw/gtwvw.c index d1436c98b5..08ab7de390 100644 --- a/harbour/extras/gtwvw/gtwvw.c +++ b/harbour/extras/gtwvw/gtwvw.c @@ -165,9 +165,9 @@ //static WIN_DATA *s_pWindows[ WVW_MAXWINDOWS ]; /*array of WIN_DATA */ //static APP_DATA s_sApp; /*application wide vars */ -WVW_DATA * s_pWvwData; -static BOOL bStartMode = TRUE; -static COLORREF _COLORS[] = { +WVW_DATA * s_pWvwData; +static BOOL bStartMode = TRUE; +static COLORREF _COLORS[] = { BLACK, BLUE, GREEN, @@ -187,10 +187,10 @@ static COLORREF _COLORS[] = { }; #ifdef WVW_DEBUG -static int nCountPuts = 0, nCountScroll = 0, nCountPaint = 0, nSetFocus = 0, nKillFocus = 0; +static int nCountPuts = 0, nCountScroll = 0, nCountPaint = 0, nSetFocus = 0, nKillFocus = 0; #endif -static int K_Ctrl[] = { +static int K_Ctrl[] = { K_CTRL_A, K_CTRL_B, K_CTRL_C, K_CTRL_D, K_CTRL_E, K_CTRL_F, K_CTRL_G, K_CTRL_H, K_CTRL_I, K_CTRL_J, K_CTRL_K, K_CTRL_L, K_CTRL_M, K_CTRL_N, K_CTRL_O, K_CTRL_P, K_CTRL_Q, K_CTRL_R, K_CTRL_S, K_CTRL_T, K_CTRL_U, K_CTRL_V, K_CTRL_W, K_CTRL_X, @@ -348,15 +348,15 @@ static BOOL hb_wvw_Size_Ready( BOOL b_p_SizeIsReady ); /* set in mainwin.c */ /* */ -extern int hb_iCmdShow; +extern int hb_iCmdShow; -static int s_iCursorStyle; -static int s_iOldCurStyle; +static int s_iCursorStyle; +static int s_iOldCurStyle; -static HB_FHANDLE s_iStdIn, s_iStdOut, s_iStdErr; +static HB_FHANDLE s_iStdIn, s_iStdOut, s_iStdErr; -static int s_GtId; -static HB_GT_FUNCS SuperTable; +static int s_GtId; +static HB_GT_FUNCS SuperTable; #define HB_GTSUPER ( &SuperTable ) #define HB_GTID_PTR ( &s_GtId ) @@ -365,15 +365,15 @@ HB_EXTERN_END LONG GetFontDialogUnits( HWND h, HFONT f ) { - HFONT hFont; - HFONT hFontOld; - LONG avgWidth; - HDC hDc; - char * tmp = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - SIZE sz; + HFONT hFont; + HFONT hFontOld; + LONG avgWidth; + HDC hDc; + char * tmp = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + SIZE sz; //get the hdc to the main window - hDc = GetDC( h ); + hDc = GetDC( h ); //with the current font attributes, select the font hFont = f; //GetStockObject(ANSI_VAR_FONT) ; @@ -408,57 +408,57 @@ LONG GetFontDialogUnits( HWND h, HFONT f ) static void hb_gt_wvw_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr ) { - HANDLE hInstance; - HANDLE hPrevInstance; - int iCmdShow; + HANDLE hInstance; + HANDLE hPrevInstance; + int iCmdShow; /* FSG: filename var for application name */ - PHB_FNAME pFileName; - USHORT i; + PHB_FNAME pFileName; + USHORT i; if( bStartMode ) { - s_pWvwData = ( WVW_DATA * ) hb_xgrab( sizeof( WVW_DATA ) ); + s_pWvwData = ( WVW_DATA * ) hb_xgrab( sizeof( WVW_DATA ) ); memset( s_pWvwData, 0, sizeof( WVW_DATA ) ); - s_pWvwData->s_sApp = ( APP_DATA * ) hb_xgrab( sizeof( APP_DATA ) ); + s_pWvwData->s_sApp = ( APP_DATA * ) hb_xgrab( sizeof( APP_DATA ) ); memset( s_pWvwData->s_sApp, 0, sizeof( APP_DATA ) ); - s_pWvwData->s_uiPaintRefresh = 100; - s_pWvwData->s_bMainCoordMode = FALSE; - s_pWvwData->s_bVertCaret = FALSE; - s_pWvwData->s_bNOSTARTUPSUBWINDOW = FALSE; - s_pWvwData->s_bDefCentreWindow = FALSE; - s_pWvwData->s_bDefHCentreWindow = FALSE; - s_pWvwData->s_bDefVCentreWindow = FALSE; - s_pWvwData->s_byDefLineSpacing = 0; - s_pWvwData->s_iDefLSpaceColor = -1; - s_pWvwData->s_bAllowNonTop = FALSE; - s_pWvwData->s_bRecurseCBlock = FALSE; - s_pWvwData->hWndTT = 0; - s_pWvwData->s_bQuickSetMode = FALSE; - s_pWvwData->s_bFlashingWindow = FALSE; - s_pWvwData->s_iScrolling = 0; - s_pWvwData->s_iWrongButtonUp = 0; - s_pWvwData->s_iMaxWrongButtonUp = 500; + s_pWvwData->s_uiPaintRefresh = 100; + s_pWvwData->s_bMainCoordMode = FALSE; + s_pWvwData->s_bVertCaret = FALSE; + s_pWvwData->s_bNOSTARTUPSUBWINDOW = FALSE; + s_pWvwData->s_bDefCentreWindow = FALSE; + s_pWvwData->s_bDefHCentreWindow = FALSE; + s_pWvwData->s_bDefVCentreWindow = FALSE; + s_pWvwData->s_byDefLineSpacing = 0; + s_pWvwData->s_iDefLSpaceColor = -1; + s_pWvwData->s_bAllowNonTop = FALSE; + s_pWvwData->s_bRecurseCBlock = FALSE; + s_pWvwData->hWndTT = 0; + s_pWvwData->s_bQuickSetMode = FALSE; + s_pWvwData->s_bFlashingWindow = FALSE; + s_pWvwData->s_iScrolling = 0; + s_pWvwData->s_iWrongButtonUp = 0; + s_pWvwData->s_iMaxWrongButtonUp = 500; strcpy( s_pWvwData->szAppName, "Harbour WVW" ); strcpy( s_pWvwData->szSubWinName, "Harbour WVW subwindows" ); - s_pWvwData->s_bSWRegistered = FALSE; - s_pWvwData->s_usCurWindow = 0; - bStartMode = FALSE; + s_pWvwData->s_bSWRegistered = FALSE; + s_pWvwData->s_usCurWindow = 0; + bStartMode = FALSE; } HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvw_Init()" ) ); /* stdin && stdout && stderr */ - s_iStdIn = hFilenoStdin; - s_iStdOut = hFilenoStdout; - s_iStdErr = hFilenoStderr; + s_iStdIn = hFilenoStdin; + s_iStdOut = hFilenoStdout; + s_iStdErr = hFilenoStderr; if( ! hb_winmainArgGet( &hInstance, &hPrevInstance, &iCmdShow ) ) hb_errInternal( 10001, "It's not a GUI program", NULL, NULL ); - s_iOldCurStyle = s_iCursorStyle = SC_NORMAL; + s_iOldCurStyle = s_iCursorStyle = SC_NORMAL; s_pWvwData->s_usNumWindows = 0; for( i = 0; i < WVW_MAXWINDOWS; i++ ) @@ -470,9 +470,9 @@ static void hb_gt_wvw_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil hb_gtInitStatics( 0, ( LPCTSTR ) s_pWvwData->szAppName, 0, 0, WVW_DEFAULT_ROWS - 1, WVW_DEFAULT_COLS - 1 ); - s_pWvwData->hInstance = ( HINSTANCE ) hInstance; + s_pWvwData->hInstance = ( HINSTANCE ) hInstance; - s_pWvwData->s_pWindows[ 0 ]->hWnd = hb_gt_wvwCreateWindow( ( HINSTANCE ) hInstance, ( HINSTANCE ) hPrevInstance, "", iCmdShow ); + s_pWvwData->s_pWindows[ 0 ]->hWnd = hb_gt_wvwCreateWindow( ( HINSTANCE ) hInstance, ( HINSTANCE ) hPrevInstance, "", iCmdShow ); if( ! s_pWvwData->s_pWindows[ 0 ]->hWnd ) { @@ -488,15 +488,15 @@ static void hb_gt_wvw_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil hb_xfree( pFileName ); hb_gt_wvwCreateObjects( 0 ); - s_pWvwData->s_pWindows[ 0 ]->hdc = GetDC( s_pWvwData->s_pWindows[ 0 ]->hWnd ); - s_pWvwData->s_pWindows[ 0 ]->hCompDC = CreateCompatibleDC( s_pWvwData->s_pWindows[ 0 ]->hdc ); + s_pWvwData->s_pWindows[ 0 ]->hdc = GetDC( s_pWvwData->s_pWindows[ 0 ]->hWnd ); + s_pWvwData->s_pWindows[ 0 ]->hCompDC = CreateCompatibleDC( s_pWvwData->s_pWindows[ 0 ]->hdc ); /* Apos o Device Context e as PENs e BRUSHes criados, atribuo uma PEN e um BRUSH qualquer apenas para pegar o handle original da PEN e BRUSH do Device Context */ - s_pWvwData->s_sApp->OriginalPen = ( HPEN ) SelectObject( s_pWvwData->s_pWindows[ 0 ]->hdc, ( HPEN ) s_pWvwData->s_sApp->penWhite ); - s_pWvwData->s_sApp->OriginalBrush = ( HBRUSH ) SelectObject( s_pWvwData->s_pWindows[ 0 ]->hdc, ( HBRUSH ) s_pWvwData->s_sApp->currentBrush ); + s_pWvwData->s_sApp->OriginalPen = ( HPEN ) SelectObject( s_pWvwData->s_pWindows[ 0 ]->hdc, ( HPEN ) s_pWvwData->s_sApp->penWhite ); + s_pWvwData->s_sApp->OriginalBrush = ( HBRUSH ) SelectObject( s_pWvwData->s_pWindows[ 0 ]->hdc, ( HBRUSH ) s_pWvwData->s_sApp->currentBrush ); /* E, logo apos, restaura aos valores originais mantendo em s_pWvwData->s_sApp os valores salvos para restauracao quando for utilizar DeleteObject() @@ -529,12 +529,12 @@ BOOL hb_gt_wvwDestroyPicture( IPicture * iPicture ) static void hb_gt_wvw_Exit( PHB_GT pGT ) { //void gt_Exit( void ) - int i; - int j; - WIN_DATA * pWindowData; - BITMAP_HANDLE * pbh; - PICTURE_HANDLE * pph; - CONTROL_DATA * pcd; + int i; + int j; + WIN_DATA * pWindowData; + BITMAP_HANDLE * pbh; + PICTURE_HANDLE * pph; + CONTROL_DATA * pcd; HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvw_Exit()" ) ); @@ -764,11 +764,11 @@ static void hb_gt_wvw_Exit( PHB_GT pGT ) void hb_gt_wvw_SetPos( PHB_GT pGT, int iRow, int iCol ) { - int i_Row = iRow; - int i_Col = iCol; + int i_Row = iRow; + int i_Col = iCol; - pGT->iRow = iRow; - pGT->iCol = iCol; + pGT->iRow = iRow; + pGT->iCol = iCol; HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvw_SetPos( %hd, %hd )", iRow, iCol ) ); @@ -832,33 +832,33 @@ static int hb_gt_wvw_GetCursorStyle( PHB_GT pGT ) static void hb_gt_wvw_SetCursorStyle( PHB_GT pGT, int iStyle ) { - BOOL bCursorOn = TRUE; - WIN_DATA * pWindowData; - USHORT usFullSize; + BOOL bCursorOn = TRUE; + WIN_DATA * pWindowData; + USHORT usFullSize; HB_SYMBOL_UNUSED( pGT ); HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvw_SetCursorStyle( %hu )", iStyle ) ); - pWindowData = ( WIN_DATA * ) s_pWvwData->s_pWindows[ s_pWvwData->s_usNumWindows - 1 ]; - usFullSize = ( USHORT ) ( s_pWvwData->s_bVertCaret ? pWindowData->PTEXTSIZE.x : pWindowData->PTEXTSIZE.y ); + pWindowData = ( WIN_DATA * ) s_pWvwData->s_pWindows[ s_pWvwData->s_usNumWindows - 1 ]; + usFullSize = ( USHORT ) ( s_pWvwData->s_bVertCaret ? pWindowData->PTEXTSIZE.x : pWindowData->PTEXTSIZE.y ); s_iCursorStyle = iStyle; switch( iStyle ) { case SC_NONE: - pWindowData->CaretSize = 0; - bCursorOn = FALSE; + pWindowData->CaretSize = 0; + bCursorOn = FALSE; break; case SC_INSERT: - pWindowData->CaretSize = ( usFullSize / 2 ); + pWindowData->CaretSize = ( usFullSize / 2 ); break; case SC_SPECIAL1: - pWindowData->CaretSize = usFullSize; + pWindowData->CaretSize = usFullSize; break; case SC_SPECIAL2: - pWindowData->CaretSize = -( usFullSize / 2 ); + pWindowData->CaretSize = -( usFullSize / 2 ); break; case SC_NORMAL: default: @@ -992,14 +992,14 @@ static void hb_gt_wvw_SetAttribute( PHB_GT pGT, int iTop, int iLeft, int iBottom static void hb_gt_wvw_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, int bColor, USHORT bChar, int iRows, int iCols ) { - LONG usSaveRow, usSaveCol; + LONG usSaveRow, usSaveCol; - BYTE ucBlank[ WVW_CHAR_BUFFER ], ucBuff[ WVW_CHAR_BUFFER * 2 ]; - BYTE * fpBlank; - BYTE * fpBuff; - int iLength = ( iRight - iLeft ) + 1; - int iCount, iColOld, iColNew, iColSize; - BOOL bMalloc = FALSE; + BYTE ucBlank[ WVW_CHAR_BUFFER ], ucBuff[ WVW_CHAR_BUFFER * 2 ]; + BYTE * fpBlank; + BYTE * fpBuff; + int iLength = ( iRight - iLeft ) + 1; + int iCount, iColOld, iColNew, iColSize; + BOOL bMalloc = FALSE; HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvw_Scroll( %hu, %hu, %hu, %hu, %hu, %hd, %hd )", iTop, iLeft, iBottom, iRight, bColor, iRows, iCols ) ); @@ -1014,14 +1014,14 @@ static void hb_gt_wvw_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int if( iLength > WVW_CHAR_BUFFER ) /* Avoid allocating memory if possible */ { - fpBlank = ( BYTE * ) hb_xgrab( iLength ); - fpBuff = ( BYTE * ) hb_xgrab( iLength * 2 ); /* *2 room for attribs */ - bMalloc = TRUE; + fpBlank = ( BYTE * ) hb_xgrab( iLength ); + fpBuff = ( BYTE * ) hb_xgrab( iLength * 2 ); /* *2 room for attribs */ + bMalloc = TRUE; } else { - fpBlank = ucBlank; - fpBuff = ucBuff; + fpBlank = ucBlank; + fpBuff = ucBuff; } memset( fpBlank, hb_gtGetClearChar(), iLength ); @@ -1050,8 +1050,8 @@ static void hb_gt_wvw_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int hb_gt_wvw_vDispBegin( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ] ); } - usSaveCol = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->caretPos.x; - usSaveRow = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->caretPos.y; + usSaveCol = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->caretPos.x; + usSaveRow = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->caretPos.y; for( iCount = ( iRows >= 0 ? iTop : iBottom ); ( iRows >= 0 ? iCount <= iBottom : iCount >= iTop ); ( iRows >= 0 ? iCount++ : iCount-- ) ) @@ -1086,16 +1086,16 @@ static void hb_gt_wvw_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int { RECT cr = { 0 }, crInvalid = { 0 }; - cr.left = iLeft + ( iCols > 0 ? 1 : 0 ); - cr.top = iTop + ( iRows > 0 ? 1 : 0 ); - cr.right = iRight - ( iCols < 0 ? 1 : 0 ); - cr.bottom = iBottom - ( iRows < 0 ? 1 : 0 ); + cr.left = iLeft + ( iCols > 0 ? 1 : 0 ); + cr.top = iTop + ( iRows > 0 ? 1 : 0 ); + cr.right = iRight - ( iCols < 0 ? 1 : 0 ); + cr.bottom = iBottom - ( iRows < 0 ? 1 : 0 ); - cr = hb_gt_wvwGetXYFromColRowRect( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ], cr ); + cr = hb_gt_wvwGetXYFromColRowRect( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ], cr ); - cr.top -= ( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->byLineSpacing / 2 ); + cr.top -= ( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->byLineSpacing / 2 ); - cr.bottom += ( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->byLineSpacing / 2 ); + cr.bottom += ( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->byLineSpacing / 2 ); ScrollWindowEx( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->hWnd, -iCols * s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->PTEXTSIZE.x, -iRows * hb_wvw_LineHeight( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ] ), &cr, NULL, NULL, &crInvalid, 0 ); InvalidateRect( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->hWnd, &crInvalid, FALSE ); @@ -1184,10 +1184,10 @@ static const char * hb_gt_wvw_Version( PHB_GT pGT, int iType ) static void hb_gt_wvw_Box( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, const char * pbyFrame, int bColor ) { - int i_Top = ( iTop < 0 ? 0 : iTop ); - int i_Left = ( iLeft < 0 ? 0 : iLeft ); - int i_Bottom = ( iBottom < 0 ? 0 : iBottom ); - int i_Right = ( iRight < 0 ? 0 : iRight ); + int i_Top = ( iTop < 0 ? 0 : iTop ); + int i_Left = ( iLeft < 0 ? 0 : iLeft ); + int i_Bottom = ( iBottom < 0 ? 0 : iBottom ); + int i_Right = ( iRight < 0 ? 0 : iRight ); HB_SYMBOL_UNUSED( pGT ); @@ -1207,10 +1207,10 @@ static void hb_gt_wvw_Box( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRi static void hb_gt_wvw_HorizLine( PHB_GT pGT, int iRow, int iLeft, int iRight, USHORT bChar, int bColor ) { - int iWidth; - int i_Row = ( iRow < 0 ? 0 : iRow ); - int i_Left = ( iLeft < 0 ? 0 : iLeft ); - int i_Right = ( iRight < 0 ? 0 : iRight ); + int iWidth; + int i_Row = ( iRow < 0 ? 0 : iRow ); + int i_Left = ( iLeft < 0 ? 0 : iLeft ); + int i_Right = ( iRight < 0 ? 0 : iRight ); HB_SYMBOL_UNUSED( pGT ); @@ -1220,9 +1220,9 @@ static void hb_gt_wvw_HorizLine( PHB_GT pGT, int iRow, int iLeft, int iRight, US if( i_Left > i_Right ) { int temp; - temp = i_Left; - i_Left = i_Right; - i_Right = temp; + temp = i_Left; + i_Left = i_Right; + i_Right = temp; } hb_gt_wvwFUNCPrologue( 4, &i_Row, &i_Left, NULL, &i_Right ); } @@ -1262,12 +1262,12 @@ static void hb_gt_wvw_HorizLine( PHB_GT pGT, int iRow, int iLeft, int iRight, US static void hb_gt_wvw_VertLine( PHB_GT pGT, int iCol, int iTop, int iBottom, USHORT bChar, int bColor ) { - int i_Width; - int i_Height; - int i_Row; - int i_Col = ( iCol < 0 ? 0 : iCol ); - int i_Top = ( iTop < 0 ? 0 : iTop ); - int i_Bottom = ( iBottom < 0 ? 0 : iBottom ); + int i_Width; + int i_Height; + int i_Row; + int i_Col = ( iCol < 0 ? 0 : iCol ); + int i_Top = ( iTop < 0 ? 0 : iTop ); + int i_Bottom = ( iBottom < 0 ? 0 : iBottom ); HB_SYMBOL_UNUSED( pGT ); @@ -1348,8 +1348,8 @@ static void hb_gt_wvw_OutErr( PHB_GT pGT, const char * pbyStr, HB_SIZE ulLen ) static BOOL hb_gt_wvwGetCharFromInputQueue( int * c ) { - UINT uiWindow = s_pWvwData->s_usNumWindows - 1; - WIN_DATA * pWindow = s_pWvwData->s_pWindows[ uiWindow ]; + UINT uiWindow = s_pWvwData->s_usNumWindows - 1; + WIN_DATA * pWindow = s_pWvwData->s_pWindows[ uiWindow ]; /* int iNextPos; @@ -1385,8 +1385,8 @@ static BOOL hb_gt_wvwGetCharFromInputQueue( int * c ) static int hb_gt_wvw_ReadKey( PHB_GT pGT, int eventmask ) { - int c = 0; - BOOL bKey; + int c = 0; + BOOL bKey; HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvw_ReadKey( %d )", ( int ) eventmask ) ); @@ -1475,8 +1475,8 @@ static int hb_gt_wvw_mouse_Row( PHB_GT pGT ) static void hb_gt_wvw_mouse_SetPos( PHB_GT pGT, int iRow, int iCol ) { - int i_Row = ( iRow < 0 ? 0 : iRow ); - int i_Col = ( iCol < 0 ? 0 : iCol ); + int i_Row = ( iRow < 0 ? 0 : iRow ); + int i_Col = ( iCol < 0 ? 0 : iCol ); HB_SYMBOL_UNUSED( pGT ); if( s_pWvwData->s_bMainCoordMode ) @@ -1503,8 +1503,8 @@ static void hb_gt_wvw_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol ) HB_SYMBOL_UNUSED( pGT ); - *piRow = hb_gt_wvw_mouse_Row( pGT ); - *piCol = hb_gt_wvw_mouse_Col( pGT ); + *piRow = hb_gt_wvw_mouse_Row( pGT ); + *piCol = hb_gt_wvw_mouse_Col( pGT ); } @@ -1542,8 +1542,8 @@ static int hb_gt_wvw_mouse_CountButton( PHB_GT pGT ) //int gt_info(int iMsgType, BOOL bUpdate, int iParam, void *vpParam ) static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) { - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]; - int iVal; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]; + int iVal; HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvw_Info(%p,%d,%p)", pGT, iType, pInfo ) ); HB_SYMBOL_UNUSED( pGT ); @@ -1582,7 +1582,7 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) case HB_GTI_FONTSIZE: pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWindowData->PTEXTSIZE.y ); - iVal = hb_itemGetNI( pInfo->pNewVal ); + iVal = hb_itemGetNI( pInfo->pNewVal ); if( iVal > 0 ) { HFONT hFont = hb_gt_wvwGetFont( pWindowData->fontFace, iVal, pWindowData->fontWidth, pWindowData->fontWeight, pWindowData->fontQuality, pWindowData->CodePage ); @@ -1611,7 +1611,7 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) case HB_GTI_FONTWIDTH: pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWindowData->fontWidth ); - iVal = hb_itemGetNI( pInfo->pNewVal ); + iVal = hb_itemGetNI( pInfo->pNewVal ); if( iVal > 0 ) { /* store font status for next operation on fontsize */ @@ -1684,10 +1684,10 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) break; case NONANTIALIASED_QUALITY: case PROOF_QUALITY: - iVal = HB_GTI_FONTQ_DRAFT; + iVal = HB_GTI_FONTQ_DRAFT; break; default: - iVal = 0; + iVal = 0; break; } pInfo->pResult = hb_itemPutNI( pInfo->pResult, iVal ); @@ -1696,31 +1696,31 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) switch( hb_itemGetNI( pInfo->pNewVal ) ) { case HB_GTI_FONTQ_HIGH: - pWindowData->fontQuality = ANTIALIASED_QUALITY; + pWindowData->fontQuality = ANTIALIASED_QUALITY; break; case HB_GTI_FONTQ_NORMAL: - pWindowData->fontQuality = DEFAULT_QUALITY; + pWindowData->fontQuality = DEFAULT_QUALITY; break; case HB_GTI_FONTQ_DRAFT: - pWindowData->fontQuality = DRAFT_QUALITY; + pWindowData->fontQuality = DRAFT_QUALITY; break; } } break; case HB_GTI_SCREENHEIGHT: - /*NOTE 20040618 currently not includes StatusBar and ToolBar, if any. - *TODO I Think it should return ALL window height, incl - * StatusBar and ToolBar - * ie. hb_gt_wvwCalcPixelHeight() - **SEEALSO hb_gt_wvwCalcPixelHeight() + /* NOTE 20040618 currently not includes StatusBar and ToolBar, if any. + * TODO I Think it should return ALL window height, incl + * StatusBar and ToolBar + * ie. hb_gt_wvwCalcPixelHeight() + * SEEALSO hb_gt_wvwCalcPixelHeight() */ /*NOTE 20040719 screenheight includes linespacing, if any */ pInfo->pResult = hb_itemPutNI( pInfo->pResult, hb_wvw_LineHeight( pWindowData ) * pWindowData->ROWS ); - iVal = hb_itemGetNI( pInfo->pNewVal ); + iVal = hb_itemGetNI( pInfo->pNewVal ); if( iVal > 0 ) { hb_gt_wvw_bSetMode( pWindowData, ( USHORT ) ( iVal / hb_wvw_LineHeight( pWindowData ) ), pWindowData->COLS ); @@ -1729,7 +1729,7 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) case HB_GTI_SCREENWIDTH: pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWindowData->PTEXTSIZE.x * pWindowData->COLS ); - iVal = hb_itemGetNI( pInfo->pNewVal ); + iVal = hb_itemGetNI( pInfo->pNewVal ); if( iVal > 0 ) { hb_gt_wvw_bSetMode( pWindowData, pWindowData->ROWS, ( USHORT ) ( iVal / pWindowData->PTEXTSIZE.x ) ); @@ -1738,10 +1738,10 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) case HB_GTI_DESKTOPWIDTH: { - RECT rDesk = { 0 }; - HWND hDesk; + RECT rDesk = { 0 }; + HWND hDesk; - hDesk = GetDesktopWindow(); + hDesk = GetDesktopWindow(); GetWindowRect( hDesk, &rDesk ); pInfo->pResult = hb_itemPutNI( pInfo->pResult, rDesk.right - rDesk.left ); break; @@ -1754,8 +1754,8 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) *SEEALSO hb_gt_wvwCalcPixelHeight() - usSBHeight - usTBHeight */ - RECT rDesk = { 0 }; - HWND hDesk = GetDesktopWindow(); + RECT rDesk = { 0 }; + HWND hDesk = GetDesktopWindow(); GetWindowRect( hDesk, &rDesk ); pInfo->pResult = hb_itemPutNI( pInfo->pResult, rDesk.bottom - rDesk.top ); break; @@ -1763,10 +1763,10 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) case HB_GTI_DESKTOPCOLS: { - RECT rDesk = { 0 }; - HWND hDesk; + RECT rDesk = { 0 }; + HWND hDesk; - hDesk = GetDesktopWindow(); + hDesk = GetDesktopWindow(); GetClientRect( hDesk, &rDesk ); pInfo->pResult = hb_itemPutNI( pInfo->pResult, @@ -1783,10 +1783,10 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) /*NOTE 20040719 screenheight includes linespacing, if any */ - RECT rDesk = { 0 }; - HWND hDesk; + RECT rDesk = { 0 }; + HWND hDesk; - hDesk = GetDesktopWindow(); + hDesk = GetDesktopWindow(); GetClientRect( hDesk, &rDesk ); pInfo->pResult = hb_itemPutNI( pInfo->pResult, @@ -1806,7 +1806,7 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) } case HB_GTI_CODEPAGE: pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWindowData->CodePage ); - iVal = hb_itemGetNI( pInfo->pNewVal ); + iVal = hb_itemGetNI( pInfo->pNewVal ); if( iVal > 0 && iVal != pWindowData->CodePage ) { hb_gt_wvwSetCodePage( s_pWvwData->s_usCurWindow, iVal );; @@ -1961,7 +1961,7 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) * */ -#define SetGFXContext() hPen = CreatePen( PS_SOLID, 1, color ); hOldPen = ( HPEN ) SelectObject( hdc, hPen ); hBrush = ( HBRUSH ) CreateSolidBrush( color ); hOldBrush = ( HBRUSH ) SelectObject( hdc, hBrush ); bOut = TRUE +#define SetGFXContext() hPen = CreatePen( PS_SOLID, 1, color ); hOldPen = ( HPEN ) SelectObject( hdc, hPen ); hBrush = ( HBRUSH ) CreateSolidBrush( color ); hOldBrush = ( HBRUSH ) SelectObject( hdc, hBrush ); bOut = TRUE /*WARNING: assume working on current window *NOTES: in MainCoord Mode current window is always the Main Window @@ -1969,13 +1969,13 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) static int hb_gt_wvw_gfxPrimitive( PHB_GT pGT, int iType, int iTop, int iLeft, int iBottom, int iRight, int iColor ) { - COLORREF color; - HPEN hPen = NULL, hOldPen = NULL; - HBRUSH hBrush = NULL, hOldBrush = NULL; - HDC hdc; - BOOL bOut = FALSE; - int iRet = 0; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]; + COLORREF color; + HPEN hPen = NULL, hOldPen = NULL; + HBRUSH hBrush = NULL, hOldBrush = NULL; + HDC hdc; + BOOL bOut = FALSE; + int iRet = 0; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]; HB_SYMBOL_UNUSED( pGT ); @@ -1997,7 +1997,7 @@ static int hb_gt_wvw_gfxPrimitive( PHB_GT pGT, int iType, int iTop, int iLeft, i MoveToEx( hdc, iLeft, iTop, NULL ); LineTo( hdc, iLeft, iTop ); - iRet = 1; + iRet = 1; break; case HB_GFX_LINE: color = RGB( iColor >> 16, ( iColor & 0xFF00 ) >> 8, iColor & 0xFF ); @@ -2016,7 +2016,7 @@ static int hb_gt_wvw_gfxPrimitive( PHB_GT pGT, int iType, int iTop, int iLeft, i r.right = iRight; r.bottom = iBottom; - color = RGB( iColor >> 16, ( iColor & 0xFF00 ) >> 8, iColor & 0xFF ); + color = RGB( iColor >> 16, ( iColor & 0xFF00 ) >> 8, iColor & 0xFF ); SetGFXContext(); FrameRect( hdc, &r, hBrush ); @@ -2030,7 +2030,7 @@ static int hb_gt_wvw_gfxPrimitive( PHB_GT pGT, int iType, int iTop, int iLeft, i Rectangle( hdc, iLeft, iTop, iRight, iBottom ); - iRet = 1; + iRet = 1; break; case HB_GFX_CIRCLE: color = RGB( iRight >> 16, ( iRight & 0xFF00 ) >> 8, iRight & 0xFF ); @@ -2038,7 +2038,7 @@ static int hb_gt_wvw_gfxPrimitive( PHB_GT pGT, int iType, int iTop, int iLeft, i Arc( hdc, iLeft - iBottom / 2, iTop - iBottom / 2, iLeft + iBottom / 2, iTop + iBottom / 2, 0, 0, 0, 0 ); - iRet = 1; + iRet = 1; break; case HB_GFX_FILLEDCIRCLE: color = RGB( iRight >> 16, ( iRight & 0xFF00 ) >> 8, iRight & 0xFF ); @@ -2046,7 +2046,7 @@ static int hb_gt_wvw_gfxPrimitive( PHB_GT pGT, int iType, int iTop, int iLeft, i Ellipse( hdc, iLeft - iBottom / 2, iTop - iBottom / 2, iLeft + iBottom / 2, iTop + iBottom / 2 ); - iRet = 1; + iRet = 1; break; case HB_GFX_ELLIPSE: color = RGB( iColor >> 16, ( iColor & 0xFF00 ) >> 8, iColor & 0xFF ); @@ -2054,7 +2054,7 @@ static int hb_gt_wvw_gfxPrimitive( PHB_GT pGT, int iType, int iTop, int iLeft, i Arc( hdc, iLeft - iRight / 2, iTop - iBottom / 2, iLeft + iRight / 2, iTop + iBottom / 2, 0, 0, 0, 0 ); - iRet = 1; + iRet = 1; break; case HB_GFX_FILLEDELLIPSE: color = RGB( iColor >> 16, ( iColor & 0xFF00 ) >> 8, iColor & 0xFF ); @@ -2062,7 +2062,7 @@ static int hb_gt_wvw_gfxPrimitive( PHB_GT pGT, int iType, int iTop, int iLeft, i Ellipse( hdc, iLeft - iRight / 2, iTop - iBottom / 2, iLeft + iRight / 2, iTop + iBottom / 2 ); - iRet = 1; + iRet = 1; break; case HB_GFX_FLOODFILL: color = RGB( iBottom >> 16, ( iBottom & 0xFF00 ) >> 8, iBottom & 0xFF ); @@ -2108,8 +2108,8 @@ void gt_gfxText( int iTop, int iLeft, char * cBuf, int iColor, int iSize, int iW BOOL CALLBACK hb_gt_wvwDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { int iIndex, iType; - long int bReturn = FALSE; - PHB_ITEM pFunc = NULL; + long int bReturn = FALSE; + PHB_ITEM pFunc = NULL; iType = ( int ) NULL; @@ -2229,11 +2229,11 @@ BOOL CALLBACK hb_gt_wvwDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPA hb_itemRelease( s_pWvwData->s_sApp->pFunc[ iIndex ] ); } - s_pWvwData->s_sApp->hDlgModeless[ iIndex ] = NULL; + s_pWvwData->s_sApp->hDlgModeless[ iIndex ] = NULL; - s_pWvwData->s_sApp->pFunc[ iIndex ] = NULL; - s_pWvwData->s_sApp->iType[ iIndex ] = ( int ) NULL; - bReturn = FALSE; + s_pWvwData->s_sApp->pFunc[ iIndex ] = NULL; + s_pWvwData->s_sApp->iType[ iIndex ] = ( int ) NULL; + bReturn = FALSE; break; } @@ -2245,10 +2245,10 @@ BOOL CALLBACK hb_gt_wvwDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPA BOOL CALLBACK hb_gt_wvwDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { int iIndex, iType; - long int bReturn = FALSE; - PHB_ITEM pFunc = NULL; + long int bReturn = FALSE; + PHB_ITEM pFunc = NULL; - int iFirst = ( int ) lParam; + int iFirst = ( int ) lParam; if( iFirst > 0 && iFirst <= WVW_DLGMD_MAX ) { @@ -2370,10 +2370,10 @@ BOOL CALLBACK hb_gt_wvwDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPA hb_itemRelease( s_pWvwData->s_sApp->pFuncModal[ iIndex ] ); } - s_pWvwData->s_sApp->hDlgModal[ iIndex ] = NULL; - s_pWvwData->s_sApp->pFuncModal[ iIndex ] = NULL; - s_pWvwData->s_sApp->iTypeModal[ iIndex ] = ( int ) NULL; - bReturn = FALSE; + s_pWvwData->s_sApp->hDlgModal[ iIndex ] = NULL; + s_pWvwData->s_sApp->pFuncModal[ iIndex ] = NULL; + s_pWvwData->s_sApp->iTypeModal[ iIndex ] = ( int ) NULL; + bReturn = FALSE; break; } @@ -2409,33 +2409,33 @@ static void hb_gt_wvwCreateObjects( UINT usWinNum ) return; } - s_pWvwData->s_sApp->penWhite = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 255, 255, 255 ) ); - s_pWvwData->s_sApp->penBlack = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 0, 0, 0 ) ); - s_pWvwData->s_sApp->penWhiteDim = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 205, 205, 205 ) ); - s_pWvwData->s_sApp->penDarkGray = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 150, 150, 150 ) ); - s_pWvwData->s_sApp->penGray = CreatePen( PS_SOLID, 0, ( COLORREF ) _COLORS[ 7 ] ); - s_pWvwData->s_sApp->penNull = CreatePen( PS_NULL, 0, ( COLORREF ) _COLORS[ 7 ] ); - s_pWvwData->s_sApp->currentPen = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 0, 0, 0 ) ); + s_pWvwData->s_sApp->penWhite = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 255, 255, 255 ) ); + s_pWvwData->s_sApp->penBlack = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 0, 0, 0 ) ); + s_pWvwData->s_sApp->penWhiteDim = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 205, 205, 205 ) ); + s_pWvwData->s_sApp->penDarkGray = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 150, 150, 150 ) ); + s_pWvwData->s_sApp->penGray = CreatePen( PS_SOLID, 0, ( COLORREF ) _COLORS[ 7 ] ); + s_pWvwData->s_sApp->penNull = CreatePen( PS_NULL, 0, ( COLORREF ) _COLORS[ 7 ] ); + s_pWvwData->s_sApp->currentPen = CreatePen( PS_SOLID, 0, ( COLORREF ) RGB( 0, 0, 0 ) ); - lb.lbStyle = BS_NULL; - lb.lbColor = RGB( 198, 198, 198 ); - lb.lbHatch = 0; - s_pWvwData->s_sApp->currentBrush = CreateBrushIndirect( &lb ); + lb.lbStyle = BS_NULL; + lb.lbColor = RGB( 198, 198, 198 ); + lb.lbHatch = 0; + s_pWvwData->s_sApp->currentBrush = CreateBrushIndirect( &lb ); - lb.lbStyle = BS_HATCHED; - lb.lbColor = RGB( 210, 210, 210 ); - lb.lbHatch = HS_DIAGCROSS; /* HS_BDIAGONAL; */ - s_pWvwData->s_sApp->diagonalBrush = CreateBrushIndirect( &lb ); + lb.lbStyle = BS_HATCHED; + lb.lbColor = RGB( 210, 210, 210 ); + lb.lbHatch = HS_DIAGCROSS; /* HS_BDIAGONAL; */ + s_pWvwData->s_sApp->diagonalBrush = CreateBrushIndirect( &lb ); - lb.lbStyle = BS_SOLID; - lb.lbColor = 0; /* RGB( 0,0,0 ); */ - lb.lbHatch = 0; - s_pWvwData->s_sApp->solidBrush = CreateBrushIndirect( &lb ); + lb.lbStyle = BS_SOLID; + lb.lbColor = 0; /* RGB( 0,0,0 ); */ + lb.lbHatch = 0; + s_pWvwData->s_sApp->solidBrush = CreateBrushIndirect( &lb ); - lb.lbStyle = BS_SOLID; - lb.lbColor = _COLORS[ 7 ]; - lb.lbHatch = 0; - s_pWvwData->s_sApp->wvwWhiteBrush = CreateBrushIndirect( &lb ); + lb.lbStyle = BS_SOLID; + lb.lbColor = _COLORS[ 7 ]; + lb.lbHatch = 0; + s_pWvwData->s_sApp->wvwWhiteBrush = CreateBrushIndirect( &lb ); } @@ -2505,43 +2505,43 @@ static BOOL hb_gt_wvwInitWindow( WIN_DATA * pWindowData, HWND hWnd, USHORT col, static BOOL hb_gt_wvwValidWindowSize( WIN_DATA * pWindowData, int rows, int cols, HFONT hFont, int iWidth, int * pmaxrows, int * pmaxcols ) { - HDC hdc; - HFONT hOldFont; - USHORT width, height, maxWidth, maxHeight; - USHORT diffHeight, diffWidth; - TEXTMETRIC tm = { 0 }; - RECT rcWorkArea = { 0 }; + HDC hdc; + HFONT hOldFont; + USHORT width, height, maxWidth, maxHeight; + USHORT diffHeight, diffWidth; + TEXTMETRIC tm = { 0 }; + RECT rcWorkArea = { 0 }; - RECT wi = { 0 }, ci = { 0 }; + RECT wi = { 0 }, ci = { 0 }; SystemParametersInfo( SPI_GETWORKAREA, 0, &rcWorkArea, 0 ); - maxWidth = ( SHORT ) ( rcWorkArea.right - rcWorkArea.left + 1 ); - maxHeight = ( SHORT ) ( rcWorkArea.bottom - rcWorkArea.top + 1 ); + maxWidth = ( SHORT ) ( rcWorkArea.right - rcWorkArea.left + 1 ); + maxHeight = ( SHORT ) ( rcWorkArea.bottom - rcWorkArea.top + 1 ); - hdc = GetDC( pWindowData->hWnd ); - hOldFont = ( HFONT ) SelectObject( hdc, hFont ); + hdc = GetDC( pWindowData->hWnd ); + hOldFont = ( HFONT ) SelectObject( hdc, hFont ); GetTextMetrics( hdc, &tm ); SelectObject( hdc, hOldFont ); ReleaseDC( pWindowData->hWnd, hdc ); - width = ( iWidth < 0 ? ( USHORT ) -iWidth : ( USHORT ) ( ( USHORT ) ( LONG ) ( tm.tmAveCharWidth ) ) ) * ( USHORT ) cols; /* Total pixel width this setting would take */ - height = ( USHORT ) ( ( USHORT ) ( LONG ) ( tm.tmHeight ) ) * ( USHORT ) rows; /* Total pixel height this setting would take */ + width = ( iWidth < 0 ? ( USHORT ) -iWidth : ( USHORT ) ( ( USHORT ) ( LONG ) ( tm.tmAveCharWidth ) ) ) * ( USHORT ) cols; /* Total pixel width this setting would take */ + height = ( USHORT ) ( ( USHORT ) ( LONG ) ( tm.tmHeight ) ) * ( USHORT ) rows; /* Total pixel height this setting would take */ GetWindowRect( pWindowData->hWnd, &wi ); GetClientRect( pWindowData->hWnd, &ci ); - diffWidth = ( SHORT ) ( ( wi.right - wi.left ) - ( ci.right ) ); - diffHeight = ( SHORT ) ( ( wi.bottom - wi.top ) - ( ci.bottom ) ); - width += diffWidth; - height += diffHeight; + diffWidth = ( SHORT ) ( ( wi.right - wi.left ) - ( ci.right ) ); + diffHeight = ( SHORT ) ( ( wi.bottom - wi.top ) - ( ci.bottom ) ); + width += diffWidth; + height += diffHeight; - height += ( USHORT ) ( pWindowData->byLineSpacing * rows ); + height += ( USHORT ) ( pWindowData->byLineSpacing * rows ); - height += pWindowData->usTBHeight; + height += pWindowData->usTBHeight; - height += pWindowData->usSBHeight; + height += pWindowData->usSBHeight; /* TODO: should also calc menu */ @@ -2564,33 +2564,33 @@ static BOOL hb_gt_wvwValidWindowSize( WIN_DATA * pWindowData, int rows, int cols static void hb_gt_wvwResetWindowSize( WIN_DATA * pWindowData, HWND hWnd ) { - HDC hdc; - HFONT hFont, hOldFont; - USHORT diffWidth, diffHeight; - USHORT height, width; - RECT wi = { 0 }, ci = { 0 }; - TEXTMETRIC tm = { 0 }; + HDC hdc; + HFONT hFont, hOldFont; + USHORT diffWidth, diffHeight; + USHORT height, width; + RECT wi = { 0 }, ci = { 0 }; + TEXTMETRIC tm = { 0 }; - RECT rcWorkArea = { 0 }; - RECT rcMainClientArea = { 0 }; - int n; - WIN_DATA * pMainWindow; + RECT rcWorkArea = { 0 }; + RECT rcMainClientArea = { 0 }; + int n; + WIN_DATA * pMainWindow; pMainWindow = s_pWvwData->s_pWindows[ 0 ]; /* set the font and get it's size to determine the size of the client area * for the required number of rows and columns */ - hdc = GetDC( hWnd ); - hFont = hb_gt_wvwGetFont( pWindowData->fontFace, pWindowData->fontHeight, pWindowData->fontWidth, pWindowData->fontWeight, pWindowData->fontQuality, pWindowData->CodePage ); + hdc = GetDC( hWnd ); + hFont = hb_gt_wvwGetFont( pWindowData->fontFace, pWindowData->fontHeight, pWindowData->fontWidth, pWindowData->fontWeight, pWindowData->fontQuality, pWindowData->CodePage ); if( pWindowData->hFont ) { DeleteObject( ( HFONT ) pWindowData->hFont ); } - pWindowData->hFont = hFont; - hOldFont = ( HFONT ) SelectObject( hdc, hFont ); + pWindowData->hFont = hFont; + hOldFont = ( HFONT ) SelectObject( hdc, hFont ); GetTextMetrics( hdc, &tm ); SetTextCharacterExtra( hdc, 0 ); /* do not add extra char spacing even if bold */ @@ -2602,8 +2602,8 @@ static void hb_gt_wvwResetWindowSize( WIN_DATA * pWindowData, HWND hWnd ) * row column space in the future, so we keep it around in a static! */ - pWindowData->PTEXTSIZE.x = pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : tm.tmAveCharWidth; /* For fixed FONT should == tm.tmMaxCharWidth */ - pWindowData->PTEXTSIZE.y = tm.tmHeight; /* but seems to be a problem on Win9X so */ + pWindowData->PTEXTSIZE.x = pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : tm.tmAveCharWidth; /* For fixed FONT should == tm.tmMaxCharWidth */ + pWindowData->PTEXTSIZE.y = tm.tmHeight; /* but seems to be a problem on Win9X so */ /* assume proportional fonts always for Win9X */ if( pWindowData->fontWidth < 0 || s_pWvwData->s_sApp->Win9X || ( tm.tmPitchAndFamily & TMPF_FIXED_PITCH ) || ( pWindowData->PTEXTSIZE.x != tm.tmMaxCharWidth ) ) @@ -2626,34 +2626,34 @@ static void hb_gt_wvwResetWindowSize( WIN_DATA * pWindowData, HWND hWnd ) if( SystemParametersInfo( SPI_GETWORKAREA, 0, &rcWorkArea, 0 ) ) { - wi.top = rcWorkArea.top; - wi.left = rcWorkArea.left; - wi.bottom = rcWorkArea.bottom; - wi.right = rcWorkArea.right; + wi.top = rcWorkArea.top; + wi.left = rcWorkArea.left; + wi.bottom = rcWorkArea.bottom; + wi.right = rcWorkArea.right; } else { GetWindowRect( hWnd, &wi ); } - height = ( ( USHORT ) ( LONG ) ( wi.bottom ) ) - ( ( USHORT ) ( LONG ) ( wi.top ) ) + 1; - width = ( ( USHORT ) ( LONG ) ( wi.right ) ) - ( ( USHORT ) ( LONG ) ( wi.left ) ) + 1; + height = ( ( USHORT ) ( LONG ) ( wi.bottom ) ) - ( ( USHORT ) ( LONG ) ( wi.top ) ) + 1; + width = ( ( USHORT ) ( LONG ) ( wi.right ) ) - ( ( USHORT ) ( LONG ) ( wi.left ) ) + 1; } else if( pWindowData->byWinId == 0 ) { /* resize the window to get the specified number of rows and columns */ - height = hb_gt_wvwCalcPixelHeight( pWindowData ); - width = hb_gt_wvwCalcPixelWidth( pWindowData ); + height = hb_gt_wvwCalcPixelHeight( pWindowData ); + width = hb_gt_wvwCalcPixelWidth( pWindowData ); GetWindowRect( hWnd, &wi ); GetClientRect( hWnd, &ci ); - diffWidth = ( SHORT ) ( ( wi.right - wi.left ) - ( ci.right ) ); - diffHeight = ( SHORT ) ( ( wi.bottom - wi.top ) - ( ci.bottom ) ); - width += diffWidth; - height += diffHeight; + diffWidth = ( SHORT ) ( ( wi.right - wi.left ) - ( ci.right ) ); + diffHeight = ( SHORT ) ( ( wi.bottom - wi.top ) - ( ci.bottom ) ); + width += diffWidth; + height += diffHeight; /* Centre the window within the CLIENT area on the screen * but only if pWindowData->CentreWindow == TRUE @@ -2671,8 +2671,8 @@ static void hb_gt_wvwResetWindowSize( WIN_DATA * pWindowData, HWND hWnd ) { if( pWindowData->CentreWindow ) { - wi.left = rcWorkArea.left + ( ( ( rcWorkArea.right - rcWorkArea.left ) - ( width ) ) / 2 ); - wi.top = rcWorkArea.top + ( ( ( rcWorkArea.bottom - rcWorkArea.top ) - ( height ) ) / 2 ); + wi.left = rcWorkArea.left + ( ( ( rcWorkArea.right - rcWorkArea.left ) - ( width ) ) / 2 ); + wi.top = rcWorkArea.top + ( ( ( rcWorkArea.bottom - rcWorkArea.top ) - ( height ) ) / 2 ); } else { @@ -2693,16 +2693,16 @@ static void hb_gt_wvwResetWindowSize( WIN_DATA * pWindowData, HWND hWnd ) /* resize the window to get the specified number of rows and columns */ - height = hb_gt_wvwCalcPixelHeight( pWindowData ); - width = hb_gt_wvwCalcPixelWidth( pWindowData ); + height = hb_gt_wvwCalcPixelHeight( pWindowData ); + width = hb_gt_wvwCalcPixelWidth( pWindowData ); GetWindowRect( hWnd, &wi ); GetClientRect( hWnd, &ci ); - diffWidth = ( SHORT ) ( ( wi.right - wi.left ) - ( ci.right ) ); - diffHeight = ( SHORT ) ( ( wi.bottom - wi.top ) - ( ci.bottom ) ); - width += diffWidth; - height += diffHeight; + diffWidth = ( SHORT ) ( ( wi.right - wi.left ) - ( ci.right ) ); + diffHeight = ( SHORT ) ( ( wi.bottom - wi.top ) - ( ci.bottom ) ); + width += diffWidth; + height += diffHeight; /* Centre the window within the area of the MAIN WINDOW * but only if pWindowData->CentreWindow == TRUE @@ -2712,8 +2712,8 @@ static void hb_gt_wvwResetWindowSize( WIN_DATA * pWindowData, HWND hWnd ) if( pWindowData->CentreWindow ) { - wi.left = rcWorkArea.left + ( ( ( rcWorkArea.right - rcWorkArea.left ) - ( width ) ) / 2 ); - wi.top = rcWorkArea.top + ( ( ( rcWorkArea.bottom - rcWorkArea.top ) - ( height ) ) / 2 ); + wi.left = rcWorkArea.left + ( ( ( rcWorkArea.right - rcWorkArea.left ) - ( width ) ) / 2 ); + wi.top = rcWorkArea.top + ( ( ( rcWorkArea.bottom - rcWorkArea.top ) - ( height ) ) / 2 ); } else { @@ -2735,15 +2735,15 @@ static void hb_gt_wvwResetWindowSize( WIN_DATA * pWindowData, HWND hWnd ) else { - wi.top = rcWorkArea.top + ( pWindowData->usRowOfs * hb_wvw_LineHeight( pMainWindow ) ); + wi.top = rcWorkArea.top + ( pWindowData->usRowOfs * hb_wvw_LineHeight( pMainWindow ) ); - wi.top -= diffHeight; + wi.top -= diffHeight; - wi.top += ( ( rcWorkArea.bottom - rcWorkArea.top ) - ( rcMainClientArea.bottom ) ); + wi.top += ( ( rcWorkArea.bottom - rcWorkArea.top ) - ( rcMainClientArea.bottom ) ); - wi.top += ( *pMainWindow ).usTBHeight; + wi.top += ( *pMainWindow ).usTBHeight; - wi.top -= ( *pWindowData ).usTBHeight; + wi.top -= ( *pWindowData ).usTBHeight; } } @@ -2797,8 +2797,8 @@ static void hb_gt_wvwResetWindowSize( WIN_DATA * pWindowData, HWND hWnd ) static int hb_wvw_key_ansi_to_oem( int c ) { - char pszAnsi[ 4 ]; - char pszOem[ 4 ]; + char pszAnsi[ 4 ]; + char pszOem[ 4 ]; sprintf( pszAnsi, "%c", c ); CharToOemBuff( ( LPCSTR ) pszAnsi, ( LPTSTR ) pszOem, 1 ); @@ -2819,9 +2819,9 @@ static void xUserPaintNow( UINT usWinNum ) if( bRunning ) return; - bRunning = TRUE; + bRunning = TRUE; - s_pWvwData->s_pWindows[ usWinNum ]->bPaintPending = FALSE; + s_pWvwData->s_pWindows[ usWinNum ]->bPaintPending = FALSE; if( s_pWvwData->s_sApp->pSymWVW_PAINT ) { @@ -2893,11 +2893,11 @@ static void xUserTimerNow( UINT usWinNum, HWND hWnd, UINT message, WPARAM wParam static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { - BOOL bRet; - long int res; + BOOL bRet; + long int res; - UINT usWinNum; - WIN_DATA * pWindowData; + UINT usWinNum; + WIN_DATA * pWindowData; for( usWinNum = 0; usWinNum < s_pWvwData->s_usNumWindows; usWinNum++ ) { @@ -2926,9 +2926,9 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam case WM_COMMAND: /* handle menu items */ { - BOOL bTopMost = ( s_pWvwData->s_usNumWindows == usWinNum + 1 ); - int iEvent = ( int ) HIWORD( wParam ); - int iId = ( int ) LOWORD( wParam ); + BOOL bTopMost = ( s_pWvwData->s_usNumWindows == usWinNum + 1 ); + int iEvent = ( int ) HIWORD( wParam ); + int iId = ( int ) LOWORD( wParam ); if( iId < WVW_ID_BASE_PUSHBUTTON ) { @@ -2948,9 +2948,9 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam if( bTopMost || s_pWvwData->s_bAllowNonTop ) { - HWND hWndCtrl = ( HWND ) lParam; - UINT uiPBid; - byte bStyle; + HWND hWndCtrl = ( HWND ) lParam; + UINT uiPBid; + byte bStyle; uiPBid = ( UINT ) FindControlId( usWinNum, WVW_CONTROL_PUSHBUTTON, hWndCtrl, &bStyle ); if( uiPBid == 0 ) @@ -2998,9 +2998,9 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam if( ( iEvent == CBN_KILLFOCUS ) || bTopMost || s_pWvwData->s_bAllowNonTop ) { - HWND hWndCtrl = ( HWND ) lParam; - UINT uiCBid; - byte bStyle; + HWND hWndCtrl = ( HWND ) lParam; + UINT uiCBid; + byte bStyle; uiCBid = ( UINT ) FindControlId( usWinNum, WVW_CONTROL_COMBOBOX, hWndCtrl, &bStyle ); if( uiCBid == 0 ) @@ -3055,9 +3055,9 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam if( ( iEvent == EN_KILLFOCUS ) || bTopMost || s_pWvwData->s_bAllowNonTop ) { - HWND hWndCtrl = ( HWND ) lParam; - UINT uiEBid; - byte bStyle; + HWND hWndCtrl = ( HWND ) lParam; + UINT uiEBid; + byte bStyle; uiEBid = ( UINT ) FindControlId( usWinNum, WVW_CONTROL_EDITBOX, hWndCtrl, &bStyle ); if( uiEBid == 0 ) @@ -3113,17 +3113,17 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam case WM_PAINT: { - PAINTSTRUCT ps = { 0 }; + PAINTSTRUCT ps = { 0 }; HDC hdc; USHORT irow; - RECT updateRect = { 0 }, rcRect = { 0 }; + RECT updateRect = { 0 }, rcRect = { 0 }; - RECT ci = { 0 }; - int ixbeyond; - int iybeyond; - BOOL bR = FALSE, bB = FALSE; - int colStart = 0, colStop = 0, rowStart = 0, rowStop = 0; - HFONT hOldFont; + RECT ci = { 0 }; + int ixbeyond; + int iybeyond; + BOOL bR = FALSE, bB = FALSE; + int colStart = 0, colStop = 0, rowStart = 0, rowStop = 0; + HFONT hOldFont; GetUpdateRect( hWnd, &updateRect, FALSE ); /* WARNING!!! @@ -3133,7 +3133,7 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam /* 20050625 TODO: MSDN says app should NOT call BeginPaint if GetUpdateRect returns zero */ - hdc = BeginPaint( hWnd, &ps ); + hdc = BeginPaint( hWnd, &ps ); hOldFont = ( HFONT ) SelectObject( hdc, pWindowData->hFont ); @@ -3177,22 +3177,22 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam rowStart = max( 0, rcRect.top ); - rowStop = min( pWindowData->ROWS - 1, rcRect.bottom ); + rowStop = min( pWindowData->ROWS - 1, rcRect.bottom ); colStart = rcRect.left; colStop = rcRect.right; for( irow = ( USHORT ) rowStart; irow <= ( USHORT ) rowStop; irow++ ) { - USHORT icol, index, startIndex, startCol, len; - BYTE oldColor, color; + USHORT icol, index, startIndex, startCol, len; + BYTE oldColor, color; - icol = ( USHORT ) colStart; - index = hb_gt_wvwGetIndexForTextBuffer( pWindowData, icol, irow ); - startIndex = index; - startCol = icol; - len = 0; - oldColor = *( pWindowData->pColors + index ); + icol = ( USHORT ) colStart; + index = hb_gt_wvwGetIndexForTextBuffer( pWindowData, icol, irow ); + startIndex = index; + startCol = icol; + len = 0; + oldColor = *( pWindowData->pColors + index ); /* colorute may change mid line... * so buffer up text with same color, and output it @@ -3216,10 +3216,10 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam hb_gt_wvwFillLineSpace( pWindowData, hdc, startCol, irow, len, oldColor ); } - oldColor = color; - startIndex = index; - startCol = icol; - len = 0; + oldColor = color; + startIndex = index; + startCol = icol; + len = 0; } icol++; @@ -3252,10 +3252,10 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam if( ci.right > ixbeyond ) { - rcRect.left = ixbeyond; - rcRect.top = updateRect.top; - rcRect.right = ci.right; - rcRect.bottom = updateRect.bottom; + rcRect.left = ixbeyond; + rcRect.top = updateRect.top; + rcRect.right = ci.right; + rcRect.bottom = updateRect.bottom; InvalidateRect( hWnd, &rcRect, FALSE ); @@ -3267,21 +3267,21 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam else if( updateRect.right > ixbeyond ) { - LOGBRUSH lb = { 0 }; + LOGBRUSH lb = { 0 }; HBRUSH hBrush; - COLORREF bkColor = _COLORS[ pWindowData->byColors[ 0 ] >> 4 ]; + COLORREF bkColor = _COLORS[ pWindowData->byColors[ 0 ] >> 4 ]; - rcRect.left = max( ixbeyond, updateRect.left ); - rcRect.top = updateRect.top; - rcRect.right = updateRect.right; - rcRect.bottom = updateRect.bottom; + rcRect.left = max( ixbeyond, updateRect.left ); + rcRect.top = updateRect.top; + rcRect.right = updateRect.right; + rcRect.bottom = updateRect.bottom; - lb.lbStyle = BS_SOLID; - lb.lbColor = bkColor; - lb.lbHatch = 0; + lb.lbStyle = BS_SOLID; + lb.lbColor = bkColor; + lb.lbHatch = 0; - hBrush = CreateBrushIndirect( &lb ); + hBrush = CreateBrushIndirect( &lb ); FillRect( hdc, &rcRect, hBrush ); @@ -3299,13 +3299,13 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam if( ci.bottom > iybeyond ) { - rcRect.left = updateRect.left; - rcRect.top = iybeyond; - rcRect.right = updateRect.right; - rcRect.bottom = ci.bottom; + rcRect.left = updateRect.left; + rcRect.top = iybeyond; + rcRect.right = updateRect.right; + rcRect.bottom = ci.bottom; InvalidateRect( hWnd, &rcRect, FALSE ); - bB = TRUE; + bB = TRUE; } } @@ -3315,21 +3315,21 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam else if( updateRect.bottom > iybeyond ) { - LOGBRUSH lb = { 0 }; + LOGBRUSH lb = { 0 }; HBRUSH hBrush; - COLORREF bkColor = _COLORS[ pWindowData->byColors[ 0 ] >> 4 ]; + COLORREF bkColor = _COLORS[ pWindowData->byColors[ 0 ] >> 4 ]; - rcRect.left = updateRect.left; - rcRect.top = max( iybeyond, updateRect.top ); - rcRect.right = updateRect.right; - rcRect.bottom = updateRect.bottom; + rcRect.left = updateRect.left; + rcRect.top = max( iybeyond, updateRect.top ); + rcRect.right = updateRect.right; + rcRect.bottom = updateRect.bottom; - lb.lbStyle = BS_SOLID; - lb.lbColor = bkColor; - lb.lbHatch = 0; + lb.lbStyle = BS_SOLID; + lb.lbColor = bkColor; + lb.lbHatch = 0; - hBrush = CreateBrushIndirect( &lb ); + hBrush = CreateBrushIndirect( &lb ); FillRect( hdc, &rcRect, hBrush ); @@ -3340,10 +3340,10 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam if( bR && bB ) { - rcRect.left = ixbeyond; - rcRect.top = iybeyond; - rcRect.right = ci.right; - rcRect.bottom = ci.bottom; + rcRect.left = ixbeyond; + rcRect.top = iybeyond; + rcRect.right = ci.right; + rcRect.bottom = ci.bottom; InvalidateRect( hWnd, &rcRect, FALSE ); @@ -3560,9 +3560,9 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam break; default: { - BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; - BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000; - int iScanCode = HIWORD( lParam ) & 0xFF; + BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; + BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000; + int iScanCode = HIWORD( lParam ) & 0xFF; if( bCtrl && iScanCode == 76 ) /* CTRL_VK_NUMPAD5 ) */ { @@ -3633,10 +3633,10 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam case WM_CHAR: { - BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; - int iScanCode = HIWORD( lParam ) & 0xFF; - int c = ( int ) wParam; - HWND hMouseCapturer; + BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; + int iScanCode = HIWORD( lParam ) & 0xFF; + int c = ( int ) wParam; + HWND hMouseCapturer; hMouseCapturer = GetCapture(); if( hMouseCapturer ) @@ -3713,121 +3713,121 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam switch( iScanCode ) { case 2: - c = K_ALT_1; + c = K_ALT_1; break; case 3: - c = K_ALT_2; + c = K_ALT_2; break; case 4: - c = K_ALT_3; + c = K_ALT_3; break; case 5: - c = K_ALT_4; + c = K_ALT_4; break; case 6: - c = K_ALT_5; + c = K_ALT_5; break; case 7: - c = K_ALT_6; + c = K_ALT_6; break; case 8: - c = K_ALT_7; + c = K_ALT_7; break; case 9: - c = K_ALT_8; + c = K_ALT_8; break; case 10: - c = K_ALT_9; + c = K_ALT_9; break; case 11: - c = K_ALT_0; + c = K_ALT_0; break; case 13: - c = K_ALT_EQUALS; + c = K_ALT_EQUALS; break; case 14: - c = K_ALT_BS; + c = K_ALT_BS; break; case 16: - c = K_ALT_Q; + c = K_ALT_Q; break; case 17: - c = K_ALT_W; + c = K_ALT_W; break; case 18: - c = K_ALT_E; + c = K_ALT_E; break; case 19: - c = K_ALT_R; + c = K_ALT_R; break; case 20: - c = K_ALT_T; + c = K_ALT_T; break; case 21: - c = K_ALT_Y; + c = K_ALT_Y; break; case 22: - c = K_ALT_U; + c = K_ALT_U; break; case 23: - c = K_ALT_I; + c = K_ALT_I; break; case 24: - c = K_ALT_O; + c = K_ALT_O; break; case 25: - c = K_ALT_P; + c = K_ALT_P; break; case 30: - c = K_ALT_A; + c = K_ALT_A; break; case 31: - c = K_ALT_S; + c = K_ALT_S; break; case 32: - c = K_ALT_D; + c = K_ALT_D; break; case 33: - c = K_ALT_F; + c = K_ALT_F; break; case 34: - c = K_ALT_G; + c = K_ALT_G; break; case 35: - c = K_ALT_H; + c = K_ALT_H; break; case 36: - c = K_ALT_J; + c = K_ALT_J; break; case 37: - c = K_ALT_K; + c = K_ALT_K; break; case 38: - c = K_ALT_L; + c = K_ALT_L; break; case 44: - c = K_ALT_Z; + c = K_ALT_Z; break; case 45: - c = K_ALT_X; + c = K_ALT_X; break; case 46: - c = K_ALT_C; + c = K_ALT_C; break; case 47: - c = K_ALT_V; + c = K_ALT_V; break; case 48: - c = K_ALT_B; + c = K_ALT_B; break; case 49: - c = K_ALT_N; + c = K_ALT_N; break; case 50: - c = K_ALT_M; + c = K_ALT_M; break; default: - c = ( int ) wParam; + c = ( int ) wParam; break; } hb_gt_wvwAddCharToInputQueue( c ); @@ -3929,10 +3929,10 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam case WM_HSCROLL: case WM_VSCROLL: { - HWND hWndCtrl = ( HWND ) lParam; - UINT uiXBid; - byte bStyle; - BOOL bTopMost = ( s_pWvwData->s_usNumWindows == usWinNum + 1 ); + HWND hWndCtrl = ( HWND ) lParam; + UINT uiXBid; + byte bStyle; + BOOL bTopMost = ( s_pWvwData->s_usNumWindows == usWinNum + 1 ); /* reject if not accepting input (topmost window not on focus) */ @@ -4046,20 +4046,20 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam if( pWindowData->bSBPaint ) { - LPDRAWITEMSTRUCT lpDIS; - PTSTR ptStr; - RECT rectCorner; + LPDRAWITEMSTRUCT lpDIS; + PTSTR ptStr; + RECT rectCorner; //long lSBColorForeground, lSBColorBackground; - size_t stLen; - const _TCHAR * pEnd; + size_t stLen; + const _TCHAR * pEnd; - pWindowData->bSBPaint = FALSE; + pWindowData->bSBPaint = FALSE; - lpDIS = ( LPDRAWITEMSTRUCT ) lParam; + lpDIS = ( LPDRAWITEMSTRUCT ) lParam; - ptStr = ( PTSTR ) lpDIS->itemData; - rectCorner = lpDIS->rcItem; + ptStr = ( PTSTR ) lpDIS->itemData; + rectCorner = lpDIS->rcItem; if( pWindowData->cSBColorForeground ) @@ -4124,16 +4124,16 @@ static HWND hb_gt_wvwCreateWindow( HINSTANCE hInstance, HINSTANCE hPrevInstance, InitCommonControls(); - wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC; - wndclass.lpfnWndProc = hb_gt_wvwWndProc; - wndclass.cbClsExtra = 0; - wndclass.cbWndExtra = 0; - wndclass.hInstance = hInstance; - wndclass.hIcon = NULL; - wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ); - wndclass.hbrBackground = NULL; - wndclass.lpszMenuName = NULL; - wndclass.lpszClassName = s_pWvwData->szAppName; + wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC; + wndclass.lpfnWndProc = hb_gt_wvwWndProc; + wndclass.cbClsExtra = 0; + wndclass.cbWndExtra = 0; + wndclass.hInstance = hInstance; + wndclass.hIcon = NULL; + wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ); + wndclass.hbrBackground = NULL; + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = s_pWvwData->szAppName; if( ! RegisterClass( &wndclass ) ) { @@ -4192,9 +4192,9 @@ static HWND hb_gt_wvwCreateWindow( HINSTANCE hInstance, HINSTANCE hPrevInstance, static void hb_gt_wvwCreateToolTipWindow( WIN_DATA * pWindowData ) { - INITCOMMONCONTROLSEX icex = { 0 }; - HWND hWndTT; - TOOLINFO ti = { 0 }; + INITCOMMONCONTROLSEX icex = { 0 }; + HWND hWndTT; + TOOLINFO ti = { 0 }; /* Load the tooltip class from the DLL. */ @@ -4208,7 +4208,7 @@ static void hb_gt_wvwCreateToolTipWindow( WIN_DATA * pWindowData ) /* Create the tooltip control. * - **TODO: shouldn't we set hWndOwner to pWindowData->hWnd instead of NULL? + * TODO: shouldn't we set hWndOwner to pWindowData->hWnd instead of NULL? */ hWndTT = CreateWindow( TOOLTIPS_CLASS, TEXT( "" ), WS_POPUP | TTS_ALWAYSTIP, @@ -4229,13 +4229,13 @@ static void hb_gt_wvwCreateToolTipWindow( WIN_DATA * pWindowData ) /* Prepare TOOLINFO structure for use as tracking tooltip. */ - ti.cbSize = sizeof( TOOLINFO ); - ti.uFlags = TTF_SUBCLASS; - ti.hwnd = pWindowData->hWnd; - ti.uId = WVW_ID_BASE_TOOLTIP + pWindowData->byWinId; - ti.hinst = s_pWvwData->hInstance; - ti.lpszText = ""; - ti.rect.left = ti.rect.top = ti.rect.bottom = ti.rect.right = 0; + ti.cbSize = sizeof( TOOLINFO ); + ti.uFlags = TTF_SUBCLASS; + ti.hwnd = pWindowData->hWnd; + ti.uId = WVW_ID_BASE_TOOLTIP + pWindowData->byWinId; + ti.hinst = s_pWvwData->hInstance; + ti.lpszText = ""; + ti.rect.left = ti.rect.top = ti.rect.bottom = ti.rect.right = 0; /* Add the tool to the control, displaying an error if needed. */ @@ -4251,9 +4251,9 @@ static void hb_gt_wvwCreateToolTipWindow( WIN_DATA * pWindowData ) DWORD hb_gt_wvwProcessMessages( WIN_DATA * pWindowData ) { - MSG msg; - int iIndex; - BOOL bProcessed; + MSG msg; + int iIndex; + BOOL bProcessed; HB_SYMBOL_UNUSED( pWindowData ); @@ -4318,11 +4318,11 @@ POINT hb_gt_wvwGetXYFromColRow( WIN_DATA * pWindowData, USHORT col, USHORT row ) { POINT xy = { 0 }; - xy.x = ( col ) * pWindowData->PTEXTSIZE.x; + xy.x = ( col ) * pWindowData->PTEXTSIZE.x; - xy.y = ( row ) * hb_wvw_LineHeight( pWindowData ) + ( pWindowData->byLineSpacing / 2 ); + xy.y = ( row ) * hb_wvw_LineHeight( pWindowData ) + ( pWindowData->byLineSpacing / 2 ); - xy.y += pWindowData->usTBHeight; + xy.y += pWindowData->usTBHeight; return xy; } @@ -4366,7 +4366,7 @@ static POINT hb_gt_wvwGetColRowFromXY( WIN_DATA * pWindowData, USHORT x, USHORT colrow.x = ( x / pWindowData->PTEXTSIZE.x ); - y -= pWindowData->usTBHeight; + y -= pWindowData->usTBHeight; colrow.y = ( y / ( pWindowData->PTEXTSIZE.y + pWindowData->byLineSpacing ) ); @@ -4394,21 +4394,21 @@ static POINT hb_gt_wvwTBGetColRowFromXY( WIN_DATA * pWindowData, USHORT x, USHOR RECT hb_gt_wvwGetColRowFromXYRect( WIN_DATA * pWindowData, RECT xy ) { - RECT colrow = { 0 }; - int usLineSpaces; + RECT colrow = { 0 }; + int usLineSpaces; - xy.top -= pWindowData->usTBHeight; - xy.bottom -= pWindowData->usTBHeight; + xy.top -= pWindowData->usTBHeight; + xy.bottom -= pWindowData->usTBHeight; /* TODO: pls improve efficiency */ - usLineSpaces = pWindowData->byLineSpacing; + usLineSpaces = pWindowData->byLineSpacing; - colrow.left = ( xy.left / pWindowData->PTEXTSIZE.x ); - colrow.top = ( xy.top / ( pWindowData->PTEXTSIZE.y + usLineSpaces ) ); + colrow.left = ( xy.left / pWindowData->PTEXTSIZE.x ); + colrow.top = ( xy.top / ( pWindowData->PTEXTSIZE.y + usLineSpaces ) ); /* Adjust for when rectangle EXACTLY overlaps characters */ - colrow.right = ( xy.right / pWindowData->PTEXTSIZE.x - ( xy.right % pWindowData->PTEXTSIZE.x ? 0 : 1 ) ); - colrow.bottom = ( xy.bottom / ( pWindowData->PTEXTSIZE.y + usLineSpaces ) - ( xy.bottom % ( pWindowData->PTEXTSIZE.y + usLineSpaces ) ? 0 : 1 ) ); + colrow.right = ( xy.right / pWindowData->PTEXTSIZE.x - ( xy.right % pWindowData->PTEXTSIZE.x ? 0 : 1 ) ); + colrow.bottom = ( xy.bottom / ( pWindowData->PTEXTSIZE.y + usLineSpaces ) - ( xy.bottom % ( pWindowData->PTEXTSIZE.y + usLineSpaces ) ? 0 : 1 ) ); return colrow; } @@ -4424,17 +4424,17 @@ RECT hb_gt_wvwGetXYFromColRowRect( WIN_DATA * pWindowData, RECT colrow ) { RECT xy = { 0 }; - xy.left = ( colrow.left ) * pWindowData->PTEXTSIZE.x; + xy.left = ( colrow.left ) * pWindowData->PTEXTSIZE.x; - xy.top = ( colrow.top ) * hb_wvw_LineHeight( pWindowData ) + ( pWindowData->byLineSpacing / 2 ); + xy.top = ( colrow.top ) * hb_wvw_LineHeight( pWindowData ) + ( pWindowData->byLineSpacing / 2 ); - xy.right = ( colrow.right + 1 ) * pWindowData->PTEXTSIZE.x; + xy.right = ( colrow.right + 1 ) * pWindowData->PTEXTSIZE.x; - xy.bottom = ( colrow.bottom + 1 ) * hb_wvw_LineHeight( pWindowData ) - - ( pWindowData->byLineSpacing / 2 ); + xy.bottom = ( colrow.bottom + 1 ) * hb_wvw_LineHeight( pWindowData ) + - ( pWindowData->byLineSpacing / 2 ); - xy.top += pWindowData->usTBHeight; - xy.bottom += pWindowData->usTBHeight; + xy.top += pWindowData->usTBHeight; + xy.bottom += pWindowData->usTBHeight; return xy; } @@ -4671,8 +4671,8 @@ static BOOL hb_gt_wvwTextOut( WIN_DATA * pWindowData, HDC hdc, USHORT col, USHOR static BOOL hb_gt_wvwSetColors( WIN_DATA * pWindowData, HDC hdc, BYTE attr ) { - int fore = attr & 0x000F; - int back = ( attr & 0x00F0 ) >> 4; + int fore = attr & 0x000F; + int back = ( attr & 0x00F0 ) >> 4; pWindowData->foreground = _COLORS[ fore ]; pWindowData->background = _COLORS[ back ]; @@ -4698,12 +4698,12 @@ static void hb_gt_wvwSetInvalidRect( WIN_DATA * pWindowData, USHORT left, USHORT rect.right = right; rect.bottom = bottom; - rect = hb_gt_wvwGetXYFromColRowRect( pWindowData, rect ); + rect = hb_gt_wvwGetXYFromColRowRect( pWindowData, rect ); /* check for wrapping */ /* */ - rect.left = min( rect.left, rect.right ); - rect.top = min( rect.top, rect.bottom ); + rect.left = min( rect.left, rect.right ); + rect.top = min( rect.top, rect.bottom ); rect.right = max( rect.left, rect.right ); rect.bottom = max( rect.top, rect.bottom ); @@ -4717,10 +4717,10 @@ static void hb_gt_wvwSetInvalidRect( WIN_DATA * pWindowData, USHORT left, USHORT } else { - pWindowData->RectInvalid.left = min( pWindowData->RectInvalid.left, rect.left ); - pWindowData->RectInvalid.top = min( pWindowData->RectInvalid.top, rect.top ); - pWindowData->RectInvalid.right = max( pWindowData->RectInvalid.right, rect.right ); - pWindowData->RectInvalid.bottom = max( pWindowData->RectInvalid.bottom, rect.bottom ); + pWindowData->RectInvalid.left = min( pWindowData->RectInvalid.left, rect.left ); + pWindowData->RectInvalid.top = min( pWindowData->RectInvalid.top, rect.top ); + pWindowData->RectInvalid.right = max( pWindowData->RectInvalid.right, rect.right ); + pWindowData->RectInvalid.bottom = max( pWindowData->RectInvalid.bottom, rect.bottom ); } hb_gt_wvwDoInvalidateRect( pWindowData ); } @@ -4800,19 +4800,19 @@ HFONT hb_gt_wvwGetFont( const char * pszFace, int iHeight, int iWidth, int iWeig { LOGFONT logfont = { 0 }; - logfont.lfEscapement = 0; - logfont.lfOrientation = 0; - logfont.lfWeight = iWeight; - logfont.lfItalic = 0; - logfont.lfUnderline = 0; - logfont.lfStrikeOut = 0; - logfont.lfCharSet = ( BYTE ) iCodePage; /* OEM_CHARSET; */ - logfont.lfOutPrecision = 0; - logfont.lfClipPrecision = 0; - logfont.lfQuality = ( BYTE ) iQuality; /* DEFAULT_QUALITY, DRAFT_QUALITY or PROOF_QUALITY */ - logfont.lfPitchAndFamily = FIXED_PITCH + FF_MODERN; /* all mapping depends on fixed width fonts! */ - logfont.lfHeight = iHeight; - logfont.lfWidth = iWidth < 0 ? -iWidth : iWidth; + logfont.lfEscapement = 0; + logfont.lfOrientation = 0; + logfont.lfWeight = iWeight; + logfont.lfItalic = 0; + logfont.lfUnderline = 0; + logfont.lfStrikeOut = 0; + logfont.lfCharSet = ( BYTE ) iCodePage; /* OEM_CHARSET; */ + logfont.lfOutPrecision = 0; + logfont.lfClipPrecision = 0; + logfont.lfQuality = ( BYTE ) iQuality; /* DEFAULT_QUALITY, DRAFT_QUALITY or PROOF_QUALITY */ + logfont.lfPitchAndFamily = FIXED_PITCH + FF_MODERN; /* all mapping depends on fixed width fonts! */ + logfont.lfHeight = iHeight; + logfont.lfWidth = iWidth < 0 ? -iWidth : iWidth; strcpy( logfont.lfFaceName, pszFace ); @@ -4831,162 +4831,162 @@ HFONT hb_gt_wvwGetFont( const char * pszFace, int iHeight, int iWidth, int iWeig static void hb_gtInitStatics( UINT usWinNum, LPCTSTR lpszWinName, USHORT usRow1, USHORT usCol1, USHORT usRow2, USHORT usCol2 ) { - OSVERSIONINFO osvi; - HINSTANCE h; - WIN_DATA * pWindowData; - WIN_DATA * pPrevWindow; - int iIndex; + OSVERSIONINFO osvi; + HINSTANCE h; + WIN_DATA * pWindowData; + WIN_DATA * pPrevWindow; + int iIndex; pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; if( usWinNum == 0 ) { - pWindowData->byWinId = ( int ) usWinNum; + pWindowData->byWinId = ( int ) usWinNum; strcpy( pWindowData->szWinName, lpszWinName ); - pWindowData->usRowOfs = usRow1; - pWindowData->usColOfs = usCol1; - pWindowData->uiDispCount = 0; + pWindowData->usRowOfs = usRow1; + pWindowData->usColOfs = usCol1; + pWindowData->uiDispCount = 0; - pWindowData->ROWS = usRow2 - usRow1 + 1; - pWindowData->COLS = usCol2 - usCol1 + 1; - pWindowData->foreground = WHITE; - pWindowData->background = BLACK; - pWindowData->BUFFERSIZE = 0; - pWindowData->pColors = NULL; - pWindowData->pBuffer = NULL; - pWindowData->caretPos.x = 0; - pWindowData->caretPos.y = 0; + pWindowData->ROWS = usRow2 - usRow1 + 1; + pWindowData->COLS = usCol2 - usCol1 + 1; + pWindowData->foreground = WHITE; + pWindowData->background = BLACK; + pWindowData->BUFFERSIZE = 0; + pWindowData->pColors = NULL; + pWindowData->pBuffer = NULL; + pWindowData->caretPos.x = 0; + pWindowData->caretPos.y = 0; - s_pWvwData->s_sApp->CaretExist = FALSE; + s_pWvwData->s_sApp->CaretExist = FALSE; - pWindowData->CaretSize = 2; - pWindowData->mousePos.x = 0; - pWindowData->mousePos.y = 0; - pWindowData->MouseMove = FALSE; - pWindowData->hWnd = NULL; - pWindowData->keyPointerIn = 0; - pWindowData->keyPointerOut = 0; - pWindowData->keyLast = 0; + pWindowData->CaretSize = 2; + pWindowData->mousePos.x = 0; + pWindowData->mousePos.y = 0; + pWindowData->MouseMove = FALSE; + pWindowData->hWnd = NULL; + pWindowData->keyPointerIn = 0; + pWindowData->keyPointerOut = 0; + pWindowData->keyLast = 0; memset( &pWindowData->Keys, 0, sizeof( pWindowData->Keys ) ); - s_pWvwData->s_sApp->displayCaret = TRUE; + s_pWvwData->s_sApp->displayCaret = TRUE; - pWindowData->RectInvalid.left = -1; + pWindowData->RectInvalid.left = -1; - pWindowData->PTEXTSIZE.x = 8; - pWindowData->PTEXTSIZE.y = 12; + pWindowData->PTEXTSIZE.x = 8; + pWindowData->PTEXTSIZE.y = 12; - pWindowData->fontHeight = 20; - pWindowData->fontWidth = 10; - pWindowData->fontWeight = FW_NORMAL; - pWindowData->fontQuality = DEFAULT_QUALITY; + pWindowData->fontHeight = 20; + pWindowData->fontWidth = 10; + pWindowData->fontWeight = FW_NORMAL; + pWindowData->fontQuality = DEFAULT_QUALITY; strcpy( pWindowData->fontFace, "Courier New" ); - pWindowData->LastMenuEvent = 0; - pWindowData->MenuKeyEvent = WVW_DEFAULT_MENUKEYEVENT; - pWindowData->CentreWindow = TRUE; /* Default is to always display window in centre of screen */ + pWindowData->LastMenuEvent = 0; + pWindowData->MenuKeyEvent = WVW_DEFAULT_MENUKEYEVENT; + pWindowData->CentreWindow = TRUE; /* Default is to always display window in centre of screen */ /* two following parameters are meaningful only if CentreWindow is FALSE */ - pWindowData->HCentreWindow = FALSE; /* horizontally */ - pWindowData->VCentreWindow = FALSE; /* vertically */ + pWindowData->HCentreWindow = FALSE; /* horizontally */ + pWindowData->VCentreWindow = FALSE; /* vertically */ - pWindowData->CodePage = GetACP(); /* Set code page to default system */ + pWindowData->CodePage = GetACP(); /* Set code page to default system */ - osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); + osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); GetVersionEx( &osvi ); - s_pWvwData->s_sApp->Win9X = ( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ); - s_pWvwData->s_sApp->AltF4Close = FALSE; + s_pWvwData->s_sApp->Win9X = ( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ); + s_pWvwData->s_sApp->AltF4Close = FALSE; - pWindowData->InvalidateWindow = TRUE; - pWindowData->EnableShortCuts = FALSE; + pWindowData->InvalidateWindow = TRUE; + pWindowData->EnableShortCuts = FALSE; - pWindowData->bToolTipActive = FALSE; - pWindowData->hWndTT = NULL; - pWindowData->hPopup = NULL; + pWindowData->bToolTipActive = FALSE; + pWindowData->hWndTT = NULL; + pWindowData->hPopup = NULL; - s_pWvwData->s_lfPB.lfHeight = pWindowData->fontHeight - 2; - s_pWvwData->s_lfPB.lfWidth = 0; - s_pWvwData->s_lfPB.lfEscapement = 0; - s_pWvwData->s_lfPB.lfOrientation = 0; - s_pWvwData->s_lfPB.lfWeight = 0; - s_pWvwData->s_lfPB.lfItalic = 0; - s_pWvwData->s_lfPB.lfUnderline = 0; - s_pWvwData->s_lfPB.lfStrikeOut = 0; - s_pWvwData->s_lfPB.lfCharSet = DEFAULT_CHARSET; + s_pWvwData->s_lfPB.lfHeight = pWindowData->fontHeight - 2; + s_pWvwData->s_lfPB.lfWidth = 0; + s_pWvwData->s_lfPB.lfEscapement = 0; + s_pWvwData->s_lfPB.lfOrientation = 0; + s_pWvwData->s_lfPB.lfWeight = 0; + s_pWvwData->s_lfPB.lfItalic = 0; + s_pWvwData->s_lfPB.lfUnderline = 0; + s_pWvwData->s_lfPB.lfStrikeOut = 0; + s_pWvwData->s_lfPB.lfCharSet = DEFAULT_CHARSET; - s_pWvwData->s_lfPB.lfQuality = DEFAULT_QUALITY; - s_pWvwData->s_lfPB.lfPitchAndFamily = FF_DONTCARE; + s_pWvwData->s_lfPB.lfQuality = DEFAULT_QUALITY; + s_pWvwData->s_lfPB.lfPitchAndFamily = FF_DONTCARE; strcpy( s_pWvwData->s_lfPB.lfFaceName, "Arial" ); - s_pWvwData->s_lfSB.lfHeight = 12; - s_pWvwData->s_lfSB.lfWidth = 0; - s_pWvwData->s_lfSB.lfEscapement = 0; - s_pWvwData->s_lfSB.lfOrientation = 0; - s_pWvwData->s_lfSB.lfWeight = 400; // - s_pWvwData->s_lfSB.lfItalic = 0; - s_pWvwData->s_lfSB.lfUnderline = 0; - s_pWvwData->s_lfSB.lfStrikeOut = 0; - s_pWvwData->s_lfSB.lfCharSet = DEFAULT_CHARSET; + s_pWvwData->s_lfSB.lfHeight = 12; + s_pWvwData->s_lfSB.lfWidth = 0; + s_pWvwData->s_lfSB.lfEscapement = 0; + s_pWvwData->s_lfSB.lfOrientation = 0; + s_pWvwData->s_lfSB.lfWeight = 400; // + s_pWvwData->s_lfSB.lfItalic = 0; + s_pWvwData->s_lfSB.lfUnderline = 0; + s_pWvwData->s_lfSB.lfStrikeOut = 0; + s_pWvwData->s_lfSB.lfCharSet = DEFAULT_CHARSET; - s_pWvwData->s_lfSB.lfQuality = DEFAULT_QUALITY; - s_pWvwData->s_lfSB.lfPitchAndFamily = FF_DONTCARE; + s_pWvwData->s_lfSB.lfQuality = DEFAULT_QUALITY; + s_pWvwData->s_lfSB.lfPitchAndFamily = FF_DONTCARE; strcpy( s_pWvwData->s_lfSB.lfFaceName, "Arial" ); - s_pWvwData->s_lfCB.lfHeight = pWindowData->fontHeight - 2; - s_pWvwData->s_lfCB.lfWidth = 0; - s_pWvwData->s_lfCB.lfEscapement = 0; - s_pWvwData->s_lfCB.lfOrientation = 0; - s_pWvwData->s_lfCB.lfWeight = 0; - s_pWvwData->s_lfCB.lfItalic = 0; - s_pWvwData->s_lfCB.lfUnderline = 0; - s_pWvwData->s_lfCB.lfStrikeOut = 0; - s_pWvwData->s_lfCB.lfCharSet = DEFAULT_CHARSET; + s_pWvwData->s_lfCB.lfHeight = pWindowData->fontHeight - 2; + s_pWvwData->s_lfCB.lfWidth = 0; + s_pWvwData->s_lfCB.lfEscapement = 0; + s_pWvwData->s_lfCB.lfOrientation = 0; + s_pWvwData->s_lfCB.lfWeight = 0; + s_pWvwData->s_lfCB.lfItalic = 0; + s_pWvwData->s_lfCB.lfUnderline = 0; + s_pWvwData->s_lfCB.lfStrikeOut = 0; + s_pWvwData->s_lfCB.lfCharSet = DEFAULT_CHARSET; - s_pWvwData->s_lfCB.lfQuality = DEFAULT_QUALITY; - s_pWvwData->s_lfCB.lfPitchAndFamily = FF_DONTCARE; + s_pWvwData->s_lfCB.lfQuality = DEFAULT_QUALITY; + s_pWvwData->s_lfCB.lfPitchAndFamily = FF_DONTCARE; strcpy( s_pWvwData->s_lfCB.lfFaceName, "Arial" ); - s_pWvwData->s_lfEB.lfHeight = pWindowData->fontHeight - 2; - s_pWvwData->s_lfEB.lfWidth = 0; - s_pWvwData->s_lfEB.lfEscapement = 0; - s_pWvwData->s_lfEB.lfOrientation = 0; - s_pWvwData->s_lfEB.lfWeight = 0; - s_pWvwData->s_lfEB.lfItalic = 0; - s_pWvwData->s_lfEB.lfUnderline = 0; - s_pWvwData->s_lfEB.lfStrikeOut = 0; - s_pWvwData->s_lfEB.lfCharSet = DEFAULT_CHARSET; + s_pWvwData->s_lfEB.lfHeight = pWindowData->fontHeight - 2; + s_pWvwData->s_lfEB.lfWidth = 0; + s_pWvwData->s_lfEB.lfEscapement = 0; + s_pWvwData->s_lfEB.lfOrientation = 0; + s_pWvwData->s_lfEB.lfWeight = 0; + s_pWvwData->s_lfEB.lfItalic = 0; + s_pWvwData->s_lfEB.lfUnderline = 0; + s_pWvwData->s_lfEB.lfStrikeOut = 0; + s_pWvwData->s_lfEB.lfCharSet = DEFAULT_CHARSET; - s_pWvwData->s_lfEB.lfQuality = DEFAULT_QUALITY; - s_pWvwData->s_lfEB.lfPitchAndFamily = FF_DONTCARE; + s_pWvwData->s_lfEB.lfQuality = DEFAULT_QUALITY; + s_pWvwData->s_lfEB.lfPitchAndFamily = FF_DONTCARE; strcpy( s_pWvwData->s_lfEB.lfFaceName, "Arial" ); - s_pWvwData->s_lfCX.lfHeight = pWindowData->fontHeight - 2; - s_pWvwData->s_lfCX.lfWidth = 0; - s_pWvwData->s_lfCX.lfEscapement = 0; - s_pWvwData->s_lfCX.lfOrientation = 0; - s_pWvwData->s_lfCX.lfWeight = 0; - s_pWvwData->s_lfCX.lfItalic = 0; - s_pWvwData->s_lfCX.lfUnderline = 0; - s_pWvwData->s_lfCX.lfStrikeOut = 0; - s_pWvwData->s_lfCX.lfCharSet = DEFAULT_CHARSET; + s_pWvwData->s_lfCX.lfHeight = pWindowData->fontHeight - 2; + s_pWvwData->s_lfCX.lfWidth = 0; + s_pWvwData->s_lfCX.lfEscapement = 0; + s_pWvwData->s_lfCX.lfOrientation = 0; + s_pWvwData->s_lfCX.lfWeight = 0; + s_pWvwData->s_lfCX.lfItalic = 0; + s_pWvwData->s_lfCX.lfUnderline = 0; + s_pWvwData->s_lfCX.lfStrikeOut = 0; + s_pWvwData->s_lfCX.lfCharSet = DEFAULT_CHARSET; - s_pWvwData->s_lfCX.lfQuality = DEFAULT_QUALITY; - s_pWvwData->s_lfCX.lfPitchAndFamily = FF_DONTCARE; + s_pWvwData->s_lfCX.lfQuality = DEFAULT_QUALITY; + s_pWvwData->s_lfCX.lfPitchAndFamily = FF_DONTCARE; strcpy( s_pWvwData->s_lfCX.lfFaceName, "Arial" ); - s_pWvwData->s_lfST.lfHeight = pWindowData->fontHeight; - s_pWvwData->s_lfST.lfWidth = 0; - s_pWvwData->s_lfST.lfEscapement = 0; - s_pWvwData->s_lfST.lfOrientation = 0; - s_pWvwData->s_lfST.lfWeight = 0; - s_pWvwData->s_lfST.lfItalic = 0; - s_pWvwData->s_lfST.lfUnderline = 0; - s_pWvwData->s_lfST.lfStrikeOut = 0; - s_pWvwData->s_lfST.lfCharSet = DEFAULT_CHARSET; + s_pWvwData->s_lfST.lfHeight = pWindowData->fontHeight; + s_pWvwData->s_lfST.lfWidth = 0; + s_pWvwData->s_lfST.lfEscapement = 0; + s_pWvwData->s_lfST.lfOrientation = 0; + s_pWvwData->s_lfST.lfWeight = 0; + s_pWvwData->s_lfST.lfItalic = 0; + s_pWvwData->s_lfST.lfUnderline = 0; + s_pWvwData->s_lfST.lfStrikeOut = 0; + s_pWvwData->s_lfST.lfCharSet = DEFAULT_CHARSET; - s_pWvwData->s_lfST.lfQuality = DEFAULT_QUALITY; - s_pWvwData->s_lfST.lfPitchAndFamily = FF_DONTCARE; + s_pWvwData->s_lfST.lfQuality = DEFAULT_QUALITY; + s_pWvwData->s_lfST.lfPitchAndFamily = FF_DONTCARE; strcpy( s_pWvwData->s_lfST.lfFaceName, pWindowData->fontFace ); s_pWvwData->s_sApp->pSymWVW_PAINT = hb_dynsymFind( "WVW_PAINT" ); @@ -4996,14 +4996,14 @@ static void hb_gtInitStatics( UINT usWinNum, LPCTSTR lpszWinName, USHORT usRow1, s_pWvwData->s_sApp->pSymWVW_MENUSELECT = hb_dynsymFind( "WVW_MENUSELECT" ); s_pWvwData->s_sApp->pSymWVW_TBMOUSE = hb_dynsymFind( "WVW_TBMOUSE" ); - s_pWvwData->s_sApp->pSymWVW_SIZE = hb_dynsymFind( "WVW_SIZE" ); - s_pWvwData->s_sApp->pSymWVW_MOVE = hb_dynsymFind( "WVW_MOVE" ); + s_pWvwData->s_sApp->pSymWVW_SIZE = hb_dynsymFind( "WVW_SIZE" ); + s_pWvwData->s_sApp->pSymWVW_MOVE = hb_dynsymFind( "WVW_MOVE" ); s_pWvwData->s_sApp->pSymWVW_INPUTFOCUS = hb_dynsymFind( "WVW_INPUTFOCUS" ); s_pWvwData->s_sApp->pSymWVW_TIMER = hb_dynsymFind( "WVW_TIMER" ); s_pWvwData->s_sApp->pSymWVW_ONCTLCOLOR = hb_dynsymFind( "WVW_ONCTLCOLOR" ); - h = LoadLibrary( "msimg32.dll" ); + h = LoadLibrary( "msimg32.dll" ); if( h ) { s_pWvwData->s_sApp->pfnGF = ( wvwGradientFill ) GetProcAddress( h, "GradientFill" ); @@ -5015,25 +5015,25 @@ static void hb_gtInitStatics( UINT usWinNum, LPCTSTR lpszWinName, USHORT usRow1, for( iIndex = 0; iIndex < WVW_DLGML_MAX; iIndex++ ) { - s_pWvwData->s_sApp->hDlgModeless[ iIndex ] = NULL; + s_pWvwData->s_sApp->hDlgModeless[ iIndex ] = NULL; - s_pWvwData->s_sApp->pFunc[ iIndex ] = NULL; - s_pWvwData->s_sApp->iType[ iIndex ] = ( int ) NULL; + s_pWvwData->s_sApp->pFunc[ iIndex ] = NULL; + s_pWvwData->s_sApp->iType[ iIndex ] = ( int ) NULL; } for( iIndex = 0; iIndex < WVW_DLGMD_MAX; iIndex++ ) { - s_pWvwData->s_sApp->hDlgModal[ iIndex ] = NULL; - s_pWvwData->s_sApp->pFuncModal[ iIndex ] = NULL; - s_pWvwData->s_sApp->iTypeModal[ iIndex ] = ( int ) NULL; + s_pWvwData->s_sApp->hDlgModal[ iIndex ] = NULL; + s_pWvwData->s_sApp->pFuncModal[ iIndex ] = NULL; + s_pWvwData->s_sApp->iTypeModal[ iIndex ] = ( int ) NULL; } - s_pWvwData->s_sApp->pbhBitmapList = NULL; - s_pWvwData->s_sApp->pphPictureList = NULL; + s_pWvwData->s_sApp->pbhBitmapList = NULL; + s_pWvwData->s_sApp->pphPictureList = NULL; - s_pWvwData->s_sApp->pbhUserBitmap = NULL; - s_pWvwData->s_sApp->uiBMcache = 0; - s_pWvwData->s_sApp->uiMaxBMcache = WVW_DEFAULT_MAX_BMCACHE; + s_pWvwData->s_sApp->pbhUserBitmap = NULL; + s_pWvwData->s_sApp->uiBMcache = 0; + s_pWvwData->s_sApp->uiMaxBMcache = WVW_DEFAULT_MAX_BMCACHE; } else @@ -5048,31 +5048,31 @@ static void hb_gtInitStatics( UINT usWinNum, LPCTSTR lpszWinName, USHORT usRow1, pPrevWindow = s_pWvwData->s_pWindows[ usWinNum - 1 ]; } - pWindowData->byWinId = usWinNum; + pWindowData->byWinId = usWinNum; strcpy( pWindowData->szWinName, lpszWinName ); - pWindowData->usRowOfs = usRow1; - pWindowData->usColOfs = usCol1; - pWindowData->uiDispCount = 0; + pWindowData->usRowOfs = usRow1; + pWindowData->usColOfs = usCol1; + pWindowData->uiDispCount = 0; - pWindowData->ROWS = usRow2 - usRow1 + 1; - pWindowData->COLS = usCol2 - usCol1 + 1; + pWindowData->ROWS = usRow2 - usRow1 + 1; + pWindowData->COLS = usCol2 - usCol1 + 1; - pWindowData->foreground = pPrevWindow->foreground; - pWindowData->background = pPrevWindow->background; - pWindowData->BUFFERSIZE = 0; - pWindowData->pColors = NULL; - pWindowData->pBuffer = NULL; - pWindowData->caretPos.x = 0; - pWindowData->caretPos.y = 0; + pWindowData->foreground = pPrevWindow->foreground; + pWindowData->background = pPrevWindow->background; + pWindowData->BUFFERSIZE = 0; + pWindowData->pColors = NULL; + pWindowData->pBuffer = NULL; + pWindowData->caretPos.x = 0; + pWindowData->caretPos.y = 0; - pWindowData->CaretSize = pPrevWindow->CaretSize; - pWindowData->mousePos.x = 0; - pWindowData->mousePos.y = 0; - pWindowData->MouseMove = pPrevWindow->MouseMove; - pWindowData->hWnd = NULL; - pWindowData->keyPointerIn = 0; - pWindowData->keyPointerOut = 0; - pWindowData->keyLast = 0; + pWindowData->CaretSize = pPrevWindow->CaretSize; + pWindowData->mousePos.x = 0; + pWindowData->mousePos.y = 0; + pWindowData->MouseMove = pPrevWindow->MouseMove; + pWindowData->hWnd = NULL; + pWindowData->keyPointerIn = 0; + pWindowData->keyPointerOut = 0; + pWindowData->keyLast = 0; memset( &pWindowData->Keys, 0, sizeof( pWindowData->Keys ) ); pWindowData->RectInvalid.left = -1; @@ -5083,62 +5083,62 @@ static void hb_gtInitStatics( UINT usWinNum, LPCTSTR lpszWinName, USHORT usRow1, pWindowData->fontWeight = pPrevWindow->fontWeight; pWindowData->fontQuality = pPrevWindow->fontQuality; strcpy( pWindowData->fontFace, pPrevWindow->fontFace ); - pWindowData->LastMenuEvent = 0; - pWindowData->MenuKeyEvent = WVW_DEFAULT_MENUKEYEVENT; + pWindowData->LastMenuEvent = 0; + pWindowData->MenuKeyEvent = WVW_DEFAULT_MENUKEYEVENT; - pWindowData->CentreWindow = s_pWvwData->s_bDefCentreWindow; + pWindowData->CentreWindow = s_pWvwData->s_bDefCentreWindow; /* two following parameters are meaningful only if CentreWindow is FALSE */ - pWindowData->HCentreWindow = s_pWvwData->s_bDefHCentreWindow; /* horizontally */ - pWindowData->VCentreWindow = s_pWvwData->s_bDefVCentreWindow; /* vertically */ + pWindowData->HCentreWindow = s_pWvwData->s_bDefHCentreWindow; /* horizontally */ + pWindowData->VCentreWindow = s_pWvwData->s_bDefVCentreWindow; /* vertically */ - pWindowData->CodePage = pPrevWindow->CodePage; + pWindowData->CodePage = pPrevWindow->CodePage; pWindowData->InvalidateWindow = TRUE; pWindowData->EnableShortCuts = pPrevWindow->EnableShortCuts; - pWindowData->bToolTipActive = FALSE; - pWindowData->hWndTT = NULL; - pWindowData->hPopup = NULL; + pWindowData->bToolTipActive = FALSE; + pWindowData->hWndTT = NULL; + pWindowData->hPopup = NULL; } - pWindowData->bIgnoreWM_SYSCHAR = FALSE; - pWindowData->bPaint = FALSE; - pWindowData->bGetFocus = FALSE; + pWindowData->bIgnoreWM_SYSCHAR = FALSE; + pWindowData->bPaint = FALSE; + pWindowData->bGetFocus = FALSE; - pWindowData->byLineSpacing = s_pWvwData->s_byDefLineSpacing; + pWindowData->byLineSpacing = s_pWvwData->s_byDefLineSpacing; - pWindowData->iLSpaceColor = s_pWvwData->s_iDefLSpaceColor; + pWindowData->iLSpaceColor = s_pWvwData->s_iDefLSpaceColor; - pWindowData->bPaintPending = FALSE; + pWindowData->bPaintPending = FALSE; hb_wvw_InitPendingRect( pWindowData ); - pWindowData->hStatusBar = NULL; - pWindowData->usSBHeight = 0; + pWindowData->hStatusBar = NULL; + pWindowData->usSBHeight = 0; - pWindowData->bSBPaint = FALSE; - pWindowData->cSBColorForeground = 0; - pWindowData->cSBColorBackground = 0; + pWindowData->bSBPaint = FALSE; + pWindowData->cSBColorForeground = 0; + pWindowData->cSBColorBackground = 0; - pWindowData->hToolBar = NULL; - pWindowData->usTBHeight = 0; + pWindowData->hToolBar = NULL; + pWindowData->usTBHeight = 0; - pWindowData->pcdCtrlList = NULL; + pWindowData->pcdCtrlList = NULL; - pWindowData->hPBfont = NULL; /* will be created on first creation of pushbutton, if ever */ + pWindowData->hPBfont = NULL; /* will be created on first creation of pushbutton, if ever */ - pWindowData->hCBfont = NULL; /* will be created on first creation of combobox, if ever */ + pWindowData->hCBfont = NULL; /* will be created on first creation of combobox, if ever */ - pWindowData->hEBfont = NULL; /* will be created on first creation of editbox, if ever */ + pWindowData->hEBfont = NULL; /* will be created on first creation of editbox, if ever */ - pWindowData->hCXfont = NULL; /* will be created on first creation of checkbox, if ever */ + pWindowData->hCXfont = NULL; /* will be created on first creation of checkbox, if ever */ - pWindowData->hSBfont = NULL; /* will be created on first creation of statusbar, if ever */ + pWindowData->hSBfont = NULL; /* will be created on first creation of statusbar, if ever */ - pWindowData->hSTfont = NULL; /* will be created on first creation of static control, if ever */ + pWindowData->hSTfont = NULL; /* will be created on first creation of static control, if ever */ - s_pWvwData->s_usCurWindow = usWinNum; + s_pWvwData->s_usCurWindow = usWinNum; } @@ -5150,8 +5150,8 @@ static void hb_gtInitStatics( UINT usWinNum, LPCTSTR lpszWinName, USHORT usRow1, static void hb_gt_wvwAddCharToInputQueue( int iKey ) { - UINT uiWinNum = s_pWvwData->s_usNumWindows - 1; - int iNextPos = s_pWvwData->s_pWindows[ uiWinNum ]->keyPointerIn; + UINT uiWinNum = s_pWvwData->s_usNumWindows - 1; + int iNextPos = s_pWvwData->s_pWindows[ uiWinNum ]->keyPointerIn; if( iKey == K_MOUSEMOVE || iKey == K_NCMOUSEMOVE ) { @@ -5203,8 +5203,8 @@ static void hb_gt_wvwSetMouseY( WIN_DATA * pWindowData, USHORT iy ) */ static void hb_gt_wvwSetStringInTextBuffer( WIN_DATA * pWindowData, int col, int row, BYTE color, BYTE attr, BYTE * sBuffer, ULONG length ) { - POINT end = { 0 }; - USHORT index; + POINT end = { 0 }; + USHORT index; HB_SYMBOL_UNUSED( attr ); @@ -5273,10 +5273,10 @@ static void hb_gt_wvwMouseEvent( WIN_DATA * pWindowData, HWND hWnd, UINT message } } - xy.x = LOWORD( lParam ); - xy.y = HIWORD( lParam ); + xy.x = LOWORD( lParam ); + xy.y = HIWORD( lParam ); - colrow = hb_gt_wvwGetColRowFromXY( pWindowData, ( SHORT ) xy.x, ( SHORT ) xy.y ); + colrow = hb_gt_wvwGetColRowFromXY( pWindowData, ( SHORT ) xy.x, ( SHORT ) xy.y ); hb_gt_wvwSetMouseX( pWindowData, ( SHORT ) colrow.x ); hb_gt_wvwSetMouseY( pWindowData, ( SHORT ) colrow.y ); @@ -5424,10 +5424,10 @@ static void hb_gt_wvwTBMouseEvent( WIN_DATA * pWindowData, HWND hWnd, UINT messa } } - xy.x = LOWORD( lParam ); - xy.y = HIWORD( lParam ); + xy.x = LOWORD( lParam ); + xy.y = HIWORD( lParam ); - colrow = hb_gt_wvwTBGetColRowFromXY( pWindowData, ( SHORT ) xy.x, ( SHORT ) xy.y ); + colrow = hb_gt_wvwTBGetColRowFromXY( pWindowData, ( SHORT ) xy.x, ( SHORT ) xy.y ); hb_gt_wvwSetMouseX( pWindowData, ( SHORT ) colrow.x ); hb_gt_wvwSetMouseY( pWindowData, ( SHORT ) colrow.y ); @@ -5571,7 +5571,7 @@ static void hb_gt_wvwWindowPrologue( void ) } s_pWvwData->s_usNumWindows++; - uiWindow = s_pWvwData->s_usNumWindows; + uiWindow = s_pWvwData->s_usNumWindows; s_pWvwData->s_pWindows[ uiWindow - 1 ] = ( WIN_DATA * ) hb_xgrab( sizeof( WIN_DATA ) ); memset( s_pWvwData->s_pWindows[ uiWindow - 1 ], 0, sizeof( WIN_DATA ) ); @@ -5601,11 +5601,11 @@ static UINT hb_gt_wvwOpenWindow( LPCTSTR lpszWinName, int iRow1, int iCol1, int *(relative to MAIN window, NOT to parent window) */ { - HWND hWnd; + HWND hWnd; - WNDCLASS wndclass; - WIN_DATA * pParentWindow; - int iCmdShow; + WNDCLASS wndclass; + WIN_DATA * pParentWindow; + int iCmdShow; HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvwOpenWindow()" ) ); @@ -5632,16 +5632,16 @@ static UINT hb_gt_wvwOpenWindow( LPCTSTR lpszWinName, int iRow1, int iCol1, int if( ! s_pWvwData->s_bSWRegistered && ( s_pWvwData->s_usNumWindows == 1 ) ) { - wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC; - wndclass.lpfnWndProc = hb_gt_wvwWndProc; - wndclass.cbClsExtra = 0; - wndclass.cbWndExtra = 0; - wndclass.hInstance = s_pWvwData->hInstance; - wndclass.hIcon = NULL; - wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ); - wndclass.hbrBackground = NULL; - wndclass.lpszMenuName = NULL; - wndclass.lpszClassName = s_pWvwData->szSubWinName; + wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC; + wndclass.lpfnWndProc = hb_gt_wvwWndProc; + wndclass.cbClsExtra = 0; + wndclass.cbWndExtra = 0; + wndclass.hInstance = s_pWvwData->hInstance; + wndclass.hIcon = NULL; + wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ); + wndclass.hbrBackground = NULL; + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = s_pWvwData->szSubWinName; if( ! RegisterClass( &wndclass ) ) { @@ -5915,7 +5915,7 @@ static VOID CALLBACK hb_gt_wvwFlashWindow( HWND hwnd, UINT uMsg, UINT_PTR idEven { KillTimer( hwnd, idEvent ); - byCount = 0; + byCount = 0; s_pWvwData->s_bFlashingWindow = FALSE; } } @@ -5971,7 +5971,7 @@ static void hb_gt_wvwInputNotAllowed( UINT usWinNum, UINT message, WPARAM wParam } -/* ******************************************************************** +/******************************************************************** MainCoord Mode ******************************************************************** In this mode an xHarbour program uses (row,col) coordinate relative to @@ -6113,8 +6113,8 @@ void hb_gt_wvwFUNCPrologue( BYTE byNumCoord, int * iRow1, int * iCol1, int * iRo void hb_gt_wvwFUNCEpilogue( void ) { - s_pWvwData->s_pWindows[ 0 ]->caretPos.y = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->caretPos.y + hb_gt_wvwRowOfs( s_pWvwData->s_usCurWindow ); - s_pWvwData->s_pWindows[ 0 ]->caretPos.x = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->caretPos.x + hb_gt_wvwColOfs( s_pWvwData->s_usCurWindow ); + s_pWvwData->s_pWindows[ 0 ]->caretPos.y = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->caretPos.y + hb_gt_wvwRowOfs( s_pWvwData->s_usCurWindow ); + s_pWvwData->s_pWindows[ 0 ]->caretPos.x = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->caretPos.x + hb_gt_wvwColOfs( s_pWvwData->s_usCurWindow ); hb_gt_wvwSetCurWindow( 0 ); @@ -6149,23 +6149,23 @@ void hb_wvw_HBFUNCPrologue( UINT usWinNum, */ static UINT hb_gt_wvwSetCurWindow( UINT usWinNum ) { - UINT usOldWin = s_pWvwData->s_usCurWindow; - BOOL bMainCoordMode; + UINT usOldWin = s_pWvwData->s_usCurWindow; + BOOL bMainCoordMode; if( usWinNum == usOldWin ) { return usOldWin; } - s_pWvwData->s_usCurWindow = usWinNum; + s_pWvwData->s_usCurWindow = usWinNum; - bMainCoordMode = s_pWvwData->s_bMainCoordMode; - s_pWvwData->s_bMainCoordMode = FALSE; + bMainCoordMode = s_pWvwData->s_bMainCoordMode; + s_pWvwData->s_bMainCoordMode = FALSE; /*updating GTAPI's statics: *tell GTAPI about the new maxrow(), maxcol() */ - s_pWvwData->s_bQuickSetMode = TRUE; + s_pWvwData->s_bQuickSetMode = TRUE; hb_gtSetMode( s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->ROWS, s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]->COLS ); @@ -6282,8 +6282,8 @@ static void hb_gt_wvw_vReplicate( WIN_DATA * pWindowData, int iRow, int iCol, i if( ulLen > WVW_CHAR_BUFFER ) { - byChars = ( BYTE * ) hb_xgrab( ulLen ); - bMalloc = TRUE; + byChars = ( BYTE * ) hb_xgrab( ulLen ); + bMalloc = TRUE; } else { @@ -6306,8 +6306,8 @@ static void hb_gt_wvw_vReplicate( WIN_DATA * pWindowData, int iRow, int iCol, i static BOOL hb_gt_wvw_GetChar( PHB_GT pGT, int iRow, int iCol, int * pbColor, BYTE * pbAttr, USHORT * pusChar ) { - WIN_DATA * pWindowData; - long lIndex; + WIN_DATA * pWindowData; + long lIndex; HB_SYMBOL_UNUSED( pbAttr ); @@ -6328,8 +6328,8 @@ static BOOL hb_gt_wvw_GetChar( PHB_GT pGT, int iRow, int iCol, static BOOL hb_gt_wvw_PutChar( PHB_GT pGT, int iRow, int iCol, int bColor, BYTE bAttr, USHORT usChar ) { - WIN_DATA * pWindowData; - long lIndex; + WIN_DATA * pWindowData; + long lIndex; HB_SYMBOL_UNUSED( bAttr ); @@ -6339,8 +6339,8 @@ static BOOL hb_gt_wvw_PutChar( PHB_GT pGT, int iRow, int iCol, if( lIndex < pWindowData->BUFFERSIZE ) { - pWindowData->pBuffer[ lIndex ] = ( BYTE ) usChar; - pWindowData->pColors[ lIndex ] = bColor; + pWindowData->pBuffer[ lIndex ] = ( BYTE ) usChar; + pWindowData->pColors[ lIndex ] = bColor; return TRUE; } @@ -6367,19 +6367,19 @@ static void hb_gt_wvw_GetSize( PHB_GT pGT, int * piRows, int * piCols ) pWindowData = ( WIN_DATA * ) s_pWvwData->s_pWindows[ s_pWvwData->s_usNumWindows - 1 ]; - *piRows = pWindowData->ROWS; - *piCols = pWindowData->COLS; + *piRows = pWindowData->ROWS; + *piCols = pWindowData->COLS; } static void hb_gt_wvw_Save( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, void * pBuffer ) { - BYTE * pbyBuffer = ( BYTE * ) pBuffer; + BYTE * pbyBuffer = ( BYTE * ) pBuffer; - int i_Top = ( iTop < 0 ? 0 : iTop ); - int i_Left = ( iLeft < 0 ? 0 : iLeft ); - int i_Bottom = ( iBottom < 0 ? 0 : iBottom ); - int i_Right = ( iRight < 0 ? 0 : iRight ); + int i_Top = ( iTop < 0 ? 0 : iTop ); + int i_Left = ( iLeft < 0 ? 0 : iLeft ); + int i_Bottom = ( iBottom < 0 ? 0 : iBottom ); + int i_Right = ( iRight < 0 ? 0 : iRight ); if( s_pWvwData->s_bMainCoordMode ) { @@ -6388,19 +6388,19 @@ static void hb_gt_wvw_Save( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iR while( i_Top <= i_Bottom ) { - int iColor; - USHORT usChar; - int iCol; + int iColor; + USHORT usChar; + int iCol; for( iCol = i_Left; iCol <= i_Right; ++iCol ) { if( ! HB_GTSELF_GETCHAR( pGT, i_Top, iCol, &iColor, NULL, &usChar ) ) { - usChar = ( USHORT ) HB_GTSELF_GETCLEARCHAR( pGT ); - iColor = HB_GTSELF_GETCLEARCOLOR( pGT ); + usChar = ( USHORT ) HB_GTSELF_GETCLEARCHAR( pGT ); + iColor = HB_GTSELF_GETCLEARCOLOR( pGT ); } - *pbyBuffer++ = ( BYTE ) usChar; - *pbyBuffer++ = ( BYTE ) iColor; /* TOFIX */ + *pbyBuffer++ = ( BYTE ) usChar; + *pbyBuffer++ = ( BYTE ) iColor; /* TOFIX */ } ++i_Top; } @@ -6414,14 +6414,14 @@ static void hb_gt_wvw_Save( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iR static void hb_gt_wvw_Rest( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, const void * pBuffer ) { - BYTE * pbyBuffer = ( BYTE * ) pBuffer; + BYTE * pbyBuffer = ( BYTE * ) pBuffer; - WIN_DATA * pWindowData; - int iSaveTop; - int i_Top = ( iTop < 0 ? 0 : iTop ); - int i_Left = ( iLeft < 0 ? 0 : iLeft ); - int i_Bottom = ( iBottom < 0 ? 0 : iBottom ); - int i_Right = ( iRight < 0 ? 0 : iRight ); + WIN_DATA * pWindowData; + int iSaveTop; + int i_Top = ( iTop < 0 ? 0 : iTop ); + int i_Left = ( iLeft < 0 ? 0 : iLeft ); + int i_Bottom = ( iBottom < 0 ? 0 : iBottom ); + int i_Right = ( iRight < 0 ? 0 : iRight ); pWindowData = ( WIN_DATA * ) s_pWvwData->s_pWindows[ s_pWvwData->s_usNumWindows - 1 ]; @@ -6434,14 +6434,14 @@ static void hb_gt_wvw_Rest( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iR while( iSaveTop <= i_Bottom ) { - int bColor; - USHORT usChar; - int iCol; + int bColor; + USHORT usChar; + int iCol; for( iCol = i_Left; iCol <= i_Right; ++iCol ) { - usChar = *pbyBuffer++; - bColor = *pbyBuffer++; + usChar = *pbyBuffer++; + bColor = *pbyBuffer++; HB_GTSELF_PUTCHAR( pGT, iSaveTop, iCol, bColor, 0, usChar ); @@ -6541,8 +6541,8 @@ static BOOL hb_gt_wvw_bSetMode( WIN_DATA * pWindowData, USHORT row, USHORT col * font settings will fit in the window * * JC1: See my note - **x gtwvt comments out the following condition! (see also SetFont) - **x TODO: I THINK I am right to keep it, am I? + * x gtwvt comments out the following condition! (see also SetFont) + * x TODO: I THINK I am right to keep it, am I? */ if( hb_gt_wvwValidWindowSize( pWindowData, row, col, hFont, pWindowData->fontWidth, NULL, NULL ) ) { @@ -6581,15 +6581,15 @@ static void hb_gt_wvw_vxPutch( WIN_DATA * pWindowData, USHORT iRow, USHORT iCol static void hb_gt_wvw_usBox( WIN_DATA * pWindowData, int iTop, int iLeft, int iBottom, int iRight, const char * pbyFrame, int bColor ) { - int i; - int iRow; - int iCol; - int iHeight; - int iWidth; - USHORT sWidth = pWindowData->COLS; - USHORT sHeight = pWindowData->ROWS; - BYTE szBox[ 10 ]; - BYTE bPadCh = ( BYTE ) HB_GTSELF_GETCLEARCHAR( hb_gt_Base() ); + int i; + int iRow; + int iCol; + int iHeight; + int iWidth; + USHORT sWidth = pWindowData->COLS; + USHORT sHeight = pWindowData->ROWS; + BYTE szBox[ 10 ]; + BYTE bPadCh = ( BYTE ) HB_GTSELF_GETCLEARCHAR( hb_gt_Base() ); if( ( iLeft >= 0 && iLeft < sWidth ) || ( iRight >= 0 && iRight < sWidth ) || @@ -6611,20 +6611,20 @@ static void hb_gt_wvw_usBox( WIN_DATA * pWindowData, int iTop, int iLeft, int iB /* Ensure that box is drawn from Top Left to Bottom Right. */ if( iTop > iBottom ) { - iRow = iTop; - iTop = iBottom; - iBottom = iRow; + iRow = iTop; + iTop = iBottom; + iBottom = iRow; } if( iLeft > iRight ) { - iRow = iLeft; - iLeft = iRight; - iRight = iRow; + iRow = iLeft; + iLeft = iRight; + iRight = iRow; } /* Draw the box or line as specified */ - iHeight = iBottom - iTop + 1; - iWidth = iRight - iLeft + 1; + iHeight = iBottom - iTop + 1; + iWidth = iRight - iLeft + 1; hb_gt_wvw_vDispBegin( pWindowData ); @@ -6639,8 +6639,8 @@ static void hb_gt_wvw_usBox( WIN_DATA * pWindowData, int iTop, int iLeft, int iB iCol = ( iWidth > 1 ? iLeft + 1 : iLeft ); if( iCol < 0 ) { - iWidth += iCol; - iCol = 0; + iWidth += iCol; + iCol = 0; } if( iRight >= sWidth ) { @@ -6763,10 +6763,10 @@ static void hb_gt_wvw_vSetPos( WIN_DATA * pWindowData, int iRow, int iCol ) static void hb_wvw_InitPendingRect( WIN_DATA * pWindowData ) { - pWindowData->rPaintPending.left = WVW_MAX_COLS - 1; - pWindowData->rPaintPending.top = WVW_MAX_ROWS - 1; - pWindowData->rPaintPending.right = 0; - pWindowData->rPaintPending.bottom = 0; + pWindowData->rPaintPending.left = WVW_MAX_COLS - 1; + pWindowData->rPaintPending.top = WVW_MAX_ROWS - 1; + pWindowData->rPaintPending.right = 0; + pWindowData->rPaintPending.bottom = 0; } @@ -6775,10 +6775,10 @@ static void hb_wvw_InitPendingRect( WIN_DATA * pWindowData ) static void hb_wvw_UpdatePendingRect( WIN_DATA * pWindowData, USHORT usRow1, USHORT usCol1, USHORT usRow2, USHORT usCol2 ) { - pWindowData->rPaintPending.left = HB_MIN( pWindowData->rPaintPending.left, usCol1 ); - pWindowData->rPaintPending.top = HB_MIN( pWindowData->rPaintPending.top, usRow1 ); - pWindowData->rPaintPending.right = HB_MAX( pWindowData->rPaintPending.right, usCol2 ); - pWindowData->rPaintPending.bottom = HB_MAX( pWindowData->rPaintPending.bottom, usRow2 ); + pWindowData->rPaintPending.left = HB_MIN( pWindowData->rPaintPending.left, usCol1 ); + pWindowData->rPaintPending.top = HB_MIN( pWindowData->rPaintPending.top, usRow1 ); + pWindowData->rPaintPending.right = HB_MAX( pWindowData->rPaintPending.right, usCol2 ); + pWindowData->rPaintPending.bottom = HB_MAX( pWindowData->rPaintPending.bottom, usRow2 ); } /* returns lineheight, ie. including linespacing if any */ @@ -6792,33 +6792,31 @@ BYTE hb_wvw_LineHeight( WIN_DATA * pWindowData ) has no effect if linespacing == 0 */ static void hb_gt_wvwFillLineSpace( WIN_DATA * pWindowData, HDC hdc, USHORT startCol, USHORT irow, USHORT len, BYTE byAttrib ) { - RECT rc = { 0 }; - LOGBRUSH lb = { 0 }; + RECT rc = { 0 }; + LOGBRUSH lb = { 0 }; HBRUSH hBrush; - int byColorIndex = pWindowData->iLSpaceColor < 0 ? - ( byAttrib & 0x00F0 ) >> 4 : - pWindowData->iLSpaceColor; - COLORREF bkColor = _COLORS[ byColorIndex ]; + int byColorIndex = pWindowData->iLSpaceColor < 0 ? ( byAttrib& 0x00F0 ) >> 4 : pWindowData->iLSpaceColor; + COLORREF bkColor = _COLORS[ byColorIndex ]; - rc.top = irow; - rc.left = startCol; - rc.bottom = irow; - rc.right = startCol + len - 1; - rc = hb_gt_wvwGetXYFromColRowRect( pWindowData, rc ); + rc.top = irow; + rc.left = startCol; + rc.bottom = irow; + rc.right = startCol + len - 1; + rc = hb_gt_wvwGetXYFromColRowRect( pWindowData, rc ); - lb.lbStyle = BS_SOLID; - lb.lbColor = bkColor; - lb.lbHatch = 0; + lb.lbStyle = BS_SOLID; + lb.lbColor = bkColor; + lb.lbHatch = 0; - hBrush = CreateBrushIndirect( &lb ); + hBrush = CreateBrushIndirect( &lb ); - rc.bottom = rc.top; - rc.top -= ( pWindowData->byLineSpacing / 2 ); + rc.bottom = rc.top; + rc.top -= ( pWindowData->byLineSpacing / 2 ); FillRect( hdc, &rc, hBrush ); - rc.top = rc.bottom + pWindowData->PTEXTSIZE.y; - rc.bottom = rc.top + ( pWindowData->byLineSpacing / 2 ); + rc.top = rc.bottom + pWindowData->PTEXTSIZE.y; + rc.bottom = rc.top + ( pWindowData->byLineSpacing / 2 ); FillRect( hdc, &rc, hBrush ); SelectObject( s_pWvwData->s_pWindows[ 0 ]->hdc, ( HBRUSH ) s_pWvwData->s_sApp->OriginalBrush ); @@ -6854,8 +6852,8 @@ static BOOL hb_gt_wvwSetCentreWindow( UINT usWinNum, BOOL bCentre, BOOL bPaint ) { BOOL bWasCentre; - bWasCentre = s_pWvwData->s_pWindows[ usWinNum ]->CentreWindow; - s_pWvwData->s_pWindows[ usWinNum ]->CentreWindow = bCentre; + bWasCentre = s_pWvwData->s_pWindows[ usWinNum ]->CentreWindow; + s_pWvwData->s_pWindows[ usWinNum ]->CentreWindow = bCentre; if( bPaint ) { @@ -6935,9 +6933,9 @@ static BOOL hb_gt_wvw_GetWindowTitle( UINT usWinNum, char ** title ) if( iResult > 0 ) { #ifdef UNICODE - *title = hb_wcntomb( buffer, iResult ); + *title = hb_wcntomb( buffer, iResult ); #else - *title = hb_strndup( buffer, iResult ); + *title = hb_strndup( buffer, iResult ); #endif return TRUE; } @@ -7002,10 +7000,10 @@ int hb_gt_wvwGetWindowTitle( UINT usWinNum, char * title, int length ) BOOL hb_gt_wvwSetFont( UINT usWinNum, const char * fontFace, int height, int width, int Bold, int Quality ) { - int size; - BOOL bResult = FALSE; - HFONT hFont = hb_gt_wvwGetFont( fontFace, height, width, Bold, Quality, s_pWvwData->s_pWindows[ usWinNum ]->CodePage ); - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + int size; + BOOL bResult = FALSE; + HFONT hFont = hb_gt_wvwGetFont( fontFace, height, width, Bold, Quality, s_pWvwData->s_pWindows[ usWinNum ]->CodePage ); + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; /* make sure the font could actually be created */ @@ -7014,22 +7012,22 @@ BOOL hb_gt_wvwSetFont( UINT usWinNum, const char * fontFace, int height, int wid /* make sure that the font will fit inside the * window with the current pWindowData->ROWS and pWindowData->COLS setting * - **JC1: There's definitely something WRONG with this way of thinking. + * JC1: There's definitely something WRONG with this way of thinking. * This makes effectively impossible to enlarge the window from it's * initial size. * - **x with the above remark, gtwvt comments out the following condition: - **x TODO: I THINK I am I to keep it, am I? + * x with the above remark, gtwvt comments out the following condition: + * x TODO: I THINK I am I to keep it, am I? */ if( hb_gt_wvwValidWindowSize( pWindowData, pWindowData->ROWS, pWindowData->COLS, hFont, width, NULL, NULL ) ) { - pWindowData->fontHeight = height; - pWindowData->fontWidth = width; - pWindowData->fontWeight = Bold; - pWindowData->fontQuality = Quality; + pWindowData->fontHeight = height; + pWindowData->fontWidth = width; + pWindowData->fontWeight = Bold; + pWindowData->fontQuality = Quality; - size = strlen( fontFace ); + size = strlen( fontFace ); if( ( size > 0 ) && ( size < LF_FACESIZE - 1 ) ) { strcpy( pWindowData->fontFace, fontFace ); @@ -7082,8 +7080,8 @@ BOOL hb_gt_wvwSetAltF4Close( BOOL bCanClose ) { BOOL bWas; - bWas = s_pWvwData->s_sApp->AltF4Close; - s_pWvwData->s_sApp->AltF4Close = bCanClose; + bWas = s_pWvwData->s_sApp->AltF4Close; + s_pWvwData->s_sApp->AltF4Close = bCanClose; return bWas; } @@ -7117,8 +7115,8 @@ BOOL hb_gt_wvwEnableShortCuts( UINT usWinNum, BOOL bEnable ) BOOL GetIPictDimension( IPicture * pPic, int * pWidth, int * pHeight ) { - OLE_HANDLE oHtemp; - BITMAP bmTemp; + OLE_HANDLE oHtemp; + BITMAP bmTemp; pPic->lpVtbl->get_Handle( pPic, &oHtemp ); @@ -7132,19 +7130,19 @@ BOOL GetIPictDimension( IPicture * pPic, int * pWidth, int * pHeight ) BOOL GetImageDimension( const char * image, int * pWidth, int * pHeight ) { - HBITMAP hBitmap; - BOOL bResult = TRUE; + HBITMAP hBitmap; + BOOL bResult = TRUE; - *pWidth = 0; *pHeight = 0; - hBitmap = FindUserBitmapHandle( image, pWidth, pHeight ); + *pWidth = 0; *pHeight = 0; + hBitmap = FindUserBitmapHandle( image, pWidth, pHeight ); if( ! hBitmap ) { IPicture * pPic; - *pWidth = 0; *pHeight = 0; + *pWidth = 0; *pHeight = 0; - pPic = hb_gt_wvwLoadPicture( image ); + pPic = hb_gt_wvwLoadPicture( image ); if( ! pPic ) { return FALSE; @@ -7172,7 +7170,7 @@ static void DrawTransparentBitmap( HDC hdc, HBITMAP hBitmap, short xStart, POINT ptSize; COLORREF cTransparentColor; - hdcCopy = CreateCompatibleDC( hdc ); + hdcCopy = CreateCompatibleDC( hdc ); SelectObject( hdcCopy, hBitmap ); cTransparentColor = GetPixel( hdcCopy, @@ -7180,13 +7178,13 @@ static void DrawTransparentBitmap( HDC hdc, HBITMAP hBitmap, short xStart, 0 ); GetObject( hBitmap, sizeof( BITMAP ), ( LPSTR ) &bm ); - ptSize.x = bm.bmWidth; - ptSize.y = bm.bmHeight; + ptSize.x = bm.bmWidth; + ptSize.y = bm.bmHeight; DPtoLP( hdcCopy, &ptSize, 1 ); - bmStretch = CreateCompatibleBitmap( hdc, iDestWidth, iDestHeight ); - hdcTemp = CreateCompatibleDC( hdc ); - bmStretchOld = ( HBITMAP ) SelectObject( hdcTemp, bmStretch ); + bmStretch = CreateCompatibleBitmap( hdc, iDestWidth, iDestHeight ); + hdcTemp = CreateCompatibleDC( hdc ); + bmStretchOld = ( HBITMAP ) SelectObject( hdcTemp, bmStretch ); StretchBlt( hdcTemp, 0, 0, iDestWidth, iDestHeight, @@ -7194,15 +7192,15 @@ static void DrawTransparentBitmap( HDC hdc, HBITMAP hBitmap, short xStart, ptSize.x, ptSize.y, SRCCOPY ); - hdcBack = CreateCompatibleDC( hdc ); - hdcObject = CreateCompatibleDC( hdc ); - hdcMem = CreateCompatibleDC( hdc ); + hdcBack = CreateCompatibleDC( hdc ); + hdcObject = CreateCompatibleDC( hdc ); + hdcMem = CreateCompatibleDC( hdc ); - bmAndBack = CreateBitmap( iDestWidth, iDestHeight, 1, 1, NULL ); + bmAndBack = CreateBitmap( iDestWidth, iDestHeight, 1, 1, NULL ); bmAndObject = CreateBitmap( iDestWidth, iDestHeight, 1, 1, NULL ); - bmAndMem = CreateCompatibleBitmap( hdc, iDestWidth, iDestHeight ); + bmAndMem = CreateCompatibleBitmap( hdc, iDestWidth, iDestHeight ); bmBackOld = ( HBITMAP ) SelectObject( hdcBack, bmAndBack ); bmObjectOld = ( HBITMAP ) SelectObject( hdcObject, bmAndObject ); @@ -7256,21 +7254,21 @@ static void DrawTransparentBitmap( HDC hdc, HBITMAP hBitmap, short xStart, */ BOOL hb_gt_wvwDrawImage( UINT usWinNum, int x1, int y1, int wd, int ht, const char * image, BOOL bTransparent ) { - HBITMAP hBitmap; - BOOL bResult; - int iWidth, iHeight; - HDC hdc, hdcMem; + HBITMAP hBitmap; + BOOL bResult; + int iWidth, iHeight; + HDC hdc, hdcMem; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; - iWidth = 0; iHeight = 0; + iWidth = 0; iHeight = 0; - hBitmap = FindUserBitmapHandle( image, &iWidth, &iHeight ); + hBitmap = FindUserBitmapHandle( image, &iWidth, &iHeight ); if( ! hBitmap ) { - IPicture * pPic; - OLE_HANDLE oHtemp; - BITMAP bmTemp; + IPicture * pPic; + OLE_HANDLE oHtemp; + BITMAP bmTemp; pPic = hb_gt_wvwLoadPicture( image ); if( ! pPic ) @@ -7298,8 +7296,8 @@ BOOL hb_gt_wvwDrawImage( UINT usWinNum, int x1, int y1, int wd, int ht, const ch } GetObject( hBitmap, sizeof( BITMAP ), ( LPSTR ) &bmTemp ); - iWidth = bmTemp.bmWidth; - iHeight = bmTemp.bmHeight; + iWidth = bmTemp.bmWidth; + iHeight = bmTemp.bmHeight; AddUserBitmapHandle( image, hBitmap, iWidth, iHeight ); } @@ -7326,7 +7324,7 @@ BOOL hb_gt_wvwDrawImage( UINT usWinNum, int x1, int y1, int wd, int ht, const ch iOldMode = SetStretchBltMode( hdc, COLORONCOLOR ); - bResult = StretchBlt( + bResult = StretchBlt( hdc, /* handle to destination DC */ x1, /* x-coord of destination upper-left corner */ y1, /* y-coord of destination upper-left corner */ @@ -7355,13 +7353,13 @@ BOOL hb_gt_wvwDrawImage( UINT usWinNum, int x1, int y1, int wd, int ht, const ch IPicture * hb_gt_wvwLoadPicture( const char * image ) { - IStream * iStream; + IStream * iStream; - LPVOID iPicture = NULL; - HGLOBAL hGlobal; - HANDLE hFile; - DWORD nFileSize; - DWORD nReadByte; + LPVOID iPicture = NULL; + HGLOBAL hGlobal; + HANDLE hFile; + DWORD nFileSize; + DWORD nReadByte; hFile = CreateFile( image, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if( hFile != INVALID_HANDLE_VALUE ) @@ -7394,26 +7392,26 @@ IPicture * hb_gt_wvwLoadPicture( const char * image ) BOOL hb_gt_wvwRenderPicture( UINT usWinNum, int x1, int y1, int wd, int ht, IPicture * iPicture, BOOL bTransp ) { - 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; - HRGN hrgn1; - POINT lpp = { 0 }; - BOOL bResult = FALSE; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + 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; + HRGN hrgn1; + POINT lpp = { 0 }; + BOOL bResult = FALSE; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; if( iPicture ) { /* if bTransp, we use different method */ if( bTransp ) { - OLE_HANDLE oHtemp; - HDC hdc; + OLE_HANDLE oHtemp; + HDC hdc; iPicture->lpVtbl->get_Handle( iPicture, &oHtemp ); @@ -7476,7 +7474,7 @@ BOOL hb_gt_wvwRenderPicture( UINT usWinNum, int x1, int y1, int wd, int ht, IPic y += dr; } y = r; - x += dc; + x += dc; } SelectClipRgn( pWindowData->hdc, NULL ); @@ -7511,7 +7509,7 @@ BOOL hb_gt_wvwSetColorData( int iIndex, COLORREF ulCr ) if( iIndex >= 0 && iIndex < 16 ) { _COLORS[ iIndex ] = ulCr; - bResult = TRUE; + bResult = TRUE; } return bResult; } @@ -7673,10 +7671,10 @@ static BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable ) { HB_TRACE( HB_TR_DEBUG, ( "hb_gtFnInit( %p )", pFuncTable ) ); - pFuncTable->Init = hb_gt_wvw_Init; - pFuncTable->Exit = hb_gt_wvw_Exit; - pFuncTable->MaxCol = hb_gt_wvw_MaxCol; - pFuncTable->MaxRow = hb_gt_wvw_MaxRow; + pFuncTable->Init = hb_gt_wvw_Init; + pFuncTable->Exit = hb_gt_wvw_Exit; + pFuncTable->MaxCol = hb_gt_wvw_MaxCol; + pFuncTable->MaxRow = hb_gt_wvw_MaxRow; pFuncTable->SetPos = hb_gt_wvw_SetPos; pFuncTable->IsColor = hb_gt_wvw_IsColor; @@ -7690,40 +7688,40 @@ static BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable ) pFuncTable->PutText = hb_gt_wvw_PutText; pFuncTable->SetAttribute = hb_gt_wvw_SetAttribute; // pFuncTable->Scroll = hb_gt_wvw_Scroll; - pFuncTable->SetMode = hb_gt_wvw_SetMode; - pFuncTable->GetBlink = hb_gt_wvw_GetBlink; - pFuncTable->SetBlink = hb_gt_wvw_SetBlink; - pFuncTable->Version = hb_gt_wvw_Version; - pFuncTable->Box = hb_gt_wvw_Box; - pFuncTable->HorizLine = hb_gt_wvw_HorizLine; - pFuncTable->VertLine = hb_gt_wvw_VertLine; - pFuncTable->OutStd = hb_gt_wvw_OutStd; - pFuncTable->OutErr = hb_gt_wvw_OutErr; - pFuncTable->Tone = hb_gt_wvw_Tone; - pFuncTable->ReadKey = hb_gt_wvw_ReadKey; - pFuncTable->Info = hb_gt_wvw_Info; + pFuncTable->SetMode = hb_gt_wvw_SetMode; + pFuncTable->GetBlink = hb_gt_wvw_GetBlink; + pFuncTable->SetBlink = hb_gt_wvw_SetBlink; + pFuncTable->Version = hb_gt_wvw_Version; + pFuncTable->Box = hb_gt_wvw_Box; + pFuncTable->HorizLine = hb_gt_wvw_HorizLine; + pFuncTable->VertLine = hb_gt_wvw_VertLine; + pFuncTable->OutStd = hb_gt_wvw_OutStd; + pFuncTable->OutErr = hb_gt_wvw_OutErr; + pFuncTable->Tone = hb_gt_wvw_Tone; + pFuncTable->ReadKey = hb_gt_wvw_ReadKey; + pFuncTable->Info = hb_gt_wvw_Info; - pFuncTable->GetChar = hb_gt_wvw_GetChar; - pFuncTable->PutChar = hb_gt_wvw_PutChar; - pFuncTable->CheckPos = hb_gt_wvw_CheckPos; - pFuncTable->GetSize = hb_gt_wvw_GetSize; - pFuncTable->Save = hb_gt_wvw_Save; - pFuncTable->Rest = hb_gt_wvw_Rest; - pFuncTable->ExposeArea = hb_gt_wvw_ExposeArea; + pFuncTable->GetChar = hb_gt_wvw_GetChar; + pFuncTable->PutChar = hb_gt_wvw_PutChar; + pFuncTable->CheckPos = hb_gt_wvw_CheckPos; + pFuncTable->GetSize = hb_gt_wvw_GetSize; + pFuncTable->Save = hb_gt_wvw_Save; + pFuncTable->Rest = hb_gt_wvw_Rest; + pFuncTable->ExposeArea = hb_gt_wvw_ExposeArea; /* Graphics API */ - pFuncTable->GfxPrimitive = hb_gt_wvw_gfxPrimitive; + pFuncTable->GfxPrimitive = hb_gt_wvw_gfxPrimitive; - pFuncTable->MouseInit = hb_gt_wvw_mouse_Init; - pFuncTable->MouseExit = hb_gt_wvw_mouse_Exit; - pFuncTable->MouseIsPresent = hb_gt_wvw_mouse_IsPresent; - pFuncTable->MouseCol = hb_gt_wvw_mouse_Col; - pFuncTable->MouseRow = hb_gt_wvw_mouse_Row; - pFuncTable->MouseSetPos = hb_gt_wvw_mouse_SetPos; - pFuncTable->MouseGetPos = hb_gt_wvw_mouse_GetPos; - pFuncTable->MouseCountButton = hb_gt_wvw_mouse_CountButton; - pFuncTable->MouseButtonState = hb_gt_wvw_mouse_ButtonState; + pFuncTable->MouseInit = hb_gt_wvw_mouse_Init; + pFuncTable->MouseExit = hb_gt_wvw_mouse_Exit; + pFuncTable->MouseIsPresent = hb_gt_wvw_mouse_IsPresent; + pFuncTable->MouseCol = hb_gt_wvw_mouse_Col; + pFuncTable->MouseRow = hb_gt_wvw_mouse_Row; + pFuncTable->MouseSetPos = hb_gt_wvw_mouse_SetPos; + pFuncTable->MouseGetPos = hb_gt_wvw_mouse_GetPos; + pFuncTable->MouseCountButton = hb_gt_wvw_mouse_CountButton; + pFuncTable->MouseButtonState = hb_gt_wvw_mouse_ButtonState; return TRUE; } @@ -7780,50 +7778,50 @@ WVW_DATA * hb_getWvwData( void ) -/*20040713 this function was named WVW_lOpenWindow() - *now it is wvw_nOpenWindow() - *it now returns numeric +/* 20040713 this function was named WVW_lOpenWindow() + * now it is wvw_nOpenWindow() + * it now returns numeric - *WVW_nOpenWindow(cWinName, row1, col1, row2, col2, ; + * WVW_nOpenWindow(cWinName, row1, col1, row2, col2, ; * nStyle, nParentWin) - **rowx and colx are relative to MAIN WINDOW (not current window!) - **rowx and colx are used for: - **(1) positioning window to its initial position, - **(2) determining the size of the window (new maxrow() and maxcol()) - **(3) saved into RowOfs and ColOfs for MainCoord mode + * rowx and colx are relative to MAIN WINDOW (not current window!) + * rowx and colx are used for: + * (1) positioning window to its initial position, + * (2) determining the size of the window (new maxrow() and maxcol()) + * (3) saved into RowOfs and ColOfs for MainCoord mode * - **nStyle is window style (eg. WS_OVERLAPPEDWINDOW, etc.) + * nStyle is window style (eg. WS_OVERLAPPEDWINDOW, etc.) * default is: WS_CAPTION|WS_SYSMENU |WS_CLIPCHILDREN * WARNING: you must know what you're doing if you supplied this param * NOTES: if you will use controls such as PUSHBUTTON, * you MUST include WS_CLIPCHILDREN. * - **nParentWin is parent window of the new on we're about to open. + * nParentWin is parent window of the new on we're about to open. * default is: current window (in Standard Mode) * last window (in MainCoord Mode) * If you want the new window to not have parent, * pass -1 as nParentWin. * * - **returns window number if successful - **returns 0 if failed + * returns window number if successful + * returns 0 if failed */ HB_FUNC( WVW_NOPENWINDOW ) { - LPCTSTR lpszWinName; + LPCTSTR lpszWinName; - int iLen; - WIN_DATA * pParentWindow; + int iLen; + WIN_DATA * pParentWindow; - WIN_DATA * pWindowData; - int irow1, icol1, irow2, icol2; - RECT wi = { 0 }, rcWorkArea = { 0 }; - UINT usWinNum; + WIN_DATA * pWindowData; + int irow1, icol1, irow2, icol2; + RECT wi = { 0 }, rcWorkArea = { 0 }; + UINT usWinNum; - DWORD dwStyle = ( HB_ISNIL( 6 ) ? ( ( DWORD ) ( WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN ) ) : ( ( DWORD ) hb_parnl( 6 ) ) ); - INT iParentWin = ( HB_ISNIL( 7 ) ? ( s_pWvwData->s_bMainCoordMode ? s_pWvwData->s_usNumWindows - 1 : s_pWvwData->s_usCurWindow ) : ( ( INT ) hb_parni( 7 ) ) ); - PHB_FNAME pFileName = NULL; + DWORD dwStyle = ( HB_ISNIL( 6 ) ? ( ( DWORD ) ( WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN ) ) : ( ( DWORD ) hb_parnl( 6 ) ) ); + INT iParentWin = ( HB_ISNIL( 7 ) ? ( s_pWvwData->s_bMainCoordMode ? s_pWvwData->s_usNumWindows - 1 : s_pWvwData->s_usCurWindow ) : ( ( INT ) hb_parni( 7 ) ) ); + PHB_FNAME pFileName = NULL; if( s_pWvwData->s_usNumWindows == 0 ) { @@ -7892,10 +7890,10 @@ HB_FUNC( WVW_NOPENWINDOW ) return; } - irow1 = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - icol1 = HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ); - irow2 = HB_ISNIL( 4 ) ? pParentWindow->ROWS - 1 : hb_parni( 4 ); - icol2 = HB_ISNIL( 5 ) ? pParentWindow->COLS - 1 : hb_parni( 5 ); + irow1 = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + icol1 = HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ); + irow2 = HB_ISNIL( 4 ) ? pParentWindow->ROWS - 1 : hb_parni( 4 ); + icol2 = HB_ISNIL( 5 ) ? pParentWindow->COLS - 1 : hb_parni( 5 ); usWinNum = hb_gt_wvwOpenWindow( lpszWinName, irow1, icol1, irow2, icol2, dwStyle, iParentWin ); @@ -7954,8 +7952,8 @@ HB_FUNC( WVW_NOPENWINDOW ) HB_FUNC( WVW_GET_HND_WINDOW ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; HB_RETHANDLE( pWindowData->hWnd ); } @@ -8049,8 +8047,8 @@ HB_FUNC( WVW_NNUMWINDOWS ) */ HB_FUNC( WVW_XREPOSWINDOW ) { - UINT i; - BOOL bAnchored = ( HB_ISLOG( 1 ) ? hb_parl( 1 ) : TRUE ); + UINT i; + BOOL bAnchored = ( HB_ISLOG( 1 ) ? hb_parl( 1 ) : TRUE ); /* centerize Main Window, only if not maximized */ @@ -8073,13 +8071,13 @@ HB_FUNC( WVW_XREPOSWINDOW ) } } -/*WVW_nSetCurWindow( nWinNum ) (0==MAIN) - *assigns nWinNum as the new current window (s_pWvwData->s_usCurWindow) - *returns old current window - *example: saved := WVW_nSetCurWindow(0) +/* WVW_nSetCurWindow( nWinNum ) (0==MAIN) + * assigns nWinNum as the new current window (s_pWvwData->s_usCurWindow) + * returns old current window + * example: saved := WVW_nSetCurWindow(0) * ? "This will be displayed in Main Window" * WVW_nSetCurWindow(saved) - **notes: makes sense only if !s_pWvwData->s_bMainCoordMode + * notes: makes sense only if !s_pWvwData->s_bMainCoordMode */ HB_FUNC( WVW_NSETCURWINDOW ) { @@ -8133,8 +8131,8 @@ HB_FUNC( WVW_NCOLOFS ) */ HB_FUNC( WVW_MAXMAXROW ) { - UINT usWinNum = WVW_WHICH_WINDOW; - int maxrows; + UINT usWinNum = WVW_WHICH_WINDOW; + int maxrows; /* rows and cols passed are dummy ones */ hb_gt_wvwValidWindowSize( s_pWvwData->s_pWindows[ usWinNum ], 10, 10, s_pWvwData->s_pWindows[ usWinNum ]->hFont, s_pWvwData->s_pWindows[ usWinNum ]->fontWidth, @@ -8149,8 +8147,8 @@ HB_FUNC( WVW_MAXMAXROW ) */ HB_FUNC( WVW_MAXMAXCOL ) { - UINT usWinNum = WVW_WHICH_WINDOW; - int maxcols; + UINT usWinNum = WVW_WHICH_WINDOW; + int maxcols; /* rows and cols passed are dummy ones */ hb_gt_wvwValidWindowSize( s_pWvwData->s_pWindows[ usWinNum ], 10, 10, s_pWvwData->s_pWindows[ usWinNum ]->hFont, s_pWvwData->s_pWindows[ usWinNum ]->fontWidth, @@ -8167,8 +8165,8 @@ HB_FUNC( WVW_MAXMAXCOL ) */ HB_FUNC( WVW_UNREACHEDBR ) { - UINT usWinNum = WVW_WHICH_WINDOW; - int cols, rows; + UINT usWinNum = WVW_WHICH_WINDOW; + int cols, rows; hb_gt_wvwUnreachedXY( s_pWvwData->s_pWindows[ usWinNum ], &cols, &rows ); if( HB_ISBYREF( 2 ) ) @@ -8219,14 +8217,14 @@ HB_FUNC( WVW_SETMAINCOORD ) */ HB_FUNC( WVW_ADDROWS ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; - int iRows = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - USHORT height, width; - USHORT diffheight, diffwidth; - USHORT usNumChars; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + int iRows = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + USHORT height, width; + USHORT diffheight, diffwidth; + USHORT usNumChars; - RECT wi = { 0 }, ci = { 0 }; + RECT wi = { 0 }, ci = { 0 }; if( iRows == 0 ) { @@ -8249,8 +8247,8 @@ HB_FUNC( WVW_ADDROWS ) if( iRows > 0 ) { /* initialize chars and attributes */ - USHORT usBufLastRow = hb_gt_wvwGetIndexForTextBuffer( pWindowData, 0, pWindowData->ROWS - 1 ); - USHORT usBufStart = hb_gt_wvwGetIndexForTextBuffer( pWindowData, 0, pWindowData->ROWS ); + USHORT usBufLastRow = hb_gt_wvwGetIndexForTextBuffer( pWindowData, 0, pWindowData->ROWS - 1 ); + USHORT usBufStart = hb_gt_wvwGetIndexForTextBuffer( pWindowData, 0, pWindowData->ROWS ); memset( &( pWindowData->byBuffer[ usBufStart ] ), ' ', usNumChars ); @@ -8264,29 +8262,29 @@ HB_FUNC( WVW_ADDROWS ) if( ! s_pWvwData->s_bMainCoordMode ) { UINT usCurWindow = s_pWvwData->s_usCurWindow; - s_pWvwData->s_usCurWindow = usWinNum; + s_pWvwData->s_usCurWindow = usWinNum; - s_pWvwData->s_bQuickSetMode = TRUE; + s_pWvwData->s_bQuickSetMode = TRUE; hb_gtSetMode( pWindowData->ROWS, pWindowData->COLS ); - s_pWvwData->s_bQuickSetMode = FALSE; + s_pWvwData->s_bQuickSetMode = FALSE; - s_pWvwData->s_usCurWindow = usCurWindow; + s_pWvwData->s_usCurWindow = usCurWindow; } /* resize the window to get the specified number of rows and columns */ - height = hb_gt_wvwCalcPixelHeight( pWindowData ); - width = hb_gt_wvwCalcPixelWidth( pWindowData ); + height = hb_gt_wvwCalcPixelHeight( pWindowData ); + width = hb_gt_wvwCalcPixelWidth( pWindowData ); GetWindowRect( pWindowData->hWnd, &wi ); GetClientRect( pWindowData->hWnd, &ci ); - diffheight = ( USHORT ) ( ( wi.bottom - wi.top ) - ( ci.bottom - ci.top ) ); - diffwidth = ( USHORT ) ( ( wi.right - wi.left ) - ( ci.right - ci.left ) ); + diffheight = ( USHORT ) ( ( wi.bottom - wi.top ) - ( ci.bottom - ci.top ) ); + diffwidth = ( USHORT ) ( ( wi.right - wi.left ) - ( ci.right - ci.left ) ); - height += diffheight; - width += diffwidth; + height += diffheight; + width += diffwidth; SetWindowPos( pWindowData->hWnd, NULL, wi.left, wi.top, width, height, SWP_NOZORDER ); @@ -8296,28 +8294,29 @@ HB_FUNC( WVW_ADDROWS ) } +#if 0 /**** THESE are not required, because we simply enlarged/shrinked the window downward - NOTICE however that some control may not be fully visible + NOTICE however that some control may not be fully visible */ - if (pWindowData->hToolBar != NULL) - { + if( pWindowData->hToolBar != NULL ) + { SetWindowPos( pWindowData->hToolBar, NULL, wi.left, wi.top - pWindowData->usTBHeight, width, pWindowData->usTBHeight, SWP_NOZORDER ); - } + } - if (pWindowData->pcdCtrlList != NULL) - { + if( pWindowData->pcdCtrlList != NULL ) + { - ReposControls(pWindowData->byWinId, 0); - } + ReposControls( pWindowData->byWinId, 0 ); + } - if (pWindowData->byWinId == s_pWvwData->s_usNumWindows-1) - { - hb_gt_wvwSetCaretPos(pWindowData); - } + if( pWindowData->byWinId == s_pWvwData->s_usNumWindows - 1 ) + { + hb_gt_wvwSetCaretPos( pWindowData ); + } - ******/ +#endif if( iRows > 0 ) { @@ -8333,10 +8332,10 @@ HB_FUNC( WVW_ADDROWS ) } /* - *WVW_NOCLOSE( [nWinNum] ) - *disable CLOSE 'X' button of a window + * WVW_NOCLOSE( [nWinNum] ) + * disable CLOSE 'X' button of a window * - **no return value + * no return value */ HB_FUNC( WVW_NOCLOSE ) { @@ -8351,15 +8350,15 @@ HB_FUNC( WVW_NOCLOSE ) } /* - *WVW_SETWINSTYLE( [nWinNum], [nStyle] ) - *Get/Set window style - *NOTES: if window has controls (eg. pushbutton, scrollbar) + * WVW_SETWINSTYLE( [nWinNum], [nStyle] ) + * Get/Set window style + * NOTES: if window has controls (eg. pushbutton, scrollbar) * you should include WS_CLIPCHILDREN in nStyle * - **SIDE EFFECT: + * SIDE EFFECT: * if window is hidden, applying nStyle here will cause it to show * - **return Window Style prior to applying the new style + * return Window Style prior to applying the new style */ HB_FUNC( WVW_SETWINSTYLE ) @@ -8384,12 +8383,12 @@ HB_FUNC( WVW_SETWINSTYLE ) } /* - *WVW_ENABLEMAXIMIZE( [nWinNum], [lEnable] ) - *Get/Set maximize button + * WVW_ENABLEMAXIMIZE( [nWinNum], [lEnable] ) + * Get/Set maximize button * - **returns maximize box state prior to applying the new style + * returns maximize box state prior to applying the new style * - **NOTE: in order to enable MAXIMIZE button, app should have WVW_SIZE() callback function + * NOTE: in order to enable MAXIMIZE button, app should have WVW_SIZE() callback function */ HB_FUNC( WVW_ENABLEMAXIMIZE ) @@ -8398,8 +8397,8 @@ HB_FUNC( WVW_ENABLEMAXIMIZE ) LONG_PTR lpStyle; BOOL bState; - lpStyle = GetWindowLongPtr( s_pWvwData->s_pWindows[ usWinNum ]->hWnd, GWL_STYLE ); - bState = ( BOOL ) ( lpStyle & ( LONG_PTR ) WS_MAXIMIZEBOX ); + lpStyle = GetWindowLongPtr( s_pWvwData->s_pWindows[ usWinNum ]->hWnd, GWL_STYLE ); + bState = ( BOOL ) ( lpStyle & ( LONG_PTR ) WS_MAXIMIZEBOX ); hb_retl( bState ); if( HB_ISLOG( 2 ) ) @@ -8481,8 +8480,8 @@ HB_FUNC( WVW_SETPAINTREFRESH ) /*TODO: do you want to make it window selective?*/ HB_FUNC( WVW_SETVERTCARET ) { - BOOL bOldVertCaret = s_pWvwData->s_bVertCaret; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ s_pWvwData->s_usNumWindows - 1 ]; + BOOL bOldVertCaret = s_pWvwData->s_bVertCaret; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ s_pWvwData->s_usNumWindows - 1 ]; if( ! HB_ISNIL( 1 ) ) { @@ -8584,21 +8583,21 @@ HB_FUNC( WVW_SETDEFLINESPACING ) */ HB_FUNC( WVW_SETLINESPACING ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; - int byOldLineSpacing = pWindowData->byLineSpacing; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + int byOldLineSpacing = pWindowData->byLineSpacing; if( ! HB_ISNIL( 2 ) && HB_ISNUM( 2 ) && hb_parni( 2 ) >= 0 && hb_parni( 2 ) <= 40 && /*nobody is crazy enough to use > 40 */ fmod( hb_parnd( 2 ), 2 ) == 0 ) { - USHORT height, maxHeight; - RECT rcWorkArea = { 0 }; + USHORT height, maxHeight; + RECT rcWorkArea = { 0 }; SystemParametersInfo( SPI_GETWORKAREA, 0, &rcWorkArea, 0 ); - maxHeight = ( SHORT ) ( rcWorkArea.bottom - rcWorkArea.top ); + maxHeight = ( SHORT ) ( rcWorkArea.bottom - rcWorkArea.top ); pWindowData->byLineSpacing = hb_parni( 2 ); - height = hb_gt_wvwCalcPixelHeight( pWindowData ); + height = hb_gt_wvwCalcPixelHeight( pWindowData ); /* TODO/WARNING: this height doesn't take Menu Bar into account */ if( height >= maxHeight ) @@ -8649,9 +8648,9 @@ HB_FUNC( WVW_SETDEFLSPACECOLOR ) */ HB_FUNC( WVW_SETLSPACECOLOR ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; - int iOldLSpaceColor = pWindowData->iLSpaceColor; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + int iOldLSpaceColor = pWindowData->iLSpaceColor; if( ! HB_ISNIL( 2 ) && HB_ISNUM( 2 ) && hb_parni( 2 ) >= -1 && hb_parni( 2 ) <= 15 ) { @@ -8772,8 +8771,8 @@ HB_FUNC( WVW_SETWINDOWCENTRE ) */ HB_FUNC( WVW_ENABLESHORTCUTS ) { - UINT usWinNum = WVW_WHICH_WINDOW; - BOOL bEnable = HB_ISNIL( 2 ) ? TRUE : hb_parl( 2 ); + UINT usWinNum = WVW_WHICH_WINDOW; + BOOL bEnable = HB_ISNIL( 2 ) ? TRUE : hb_parl( 2 ); hb_retl( hb_gt_wvwEnableShortCuts( usWinNum, bEnable ) ); } @@ -8800,8 +8799,8 @@ HB_FUNC( WVW_PROCESSMESSAGES ) HB_FUNC( WVW_GETTITLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - BYTE ucText[ 1024 ]; + UINT usWinNum = WVW_WHICH_WINDOW; + BYTE ucText[ 1024 ]; hb_gt_wvwGetWindowTitle( usWinNum, ( char * ) ucText, 1023 ); @@ -8855,8 +8854,8 @@ HB_FUNC( WVW_GETRGBCOLOR ) HB_FUNC( WVW_GETCLIPBOARD ) { - HGLOBAL hglb; - LPTSTR lptstr; + HGLOBAL hglb; + LPTSTR lptstr; if( ! IsClipboardFormatAvailable( CF_TEXT ) ) { @@ -8885,10 +8884,10 @@ HB_FUNC( WVW_GETCLIPBOARD ) HB_FUNC( WVW_SETCLIPBOARD ) { - LPTSTR lptstrCopy; - HGLOBAL hglbCopy; - const char * cText; - int nLen; + LPTSTR lptstrCopy; + HGLOBAL hglbCopy; + const char * cText; + int nLen; if( ! IsClipboardFormatAvailable( CF_TEXT ) ) { @@ -8913,8 +8912,8 @@ HB_FUNC( WVW_SETCLIPBOARD ) /* Get text from PRG */ - cText = hb_parcx( 1 ); - nLen = hb_parclen( 1 ); + cText = hb_parcx( 1 ); + nLen = hb_parclen( 1 ); /* Allocate a global memory object for the text. */ @@ -8928,9 +8927,9 @@ HB_FUNC( WVW_SETCLIPBOARD ) /* Lock the handle and copy the text to the buffer. */ - lptstrCopy = ( LPSTR ) GlobalLock( hglbCopy ); + lptstrCopy = ( LPSTR ) GlobalLock( hglbCopy ); memcpy( lptstrCopy, cText, ( nLen + 1 ) * sizeof( TCHAR ) ); - lptstrCopy[ nLen + 1 ] = ( TCHAR ) 0; + lptstrCopy[ nLen + 1 ] = ( TCHAR ) 0; GlobalUnlock( hglbCopy ); /* Place the handle on the clipboard. @@ -8945,9 +8944,9 @@ HB_FUNC( WVW_SETCLIPBOARD ) HB_FUNC( WVW_PASTEFROMCLIPBOARD ) { - HGLOBAL hglb; - LPTSTR lptstr; - ULONG ul; + HGLOBAL hglb; + LPTSTR lptstr; + ULONG ul; if( ! IsClipboardFormatAvailable( CF_TEXT ) ) { @@ -8994,27 +8993,27 @@ HB_FUNC( WVW_KEYBOARD ) HB_FUNC( WVW_INVALIDATERECT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; - RECT rc = { 0 }; - POINT xy = { 0 }; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + RECT rc = { 0 }; + POINT xy = { 0 }; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); if( s_pWvwData->s_bMainCoordMode ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - rc.top = xy.y; - rc.left = xy.x; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - rc.bottom = xy.y - 1; - rc.right = xy.x - 1; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + rc.top = xy.y; + rc.left = xy.x; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + rc.bottom = xy.y - 1; + rc.right = xy.x - 1; InvalidateRect( pWindowData->hWnd, &rc, TRUE ); } @@ -9030,12 +9029,12 @@ HB_FUNC( WVW_ISLBUTTONPRESSED ) HB_FUNC( WVW_CLIENTTOSCREEN ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; - PHB_ITEM paXY = hb_itemArrayNew( 2 ); - POINT xy = { 0 }; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + PHB_ITEM paXY = hb_itemArrayNew( 2 ); + POINT xy = { 0 }; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ); if( s_pWvwData->s_bMainCoordMode ) { @@ -9330,8 +9329,8 @@ LPWORD lpwAlign( LPWORD lpIn ) { ULONG ul; - ul = ( ULONG ) lpIn; - ul += 3; + ul = ( ULONG ) lpIn; + ul += 3; ul >>= 2; ul <<= 2; return ( LPWORD ) ul; @@ -9353,15 +9352,15 @@ int nCopyAnsiToWideChar( LPWORD lpWCStr, LPSTR lpAnsiIn ) IPicture * rr_LoadPictureFromResource( const char * resname, UINT iresimage, LONG * lwidth, LONG * lheight ) { - HBITMAP hbmpx; - IPicture * iPicture = NULL; - PICTDESC picd; + HBITMAP hbmpx; + IPicture * iPicture = NULL; + PICTDESC picd; // int nSize ; - char szResname[ _MAX_PATH + 1 ]; - int iWidth, iHeight; + char szResname[ _MAX_PATH + 1 ]; + int iWidth, iHeight; - iWidth = *lwidth; - iHeight = *lheight; + iWidth = *lwidth; + iHeight = *lheight; if( resname == NULL ) { @@ -9394,9 +9393,9 @@ IPicture * rr_LoadPictureFromResource( const char * resname, UINT iresimage, LON if( iPicture == NULL ) { - picd.cbSizeofstruct = sizeof( PICTDESC ); - picd.picType = PICTYPE_BITMAP; - picd.bmp.hbitmap = hbmpx; + picd.cbSizeofstruct = sizeof( PICTDESC ); + picd.picType = PICTYPE_BITMAP; + picd.bmp.hbitmap = hbmpx; OleCreatePictureIndirect( &picd, &IID_IPicture, TRUE, ( LPVOID * ) &iPicture ); AddPictureHandle( resname, iPicture, iWidth, iHeight ); } @@ -9411,19 +9410,19 @@ IPicture * rr_LoadPictureFromResource( const char * resname, UINT iresimage, LON IPicture * rr_LoadPicture( const char * filename, LONG * lwidth, LONG * lheight ) { - IStream * iStream = NULL; - IPicture * iPicture = NULL; - HGLOBAL hGlobal; - void * pGlobal; - HANDLE hFile; - DWORD nFileSize, nReadByte; + IStream * iStream = NULL; + IPicture * iPicture = NULL; + HGLOBAL hGlobal; + void * pGlobal; + HANDLE hFile; + DWORD nFileSize, nReadByte; - hFile = CreateFile( filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); + hFile = CreateFile( filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if( hFile == INVALID_HANDLE_VALUE ) return NULL; - nFileSize = GetFileSize( hFile, NULL ); - hGlobal = GlobalAlloc( GMEM_MOVEABLE, nFileSize + 4096 ); - pGlobal = GlobalLock( hGlobal ); + nFileSize = GetFileSize( hFile, NULL ); + hGlobal = GlobalAlloc( GMEM_MOVEABLE, nFileSize + 4096 ); + pGlobal = GlobalLock( hGlobal ); ReadFile( hFile, pGlobal, nFileSize, &nReadByte, NULL ); CloseHandle( hFile ); CreateStreamOnHGlobal( hGlobal, TRUE, &iStream ); @@ -9463,11 +9462,11 @@ IPicture * rr_LoadPicture( const char * filename, LONG * lwidth, LONG * lheight static BITMAPINFO * PackedDibLoad( PTSTR szFileName ) { - BITMAPFILEHEADER bmfh; - BITMAPINFO * pbmi; - BOOL bSuccess; - DWORD dwPackedDibSize, dwBytesRead; - HANDLE hFile; + BITMAPFILEHEADER bmfh; + BITMAPINFO * pbmi; + BOOL bSuccess; + DWORD dwPackedDibSize, dwBytesRead; + HANDLE hFile; hFile = CreateFile( szFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); @@ -9485,11 +9484,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 ) ) @@ -9578,9 +9577,9 @@ static BYTE * PackedDibGetBitsPtr( BITMAPINFO * pPackedDib ) Windows controls such as toolbar, pushbutton, checkbox, etc */ HBITMAP FindBitmapHandle( const char * szFileName, int * piWidth, int * piHeight ) { - BITMAP_HANDLE * pbh = s_pWvwData->s_sApp->pbhBitmapList; + BITMAP_HANDLE * pbh = s_pWvwData->s_sApp->pbhBitmapList; - BOOL bStrictDimension = ! ( *piWidth == 0 && *piHeight == 0 ); + BOOL bStrictDimension = ! ( *piWidth == 0 && *piHeight == 0 ); while( pbh ) { @@ -9588,15 +9587,15 @@ HBITMAP FindBitmapHandle( const char * szFileName, int * piWidth, int * piHeight if( strcmp( szFileName, pbh->szFilename ) == 0 && ( ! bStrictDimension || ( *piWidth == pbh->iWidth && - *piHeight == pbh->iHeight + *piHeight == pbh->iHeight ) ) ) { if( ! bStrictDimension ) { - *piWidth = pbh->iWidth; - *piHeight = pbh->iHeight; + *piWidth = pbh->iWidth; + *piHeight = pbh->iHeight; } return pbh->hBitmap; } @@ -9613,12 +9612,12 @@ void AddBitmapHandle( const char * szFileName, HBITMAP hBitmap, int iWidth, int memset( pbhNew, 0, sizeof( BITMAP_HANDLE ) ); strcpy( pbhNew->szFilename, szFileName ); - pbhNew->hBitmap = hBitmap; - pbhNew->iWidth = iWidth; - pbhNew->iHeight = iHeight; - pbhNew->pNext = s_pWvwData->s_sApp->pbhBitmapList; + pbhNew->hBitmap = hBitmap; + pbhNew->iWidth = iWidth; + pbhNew->iHeight = iHeight; + pbhNew->pNext = s_pWvwData->s_sApp->pbhBitmapList; - s_pWvwData->s_sApp->pbhBitmapList = pbhNew; + s_pWvwData->s_sApp->pbhBitmapList = pbhNew; } @@ -9626,9 +9625,9 @@ void AddBitmapHandle( const char * szFileName, HBITMAP hBitmap, int iWidth, int Windows controls such as toolbar, pushbutton, checkbox, etc */ static IPicture * FindPictureHandle( const char * szFileName, int * piWidth, int * piHeight ) { - PICTURE_HANDLE * pph = s_pWvwData->s_sApp->pphPictureList; + PICTURE_HANDLE * pph = s_pWvwData->s_sApp->pphPictureList; - BOOL bStrictDimension = ! ( *piWidth == 0 && *piHeight == 0 ); + BOOL bStrictDimension = ! ( *piWidth == 0 && *piHeight == 0 ); while( pph ) { @@ -9636,15 +9635,15 @@ static IPicture * FindPictureHandle( const char * szFileName, int * piWidth, int if( strcmp( szFileName, pph->szFilename ) == 0 && ( ! bStrictDimension || ( *piWidth == pph->iWidth && - *piHeight == pph->iHeight + *piHeight == pph->iHeight ) ) ) { if( ! bStrictDimension ) { - *piWidth = pph->iWidth; - *piHeight = pph->iHeight; + *piWidth = pph->iWidth; + *piHeight = pph->iHeight; } return pph->iPicture; } @@ -9660,12 +9659,12 @@ static void AddPictureHandle( const char * szFileName, IPicture * iPicture, int memset( pphNew, 0, sizeof( PICTURE_HANDLE ) ); strcpy( pphNew->szFilename, szFileName ); - pphNew->iPicture = iPicture; - pphNew->iWidth = iWidth; - pphNew->iHeight = iHeight; - pphNew->pNext = s_pWvwData->s_sApp->pphPictureList; + pphNew->iPicture = iPicture; + pphNew->iWidth = iWidth; + pphNew->iHeight = iHeight; + pphNew->pNext = s_pWvwData->s_sApp->pphPictureList; - s_pWvwData->s_sApp->pphPictureList = pphNew; + s_pWvwData->s_sApp->pphPictureList = pphNew; } @@ -9675,8 +9674,8 @@ static void AddPictureHandle( const char * szFileName, IPicture * iPicture, int */ static HBITMAP FindUserBitmapHandle( const char * szFileName, int * piWidth, int * piHeight ) { - BITMAP_HANDLE * pbh = s_pWvwData->s_sApp->pbhUserBitmap; - BOOL bStrictDimension = ! ( *piWidth == 0 && *piHeight == 0 ); + BITMAP_HANDLE * pbh = s_pWvwData->s_sApp->pbhUserBitmap; + BOOL bStrictDimension = ! ( *piWidth == 0 && *piHeight == 0 ); while( pbh ) { @@ -9684,15 +9683,15 @@ static HBITMAP FindUserBitmapHandle( const char * szFileName, int * piWidth, int if( strcmp( szFileName, pbh->szFilename ) == 0 && ( ! bStrictDimension || ( *piWidth == pbh->iWidth && - *piHeight == pbh->iHeight + *piHeight == pbh->iHeight ) ) ) { if( ! bStrictDimension ) { - *piWidth = pbh->iWidth; - *piHeight = pbh->iHeight; + *piWidth = pbh->iWidth; + *piHeight = pbh->iHeight; } return pbh->hBitmap; @@ -9710,20 +9709,20 @@ static void AddUserBitmapHandle( const char * szFileName, HBITMAP hBitmap, int i memset( pbhNew, 0, sizeof( BITMAP_HANDLE ) ); strcpy( pbhNew->szFilename, szFileName ); - pbhNew->hBitmap = hBitmap; - pbhNew->iWidth = iWidth; - pbhNew->iHeight = iHeight; + pbhNew->hBitmap = hBitmap; + pbhNew->iWidth = iWidth; + pbhNew->iHeight = iHeight; if( s_pWvwData->s_sApp->uiBMcache >= s_pWvwData->s_sApp->uiMaxBMcache ) { BITMAP_HANDLE * pbhTail, * pbhPrev; - pbhTail = s_pWvwData->s_sApp->pbhUserBitmap; - pbhPrev = NULL; + pbhTail = s_pWvwData->s_sApp->pbhUserBitmap; + pbhPrev = NULL; while( pbhTail && pbhTail->pNext ) { - pbhPrev = pbhTail; - pbhTail = pbhTail->pNext; + pbhPrev = pbhTail; + pbhTail = pbhTail->pNext; } if( pbhTail ) @@ -9743,8 +9742,8 @@ static void AddUserBitmapHandle( const char * szFileName, HBITMAP hBitmap, int i } s_pWvwData->s_sApp->uiBMcache++; - pbhNew->pNext = s_pWvwData->s_sApp->pbhUserBitmap; - s_pWvwData->s_sApp->pbhUserBitmap = pbhNew; + pbhNew->pNext = s_pWvwData->s_sApp->pbhUserBitmap; + s_pWvwData->s_sApp->pbhUserBitmap = pbhNew; } @@ -9754,10 +9753,10 @@ static HBITMAP hPrepareBitmap( char * szBitmap, UINT uiBitmap, BOOL bMap3Dcolors, HWND hCtrl ) { - HBITMAP hBitmap; + HBITMAP hBitmap; - UINT uiOptions = bMap3Dcolors ? LR_LOADMAP3DCOLORS : LR_DEFAULTCOLOR; - char szResname[ _MAX_PATH + 1 ]; + UINT uiOptions = bMap3Dcolors ? LR_LOADMAP3DCOLORS : LR_DEFAULTCOLOR; + char szResname[ _MAX_PATH + 1 ]; if( szBitmap ) { @@ -9813,8 +9812,8 @@ static HBITMAP hPrepareBitmap( char * szBitmap, UINT uiBitmap, if( ! hBitmap ) { - BITMAPINFO * pPackedDib = NULL; - HDC hdc; + BITMAPINFO * pPackedDib = NULL; + HDC hdc; if( ! bMap3Dcolors ) { @@ -9842,8 +9841,8 @@ static HBITMAP hPrepareBitmap( char * szBitmap, UINT uiBitmap, return NULL; } - iWidth = PackedDibGetWidth( pPackedDib ); - iHeight = PackedDibGetHeight( pPackedDib ); + iWidth = PackedDibGetWidth( pPackedDib ); + iHeight = PackedDibGetHeight( pPackedDib ); } else { @@ -9861,31 +9860,31 @@ static HBITMAP hPrepareBitmap( char * szBitmap, UINT uiBitmap, return NULL; } - iWidth = iExpWidth; - iHeight = iExpHeight; + iWidth = iExpWidth; + iHeight = iExpHeight; } if( iExpWidth == 0 && iExpHeight == 0 ) { - iWidth = iExpWidth; - iHeight = iExpHeight; + iWidth = iExpWidth; + iHeight = iExpHeight; } if( iExpWidth != iWidth || iExpHeight != iHeight ) { - HDC hdcSource, hdcTarget; - HBITMAP hBitmap2; - BOOL bResult; + HDC hdcSource, hdcTarget; + HBITMAP hBitmap2; + BOOL bResult; - hdcSource = CreateCompatibleDC( hdc ); + hdcSource = CreateCompatibleDC( hdc ); SelectObject( hdcSource, hBitmap ); - hdcTarget = CreateCompatibleDC( hdc ); - hBitmap2 = CreateCompatibleBitmap( hdcSource, iExpWidth, iExpHeight ); + hdcTarget = CreateCompatibleDC( hdc ); + hBitmap2 = CreateCompatibleBitmap( hdcSource, iExpWidth, iExpHeight ); SelectObject( hdcTarget, hBitmap2 ); - bResult = StretchBlt( + bResult = StretchBlt( hdcTarget, /* handle to destination DC */ 0, /* x-coord of destination upper-left corner */ 0, /* y-coord of destination upper-left corner */ @@ -9911,9 +9910,9 @@ static HBITMAP hPrepareBitmap( char * szBitmap, UINT uiBitmap, { DeleteObject( hBitmap ); - hBitmap = hBitmap2; - iWidth = iExpWidth; - iHeight = iExpHeight; + hBitmap = hBitmap2; + iWidth = iExpWidth; + iHeight = iExpHeight; } DeleteDC( hdcSource ); @@ -9958,33 +9957,33 @@ BOOL AddTBButton( HWND hWndToolbar, char * szBitmap, UINT uiBitmap, char * pszLa if( iCommand == 0 ) { - tbb.iBitmap = 0; - tbb.idCommand = 0; - tbb.fsState = TBSTATE_ENABLED; - tbb.fsStyle = TBSTYLE_SEP; - tbb.dwData = 0; - tbb.iString = 0; + tbb.iBitmap = 0; + tbb.idCommand = 0; + tbb.fsState = TBSTATE_ENABLED; + tbb.fsStyle = TBSTYLE_SEP; + tbb.dwData = 0; + tbb.iString = 0; - bSuccess = ( BOOL ) SendMessage( hWndToolbar, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ); + bSuccess = ( BOOL ) SendMessage( hWndToolbar, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ); return bSuccess; } switch( iBitmapType ) { case 0: - iOffset = 0; + iOffset = 0; break; case 1: - iOffset = pWindowData->iStartStdBitmap; + iOffset = pWindowData->iStartStdBitmap; break; case 2: - iOffset = pWindowData->iStartViewBitmap; + iOffset = pWindowData->iStartViewBitmap; break; case 3: - iOffset = pWindowData->iStartHistBitmap; + iOffset = pWindowData->iStartHistBitmap; break; default: - iOffset = 0; + iOffset = 0; break; } @@ -9992,22 +9991,22 @@ BOOL AddTBButton( HWND hWndToolbar, char * szBitmap, UINT uiBitmap, char * pszLa { int iExpWidth, iExpHeight; - iExpWidth = pWindowData->iTBImgWidth; - iExpHeight = pWindowData->iTBImgHeight; + iExpWidth = pWindowData->iTBImgWidth; + iExpHeight = pWindowData->iTBImgHeight; - hBitmap = hPrepareBitmap( szBitmap, uiBitmap, - iExpWidth, iExpHeight, - bMap3Dcolors, - hWndToolbar ); + hBitmap = hPrepareBitmap( szBitmap, uiBitmap, + iExpWidth, iExpHeight, + bMap3Dcolors, + hWndToolbar ); if( ! hBitmap ) { return FALSE; } - tbab.hInst = NULL; - tbab.nID = ( UINT_PTR ) hBitmap; - iNewBitmap = SendMessage( hWndToolbar, TB_ADDBITMAP, ( WPARAM ) 1, ( WPARAM ) &tbab ); + tbab.hInst = NULL; + tbab.nID = ( UINT_PTR ) hBitmap; + iNewBitmap = SendMessage( hWndToolbar, TB_ADDBITMAP, ( WPARAM ) 1, ( WPARAM ) &tbab ); } else /* system bitmap */ @@ -10015,15 +10014,15 @@ BOOL AddTBButton( HWND hWndToolbar, char * szBitmap, UINT uiBitmap, char * pszLa iNewBitmap = ( int ) uiBitmap + iOffset; } - szBuffer[ 0 ] = ( char ) 0; + szBuffer[ 0 ] = ( char ) 0; strcat( szBuffer, pszLabel ); - szBuffer[ strlen( szBuffer ) + 1 ] = ( char ) 0; - iNewString = SendMessage( hWndToolbar, TB_ADDSTRING, ( WPARAM ) 0, ( LPARAM ) szBuffer ); + szBuffer[ strlen( szBuffer ) + 1 ] = ( char ) 0; + iNewString = SendMessage( hWndToolbar, TB_ADDSTRING, ( WPARAM ) 0, ( LPARAM ) szBuffer ); - tbb.iBitmap = iNewBitmap; - tbb.idCommand = iCommand; - tbb.fsState = TBSTATE_ENABLED; - tbb.fsStyle = TBSTYLE_BUTTON; + tbb.iBitmap = iNewBitmap; + tbb.idCommand = iCommand; + tbb.fsState = TBSTATE_ENABLED; + tbb.fsStyle = TBSTYLE_BUTTON; if( bDropdown ) { tbb.fsStyle = tbb.fsStyle | 0x0080 /*BTNS_WHOLEDROPDOWN*/; @@ -10031,7 +10030,7 @@ BOOL AddTBButton( HWND hWndToolbar, char * szBitmap, UINT uiBitmap, char * pszLa tbb.dwData = 0; tbb.iString = iNewString; - bSuccess = SendMessage( hWndToolbar, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ); + bSuccess = SendMessage( hWndToolbar, TB_ADDBUTTONS, ( WPARAM ) 1, ( LPARAM ) ( LPTBBUTTON ) &tbb ); return bSuccess; } @@ -10073,9 +10072,9 @@ void hb_gt_wvwTBinitSize( WIN_DATA * pWindowData, HWND hWndTB ) LRESULT CALLBACK hb_gt_wvwTBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { - HWND hWndParent = GetParent( hWnd ); - UINT usWinNum; - WIN_DATA * pWindowData; + HWND hWndParent = GetParent( hWnd ); + UINT usWinNum; + WIN_DATA * pWindowData; if( hWndParent == NULL ) { @@ -10131,20 +10130,20 @@ LRESULT CALLBACK hb_gt_wvwTBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM case WM_PAINT: { - HGDIOBJ hOldObj; - HDC hdc; - RECT rTB = { 0 }; - int iTop, iRight; + HGDIOBJ hOldObj; + HDC hdc; + RECT rTB = { 0 }; + int iTop, iRight; CallWindowProc( ( WNDPROC ) pWindowData->tbOldProc, hWnd, message, wParam, lParam ); GetClientRect( hWnd, &rTB ); - iTop = rTB.bottom - 3; - iRight = rTB.right; + iTop = rTB.bottom - 3; + iRight = rTB.right; - hdc = GetDC( hWnd ); + hdc = GetDC( hWnd ); - hOldObj = SelectObject( hdc, s_pWvwData->s_sApp->penWhite ); + hOldObj = SelectObject( hdc, s_pWvwData->s_sApp->penWhite ); MoveToEx( hdc, 0, iTop, NULL ); /* Top */ LineTo( hdc, iRight, iTop ); @@ -10242,9 +10241,9 @@ void AddControlHandle( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UINT uiCt memset( pcdNew, 0, sizeof( CONTROL_DATA ) ); - pcdNew->byCtrlClass = byCtrlClass; - pcdNew->hWndCtrl = hWndCtrl; - pcdNew->uiCtrlid = uiCtrlid; + pcdNew->byCtrlClass = byCtrlClass; + pcdNew->hWndCtrl = hWndCtrl; + pcdNew->uiCtrlid = uiCtrlid; pcdNew->phiCodeBlock = NULL; @@ -10254,25 +10253,25 @@ void AddControlHandle( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UINT uiCt } - pcdNew->bBusy = FALSE; - pcdNew->uiBusy = 0; + pcdNew->bBusy = FALSE; + pcdNew->uiBusy = 0; - pcdNew->rCtrl.top = rCtrl.top; - pcdNew->rCtrl.left = rCtrl.left; - pcdNew->rCtrl.bottom = rCtrl.bottom; - pcdNew->rCtrl.right = rCtrl.right; - pcdNew->rOffCtrl.top = rOffCtrl.top; - pcdNew->rOffCtrl.left = rOffCtrl.left; - pcdNew->rOffCtrl.bottom = rOffCtrl.bottom; - pcdNew->rOffCtrl.right = rOffCtrl.right; + pcdNew->rCtrl.top = rCtrl.top; + pcdNew->rCtrl.left = rCtrl.left; + pcdNew->rCtrl.bottom = rCtrl.bottom; + pcdNew->rCtrl.right = rCtrl.right; + pcdNew->rOffCtrl.top = rOffCtrl.top; + pcdNew->rOffCtrl.left = rOffCtrl.left; + pcdNew->rOffCtrl.bottom = rOffCtrl.bottom; + pcdNew->rOffCtrl.right = rOffCtrl.right; - pcdNew->bStyle = bStyle; + pcdNew->bStyle = bStyle; - pcdNew->OldProc = ( WNDPROC ) NULL; + pcdNew->OldProc = ( WNDPROC ) NULL; - pcdNew->pNext = pWindowData->pcdCtrlList; + pcdNew->pNext = pWindowData->pcdCtrlList; - pWindowData->pcdCtrlList = pcdNew; + pWindowData->pcdCtrlList = pcdNew; } CONTROL_DATA * GetControlData( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UINT uiCtrlid ) @@ -10377,13 +10376,13 @@ static void RunControlBlock( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UIN } } - pcd->bBusy = TRUE; + pcd->bBusy = TRUE; pcd->uiBusy++; - phiWinNum = hb_itemNew( NULL ); + phiWinNum = hb_itemNew( NULL ); hb_itemPutNI( phiWinNum, ( int ) usWinNum ); - phiXBid = hb_itemNew( NULL ); + phiXBid = hb_itemNew( NULL ); hb_itemPutNI( phiXBid, ( int ) pcd->uiCtrlid ); if( pcd->byCtrlClass == WVW_CONTROL_SCROLLBAR ) @@ -10394,7 +10393,7 @@ static void RunControlBlock( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UIN phiXBpos = hb_itemNew( NULL ); hb_itemPutNI( phiXBpos, ( int ) HIWORD( wParam ) ); - pReturn = hb_itemDo( pcd->phiCodeBlock, 4, phiWinNum, phiXBid, phiXBmsg, phiXBpos ); + pReturn = hb_itemDo( pcd->phiCodeBlock, 4, phiWinNum, phiXBid, phiXBmsg, phiXBpos ); hb_itemRelease( pReturn ); hb_itemRelease( phiXBmsg ); hb_itemRelease( phiXBpos ); @@ -10407,7 +10406,7 @@ static void RunControlBlock( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UIN } else if( pcd->byCtrlClass == WVW_CONTROL_COMBOBOX ) { - int iCurSel; + int iCurSel; PHB_ITEM phiEvent, phiIndex; @@ -10426,28 +10425,29 @@ static void RunControlBlock( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UIN break; } +#if 0 /*********************** let user find by his own, what is the string of iCurSel - we don;t have to do this: + we don;t have to do this: */ - iTextLen = SendMessage((HWND) pcd->hWndCtrl, - CB_GETLBTEXTLEN, - (WPARAM) iCurSel; - (LPARAM) 0 - ); - lptstrSelected = ( char* ) hb_xgrab( iTextLen+1 ); + iTextLen = SendMessage( ( HWND ) pcd->hWndCtrl, + CB_GETLBTEXTLEN, + ( WPARAM ) iCurSel; + ( LPARAM ) 0 + ); + lptstrSelected = ( char * ) hb_xgrab( iTextLen + 1 ); - SendMessage((HWND) pcd->hWndCtrl, - CB_GETLBTEXT, - (WPARAM) iCurSel, - (LPARAM) lptstrSelected - ); + SendMessage( ( HWND ) pcd->hWndCtrl, + CB_GETLBTEXT, + ( WPARAM ) iCurSel, + ( LPARAM ) lptstrSelected + ); - ... + ... - hb_xfree( lptstrSelected ); + hb_xfree( lptstrSelected ); - **************************/ +#endif /* now execute the codeblock */ phiEvent = hb_itemNew( NULL ); @@ -10456,7 +10456,7 @@ static void RunControlBlock( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UIN phiIndex = hb_itemNew( NULL ); hb_itemPutNI( phiIndex, ( int ) iCurSel ); - pReturn = hb_itemDo( pcd->phiCodeBlock, 4, phiWinNum, phiXBid, phiEvent, phiIndex ); + pReturn = hb_itemDo( pcd->phiCodeBlock, 4, phiWinNum, phiXBid, phiEvent, phiIndex ); hb_itemRelease( pReturn ); hb_itemRelease( phiEvent ); hb_itemRelease( phiIndex ); @@ -10519,44 +10519,44 @@ static void ReposControls( UINT usWinNum, BYTE byCtrlClass ) iTop = xy.y + pcd->rOffCtrl.top; iLeft = xy.x + pcd->rOffCtrl.left; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, ( ( USHORT ) ( LONG ) ( pcd->rCtrl.right ) ) + 1, ( ( USHORT ) ( LONG ) ( pcd->rCtrl.bottom ) ) + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, ( ( USHORT ) ( LONG ) ( pcd->rCtrl.right ) ) + 1, ( ( USHORT ) ( LONG ) ( pcd->rCtrl.bottom ) ) + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; if( pcd->byCtrlClass == WVW_CONTROL_SCROLLBAR ) { if( pcd->bStyle == SBS_VERT ) { - iBottom = xy.y - 1 + pcd->rOffCtrl.bottom; - iRight = iLeft + pWindowData->PTEXTSIZE.y - 1 + pcd->rOffCtrl.right; + iBottom = xy.y - 1 + pcd->rOffCtrl.bottom; + iRight = iLeft + pWindowData->PTEXTSIZE.y - 1 + pcd->rOffCtrl.right; } else { - iRight = xy.x - 1 + pcd->rOffCtrl.right; - iBottom = iTop + pWindowData->PTEXTSIZE.y - 1 + pcd->rOffCtrl.bottom; + iRight = xy.x - 1 + pcd->rOffCtrl.right; + iBottom = iTop + pWindowData->PTEXTSIZE.y - 1 + pcd->rOffCtrl.bottom; } } else if( pcd->byCtrlClass == WVW_CONTROL_PUSHBUTTON ) { - iBottom = xy.y - 1 + pcd->rOffCtrl.bottom; - iRight = xy.x - 1 + pcd->rOffCtrl.right; + iBottom = xy.y - 1 + pcd->rOffCtrl.bottom; + iRight = xy.x - 1 + pcd->rOffCtrl.right; } else if( pcd->byCtrlClass == WVW_CONTROL_PROGRESSBAR ) { - iBottom = xy.y - 1 + pcd->rOffCtrl.bottom; - iRight = xy.x - 1 + pcd->rOffCtrl.right; + iBottom = xy.y - 1 + pcd->rOffCtrl.bottom; + iRight = xy.x - 1 + pcd->rOffCtrl.right; } else if( pcd->byCtrlClass == WVW_CONTROL_COMBOBOX ) { - iBottom = xy.y - 1 + ( pcd->rOffCtrl.bottom * hb_wvw_LineHeight( pWindowData ) ); - iRight = xy.x - 1 + pcd->rOffCtrl.right; + iBottom = xy.y - 1 + ( pcd->rOffCtrl.bottom * hb_wvw_LineHeight( pWindowData ) ); + iRight = xy.x - 1 + pcd->rOffCtrl.right; } else if( pcd->byCtrlClass == WVW_CONTROL_EDITBOX ) { - iBottom = xy.y - 1 + pcd->rOffCtrl.bottom; - iRight = xy.x - 1 + pcd->rOffCtrl.right; + iBottom = xy.y - 1 + pcd->rOffCtrl.bottom; + iRight = xy.x - 1 + pcd->rOffCtrl.right; } else { @@ -10564,8 +10564,8 @@ static void ReposControls( UINT usWinNum, BYTE byCtrlClass ) hb_errRT_TERM( EG_NOFUNC, 10001, "Undefined Control Class", "ReposControls()", 0, 0 ); /* dummy assignment, to avoid warning in mingw32: */ - iBottom = 0; - iRight = 0; + iBottom = 0; + iRight = 0; } SetWindowPos( pcd->hWndCtrl, NULL, iLeft, iTop, iRight - iLeft + 1, iBottom - iTop + 1, SWP_NOZORDER ); @@ -10583,12 +10583,12 @@ static void ReposControls( UINT usWinNum, BYTE byCtrlClass ) LRESULT CALLBACK hb_gt_wvwXBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { - HWND hWndParent = GetParent( hWnd ); - UINT usWinNum; + HWND hWndParent = GetParent( hWnd ); + UINT usWinNum; - UINT uiXBid; + UINT uiXBid; // byte bStyle; - WNDPROC OldProc; + WNDPROC OldProc; if( message == WM_MOUSEACTIVATE ) { @@ -10676,12 +10676,12 @@ LRESULT CALLBACK hb_gt_wvwXBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM LRESULT CALLBACK hb_gt_wvwBtnProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { - HWND hWndParent = GetParent( hWnd ); - UINT usWinNum; + HWND hWndParent = GetParent( hWnd ); + UINT usWinNum; - UINT uiPBid; + UINT uiPBid; - WNDPROC OldProc; + WNDPROC OldProc; if( hWndParent == NULL ) { @@ -10726,11 +10726,11 @@ LRESULT CALLBACK hb_gt_wvwBtnProc( HWND hWnd, UINT message, WPARAM wParam, LPARA case WM_KEYDOWN: case WM_SYSKEYDOWN: { - BOOL bAlt = GetKeyState( VK_MENU ) & 0x8000; - BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; - BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000; + BOOL bAlt = GetKeyState( VK_MENU ) & 0x8000; + BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; + BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000; - int c = ( int ) wParam; + int c = ( int ) wParam; if( ! bAlt && ! bCtrl && ! bShift && wParam == VK_SPACE ) { @@ -10799,12 +10799,12 @@ UINT ButtonCreate( UINT usWinNum, USHORT usTop, USHORT usLeft, USHORT usBottom, double dStretch, BOOL bMap3Dcolors, int iStyle ) { - WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; - HWND hWndParent = pWindowData->hWnd; - HWND hWndButton; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - UINT uiPBid; + WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ usWinNum ]; + HWND hWndParent = pWindowData->hWnd; + HWND hWndButton; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + UINT uiPBid; if( pWindowData->hPBfont == NULL ) { @@ -10820,18 +10820,18 @@ UINT ButtonCreate( UINT usWinNum, USHORT usTop, USHORT usLeft, USHORT usBottom, hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + iOffBottom; - iRight = xy.x - 1 + iOffRight; + iBottom = xy.y - 1 + iOffBottom; + iRight = xy.x - 1 + iOffRight; - uiPBid = LastControlId( usWinNum, WVW_CONTROL_PUSHBUTTON ); + uiPBid = LastControlId( usWinNum, WVW_CONTROL_PUSHBUTTON ); if( uiPBid == 0 ) { uiPBid = WVW_ID_BASE_PUSHBUTTON; @@ -10863,20 +10863,20 @@ UINT ButtonCreate( UINT usWinNum, USHORT usTop, USHORT usLeft, USHORT usBottom, if( hWndButton ) { - RECT rXB = { 0 }, rOffXB = { 0 }; - WNDPROC OldProc; + RECT rXB = { 0 }, rOffXB = { 0 }; + WNDPROC OldProc; if( szBitmap || uiBitmap ) { - HBITMAP hBitmap; - int iExpWidth, iExpHeight; + HBITMAP hBitmap; + int iExpWidth, iExpHeight; - iExpWidth = iRight - iLeft + 1; - iExpHeight = iBottom - iTop + 1; - hBitmap = hPrepareBitmap( szBitmap, uiBitmap, - ( int ) dStretch * iExpWidth, ( int ) dStretch * iExpHeight, - bMap3Dcolors, - hWndButton ); + iExpWidth = iRight - iLeft + 1; + iExpHeight = iBottom - iTop + 1; + hBitmap = hPrepareBitmap( szBitmap, uiBitmap, + ( int ) dStretch * iExpWidth, ( int ) dStretch * iExpHeight, + bMap3Dcolors, + hWndButton ); if( hBitmap ) { @@ -10888,10 +10888,10 @@ UINT ButtonCreate( UINT usWinNum, USHORT usTop, USHORT usLeft, USHORT usBottom, } } - rXB.top = usTop; rXB.left = usLeft; - rXB.bottom = usBottom; rXB.right = usRight; - rOffXB.top = iOffTop; rOffXB.left = iOffLeft; - rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; + rXB.top = usTop; rXB.left = usLeft; + rXB.bottom = usBottom; rXB.right = usRight; + rOffXB.top = iOffTop; rOffXB.left = iOffLeft; + rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; AddControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, hWndButton, uiPBid, ( PHB_ITEM ) phbiCodeBlock, rXB, rOffXB, ( byte ) iStyle ); @@ -10925,12 +10925,12 @@ UINT ButtonCreate( UINT usWinNum, USHORT usTop, USHORT usLeft, USHORT usBottom, LRESULT CALLBACK hb_gt_wvwCBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { - HWND hWndParent = GetParent( hWnd ); - UINT usWinNum; + HWND hWndParent = GetParent( hWnd ); + UINT usWinNum; - UINT uiCBid; - WNDPROC OldProc; - BYTE bKbdType; + UINT uiCBid; + WNDPROC OldProc; + BYTE bKbdType; if( hWndParent == NULL ) { @@ -10976,11 +10976,11 @@ LRESULT CALLBACK hb_gt_wvwCBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM case WM_KEYDOWN: case WM_SYSKEYDOWN: { - BOOL bAlt = GetKeyState( VK_MENU ) & 0x8000; - BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; - BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000; - int c = ( int ) wParam; - BOOL bDropped; + BOOL bAlt = GetKeyState( VK_MENU ) & 0x8000; + BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; + BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000; + int c = ( int ) wParam; + BOOL bDropped; if( ! hb_gt_wvwBufferedKey( ( LONG ) wParam ) ) { @@ -11173,13 +11173,13 @@ LRESULT CALLBACK hb_gt_wvwCBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { - HWND hWndParent = GetParent( hWnd ); - UINT usWinNum; + HWND hWndParent = GetParent( hWnd ); + UINT usWinNum; - UINT uiEBid; - WNDPROC OldProc; - BYTE bEBType; - int iKey; + UINT uiEBid; + WNDPROC OldProc; + BYTE bEBType; + int iKey; if( hWndParent == NULL ) { @@ -11225,18 +11225,18 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM case WM_KEYDOWN: case WM_SYSKEYDOWN: { - BOOL bAlt = GetKeyState( VK_MENU ) & 0x8000; - int c = ( int ) wParam; + BOOL bAlt = GetKeyState( VK_MENU ) & 0x8000; + int c = ( int ) wParam; switch( c ) { case VK_F1: - iKey = hb_gt_wvwJustTranslateKey( K_F1, K_SH_F1, K_ALT_F1, K_CTRL_F1 ); + iKey = hb_gt_wvwJustTranslateKey( K_F1, K_SH_F1, K_ALT_F1, K_CTRL_F1 ); break; case VK_F2: - iKey = hb_gt_wvwJustTranslateKey( K_F2, K_SH_F2, K_ALT_F2, K_CTRL_F2 ); + iKey = hb_gt_wvwJustTranslateKey( K_F2, K_SH_F2, K_ALT_F2, K_CTRL_F2 ); break; case VK_F3: - iKey = hb_gt_wvwJustTranslateKey( K_F3, K_SH_F3, K_ALT_F3, K_CTRL_F3 ); + iKey = hb_gt_wvwJustTranslateKey( K_F3, K_SH_F3, K_ALT_F3, K_CTRL_F3 ); break; case VK_F4: if( bAlt ) @@ -11251,28 +11251,28 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM } break; case VK_F5: - iKey = hb_gt_wvwJustTranslateKey( K_F5, K_SH_F5, K_ALT_F5, K_CTRL_F5 ); + iKey = hb_gt_wvwJustTranslateKey( K_F5, K_SH_F5, K_ALT_F5, K_CTRL_F5 ); break; case VK_F6: - iKey = hb_gt_wvwJustTranslateKey( K_F6, K_SH_F6, K_ALT_F6, K_CTRL_F6 ); + iKey = hb_gt_wvwJustTranslateKey( K_F6, K_SH_F6, K_ALT_F6, K_CTRL_F6 ); break; case VK_F7: - iKey = hb_gt_wvwJustTranslateKey( K_F7, K_SH_F7, K_ALT_F7, K_CTRL_F7 ); + iKey = hb_gt_wvwJustTranslateKey( K_F7, K_SH_F7, K_ALT_F7, K_CTRL_F7 ); break; case VK_F8: - iKey = hb_gt_wvwJustTranslateKey( K_F8, K_SH_F8, K_ALT_F8, K_CTRL_F8 ); + iKey = hb_gt_wvwJustTranslateKey( K_F8, K_SH_F8, K_ALT_F8, K_CTRL_F8 ); break; case VK_F9: - iKey = hb_gt_wvwJustTranslateKey( K_F9, K_SH_F9, K_ALT_F9, K_CTRL_F9 ); + iKey = hb_gt_wvwJustTranslateKey( K_F9, K_SH_F9, K_ALT_F9, K_CTRL_F9 ); break; case VK_F10: - iKey = hb_gt_wvwJustTranslateKey( K_F10, K_SH_F10, K_ALT_F10, K_CTRL_F10 ); + iKey = hb_gt_wvwJustTranslateKey( K_F10, K_SH_F10, K_ALT_F10, K_CTRL_F10 ); break; case VK_F11: - iKey = hb_gt_wvwJustTranslateKey( K_F11, K_SH_F11, K_ALT_F11, K_CTRL_F11 ); + iKey = hb_gt_wvwJustTranslateKey( K_F11, K_SH_F11, K_ALT_F11, K_CTRL_F11 ); break; case VK_F12: - iKey = hb_gt_wvwJustTranslateKey( K_F12, K_SH_F12, K_ALT_F12, K_CTRL_F12 ); + iKey = hb_gt_wvwJustTranslateKey( K_F12, K_SH_F12, K_ALT_F12, K_CTRL_F12 ); break; } break; @@ -11280,9 +11280,9 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM case WM_CHAR: { - BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; - int iScanCode = HIWORD( lParam ) & 0xFF; - int c = ( int ) wParam; + BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; + int iScanCode = HIWORD( lParam ) & 0xFF; + int c = ( int ) wParam; if( bCtrl && iScanCode == 28 ) { iKey = K_CTRL_RETURN; @@ -11297,16 +11297,16 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM { case VK_BACK: - iKey = hb_gt_wvwJustTranslateKey( K_BS, K_SH_BS, K_ALT_BS, K_CTRL_BS ); + iKey = hb_gt_wvwJustTranslateKey( K_BS, K_SH_BS, K_ALT_BS, K_CTRL_BS ); break; case VK_TAB: - iKey = hb_gt_wvwJustTranslateKey( K_TAB, K_SH_TAB, K_ALT_TAB, K_CTRL_TAB ); + iKey = hb_gt_wvwJustTranslateKey( K_TAB, K_SH_TAB, K_ALT_TAB, K_CTRL_TAB ); break; case VK_RETURN: - iKey = hb_gt_wvwJustTranslateKey( K_RETURN, K_SH_RETURN, K_ALT_RETURN, K_CTRL_RETURN ); + iKey = hb_gt_wvwJustTranslateKey( K_RETURN, K_SH_RETURN, K_ALT_RETURN, K_CTRL_RETURN ); break; case VK_ESCAPE: - iKey = K_ESC; + iKey = K_ESC; break; default: if( s_pWvwData->s_pWindows[ usWinNum ]->CodePage == OEM_CHARSET ) @@ -11326,121 +11326,121 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM switch( iScanCode ) { case 2: - c = K_ALT_1; + c = K_ALT_1; break; case 3: - c = K_ALT_2; + c = K_ALT_2; break; case 4: - c = K_ALT_3; + c = K_ALT_3; break; case 5: - c = K_ALT_4; + c = K_ALT_4; break; case 6: - c = K_ALT_5; + c = K_ALT_5; break; case 7: - c = K_ALT_6; + c = K_ALT_6; break; case 8: - c = K_ALT_7; + c = K_ALT_7; break; case 9: - c = K_ALT_8; + c = K_ALT_8; break; case 10: - c = K_ALT_9; + c = K_ALT_9; break; case 11: - c = K_ALT_0; + c = K_ALT_0; break; case 13: - c = K_ALT_EQUALS; + c = K_ALT_EQUALS; break; case 14: - c = K_ALT_BS; + c = K_ALT_BS; break; case 16: - c = K_ALT_Q; + c = K_ALT_Q; break; case 17: - c = K_ALT_W; + c = K_ALT_W; break; case 18: - c = K_ALT_E; + c = K_ALT_E; break; case 19: - c = K_ALT_R; + c = K_ALT_R; break; case 20: - c = K_ALT_T; + c = K_ALT_T; break; case 21: - c = K_ALT_Y; + c = K_ALT_Y; break; case 22: - c = K_ALT_U; + c = K_ALT_U; break; case 23: - c = K_ALT_I; + c = K_ALT_I; break; case 24: - c = K_ALT_O; + c = K_ALT_O; break; case 25: - c = K_ALT_P; + c = K_ALT_P; break; case 30: - c = K_ALT_A; + c = K_ALT_A; break; case 31: - c = K_ALT_S; + c = K_ALT_S; break; case 32: - c = K_ALT_D; + c = K_ALT_D; break; case 33: - c = K_ALT_F; + c = K_ALT_F; break; case 34: - c = K_ALT_G; + c = K_ALT_G; break; case 35: - c = K_ALT_H; + c = K_ALT_H; break; case 36: - c = K_ALT_J; + c = K_ALT_J; break; case 37: - c = K_ALT_K; + c = K_ALT_K; break; case 38: - c = K_ALT_L; + c = K_ALT_L; break; case 44: - c = K_ALT_Z; + c = K_ALT_Z; break; case 45: - c = K_ALT_X; + c = K_ALT_X; break; case 46: - c = K_ALT_C; + c = K_ALT_C; break; case 47: - c = K_ALT_V; + c = K_ALT_V; break; case 48: - c = K_ALT_B; + c = K_ALT_B; break; case 49: - c = K_ALT_N; + c = K_ALT_N; break; case 50: - c = K_ALT_M; + c = K_ALT_M; break; default: - c = ( int ) wParam; + c = ( int ) wParam; break; } iKey = c; @@ -11452,9 +11452,9 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM if( iKey != 0 ) { PHB_ITEM pCodeblock; - PHB_ITEM hiKey = hb_itemNew( NULL ); + PHB_ITEM hiKey = hb_itemNew( NULL ); PHB_ITEM pReturn; - BOOL bCodeExec = FALSE; + BOOL bCodeExec = FALSE; hb_itemPutNI( hiKey, iKey ); @@ -11462,10 +11462,10 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM if( HB_IS_BLOCK( pCodeblock ) ) { SetFocus( hWndParent ); - pReturn = hb_itemDo( pCodeblock, 0 ); + pReturn = hb_itemDo( pCodeblock, 0 ); hb_itemRelease( pReturn ); SetFocus( hWnd ); - bCodeExec = TRUE; + bCodeExec = TRUE; } hb_itemRelease( pCodeblock ); hb_itemRelease( hiKey ); @@ -11480,11 +11480,11 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM case WM_KEYDOWN: case WM_SYSKEYDOWN: { - BOOL bAlt = GetKeyState( VK_MENU ) & 0x8000; - BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; - BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000; - int c = ( int ) wParam; - BOOL bMultiline; + BOOL bAlt = GetKeyState( VK_MENU ) & 0x8000; + BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; + BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000; + int c = ( int ) wParam; + BOOL bMultiline; if( ! hb_gt_wvwBufferedKey( ( LONG ) wParam ) ) { @@ -11592,8 +11592,8 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM case WM_CHAR: { - BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; - int c = ( int ) wParam; + BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000; + int c = ( int ) wParam; switch( c ) { case VK_TAB: @@ -11602,7 +11602,6 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM case 1: if( bCtrl ) { - SendMessage( ( HWND ) hWnd, EM_SETSEL, ( WPARAM ) 0, @@ -11634,6 +11633,6 @@ LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM * Direct WinApi Functions - Prefixed WIN_*() * Original work of Pritpal Bedi on wvtutils.c * - **TODO: should be moved to separate modul. totally independent of GT. + * TODO: should be moved to separate modul. totally independent of GT. * */ diff --git a/harbour/extras/gtwvw/hbgtwvw.h b/harbour/extras/gtwvw/hbgtwvw.h index 0129d704b4..96d5559a42 100644 --- a/harbour/extras/gtwvw/hbgtwvw.h +++ b/harbour/extras/gtwvw/hbgtwvw.h @@ -133,18 +133,18 @@ typedef __int64 LONG_PTR; #if ( ( defined( _MSC_VER ) && ( _MSC_VER <= 1200 || defined( HB_OS_WIN_CE ) ) ) || \ defined( __DMC__ ) ) && ! defined( HB_ARCH_64BIT ) # ifndef GetWindowLongPtr -# define GetWindowLongPtr GetWindowLong +# define GetWindowLongPtr GetWindowLong # endif # ifndef SetWindowLongPtr -# define SetWindowLongPtr SetWindowLong +# define SetWindowLongPtr SetWindowLong # endif # ifndef SetClassLongPtr -# define SetClassLongPtr SetClassLong +# define SetClassLongPtr SetClassLong # endif #endif #if ( defined( __MSC6__ ) || defined( __DMC__ ) ) - #define LONG_PTR LONG + #define LONG_PTR LONG #endif #include @@ -152,131 +152,131 @@ typedef __int64 LONG_PTR; /* xHarbour compatible definitions */ #if ! defined( K_SH_LEFT ) -#define K_SH_LEFT K_LEFT /* Shift-Left == Left */ -#define K_SH_UP K_UP /* Shift-Up == Up */ -#define K_SH_RIGHT K_RIGHT /* Shift-Right == Right */ -#define K_SH_DOWN K_DOWN /* Shift-Down == Down */ -#define K_SH_INS K_INS /* Shift-Ins == Ins */ -#define K_SH_DEL K_DEL /* Shift-Del == Del */ -#define K_SH_HOME K_HOME /* Shift-Home == Home */ -#define K_SH_END K_END /* Shift-End == End */ -#define K_SH_PGUP K_PGUP /* Shift-PgUp == PgUp */ -#define K_SH_PGDN K_PGDN /* Shift-PgDn == PgDn */ -#define K_SH_RETURN K_RETURN /* Shift-Enter == Enter */ -#define K_SH_ENTER K_ENTER /* Shift-Enter == Enter */ +#define K_SH_LEFT K_LEFT /* Shift-Left == Left */ +#define K_SH_UP K_UP /* Shift-Up == Up */ +#define K_SH_RIGHT K_RIGHT /* Shift-Right == Right */ +#define K_SH_DOWN K_DOWN /* Shift-Down == Down */ +#define K_SH_INS K_INS /* Shift-Ins == Ins */ +#define K_SH_DEL K_DEL /* Shift-Del == Del */ +#define K_SH_HOME K_HOME /* Shift-Home == Home */ +#define K_SH_END K_END /* Shift-End == End */ +#define K_SH_PGUP K_PGUP /* Shift-PgUp == PgUp */ +#define K_SH_PGDN K_PGDN /* Shift-PgDn == PgDn */ +#define K_SH_RETURN K_RETURN /* Shift-Enter == Enter */ +#define K_SH_ENTER K_ENTER /* Shift-Enter == Enter */ #endif -#define WVW_MAXWINDOWS 40 +#define WVW_MAXWINDOWS 40 -#define WVW_MAXWINNAMELENGTH 256 +#define WVW_MAXWINNAMELENGTH 256 -#define WVW_DEFAULT_MENUKEYEVENT 1024 +#define WVW_DEFAULT_MENUKEYEVENT 1024 -#define WVW_MAX_STATUS_PARTS 40 /* max # of parts in Status Bar */ -#define WVW_SPACE_BETWEEN_PARTS 2 /* pixel space between Status Bar's parts */ +#define WVW_MAX_STATUS_PARTS 40 /* max # of parts in Status Bar */ +#define WVW_SPACE_BETWEEN_PARTS 2 /* pixel space between Status Bar's parts */ -#define WVW_ID_SYSTEM_TIMER 1 +#define WVW_ID_SYSTEM_TIMER 1 -#define WVW_ID_BASE_STATUSBAR 100 -#define WVW_ID_BASE_TIMER 100 +#define WVW_ID_BASE_STATUSBAR 100 +#define WVW_ID_BASE_TIMER 100 -#define WVW_ID_BASE_TOOLTIP 100 +#define WVW_ID_BASE_TOOLTIP 100 -#define WVW_ID_BASE_TOOLBAR 100 +#define WVW_ID_BASE_TOOLBAR 100 -#define WVW_ID_BASE_SCROLLBAR 100 +#define WVW_ID_BASE_SCROLLBAR 100 -#define WVW_ID_BASE_PROGRESSBAR 100 -#define WVW_ID_BASE_STATIC 200 +#define WVW_ID_BASE_PROGRESSBAR 100 +#define WVW_ID_BASE_STATIC 200 -#define WVW_ID_BASE_PUSHBUTTON 64000 -#define WVW_ID_BASE_CHECKBOX 64000 +#define WVW_ID_BASE_PUSHBUTTON 64000 +#define WVW_ID_BASE_CHECKBOX 64000 -#define WVW_ID_MAX_PUSHBUTTON WVW_ID_BASE_PUSHBUTTON + 200 - 1 -#define WVW_ID_MAX_CHECKBOX WVW_ID_BASE_CHECKBOX + 200 - 1 +#define WVW_ID_MAX_PUSHBUTTON WVW_ID_BASE_PUSHBUTTON + 200 - 1 +#define WVW_ID_MAX_CHECKBOX WVW_ID_BASE_CHECKBOX + 200 - 1 /* ie. effectively there are max 200 buttons on a window */ -#define WVW_ID_BASE_COMBOBOX WVW_ID_MAX_PUSHBUTTON + 1 -#define WVW_CB_KBD_STANDARD 0 -#define WVW_CB_KBD_CLIPPER 1 +#define WVW_ID_BASE_COMBOBOX WVW_ID_MAX_PUSHBUTTON + 1 +#define WVW_CB_KBD_STANDARD 0 +#define WVW_CB_KBD_CLIPPER 1 -#define WVW_COMBOBOX_MAXLEN 255 /* maximum length of combobox string */ +#define WVW_COMBOBOX_MAXLEN 255 /* maximum length of combobox string */ -#define WVW_ID_MAX_COMBOBOX WVW_ID_BASE_COMBOBOX + 200 - 1 +#define WVW_ID_MAX_COMBOBOX WVW_ID_BASE_COMBOBOX + 200 - 1 -#define WVW_ID_BASE_EDITBOX WVW_ID_MAX_COMBOBOX + 1 -#define WVW_ID_MAX_EDITBOX WVW_ID_BASE_EDITBOX + 200 - 1 +#define WVW_ID_BASE_EDITBOX WVW_ID_MAX_COMBOBOX + 1 +#define WVW_ID_MAX_EDITBOX WVW_ID_BASE_EDITBOX + 200 - 1 -#define WVW_EB_SINGLELINE 1 -#define WVW_EB_MULTILINE 2 +#define WVW_EB_SINGLELINE 1 +#define WVW_EB_MULTILINE 2 -#define WVW_CHAR_QUEUE_SIZE 128 -#define WVW_MAX_TITLE_SIZE 128 -#define WVW_CHAR_BUFFER 1024 -#define WVW_MAX_ROWS 256 -#define WVW_MAX_COLS 256 -#define WVW_DEFAULT_ROWS 25 -#define WVW_DEFAULT_COLS 80 +#define WVW_CHAR_QUEUE_SIZE 128 +#define WVW_MAX_TITLE_SIZE 128 +#define WVW_CHAR_BUFFER 1024 +#define WVW_MAX_ROWS 256 +#define WVW_MAX_COLS 256 +#define WVW_DEFAULT_ROWS 25 +#define WVW_DEFAULT_COLS 80 -#define WVW_PICTURES_MAX 20 +#define WVW_PICTURES_MAX 20 -#define WVW_FONTS_MAX 20 -#define WVW_PENS_MAX 20 -#define WVW_DLGML_MAX 20 -#define WVW_DLGMD_MAX 20 +#define WVW_FONTS_MAX 20 +#define WVW_PENS_MAX 20 +#define WVW_DLGML_MAX 20 +#define WVW_DLGMD_MAX 20 /* default maximum number of user bitmap cache One bitmap cache currently takes 280 bytes (see BITMAP_HANDLE). See also wvw_setMaxBMCache(). */ -#define WVW_DEFAULT_MAX_BMCACHE 20 +#define WVW_DEFAULT_MAX_BMCACHE 20 /* Como as descricoes sao grandes, precisei aumetar isso - Peluffo - 26/10/2007 #define WVW_TB_LABELMAXLENGTH 40 */ -#define WVW_TB_LABELMAXLENGTH 100 +#define WVW_TB_LABELMAXLENGTH 100 //#define WVW_WHICH_WINDOW ( HB_ISNIL( 1 ) ? ( s_bMainCoordMode ? s_usNumWindows-1 : s_usCurWindow ) : ((UINT) hb_parni( 1 )) ) -#define WVW_WHICH_WINDOW ( HB_ISNIL( 1 ) ? ( hb_gt_wvw_GetMainCoordMode() ? ( ( hb_gt_wvw_GetNumWindows() ) - 1 ) : hb_gt_wvw_GetCurWindow() ) : ( ( UINT ) hb_parni( 1 ) ) ) +#define WVW_WHICH_WINDOW ( HB_ISNIL( 1 ) ? ( hb_gt_wvw_GetMainCoordMode() ? ( ( hb_gt_wvw_GetNumWindows() ) - 1 ) : hb_gt_wvw_GetCurWindow() ) : ( ( UINT ) hb_parni( 1 ) ) ) -#define BLACK RGB( 0x0, 0x0, 0x0 ) -#define BLUE RGB( 0x0, 0x0, 0x85 ) -#define GREEN RGB( 0x0, 0x85, 0x0 ) -#define CYAN RGB( 0x0, 0x85, 0x85 ) -#define RED RGB( 0x85, 0x0, 0x0 ) -#define MAGENTA RGB( 0x85, 0x0, 0x85 ) -#define BROWN RGB( 0x85, 0x85, 0x0 ) -#define WHITE RGB( 0xC6, 0xC6, 0xC6 ) -#define LIGHT_GRAY RGB( 0x60, 0x60, 0x60 ) -#define BRIGHT_BLUE RGB( 0x00, 0x00, 0xFF ) -#define BRIGHT_GREEN RGB( 0x60, 0xFF, 0x60 ) -#define BRIGHT_CYAN RGB( 0x60, 0xFF, 0xFF ) -#define BRIGHT_RED RGB( 0xF8, 0x00, 0x26 ) -#define BRIGHT_MAGENTA RGB( 0xFF, 0x60, 0xFF ) -#define YELLOW RGB( 0xFF, 0xFF, 0x00 ) -#define BRIGHT_WHITE RGB( 0xFF, 0xFF, 0xFF ) +#define BLACK RGB( 0x0, 0x0, 0x0 ) +#define BLUE RGB( 0x0, 0x0, 0x85 ) +#define GREEN RGB( 0x0, 0x85, 0x0 ) +#define CYAN RGB( 0x0, 0x85, 0x85 ) +#define RED RGB( 0x85, 0x0, 0x0 ) +#define MAGENTA RGB( 0x85, 0x0, 0x85 ) +#define BROWN RGB( 0x85, 0x85, 0x0 ) +#define WHITE RGB( 0xC6, 0xC6, 0xC6 ) +#define LIGHT_GRAY RGB( 0x60, 0x60, 0x60 ) +#define BRIGHT_BLUE RGB( 0x00, 0x00, 0xFF ) +#define BRIGHT_GREEN RGB( 0x60, 0xFF, 0x60 ) +#define BRIGHT_CYAN RGB( 0x60, 0xFF, 0xFF ) +#define BRIGHT_RED RGB( 0xF8, 0x00, 0x26 ) +#define BRIGHT_MAGENTA RGB( 0xFF, 0x60, 0xFF ) +#define YELLOW RGB( 0xFF, 0xFF, 0x00 ) +#define BRIGHT_WHITE RGB( 0xFF, 0xFF, 0xFF ) #if defined( __DMC__ ) - #define SBT_TOOLTIPS 0x0800 - #define SB_SETICON ( WM_USER + 15 ) - #define SB_SETTIPTEXT ( WM_USER + 17 ) - #define SB_GETTIPTEXT ( WM_USER + 18 ) - #define TBSTYLE_FLAT 0x0800 - #define TBSTYLE_LIST 0x1000 - #define BTNS_WHOLEDROPDOWN 0x0080 - #define TBSTYLE_CUSTOMERASE 0x2000 - #define IDB_HIST_SMALL_COLOR 8 - #define IDB_HIST_LARGE_COLOR 9 - #define TB_SETMAXTEXTROWS ( WM_USER + 60 ) - #define PBS_VERTICAL 0x04 - #define PBS_SMOOTH 0x01 - #define CCM_FIRST 0x2000 - #define CCM_SETBKCOLOR ( CCM_FIRST + 1 ) - #define PBM_SETBKCOLOR CCM_SETBKCOLOR - #define PBM_SETBARCOLOR ( WM_USER + 9 ) - #define PBM_GETRANGE ( WM_USER + 7 ) - #define PBM_GETPOS ( WM_USER + 8 ) + #define SBT_TOOLTIPS 0x0800 + #define SB_SETICON ( WM_USER + 15 ) + #define SB_SETTIPTEXT ( WM_USER + 17 ) + #define SB_GETTIPTEXT ( WM_USER + 18 ) + #define TBSTYLE_FLAT 0x0800 + #define TBSTYLE_LIST 0x1000 + #define BTNS_WHOLEDROPDOWN 0x0080 + #define TBSTYLE_CUSTOMERASE 0x2000 + #define IDB_HIST_SMALL_COLOR 8 + #define IDB_HIST_LARGE_COLOR 9 + #define TB_SETMAXTEXTROWS ( WM_USER + 60 ) + #define PBS_VERTICAL 0x04 + #define PBS_SMOOTH 0x01 + #define CCM_FIRST 0x2000 + #define CCM_SETBKCOLOR ( CCM_FIRST + 1 ) + #define PBM_SETBKCOLOR CCM_SETBKCOLOR + #define PBM_SETBARCOLOR ( WM_USER + 9 ) + #define PBM_GETRANGE ( WM_USER + 7 ) + #define PBM_GETPOS ( WM_USER + 8 ) typedef DWORD UINT_PTR; @@ -286,14 +286,14 @@ typedef struct int iHigh; } PBRANGE, * PPBRANGE; - #define ICC_BAR_CLASSES 0x00000004 + #define ICC_BAR_CLASSES 0x00000004 typedef USHORT COLOR16; typedef struct _TRIVERTEX { - LONG x; - LONG y; + LONG x; + LONG y; COLOR16 Red; COLOR16 Green; COLOR16 Blue; @@ -315,7 +315,7 @@ typedef struct _GRADIENT_RECT } GRADIENT_RECT, * PGRADIENT_RECT, * LPGRADIENT_RECT; #endif -#define WM_MY_UPDATE_CARET ( WM_USER + 0x0101 ) +#define WM_MY_UPDATE_CARET ( WM_USER + 0x0101 ) typedef BOOL ( WINAPI * wvwGradientFill )( HDC hdc, @@ -326,22 +326,22 @@ typedef BOOL ( WINAPI * wvwGradientFill )( ULONG dwMode ); #ifndef _MAX_PATH - #define _MAX_PATH 256 + #define _MAX_PATH 256 #endif typedef struct bitmap_handle { - char szFilename[ _MAX_PATH + 1 ]; + char szFilename[ _MAX_PATH + 1 ]; HBITMAP hBitmap; - int iWidth, iHeight; + int iWidth, iHeight; struct bitmap_handle * pNext; } BITMAP_HANDLE; typedef struct picture_handle { - char szFilename[ _MAX_PATH + 1 ]; + char szFilename[ _MAX_PATH + 1 ]; IPicture * iPicture; - int iWidth, iHeight; + int iWidth, iHeight; struct picture_handle * pNext; } PICTURE_HANDLE; @@ -358,13 +358,13 @@ typedef struct picture_handle typedef struct control_data { - BYTE byCtrlClass; - HWND hWndCtrl; - UINT uiCtrlid; + BYTE byCtrlClass; + HWND hWndCtrl; + UINT uiCtrlid; PHB_ITEM phiCodeBlock; - BOOL bBusy; - UINT uiBusy; - RECT rCtrl, rOffCtrl; + BOOL bBusy; + UINT uiBusy; + RECT rCtrl, rOffCtrl; /* SCROLLBAR specifics: */ /* also used by combobox to store kbd type */ @@ -385,15 +385,15 @@ typedef struct app_data BOOL Win9X; /* Flag to say if running on Win9X not NT/2000/XP */ BOOL AltF4Close; /* Can use Alt+F4 to close application */ - HPEN penWhite; /* White pen to draw GDI elements */ - HPEN penBlack; /* Black pen to draw GDI elements */ - HPEN penWhiteDim; /* White dim pen to draw GDI elements */ - HPEN penDarkGray; /* Dark gray pen to draw GDI elements */ - HPEN penGray; /* Gray pen equivalent to Clipper White */ - HPEN penNull; /* Null pen */ - HPEN OriginalPen; /* Handle da Pen original do Device Context */ - HPEN currentPen; /* Handle to current pen settable at runtime */ - HPEN gridPen; /* Handle da Pen para Grid */ + HPEN penWhite; /* White pen to draw GDI elements */ + HPEN penBlack; /* Black pen to draw GDI elements */ + HPEN penWhiteDim; /* White dim pen to draw GDI elements */ + HPEN penDarkGray; /* Dark gray pen to draw GDI elements */ + HPEN penGray; /* Gray pen equivalent to Clipper White */ + HPEN penNull; /* Null pen */ + HPEN OriginalPen; /* Handle da Pen original do Device Context */ + HPEN currentPen; /* Handle to current pen settable at runtime */ + HPEN gridPen; /* Handle da Pen para Grid */ HBRUSH currentBrush; /* Handle to current brush settable by runtime */ HBRUSH diagonalBrush; /* Handle to diaoganl brush to draw scrollbars */ HBRUSH solidBrush; /* Handle to solid brush */ @@ -401,10 +401,10 @@ typedef struct app_data HBRUSH OriginalBrush; /* Handle da Brush original do Device Context */ IPicture * iPicture[ WVW_PICTURES_MAX ]; /* Array to hold the Picture Streams to avoid recurring loading and unloading */ - HFONT hUserFonts[ WVW_FONTS_MAX ]; /* User defined font handles */ - HPEN hUserPens[ WVW_PENS_MAX ]; /* User defined pens */ + HFONT hUserFonts[ WVW_FONTS_MAX ]; /* User defined font handles */ + HPEN hUserPens[ WVW_PENS_MAX ]; /* User defined pens */ - HINSTANCE hMSImg32; /* Handle to the loaded library msimg32.dll */ + HINSTANCE hMSImg32; /* Handle to the loaded library msimg32.dll */ wvwGradientFill pfnGF; /* Pointer to Address of the GradientFill function in MSImg32.dll */ HWND hDlgModeless[ WVW_DLGML_MAX ]; /* Handle to a modeless dialog */ @@ -412,15 +412,15 @@ typedef struct app_data PHB_ITEM pFunc[ WVW_DLGML_MAX ]; /* Function pointer for WndProc */ /* TODO: pcbFunc is redundant and should be removed */ PHB_ITEM pcbFunc[ WVW_DLGML_MAX ]; /* codeblock for WndProc */ - int iType[ WVW_DLGML_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */ + int iType[ WVW_DLGML_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */ - HWND hDlgModal[ WVW_DLGMD_MAX ]; /* Handle to a modal dialog */ + HWND hDlgModal[ WVW_DLGMD_MAX ]; /* Handle to a modal dialog */ PHB_ITEM pFuncModal[ WVW_DLGMD_MAX ]; /* Function pointer for WndProc */ /* TODO: pcbFuncModal is redundant and should be removed */ PHB_ITEM pcbFuncModal[ WVW_DLGMD_MAX ]; /* codeblock for WndProc */ - int iTypeModal[ WVW_DLGMD_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */ + int iTypeModal[ WVW_DLGMD_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */ - BITMAP_HANDLE * pbhBitmapList; + BITMAP_HANDLE * pbhBitmapList; PICTURE_HANDLE * pphPictureList; BITMAP_HANDLE * pbhUserBitmap; /* User bitmap (wvw_drawimage) */ @@ -446,7 +446,7 @@ typedef struct app_data typedef struct win_data { - UINT byWinId; /*x Window's Id, a number 0..WVWMAXWINDOWS */ + UINT byWinId; /*x Window's Id, a number 0..WVWMAXWINDOWS */ TCHAR szWinName[ WVW_MAXWINNAMELENGTH ]; /*x name of Window ~ szAppName for Window 0 */ int byLineSpacing; /*x linespacing in pixels */ @@ -454,17 +454,17 @@ typedef struct win_data USHORT usRowOfs; /*x offset to Main Window's (0,0) */ USHORT usColOfs; /*x offset to Main Window's (0,0) */ - int uiDispCount; /*x pending DispEnd() request */ - BOOL bPaintPending; /*x pending WVW_PAINT() execution */ - RECT rPaintPending; /*x rect of pending bPaintPending */ - HWND hStatusBar; /* handle to status bar */ + int uiDispCount; /*x pending DispEnd() request */ + BOOL bPaintPending; /*x pending WVW_PAINT() execution */ + RECT rPaintPending; /*x rect of pending bPaintPending */ + HWND hStatusBar; /* handle to status bar */ USHORT usSBHeight; /* height of status bar */ - HWND hToolBar; /* TB handle to toolbar */ + HWND hToolBar; /* TB handle to toolbar */ USHORT usTBHeight; /* TB height of toolbar */ - int iStartStdBitmap, - iStartViewBitmap, - iStartHistBitmap; /* start of bitmap index */ + int iStartStdBitmap, + iStartViewBitmap, + iStartHistBitmap; /* start of bitmap index */ int iTBImgWidth, iTBImgHeight; /* image width and height */ WNDPROC tbOldProc; @@ -482,7 +482,7 @@ typedef struct win_data HFONT hCXfont; /* handle to font used by checkboxes when 'focused' */ HFONT hSTfont; /* handle to font used by checkboxes when 'focused' */ - BOOL bSBPaint; + BOOL bSBPaint; COLORREF cSBColorForeground; COLORREF cSBColorBackground; @@ -490,41 +490,41 @@ typedef struct win_data BOOL bPaint; BOOL bGetFocus; - POINT PTEXTSIZE; /* size of the fixed width font */ - BOOL FixedFont; /* TRUE if current font is a fixed font */ - int FixedSize[ WVW_MAX_COLS ]; /* buffer for ExtTextOut() to emulate fixed pitch when Proportional font selected */ - USHORT ROWS; /* number of displayable rows in window */ - USHORT COLS; /* number of displayable columns in window */ + POINT PTEXTSIZE; /* size of the fixed width font */ + BOOL FixedFont; /* TRUE if current font is a fixed font */ + int FixedSize[ WVW_MAX_COLS ]; /* buffer for ExtTextOut() to emulate fixed pitch when Proportional font selected */ + USHORT ROWS; /* number of displayable rows in window */ + USHORT COLS; /* number of displayable columns in window */ COLORREF foreground; /* foreground colour */ COLORREF background; /* background colour */ USHORT BUFFERSIZE; /* size of the screen text buffer */ - BYTE byBuffer[ WVW_MAX_ROWS * WVW_MAX_COLS ]; /* buffer with the text to be displayed on the screen */ - BYTE byColors[ WVW_MAX_ROWS * WVW_MAX_COLS ]; + BYTE byBuffer[ WVW_MAX_ROWS * WVW_MAX_COLS ]; /* buffer with the text to be displayed on the screen */ + BYTE byColors[ WVW_MAX_ROWS * WVW_MAX_COLS ]; BYTE * pBuffer; /* " " " */ BYTE * pColors; /* " " " */ - POINT caretPos; /* the current caret position */ + POINT caretPos; /* the current caret position */ - int CaretSize; /*x this may be specific to each windows, eg. different font size */ + int CaretSize; /*x this may be specific to each windows, eg. different font size */ POINT mousePos; /* the last mousedown position */ - BOOL MouseMove; /* Flag to say whether to return mouse movement events */ - HWND hWnd; /* the window handle */ - int Keys[ WVW_CHAR_QUEUE_SIZE ]; /* Array to hold the characters & events */ - int keyPointerIn; /* Offset into key array for character to be placed */ - int keyPointerOut; /* Offset into key array of next character to read */ - int keyLast; + BOOL MouseMove; /* Flag to say whether to return mouse movement events */ + HWND hWnd; /* the window handle */ + int Keys[ WVW_CHAR_QUEUE_SIZE ]; /* Array to hold the characters & events */ + int keyPointerIn; /* Offset into key array for character to be placed */ + int keyPointerOut; /* Offset into key array of next character to read */ + int keyLast; - RECT RectInvalid; /* Invalid rectangle if DISPBEGIN() active */ + RECT RectInvalid; /* Invalid rectangle if DISPBEGIN() active */ HFONT hFont; - int fontHeight; /* requested font height */ - int fontWidth; /* requested font width */ - int fontWeight; /* Bold level */ - int fontQuality; - char fontFace[ LF_FACESIZE ]; /* requested font face name LF_FACESIZE #defined in wingdi.h */ + int fontHeight; /* requested font height */ + int fontWidth; /* requested font width */ + int fontWeight; /* Bold level */ + int fontQuality; + char fontFace[ LF_FACESIZE ]; /* requested font face name LF_FACESIZE #defined in wingdi.h */ - int LastMenuEvent; /* Last menu item selected */ - int MenuKeyEvent; /* User definable event number for windows menu command */ + int LastMenuEvent; /* Last menu item selected */ + int MenuKeyEvent; /* User definable event number for windows menu command */ BOOL CentreWindow; /* True if window is to be Reset into centre of window */ /* if CentreWindow is FALSE, two following settings are examined */ @@ -540,9 +540,9 @@ typedef struct win_data HMENU hPopup; /* Handle of context menu invokable with right click */ - HDC hCompDC; /* Compatible DC to _s.hdc */ - HWND hWndTT; /* Handle to hold tooltip information */ - BOOL bToolTipActive; /* Flag to set whether tooltip is active or not */ + HDC hCompDC; /* Compatible DC to _s.hdc */ + HWND hWndTT; /* Handle to hold tooltip information */ + BOOL bToolTipActive; /* Flag to set whether tooltip is active or not */ HICON hIcon; } WIN_DATA; @@ -601,7 +601,7 @@ typedef struct wvw_data TCHAR szAppName[ 13 ]; TCHAR szSubWinName[ 25 ]; - BOOL s_bSWRegistered; + BOOL s_bSWRegistered; HINSTANCE hInstance; @@ -616,9 +616,9 @@ typedef struct wvw_data //#define HB_RETHANDLE( h ) hb_retptr( ( void * ) ( h ) ) //#define HB_PARHANDLE( n ) hb_parptr( n ) //#define HB_STOREHANDLE( h, n ) hb_storptr( ( void * ) ( h ), n ) - #define HB_RETHANDLE( h ) hb_retnl( ( LONG ) ( h ) ) - #define HB_PARHANDLE( n ) ( ( LONG ) hb_parnl( n ) ) - #define HB_STOREHANDLE( h, n ) hb_stornl( ( LONG ) ( h ), n ) + #define HB_RETHANDLE( h ) hb_retnl( ( LONG ) ( h ) ) + #define HB_PARHANDLE( n ) ( ( LONG ) hb_parnl( n ) ) + #define HB_STOREHANDLE( h, n ) hb_stornl( ( LONG ) ( h ), n ) HB_EXTERN_BEGIN /* Get functions for internal Data */ diff --git a/harbour/extras/gtwvw/hbole.h b/harbour/extras/gtwvw/hbole.h index 60570b1130..88fcb6e10e 100644 --- a/harbour/extras/gtwvw/hbole.h +++ b/harbour/extras/gtwvw/hbole.h @@ -63,31 +63,31 @@ ! defined( __LCC__ ) && ! defined( __POCC__ ) && ! defined( __XCC__ ) #ifndef CINTERFACE -#define CINTERFACE 1 +#define CINTERFACE 1 #endif #ifndef _REFGUID_DEFINED -#define _REFGUID_DEFINED 1 -#define REFGUID const GUID * const +#define _REFGUID_DEFINED 1 +#define REFGUID const GUID * const #endif #ifndef _REFIID_DEFINED -#define _REFIID_DEFINED 1 -#define REFIID const IID * const +#define _REFIID_DEFINED 1 +#define REFIID const IID * const #endif #ifndef _REFCLSID_DEFINED -#define _REFCLSID_DEFINED 1 -#define REFCLSID const IID * const +#define _REFCLSID_DEFINED 1 +#define REFCLSID const IID * const #endif #ifndef _REFFMTID_DEFINED -#define _REFFMTID_DEFINED 1 -#define REFFMTID const IID * const +#define _REFFMTID_DEFINED 1 +#define REFFMTID const IID * const #endif #ifndef _SYS_GUID_OPERATOR_EQ_ -#define _SYS_GUID_OPERATOR_EQ_ 1 +#define _SYS_GUID_OPERATOR_EQ_ 1 #endif // _SYS_GUID_OPERATOR_EQ_ #endif // _MSC_VER diff --git a/harbour/extras/gtwvw/wvwcheck.c b/harbour/extras/gtwvw/wvwcheck.c index 8762766d32..f3a5dd3890 100644 --- a/harbour/extras/gtwvw/wvwcheck.c +++ b/harbour/extras/gtwvw/wvwcheck.c @@ -83,21 +83,21 @@ /*WVW_CXcreate( [nWinNum], nTop, nLeft, nBottom, nRight, cText, cImage/nImage, bBlock, aOffset,; * nStretchBitmap, lMap3Dcolors) - **create CHECKBOX for window nWinNum - **nTop: row of top/left corner (in character unit) - **nLeft: col of top/left corner (in character unit) - **nBottom: row of bottom/right corner (in character unit) defaults==nTop - **nRight: col of bottom/right corner (in character unit) defaults==?? - **cText: caption, default == "" + * create CHECKBOX for window nWinNum + * nTop: row of top/left corner (in character unit) + * nLeft: col of top/left corner (in character unit) + * nBottom: row of bottom/right corner (in character unit) defaults==nTop + * nRight: col of bottom/right corner (in character unit) defaults==?? + * cText: caption, default == "" * - **cImage: bitmap file name, can be supplied as nImage: bitmap resource id - **nStretchBitmap: a number between 0 and 1 (inclusive) as a factor to + * cImage: bitmap file name, can be supplied as nImage: bitmap resource id + * nStretchBitmap: a number between 0 and 1 (inclusive) as a factor to * stretch the bitmap. * 1.0: bitmap covers the whole button * 0.5: bitmap covers 50% of button * 0: bitmap is not stretch * (default is 1) - **lMap3Dcolors: defaults to .f. + * lMap3Dcolors: defaults to .f. * if .t. the following color mapping will be performed: * RGB(192,192,192) --> COLOR_3DFACE ("transparent") * RGB(128,128,128) --> COLOR_3DSHADOW @@ -105,36 +105,36 @@ * This might be desirable to have transparent effect. * LIMITATION: this will work on 256 colored bitmaps only * - **aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust + * aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust * dimension of CHECKBOX. * defaults for CHECKBOX: {-2,-2,+2,+2} * - **bBlock: codeblock to execute on every BN_CLICK event. + * bBlock: codeblock to execute on every BN_CLICK event. * This codeblock will be evaluated with these parameters: * nWinNum: window number * nCXid : CHECKBOX id * - **returns control id of newly created CHECKBOX of windows nWinNum - **returns 0 if failed + * returns control id of newly created CHECKBOX of windows nWinNum + * returns 0 if failed * - **example: + * example: */ HB_FUNC( WVW_CXCREATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - int iOffTop, iOffLeft, iOffBottom, iOffRight; + UINT usWinNum = WVW_WHICH_WINDOW; + int iOffTop, iOffLeft, iOffBottom, iOffRight; // int iStyle; - UINT uiPBid; - USHORT usTop = ( BYTE ) hb_parni( 2 ), - usLeft = ( BYTE ) hb_parni( 3 ), - usBottom = ( BYTE ) hb_parni( 4 ), - usRight = ( BYTE ) hb_parni( 5 ); - LPCTSTR lpszCaption = HB_ISCHAR( 6 ) ? hb_parcx( 6 ) : NULL; - char * szBitmap = HB_ISCHAR( 7 ) ? ( char * ) hb_parcx( 7 ) : NULL; - UINT uiBitmap = HB_ISNUM( 7 ) ? ( UINT ) hb_parni( 7 ) : 0; - double dStretch = ! HB_ISNIL( 10 ) ? hb_parnd( 10 ) : 1; - BOOL bMap3Dcolors = HB_ISLOG( 11 ) ? ( BOOL ) hb_parl( 11 ) : FALSE; + UINT uiPBid; + USHORT usTop = ( BYTE ) hb_parni( 2 ), + usLeft = ( BYTE ) hb_parni( 3 ), + usBottom = ( BYTE ) hb_parni( 4 ), + usRight = ( BYTE ) hb_parni( 5 ); + LPCTSTR lpszCaption = HB_ISCHAR( 6 ) ? hb_parcx( 6 ) : NULL; + char * szBitmap = HB_ISCHAR( 7 ) ? ( char * ) hb_parcx( 7 ) : NULL; + UINT uiBitmap = HB_ISNUM( 7 ) ? ( UINT ) hb_parni( 7 ) : 0; + double dStretch = ! HB_ISNIL( 10 ) ? hb_parnd( 10 ) : 1; + BOOL bMap3Dcolors = HB_ISLOG( 11 ) ? ( BOOL ) hb_parl( 11 ) : FALSE; if( ! HB_ISBLOCK( 8 ) ) { @@ -142,16 +142,16 @@ HB_FUNC( WVW_CXCREATE ) return; } - iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : -2; - iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : -2; - iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : +2; - iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : +2; + iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : -2; + iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : -2; + iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : +2; + iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : +2; - uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption, - szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ), - iOffTop, iOffLeft, iOffBottom, iOffRight, - dStretch, bMap3Dcolors, - BS_AUTOCHECKBOX ); + uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption, + szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ), + iOffTop, iOffLeft, iOffBottom, iOffRight, + dStretch, bMap3Dcolors, + BS_AUTOCHECKBOX ); hb_retnl( ( LONG ) uiPBid ); } @@ -160,7 +160,7 @@ HB_FUNC( WVW_CXCREATE ) */ HB_FUNC( WVW_CXDESTROY ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); CONTROL_DATA * pcd = pWindowData->pcdCtrlList; @@ -172,8 +172,8 @@ HB_FUNC( WVW_CXDESTROY ) { break; } - pcdPrev = pcd; - pcd = pcd->pNext; + pcdPrev = pcd; + pcd = pcd->pNext; } if( pcd == NULL ) @@ -206,10 +206,10 @@ HB_FUNC( WVW_CXDESTROY ) */ HB_FUNC( WVW_CXSETFOCUS ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - byte bStyle; - HWND hWndCX = FindControlHandle( usWinNum, WVW_CONTROL_CHECKBOX, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + byte bStyle; + HWND hWndCX = FindControlHandle( usWinNum, WVW_CONTROL_CHECKBOX, uiCtrlId, &bStyle ); if( hWndCX ) { @@ -230,12 +230,12 @@ HB_FUNC( WVW_CXSETFOCUS ) */ HB_FUNC( WVW_CXENABLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); - byte bStyle; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndCX = FindControlHandle( usWinNum, WVW_CONTROL_CHECKBOX, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); + byte bStyle; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndCX = FindControlHandle( usWinNum, WVW_CONTROL_CHECKBOX, uiCtrlId, &bStyle ); if( hWndCX ) { @@ -259,12 +259,12 @@ HB_FUNC( WVW_CXENABLE ) */ HB_FUNC( WVW_CXSETCODEBLOCK ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WVW_DATA * pData = hb_getWvwData(); - UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid ); - PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK ); - BOOL bOldSetting = pData->s_bRecurseCBlock; + UINT usWinNum = WVW_WHICH_WINDOW; + WVW_DATA * pData = hb_getWvwData(); + UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid ); + PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK ); + BOOL bOldSetting = pData->s_bRecurseCBlock; if( ! phiCodeBlock || pcd == NULL || pcd->bBusy ) { @@ -273,7 +273,7 @@ HB_FUNC( WVW_CXSETCODEBLOCK ) } pData->s_bRecurseCBlock = FALSE; - pcd->bBusy = TRUE; + pcd->bBusy = TRUE; if( pcd->phiCodeBlock ) { @@ -281,28 +281,28 @@ HB_FUNC( WVW_CXSETCODEBLOCK ) } - pcd->phiCodeBlock = hb_itemNew( phiCodeBlock ); + pcd->phiCodeBlock = hb_itemNew( phiCodeBlock ); - pcd->bBusy = FALSE; + pcd->bBusy = FALSE; pData->s_bRecurseCBlock = bOldSetting; hb_retl( TRUE ); } -/*WVW_CXsetcheck( [nWinNum], nCXid, nCheckState ) - *assigns check-state of checkbox nCXid +/* WVW_CXsetcheck( [nWinNum], nCXid, nCheckState ) + * assigns check-state of checkbox nCXid * 0==unchecked BST_UNCHECKED * 1==checked BST_CHECKED * 2==indeterminate BST_INDETERMINATE - **this function always returns .t. + * this function always returns .t. */ HB_FUNC( WVW_CXSETCHECK ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - ULONG ulCheck = ( ULONG ) ( HB_ISNIL( 3 ) ? BST_CHECKED : hb_parni( 3 ) ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid ); + UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + ULONG ulCheck = ( ULONG ) ( HB_ISNIL( 3 ) ? BST_CHECKED : hb_parni( 3 ) ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid ); if( pcd->hWndCtrl ) { @@ -321,11 +321,11 @@ HB_FUNC( WVW_CXSETCHECK ) */ HB_FUNC( WVW_CXGETCHECK ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - ULONG ulCheck = 0; - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid ); + UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + ULONG ulCheck = 0; + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid ); if( pcd->hWndCtrl ) { @@ -342,24 +342,24 @@ HB_FUNC( WVW_CXGETCHECK ) */ HB_FUNC( WVW_CXSETFONT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WVW_DATA * pData = hb_getWvwData(); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WVW_DATA * pData = hb_getWvwData(); - BOOL retval = TRUE; + BOOL retval = TRUE; - pData->s_lfCX.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); - pData->s_lfCX.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfCX.lfWidth : hb_parni( 4 ); - pData->s_lfCX.lfEscapement = 0; - pData->s_lfCX.lfOrientation = 0; - pData->s_lfCX.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfCX.lfWeight : hb_parni( 5 ); - pData->s_lfCX.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfCX.lfItalic : ( BYTE ) hb_parl( 7 ); - pData->s_lfCX.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfCX.lfUnderline : ( BYTE ) hb_parl( 8 ); - pData->s_lfCX.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfCX.lfStrikeOut : ( BYTE ) hb_parl( 9 ); - pData->s_lfCX.lfCharSet = DEFAULT_CHARSET; + pData->s_lfCX.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); + pData->s_lfCX.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfCX.lfWidth : hb_parni( 4 ); + pData->s_lfCX.lfEscapement = 0; + pData->s_lfCX.lfOrientation = 0; + pData->s_lfCX.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfCX.lfWeight : hb_parni( 5 ); + pData->s_lfCX.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfCX.lfItalic : ( BYTE ) hb_parl( 7 ); + pData->s_lfCX.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfCX.lfUnderline : ( BYTE ) hb_parl( 8 ); + pData->s_lfCX.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfCX.lfStrikeOut : ( BYTE ) hb_parl( 9 ); + pData->s_lfCX.lfCharSet = DEFAULT_CHARSET; - pData->s_lfCX.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfCX.lfQuality : ( BYTE ) hb_parni( 6 ); - pData->s_lfCX.lfPitchAndFamily = FF_DONTCARE; + pData->s_lfCX.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfCX.lfQuality : ( BYTE ) hb_parni( 6 ); + pData->s_lfCX.lfPitchAndFamily = FF_DONTCARE; if( HB_ISCHAR( 2 ) ) { strcpy( pData->s_lfCX.lfFaceName, hb_parcx( 2 ) ); @@ -400,12 +400,12 @@ HB_FUNC( WVW_CXSETFONT ) HB_FUNC( WVW_CXSTATUSFONT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - UINT uiPBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - BOOL bFocus = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_PUSHBUTTON, NULL, uiPBid ); + UINT uiPBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + BOOL bFocus = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_PUSHBUTTON, NULL, uiPBid ); if( pcd->hWndCtrl ) { @@ -433,80 +433,80 @@ HB_FUNC( WVW_CXSTATUSFONT ) /* PROGRESSBAR begins */ -/*WVW_PGcreate( [nWinNum], nTop, nLeft, nBottom, nRight, [aOffset], +/* WVW_PGcreate( [nWinNum], nTop, nLeft, nBottom, nRight, [aOffset], * [nBackColor], [nBarColor], [lSmooth], [lVertical]) - **create progress bar for window nWinNum - **nTop: row of top/left corner (in character unit) - **nLeft: col of top/left corner (in character unit) - **nBottom: row of bottom/right corner (in character unit) - **nRight: col of bottom/right corner (in character unit) - **aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust - * dimension of progress bar. defaults: {0, 0, 0, 0} - **nBackColor: color of background (as RGB value) - **nBarColor: color of bar (as RGB value) - **lSmooth: if .t., draw as smooth bar (default is .f.) - **lVertical: if .t., draw as vertical progress bar (default is .f.) + * create progress bar for window nWinNum + * nTop: row of top/left corner (in character unit) + * nLeft: col of top/left corner (in character unit) + * nBottom: row of bottom/right corner (in character unit) + * nRight: col of bottom/right corner (in character unit) + * aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust + * dimension of progress bar. defaults: {0, 0, 0, 0} + * nBackColor: color of background (as RGB value) + * nBarColor: color of bar (as RGB value) + * lSmooth: if .t., draw as smooth bar (default is .f.) + * lVertical: if .t., draw as vertical progress bar (default is .f.) * - **returns control id of newly created progress bar of windows nWinNum - **returns 0 if failed + * returns control id of newly created progress bar of windows nWinNum + * returns 0 if failed * - **example: - **WVW_PGcreate( , 5, 10, 5, 30) + * example: + * WVW_PGcreate( , 5, 10, 5, 30) * :: creates horiz progressbar on current window at (5,10) to (5,30) * colors using default ones. * - **WVW_PGcreate( , 5, 10, 5, 30, {-1, 0, +1, 0} ) + * WVW_PGcreate( , 5, 10, 5, 30, {-1, 0, +1, 0} ) * :: same as above, but the bar is enlarged 1 pixel to the top * and 1 pixel to the bottom * - **NOTES: - **ProgressRange is initially set as 0 - 100. - **Initial ProgressPos is 0 + * NOTES: + * ProgressRange is initially set as 0 - 100. + * Initial ProgressPos is 0 */ HB_FUNC( WVW_PGCREATE ) { - HANDLE hInstance = NULL; - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndParent = pWindowData->hWnd; - HWND hWndPG; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - int iStyle = 0; - BOOL bBackColor = ! HB_ISNIL( 7 ); - BOOL bBarColor = ! HB_ISNIL( 8 ); - BOOL bSmooth = ( ! HB_ISLOG( 9 ) ? FALSE : hb_parl( 9 ) ); - BOOL bVertical = ( ! HB_ISLOG( 10 ) ? FALSE : hb_parl( 10 ) ); - UINT uiPGid; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + HANDLE hInstance = NULL; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndParent = pWindowData->hWnd; + HWND hWndPG; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + int iStyle = 0; + BOOL bBackColor = ! HB_ISNIL( 7 ); + BOOL bBarColor = ! HB_ISNIL( 8 ); + BOOL bSmooth = ( ! HB_ISLOG( 9 ) ? FALSE : hb_parl( 9 ) ); + BOOL bVertical = ( ! HB_ISLOG( 10 ) ? FALSE : hb_parl( 10 ) ); + UINT uiPGid; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); InitCommonControls(); - iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; - iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; + iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; + iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + iOffBottom; - iRight = xy.x - 1 + iOffRight; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy.y -= pWindowData->byLineSpacing; + iBottom = xy.y - 1 + iOffBottom; + iRight = xy.x - 1 + iOffRight; - uiPGid = LastControlId( usWinNum, WVW_CONTROL_PROGRESSBAR ); + uiPGid = LastControlId( usWinNum, WVW_CONTROL_PROGRESSBAR ); if( uiPGid == 0 ) { uiPGid = WVW_ID_BASE_PROGRESSBAR; @@ -560,10 +560,10 @@ HB_FUNC( WVW_PGCREATE ) SendMessage( hWndPG, PBM_SETRANGE, 0, MAKELPARAM( 0, 100 ) ); SendMessage( hWndPG, PBM_SETPOS, ( WPARAM ) 0, 0 ); - rXB.top = usTop; rXB.left = usLeft; - rXB.bottom = usBottom; rXB.right = usRight; - rOffXB.top = iOffTop; rOffXB.left = iOffLeft; - rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; + rXB.top = usTop; rXB.left = usLeft; + rXB.bottom = usBottom; rXB.right = usRight; + rOffXB.top = iOffTop; rOffXB.left = iOffLeft; + rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; AddControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, hWndPG, uiPGid, ( PHB_ITEM ) NULL, rXB, rOffXB, ( byte ) iStyle ); @@ -582,7 +582,7 @@ HB_FUNC( WVW_PGCREATE ) */ HB_FUNC( WVW_PGDESTROY ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); CONTROL_DATA * pcd = pWindowData->pcdCtrlList; @@ -595,8 +595,8 @@ HB_FUNC( WVW_PGDESTROY ) break; } - pcdPrev = pcd; - pcd = pcd->pNext; + pcdPrev = pcd; + pcd = pcd->pNext; } if( pcd == NULL ) { @@ -623,24 +623,24 @@ HB_FUNC( WVW_PGDESTROY ) hb_xfree( pcd ); } -/*WVW_PGsetrange(nWinNum, PGid, [nMin], [nMax]) - *update progressbar data range (default is 0-100) - *nMin: a number in range of -32767 to +32767 - *nMax: a number in range of -32767 to +32767 +/* WVW_PGsetrange(nWinNum, PGid, [nMin], [nMax]) + * update progressbar data range (default is 0-100) + * nMin: a number in range of -32767 to +32767 + * nMax: a number in range of -32767 to +32767 * - **Remark: progress position is reset to nMin + * Remark: progress position is reset to nMin * - **returns .t. if operation considered successfull + * returns .t. if operation considered successfull */ HB_FUNC( WVW_PGSETRANGE ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - byte bStyle; - HWND hWndPG = FindControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle ); - int iMin = ( int ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); - int iMax = ( int ) ( HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ) ); + UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + byte bStyle; + HWND hWndPG = FindControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle ); + int iMin = ( int ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); + int iMax = ( int ) ( HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ) ); if( uiPGid == 0 || hWndPG == NULL || ( iMin > iMax ) ) { @@ -661,13 +661,13 @@ HB_FUNC( WVW_PGSETRANGE ) */ HB_FUNC( WVW_PGSETPOS ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - byte bStyle; - HWND hWndPG = FindControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle ); - int iPos = ( int ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); - PBRANGE pbrange; + UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + byte bStyle; + HWND hWndPG = FindControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle ); + int iPos = ( int ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); + PBRANGE pbrange; if( uiPGid == 0 || hWndPG == NULL ) { @@ -694,11 +694,11 @@ HB_FUNC( WVW_PGSETPOS ) */ HB_FUNC( WVW_PGGETPOS ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - byte bStyle; - HWND hWndPG = FindControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle ); + UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + byte bStyle; + HWND hWndPG = FindControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle ); if( uiPGid == 0 || hWndPG == NULL ) { @@ -712,4 +712,3 @@ HB_FUNC( WVW_PGGETPOS ) /* PROGRESSBAR ends */ - diff --git a/harbour/extras/gtwvw/wvwdraw.c b/harbour/extras/gtwvw/wvwdraw.c index 2b5244c2ea..ae84e89813 100644 --- a/harbour/extras/gtwvw/wvwdraw.c +++ b/harbour/extras/gtwvw/wvwdraw.c @@ -104,69 +104,69 @@ static COLORREF _COLORS[] = { HB_FUNC( WVW_DRAWLABELOBJ ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight, x, y; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - RECT rect = { 0 }; - HFONT oldFont; - int oldTextAlign, iAlignHorz, iAlignVert, iAlignH = 0, iAlignV; - COLORREF oldBkColor, oldTextColor; - UINT uiOptions; - SIZE sz = { 0 }; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight, x, y; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + RECT rect = { 0 }; + HFONT oldFont; + int oldTextAlign, iAlignHorz, iAlignVert, iAlignH = 0, iAlignV; + COLORREF oldBkColor, oldTextColor; + UINT uiOptions; + SIZE sz = { 0 }; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); - iOffTop = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 3 ) : 0; - iOffRight = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 4 ) : 0; + iOffTop = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 3 ) : 0; + iOffRight = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + 1 + iOffBottom; - iRight = xy.x - 1 + 1 + iOffRight; + iBottom = xy.y - 1 + 1 + iOffBottom; + iRight = xy.x - 1 + 1 + iOffRight; - iAlignHorz = ( HB_ISNIL( 7 ) ? 0 : hb_parni( 7 ) ); - iAlignVert = ( HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ) ); + iAlignHorz = ( HB_ISNIL( 7 ) ? 0 : hb_parni( 7 ) ); + iAlignVert = ( HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ) ); - oldTextColor = SetTextColor( pWindowData->hdc, HB_ISNIL( 9 ) ? pWindowData->foreground : ( COLORREF ) hb_parnl( 9 ) ); - oldBkColor = SetBkColor( pWindowData->hdc, HB_ISNIL( 10 ) ? pWindowData->background : ( COLORREF ) hb_parnl( 10 ) ); - oldFont = ( HFONT ) SelectObject( pWindowData->hdc, ( HFONT ) HB_PARHANDLE( 11 ) ); + oldTextColor = SetTextColor( pWindowData->hdc, HB_ISNIL( 9 ) ? pWindowData->foreground : ( COLORREF ) hb_parnl( 9 ) ); + oldBkColor = SetBkColor( pWindowData->hdc, HB_ISNIL( 10 ) ? pWindowData->background : ( COLORREF ) hb_parnl( 10 ) ); + oldFont = ( HFONT ) SelectObject( pWindowData->hdc, ( HFONT ) HB_PARHANDLE( 11 ) ); GetTextExtentPoint32( pWindowData->hdc, hb_parcx( 6 ), strlen( hb_parcx( 6 ) ), &sz ); - x = iLeft; - y = iTop; + x = iLeft; + y = iTop; switch( iAlignHorz ) { case 0: - iAlignH = TA_LEFT; + iAlignH = TA_LEFT; break; case 1: - iAlignH = TA_RIGHT; - x = iRight; + iAlignH = TA_RIGHT; + x = iRight; break; case 2: - iAlignH = TA_CENTER; - x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); + iAlignH = TA_CENTER; + x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); break; } @@ -175,21 +175,21 @@ HB_FUNC( WVW_DRAWLABELOBJ ) switch( iAlignVert ) { case 1: - y = iBottom - sz.cy; + y = iBottom - sz.cy; break; case 2: - y = iTop + ( ( iBottom - iTop + 1 - sz.cy ) / 2 ); + y = iTop + ( ( iBottom - iTop + 1 - sz.cy ) / 2 ); break; } - oldTextAlign = SetTextAlign( pWindowData->hdc, iAlignH | iAlignV ); + oldTextAlign = SetTextAlign( pWindowData->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( pWindowData->hdc, x, y, uiOptions, &rect, hb_parcx( 6 ), strlen( hb_parcx( 6 ) ), NULL ); @@ -208,34 +208,34 @@ HB_FUNC( WVW_DRAWLABELOBJ ) /* */ HB_FUNC( WVW_DRAWTOOLBUTTONSTATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iState = hb_parni( 7 ); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iState = hb_parni( 7 ); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + hb_parvni( 6, 1 ); - iLeft = xy.x + hb_parvni( 6, 2 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + hb_parvni( 6, 1 ); + iLeft = xy.x + hb_parvni( 6, 2 ); - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + hb_parvni( 6, 3 ); - iRight = xy.x - 1 + hb_parvni( 6, 4 ); + iBottom = xy.y - 1 + hb_parvni( 6, 3 ); + iRight = xy.x - 1 + hb_parvni( 6, 4 ); switch( iState ) { @@ -302,40 +302,40 @@ HB_FUNC( WVW_DRAWTOOLBUTTONSTATE ) /* NOTE: with WVW_XB (scrollbar) this function does not seem to be usefull */ HB_FUNC( WVW_DRAWSCROLLBUTTON ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - int iTop, iLeft, iBottom, iRight; - POINT * Point; - POINT xy = { 0 }; - int iHeight, iOff; - BOOL bDepressed = HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + int iTop, iLeft, iBottom, iRight; + POINT * Point; + POINT xy = { 0 }; + int iHeight, iOff; + BOOL bDepressed = HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + hb_parvni( 6, 1 ); - iLeft = xy.x + hb_parvni( 6, 2 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + hb_parvni( 6, 1 ); + iLeft = xy.x + hb_parvni( 6, 2 ); - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + hb_parvni( 6, 3 ); - iRight = xy.x - 1 + hb_parvni( 6, 4 ); + iBottom = xy.y - 1 + hb_parvni( 6, 3 ); + iRight = xy.x - 1 + hb_parvni( 6, 4 ); - Point = ( POINT * ) hb_xgrab( 3 * sizeof( POINT ) ); - iOff = 6; + Point = ( POINT * ) hb_xgrab( 3 * sizeof( POINT ) ); + iOff = 6; - iHeight = iBottom - iTop + 1; + iHeight = iBottom - iTop + 1; if( bDepressed ) { @@ -350,47 +350,47 @@ HB_FUNC( WVW_DRAWSCROLLBUTTON ) switch( hb_parni( 7 ) ) { case 1: - 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; + 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: - 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; + 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: - 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; + 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: - 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; + 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; } @@ -406,19 +406,19 @@ HB_FUNC( WVW_DRAWSCROLLBUTTON ) /* NOTE: with WVW_XB (scrollbar) this function does not seem to be usefull */ HB_FUNC( WVW_DRAWSCROLLTHUMBVERT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iTabTop, iTabLft, iTabBtm, iTabRgt; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iTabTop, iTabLft, iTabBtm, iTabRgt; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); - USHORT usTabTop = ( USHORT ) hb_parni( 7 ); + USHORT usTabTop = ( USHORT ) hb_parni( 7 ); if( hb_gt_wvw_GetMainCoordMode() ) { @@ -426,16 +426,16 @@ HB_FUNC( WVW_DRAWSCROLLTHUMBVERT ) hb_wvw_HBFUNCPrologue( usWinNum, &usTabTop, NULL, NULL, NULL ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + hb_parvni( 6, 1 ); - iLeft = xy.x + hb_parvni( 6, 2 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + hb_parvni( 6, 1 ); + iLeft = xy.x + hb_parvni( 6, 2 ); - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + hb_parvni( 6, 3 ); - iRight = xy.x - 1 + hb_parvni( 6, 4 ); + iBottom = xy.y - 1 + hb_parvni( 6, 3 ); + iRight = xy.x - 1 + hb_parvni( 6, 4 ); SetBkColor( pWindowData->hdc, RGB( 230, 230, 230 ) ); SelectObject( pWindowData->hdc, s_sApp->diagonalBrush ); @@ -443,12 +443,12 @@ HB_FUNC( WVW_DRAWSCROLLTHUMBVERT ) SelectObject( pWindowData->hdc, s_sApp->penNull ); Rectangle( pWindowData->hdc, iLeft, iTop, iRight + 1, iBottom + 1 ); - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft /* dummy */, usTabTop ); - iTabTop = xy.y; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft /* dummy */, usTabTop ); + iTabTop = xy.y; - iTabLft = iLeft; - iTabBtm = iTabTop + pWindowData->PTEXTSIZE.y - 1; - iTabRgt = iRight; + iTabLft = iLeft; + iTabBtm = iTabTop + pWindowData->PTEXTSIZE.y - 1; + iTabRgt = iRight; SelectObject( pWindowData->hdc, s_sApp->wvwWhiteBrush ); SelectObject( pWindowData->hdc, s_sApp->penGray ); @@ -464,18 +464,18 @@ HB_FUNC( WVW_DRAWSCROLLTHUMBVERT ) /* NOTE: with WVW_XB (scrollbar) this function does not seem to be usefull */ HB_FUNC( WVW_DRAWSCROLLTHUMBHORZ ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - POINT xy = { 0 }; - int iThumbLeft, iThumbRight; - int iTop, iLeft, iBottom, iRight; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + POINT xy = { 0 }; + int iThumbLeft, iThumbRight; + int iTop, iLeft, iBottom, iRight; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - USHORT usThumbLeft = ( USHORT ) hb_parni( 7 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + USHORT usThumbLeft = ( USHORT ) hb_parni( 7 ); if( hb_gt_wvw_GetMainCoordMode() ) { @@ -483,19 +483,19 @@ HB_FUNC( WVW_DRAWSCROLLTHUMBHORZ ) hb_wvw_HBFUNCPrologue( usWinNum, NULL, &usThumbLeft, NULL, NULL ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + hb_parvni( 6, 1 ); - iLeft = xy.x + hb_parvni( 6, 2 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + hb_parvni( 6, 1 ); + iLeft = xy.x + hb_parvni( 6, 2 ); - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + hb_parvni( 6, 3 ); - iRight = xy.x - 1 + hb_parvni( 6, 4 ); + iBottom = xy.y - 1 + hb_parvni( 6, 3 ); + iRight = xy.x - 1 + hb_parvni( 6, 4 ); - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usThumbLeft, usTop /* dummy */ ); - iThumbLeft = xy.x; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usThumbLeft, usTop /* dummy */ ); + iThumbLeft = xy.x; iThumbRight = iThumbLeft + ( pWindowData->PTEXTSIZE.x * 2 ) - 1; @@ -516,15 +516,15 @@ HB_FUNC( WVW_DRAWSCROLLTHUMBHORZ ) /* */ HB_FUNC( WVW_DRAWSHADEDRECT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - BOOL bGF = FALSE; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + BOOL bGF = FALSE; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); if( hb_gt_wvw_GetMainCoordMode() ) { @@ -533,42 +533,42 @@ HB_FUNC( WVW_DRAWSHADEDRECT ) if( s_sApp->hMSImg32 ) { - TRIVERTEX vert[ 2 ]; - GRADIENT_RECT gRect = { 0 }; + TRIVERTEX vert[ 2 ]; + GRADIENT_RECT gRect = { 0 }; - int iMode = HB_ISNIL( 7 ) ? GRADIENT_FILL_RECT_H : hb_parni( 7 ); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; + int iMode = HB_ISNIL( 7 ) ? GRADIENT_FILL_RECT_H : hb_parni( 7 ); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + hb_parvni( 6, 1 ); - iLeft = xy.x + hb_parvni( 6, 2 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + hb_parvni( 6, 1 ); + iLeft = xy.x + hb_parvni( 6, 2 ); - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + hb_parvni( 6, 3 ); - iRight = xy.x - 1 + hb_parvni( 6, 4 ); + iBottom = xy.y - 1 + hb_parvni( 6, 3 ); + iRight = xy.x - 1 + hb_parvni( 6, 4 ); - vert[ 0 ].x = iLeft; - vert[ 0 ].y = iTop; - vert[ 0 ].Red = ( COLOR16 ) hb_parvni( 8, 1 ); - vert[ 0 ].Green = ( COLOR16 ) hb_parvni( 8, 2 ); - vert[ 0 ].Blue = ( COLOR16 ) hb_parvni( 8, 3 ); - vert[ 0 ].Alpha = ( COLOR16 ) hb_parvni( 8, 4 ); + vert[ 0 ].x = iLeft; + vert[ 0 ].y = iTop; + vert[ 0 ].Red = ( COLOR16 ) hb_parvni( 8, 1 ); + vert[ 0 ].Green = ( COLOR16 ) hb_parvni( 8, 2 ); + vert[ 0 ].Blue = ( COLOR16 ) hb_parvni( 8, 3 ); + vert[ 0 ].Alpha = ( COLOR16 ) hb_parvni( 8, 4 ); - vert[ 1 ].x = iRight; - vert[ 1 ].y = iBottom; - vert[ 1 ].Red = ( COLOR16 ) hb_parvni( 9, 1 ); - vert[ 1 ].Green = ( COLOR16 ) hb_parvni( 9, 2 ); - vert[ 1 ].Blue = ( COLOR16 ) hb_parvni( 9, 3 ); - vert[ 1 ].Alpha = ( COLOR16 ) hb_parvni( 9, 4 ); + vert[ 1 ].x = iRight; + vert[ 1 ].y = iBottom; + vert[ 1 ].Red = ( COLOR16 ) hb_parvni( 9, 1 ); + vert[ 1 ].Green = ( COLOR16 ) hb_parvni( 9, 2 ); + vert[ 1 ].Blue = ( COLOR16 ) hb_parvni( 9, 3 ); + vert[ 1 ].Alpha = ( COLOR16 ) hb_parvni( 9, 4 ); - gRect.UpperLeft = 0; - gRect.LowerRight = 1; + gRect.UpperLeft = 0; + gRect.LowerRight = 1; - bGF = ( BOOL ) s_sApp->pfnGF( pWindowData->hdc, vert, 2, &gRect, 1, iMode ); + bGF = ( BOOL ) s_sApp->pfnGF( pWindowData->hdc, vert, 2, &gRect, 1, iMode ); } hb_retl( bGF ); } @@ -581,64 +581,64 @@ HB_FUNC( WVW_DRAWSHADEDRECT ) /* */ HB_FUNC( WVW_DRAWTEXTBOX ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; - int iAlignHorz = ( HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ) ); + int iAlignHorz = ( HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ) ); - int iAlignH = 0; + int iAlignH = 0; - COLORREF oldTextColor, oldBkColor; - HFONT oldFont; - int oldTextAlign, oldBkMode; - RECT rc = { 0 }; + COLORREF oldTextColor, oldBkColor; + HFONT oldFont; + int oldTextAlign, oldBkMode; + RECT rc = { 0 }; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + hb_parvni( 6, 1 ); - iLeft = xy.x + hb_parvni( 6, 2 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + hb_parvni( 6, 1 ); + iLeft = xy.x + hb_parvni( 6, 2 ); - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + hb_parvni( 6, 3 ); - iRight = xy.x - 1 + hb_parvni( 6, 4 ); + iBottom = xy.y - 1 + hb_parvni( 6, 3 ); + iRight = xy.x - 1 + hb_parvni( 6, 4 ); switch( iAlignHorz ) { case 0: - iAlignH = DT_LEFT; + iAlignH = DT_LEFT; break; case 1: - iAlignH = DT_RIGHT; + iAlignH = DT_RIGHT; break; case 2: - iAlignH = DT_CENTER; + 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; - oldTextAlign = SetTextAlign( pWindowData->hdc, TA_TOP | TA_LEFT | TA_NOUPDATECP ); - oldTextColor = SetTextColor( pWindowData->hdc, HB_ISNIL( 10 ) ? pWindowData->foreground : ( COLORREF ) hb_parnl( 10 ) ); - oldBkColor = SetBkColor( pWindowData->hdc, HB_ISNIL( 11 ) ? pWindowData->background : ( COLORREF ) hb_parnl( 11 ) ); - oldBkMode = SetBkMode( pWindowData->hdc, HB_ISNIL( 12 ) ? OPAQUE : hb_parni( 12 ) ); - oldFont = ( HFONT ) SelectObject( pWindowData->hdc, ( HFONT ) HB_PARHANDLE( 13 ) ); + oldTextAlign = SetTextAlign( pWindowData->hdc, TA_TOP | TA_LEFT | TA_NOUPDATECP ); + oldTextColor = SetTextColor( pWindowData->hdc, HB_ISNIL( 10 ) ? pWindowData->foreground : ( COLORREF ) hb_parnl( 10 ) ); + oldBkColor = SetBkColor( pWindowData->hdc, HB_ISNIL( 11 ) ? pWindowData->background : ( COLORREF ) hb_parnl( 11 ) ); + oldBkMode = SetBkMode( pWindowData->hdc, HB_ISNIL( 12 ) ? OPAQUE : hb_parni( 12 ) ); + oldFont = ( HFONT ) SelectObject( pWindowData->hdc, ( HFONT ) HB_PARHANDLE( 13 ) ); DrawText( pWindowData->hdc, hb_parcx( 7 ), strlen( hb_parcx( 7 ) ), &rc, iAlignH | DT_WORDBREAK | DT_TOP ); @@ -656,20 +656,20 @@ HB_FUNC( WVW_DRAWTEXTBOX ) */ HB_FUNC( WVW_DRAWPROGRESSBAR ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WIN_DATA * pWinMainData = hb_gt_wvw_GetWindowsData( 0 ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - int iTop; - int iLeft; - int iBottom; - int iRight; - int iPercent, iBarUpto, iDirection; - BOOL bVertical, bImage; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WIN_DATA * pWinMainData = hb_gt_wvw_GetWindowsData( 0 ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + int iTop; + int iLeft; + int iBottom; + int iRight; + int iPercent, iBarUpto, iDirection; + BOOL bVertical, bImage; COLORREF crBarColor; HBRUSH hBrush; @@ -682,58 +682,58 @@ HB_FUNC( WVW_DRAWPROGRESSBAR ) hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + hb_parvni( 6, 1 ); - iLeft = xy.x + hb_parvni( 6, 2 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + hb_parvni( 6, 1 ); + iLeft = xy.x + hb_parvni( 6, 2 ); - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + hb_parvni( 6, 3 ); - iRight = xy.x - 1 + hb_parvni( 6, 4 ); + iBottom = xy.y - 1 + hb_parvni( 6, 3 ); + iRight = xy.x - 1 + hb_parvni( 6, 4 ); - iPercent = hb_parni( 7 ); - bImage = HB_ISNIL( 10 ) ? FALSE : TRUE; - bVertical = HB_ISNIL( 11 ) ? FALSE : hb_parl( 11 ); - iDirection = HB_ISNIL( 12 ) ? 0 : hb_parni( 12 ); + iPercent = hb_parni( 7 ); + bImage = HB_ISNIL( 10 ) ? FALSE : TRUE; + bVertical = HB_ISNIL( 11 ) ? FALSE : hb_parl( 11 ); + iDirection = HB_ISNIL( 12 ) ? 0 : hb_parni( 12 ); 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; } } @@ -745,13 +745,13 @@ HB_FUNC( WVW_DRAWPROGRESSBAR ) else { - crBarColor = HB_ISNIL( 9 ) ? hb_gt_wvwGetColorData( 0 ) : ( COLORREF ) hb_parnl( 9 ); + crBarColor = HB_ISNIL( 9 ) ? hb_gt_wvwGetColorData( 0 ) : ( COLORREF ) hb_parnl( 9 ); - lb.lbStyle = BS_SOLID; - lb.lbColor = crBarColor; - lb.lbHatch = 0; + lb.lbStyle = BS_SOLID; + lb.lbColor = crBarColor; + lb.lbHatch = 0; - hBrush = CreateBrushIndirect( &lb ); + hBrush = CreateBrushIndirect( &lb ); rc.bottom++; rc.right++; @@ -768,48 +768,48 @@ HB_FUNC( WVW_DRAWPROGRESSBAR ) * Wvw_DrawBoxGet( [nWinNum], nRow, nCol, nWidth,; * aOffset ) <-- additional parm, not exist in GTWVT * - **NOTES: unlike GTWVT, GTWVW draw white lines on outer right and outer bottom + * NOTES: unlike GTWVT, GTWVW draw white lines on outer right and outer bottom * Besides, scope is the same as DRAWBOXRECESSED, ie. * two pixel out of char boundary */ HB_FUNC( WVW_DRAWBOXGET ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - POINT yz = { 0 }; - WIN_DATA * pWindowData; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - USHORT usRow, usCol, usLen; + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + POINT yz = { 0 }; + WIN_DATA * pWindowData; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + USHORT usRow, usCol, usLen; pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - usRow = ( USHORT ) hb_parni( 2 ); - usCol = ( USHORT ) hb_parni( 3 ); - usLen = ( USHORT ) hb_parni( 4 ); + usRow = ( USHORT ) hb_parni( 2 ); + usCol = ( USHORT ) hb_parni( 3 ); + usLen = ( USHORT ) hb_parni( 4 ); - iOffTop = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 3 ) : 0; - iOffRight = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 4 ) : 0; + iOffTop = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 3 ) : 0; + iOffRight = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usRow, &usCol, NULL, NULL ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usCol, usRow ); - iTop = xy.y - 1 + iOffTop; - iLeft = xy.x - 1 + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usCol, usRow ); + iTop = xy.y - 1 + iOffTop; + iLeft = xy.x - 1 + iOffLeft; - yz = hb_gt_wvwGetXYFromColRow( pWindowData, usCol + usLen, usRow + 1 ); + yz = hb_gt_wvwGetXYFromColRow( pWindowData, usCol + usLen, usRow + 1 ); - yz.y -= pWindowData->byLineSpacing; + yz.y -= pWindowData->byLineSpacing; - iBottom = yz.y + iOffBottom; - iRight = yz.x + iOffRight; + iBottom = yz.y + iOffBottom; + iRight = yz.x + iOffRight; SelectObject( pWindowData->hdc, s_sApp->penBlack ); @@ -854,48 +854,48 @@ HB_FUNC( WVW_DRAWBOXGET ) * Wvw_DrawBoxGet_XP( [nWinNum], nRow, nCol, nWidth,; * aOffset ) <-- additional parm, not exist in GTWVT * - **NOTES: unlike GTWVT, GTWVW draw white lines on outer right and outer bottom + * NOTES: unlike GTWVT, GTWVW draw white lines on outer right and outer bottom * Besides, scope is the same as DRAWBOXRECESSED, ie. * two pixel out of char boundary */ HB_FUNC( WVW_DRAWBOXGET_XP ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - POINT yz = { 0 }; - WIN_DATA * pWindowData; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - USHORT usRow, usCol, usLen; + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + POINT yz = { 0 }; + WIN_DATA * pWindowData; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + USHORT usRow, usCol, usLen; pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - usRow = ( USHORT ) hb_parni( 2 ); - usCol = ( USHORT ) hb_parni( 3 ); - usLen = ( USHORT ) hb_parni( 4 ); + usRow = ( USHORT ) hb_parni( 2 ); + usCol = ( USHORT ) hb_parni( 3 ); + usLen = ( USHORT ) hb_parni( 4 ); - iOffTop = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 3 ) : 0; - iOffRight = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 4 ) : 0; + iOffTop = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 3 ) : 0; + iOffRight = ! HB_ISNIL( 5 ) ? hb_parvni( 5, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usRow, &usCol, NULL, NULL ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usCol, usRow ); - iTop = xy.y - 1 + iOffTop; - iLeft = xy.x - 1 + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usCol, usRow ); + iTop = xy.y - 1 + iOffTop; + iLeft = xy.x - 1 + iOffLeft; - yz = hb_gt_wvwGetXYFromColRow( pWindowData, usCol + usLen, usRow + 1 ); + yz = hb_gt_wvwGetXYFromColRow( pWindowData, usCol + usLen, usRow + 1 ); - yz.y -= pWindowData->byLineSpacing; + yz.y -= pWindowData->byLineSpacing; - iBottom = yz.y + iOffBottom; - iRight = yz.x + iOffRight; + iBottom = yz.y + iOffBottom; + iRight = yz.x + iOffRight; SelectObject( pWindowData->hdc, s_sApp->penGray ); @@ -933,18 +933,18 @@ HB_FUNC( WVW_DRAWBOXGET_XP ) HB_FUNC( WVW_DRAWBOXRAISED ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - WIN_DATA * pWindowData; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - BOOL bUseArray = HB_ISARRAY( 6 ); + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + WIN_DATA * pWindowData; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + BOOL bUseArray = HB_ISARRAY( 6 ); - BOOL bTight = ( bUseArray || HB_ISNIL( 6 ) ? FALSE : hb_parl( 6 ) ); - int iOLeft, iOTop, iORight, iOBottom; + BOOL bTight = ( bUseArray || HB_ISNIL( 6 ) ? FALSE : hb_parl( 6 ) ); + int iOLeft, iOTop, iORight, iOBottom; pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); @@ -978,16 +978,16 @@ HB_FUNC( WVW_DRAWBOXRAISED ) iORight = 0; } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOTop; - iLeft = xy.x + iOLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOTop; + iLeft = xy.x + iOLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y + iOBottom; - iRight = xy.x + iORight; + iBottom = xy.y + iOBottom; + iRight = xy.x + iORight; hb_gt_wvwDrawBoxRaised( pWindowData->byWinId, iTop, iLeft, iBottom, iRight, bTight ); @@ -1013,18 +1013,18 @@ HB_FUNC( WVW_DRAWBOXRAISED ) HB_FUNC( WVW_DRAWBOXRECESSED ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - WIN_DATA * pWindowData; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - BOOL bUseArray = HB_ISARRAY( 6 ); + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + WIN_DATA * pWindowData; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + BOOL bUseArray = HB_ISARRAY( 6 ); - BOOL bTight = ( bUseArray || HB_ISNIL( 6 ) ? FALSE : hb_parl( 6 ) ); - int iOLeft, iOTop, iORight, iOBottom; + BOOL bTight = ( bUseArray || HB_ISNIL( 6 ) ? FALSE : hb_parl( 6 ) ); + int iOLeft, iOTop, iORight, iOBottom; pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); if( hb_gt_wvw_GetMainCoordMode() ) @@ -1057,16 +1057,16 @@ HB_FUNC( WVW_DRAWBOXRECESSED ) iORight = 0; } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOTop; - iLeft = xy.x + iOLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOTop; + iLeft = xy.x + iOLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y + iOBottom; - iRight = xy.x + iORight; + iBottom = xy.y + iOBottom; + iRight = xy.x + iORight; hb_gt_wvwDrawBoxRecessed( pWindowData->byWinId, iTop, iLeft, iBottom, iRight, bTight ); @@ -1085,39 +1085,39 @@ HB_FUNC( WVW_DRAWBOXRECESSED ) HB_FUNC( WVW_DRAWBOXGROUP ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - WIN_DATA * pWindowData; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + WIN_DATA * pWindowData; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; - iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; + iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; + iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y - 1 + iOffTop; - iLeft = xy.x - 1 + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y - 1 + iOffTop; + iLeft = xy.x - 1 + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y + iOffBottom; - iRight = xy.x + iOffRight; + iBottom = xy.y + iOffBottom; + iRight = xy.x + iOffRight; SelectObject( pWindowData->hdc, s_sApp->penDarkGray ); @@ -1158,15 +1158,15 @@ HB_FUNC( WVW_DRAWBOXGROUP ) HB_FUNC( WVW_DRAWBOXGROUPRAISED ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - WIN_DATA * pWindowData; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + WIN_DATA * pWindowData; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); @@ -1175,16 +1175,16 @@ HB_FUNC( WVW_DRAWBOXGROUPRAISED ) hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y - 1; - iLeft = xy.x - 1; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y - 1; + iLeft = xy.x - 1; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y; - iRight = xy.x; + iBottom = xy.y; + iRight = xy.x; SelectObject( pWindowData->hdc, s_sApp->penWhite ); @@ -1241,26 +1241,26 @@ HB_FUNC( WVW_DRAWBOXGROUPRAISED ) HB_FUNC( WVW_DRAWIMAGE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - POINT xy = { 0 }; - int iLeft, iTop, iRight = 0, iBottom = 0; - WIN_DATA * pWindowData; + UINT usWinNum = WVW_WHICH_WINDOW; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + POINT xy = { 0 }; + int iLeft, iTop, iRight = 0, iBottom = 0; + WIN_DATA * pWindowData; - BOOL bActBottom = HB_ISNIL( 4 ), - bActRight = HB_ISNIL( 5 ); - int iImgWidth = 0, iImgHeight = 0; + BOOL bActBottom = HB_ISNIL( 4 ), + bActRight = HB_ISNIL( 5 ); + int iImgWidth = 0, iImgHeight = 0; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); - BOOL bTight = ( HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) ); - BOOL bUseArray = HB_ISARRAY( 7 ); - BOOL bTransparent = ( HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ) ); - int iOLeft, iOTop, iORight, iOBottom; - BOOL bResult; + BOOL bTight = ( HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) ); + BOOL bUseArray = HB_ISARRAY( 7 ); + BOOL bTransparent = ( HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ) ); + int iOLeft, iOTop, iORight, iOBottom; + BOOL bResult; pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); @@ -1301,23 +1301,23 @@ HB_FUNC( WVW_DRAWIMAGE ) ) { - bActRight = FALSE; - bActBottom = FALSE; + bActRight = FALSE; + bActBottom = FALSE; } else { if( bActRight && bActBottom ) { - iRight = iLeft + iImgWidth - 1; - iBottom = iTop + iImgHeight - 1; + iRight = iLeft + iImgWidth - 1; + iBottom = iTop + iImgHeight - 1; } } } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; if( ! bActBottom ) { @@ -1391,27 +1391,27 @@ HB_FUNC( WVW_DRAWIMAGE ) HB_FUNC( WVW_DRAWIMAGE_RESOURCE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - int iLeft, iTop, iRight = 0, iBottom = 0; - WIN_DATA * pWindowData; + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + int iLeft, iTop, iRight = 0, iBottom = 0; + WIN_DATA * pWindowData; - BOOL bActBottom = HB_ISNIL( 4 ), - bActRight = HB_ISNIL( 5 ); - int iImgWidth, iImgHeight; - LONG lImgWidth, lImgHeight; + BOOL bActBottom = HB_ISNIL( 4 ), + bActRight = HB_ISNIL( 5 ); + int iImgWidth, iImgHeight; + LONG lImgWidth, lImgHeight; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); - BOOL bTight = ( HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) ); - BOOL bUseArray = HB_ISARRAY( 7 ); - BOOL bTransparent = ( HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ) ); - int iOLeft, iOTop, iORight, iOBottom; - BOOL bResult = FALSE; - IPicture * pPic; + BOOL bTight = ( HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) ); + BOOL bUseArray = HB_ISARRAY( 7 ); + BOOL bTransparent = ( HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ) ); + int iOLeft, iOTop, iORight, iOBottom; + BOOL bResult = FALSE; + IPicture * pPic; pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); if( hb_gt_wvw_GetMainCoordMode() ) @@ -1438,13 +1438,13 @@ HB_FUNC( WVW_DRAWIMAGE_RESOURCE ) iOTop = iOLeft = iOBottom = iORight = 0; } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOTop; - iLeft = xy.x + iOLeft; - lImgWidth = 0; - lImgHeight = 0; - iImgWidth = 0; - iImgHeight = 0; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOTop; + iLeft = xy.x + iOLeft; + lImgWidth = 0; + lImgHeight = 0; + iImgWidth = 0; + iImgHeight = 0; if( ! HB_ISNUM( 6 ) ) { @@ -1469,23 +1469,23 @@ HB_FUNC( WVW_DRAWIMAGE_RESOURCE ) if( ! GetIPictDimension( pPic, &iImgWidth, &iImgHeight ) ) { - bActRight = FALSE; - bActBottom = FALSE; + bActRight = FALSE; + bActBottom = FALSE; } else { if( bActRight && bActBottom ) { - iRight = iLeft + iImgWidth; - iBottom = iTop + iImgHeight; + iRight = iLeft + iImgWidth; + iBottom = iTop + iImgHeight; } } } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; if( ! bActBottom ) { @@ -1536,15 +1536,15 @@ HB_FUNC( WVW_DRAWIMAGE_RESOURCE ) HB_FUNC( WVW_DRAWLABEL ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - HFONT hFont, oldFont; - LOGFONT logfont = { 0 }; - int oldTextAlign; - COLORREF oldBkColor, oldTextColor; - WIN_DATA * pWindowData; - USHORT usRow = ( USHORT ) hb_parni( 2 ), - usCol = ( USHORT ) hb_parni( 3 ); + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + HFONT hFont, oldFont; + LOGFONT logfont = { 0 }; + int oldTextAlign; + COLORREF oldBkColor, oldTextColor; + WIN_DATA * pWindowData; + USHORT usRow = ( USHORT ) hb_parni( 2 ), + usCol = ( USHORT ) hb_parni( 3 ); pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); @@ -1553,31 +1553,31 @@ HB_FUNC( WVW_DRAWLABEL ) hb_wvw_HBFUNCPrologue( usWinNum, &usRow, &usCol, NULL, NULL ); } - logfont.lfEscapement = ( HB_ISNIL( 6 ) ? 0 : ( hb_parni( 6 ) * 10 ) ); - logfont.lfOrientation = 0; - logfont.lfWeight = ( HB_ISNIL( 12 ) ? 0 : hb_parni( 12 ) ); - logfont.lfItalic = ( HB_ISNIL( 15 ) ? 0 : ( BYTE ) hb_parl( 15 ) ); - logfont.lfUnderline = ( HB_ISNIL( 16 ) ? 0 : ( BYTE ) hb_parl( 16 ) ); - logfont.lfStrikeOut = ( HB_ISNIL( 17 ) ? 0 : ( BYTE ) hb_parl( 17 ) ); - logfont.lfCharSet = ( HB_ISNIL( 14 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 14 ) ); - logfont.lfOutPrecision = 0; - logfont.lfClipPrecision = 0; - logfont.lfQuality = ( HB_ISNIL( 13 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 13 ) ); - logfont.lfPitchAndFamily = FF_DONTCARE; - logfont.lfHeight = ( HB_ISNIL( 10 ) ? pWindowData->fontHeight : hb_parni( 10 ) ); - logfont.lfWidth = ( HB_ISNIL( 11 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 11 ) ); + logfont.lfEscapement = ( HB_ISNIL( 6 ) ? 0 : ( hb_parni( 6 ) * 10 ) ); + logfont.lfOrientation = 0; + logfont.lfWeight = ( HB_ISNIL( 12 ) ? 0 : hb_parni( 12 ) ); + logfont.lfItalic = ( HB_ISNIL( 15 ) ? 0 : ( BYTE ) hb_parl( 15 ) ); + logfont.lfUnderline = ( HB_ISNIL( 16 ) ? 0 : ( BYTE ) hb_parl( 16 ) ); + logfont.lfStrikeOut = ( HB_ISNIL( 17 ) ? 0 : ( BYTE ) hb_parl( 17 ) ); + logfont.lfCharSet = ( HB_ISNIL( 14 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 14 ) ); + logfont.lfOutPrecision = 0; + logfont.lfClipPrecision = 0; + logfont.lfQuality = ( HB_ISNIL( 13 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 13 ) ); + logfont.lfPitchAndFamily = FF_DONTCARE; + logfont.lfHeight = ( HB_ISNIL( 10 ) ? pWindowData->fontHeight : hb_parni( 10 ) ); + logfont.lfWidth = ( HB_ISNIL( 11 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 11 ) ); strcpy( logfont.lfFaceName, ( HB_ISNIL( 9 ) ? pWindowData->fontFace : hb_parcx( 9 ) ) ); hFont = CreateFontIndirect( &logfont ); if( hFont ) { - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usCol, usRow ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usCol, usRow ); - oldBkColor = SetBkColor( pWindowData->hdc, HB_ISNIL( 8 ) ? pWindowData->background : ( COLORREF ) hb_parnl( 8 ) ); - oldTextColor = SetTextColor( pWindowData->hdc, HB_ISNIL( 7 ) ? pWindowData->foreground : ( COLORREF ) hb_parnl( 7 ) ); - oldTextAlign = SetTextAlign( pWindowData->hdc, ( HB_ISNIL( 5 ) ? TA_LEFT : hb_parni( 5 ) ) ); - oldFont = ( HFONT ) SelectObject( pWindowData->hdc, hFont ); + oldBkColor = SetBkColor( pWindowData->hdc, HB_ISNIL( 8 ) ? pWindowData->background : ( COLORREF ) hb_parnl( 8 ) ); + oldTextColor = SetTextColor( pWindowData->hdc, HB_ISNIL( 7 ) ? pWindowData->foreground : ( COLORREF ) hb_parnl( 7 ) ); + oldTextAlign = SetTextAlign( pWindowData->hdc, ( HB_ISNIL( 5 ) ? TA_LEFT : hb_parni( 5 ) ) ); + oldFont = ( HFONT ) SelectObject( pWindowData->hdc, hFont ); ExtTextOut( pWindowData->hdc, xy.x, xy.y, 0, NULL, hb_parcx( 4 ), strlen( hb_parcx( 4 ) ), NULL ); @@ -1602,17 +1602,17 @@ HB_FUNC( WVW_DRAWLABEL ) HB_FUNC( WVW_DRAWOUTLINE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - HPEN hPen = 0, hOldPen = 0; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; + UINT usWinNum = WVW_WHICH_WINDOW; + HPEN hPen = 0, hOldPen = 0; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - WIN_DATA * pWindowData; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + WIN_DATA * pWindowData; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); @@ -1621,16 +1621,16 @@ HB_FUNC( WVW_DRAWOUTLINE ) hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y - 1; - iLeft = xy.x - 1; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y - 1; + iLeft = xy.x - 1; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y; - iRight = xy.x; + iBottom = xy.y; + iRight = xy.x; if( HB_ISNUM( 6 ) ) { @@ -1677,59 +1677,59 @@ HB_FUNC( WVW_DRAWLINE ) int x, y; COLORREF cr; HPEN hPen, hOldPen; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); - WIN_DATA * pWindowData; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + WIN_DATA * pWindowData; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - iOffTop = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 3 ) : 0; - iOffRight = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 4 ) : 0; + iOffTop = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 3 ) : 0; + iOffRight = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + iOffBottom; - iRight = xy.x - 1 + iOffRight; + iBottom = xy.y - 1 + iOffBottom; + iRight = xy.x - 1 + iOffRight; - iOrient = HB_ISNIL( 6 ) ? 0 : hb_parni( 6 ); - iFormat = HB_ISNIL( 7 ) ? 0 : hb_parni( 7 ); - iAlign = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ); - iStyle = HB_ISNIL( 9 ) ? 0 : hb_parni( 9 ); - iThick = HB_ISNIL( 10 ) ? 0 : hb_parni( 10 ); - cr = HB_ISNIL( 11 ) ? 0 : ( COLORREF ) hb_parnl( 11 ); + iOrient = HB_ISNIL( 6 ) ? 0 : hb_parni( 6 ); + iFormat = HB_ISNIL( 7 ) ? 0 : hb_parni( 7 ); + iAlign = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ); + iStyle = HB_ISNIL( 9 ) ? 0 : hb_parni( 9 ); + iThick = HB_ISNIL( 10 ) ? 0 : hb_parni( 10 ); + cr = HB_ISNIL( 11 ) ? 0 : ( COLORREF ) hb_parnl( 11 ); - x = iLeft; - y = iTop; + x = iLeft; + y = iTop; switch( iAlign ) { case 0: /* Center */ if( iOrient == 0 ) /* Horizontal */ { - iOffset = ( ( iBottom - iTop ) / 2 ); - y = iTop + iOffset; + iOffset = ( ( iBottom - iTop ) / 2 ); + y = iTop + iOffset; } else { - iOffset = ( ( iRight - iLeft ) / 2 ); - x = iLeft + iOffset; + iOffset = ( ( iRight - iLeft ) / 2 ); + x = iLeft + iOffset; } break; @@ -1762,8 +1762,8 @@ HB_FUNC( WVW_DRAWLINE ) break; } - hPen = CreatePen( iStyle, iThick, cr ); - hOldPen = ( HPEN ) SelectObject( pWindowData->hdc, hPen ); + hPen = CreatePen( iStyle, iThick, cr ); + hOldPen = ( HPEN ) SelectObject( pWindowData->hdc, hPen ); switch( iFormat ) { @@ -1839,37 +1839,37 @@ HB_FUNC( WVW_DRAWLINE ) HB_FUNC( WVW_DRAWELLIPSE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); - iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; - iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; + iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; + iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + iOffBottom; - iRight = xy.x - 1 + iOffRight; + iBottom = xy.y - 1 + iOffBottom; + iRight = xy.x - 1 + iOffRight; SelectObject( pWindowData->hdc, s_sApp->currentBrush ); SelectObject( pWindowData->hdc, s_sApp->currentPen ); @@ -1885,39 +1885,39 @@ HB_FUNC( WVW_DRAWELLIPSE ) HB_FUNC( WVW_DRAWRECTANGLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); // Ref.: 28454 - Marson de Paula - 11/27/2007 - BOOL bUsaCurrentPen = ( HB_ISNIL( 7 ) ? TRUE : hb_parl( 7 ) ); + BOOL bUsaCurrentPen = ( HB_ISNIL( 7 ) ? TRUE : hb_parl( 7 ) ); - iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; - iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; + iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; + iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + iOffBottom; - iRight = xy.x - 1 + iOffRight; + iBottom = xy.y - 1 + iOffBottom; + iRight = xy.x - 1 + iOffRight; SelectObject( pWindowData->hdc, s_sApp->currentBrush ); // Ref.: 28454 - Marson de Paula - 11/27/2007 @@ -1946,40 +1946,40 @@ HB_FUNC( WVW_DRAWRECTANGLE ) HB_FUNC( WVW_DRAWROUNDRECT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - int iTop, iLeft, iBottom, iRight, iWd, iHt; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + int iTop, iLeft, iBottom, iRight, iWd, iHt; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); int iOffTop, iOffLeft, iOffBottom, iOffRight; - iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; - iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; + iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; + iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + iOffBottom; - iRight = xy.x - 1 + iOffRight; + iBottom = xy.y - 1 + iOffBottom; + iRight = xy.x - 1 + iOffRight; - iWd = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ); - iHt = HB_ISNIL( 7 ) ? 0 : hb_parni( 7 ); + iWd = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ); + iHt = HB_ISNIL( 7 ) ? 0 : hb_parni( 7 ); SelectObject( pWindowData->hdc, s_sApp->currentBrush ); SelectObject( pWindowData->hdc, s_sApp->currentPen ); @@ -1995,36 +1995,36 @@ HB_FUNC( WVW_DRAWROUNDRECT ) HB_FUNC( WVW_DRAWFOCUSRECT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - RECT rc = { 0 }; - POINT xy = { 0 }; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + UINT usWinNum = WVW_WHICH_WINDOW; + RECT rc = { 0 }; + POINT xy = { 0 }; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); int iOffTop, iOffLeft, iOffBottom, iOffRight; - iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; - iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; + iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; + iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - rc.top = xy.y + iOffTop; - rc.left = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + rc.top = xy.y + iOffTop; + rc.left = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - rc.bottom = xy.y - 1 + iOffBottom; - rc.right = xy.x - 1 + iOffRight; + rc.bottom = xy.y - 1 + iOffBottom; + rc.right = xy.x - 1 + iOffRight; hb_retl( DrawFocusRect( pWindowData->hdc, &rc ) ); } @@ -2038,41 +2038,41 @@ HB_FUNC( WVW_DRAWFOCUSRECT ) */ HB_FUNC( WVW_DRAWCOLORRECT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WIN_DATA * pWindowMainData = hb_gt_wvw_GetWindowsData( 0 ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - int iOffTop, iOffLeft, iOffBottom, iOffRight; - RECT rc = { 0 }; - POINT xy = { 0 }; - HBRUSH hBrush; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WIN_DATA * pWindowMainData = hb_gt_wvw_GetWindowsData( 0 ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + int iOffTop, iOffLeft, iOffBottom, iOffRight; + RECT rc = { 0 }; + POINT xy = { 0 }; + HBRUSH hBrush; - iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; - iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; + iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; + iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - rc.top = xy.y + iOffTop; - rc.left = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + rc.top = xy.y + iOffTop; + rc.left = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - rc.bottom = xy.y - 1 + iOffBottom; - rc.right = xy.x - 1 + iOffRight; + rc.bottom = xy.y - 1 + iOffBottom; + rc.right = xy.x - 1 + iOffRight; - hBrush = CreateSolidBrush( ( COLORREF ) hb_parnl( 7 ) ); + hBrush = CreateSolidBrush( ( COLORREF ) hb_parnl( 7 ) ); if( hBrush ) { @@ -2092,27 +2092,27 @@ HB_FUNC( WVW_DRAWCOLORRECT ) HB_FUNC( WVW_DRAWGRIDHORZ ) { - UINT usWinNum = WVW_WHICH_WINDOW; - USHORT usAtRow = ( USHORT ) hb_parni( 2 ); - int iRows = hb_parni( 5 ); - int i, y; - int iLeft, iRight; - WIN_DATA * pWindowData; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - USHORT usLeft, usRight; + UINT usWinNum = WVW_WHICH_WINDOW; + USHORT usAtRow = ( USHORT ) hb_parni( 2 ); + int iRows = hb_parni( 5 ); + int i, y; + int iLeft, iRight; + WIN_DATA * pWindowData; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + USHORT usLeft, usRight; pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - usLeft = ( USHORT ) hb_parni( 3 ); - usRight = ( USHORT ) hb_parni( 4 ); + usLeft = ( USHORT ) hb_parni( 3 ); + usRight = ( USHORT ) hb_parni( 4 ); if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usAtRow, &usLeft, NULL, &usRight ); } - iLeft = ( usLeft * pWindowData->PTEXTSIZE.x ); - iRight = ( ( ( usRight + 1 ) * pWindowData->PTEXTSIZE.x ) - 1 ); + iLeft = ( usLeft * pWindowData->PTEXTSIZE.x ); + iRight = ( ( ( usRight + 1 ) * pWindowData->PTEXTSIZE.x ) - 1 ); if( s_sApp->gridPen == NULL ) { @@ -2124,9 +2124,9 @@ HB_FUNC( WVW_DRAWGRIDHORZ ) for( i = 0; i < iRows; i++ ) { - y = ( ( usAtRow ) * hb_wvw_LineHeight( pWindowData ) ); + y = ( ( usAtRow ) * hb_wvw_LineHeight( pWindowData ) ); - y += pWindowData->usTBHeight; + y += pWindowData->usTBHeight; MoveToEx( pWindowData->hdc, iLeft, y, NULL ); LineTo( pWindowData->hdc, iRight, y ); @@ -2149,15 +2149,15 @@ HB_FUNC( WVW_DRAWGRIDHORZ ) HB_FUNC( WVW_DRAWGRIDVERT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - int iTop, iBottom, x; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - int i; - int iCharHeight, iCharWidth; - int iTabs = hb_parni( 5 ); - WIN_DATA * pWindowData; - USHORT usTop, usBottom, usCol; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + UINT usWinNum = WVW_WHICH_WINDOW; + int iTop, iBottom, x; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + int i; + int iCharHeight, iCharWidth; + int iTabs = hb_parni( 5 ); + WIN_DATA * pWindowData; + USHORT usTop, usBottom, usCol; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); @@ -2166,10 +2166,10 @@ HB_FUNC( WVW_DRAWGRIDVERT ) hb_retl( FALSE ); } - iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; - iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; /* is not actually used */ + iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; + iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; /* is not actually used */ HB_SYMBOL_UNUSED( iOffRight ); @@ -2180,12 +2180,12 @@ HB_FUNC( WVW_DRAWGRIDVERT ) hb_wvw_HBFUNCPrologue( usWinNum, &usTop, NULL, &usBottom, NULL ); } - iCharWidth = pWindowData->PTEXTSIZE.x; + iCharWidth = pWindowData->PTEXTSIZE.x; iCharHeight = hb_wvw_LineHeight( pWindowData ); - iTop = ( usTop * iCharHeight ) + pWindowData->usTBHeight + iOffTop; - iBottom = ( ( usBottom + 1 ) * iCharHeight ) - 1 + pWindowData->usTBHeight + iOffBottom; + iTop = ( usTop * iCharHeight ) + pWindowData->usTBHeight + iOffTop; + iBottom = ( ( usBottom + 1 ) * iCharHeight ) - 1 + pWindowData->usTBHeight + iOffBottom; if( s_sApp->gridPen == NULL ) { @@ -2220,33 +2220,33 @@ HB_FUNC( WVW_DRAWGRIDVERT ) HB_FUNC( WVW_DRAWBUTTON ) { - UINT usWinNum = WVW_WHICH_WINDOW; - SIZE sz = { 0 }; - POINT xy = { 0 }; - RECT rc = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iAlign, oldTextAlign, oldBkMode; - int iTextHeight /*, iTextWidth */; - int iImageWidth, iImageHeight; + UINT usWinNum = WVW_WHICH_WINDOW; + SIZE sz = { 0 }; + POINT xy = { 0 }; + RECT rc = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iAlign, oldTextAlign, oldBkMode; + int iTextHeight /*, iTextWidth */; + int iImageWidth, iImageHeight; COLORREF /* oldBkColor, */ oldTextColor; - LOGBRUSH lb = { 0 }; - HBRUSH hBrush; - IPicture * iPicture; + LOGBRUSH lb = { 0 }; + HBRUSH hBrush; + IPicture * iPicture; - BOOL bText = HB_ISCHAR( 6 ); - BOOL bImage = ! ( HB_ISNIL( 7 ) ); - int iFormat = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ); + BOOL bText = HB_ISCHAR( 6 ); + BOOL bImage = ! ( HB_ISNIL( 7 ) ); + int iFormat = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ); - COLORREF textColor = HB_ISNIL( 9 ) ? _COLORS[ 0 ] : ( COLORREF ) hb_parnl( 9 ); - COLORREF bkColor = HB_ISNIL( 10 ) ? _COLORS[ 7 ] : ( COLORREF ) hb_parnl( 10 ); + COLORREF textColor = HB_ISNIL( 9 ) ? _COLORS[ 0 ] : ( COLORREF ) hb_parnl( 9 ); + COLORREF bkColor = HB_ISNIL( 10 ) ? _COLORS[ 7 ] : ( COLORREF ) hb_parnl( 10 ); - WIN_DATA * pWindowData; - WIN_DATA * pWindowMainData = hb_gt_wvw_GetWindowsData( 0 ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + WIN_DATA * pWindowData; + WIN_DATA * pWindowMainData = hb_gt_wvw_GetWindowsData( 0 ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); @@ -2255,27 +2255,27 @@ HB_FUNC( WVW_DRAWBUTTON ) hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y; - iLeft = xy.x; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y; + iLeft = xy.x; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1; - iRight = xy.x - 1; + iBottom = xy.y - 1; + iRight = xy.x - 1; - lb.lbStyle = BS_SOLID; - lb.lbColor = bkColor; - lb.lbHatch = 0; + lb.lbStyle = BS_SOLID; + lb.lbColor = bkColor; + lb.lbHatch = 0; - hBrush = CreateBrushIndirect( &lb ); + hBrush = CreateBrushIndirect( &lb ); - 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( pWindowData->hdc, &rc, hBrush ); @@ -2311,7 +2311,7 @@ HB_FUNC( WVW_DRAWBUTTON ) iTextHeight = sz.cy; - xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); + xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); if( bImage ) { @@ -2325,15 +2325,15 @@ HB_FUNC( WVW_DRAWBUTTON ) if( iFormat == 1 ) { - xy.x = xy.x + 2; - xy.y = xy.y + 2; + xy.x = xy.x + 2; + xy.y = xy.y + 2; } - iAlign = TA_CENTER + TA_TOP; + iAlign = TA_CENTER + TA_TOP; - oldTextAlign = SetTextAlign( pWindowData->hdc, iAlign ); - oldBkMode = SetBkMode( pWindowData->hdc, TRANSPARENT ); - oldTextColor = SetTextColor( pWindowData->hdc, textColor ); + oldTextAlign = SetTextAlign( pWindowData->hdc, iAlign ); + oldBkMode = SetBkMode( pWindowData->hdc, TRANSPARENT ); + oldTextColor = SetTextColor( pWindowData->hdc, textColor ); ExtTextOut( pWindowData->hdc, xy.x, xy.y, 0, NULL, hb_parcx( 6 ), strlen( hb_parcx( 6 ) ), NULL ); @@ -2348,9 +2348,9 @@ HB_FUNC( WVW_DRAWBUTTON ) if( bImage ) { - iImageWidth = ( iRight - iLeft + 1 - 8 ); + iImageWidth = ( iRight - iLeft + 1 - 8 ); - iImageHeight = ( iBottom - iTop + 1 - 8 - iTextHeight ); + iImageHeight = ( iBottom - iTop + 1 - 8 - iTextHeight ); if( HB_ISNUM( 7 ) ) { @@ -2378,17 +2378,17 @@ HB_FUNC( WVW_DRAWBUTTON ) HB_FUNC( WVW_DRAWSTATUSBAR ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - int iPanels = hb_parni( 2 ); - int i, iNext; - int iTop, iLeft, iBottom, iRight; - POINT xy = { 0 }; - USHORT usTop, - usLeft, - usBottom, - usRight; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + int iPanels = hb_parni( 2 ); + int i, iNext; + int iTop, iLeft, iBottom, iRight; + POINT xy = { 0 }; + USHORT usTop, + usLeft, + usBottom, + usRight; iNext = 0; @@ -2404,16 +2404,16 @@ HB_FUNC( WVW_DRAWSTATUSBAR ) hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y; - iLeft = xy.x + 1; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y; + iLeft = xy.x + 1; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1; - iRight = xy.x - 2; + iBottom = xy.y - 1; + iRight = xy.x - 2; SelectObject( pWindowData->hdc, s_sApp->penWhite ); @@ -2434,22 +2434,22 @@ HB_FUNC( WVW_DRAWSTATUSBAR ) iNext = iNext + 4; } - usTop = ( USHORT ) hb_parvni( 3, ( 4 * iPanels ) - 1 ); - usLeft = ( USHORT ) hb_parvni( 3, 4 * iPanels ); + usTop = ( USHORT ) hb_parvni( 3, ( 4 * iPanels ) - 1 ); + usLeft = ( USHORT ) hb_parvni( 3, 4 * iPanels ); if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, NULL, NULL ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iTop = xy.y - 2; - iLeft = xy.x - 2; - iBottom = iTop; - iRight = iLeft; + iTop = xy.y - 2; + iLeft = xy.x - 2; + iBottom = iTop; + iRight = iLeft; SelectObject( pWindowData->hdc, s_sApp->penBlack ); @@ -2478,22 +2478,22 @@ HB_FUNC( WVW_DRAWSTATUSBAR ) HB_FUNC( WVW_DRAWPICTURE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - POINT xy = { 0 }; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - int iTop, iLeft, iBottom, iRight; + UINT usWinNum = WVW_WHICH_WINDOW; + POINT xy = { 0 }; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + int iTop, iLeft, iBottom, iRight; - int iSlot = hb_parni( 6 ) - 1; + int iSlot = hb_parni( 6 ) - 1; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); - BOOL bTight = ( HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) ); /* <-- none in gtwvt */ - BOOL bUseArray = HB_ISARRAY( 7 ); - int iOLeft, iOTop, iORight, iOBottom; + BOOL bTight = ( HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) ); /* <-- none in gtwvt */ + BOOL bUseArray = HB_ISARRAY( 7 ); + int iOLeft, iOTop, iORight, iOBottom; if( hb_gt_wvw_GetMainCoordMode() ) { @@ -2523,13 +2523,13 @@ HB_FUNC( WVW_DRAWPICTURE ) { if( s_sApp->iPicture[ iSlot ] ) { - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOTop; - iLeft = xy.x + iOLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOTop; + iLeft = xy.x + iOLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - iBottom = xy.y - 1 + iOBottom; - iRight = xy.x - 1 + iORight; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + iBottom = xy.y - 1 + iOBottom; + iRight = xy.x - 1 + iORight; hb_retl( hb_gt_wvwRenderPicture( usWinNum, iLeft, iTop, iRight - iLeft + 1, iBottom - iTop + 1, s_sApp->iPicture[ iSlot ], FALSE ) @@ -2547,17 +2547,17 @@ HB_FUNC( WVW_DRAWPICTURE ) HB_FUNC( WVW_DRAWLABELEX ) { - UINT usWinNum = WVW_WHICH_WINDOW; - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - POINT xy = { 0 }; - HFONT oldFont; - int oldTextAlign; - COLORREF oldBkColor, oldTextColor; - int iSlot = hb_parni( 8 ) - 1; + UINT usWinNum = WVW_WHICH_WINDOW; + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + POINT xy = { 0 }; + HFONT oldFont; + int oldTextAlign; + COLORREF oldBkColor, oldTextColor; + int iSlot = hb_parni( 8 ) - 1; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ); if( hb_gt_wvw_GetMainCoordMode() ) { @@ -2566,12 +2566,12 @@ HB_FUNC( WVW_DRAWLABELEX ) if( s_sApp->hUserFonts[ iSlot ] ) { - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - oldBkColor = SetBkColor( pWindowData->hdc, HB_ISNIL( 7 ) ? pWindowData->background : ( COLORREF ) hb_parnl( 7 ) ); - oldTextColor = SetTextColor( pWindowData->hdc, HB_ISNIL( 6 ) ? pWindowData->foreground : ( COLORREF ) hb_parnl( 6 ) ); - oldTextAlign = SetTextAlign( pWindowData->hdc, ( HB_ISNIL( 5 ) ? TA_LEFT : hb_parni( 5 ) ) ); - oldFont = ( HFONT ) SelectObject( pWindowData->hdc, s_sApp->hUserFonts[ iSlot ] ); + oldBkColor = SetBkColor( pWindowData->hdc, HB_ISNIL( 7 ) ? pWindowData->background : ( COLORREF ) hb_parnl( 7 ) ); + oldTextColor = SetTextColor( pWindowData->hdc, HB_ISNIL( 6 ) ? pWindowData->foreground : ( COLORREF ) hb_parnl( 6 ) ); + oldTextAlign = SetTextAlign( pWindowData->hdc, ( HB_ISNIL( 5 ) ? TA_LEFT : hb_parni( 5 ) ) ); + oldFont = ( HFONT ) SelectObject( pWindowData->hdc, s_sApp->hUserFonts[ iSlot ] ); ExtTextOut( pWindowData->hdc, xy.x, xy.y, 0, NULL, hb_parcx( 4 ), strlen( hb_parcx( 4 ) ), NULL ); @@ -2593,54 +2593,54 @@ HB_FUNC( WVW_DRAWLABELEX ) HB_FUNC( WVW_DRAWLINEEX ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight, iOffset; - int iOrient, iFormat, iAlign; - int x, y; - HPEN hPen; - int iSlot = hb_parni( 9 ) - 1; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight, iOffset; + int iOrient, iFormat, iAlign; + int x, y; + HPEN hPen; + int iSlot = hb_parni( 9 ) - 1; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y; - iLeft = xy.x; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y; + iLeft = xy.x; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - iBottom = xy.y - 1; - iRight = xy.x - 1; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + iBottom = xy.y - 1; + iRight = xy.x - 1; - iOrient = HB_ISNIL( 6 ) ? 0 : hb_parni( 6 ); - iFormat = HB_ISNIL( 7 ) ? 0 : hb_parni( 7 ); - iAlign = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ); + iOrient = HB_ISNIL( 6 ) ? 0 : hb_parni( 6 ); + iFormat = HB_ISNIL( 7 ) ? 0 : hb_parni( 7 ); + iAlign = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ); - x = iLeft; - y = iTop; + x = iLeft; + y = iTop; switch( iAlign ) { case 0: /* Center */ if( iOrient == 0 ) /* Horizontal */ { - iOffset = ( ( iBottom - iTop ) / 2 ); - y = iTop + iOffset; + iOffset = ( ( iBottom - iTop ) / 2 ); + y = iTop + iOffset; } else { - iOffset = ( ( iRight - iLeft ) / 2 ); - x = iLeft + iOffset; + iOffset = ( ( iRight - iLeft ) / 2 ); + x = iLeft + iOffset; } break; @@ -2745,31 +2745,31 @@ HB_FUNC( WVW_DRAWLINEEX ) HB_FUNC( WVW_DRAWOUTLINEEX ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - APP_DATA * s_sApp = hb_gt_wvwGetAppData(); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iSlot = hb_parni( 6 ) - 1; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + APP_DATA * s_sApp = hb_gt_wvwGetAppData(); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iSlot = hb_parni( 6 ) - 1; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y - 1; - iLeft = xy.x - 1; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y - 1; + iLeft = xy.x - 1; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - iBottom = xy.y; - iRight = xy.x; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + iBottom = xy.y; + iRight = xy.x; if( s_sApp->hUserPens[ iSlot ] ) { diff --git a/harbour/extras/gtwvw/wvwedit.c b/harbour/extras/gtwvw/wvwedit.c index 9cf6501241..8e65948042 100644 --- a/harbour/extras/gtwvw/wvwedit.c +++ b/harbour/extras/gtwvw/wvwedit.c @@ -77,16 +77,16 @@ #include "hbgtwvw.h" -/*WVW_EBcreate( [nWinNum], nTop, nLeft, nBottom, nRight, cText, bBlock, ; +/* WVW_EBcreate( [nWinNum], nTop, nLeft, nBottom, nRight, cText, bBlock, ; * lMultiline, nMoreStyle, nMaxChar, nReserved, aOffset) - **create editbox for window nWinNum - **nTop: row of top/left corner (in character unit) - **nLeft: col of top/left corner (in character unit) - **nBottom: row of bottom/right corner (in character unit) - **nRight: col of bottom/right corner (in character unit) - **cText: initial text to display, default = "" - * WARNING!! must be of "C" typed! - **bBlock: codeblock to execute on these events: + * create editbox for window nWinNum + * nTop: row of top/left corner (in character unit) + * nLeft: col of top/left corner (in character unit) + * nBottom: row of bottom/right corner (in character unit) + * nRight: col of bottom/right corner (in character unit) + * cText: initial text to display, default = "" + * WARNING!! must be of "C" typed! + * bBlock: codeblock to execute on these events: * event=EN_SETFOCUS(...): editbox got focus * event=EN_KILLFOCUS(...): editbox lose focus * This codeblock will be evaluated with these parameters: @@ -95,56 +95,56 @@ * nType : event type (EN_SETFOCUS/EN_KILLFOCUS supported) * * - **lMultiline: .f. :: single line editbox (default) + * lMultiline: .f. :: single line editbox (default) * .t. :: multi line editbox * mapped internally into two types of editbox: * WVW_EB_SINGLELINE (1): single line editbox * WVW_EB_MULTILINE (2): multi line editbox * default is WVW_EB_SINGLELINE (1) * - **nMoreStyle: more style that will be added to the predefined style + * nMoreStyle: more style that will be added to the predefined style * some examples: ES_PASSWORD, ES_READONLY * - **nMaxChar: (FUTURE FEATURE) maximum number of chars allowed + * nMaxChar: (FUTURE FEATURE) maximum number of chars allowed * - **nReserved: reserved for future use + * nReserved: reserved for future use * - **aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust + * aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust * dimension of editbox. * defaults: {-2,-2,+2,+2} * - **returns control id of newly created editbox of windows nWinNum - **returns 0 if failed + * returns control id of newly created editbox of windows nWinNum + * returns 0 if failed * - **example: + * example: */ HB_FUNC( WVW_EBCREATE ) { - HANDLE hInstance = NULL; - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndParent = pWindowData->hWnd; - HWND hWndEB; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - UINT uiEBid; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - LPTSTR lpszText = ( LPTSTR ) hb_parcx( 6 ); + HANDLE hInstance = NULL; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndParent = pWindowData->hWnd; + HWND hWndEB; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + UINT uiEBid; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + LPTSTR lpszText = ( LPTSTR ) hb_parcx( 6 ); - BOOL bMultiline = ( HB_ISLOG( 8 ) ? hb_parl( 8 ) : FALSE ); - BYTE bEBType = ( BYTE ) ( bMultiline ? WVW_EB_MULTILINE : WVW_EB_SINGLELINE ); + BOOL bMultiline = ( HB_ISLOG( 8 ) ? hb_parl( 8 ) : FALSE ); + BYTE bEBType = ( BYTE ) ( bMultiline ? WVW_EB_MULTILINE : WVW_EB_SINGLELINE ); - DWORD dwMoreStyle = ( DWORD ) ( HB_ISNUM( 9 ) ? hb_parnl( 9 ) : 0 ); + DWORD dwMoreStyle = ( DWORD ) ( HB_ISNUM( 9 ) ? hb_parnl( 9 ) : 0 ); - USHORT usMaxChar = ( USHORT ) ( HB_ISNUM( 10 ) && hb_parni( 10 ) > 0 ? hb_parni( 10 ) : 0 ); + USHORT usMaxChar = ( USHORT ) ( HB_ISNUM( 10 ) && hb_parni( 10 ) > 0 ? hb_parni( 10 ) : 0 ); - DWORD dwStyle; - WVW_DATA * pData = hb_getWvwData(); + DWORD dwStyle; + WVW_DATA * pData = hb_getWvwData(); if( pWindowData->hEBfont == NULL ) { @@ -156,28 +156,28 @@ HB_FUNC( WVW_EBCREATE ) } } - iOffTop = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 3 ) : 0; - iOffRight = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 4 ) : 0; + iOffTop = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 3 ) : 0; + iOffRight = ! HB_ISNIL( 12 ) ? hb_parvni( 12, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + iOffBottom; - iRight = xy.x - 1 + iOffRight; + iBottom = xy.y - 1 + iOffBottom; + iRight = xy.x - 1 + iOffRight; - uiEBid = LastControlId( usWinNum, WVW_CONTROL_EDITBOX ); + uiEBid = LastControlId( usWinNum, WVW_CONTROL_EDITBOX ); if( uiEBid == 0 ) { uiEBid = WVW_ID_BASE_EDITBOX; @@ -224,15 +224,15 @@ HB_FUNC( WVW_EBCREATE ) if( hWndEB ) { - RECT rXB = { 0 }, rOffXB = { 0 }; - WNDPROC OldProc; + RECT rXB = { 0 }, rOffXB = { 0 }; + WNDPROC OldProc; //USHORT i; - BOOL bFromOEM = ( pWindowData->CodePage == OEM_CHARSET ); + BOOL bFromOEM = ( pWindowData->CodePage == OEM_CHARSET ); if( bFromOEM ) { - ULONG ulLen = ( ULONG ) strlen( lpszText ); - LPTSTR lpszTextANSI = ( LPTSTR ) hb_xgrab( ulLen + 1 ); + ULONG ulLen = ( ULONG ) strlen( lpszText ); + LPTSTR lpszTextANSI = ( LPTSTR ) hb_xgrab( ulLen + 1 ); OemToChar( lpszText, lpszTextANSI ); lpszText = lpszTextANSI; } @@ -259,10 +259,10 @@ HB_FUNC( WVW_EBCREATE ) ); } - rXB.top = usTop; rXB.left = usLeft; - rXB.bottom = usBottom; rXB.right = usRight; - rOffXB.top = iOffTop; rOffXB.left = iOffLeft; - rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; + rXB.top = usTop; rXB.left = usLeft; + rXB.bottom = usBottom; rXB.right = usRight; + rOffXB.top = iOffTop; rOffXB.left = iOffLeft; + rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; AddControlHandle( usWinNum, WVW_CONTROL_EDITBOX, hWndEB, uiEBid, ( PHB_ITEM ) hb_param( 7, HB_IT_BLOCK ), rXB, rOffXB, ( byte ) bEBType ); @@ -287,7 +287,7 @@ HB_FUNC( WVW_EBCREATE ) */ HB_FUNC( WVW_EBDESTROY ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); UINT uiEBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); CONTROL_DATA * pcd = pWindowData->pcdCtrlList; @@ -300,8 +300,8 @@ HB_FUNC( WVW_EBDESTROY ) break; } - pcdPrev = pcd; - pcd = pcd->pNext; + pcdPrev = pcd; + pcd = pcd->pNext; } if( pcd == NULL ) { @@ -333,10 +333,10 @@ HB_FUNC( WVW_EBDESTROY ) */ HB_FUNC( WVW_EBSETFOCUS ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - byte bStyle; - HWND hWndEB = FindControlHandle( usWinNum, WVW_CONTROL_EDITBOX, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + byte bStyle; + HWND hWndEB = FindControlHandle( usWinNum, WVW_CONTROL_EDITBOX, uiCtrlId, &bStyle ); if( hWndEB ) { @@ -353,10 +353,10 @@ HB_FUNC( WVW_EBSETFOCUS ) */ HB_FUNC( WVW_EBISFOCUSED ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - byte bStyle; - HWND hWndEB = FindControlHandle( usWinNum, WVW_CONTROL_EDITBOX, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + byte bStyle; + HWND hWndEB = FindControlHandle( usWinNum, WVW_CONTROL_EDITBOX, uiCtrlId, &bStyle ); hb_retl( ( HWND ) GetFocus() == hWndEB ); } @@ -369,12 +369,12 @@ HB_FUNC( WVW_EBISFOCUSED ) */ HB_FUNC( WVW_EBENABLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); - byte bStyle; - HWND hWndEB = FindControlHandle( usWinNum, WVW_CONTROL_EDITBOX, uiCtrlId, &bStyle ); - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); + byte bStyle; + HWND hWndEB = FindControlHandle( usWinNum, WVW_CONTROL_EDITBOX, uiCtrlId, &bStyle ); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); if( hWndEB ) { @@ -399,11 +399,11 @@ HB_FUNC( WVW_EBENABLE ) */ HB_FUNC( WVW_EBEDITABLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - BOOL bEditable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); - byte bStyle; - HWND hWndEB = FindControlHandle( usWinNum, WVW_CONTROL_EDITBOX, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + BOOL bEditable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); + byte bStyle; + HWND hWndEB = FindControlHandle( usWinNum, WVW_CONTROL_EDITBOX, uiCtrlId, &bStyle ); if( hWndEB ) { @@ -434,13 +434,13 @@ HB_FUNC( WVW_EBEDITABLE ) */ HB_FUNC( WVW_EBSETCODEBLOCK ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiEBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); - WVW_DATA * pData = hb_getWvwData(); - PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK ); - BOOL bOldSetting = pData->s_bRecurseCBlock; + UINT uiEBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); + WVW_DATA * pData = hb_getWvwData(); + PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK ); + BOOL bOldSetting = pData->s_bRecurseCBlock; if( ! phiCodeBlock || pcd == NULL || pcd->bBusy ) { @@ -449,7 +449,7 @@ HB_FUNC( WVW_EBSETCODEBLOCK ) } pData->s_bRecurseCBlock = FALSE; - pcd->bBusy = TRUE; + pcd->bBusy = TRUE; if( pcd->phiCodeBlock ) { @@ -457,41 +457,41 @@ HB_FUNC( WVW_EBSETCODEBLOCK ) } - pcd->phiCodeBlock = hb_itemNew( phiCodeBlock ); + pcd->phiCodeBlock = hb_itemNew( phiCodeBlock ); - pcd->bBusy = FALSE; + pcd->bBusy = FALSE; pData->s_bRecurseCBlock = bOldSetting; hb_retl( TRUE ); } -/*WVW_EBSetFont([nWinNum], cFontFace, nHeight, nWidth, nWeight, nQUality,; +/* WVW_EBSetFont([nWinNum], cFontFace, nHeight, nWidth, nWeight, nQUality,; * lItalic, lUnderline, lStrikeout * - **this will initialize font for ALL editboxes in window nWinNum - **(including ones created later on) + * this will initialize font for ALL editboxes in window nWinNum + * (including ones created later on) * - **TODO: ? should nHeight be ignored, and always forced to use standard char height? + * TODO: ? should nHeight be ignored, and always forced to use standard char height? */ HB_FUNC( WVW_EBSETFONT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - BOOL retval = TRUE; - WVW_DATA * pData = hb_getWvwData(); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + BOOL retval = TRUE; + WVW_DATA * pData = hb_getWvwData(); - pData->s_lfEB.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); - pData->s_lfEB.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfEB.lfWidth : hb_parni( 4 ); - pData->s_lfEB.lfEscapement = 0; - pData->s_lfEB.lfOrientation = 0; - pData->s_lfEB.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfEB.lfWeight : hb_parni( 5 ); - pData->s_lfEB.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfEB.lfItalic : ( BYTE ) hb_parl( 7 ); - pData->s_lfEB.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfEB.lfUnderline : ( BYTE ) hb_parl( 8 ); - pData->s_lfEB.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfEB.lfStrikeOut : ( BYTE ) hb_parl( 9 ); - pData->s_lfEB.lfCharSet = DEFAULT_CHARSET; + pData->s_lfEB.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); + pData->s_lfEB.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfEB.lfWidth : hb_parni( 4 ); + pData->s_lfEB.lfEscapement = 0; + pData->s_lfEB.lfOrientation = 0; + pData->s_lfEB.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfEB.lfWeight : hb_parni( 5 ); + pData->s_lfEB.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfEB.lfItalic : ( BYTE ) hb_parl( 7 ); + pData->s_lfEB.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfEB.lfUnderline : ( BYTE ) hb_parl( 8 ); + pData->s_lfEB.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfEB.lfStrikeOut : ( BYTE ) hb_parl( 9 ); + pData->s_lfEB.lfCharSet = DEFAULT_CHARSET; - pData->s_lfEB.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfEB.lfQuality : ( BYTE ) hb_parni( 6 ); - pData->s_lfEB.lfPitchAndFamily = FF_DONTCARE; + pData->s_lfEB.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfEB.lfQuality : ( BYTE ) hb_parni( 6 ); + pData->s_lfEB.lfPitchAndFamily = FF_DONTCARE; if( HB_ISCHAR( 2 ) ) { strcpy( pData->s_lfEB.lfFaceName, hb_parcx( 2 ) ); @@ -539,10 +539,10 @@ HB_FUNC( WVW_EBSETFONT ) */ HB_FUNC( WVW_EBISMULTILINE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiEBid = hb_parni( 2 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); - BOOL bMultiline; + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiEBid = hb_parni( 2 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); + BOOL bMultiline; if( pcd == NULL ) { @@ -554,28 +554,28 @@ HB_FUNC( WVW_EBISMULTILINE ) hb_retl( bMultiline ); } -/*WVW_EBgettext( [nWinNum], nEBid,; +/* WVW_EBgettext( [nWinNum], nEBid,; * lSoftBreak ) - **returns current text from editbox nEBid in window nWinNum - **lSoftBreak: Default is FALSE. + * returns current text from editbox nEBid in window nWinNum + * lSoftBreak: Default is FALSE. * insert soft line break character (CR+CR+LF) at wordwrap positions * can be usefull to convert the text to MEMO format * eg. converting editbox's softbreaks into memoline softbreak: * cStr := wvw_ebgettext( NIL, nEBid, .T. ) * cStr := StrTran( cStr, CR + CR + LF, Chr( 141 ) + LF ) * - **returns "" in case of error (eg. nEBid not valid) + * returns "" in case of error (eg. nEBid not valid) */ HB_FUNC( WVW_EBGETTEXT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiEBid = hb_parni( 2 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); - BOOL bSoftBreak = ( HB_ISLOG( 3 ) ? hb_parl( 3 ) : FALSE ); - USHORT usLen; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - LPTSTR lpszTextANSI; - BOOL bToOEM = ( pWindowData->CodePage == OEM_CHARSET ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiEBid = hb_parni( 2 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); + BOOL bSoftBreak = ( HB_ISLOG( 3 ) ? hb_parl( 3 ) : FALSE ); + USHORT usLen; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + LPTSTR lpszTextANSI; + BOOL bToOEM = ( pWindowData->CodePage == OEM_CHARSET ); if( pcd == NULL ) { @@ -594,9 +594,9 @@ HB_FUNC( WVW_EBGETTEXT ) } - usLen = ( USHORT ) SendMessage( ( HWND ) pcd->hWndCtrl, WM_GETTEXTLENGTH, 0, 0 ) + 1; + usLen = ( USHORT ) SendMessage( ( HWND ) pcd->hWndCtrl, WM_GETTEXTLENGTH, 0, 0 ) + 1; - lpszTextANSI = ( LPTSTR ) hb_xgrab( usLen ); + lpszTextANSI = ( LPTSTR ) hb_xgrab( usLen ); SendMessage( ( HWND ) pcd->hWndCtrl, @@ -607,8 +607,8 @@ HB_FUNC( WVW_EBGETTEXT ) if( bToOEM ) { - ULONG ulLen = ( ULONG ) strlen( lpszTextANSI ); - LPTSTR lpszText = ( LPTSTR ) hb_xgrab( ulLen + 1 ); + ULONG ulLen = ( ULONG ) strlen( lpszTextANSI ); + LPTSTR lpszText = ( LPTSTR ) hb_xgrab( ulLen + 1 ); CharToOem( lpszTextANSI, lpszText ); hb_retc( lpszText ); hb_xfree( lpszText ); @@ -627,13 +627,13 @@ HB_FUNC( WVW_EBGETTEXT ) */ HB_FUNC( WVW_EBSETTEXT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiEBid = hb_parni( 2 ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiEBid = hb_parni( 2 ); WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); - BOOL bRetval; - LPTSTR lpszText = ( LPTSTR ) hb_parcx( 3 ); - BOOL bFromOEM = ( pWindowData->CodePage == OEM_CHARSET ); + BOOL bRetval; + LPTSTR lpszText = ( LPTSTR ) hb_parcx( 3 ); + BOOL bFromOEM = ( pWindowData->CodePage == OEM_CHARSET ); if( pcd == NULL ) { @@ -643,8 +643,8 @@ HB_FUNC( WVW_EBSETTEXT ) if( bFromOEM ) { - ULONG ulLen = ( ULONG ) strlen( lpszText ); - LPTSTR lpszTextANSI = ( LPTSTR ) hb_xgrab( ulLen + 1 ); + ULONG ulLen = ( ULONG ) strlen( lpszText ); + LPTSTR lpszTextANSI = ( LPTSTR ) hb_xgrab( ulLen + 1 ); OemToChar( lpszText, lpszTextANSI ); lpszText = lpszTextANSI; } @@ -673,9 +673,9 @@ HB_FUNC( WVW_EBSETTEXT ) */ HB_FUNC( WVW_EBGETSEL ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiEBid = hb_parni( 2 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiEBid = hb_parni( 2 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); DWORD dwStart, dwEnd; if( pcd == NULL ) @@ -708,11 +708,11 @@ HB_FUNC( WVW_EBGETSEL ) */ HB_FUNC( WVW_EBSETSEL ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiEBid = hb_parni( 2 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); - DWORD dwStart = ( DWORD ) ( HB_ISNUM( 3 ) ? hb_parnl( 3 ) : 0 ); - DWORD dwEnd = ( DWORD ) ( HB_ISNUM( 4 ) ? hb_parnl( 4 ) : 0 ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiEBid = hb_parni( 2 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid ); + DWORD dwStart = ( DWORD ) ( HB_ISNUM( 3 ) ? hb_parnl( 3 ) : 0 ); + DWORD dwEnd = ( DWORD ) ( HB_ISNUM( 4 ) ? hb_parnl( 4 ) : 0 ); if( pcd == NULL ) { @@ -731,33 +731,33 @@ HB_FUNC( WVW_EBSETSEL ) HB_FUNC( WVW_STCREATE ) { - HANDLE hInstance = NULL; - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WVW_DATA * pData = hb_getWvwData(); - HWND hWndParent = pWindowData->hWnd; - HWND hWndCB; + HANDLE hInstance = NULL; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WVW_DATA * pData = hb_getWvwData(); + HWND hWndParent = pWindowData->hWnd; + HWND hWndCB; //RECT r; // HDC hDc; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - UINT uiCBid; - BOOL bBorder = hb_parnl( 7 ); - ULONG ulExStyle = 0 | ( bBorder ? WS_EX_CLIENTEDGE : 0 ); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + UINT uiCBid; + BOOL bBorder = hb_parnl( 7 ); + ULONG ulExStyle = 0 | ( bBorder ? WS_EX_CLIENTEDGE : 0 ); - USHORT usWidth = ( USHORT ) hb_parni( 4 ); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = HB_ISNUM( 11 ) ? ( USHORT ) hb_parni( 11 ) : usTop, - usRight = HB_ISNUM( 12 ) ? ( USHORT ) hb_parni( 12 ) : usLeft + usWidth - 1; + USHORT usWidth = ( USHORT ) hb_parni( 4 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = HB_ISNUM( 11 ) ? ( USHORT ) hb_parni( 11 ) : usTop, + usRight = HB_ISNUM( 12 ) ? ( USHORT ) hb_parni( 12 ) : usLeft + usWidth - 1; //char * sText = hb_parc( 5 ); - int iStyle = ( bBorder ? WS_BORDER : 0 ); - int iBox = HB_ISNUM( 10 ) ? hb_parni( 10 ) : 0; - HFONT hFont = NULL; + int iStyle = ( bBorder ? WS_BORDER : 0 ); + int iBox = HB_ISNUM( 10 ) ? hb_parni( 10 ) : 0; + HFONT hFont = NULL; if( iBox > 0 ) iStyle |= iBox; @@ -778,29 +778,29 @@ HB_FUNC( WVW_STCREATE ) - iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; + iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; - iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; + iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0; + iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + iOffBottom; - iRight = xy.x - 1 + iOffRight; + iBottom = xy.y - 1 + iOffBottom; + iRight = xy.x - 1 + iOffRight; - uiCBid = LastControlId( usWinNum, WVW_CONTROL_STATIC ); + uiCBid = LastControlId( usWinNum, WVW_CONTROL_STATIC ); if( uiCBid == 0 ) { uiCBid = WVW_ID_BASE_STATIC; @@ -833,10 +833,10 @@ HB_FUNC( WVW_STCREATE ) // WNDPROC OldProc; - rXB.top = usTop; rXB.left = usLeft; - rXB.bottom = usBottom; rXB.right = usRight; - rOffXB.top = iOffTop; rOffXB.left = iOffLeft; - rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; + rXB.top = usTop; rXB.left = usLeft; + rXB.bottom = usBottom; rXB.right = usRight; + rOffXB.top = iOffTop; rOffXB.left = iOffLeft; + rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; if( HB_ISCHAR( 5 ) ) @@ -878,23 +878,23 @@ HB_FUNC( WVW_STSETTEXT ) HB_FUNC( WVW_STSETFONT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WVW_DATA * pData = hb_getWvwData(); - BOOL retval = TRUE; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WVW_DATA * pData = hb_getWvwData(); + BOOL retval = TRUE; - pData->s_lfST.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); - pData->s_lfST.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfST.lfWidth : hb_parni( 4 ); - pData->s_lfST.lfEscapement = 0; - pData->s_lfST.lfOrientation = 0; - pData->s_lfST.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfST.lfWeight : hb_parni( 5 ); - pData->s_lfST.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfST.lfItalic : ( BYTE ) hb_parl( 7 ); - pData->s_lfST.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfST.lfUnderline : ( BYTE ) hb_parl( 8 ); - pData->s_lfST.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfST.lfStrikeOut : ( BYTE ) hb_parl( 9 ); - pData->s_lfST.lfCharSet = DEFAULT_CHARSET; + pData->s_lfST.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); + pData->s_lfST.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfST.lfWidth : hb_parni( 4 ); + pData->s_lfST.lfEscapement = 0; + pData->s_lfST.lfOrientation = 0; + pData->s_lfST.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfST.lfWeight : hb_parni( 5 ); + pData->s_lfST.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfST.lfItalic : ( BYTE ) hb_parl( 7 ); + pData->s_lfST.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfST.lfUnderline : ( BYTE ) hb_parl( 8 ); + pData->s_lfST.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfST.lfStrikeOut : ( BYTE ) hb_parl( 9 ); + pData->s_lfST.lfCharSet = DEFAULT_CHARSET; - pData->s_lfST.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfST.lfQuality : ( BYTE ) hb_parni( 6 ); - pData->s_lfST.lfPitchAndFamily = FF_DONTCARE; + pData->s_lfST.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfST.lfQuality : ( BYTE ) hb_parni( 6 ); + pData->s_lfST.lfPitchAndFamily = FF_DONTCARE; if( HB_ISCHAR( 2 ) ) { strcpy( pData->s_lfST.lfFaceName, hb_parcx( 2 ) ); diff --git a/harbour/extras/gtwvw/wvwfuncs.c b/harbour/extras/gtwvw/wvwfuncs.c index 26baa2084a..7ba3037050 100644 --- a/harbour/extras/gtwvw/wvwfuncs.c +++ b/harbour/extras/gtwvw/wvwfuncs.c @@ -79,9 +79,9 @@ HB_FUNC( WVW_YESCLOSE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HMENU hMenu = GetSystemMenu( pWindowData->hWnd, FALSE ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HMENU hMenu = GetSystemMenu( pWindowData->hWnd, FALSE ); if( hMenu ) { @@ -237,8 +237,8 @@ HB_FUNC( WIN_SETDLGITEMTEXT ) HB_FUNC( WIN_GETDLGITEMTEXT ) { - USHORT iLen = ( USHORT ) SendMessage( ( HWND ) GetDlgItem( ( HWND ) HB_PARHANDLE( 1 ), hb_parni( 2 ) ), ( UINT ) WM_GETTEXTLENGTH, ( WPARAM ) 0, ( LPARAM ) 0 ) + 1; - char * cText = ( char * ) hb_xgrab( iLen + 1 ); + USHORT iLen = ( USHORT ) SendMessage( ( HWND ) GetDlgItem( ( HWND ) HB_PARHANDLE( 1 ), hb_parni( 2 ) ), ( UINT ) WM_GETTEXTLENGTH, ( WPARAM ) 0, ( LPARAM ) 0 ) + 1; + char * cText = ( char * ) hb_xgrab( iLen + 1 ); GetDlgItemText( ( HWND ) HB_PARHANDLE( 1 ), hb_parni( 2 ), @@ -328,8 +328,8 @@ HB_FUNC( WIN_LOADICON ) HB_FUNC( WIN_LOADIMAGE ) { - HBITMAP hImage = NULL; - int iSource = hb_parni( 2 ); + HBITMAP hImage = NULL; + int iSource = hb_parni( 2 ); switch( iSource ) { @@ -353,8 +353,8 @@ HB_FUNC( WIN_LOADIMAGE ) HB_FUNC( WIN_GETCLIENTRECT ) { - RECT rc = { 0 }; - PHB_ITEM info = hb_itemArrayNew( 4 ); + RECT rc = { 0 }; + PHB_ITEM info = hb_itemArrayNew( 4 ); GetClientRect( ( HWND ) HB_PARHANDLE( 1 ), &rc ); @@ -406,9 +406,9 @@ HB_FUNC( WIN_CREATEBRUSH ) { LOGBRUSH lb = { 0 }; - lb.lbStyle = hb_parni( 1 ); - lb.lbColor = HB_ISNIL( 2 ) ? RGB( 0, 0, 0 ) : ( COLORREF ) hb_parnl( 2 ); - lb.lbHatch = HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ); + lb.lbStyle = hb_parni( 1 ); + lb.lbColor = HB_ISNIL( 2 ) ? RGB( 0, 0, 0 ) : ( COLORREF ) hb_parnl( 2 ); + lb.lbHatch = HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ); hb_retnl( ( ULONG ) CreateBrushIndirect( &lb ) ); } @@ -422,10 +422,10 @@ HB_FUNC( WIN_DRAWTEXT ) { RECT rc = { 0 }; - 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_PARHANDLE( 1 ), hb_parc( 2 ), strlen( hb_parc( 2 ) ), &rc, hb_parni( 4 ) ) ); } @@ -439,30 +439,30 @@ HB_FUNC( WIN_DRAWTEXT ) HB_FUNC( WVW_GBCREATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - int iOffTop, iOffLeft, iOffBottom, iOffRight; + UINT usWinNum = WVW_WHICH_WINDOW; + int iOffTop, iOffLeft, iOffBottom, iOffRight; // int iStyle; - UINT uiPBid; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - LPCTSTR lpszCaption = HB_ISCHAR( 6 ) ? hb_parcx( 6 ) : NULL; - char * szBitmap = HB_ISCHAR( 7 ) ? ( char * ) hb_parcx( 7 ) : NULL; - UINT uiBitmap = HB_ISNUM( 7 ) ? ( UINT ) hb_parni( 7 ) : 0; - double dStretch = ! HB_ISNIL( 10 ) ? hb_parnd( 10 ) : 1; - BOOL bMap3Dcolors = HB_ISLOG( 11 ) ? ( BOOL ) hb_parl( 11 ) : FALSE; + UINT uiPBid; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + LPCTSTR lpszCaption = HB_ISCHAR( 6 ) ? hb_parcx( 6 ) : NULL; + char * szBitmap = HB_ISCHAR( 7 ) ? ( char * ) hb_parcx( 7 ) : NULL; + UINT uiBitmap = HB_ISNUM( 7 ) ? ( UINT ) hb_parni( 7 ) : 0; + double dStretch = ! HB_ISNIL( 10 ) ? hb_parnd( 10 ) : 1; + BOOL bMap3Dcolors = HB_ISLOG( 11 ) ? ( BOOL ) hb_parl( 11 ) : FALSE; - iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : -1; - iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : -1; - iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : +1; - iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : +1; + iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : -1; + iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : -1; + iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : +1; + iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : +1; - uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption, - szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ), - iOffTop, iOffLeft, iOffBottom, iOffRight, - dStretch, bMap3Dcolors, - BS_TEXT | BS_GROUPBOX | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE ); + uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption, + szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ), + iOffTop, iOffLeft, iOffBottom, iOffRight, + dStretch, bMap3Dcolors, + BS_TEXT | BS_GROUPBOX | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE ); hb_retnl( ( LONG ) uiPBid ); } @@ -471,19 +471,19 @@ HB_FUNC( WVW_GBCREATE ) HB_FUNC( WVW_RBCREATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - int iOffTop, iOffLeft, iOffBottom, iOffRight; + UINT usWinNum = WVW_WHICH_WINDOW; + int iOffTop, iOffLeft, iOffBottom, iOffRight; // int iStyle; - UINT uiPBid; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - LPCTSTR lpszCaption = HB_ISCHAR( 6 ) ? hb_parcx( 6 ) : NULL; - char * szBitmap = HB_ISCHAR( 7 ) ? ( char * ) hb_parcx( 7 ) : NULL; - UINT uiBitmap = HB_ISNUM( 7 ) ? ( UINT ) hb_parni( 7 ) : 0; - double dStretch = ! HB_ISNIL( 10 ) ? hb_parnd( 10 ) : 1; - BOOL bMap3Dcolors = HB_ISLOG( 11 ) ? ( BOOL ) hb_parl( 11 ) : FALSE; + UINT uiPBid; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + LPCTSTR lpszCaption = HB_ISCHAR( 6 ) ? hb_parcx( 6 ) : NULL; + char * szBitmap = HB_ISCHAR( 7 ) ? ( char * ) hb_parcx( 7 ) : NULL; + UINT uiBitmap = HB_ISNUM( 7 ) ? ( UINT ) hb_parni( 7 ) : 0; + double dStretch = ! HB_ISNIL( 10 ) ? hb_parnd( 10 ) : 1; + BOOL bMap3Dcolors = HB_ISLOG( 11 ) ? ( BOOL ) hb_parl( 11 ) : FALSE; if( ! HB_ISBLOCK( 8 ) ) { @@ -491,25 +491,25 @@ HB_FUNC( WVW_RBCREATE ) return; } - iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : -2; - iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : -2; - iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : +2; - iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : +2; + iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : -2; + iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : -2; + iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : +2; + iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : +2; - uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption, - szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ), - iOffTop, iOffLeft, iOffBottom, iOffRight, - dStretch, bMap3Dcolors, - BS_AUTORADIOBUTTON /*| WS_GROUP*/ ); + uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption, + szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ), + iOffTop, iOffLeft, iOffBottom, iOffRight, + dStretch, bMap3Dcolors, + BS_AUTORADIOBUTTON /*| WS_GROUP*/ ); hb_retnl( ( LONG ) uiPBid ); } HB_FUNC( WVW_SETCONTROLTEXT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - byte bStyle; - HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + byte bStyle; + HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); if( uiCtrlId == 0 || hWndPB == NULL ) { @@ -521,12 +521,12 @@ HB_FUNC( WVW_SETCONTROLTEXT ) HB_FUNC( WVW_PBVISIBLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); - byte bStyle; - HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); - int iCmdShow; + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); + byte bStyle; + HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); + int iCmdShow; if( uiCtrlId == 0 || hWndPB == NULL ) { @@ -547,12 +547,12 @@ HB_FUNC( WVW_PBVISIBLE ) HB_FUNC( WVW_CBVISIBLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); - byte bStyle; - HWND hWndCB = FindControlHandle( usWinNum, WVW_CONTROL_COMBOBOX, uiCtrlId, &bStyle ); - int iCmdShow; + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); + byte bStyle; + HWND hWndCB = FindControlHandle( usWinNum, WVW_CONTROL_COMBOBOX, uiCtrlId, &bStyle ); + int iCmdShow; if( hWndCB ) { @@ -574,12 +574,12 @@ HB_FUNC( WVW_CBVISIBLE ) HB_FUNC( WVW_CXVISIBLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); - byte bStyle; - HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); - int iCmdShow; + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); + byte bStyle; + HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); + int iCmdShow; if( uiCtrlId == 0 || hWndPB == NULL ) { @@ -598,21 +598,21 @@ HB_FUNC( WVW_CXVISIBLE ) hb_retl( ShowWindow( hWndPB, iCmdShow ) == 0 ); } -/*WVW_XBVisible( [nWinNum], nXBid, lShow ) - *show/hide scrollbar nXBid in window nWinNum (default to topmost window) - *nWinNum better be NIL - *nXBid is the handle of the scrolbar - *lShow: .T. shows the scrolbar (default) +/* WVW_XBVisible( [nWinNum], nXBid, lShow ) + * show/hide scrollbar nXBid in window nWinNum (default to topmost window) + * nWinNum better be NIL + * nXBid is the handle of the scrolbar + * lShow: .T. shows the scrolbar (default) * .F. hides the scrolbar - **returns .t. if successful + * returns .t. if successful */ HB_FUNC( WVW_XBVISIBLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - BOOL bShow = ( BOOL ) ( HB_ISLOG( 3 ) ? hb_parl( 3 ) : TRUE ); - byte bStyle; - HWND hWndXB = uiXBid == 0 ? NULL : FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + BOOL bShow = ( BOOL ) ( HB_ISLOG( 3 ) ? hb_parl( 3 ) : TRUE ); + byte bStyle; + HWND hWndXB = uiXBid == 0 ? NULL : FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); if( uiXBid == 0 || hWndXB == NULL ) { @@ -670,12 +670,12 @@ HB_FUNC( SENDMESSAGE ) HB_FUNC( SETPARENT ) { - UINT usWinNum = WVW_WHICH_WINDOW; // filho - UINT usWinNum1 = ( HB_ISNIL( 2 ) ? ( hb_gt_wvw_GetMainCoordMode() ? ( ( hb_gt_wvw_GetNumWindows() ) - 1 ) : hb_gt_wvw_GetCurWindow() ) : ( ( USHORT ) hb_parni( 2 ) ) ); //pai - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WIN_DATA * pWindowData1 = hb_gt_wvw_GetWindowsData( usWinNum1 ); - HWND hWndParent = pWindowData->hWnd; - HWND hWndParent1 = pWindowData1->hWnd; + UINT usWinNum = WVW_WHICH_WINDOW; // filho + UINT usWinNum1 = ( HB_ISNIL( 2 ) ? ( hb_gt_wvw_GetMainCoordMode() ? ( ( hb_gt_wvw_GetNumWindows() ) - 1 ) : hb_gt_wvw_GetCurWindow() ) : ( ( USHORT ) hb_parni( 2 ) ) ); //pai + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WIN_DATA * pWindowData1 = hb_gt_wvw_GetWindowsData( usWinNum1 ); + HWND hWndParent = pWindowData->hWnd; + HWND hWndParent1 = pWindowData1->hWnd; if( usWinNum1 != 0 ) SetParent( hWndParent, hWndParent1 ); @@ -709,13 +709,13 @@ HB_FUNC( ISWINDOW ) HB_FUNC( ADDTOOLTIPEX ) // changed by MAG { // HWND hWnd = (HWND) hb_parnl( 1 ); - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WVW_DATA * pData = hb_getWvwData(); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WVW_DATA * pData = hb_getWvwData(); - int iStyle = TTS_ALWAYSTIP; - INITCOMMONCONTROLSEX icex = { 0 }; - TOOLINFO ti = { 0 }; + int iStyle = TTS_ALWAYSTIP; + INITCOMMONCONTROLSEX icex = { 0 }; + TOOLINFO ti = { 0 }; /* Load the tooltip class from the DLL. */ @@ -740,9 +740,9 @@ HB_FUNC( ADDTOOLTIPEX ) // changed by MAG hb_retnl( 0 ); return; } - ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; - ti.hwnd = pWindowData->hWnd; - ti.uId = ( UINT ) hb_parnl( 2 ); + ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; + ti.hwnd = pWindowData->hWnd; + ti.uId = ( UINT ) hb_parnl( 2 ); // ti.uId = (UINT) GetDlgItem( hWnd, hb_parni( 2 ) ); ti.hinst = GetModuleHandle( NULL ); ti.lpszText = ( LPSTR ) hb_parc( 3 ); @@ -759,11 +759,11 @@ HB_FUNC( ADDTOOLTIPEX ) // changed by MAG */ HB_FUNC( CREATEIMAGELIST ) { - PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY ); - UINT flags = ( HB_ISNIL( 5 ) ) ? ILC_COLOR : hb_parni( 5 ); - HIMAGELIST himl; - ULONG ul, ulLen = hb_arrayLen( pArray ); - HBITMAP hbmp; + PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY ); + UINT flags = ( HB_ISNIL( 5 ) ) ? ILC_COLOR : hb_parni( 5 ); + HIMAGELIST himl; + ULONG ul, ulLen = hb_arrayLen( pArray ); + HBITMAP hbmp; himl = ImageList_Create( hb_parni( 2 ), hb_parni( 3 ), flags, ulLen, hb_parni( 4 ) ); @@ -874,20 +874,20 @@ HB_FUNC( LOADBITMAPEX ) HB_FUNC( OPENIMAGE ) { - const char * cFileName = hb_parc( 1 ); - BOOL lString = ( HB_ISNIL( 2 ) ) ? 0 : hb_parl( 2 ); - int iFileSize; - FILE * fp; + const char * cFileName = hb_parc( 1 ); + BOOL lString = ( HB_ISNIL( 2 ) ) ? 0 : hb_parl( 2 ); + int iFileSize; + FILE * fp; // IPicture * pPic; - LPPICTURE pPic; - IStream * pStream; - HGLOBAL hG; - HBITMAP hBitmap = 0; + LPPICTURE pPic; + IStream * pStream; + HGLOBAL hG; + HBITMAP hBitmap = 0; if( lString ) { - iFileSize = hb_parclen( 1 ); - hG = GlobalAlloc( GPTR, iFileSize ); + iFileSize = hb_parclen( 1 ); + hG = GlobalAlloc( GPTR, iFileSize ); if( ! hG ) { hb_retnl( 0 ); @@ -905,8 +905,8 @@ HB_FUNC( OPENIMAGE ) } fseek( fp, 0, SEEK_END ); - iFileSize = ftell( fp ); - hG = GlobalAlloc( GPTR, iFileSize ); + iFileSize = ftell( fp ); + hG = GlobalAlloc( GPTR, iFileSize ); if( ! hG ) { fclose( fp ); @@ -960,17 +960,17 @@ HB_FUNC( OPENIMAGE ) HB_FUNC( OPENBITMAP ) { - BITMAPFILEHEADER bmfh; - BITMAPINFOHEADER bmih; - LPBITMAPINFO lpbmi; - DWORD dwRead; - LPVOID lpvBits; - HGLOBAL hmem1, hmem2; - HBITMAP hbm; - HDC hDC = ( hb_pcount() > 1 && ! HB_ISNIL( 2 ) ) ? ( HDC ) HB_PARHANDLE( 2 ) : NULL; - HANDLE hfbm = CreateFile( hb_parc( 1 ), GENERIC_READ, FILE_SHARE_READ, - ( LPSECURITY_ATTRIBUTES ) NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_READONLY, ( HANDLE ) NULL ); + BITMAPFILEHEADER bmfh; + BITMAPINFOHEADER bmih; + LPBITMAPINFO lpbmi; + DWORD dwRead; + LPVOID lpvBits; + HGLOBAL hmem1, hmem2; + HBITMAP hbm; + HDC hDC = ( hb_pcount() > 1 && ! HB_ISNIL( 2 ) ) ? ( HDC ) HB_PARHANDLE( 2 ) : NULL; + HANDLE hfbm = CreateFile( hb_parc( 1 ), GENERIC_READ, FILE_SHARE_READ, + ( LPSECURITY_ATTRIBUTES ) NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_READONLY, ( HANDLE ) NULL ); if( ( ( long int ) hfbm ) <= 0 ) { @@ -985,15 +985,15 @@ HB_FUNC( OPENBITMAP ) /* Allocate memory for the BITMAPINFO structure. */ - hmem1 = GlobalAlloc( GHND, sizeof( BITMAPINFOHEADER ) + - ( ( 1 << bmih.biBitCount ) * sizeof( RGBQUAD ) ) ); - lpbmi = ( LPBITMAPINFO ) GlobalLock( hmem1 ); + hmem1 = GlobalAlloc( GHND, sizeof( BITMAPINFOHEADER ) + + ( ( 1 << bmih.biBitCount ) * sizeof( RGBQUAD ) ) ); + lpbmi = ( LPBITMAPINFO ) GlobalLock( hmem1 ); /* Load BITMAPINFOHEADER into the BITMAPINFO structure. */ - lpbmi->bmiHeader.biSize = bmih.biSize; - lpbmi->bmiHeader.biWidth = bmih.biWidth; - lpbmi->bmiHeader.biHeight = bmih.biHeight; - lpbmi->bmiHeader.biPlanes = bmih.biPlanes; + lpbmi->bmiHeader.biSize = bmih.biSize; + lpbmi->bmiHeader.biWidth = bmih.biWidth; + lpbmi->bmiHeader.biHeight = bmih.biHeight; + lpbmi->bmiHeader.biPlanes = bmih.biPlanes; lpbmi->bmiHeader.biBitCount = bmih.biBitCount; lpbmi->bmiHeader.biCompression = bmih.biCompression; @@ -1029,8 +1029,8 @@ HB_FUNC( OPENBITMAP ) } /* Allocate memory for the required number of bytes. */ - hmem2 = GlobalAlloc( GHND, ( bmfh.bfSize - bmfh.bfOffBits ) ); - lpvBits = GlobalLock( hmem2 ); + hmem2 = GlobalAlloc( GHND, ( bmfh.bfSize - bmfh.bfOffBits ) ); + lpvBits = GlobalLock( hmem2 ); /* Retrieve the bitmap data. */ @@ -1114,11 +1114,11 @@ HB_FUNC( REDRAWWINDOW ) HB_FUNC( CREATEFONT ) { HFONT hFont; - int fnWeight = ( HB_ISNIL( 4 ) ) ? 0 : hb_parni( 4 ); - DWORD fdwCharSet = ( HB_ISNIL( 5 ) ) ? 0 : hb_parnl( 5 ); - DWORD fdwItalic = ( HB_ISNIL( 6 ) ) ? 0 : hb_parnl( 6 ); - DWORD fdwUnderline = ( HB_ISNIL( 7 ) ) ? 0 : hb_parnl( 7 ); - DWORD fdwStrikeOut = ( HB_ISNIL( 8 ) ) ? 0 : hb_parnl( 8 ); + int fnWeight = ( HB_ISNIL( 4 ) ) ? 0 : hb_parni( 4 ); + DWORD fdwCharSet = ( HB_ISNIL( 5 ) ) ? 0 : hb_parnl( 5 ); + DWORD fdwItalic = ( HB_ISNIL( 6 ) ) ? 0 : hb_parnl( 6 ); + DWORD fdwUnderline = ( HB_ISNIL( 7 ) ) ? 0 : hb_parnl( 7 ); + DWORD fdwStrikeOut = ( HB_ISNIL( 8 ) ) ? 0 : hb_parnl( 8 ); hFont = CreateFont( hb_parni( 3 ), // logical height of font @@ -1143,12 +1143,12 @@ HB_FUNC( CREATEFONT ) HB_FUNC( SELECTFONT ) { - CHOOSEFONT cf; - LOGFONT lf; - HFONT hfont; - PHB_ITEM pObj = ( HB_ISNIL( 1 ) ) ? NULL : hb_param( 1, HB_IT_OBJECT ); + CHOOSEFONT cf; + LOGFONT lf; + HFONT hfont; + PHB_ITEM pObj = ( HB_ISNIL( 1 ) ) ? NULL : hb_param( 1, HB_IT_OBJECT ); //PHB_ITEM temp1; - PHB_ITEM aMetr = hb_itemArrayNew( 9 ); + PHB_ITEM aMetr = hb_itemArrayNew( 9 ); cf.lStructSize = sizeof( CHOOSEFONT ); cf.hwndOwner = ( HWND ) NULL; @@ -1161,11 +1161,11 @@ HB_FUNC( SELECTFONT ) cf.lpfnHook = ( LPCFHOOKPROC ) NULL; cf.lpTemplateName = ( LPSTR ) NULL; - cf.hInstance = ( HINSTANCE ) NULL; - cf.lpszStyle = ( LPSTR ) NULL; - cf.nFontType = SCREEN_FONTTYPE; - cf.nSizeMin = 0; - cf.nSizeMax = 0; + cf.hInstance = ( HINSTANCE ) NULL; + cf.lpszStyle = ( LPSTR ) NULL; + cf.nFontType = SCREEN_FONTTYPE; + cf.nSizeMin = 0; + cf.nSizeMax = 0; /* Display the CHOOSEFONT common-dialog box. */ @@ -1202,10 +1202,10 @@ HB_FUNC( INVALIDATERECT ) if( hb_pcount() > 2 ) { - rc.left = hb_parni( 3 ); - rc.top = hb_parni( 4 ); - rc.right = hb_parni( 5 ); - rc.bottom = hb_parni( 6 ); + rc.left = hb_parni( 3 ); + rc.top = hb_parni( 4 ); + rc.right = hb_parni( 5 ); + rc.bottom = hb_parni( 6 ); } InvalidateRect( @@ -1218,21 +1218,21 @@ HB_FUNC( INVALIDATERECT ) HB_FUNC( TOOLBARADDBUTTONS ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndCtrl = ( HWND ) HB_PARHANDLE( 2 ); + HWND hWndCtrl = ( HWND ) HB_PARHANDLE( 2 ); /* HWND hToolTip = ( HWND ) hb_parnl( 5 ) ; */ - PHB_ITEM pArray = hb_param( 3, HB_IT_ARRAY ); - int iButtons = hb_parni( 4 ); - TBBUTTON * tb = ( struct _TBBUTTON * ) hb_xgrab( iButtons * sizeof( TBBUTTON ) ); - PHB_ITEM pTemp; + PHB_ITEM pArray = hb_param( 3, HB_IT_ARRAY ); + int iButtons = hb_parni( 4 ); + TBBUTTON * tb = ( struct _TBBUTTON * ) hb_xgrab( iButtons * sizeof( TBBUTTON ) ); + PHB_ITEM pTemp; //BOOL bSystem; - ULONG ulCount; - ULONG ulID; - DWORD style = GetWindowLong( hWndCtrl, GWL_STYLE ); - USHORT usOldHeight; + ULONG ulCount; + ULONG ulID; + DWORD style = GetWindowLong( hWndCtrl, GWL_STYLE ); + USHORT usOldHeight; SetWindowLong( hWndCtrl, GWL_STYLE, style | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT ); @@ -1290,19 +1290,19 @@ HB_FUNC( SETBITMAPRESOURCEID ) switch( iBitmapType ) { case 0: - iOffset = 0; + iOffset = 0; break; case 1: - iOffset = pWindowData->iStartStdBitmap; + iOffset = pWindowData->iStartStdBitmap; break; case 2: - iOffset = pWindowData->iStartViewBitmap; + iOffset = pWindowData->iStartViewBitmap; break; case 3: - iOffset = pWindowData->iStartHistBitmap; + iOffset = pWindowData->iStartHistBitmap; break; default: - iOffset = 0; + iOffset = 0; break; } @@ -1310,9 +1310,9 @@ HB_FUNC( SETBITMAPRESOURCEID ) { - tbab.hInst = NULL; - tbab.nID = ( UINT ) hBitmap; - iNewBitmap = SendMessage( hWndToolbar, TB_ADDBITMAP, ( WPARAM ) 1, ( WPARAM ) &tbab ); + tbab.hInst = NULL; + tbab.nID = ( UINT ) hBitmap; + iNewBitmap = SendMessage( hWndToolbar, TB_ADDBITMAP, ( WPARAM ) 1, ( WPARAM ) &tbab ); } else /* system bitmap */ @@ -1338,13 +1338,13 @@ HB_FUNC( LOADICON ) } HB_FUNC( DRAWBITMAP ) { - HDC hDC = ( HDC ) HB_PARHANDLE( 1 ); - HDC hDCmem = CreateCompatibleDC( hDC ); - DWORD dwraster = ( HB_ISNIL( 3 ) ) ? SRCCOPY : hb_parnl( 3 ); - HBITMAP hBitmap = ( HBITMAP ) HB_PARHANDLE( 2 ); - BITMAP bitmap; - int nWidthDest = ( hb_pcount() >= 5 && ! HB_ISNIL( 6 ) ) ? hb_parni( 6 ) : 0; - int nHeightDest = ( hb_pcount() >= 6 && ! HB_ISNIL( 7 ) ) ? hb_parni( 7 ) : 0; + HDC hDC = ( HDC ) HB_PARHANDLE( 1 ); + HDC hDCmem = CreateCompatibleDC( hDC ); + DWORD dwraster = ( HB_ISNIL( 3 ) ) ? SRCCOPY : hb_parnl( 3 ); + HBITMAP hBitmap = ( HBITMAP ) HB_PARHANDLE( 2 ); + BITMAP bitmap; + int nWidthDest = ( hb_pcount() >= 5 && ! HB_ISNIL( 6 ) ) ? hb_parni( 6 ) : 0; + int nHeightDest = ( hb_pcount() >= 6 && ! HB_ISNIL( 7 ) ) ? hb_parni( 7 ) : 0; SelectObject( hDCmem, hBitmap ); GetObject( hBitmap, sizeof( BITMAP ), ( LPVOID ) &bitmap ); @@ -1362,12 +1362,12 @@ HB_FUNC( DRAWBITMAP ) } HB_FUNC( WINDOW2BITMAP ) { - HWND hWnd = ( HWND ) HB_PARHANDLE( 1 ); - BOOL lFull = ( HB_ISNIL( 2 ) ) ? 0 : ( BOOL ) hb_parl( 2 ); - HDC hDC = ( lFull ) ? GetWindowDC( hWnd ) : GetDC( hWnd ); - HDC hDCmem = CreateCompatibleDC( hDC ); - HBITMAP hBitmap; - RECT rc; + HWND hWnd = ( HWND ) HB_PARHANDLE( 1 ); + BOOL lFull = ( HB_ISNIL( 2 ) ) ? 0 : ( BOOL ) hb_parl( 2 ); + HDC hDC = ( lFull ) ? GetWindowDC( hWnd ) : GetDC( hWnd ); + HDC hDCmem = CreateCompatibleDC( hDC ); + HBITMAP hBitmap; + RECT rc; if( lFull ) GetWindowRect( hWnd, &rc ); @@ -1408,8 +1408,8 @@ HB_FUNC( WINDOW2BITMAP ) */ HB_FUNC( WVW_SETMAXBMCACHE ) { - WVW_DATA * p = hb_getWvwData(); - UINT uiOldMaxBMcache = p->s_sApp->uiMaxBMcache; + WVW_DATA * p = hb_getWvwData(); + UINT uiOldMaxBMcache = p->s_sApp->uiMaxBMcache; if( ! HB_ISNIL( 1 ) ) { @@ -1459,9 +1459,9 @@ HB_FUNC( WVW_NUMBMCACHE ) /*20040602: WARNING: WVT is slightly different*/ HB_FUNC( WVW_SETTIMER ) { - WVW_DATA * p = hb_getWvwData(); - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WVW_DATA * p = hb_getWvwData(); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); if( p->s_sApp->pSymWVW_TIMER ) { @@ -1482,9 +1482,9 @@ HB_FUNC( WVW_SETTIMER ) /*20040602: WARNING: WVT is slightly different */ HB_FUNC( WVW_KILLTIMER ) { - WVW_DATA * p = hb_getWvwData(); - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WVW_DATA * p = hb_getWvwData(); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); if( p->s_sApp->pSymWVW_TIMER ) { @@ -1509,11 +1509,11 @@ HB_FUNC( WVW_KILLTIMER ) /*(in WVT these is reflected in {0,0,0,0}) */ HB_FUNC( WVW_GETPAINTRECT ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - RECT rPaintRect = pWindowData->rPaintPending; - PHB_ITEM info = hb_itemArrayNew( 4 ); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + RECT rPaintRect = pWindowData->rPaintPending; + PHB_ITEM info = hb_itemArrayNew( 4 ); hb_arraySetNI( info, 1, rPaintRect.top ); hb_arraySetNI( info, 2, rPaintRect.left ); @@ -1527,10 +1527,10 @@ HB_FUNC( WVW_GETPAINTRECT ) HB_FUNC( WVW_SETPOINTER ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iCursor = hb_parni( 2 ); - HCURSOR hCursor; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int iCursor = hb_parni( 2 ); + HCURSOR hCursor; switch( iCursor ) { @@ -1614,10 +1614,10 @@ HB_FUNC( WVW_SETPOINTER ) /* */ HB_FUNC( WVW_LOADPICTURE ) { - WVW_DATA * p = hb_getWvwData(); - IPicture * iPicture = hb_gt_wvwLoadPicture( hb_parcx( 2 ) ); - BOOL bResult = FALSE; - int iSlot = hb_parni( 1 ) - 1; + WVW_DATA * p = hb_getWvwData(); + IPicture * iPicture = hb_gt_wvwLoadPicture( hb_parcx( 2 ) ); + BOOL bResult = FALSE; + int iSlot = hb_parni( 1 ) - 1; if( iPicture ) { @@ -1626,8 +1626,8 @@ HB_FUNC( WVW_LOADPICTURE ) hb_gt_wvwDestroyPicture( p->s_sApp->iPicture[ iSlot ] ); } - p->s_sApp->iPicture[ iSlot ] = iPicture; - bResult = TRUE; + p->s_sApp->iPicture[ iSlot ] = iPicture; + bResult = TRUE; } hb_retl( bResult ); } @@ -1639,26 +1639,26 @@ HB_FUNC( WVW_LOADPICTURE ) /* */ HB_FUNC( WVW_LOADFONT ) { - WVW_DATA * p = hb_getWvwData(); - UINT usWinNum = p->s_usNumWindows - 1; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - LOGFONT logfont; - int iSlot = hb_parni( 1 ) - 1; - HFONT hFont; + WVW_DATA * p = hb_getWvwData(); + UINT usWinNum = p->s_usNumWindows - 1; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + LOGFONT logfont; + int iSlot = hb_parni( 1 ) - 1; + HFONT hFont; - logfont.lfEscapement = ( HB_ISNIL( 11 ) ? 0 : ( hb_parni( 11 ) * 10 ) ); - logfont.lfOrientation = 0; - logfont.lfWeight = ( HB_ISNIL( 5 ) ? 0 : hb_parni( 5 ) ); - logfont.lfItalic = ( HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 ) ); - logfont.lfUnderline = ( HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 ) ); - logfont.lfStrikeOut = ( HB_ISNIL( 8 ) ? 0 : ( BYTE ) hb_parl( 8 ) ); - logfont.lfCharSet = ( HB_ISNIL( 9 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 9 ) ); - logfont.lfOutPrecision = 0; - logfont.lfClipPrecision = 0; - logfont.lfQuality = ( HB_ISNIL( 10 ) ? ( BYTE ) DEFAULT_QUALITY : ( BYTE ) hb_parni( 10 ) ); - logfont.lfPitchAndFamily = FF_DONTCARE; - logfont.lfHeight = ( HB_ISNIL( 3 ) ? pWindowData->fontHeight : hb_parni( 3 ) ); - logfont.lfWidth = ( HB_ISNIL( 4 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 4 ) ); + logfont.lfEscapement = ( HB_ISNIL( 11 ) ? 0 : ( hb_parni( 11 ) * 10 ) ); + logfont.lfOrientation = 0; + logfont.lfWeight = ( HB_ISNIL( 5 ) ? 0 : hb_parni( 5 ) ); + logfont.lfItalic = ( HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 ) ); + logfont.lfUnderline = ( HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 ) ); + logfont.lfStrikeOut = ( HB_ISNIL( 8 ) ? 0 : ( BYTE ) hb_parl( 8 ) ); + logfont.lfCharSet = ( HB_ISNIL( 9 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 9 ) ); + logfont.lfOutPrecision = 0; + logfont.lfClipPrecision = 0; + logfont.lfQuality = ( HB_ISNIL( 10 ) ? ( BYTE ) DEFAULT_QUALITY : ( BYTE ) hb_parni( 10 ) ); + logfont.lfPitchAndFamily = FF_DONTCARE; + logfont.lfHeight = ( HB_ISNIL( 3 ) ? pWindowData->fontHeight : hb_parni( 3 ) ); + logfont.lfWidth = ( HB_ISNIL( 4 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 4 ) ); strcpy( logfont.lfFaceName, ( HB_ISNIL( 2 ) ? pWindowData->fontFace : hb_parcx( 2 ) ) ); @@ -1679,17 +1679,17 @@ HB_FUNC( WVW_LOADFONT ) /* */ HB_FUNC( WVW_LOADPEN ) { - WVW_DATA * p = hb_getWvwData(); - int iPenWidth, iPenStyle; - COLORREF crColor; - HPEN hPen; - int iSlot = hb_parni( 1 ) - 1; + WVW_DATA * p = hb_getWvwData(); + int iPenWidth, iPenStyle; + COLORREF crColor; + HPEN hPen; + int iSlot = hb_parni( 1 ) - 1; - iPenStyle = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - iPenWidth = HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ); - crColor = HB_ISNIL( 4 ) ? RGB( 0, 0, 0 ) : ( COLORREF ) hb_parnl( 4 ); + iPenStyle = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + iPenWidth = HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ); + crColor = HB_ISNIL( 4 ) ? RGB( 0, 0, 0 ) : ( COLORREF ) hb_parnl( 4 ); - hPen = CreatePen( iPenStyle, iPenWidth, crColor ); + hPen = CreatePen( iPenStyle, iPenWidth, crColor ); if( hPen ) { @@ -1712,8 +1712,8 @@ HB_FUNC( WVW_LOADPEN ) HB_FUNC( WVW_MESSAGEBOX ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); hb_retni( MessageBox( pWindowData->hWnd, hb_parcx( 2 ), hb_parcx( 3 ), HB_ISNIL( 4 ) ? MB_OK : hb_parni( 4 ) ) ); } @@ -1735,25 +1735,25 @@ HB_FUNC( WVW_MESSAGEBOX ) HB_FUNC( WVW_CHOOSEFONT ) { - CHOOSEFONT cf = { 0 }; - LOGFONT lf = { 0 }; - LONG PointSize = 0; - WVW_DATA * p = hb_getWvwData(); + CHOOSEFONT cf = { 0 }; + LOGFONT lf = { 0 }; + LONG PointSize = 0; + WVW_DATA * p = hb_getWvwData(); if( ! HB_ISNIL( 2 ) ) { PointSize = -MulDiv( ( LONG ) hb_parnl( 2 ), GetDeviceCaps( p->s_pWindows[ p->s_usNumWindows - 1 ]->hdc, LOGPIXELSY ), 72 ); } - lf.lfHeight = PointSize; - lf.lfWidth = HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ); - lf.lfWeight = HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ); - lf.lfItalic = HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 ); - lf.lfUnderline = HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 ); - lf.lfStrikeOut = HB_ISNIL( 8 ) ? 0 : ( BYTE ) hb_parl( 8 ); - lf.lfCharSet = DEFAULT_CHARSET; - lf.lfQuality = HB_ISNIL( 5 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 5 ); - lf.lfPitchAndFamily = FF_DONTCARE; + lf.lfHeight = PointSize; + lf.lfWidth = HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ); + lf.lfWeight = HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ); + lf.lfItalic = HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 ); + lf.lfUnderline = HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 ); + lf.lfStrikeOut = HB_ISNIL( 8 ) ? 0 : ( BYTE ) hb_parl( 8 ); + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfQuality = HB_ISNIL( 5 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 5 ); + lf.lfPitchAndFamily = FF_DONTCARE; if( HB_ISCHAR( 1 ) ) { strcpy( lf.lfFaceName, hb_parcx( 1 ) ); @@ -1826,12 +1826,12 @@ HB_FUNC( WVW_CHOOSECOLOR ) crCustClr[ i ] = ( HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i + 1 ) : GetSysColor( COLOR_BTNFACE ) ); } - cc.lStructSize = sizeof( CHOOSECOLOR ); - cc.hwndOwner = p->s_pWindows[ p->s_usNumWindows - 1 ]->hWnd; - cc.rgbResult = HB_ISNIL( 1 ) ? 0 : ( COLORREF ) hb_parnl( 1 ); - cc.lpCustColors = crCustClr; + cc.lStructSize = sizeof( CHOOSECOLOR ); + cc.hwndOwner = p->s_pWindows[ p->s_usNumWindows - 1 ]->hWnd; + cc.rgbResult = HB_ISNIL( 1 ) ? 0 : ( COLORREF ) hb_parnl( 1 ); + cc.lpCustColors = crCustClr; - cc.Flags = ( WORD ) ( HB_ISNIL( 3 ) ? CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN : hb_parnl( 3 ) ); + cc.Flags = ( WORD ) ( HB_ISNIL( 3 ) ? CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN : hb_parnl( 3 ) ); if( ChooseColor( &cc ) ) { @@ -1855,11 +1855,11 @@ HB_FUNC( WVW_CHOOSECOLOR ) HB_FUNC( WVW_SETMOUSEPOS ) { - POINT xy = { 0 }; - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - USHORT usRow = ( USHORT ) hb_parni( 2 ), - usCol = ( USHORT ) hb_parni( 3 ); + POINT xy = { 0 }; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + USHORT usRow = ( USHORT ) hb_parni( 2 ), + usCol = ( USHORT ) hb_parni( 3 ); if( hb_gt_wvw_GetMainCoordMode() ) { @@ -1896,60 +1896,60 @@ HB_FUNC( WVW_SETMOUSEPOS ) HB_FUNC( WVW_FILLRECTANGLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WVW_DATA * p = hb_getWvwData(); - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - COLORREF crRGBcolor = ( HB_ISNIL( 6 ) ? 0 : hb_parnl( 6 ) ); - BOOL bTight = ( HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) ); - BOOL bUseBrush = ( HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ) ); - LOGBRUSH lb = { 0 }; + UINT usWinNum = WVW_WHICH_WINDOW; + WVW_DATA * p = hb_getWvwData(); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + COLORREF crRGBcolor = ( HB_ISNIL( 6 ) ? 0 : hb_parnl( 6 ) ); + BOOL bTight = ( HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) ); + BOOL bUseBrush = ( HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ) ); + LOGBRUSH lb = { 0 }; HBRUSH hBrush; - RECT xyRect = { 0 }; + RECT xyRect = { 0 }; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : 0; - iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : 0; + iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : 0; + iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : 0; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = bTight ? xy.y + 2 : xy.y; - iLeft = bTight ? xy.x + 2 : xy.x; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = bTight ? xy.y + 2 : xy.y; + iLeft = bTight ? xy.x + 2 : xy.x; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1; - iRight = xy.x - 1; + iBottom = xy.y - 1; + iRight = xy.x - 1; // Aplica OffSet - iTop += iOffTop; - iLeft += iOffLeft; - iBottom += iOffBottom; - iRight += iOffRight; + iTop += iOffTop; + iLeft += iOffLeft; + iBottom += iOffBottom; + iRight += iOffRight; - xyRect.left = iLeft; - xyRect.top = iTop; - xyRect.right = iRight + 1; - xyRect.bottom = iBottom + 1; + xyRect.left = iLeft; + xyRect.top = iTop; + xyRect.right = iRight + 1; + xyRect.bottom = iBottom + 1; - lb.lbStyle = BS_SOLID; - lb.lbColor = crRGBcolor; - lb.lbHatch = 0; + lb.lbStyle = BS_SOLID; + lb.lbColor = crRGBcolor; + lb.lbHatch = 0; - hBrush = ! bUseBrush ? CreateBrushIndirect( &lb ) : ( HBRUSH ) HB_PARHANDLE( 6 ); + hBrush = ! bUseBrush ? CreateBrushIndirect( &lb ) : ( HBRUSH ) HB_PARHANDLE( 6 ); FillRect( pWindowData->hdc, &xyRect, hBrush ); @@ -2034,21 +2034,21 @@ HB_FUNC( WVW_DLGSETICON ) HB_FUNC( WVW_SETPEN ) { - int iPenWidth, iPenStyle; - COLORREF crColor; - HPEN hPen; - WVW_DATA * p = hb_getWvwData(); + int iPenWidth, iPenStyle; + COLORREF crColor; + HPEN hPen; + WVW_DATA * p = hb_getWvwData(); if( HB_ISNIL( 1 ) ) { hb_retl( FALSE ); } - iPenStyle = hb_parni( 1 ); - iPenWidth = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - crColor = HB_ISNIL( 3 ) ? RGB( 0, 0, 0 ) : ( COLORREF ) hb_parnl( 3 ); + iPenStyle = hb_parni( 1 ); + iPenWidth = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + crColor = HB_ISNIL( 3 ) ? RGB( 0, 0, 0 ) : ( COLORREF ) hb_parnl( 3 ); - hPen = CreatePen( iPenStyle, iPenWidth, crColor ); + hPen = CreatePen( iPenStyle, iPenWidth, crColor ); if( hPen ) { @@ -2087,20 +2087,20 @@ HB_FUNC( WVW_SETPEN ) HB_FUNC( WVW_SETBRUSH ) { - HBRUSH hBrush; - LOGBRUSH lb = { 0 }; - WVW_DATA * p = hb_getWvwData(); + HBRUSH hBrush; + LOGBRUSH lb = { 0 }; + WVW_DATA * p = hb_getWvwData(); if( HB_ISNIL( 1 ) ) { hb_retl( FALSE ); } - lb.lbStyle = hb_parnl( 1 ); - lb.lbColor = HB_ISNIL( 2 ) ? RGB( 0, 0, 0 ) : ( COLORREF ) hb_parnl( 2 ); - lb.lbHatch = HB_ISNIL( 3 ) ? 0 : hb_parnl( 3 ); + lb.lbStyle = hb_parnl( 1 ); + lb.lbColor = HB_ISNIL( 2 ) ? RGB( 0, 0, 0 ) : ( COLORREF ) hb_parnl( 2 ); + lb.lbHatch = HB_ISNIL( 3 ) ? 0 : hb_parnl( 3 ); - hBrush = CreateBrushIndirect( &lb ); + hBrush = CreateBrushIndirect( &lb ); if( hBrush ) { @@ -2130,38 +2130,38 @@ HB_FUNC( WVW_SETBRUSH ) HB_FUNC( WVW__MAKEDLGTEMPLATE ) { - WORD * p, * pdlgtemplate; - WORD nItems = ( WORD ) hb_parvni( 1, 4 ); - int i, nchar; - DWORD lStyle; + WORD * p, * pdlgtemplate; + WORD nItems = ( WORD ) hb_parvni( 1, 4 ); + int i, nchar; + DWORD lStyle; - pdlgtemplate = p = ( PWORD ) LocalAlloc( LPTR, 65534 ); + pdlgtemplate = p = ( PWORD ) LocalAlloc( LPTR, 65534 ); - lStyle = hb_parvnl( 1, 3 ); + lStyle = hb_parvnl( 1, 3 ); - *p++ = 1; - *p++ = 0xFFFF; - *p++ = LOWORD( hb_parvnl( 1, 1 ) ); - *p++ = HIWORD( hb_parvnl( 1, 1 ) ); + *p++ = 1; + *p++ = 0xFFFF; + *p++ = LOWORD( hb_parvnl( 1, 1 ) ); + *p++ = HIWORD( hb_parvnl( 1, 1 ) ); - *p++ = LOWORD( hb_parvnl( 1, 2 ) ); - *p++ = HIWORD( hb_parvnl( 1, 2 ) ); + *p++ = LOWORD( hb_parvnl( 1, 2 ) ); + *p++ = HIWORD( hb_parvnl( 1, 2 ) ); - *p++ = LOWORD( lStyle ); - *p++ = HIWORD( lStyle ); + *p++ = LOWORD( lStyle ); + *p++ = HIWORD( lStyle ); - *p++ = ( WORD ) nItems; - *p++ = ( short ) hb_parvni( 1, 5 ); - *p++ = ( short ) hb_parvni( 1, 6 ); - *p++ = ( short ) hb_parvni( 1, 7 ); - *p++ = ( short ) hb_parvni( 1, 8 ); - *p++ = ( short ) 0; - *p++ = ( short ) 0x00; + *p++ = ( WORD ) nItems; + *p++ = ( short ) hb_parvni( 1, 5 ); + *p++ = ( short ) hb_parvni( 1, 6 ); + *p++ = ( short ) hb_parvni( 1, 7 ); + *p++ = ( short ) hb_parvni( 1, 8 ); + *p++ = ( short ) 0; + *p++ = ( short ) 0x00; if( hb_parinfa( 1, 11 ) == HB_IT_STRING ) { nchar = nCopyAnsiToWideChar( p, TEXT( ( char * ) hb_parvcx( 1, 11 ) ) ); - p += nchar; + p += nchar; } else { @@ -2170,57 +2170,57 @@ HB_FUNC( WVW__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, TEXT( ( char * ) hb_parvcx( 1, 15 ) ) ); - p += nchar; + p += nchar; } ; for( i = 1; i <= nItems; i++ ) { - p = lpwAlign( p ); + p = lpwAlign( p ); - *p++ = LOWORD( hb_parvnl( 2, i ) ); - *p++ = HIWORD( hb_parvnl( 2, i ) ); + *p++ = LOWORD( hb_parvnl( 2, i ) ); + *p++ = HIWORD( hb_parvnl( 2, i ) ); - *p++ = LOWORD( hb_parvnl( 3, i ) ); - *p++ = HIWORD( hb_parvnl( 3, i ) ); + *p++ = LOWORD( hb_parvnl( 3, i ) ); + *p++ = HIWORD( hb_parvnl( 3, i ) ); - *p++ = LOWORD( hb_parvnl( 4, i ) ); - *p++ = HIWORD( hb_parvnl( 4, i ) ); + *p++ = LOWORD( hb_parvnl( 4, i ) ); + *p++ = HIWORD( hb_parvnl( 4, i ) ); - *p++ = ( short ) hb_parvni( 5, i ); - *p++ = ( short ) hb_parvni( 6, i ); - *p++ = ( short ) hb_parvni( 7, i ); - *p++ = ( short ) hb_parvni( 8, i ); + *p++ = ( short ) hb_parvni( 5, i ); + *p++ = ( short ) hb_parvni( 6, i ); + *p++ = ( short ) hb_parvni( 7, i ); + *p++ = ( short ) hb_parvni( 8, i ); - *p++ = LOWORD( hb_parvnl( 9, i ) ); - *p++ = HIWORD( hb_parvnl( 9, i ) ); + *p++ = LOWORD( hb_parvnl( 9, i ) ); + *p++ = HIWORD( hb_parvnl( 9, i ) ); if( hb_parinfa( 10, i ) == HB_IT_STRING ) { nchar = nCopyAnsiToWideChar( p, TEXT( ( char * ) hb_parvcx( 10, i ) ) ); - p += nchar; + p += nchar; } else { - *p++ = 0xFFFF; - *p++ = ( WORD ) hb_parvni( 10, i ); + *p++ = 0xFFFF; + *p++ = ( WORD ) hb_parvni( 10, i ); } if( hb_parinfa( 11, i ) == HB_IT_STRING ) { nchar = nCopyAnsiToWideChar( p, ( LPSTR ) hb_parvcx( 11, i ) ); - p += nchar; + p += nchar; } else { - *p++ = 0xFFFF; - *p++ = ( WORD ) hb_parvni( 11, i ); + *p++ = 0xFFFF; + *p++ = ( WORD ) hb_parvni( 11, i ); } *p++ = 0x00; @@ -2237,8 +2237,8 @@ HB_FUNC( WVW__MAKEDLGTEMPLATE ) HB_FUNC( WVW_GETCURSORPOS ) { - POINT xy = { 0 }; - PHB_ITEM info = hb_itemArrayNew( 2 ); + POINT xy = { 0 }; + PHB_ITEM info = hb_itemArrayNew( 2 ); GetCursorPos( &xy ); @@ -2259,9 +2259,9 @@ HB_FUNC( WVW_GETCURSORPOS ) /* WVW_ShowWindow( [nWinNum], nCmdShow ) */ HB_FUNC( WVW_SHOWWINDOW ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iCmdShow = HB_ISNUM( 2 ) ? hb_parni( 2 ) : SW_SHOWNORMAL; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int iCmdShow = HB_ISNUM( 2 ) ? hb_parni( 2 ) : SW_SHOWNORMAL; ShowWindow( pWindowData->hWnd, iCmdShow ); } @@ -2271,9 +2271,9 @@ HB_FUNC( WVW_SHOWWINDOW ) /* WVW_UpdateWindow( [nWinNum] ) */ HB_FUNC( WVW_UPDATEWINDOW ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); UpdateWindow( pWindowData->hWnd ); } @@ -2286,14 +2286,14 @@ HB_FUNC( WVW_UPDATEWINDOW ) HB_FUNC( WVW_CREATEDIALOGDYNAMIC ) { - PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY ); - PHB_ITEM pFunc = NULL; - PHB_DYNS pExecSym; - WVW_DATA * p = hb_getWvwData(); - HWND hDlg = NULL; - int iIndex; - int iType = 0; - int iResource = hb_parni( 4 ); + PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY ); + PHB_ITEM pFunc = NULL; + PHB_DYNS pExecSym; + WVW_DATA * p = hb_getWvwData(); + HWND hDlg = NULL; + int iIndex; + int iType = 0; + int iResource = hb_parni( 4 ); /* check if we still have room for a new dialog */ @@ -2408,14 +2408,14 @@ HB_FUNC( WVW_CREATEDIALOGDYNAMIC ) HB_FUNC( WVW_CREATEDIALOGMODAL ) { - PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY ); - PHB_ITEM pFunc = NULL; - PHB_DYNS pExecSym; - WVW_DATA * p = hb_getWvwData(); - int iIndex; - int iResource = hb_parni( 4 ); - int iResult = 0; - HWND hParent = HB_ISNIL( 5 ) ? p->s_pWindows[ 0 ]->hWnd : ( HWND ) HB_PARHANDLE( 5 ); + PHB_ITEM pFirst = hb_param( 3, HB_IT_ANY ); + PHB_ITEM pFunc = NULL; + PHB_DYNS pExecSym; + WVW_DATA * p = hb_getWvwData(); + int iIndex; + int iResource = hb_parni( 4 ); + int iResult = 0; + HWND hParent = HB_ISNIL( 5 ) ? p->s_pWindows[ 0 ]->hWnd : ( HWND ) HB_PARHANDLE( 5 ); /* check if we still have room for a new dialog */ for( iIndex = 0; iIndex < WVW_DLGMD_MAX; iIndex++ ) @@ -2437,11 +2437,11 @@ HB_FUNC( WVW_CREATEDIALOGMODAL ) { /* pFunc is pointing to stored code block (later) */ - p->s_sApp->pcbFuncModal[ iIndex ] = hb_itemNew( pFirst ); + p->s_sApp->pcbFuncModal[ iIndex ] = hb_itemNew( pFirst ); - pFunc = p->s_sApp->pcbFuncModal[ iIndex ]; - p->s_sApp->pFuncModal[ iIndex ] = pFunc; - p->s_sApp->iTypeModal[ iIndex ] = 2; + pFunc = p->s_sApp->pcbFuncModal[ iIndex ]; + p->s_sApp->pFuncModal[ iIndex ] = pFunc; + p->s_sApp->iTypeModal[ iIndex ] = 2; } else if( HB_IS_STRING( pFirst ) == HB_IT_STRING ) { @@ -2450,8 +2450,8 @@ HB_FUNC( WVW_CREATEDIALOGMODAL ) { pFunc = ( PHB_ITEM ) pExecSym; } - p->s_sApp->pFuncModal[ iIndex ] = pFunc; - p->s_sApp->iTypeModal[ iIndex ] = 1; + p->s_sApp->pFuncModal[ iIndex ] = pFunc; + p->s_sApp->iTypeModal[ iIndex ] = 1; } switch( iResource ) @@ -2494,9 +2494,9 @@ HB_FUNC( WVW_DELETEOBJECT ) HB_FUNC( WVW_SETONTOP ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - RECT rect = { 0 }; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + RECT rect = { 0 }; GetWindowRect( pWindowData->hWnd, &rect ); @@ -2512,9 +2512,9 @@ HB_FUNC( WVW_SETONTOP ) HB_FUNC( WVW_SETASNORMAL ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - RECT rect = { 0 }; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + RECT rect = { 0 }; GetWindowRect( pWindowData->hWnd, &rect ); @@ -2537,38 +2537,38 @@ HB_FUNC( WVW_SETASNORMAL ) HB_FUNC( WVW_SAVESCREEN ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HBITMAP hBmp, oldBmp; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight, iWidth, iHeight; - PHB_ITEM info = hb_itemArrayNew( 3 ); + HBITMAP hBmp, oldBmp; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight, iWidth, iHeight; + PHB_ITEM info = hb_itemArrayNew( 3 ); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y; - iLeft = xy.x; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y; + iLeft = xy.x; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - iBottom = xy.y - 1; - iRight = xy.x - 1; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + iBottom = xy.y - 1; + iRight = xy.x - 1; - iWidth = iRight - iLeft + 1; - iHeight = iBottom - iTop + 1; + iWidth = iRight - iLeft + 1; + iHeight = iBottom - iTop + 1; - hBmp = CreateCompatibleBitmap( pWindowData->hdc, iWidth, iHeight ); + hBmp = CreateCompatibleBitmap( pWindowData->hdc, iWidth, iHeight ); - oldBmp = ( HBITMAP ) SelectObject( pWindowData->hCompDC, hBmp ); + oldBmp = ( HBITMAP ) SelectObject( pWindowData->hCompDC, hBmp ); BitBlt( pWindowData->hCompDC, 0, 0, iWidth, iHeight, pWindowData->hdc, iLeft, iTop, SRCCOPY ); SelectObject( pWindowData->hCompDC, oldBmp ); @@ -2590,38 +2590,38 @@ HB_FUNC( WVW_SAVESCREEN ) HB_FUNC( WVW_RESTSCREEN ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight, iWidth, iHeight; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight, iWidth, iHeight; - HBITMAP hBmp; + HBITMAP hBmp; - BOOL bResult = FALSE; - BOOL bDoNotDestroyBMP = HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); + BOOL bResult = FALSE; + BOOL bDoNotDestroyBMP = HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y; - iLeft = xy.x; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y; + iLeft = xy.x; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - iBottom = xy.y - 1; - iRight = xy.x - 1; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + iBottom = xy.y - 1; + iRight = xy.x - 1; - iWidth = iRight - iLeft + 1; - iHeight = iBottom - iTop + 1; + iWidth = iRight - iLeft + 1; + iHeight = iBottom - iTop + 1; - hBmp = ( HBITMAP ) SelectObject( pWindowData->hCompDC, ( HBITMAP ) hb_parvnl( 6, 3 ) ); + hBmp = ( HBITMAP ) SelectObject( pWindowData->hCompDC, ( HBITMAP ) hb_parvnl( 6, 3 ) ); if( hBmp ) { if( ( iWidth == hb_parvni( 6, 1 ) ) && ( iHeight == hb_parvni( 6, 2 ) ) ) @@ -2675,28 +2675,28 @@ HB_FUNC( WVW_RESTSCREEN ) /* */ HB_FUNC( WVW_CREATEFONT ) { - WVW_DATA * p = hb_getWvwData(); - UINT usWinNum = p->s_usNumWindows - 1; + WVW_DATA * p = hb_getWvwData(); + UINT usWinNum = p->s_usNumWindows - 1; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - LOGFONT logfont; - HFONT hFont; + LOGFONT logfont; + HFONT hFont; - logfont.lfEscapement = ( HB_ISNIL( 10 ) ? 0 : ( hb_parni( 10 ) * 10 ) ); - logfont.lfOrientation = 0; - logfont.lfWeight = ( HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ) ); - logfont.lfItalic = ( HB_ISNIL( 5 ) ? 0 : ( BYTE ) hb_parl( 5 ) ); - logfont.lfUnderline = ( HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 ) ); - logfont.lfStrikeOut = ( HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 ) ); - logfont.lfCharSet = ( HB_ISNIL( 8 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 8 ) ); - logfont.lfOutPrecision = 0; - logfont.lfClipPrecision = 0; - logfont.lfQuality = ( HB_ISNIL( 9 ) ? ( BYTE ) DEFAULT_QUALITY : ( BYTE ) hb_parni( 9 ) ); - logfont.lfPitchAndFamily = FF_DONTCARE; - logfont.lfHeight = ( HB_ISNIL( 2 ) ? pWindowData->fontHeight : hb_parni( 2 ) ); - logfont.lfWidth = ( HB_ISNIL( 3 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 3 ) ); + logfont.lfEscapement = ( HB_ISNIL( 10 ) ? 0 : ( hb_parni( 10 ) * 10 ) ); + logfont.lfOrientation = 0; + logfont.lfWeight = ( HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ) ); + logfont.lfItalic = ( HB_ISNIL( 5 ) ? 0 : ( BYTE ) hb_parl( 5 ) ); + logfont.lfUnderline = ( HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 ) ); + logfont.lfStrikeOut = ( HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 ) ); + logfont.lfCharSet = ( HB_ISNIL( 8 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 8 ) ); + logfont.lfOutPrecision = 0; + logfont.lfClipPrecision = 0; + logfont.lfQuality = ( HB_ISNIL( 9 ) ? ( BYTE ) DEFAULT_QUALITY : ( BYTE ) hb_parni( 9 ) ); + logfont.lfPitchAndFamily = FF_DONTCARE; + logfont.lfHeight = ( HB_ISNIL( 2 ) ? pWindowData->fontHeight : hb_parni( 2 ) ); + logfont.lfWidth = ( HB_ISNIL( 3 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 3 ) ); strcpy( logfont.lfFaceName, ( HB_ISNIL( 1 ) ? pWindowData->fontFace : hb_parcx( 1 ) ) ); diff --git a/harbour/extras/gtwvw/wvwmenu.c b/harbour/extras/gtwvw/wvwmenu.c index d298ce51ef..995675a0bb 100644 --- a/harbour/extras/gtwvw/wvwmenu.c +++ b/harbour/extras/gtwvw/wvwmenu.c @@ -90,8 +90,8 @@ HB_FUNC( WVW_SETMENU ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWinData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWinData = hb_gt_wvw_GetWindowsData( usWinNum ); SetMenu( pWinData->hWnd, ( HMENU ) HB_PARHANDLE( 2 ) ); @@ -102,9 +102,9 @@ HB_FUNC( WVW_SETMENU ) HB_FUNC( WVW_SETPOPUPMENU ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWinData = hb_gt_wvw_GetWindowsData( usWinNum ); - HMENU hPopup = pWinData->hPopup; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWinData = hb_gt_wvw_GetWindowsData( usWinNum ); + HMENU hPopup = pWinData->hPopup; pWinData->hPopup = ( HMENU ) HB_PARHANDLE( 2 ); /* if ( hPopup ) */ @@ -133,9 +133,9 @@ HB_FUNC( WVW_CREATEPOPUPMENU ) HB_FUNC( WVW_APPENDMENU ) { - char ucBuf[ 256 ]; - int i, iLen; - LPCTSTR lpszCaption; + char ucBuf[ 256 ]; + int i, iLen; + LPCTSTR lpszCaption; if( ! ( hb_parni( 2 ) & ( MF_SEPARATOR | MF_POPUP ) ) && ( hb_parni( 3 ) >= WVW_ID_BASE_PUSHBUTTON ) ) @@ -157,8 +157,8 @@ HB_FUNC( WVW_APPENDMENU ) ucBuf[ i ] = ( *lpszCaption == '~' ) ? '&' : *lpszCaption; lpszCaption++; } - ucBuf[ iLen ] = '\0'; - lpszCaption = ucBuf; + ucBuf[ iLen ] = '\0'; + lpszCaption = ucBuf; } else { @@ -216,8 +216,8 @@ HB_FUNC( WVW_SETLASTMENUEVENT ) HB_FUNC( WVW_SETMENUKEYEVENT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - int iEvent = 0; + UINT usWinNum = WVW_WHICH_WINDOW; + int iEvent = 0; if( HB_ISNUM( 2 ) ) { @@ -236,10 +236,10 @@ HB_FUNC( WVW_SETMENUKEYEVENT ) // HB_FUNC( WVW_MENUITEM_SETBITMAPS ) { - HBITMAP hBitmapUnchecked = NULL; - HBITMAP hBitmapChecked = NULL; - char szResname[ _MAX_PATH + 1 ]; - int iWidth, iHeight; + HBITMAP hBitmapUnchecked = NULL; + HBITMAP hBitmapChecked = NULL; + char szResname[ _MAX_PATH + 1 ]; + int iWidth, iHeight; if( ! HB_ISNIL( 4 ) ) { @@ -308,8 +308,8 @@ HB_FUNC( WVW_MENUITEM_SETBITMAPS ) HB_FUNC( WVW_DRAWMENUBAR ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); DrawMenuBar( pWindowData->hWnd ); } @@ -324,8 +324,8 @@ HB_FUNC( WVW_ENDMENU ) /* WVW_GetMenu([nWinNum]) */ HB_FUNC( WVW_GETMENU ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); HB_RETHANDLE( GetMenu( pWindowData->hWnd ) ); } @@ -333,9 +333,9 @@ HB_FUNC( WVW_GETMENU ) /* WVW_TrackPopupMenu([nWinNum], n) */ HB_FUNC( WVW_TRACKPOPUPMENU ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - POINT xy = { 0 }; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + POINT xy = { 0 }; GetCursorPos( &xy ); @@ -354,18 +354,18 @@ HB_FUNC( WIN_SETMENU ) } /* - *WVW_NOSYSMENU( [nWinNum], lRemoveClose ) - *removes System Menu of a window - *if lRemoveClose is .t., also removes the 'Close' command and 'X' button + * WVW_NOSYSMENU( [nWinNum], lRemoveClose ) + * removes System Menu of a window + * if lRemoveClose is .t., also removes the 'Close' command and 'X' button * - **no return value + * no return value */ HB_FUNC( WVW_NOSYSMENU ) { - UINT usWinNum = WVW_WHICH_WINDOW; - BOOL lRemoveClose = HB_ISNIL( 2 ) ? FALSE : hb_parl( 2 ); - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HMENU hMenu = GetSystemMenu( pWindowData->hWnd, FALSE ); + UINT usWinNum = WVW_WHICH_WINDOW; + BOOL lRemoveClose = HB_ISNIL( 2 ) ? FALSE : hb_parl( 2 ); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HMENU hMenu = GetSystemMenu( pWindowData->hWnd, FALSE ); if( hMenu ) { @@ -390,9 +390,9 @@ HB_FUNC( WVW_NOSYSMENU ) */ HB_FUNC( WVW_GETSYSTEMMENU ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - BOOL lReset = HB_ISNIL( 2 ) ? FALSE : hb_parl( 2 ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + BOOL lReset = HB_ISNIL( 2 ) ? FALSE : hb_parl( 2 ); hb_retnl( ( ULONG ) GetSystemMenu( pWindowData->hWnd, lReset ) ); } diff --git a/harbour/extras/gtwvw/wvwpush.c b/harbour/extras/gtwvw/wvwpush.c index f66959abea..11d9f36c39 100644 --- a/harbour/extras/gtwvw/wvwpush.c +++ b/harbour/extras/gtwvw/wvwpush.c @@ -77,63 +77,63 @@ #include "hbgtwvw.h" -/*WVW_PBcreate( [nWinNum], nTop, nLeft, nBottom, nRight, cText, cImage/nImage, bBlock, aOffset,; - * nStretchBitmap, lMap3Dcolors) - **create pushbutton for window nWinNum - **nTop: row of top/left corner (in character unit) - **nLeft: col of top/left corner (in character unit) - **nBottom: row of bottom/right corner (in character unit) defaults==nTop - **nRight: col of bottom/right corner (in character unit) defaults==?? - **cText: caption, default == "" +/* WVW_PBcreate( [nWinNum], nTop, nLeft, nBottom, nRight, cText, cImage/nImage, bBlock, aOffset,; + * nStretchBitmap, lMap3Dcolors) + * create pushbutton for window nWinNum + * nTop: row of top/left corner (in character unit) + * nLeft: col of top/left corner (in character unit) + * nBottom: row of bottom/right corner (in character unit) defaults==nTop + * nRight: col of bottom/right corner (in character unit) defaults==?? + * cText: caption, default == "" * * - **cImage: bitmap file name, can be supplied as nImage: bitmap resource id + * cImage: bitmap file name, can be supplied as nImage: bitmap resource id * - **nStretchBitmap: a number between 0 and 1 (inclusive) as a factor to - * stretch the bitmap. - * 1.0: bitmap covers the whole button - * 0.5: bitmap covers 50% of button - * 0: bitmap is not stretch - * (default is 1) + * nStretchBitmap: a number between 0 and 1 (inclusive) as a factor to + * stretch the bitmap. + * 1.0: bitmap covers the whole button + * 0.5: bitmap covers 50% of button + * 0: bitmap is not stretch + * (default is 1) * - **lMap3Dcolors: defaults to .f. - * if .t. the following color mapping will be performed: - * RGB(192,192,192) --> COLOR_3DFACE ("transparent") - * RGB(128,128,128) --> COLOR_3DSHADOW - * RGB(223,223,223) --> COLOR_3DLIGHT - * This might be desirable to have transparent effect. - * LIMITATION: this will work on 256 colored bitmaps only + * lMap3Dcolors: defaults to .f. + * if .t. the following color mapping will be performed: + * RGB(192,192,192) --> COLOR_3DFACE ("transparent") + * RGB(128,128,128) --> COLOR_3DSHADOW + * RGB(223,223,223) --> COLOR_3DLIGHT + * This might be desirable to have transparent effect. + * LIMITATION: this will work on 256 colored bitmaps only * - **aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust - * dimension of pushbutton. - * defaults for pushbutton: {-2,-2,+2,+2} + * aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust + * dimension of pushbutton. + * defaults for pushbutton: {-2,-2,+2,+2} * - **bBlock: codeblock to execute on every BN_CLICK event. - * This codeblock will be evaluated with these parameters: - * nWinNum: window number - * nPBid : pushbutton id + * bBlock: codeblock to execute on every BN_CLICK event. + * This codeblock will be evaluated with these parameters: + * nWinNum: window number + * nPBid : pushbutton id * - **returns control id of newly created pushbutton of windows nWinNum - **returns 0 if failed + * returns control id of newly created pushbutton of windows nWinNum + * returns 0 if failed * - **example: + * example: */ HB_FUNC( WVW_PBCREATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - int iOffTop, iOffLeft, iOffBottom, iOffRight; + UINT usWinNum = WVW_WHICH_WINDOW; + int iOffTop, iOffLeft, iOffBottom, iOffRight; // int iStyle; - UINT uiPBid; - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = ( USHORT ) hb_parni( 4 ), - usRight = ( USHORT ) hb_parni( 5 ); - LPCTSTR lpszCaption = HB_ISCHAR( 6 ) ? hb_parcx( 6 ) : NULL; - char * szBitmap = HB_ISCHAR( 7 ) ? ( char * ) hb_parcx( 7 ) : NULL; - UINT uiBitmap = HB_ISNUM( 7 ) ? ( UINT ) hb_parni( 7 ) : 0; - double dStretch = ! HB_ISNIL( 10 ) ? hb_parnd( 10 ) : 1; - BOOL bMap3Dcolors = HB_ISLOG( 11 ) ? ( BOOL ) hb_parl( 11 ) : FALSE; + UINT uiPBid; + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = ( USHORT ) hb_parni( 4 ), + usRight = ( USHORT ) hb_parni( 5 ); + LPCTSTR lpszCaption = HB_ISCHAR( 6 ) ? hb_parcx( 6 ) : NULL; + char * szBitmap = HB_ISCHAR( 7 ) ? ( char * ) hb_parcx( 7 ) : NULL; + UINT uiBitmap = HB_ISNUM( 7 ) ? ( UINT ) hb_parni( 7 ) : 0; + double dStretch = ! HB_ISNIL( 10 ) ? hb_parnd( 10 ) : 1; + BOOL bMap3Dcolors = HB_ISLOG( 11 ) ? ( BOOL ) hb_parl( 11 ) : FALSE; if( ! HB_ISBLOCK( 8 ) ) { @@ -141,16 +141,16 @@ HB_FUNC( WVW_PBCREATE ) return; } - iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : -2; - iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : -2; - iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : +2; - iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : +2; + iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : -2; + iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : -2; + iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : +2; + iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : +2; - uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption, - szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ), - iOffTop, iOffLeft, iOffBottom, iOffRight, - dStretch, bMap3Dcolors, - BS_PUSHBUTTON ); + uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption, + szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ), + iOffTop, iOffLeft, iOffBottom, iOffRight, + dStretch, bMap3Dcolors, + BS_PUSHBUTTON ); hb_retnl( ( LONG ) uiPBid ); } @@ -159,7 +159,7 @@ HB_FUNC( WVW_PBCREATE ) */ HB_FUNC( WVW_PBDESTROY ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); UINT uiPBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); CONTROL_DATA * pcd = pWindowData->pcdCtrlList; @@ -171,8 +171,8 @@ HB_FUNC( WVW_PBDESTROY ) { break; } - pcdPrev = pcd; - pcd = pcd->pNext; + pcdPrev = pcd; + pcd = pcd->pNext; } if( pcd == NULL ) @@ -205,10 +205,10 @@ HB_FUNC( WVW_PBDESTROY ) */ HB_FUNC( WVW_PBSETFOCUS ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - byte bStyle; - HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + byte bStyle; + HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); if( hWndPB ) { @@ -226,10 +226,10 @@ HB_FUNC( WVW_PBSETFOCUS ) */ HB_FUNC( WVW_PBISFOCUSED ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - byte bStyle; - HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + byte bStyle; + HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); hb_retl( ( HWND ) GetFocus() == hWndPB ); } @@ -242,12 +242,12 @@ HB_FUNC( WVW_PBISFOCUSED ) */ HB_FUNC( WVW_PBENABLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - byte bStyle; - HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + byte bStyle; + HWND hWndPB = FindControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, uiCtrlId, &bStyle ); if( hWndPB ) { @@ -271,12 +271,12 @@ HB_FUNC( WVW_PBENABLE ) */ HB_FUNC( WVW_PBSETCODEBLOCK ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WVW_DATA * pData = hb_getWvwData(); - UINT uiPBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_PUSHBUTTON, NULL, uiPBid ); - PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK ); - BOOL bOldSetting = pData->s_bRecurseCBlock; + UINT usWinNum = WVW_WHICH_WINDOW; + WVW_DATA * pData = hb_getWvwData(); + UINT uiPBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_PUSHBUTTON, NULL, uiPBid ); + PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK ); + BOOL bOldSetting = pData->s_bRecurseCBlock; if( ! phiCodeBlock || pcd == NULL || pcd->bBusy ) { @@ -306,7 +306,7 @@ HB_FUNC( WVW_PBSETCODEBLOCK ) } pData->s_bRecurseCBlock = FALSE; - pcd->bBusy = TRUE; + pcd->bBusy = TRUE; if( pcd->phiCodeBlock ) { @@ -314,34 +314,34 @@ HB_FUNC( WVW_PBSETCODEBLOCK ) } - pcd->phiCodeBlock = hb_itemNew( phiCodeBlock ); + pcd->phiCodeBlock = hb_itemNew( phiCodeBlock ); - pcd->bBusy = FALSE; + pcd->bBusy = FALSE; pData->s_bRecurseCBlock = bOldSetting; hb_retl( TRUE ); } -/*WVW_PBsetstyle( [nWinNum], nPBid, nStyle ) - *assign new style nStyle to button nPBid for window nWinNum - *typical usage: nStyle==BS_DEFPUSHBUTTON (==01) to turn the button +/* WVW_PBsetstyle( [nWinNum], nPBid, nStyle ) + * assign new style nStyle to button nPBid for window nWinNum + * typical usage: nStyle==BS_DEFPUSHBUTTON (==01) to turn the button * into default push button * (thick border) * BS_PUSHBUTTON (==00) to turn the button * into regular push button * - **using other styles like BS_MULTILINE may also be usefull, - **but I haven't tried that + * using other styles like BS_MULTILINE may also be usefull, + * but I haven't tried that * * this function always return .t. */ HB_FUNC( WVW_PBSETSTYLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiPBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - ULONG ulStyle = ( ULONG ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_PUSHBUTTON, NULL, uiPBid ); + UINT uiPBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + ULONG ulStyle = ( ULONG ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_PUSHBUTTON, NULL, uiPBid ); if( pcd->hWndCtrl ) { @@ -351,31 +351,31 @@ HB_FUNC( WVW_PBSETSTYLE ) hb_retl( TRUE ); } -/*WVW_PBSetFont([nWinNum], cFontFace, nHeight, nWidth, nWeight, nQUality,; +/* WVW_PBSetFont([nWinNum], cFontFace, nHeight, nWidth, nWeight, nQUality,; * lItalic, lUnderline, lStrikeout * - **this will initialize font for ALL pushbuttons in window nWinNum - **(including ones created later on) + * this will initialize font for ALL pushbuttons in window nWinNum + * (including ones created later on) */ HB_FUNC( WVW_PBSETFONT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WVW_DATA * pData = hb_getWvwData(); - BOOL retval = TRUE; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WVW_DATA * pData = hb_getWvwData(); + BOOL retval = TRUE; - pData->s_lfPB.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); - pData->s_lfPB.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfPB.lfWidth : hb_parni( 4 ); - pData->s_lfPB.lfEscapement = 0; - pData->s_lfPB.lfOrientation = 0; - pData->s_lfPB.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfPB.lfWeight : hb_parni( 5 ); - pData->s_lfPB.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfPB.lfItalic : ( BYTE ) hb_parl( 7 ); - pData->s_lfPB.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfPB.lfUnderline : ( BYTE ) hb_parl( 8 ); - pData->s_lfPB.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfPB.lfStrikeOut : ( BYTE ) hb_parl( 9 ); - pData->s_lfPB.lfCharSet = DEFAULT_CHARSET; + pData->s_lfPB.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); + pData->s_lfPB.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfPB.lfWidth : hb_parni( 4 ); + pData->s_lfPB.lfEscapement = 0; + pData->s_lfPB.lfOrientation = 0; + pData->s_lfPB.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfPB.lfWeight : hb_parni( 5 ); + pData->s_lfPB.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfPB.lfItalic : ( BYTE ) hb_parl( 7 ); + pData->s_lfPB.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfPB.lfUnderline : ( BYTE ) hb_parl( 8 ); + pData->s_lfPB.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfPB.lfStrikeOut : ( BYTE ) hb_parl( 9 ); + pData->s_lfPB.lfCharSet = DEFAULT_CHARSET; - pData->s_lfPB.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfPB.lfQuality : ( BYTE ) hb_parni( 6 ); - pData->s_lfPB.lfPitchAndFamily = FF_DONTCARE; + pData->s_lfPB.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfPB.lfQuality : ( BYTE ) hb_parni( 6 ); + pData->s_lfPB.lfPitchAndFamily = FF_DONTCARE; if( HB_ISCHAR( 2 ) ) { strcpy( pData->s_lfPB.lfFaceName, hb_parcx( 2 ) ); @@ -423,18 +423,18 @@ HB_FUNC( WVW_PBSETFONT ) /* COMBOBOX begins (experimental) */ -/*WVW_CBcreate( [nWinNum], nTop, nLeft, nWidth, aText, bBlock, nListLines, ; - * nReserved, nKbdType, aOffset, hControl ) - **create combobox (drop-down list, no editbox) for window nWinNum - **nTop: row of top/left corner (in character unit) - **nLeft: col of top/left corner (in character unit) - **nWidth: width of combobox (in character unit) - **aText: array of drop-down list members, default = {"empty"} - * eg. {"yes","no"} - **bBlock: codeblock to execute on these events: - * event=CBN_SELCHANGE(1): user changes selection - (not executed if selection - is changed programmatically) +/* WVW_CBcreate( [nWinNum], nTop, nLeft, nWidth, aText, bBlock, nListLines, ; + * nReserved, nKbdType, aOffset, hControl ) + * create combobox (drop-down list, no editbox) for window nWinNum + * nTop: row of top/left corner (in character unit) + * nLeft: col of top/left corner (in character unit) + * nWidth: width of combobox (in character unit) + * aText: array of drop-down list members, default = {"empty"} + * eg. {"yes","no"} + * bBlock: codeblock to execute on these events: + * event=CBN_SELCHANGE(1): user changes selection + * (not executed if selection + * is changed programmatically) * event=CBN_SETFOCUS * event=CBN_KILLFOCUS * This codeblock will be evaluated with these parameters: @@ -442,61 +442,61 @@ HB_FUNC( WVW_PBSETFONT ) * nCBid : combobox id * nType : event type (CBN_SELCHANGE/CBN_SETFOCUS/CBN_KILLFOCUS supported) * nIndex : index of the selected list item (0 based) - **nListLines: number of lines for list items, default = 3 + * nListLines: number of lines for list items, default = 3 * (will be automatically truncated if it's > len(aText)) - **nReserved: reserved for future (this parm is now ignored) + * nReserved: reserved for future (this parm is now ignored) * - **nKbdType: WVW_CB_KBD_STANDARD (0): similar to standard windows convention + * nKbdType: WVW_CB_KBD_STANDARD (0): similar to standard windows convention * ENTER/ESC: will kill focus from combobox * WVW_CB_KBD_CLIPPER (1): * ENTER: drop (show) the list box * UP/DOWN/TAB/SHIFTTAB/ESC: kill focus - **default is WVW_CB_KBD_STANDARD (0) + * default is WVW_CB_KBD_STANDARD (0) * - **aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust + * aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust * dimension of combobox. * defaults: {-2,-2,+2,+2} * NOTES: the third element (y2) is actually ignored. * height of combobox is always 1 char height * (see also wvw_cbSetFont()) * - **returns control id of newly created combobox of windows nWinNum - **returns 0 if failed + * returns control id of newly created combobox of windows nWinNum + * returns 0 if failed * - **example: + * example: */ HB_FUNC( WVW_CBCREATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndParent = pWindowData->hWnd; - HWND hWndCB; - WVW_DATA * pData = hb_getWvwData(); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndParent = pWindowData->hWnd; + HWND hWndCB; + WVW_DATA * pData = hb_getWvwData(); // LONG cnt; - LONG numofchars; - LONG avgwidth; - LONG LongComboWidth, NewLongComboWidth; + LONG numofchars; + LONG avgwidth; + LONG LongComboWidth, NewLongComboWidth; // RECT r; - HFONT hFont = hb_gt_wvwGetFont( pWindowData->fontFace, 10, pWindowData->fontWidth, pWindowData->fontWeight, pWindowData->fontQuality, pWindowData->CodePage ); + HFONT hFont = hb_gt_wvwGetFont( pWindowData->fontFace, 10, pWindowData->fontWidth, pWindowData->fontWeight, pWindowData->fontQuality, pWindowData->CodePage ); - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; - UINT uiCBid; - USHORT usWidth = ( USHORT ) hb_parni( 4 ); - USHORT usTop = ( USHORT ) hb_parni( 2 ), - usLeft = ( USHORT ) hb_parni( 3 ), - usBottom = usTop, - usRight = usLeft + usWidth - 1; - USHORT usNumElement = ( USHORT ) ( HB_ISARRAY( 5 ) ? hb_arrayLen( hb_param( 5, HB_IT_ARRAY ) ) : 0 ); - USHORT usListLines = ( USHORT ) ( HB_ISNUM( 7 ) ? hb_parni( 7 ) : 3 ); - BYTE byCharHeight = hb_wvw_LineHeight( pWindowData ); + UINT uiCBid; + USHORT usWidth = ( USHORT ) hb_parni( 4 ); + USHORT usTop = ( USHORT ) hb_parni( 2 ), + usLeft = ( USHORT ) hb_parni( 3 ), + usBottom = usTop, + usRight = usLeft + usWidth - 1; + USHORT usNumElement = ( USHORT ) ( HB_ISARRAY( 5 ) ? hb_arrayLen( hb_param( 5, HB_IT_ARRAY ) ) : 0 ); + USHORT usListLines = ( USHORT ) ( HB_ISNUM( 7 ) ? hb_parni( 7 ) : 3 ); + BYTE byCharHeight = hb_wvw_LineHeight( pWindowData ); /* in the future combobox type might be selectable by 8th parameter */ - int iStyle = CBS_DROPDOWNLIST | WS_VSCROLL; - BYTE bKbdType = HB_ISNUM( 9 ) ? ( BYTE ) hb_parni( 9 ) : ( BYTE ) WVW_CB_KBD_STANDARD; + int iStyle = CBS_DROPDOWNLIST | WS_VSCROLL; + BYTE bKbdType = HB_ISNUM( 9 ) ? ( BYTE ) hb_parni( 9 ) : ( BYTE ) WVW_CB_KBD_STANDARD; if( pWindowData->hCBfont == NULL ) @@ -513,26 +513,26 @@ HB_FUNC( WVW_CBCREATE ) iOffTop = ! HB_ISNIL( 10 ) ? hb_parvni( 10, 1 ) : 0; iOffLeft = ! HB_ISNIL( 10 ) ? hb_parvni( 10, 2 ) : 0; - iOffBottom = usListLines; - iOffRight = ! HB_ISNIL( 10 ) ? hb_parvni( 10, 4 ) : 0; + iOffBottom = usListLines; + iOffRight = ! HB_ISNIL( 10 ) ? hb_parvni( 10, 4 ) : 0; if( hb_gt_wvw_GetMainCoordMode() ) { hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y + iOffTop; - iLeft = xy.x + iOffLeft; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y + iOffTop; + iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; - iBottom = xy.y - 1 + ( iOffBottom * byCharHeight ); - iRight = xy.x - 1 + iOffRight; + iBottom = xy.y - 1 + ( iOffBottom * byCharHeight ); + iRight = xy.x - 1 + iOffRight; - uiCBid = LastControlId( usWinNum, WVW_CONTROL_COMBOBOX ); + uiCBid = LastControlId( usWinNum, WVW_CONTROL_COMBOBOX ); if( uiCBid == 0 ) { uiCBid = WVW_ID_BASE_COMBOBOX; @@ -561,10 +561,10 @@ HB_FUNC( WVW_CBCREATE ) if( hWndCB ) { - RECT rXB = { 0 }, rOffXB = { 0 }; - WNDPROC OldProc; - USHORT i; - TCHAR szDefault[] = TEXT( "empty" ); + RECT rXB = { 0 }, rOffXB = { 0 }; + WNDPROC OldProc; + USHORT i; + TCHAR szDefault[] = TEXT( "empty" ); SendMessage( ( HWND ) hWndCB, @@ -621,7 +621,7 @@ HB_FUNC( WVW_CBCREATE ) ( WPARAM ) TRUE, ( LPARAM ) 0 ); - avgwidth = GetFontDialogUnits( hWndParent, hFont ); + avgwidth = GetFontDialogUnits( hWndParent, hFont ); NewLongComboWidth = ( LongComboWidth - 2 ) * avgwidth; SendMessage( ( HWND ) hWndCB, @@ -630,11 +630,11 @@ HB_FUNC( WVW_CBCREATE ) ( LPARAM ) 0 ); - rXB.top = usTop; rXB.left = usLeft; - rXB.bottom = usBottom; rXB.right = usRight; - rOffXB.top = iOffTop; rOffXB.left = iOffLeft; + rXB.top = usTop; rXB.left = usLeft; + rXB.bottom = usBottom; rXB.right = usRight; + rOffXB.top = iOffTop; rOffXB.left = iOffLeft; - rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; + rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; AddControlHandle( usWinNum, WVW_CONTROL_COMBOBOX, hWndCB, uiCBid, ( PHB_ITEM ) hb_param( 6, HB_IT_BLOCK ), rXB, rOffXB, ( byte ) bKbdType ); @@ -660,7 +660,7 @@ HB_FUNC( WVW_CBCREATE ) */ HB_FUNC( WVW_CBDESTROY ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); UINT uiCBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); CONTROL_DATA * pcd = pWindowData->pcdCtrlList; @@ -673,8 +673,8 @@ HB_FUNC( WVW_CBDESTROY ) break; } - pcdPrev = pcd; - pcd = pcd->pNext; + pcdPrev = pcd; + pcd = pcd->pNext; } if( pcd == NULL ) { @@ -706,10 +706,10 @@ HB_FUNC( WVW_CBDESTROY ) */ HB_FUNC( WVW_CBSETFOCUS ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - byte bStyle; - HWND hWndCB = FindControlHandle( usWinNum, WVW_CONTROL_COMBOBOX, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + byte bStyle; + HWND hWndCB = FindControlHandle( usWinNum, WVW_CONTROL_COMBOBOX, uiCtrlId, &bStyle ); if( hWndCB ) { @@ -727,10 +727,10 @@ HB_FUNC( WVW_CBSETFOCUS ) */ HB_FUNC( WVW_CBISFOCUSED ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - byte bStyle; - HWND hWndCB = FindControlHandle( usWinNum, WVW_CONTROL_COMBOBOX, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + byte bStyle; + HWND hWndCB = FindControlHandle( usWinNum, WVW_CONTROL_COMBOBOX, uiCtrlId, &bStyle ); hb_retl( ( HWND ) GetFocus() == hWndCB ); } @@ -743,12 +743,12 @@ HB_FUNC( WVW_CBISFOCUSED ) */ HB_FUNC( WVW_CBENABLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - byte bStyle; - HWND hWndCB = FindControlHandle( usWinNum, WVW_CONTROL_COMBOBOX, uiCtrlId, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 ); + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + byte bStyle; + HWND hWndCB = FindControlHandle( usWinNum, WVW_CONTROL_COMBOBOX, uiCtrlId, &bStyle ); if( hWndCB ) { @@ -772,13 +772,13 @@ HB_FUNC( WVW_CBENABLE ) */ HB_FUNC( WVW_CBSETCODEBLOCK ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); - PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK ); - WVW_DATA * pData = hb_getWvwData(); - BOOL bOldSetting = pData->s_bRecurseCBlock; + UINT uiCBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); + PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK ); + WVW_DATA * pData = hb_getWvwData(); + BOOL bOldSetting = pData->s_bRecurseCBlock; if( ! phiCodeBlock || pcd == NULL || pcd->bBusy ) { @@ -787,7 +787,7 @@ HB_FUNC( WVW_CBSETCODEBLOCK ) } pData->s_bRecurseCBlock = FALSE; - pcd->bBusy = TRUE; + pcd->bBusy = TRUE; if( pcd->phiCodeBlock ) { @@ -795,42 +795,42 @@ HB_FUNC( WVW_CBSETCODEBLOCK ) } - pcd->phiCodeBlock = hb_itemNew( phiCodeBlock ); + pcd->phiCodeBlock = hb_itemNew( phiCodeBlock ); - pcd->bBusy = FALSE; + pcd->bBusy = FALSE; pData->s_bRecurseCBlock = bOldSetting; hb_retl( TRUE ); } -/*WVW_CBSetFont([nWinNum], cFontFace, nHeight, nWidth, nWeight, nQUality,; +/* WVW_CBSetFont([nWinNum], cFontFace, nHeight, nWidth, nWeight, nQUality,; * lItalic, lUnderline, lStrikeout * - **this will initialize font for ALL comboboxes in window nWinNum - **(including ones created later on) + * this will initialize font for ALL comboboxes in window nWinNum + * (including ones created later on) * - **TODO: ? should nHeight be ignored, and always forced to use standard char height? + * TODO: ? should nHeight be ignored, and always forced to use standard char height? */ HB_FUNC( WVW_CBSETFONT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WVW_DATA * pData = hb_getWvwData(); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WVW_DATA * pData = hb_getWvwData(); - BOOL retval = TRUE; + BOOL retval = TRUE; - pData->s_lfCB.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); - pData->s_lfCB.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfCB.lfWidth : hb_parni( 4 ); - pData->s_lfCB.lfEscapement = 0; - pData->s_lfCB.lfOrientation = 0; - pData->s_lfCB.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfCB.lfWeight : hb_parni( 5 ); - pData->s_lfCB.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfCB.lfItalic : ( BYTE ) hb_parl( 7 ); - pData->s_lfCB.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfCB.lfUnderline : ( BYTE ) hb_parl( 8 ); - pData->s_lfCB.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfCB.lfStrikeOut : ( BYTE ) hb_parl( 9 ); - pData->s_lfCB.lfCharSet = DEFAULT_CHARSET; + pData->s_lfCB.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); + pData->s_lfCB.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfCB.lfWidth : hb_parni( 4 ); + pData->s_lfCB.lfEscapement = 0; + pData->s_lfCB.lfOrientation = 0; + pData->s_lfCB.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfCB.lfWeight : hb_parni( 5 ); + pData->s_lfCB.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfCB.lfItalic : ( BYTE ) hb_parl( 7 ); + pData->s_lfCB.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfCB.lfUnderline : ( BYTE ) hb_parl( 8 ); + pData->s_lfCB.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfCB.lfStrikeOut : ( BYTE ) hb_parl( 9 ); + pData->s_lfCB.lfCharSet = DEFAULT_CHARSET; - pData->s_lfCB.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfCB.lfQuality : ( BYTE ) hb_parni( 6 ); - pData->s_lfCB.lfPitchAndFamily = FF_DONTCARE; + pData->s_lfCB.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfCB.lfQuality : ( BYTE ) hb_parni( 6 ); + pData->s_lfCB.lfPitchAndFamily = FF_DONTCARE; if( HB_ISCHAR( 2 ) ) { strcpy( pData->s_lfCB.lfFaceName, hb_parcx( 2 ) ); @@ -871,24 +871,24 @@ HB_FUNC( WVW_CBSETFONT ) } -/*WVW_CBsetIndex( [nWinNum], nCBid, nIndex ) - *set current selection of combobox nCBid in window nWinNum to nIndex - *(nIndex is 0 based) - *returns .t. if successful. +/* WVW_CBsetIndex( [nWinNum], nCBid, nIndex ) + * set current selection of combobox nCBid in window nWinNum to nIndex + * (nIndex is 0 based) + * returns .t. if successful. * - **NOTE: the better name to this function should be WVW_CBsetCurSel() + * NOTE: the better name to this function should be WVW_CBsetCurSel() * but that name is already used. * (WVW_CBsetcursel() and WVW_CBaddstring() is NOT related to other * WVW_CB* functions) */ HB_FUNC( WVW_CBSETINDEX ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCBid = hb_parni( 2 ); - int iIndex = hb_parni( 3 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); - BOOL retval; + UINT uiCBid = hb_parni( 2 ); + int iIndex = hb_parni( 3 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); + BOOL retval; if( pcd == NULL || iIndex < 0 ) { @@ -904,12 +904,12 @@ HB_FUNC( WVW_CBSETINDEX ) hb_retl( retval ); } -/*WVW_CBgetIndex( [nWinNum], nCBid ) - *get current selection of combobox nCBid in window nWinNum - *return nIndex (0 based) - *returns CB_ERR (-1) if none selected +/* WVW_CBgetIndex( [nWinNum], nCBid ) + * get current selection of combobox nCBid in window nWinNum + * return nIndex (0 based) + * returns CB_ERR (-1) if none selected * - **NOTE: the better name to this function should be WVW_CBgetCurSel() + * NOTE: the better name to this function should be WVW_CBgetCurSel() * but that name is potentially misleading to WVW_CBsetCursel * which is not our family of WVW_CB* functions * (WVW_CBsetcursel() and WVW_CBaddstring() is NOT related to other @@ -917,11 +917,11 @@ HB_FUNC( WVW_CBSETINDEX ) */ HB_FUNC( WVW_CBGETINDEX ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCBid = hb_parni( 2 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); - int retval; + UINT uiCBid = hb_parni( 2 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); + int retval; if( pcd == NULL ) { @@ -937,20 +937,20 @@ HB_FUNC( WVW_CBGETINDEX ) hb_retni( retval ); } -/*WVW_CBfindString( [nWinNum], nCBid, cString ) - *find index of cString in combobox nCBid in window nWinNum - *returns index of cString (0 based) - *returns CB_ERR (-1) if string not found +/* WVW_CBfindString( [nWinNum], nCBid, cString ) + * find index of cString in combobox nCBid in window nWinNum + * returns index of cString (0 based) + * returns CB_ERR (-1) if string not found * - **NOTE:case insensitive + * NOTE:case insensitive */ HB_FUNC( WVW_CBFINDSTRING ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCBid = hb_parni( 2 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); - int retval; + UINT uiCBid = hb_parni( 2 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); + int retval; if( pcd == NULL ) { @@ -973,12 +973,12 @@ HB_FUNC( WVW_CBFINDSTRING ) */ HB_FUNC( WVW_CBGETCURTEXT ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCBid = hb_parni( 2 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); - int iCurSel, iTextLen; - LPTSTR lptstr = NULL; + UINT uiCBid = hb_parni( 2 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); + int iCurSel, iTextLen; + LPTSTR lptstr = NULL; if( pcd == NULL ) { @@ -1025,11 +1025,11 @@ HB_FUNC( WVW_CBGETCURTEXT ) */ HB_FUNC( WVW_CBISDROPPED ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiCBid = hb_parni( 2 ); - CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); - BOOL bDropped; + UINT uiCBid = hb_parni( 2 ); + CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_COMBOBOX, NULL, uiCBid ); + BOOL bDropped; if( pcd == NULL ) { @@ -1047,4 +1047,3 @@ HB_FUNC( WVW_CBISDROPPED ) /* COMBOBOX ends (experimental) */ - diff --git a/harbour/extras/gtwvw/wvwstbar.c b/harbour/extras/gtwvw/wvwstbar.c index cf01c98a14..0ae4baa2f4 100644 --- a/harbour/extras/gtwvw/wvwstbar.c +++ b/harbour/extras/gtwvw/wvwstbar.c @@ -88,12 +88,12 @@ */ HB_FUNC( WVW_SBCREATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndParent; - HWND hWndSB; - WVW_DATA * pData = hb_getWvwData(); - int ptArray[ WVW_MAX_STATUS_PARTS ]; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndParent; + HWND hWndSB; + WVW_DATA * pData = hb_getWvwData(); + int ptArray[ WVW_MAX_STATUS_PARTS ]; if( ! ( pWindowData->hStatusBar == NULL ) ) { @@ -101,11 +101,11 @@ HB_FUNC( WVW_SBCREATE ) return; } - hWndParent = pWindowData->hWnd; - hWndSB = CreateStatusWindow( WS_CHILD | WS_VISIBLE | WS_BORDER | SBT_TOOLTIPS, - NULL, - hWndParent, - WVW_ID_BASE_STATUSBAR + usWinNum ); + hWndParent = pWindowData->hWnd; + hWndSB = CreateStatusWindow( WS_CHILD | WS_VISIBLE | WS_BORDER | SBT_TOOLTIPS, + NULL, + hWndParent, + WVW_ID_BASE_STATUSBAR + usWinNum ); if( hWndSB ) { @@ -137,8 +137,8 @@ HB_FUNC( WVW_SBCREATE ) */ HB_FUNC( WVW_SBDESTROY ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); if( ! ( pWindowData->hStatusBar == NULL ) ) { @@ -156,31 +156,31 @@ HB_FUNC( WVW_SBDESTROY ) } } -/*WVW_SBaddPart(nWinNum, cMaxText, nWidth, nStyle, lResetParts, [cIcon , cToolTip]) - *ps. - *lResetParts==.t. :: remove all previously created parts - *nStyle: 0 (default), 0x0200 (SBT_POPOUT), 0x0100 (SBT_NOBORDERS) - *nWidth: expected width in pixels - *NOTE: if cMaxText is passed, nWidth is ignored. width of cMaxText will be used instead - *NOTE: the leftmost part will eventually have width of remaining spaces - *NOTE: cIcon and cToolTip does not work currently +/* WVW_SBaddPart(nWinNum, cMaxText, nWidth, nStyle, lResetParts, [cIcon , cToolTip]) + * ps. + * lResetParts==.t. :: remove all previously created parts + * nStyle: 0 (default), 0x0200 (SBT_POPOUT), 0x0100 (SBT_NOBORDERS) + * nWidth: expected width in pixels + * NOTE: if cMaxText is passed, nWidth is ignored. width of cMaxText will be used instead + * NOTE: the leftmost part will eventually have width of remaining spaces + * NOTE: cIcon and cToolTip does not work currently * - **returns number of parts - **returns 0 if failed + * returns number of parts + * returns 0 if failed */ HB_FUNC( WVW_SBADDPART ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndSB; - int ptArray[ WVW_MAX_STATUS_PARTS ]; - int numOfParts; - int n; - RECT rSB = { 0 }; - WORD displayFlags; - HICON hIcon; - BOOL lResetParts; - USHORT usWidth; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndSB; + int ptArray[ WVW_MAX_STATUS_PARTS ]; + int numOfParts; + int n; + RECT rSB = { 0 }; + WORD displayFlags; + HICON hIcon; + BOOL lResetParts; + USHORT usWidth; hWndSB = pWindowData->hStatusBar; if( hWndSB == NULL ) @@ -189,14 +189,14 @@ HB_FUNC( WVW_SBADDPART ) return; } - displayFlags = HB_ISNIL( 4 ) ? 0 : ( WORD ) hb_parnl( 4 ); - lResetParts = ! HB_ISNIL( 5 ) && hb_parl( 5 ); - usWidth = HB_ISNIL( 3 ) || hb_parni( 3 ) <= 0 ? 5 * WVW_SPACE_BETWEEN_PARTS : ( USHORT ) hb_parni( 3 ); + displayFlags = HB_ISNIL( 4 ) ? 0 : ( WORD ) hb_parnl( 4 ); + lResetParts = ! HB_ISNIL( 5 ) && hb_parl( 5 ); + usWidth = HB_ISNIL( 3 ) || hb_parni( 3 ) <= 0 ? 5 * WVW_SPACE_BETWEEN_PARTS : ( USHORT ) hb_parni( 3 ); if( HB_ISCHAR( 2 ) ) { - HDC hDCSB = GetDC( hWndSB ); - SIZE size = { 0 }; + HDC hDCSB = GetDC( hWndSB ); + SIZE size = { 0 }; HFONT hFont = ( HFONT ) SendMessage( hWndSB, WM_GETFONT, ( WPARAM ) 0, ( LPARAM ) 0 ); HFONT hOldFont = ( HFONT ) SelectObject( hDCSB, hFont ); @@ -237,8 +237,8 @@ HB_FUNC( WVW_SBADDPART ) if( ! HB_ISNIL( 6 ) ) { - int cy = rSB.bottom - rSB.top - 4; - int cx = cy; + int cy = rSB.bottom - rSB.top - 4; + int cx = cy; hIcon = ( HICON ) LoadImage( 0, hb_parcx( 6 ), IMAGE_ICON, cx, cy, LR_LOADFROMFILE | LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT | LR_DEFAULTSIZE ); @@ -271,14 +271,14 @@ HB_FUNC( WVW_SBADDPART ) */ HB_FUNC( WVW_SBREFRESH ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndSB; - int ptArray[ WVW_MAX_STATUS_PARTS ]; - int numOfParts; - int n; - int iDiff; - RECT rSB = { 0 }; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndSB; + int ptArray[ WVW_MAX_STATUS_PARTS ]; + int numOfParts; + int n; + int iDiff; + RECT rSB = { 0 }; hWndSB = pWindowData->hStatusBar; if( hWndSB == NULL ) @@ -312,9 +312,9 @@ HB_FUNC( WVW_SBREFRESH ) */ HB_FUNC( WVW_SBSETTEXT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iPart = HB_ISNIL( 2 ) ? 1 : hb_parni( 2 ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int iPart = HB_ISNIL( 2 ) ? 1 : hb_parni( 2 ); if( ! HB_ISNIL( 4 ) ) { @@ -347,10 +347,10 @@ HB_FUNC( WVW_SBSETTEXT ) */ HB_FUNC( WVW_SBGETTEXT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iPart = HB_ISNIL( 2 ) ? 1 : hb_parni( 2 ); - char cString[ 1024 ] = ""; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int iPart = HB_ISNIL( 2 ) ? 1 : hb_parni( 2 ); + char cString[ 1024 ] = ""; SendMessage( pWindowData->hStatusBar, SB_GETTEXT, ( WPARAM ) iPart, ( LPARAM ) cString ); hb_retc( cString ); @@ -361,9 +361,9 @@ HB_FUNC( WVW_SBGETTEXT ) */ HB_FUNC( WVW_SBGETPARTS ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int numOfParts = ( int ) SendMessage( pWindowData->hStatusBar, SB_GETPARTS, WVW_MAX_STATUS_PARTS, 0 ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int numOfParts = ( int ) SendMessage( pWindowData->hStatusBar, SB_GETPARTS, WVW_MAX_STATUS_PARTS, 0 ); hb_retni( numOfParts ); } @@ -374,25 +374,25 @@ HB_FUNC( WVW_SBGETPARTS ) */ HB_FUNC( WVW_SBSETFONT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - WVW_DATA * pData = hb_getWvwData(); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + WVW_DATA * pData = hb_getWvwData(); - BOOL retval = TRUE; + BOOL retval = TRUE; - pData->s_lfSB.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); - pData->s_lfSB.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfSB.lfWidth : hb_parni( 4 ); - pData->s_lfSB.lfEscapement = 0; - pData->s_lfSB.lfOrientation = 0; - pData->s_lfSB.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfSB.lfWeight : hb_parni( 5 ); - pData->s_lfSB.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfSB.lfItalic : ( BYTE ) hb_parl( 7 ); - pData->s_lfSB.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfSB.lfUnderline : ( BYTE ) hb_parl( 8 ); - pData->s_lfSB.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfSB.lfStrikeOut : ( BYTE ) hb_parl( 9 ); - pData->s_lfSB.lfCharSet = DEFAULT_CHARSET; + pData->s_lfSB.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 ); + pData->s_lfSB.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfSB.lfWidth : hb_parni( 4 ); + pData->s_lfSB.lfEscapement = 0; + pData->s_lfSB.lfOrientation = 0; + pData->s_lfSB.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfSB.lfWeight : hb_parni( 5 ); + pData->s_lfSB.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfSB.lfItalic : ( BYTE ) hb_parl( 7 ); + pData->s_lfSB.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfSB.lfUnderline : ( BYTE ) hb_parl( 8 ); + pData->s_lfSB.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfSB.lfStrikeOut : ( BYTE ) hb_parl( 9 ); + pData->s_lfSB.lfCharSet = DEFAULT_CHARSET; - pData->s_lfSB.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfSB.lfQuality : ( BYTE ) hb_parni( 6 ); - pData->s_lfSB.lfPitchAndFamily = FF_DONTCARE; + pData->s_lfSB.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfSB.lfQuality : ( BYTE ) hb_parni( 6 ); + pData->s_lfSB.lfPitchAndFamily = FF_DONTCARE; if( HB_ISCHAR( 2 ) ) { strcpy( pData->s_lfSB.lfFaceName, hb_parcx( 2 ) ); @@ -427,14 +427,14 @@ HB_FUNC( WVW_SBSETFONT ) * horiz: defaults to one character height * verti: defaults to one character _height_ too (!) * use aOffset to adjust the dimension - **aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust + * aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust * dimension of scroll bar. * defaults for vertical scroll bar: {0,+3,0,0} * defaults for horiz scroll bar: {+3-linespacing,0,0,0} * NOTES: these defaults are meant to make room for other common * GUI elements like raised/recessed lines. * - **bBlock: codeblock to execute on every WM_VSCROLL/WM_HSCROLL event. + * bBlock: codeblock to execute on every WM_VSCROLL/WM_HSCROLL event. * This codeblock will be evaluated with these parameters: * nWinNum: window number * nXBid : scrollbar id @@ -450,40 +450,40 @@ HB_FUNC( WVW_SBSETFONT ) * SB_THUMBTRACK 5: scroll thumb is being dragged at position nXBpos * SB_ENDSCROLL 8 * - **returns control id of newly created scroll bar of windows nWinNum - **returns 0 if failed + * returns control id of newly created scroll bar of windows nWinNum + * returns 0 if failed * - **example: - **WVW_XBcreate( , 1, 10, 70, 12) + * example: + * WVW_XBcreate( , 1, 10, 70, 12) * :: creates Vertical scrollbar on current window at (10,70) with length 12 * dimensions using default ones. * buttons/parts behaviour using default ones. * - **WVW_XBcreate( , 1, 10, 70, 12, {0, +5, 0, +5} ) + * WVW_XBcreate( , 1, 10, 70, 12, {0, +5, 0, +5} ) * :: creates Vertical scrollbar on current window at (10,70) with length 12 * left and right coordinate is shifted 5 pixels to the right. * buttons/parts behaviour using default ones. * - **NOTES: - **ScrollRange is always 0 - 100. - **Initial ScrollPos is 0 + * NOTES: + * ScrollRange is always 0 - 100. + * Initial ScrollPos is 0 */ HB_FUNC( WVW_XBCREATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndParent = pWindowData->hWnd; - HWND hWndXB; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; - int iOffTop, iOffLeft, iOffBottom, iOffRight; - int iStyle = ( int ) ( ! HB_ISNUM( 2 ) ? -1 : hb_parni( 2 ) ); - UINT uiXBid; - USHORT usTop = ( USHORT ) hb_parni( 3 ), - usLeft = ( USHORT ) hb_parni( 4 ), - usBottom, - usRight; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndParent = pWindowData->hWnd; + HWND hWndXB; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; + int iOffTop, iOffLeft, iOffBottom, iOffRight; + int iStyle = ( int ) ( ! HB_ISNUM( 2 ) ? -1 : hb_parni( 2 ) ); + UINT uiXBid; + USHORT usTop = ( USHORT ) hb_parni( 3 ), + usLeft = ( USHORT ) hb_parni( 4 ), + usBottom, + usRight; if( iStyle < SBS_HORZ || iStyle > SBS_VERT || ! HB_ISBLOCK( 6 ) ) { @@ -493,23 +493,23 @@ HB_FUNC( WVW_XBCREATE ) if( iStyle == SBS_VERT ) { - usBottom = usTop + ( USHORT ) hb_parni( 5 ) - 1; - usRight = usLeft; + usBottom = usTop + ( USHORT ) hb_parni( 5 ) - 1; + usRight = usLeft; - iOffTop = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 1 ) : 0; - iOffLeft = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 2 ) : +3; - iOffBottom = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 3 ) : 0; - iOffRight = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 4 ) : 0; + iOffTop = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 1 ) : 0; + iOffLeft = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 2 ) : +3; + iOffBottom = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 3 ) : 0; + iOffRight = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 4 ) : 0; } else { - usRight = usLeft + ( USHORT ) hb_parni( 5 ) - 1; - usBottom = usTop; + usRight = usLeft + ( USHORT ) hb_parni( 5 ) - 1; + usBottom = usTop; - iOffTop = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 1 ) : +3 - pWindowData->byLineSpacing; - iOffLeft = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 2 ) : 0; - iOffBottom = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 3 ) : 0; - iOffRight = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 4 ) : 0; + iOffTop = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 1 ) : +3 - pWindowData->byLineSpacing; + iOffLeft = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 2 ) : 0; + iOffBottom = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 3 ) : 0; + iOffRight = ! HB_ISNIL( 7 ) ? hb_parvni( 7, 4 ) : 0; } if( hb_gt_wvw_GetMainCoordMode() ) @@ -521,19 +521,19 @@ HB_FUNC( WVW_XBCREATE ) iTop = xy.y + iOffTop; iLeft = xy.x + iOffLeft; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - xy.y -= pWindowData->byLineSpacing; + xy.y -= pWindowData->byLineSpacing; if( iStyle == SBS_VERT ) { - iBottom = xy.y - 1 + iOffBottom; - iRight = iLeft + pWindowData->PTEXTSIZE.y - 1 + iOffRight; + iBottom = xy.y - 1 + iOffBottom; + iRight = iLeft + pWindowData->PTEXTSIZE.y - 1 + iOffRight; } else { - iRight = xy.x - 1 + iOffRight; - iBottom = iTop + pWindowData->PTEXTSIZE.y - 1 + iOffBottom; + iRight = xy.x - 1 + iOffRight; + iBottom = iTop + pWindowData->PTEXTSIZE.y - 1 + iOffBottom; } uiXBid = LastControlId( usWinNum, WVW_CONTROL_SCROLLBAR ); @@ -564,14 +564,14 @@ HB_FUNC( WVW_XBCREATE ) if( hWndXB ) { - RECT rXB = { 0 }, rOffXB = { 0 }; + RECT rXB = { 0 }, rOffXB = { 0 }; - WNDPROC OldProc; + WNDPROC OldProc; - rXB.top = usTop; rXB.left = usLeft; - rXB.bottom = usBottom; rXB.right = usRight; - rOffXB.top = iOffTop; rOffXB.left = iOffLeft; - rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; + rXB.top = usTop; rXB.left = usLeft; + rXB.bottom = usBottom; rXB.right = usRight; + rOffXB.top = iOffTop; rOffXB.left = iOffLeft; + rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight; SetScrollRange( hWndXB, SB_CTL, 0, 99, FALSE ); SetScrollPos( hWndXB, SB_CTL, 0, TRUE ); @@ -597,7 +597,7 @@ HB_FUNC( WVW_XBCREATE ) */ HB_FUNC( WVW_XBDESTROY ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); CONTROL_DATA * pcd = pWindowData->pcdCtrlList; @@ -610,8 +610,8 @@ HB_FUNC( WVW_XBDESTROY ) break; } - pcdPrev = pcd; - pcd = pcd->pNext; + pcdPrev = pcd; + pcd = pcd->pNext; } if( pcd == NULL ) { @@ -647,18 +647,18 @@ HB_FUNC( WVW_XBDESTROY ) */ HB_FUNC( WVW_XBUPDATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - byte bStyle; - HWND hWndXB = FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); - int iPos = ( int ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); - int iPage = ( int ) ( HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ) ); - int iMin = ( int ) ( HB_ISNIL( 5 ) ? 0 : hb_parni( 5 ) ); - int iMax = ( int ) ( HB_ISNIL( 6 ) ? 0 : hb_parni( 6 ) ); - SCROLLINFO si; - int iRetval; - UINT fMask = SIF_DISABLENOSCROLL; + UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + byte bStyle; + HWND hWndXB = FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); + int iPos = ( int ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); + int iPage = ( int ) ( HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ) ); + int iMin = ( int ) ( HB_ISNIL( 5 ) ? 0 : hb_parni( 5 ) ); + int iMax = ( int ) ( HB_ISNIL( 6 ) ? 0 : hb_parni( 6 ) ); + SCROLLINFO si; + int iRetval; + UINT fMask = SIF_DISABLENOSCROLL; if( uiXBid == 0 || hWndXB == NULL || iPage < 0 ) { @@ -679,16 +679,16 @@ HB_FUNC( WVW_XBUPDATE ) fMask = fMask | SIF_RANGE; } - si.cbSize = sizeof( si ); - si.fMask = fMask; - si.nMin = iMin; - si.nMax = iMax; - si.nPage = ( UINT ) iPage; - si.nPos = iPos; - iRetval = SetScrollInfo( hWndXB, - SB_CTL, - ( LPCSCROLLINFO ) &si, - TRUE ); + si.cbSize = sizeof( si ); + si.fMask = fMask; + si.nMin = iMin; + si.nMax = iMax; + si.nPage = ( UINT ) iPage; + si.nPos = iPos; + iRetval = SetScrollInfo( hWndXB, + SB_CTL, + ( LPCSCROLLINFO ) &si, + TRUE ); hb_retni( iRetval ); } @@ -699,13 +699,13 @@ HB_FUNC( WVW_XBUPDATE ) */ HB_FUNC( WVW_XBINFO ) { - UINT usWinNum = WVW_WHICH_WINDOW; - PHB_ITEM aInfo; - SCROLLINFO si; + UINT usWinNum = WVW_WHICH_WINDOW; + PHB_ITEM aInfo; + SCROLLINFO si; - UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - byte bStyle; - HWND hWndXB = FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); + UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + byte bStyle; + HWND hWndXB = FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); if( uiXBid == 0 || hWndXB == NULL ) { @@ -716,8 +716,8 @@ HB_FUNC( WVW_XBINFO ) return; } - si.cbSize = sizeof( si ); - si.fMask = SIF_ALL; + si.cbSize = sizeof( si ); + si.fMask = SIF_ALL; if( ! GetScrollInfo( hWndXB, SB_CTL, &si ) ) { @@ -738,22 +738,22 @@ HB_FUNC( WVW_XBINFO ) hb_itemReturnRelease( aInfo ); } -/*WVW_XBenable( [nWinNum], nXBid, nFlags ) - *enable/disable scrollbar nXBid in window nWinNum (default to topmost window) - *nFlags: ESB_ENABLE_BOTH 0: enable both arrows +/* WVW_XBenable( [nWinNum], nXBid, nFlags ) + * enable/disable scrollbar nXBid in window nWinNum (default to topmost window) + * nFlags: ESB_ENABLE_BOTH 0: enable both arrows * ESB_DISABLE_LEFT/ESB_DISABLE_UP 1: disable left/up arrow * ESB_DISABLE_RIGHT/ESB_DISABLE_DOWN 2: disable right/down arrow * ESB_DISABLE_BOTH 3: disable both arrow - **returns .t. if successful + * returns .t. if successful */ HB_FUNC( WVW_XBENABLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; + UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - UINT uiFlags = ( UINT ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); - byte bStyle; - HWND hWndXB = uiXBid == 0 ? NULL : FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); + UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + UINT uiFlags = ( UINT ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) ); + byte bStyle; + HWND hWndXB = uiXBid == 0 ? NULL : FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); if( uiXBid == 0 || hWndXB == NULL || uiFlags > ESB_DISABLE_BOTH ) { @@ -764,20 +764,20 @@ HB_FUNC( WVW_XBENABLE ) hb_retl( EnableScrollBar( hWndXB, SB_CTL, uiFlags ) ); } -/*WVW_XBshow( [nWinNum], nXBid, lShow ) - *show/hide scrollbar nXBid in window nWinNum (default to topmost window) - *nXBid is the handle of the scrolbar - *lShow: .T. shows the scrolbar (default) +/* WVW_XBshow( [nWinNum], nXBid, lShow ) + * show/hide scrollbar nXBid in window nWinNum (default to topmost window) + * nXBid is the handle of the scrolbar + * lShow: .T. shows the scrolbar (default) * .F. hides the scrolbar - **returns .t. if successful + * returns .t. if successful */ HB_FUNC( WVW_XBSHOW ) { - UINT usWinNum = WVW_WHICH_WINDOW; - UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); - BOOL bShow = ( BOOL ) ( HB_ISLOG( 3 ) ? hb_parl( 3 ) : TRUE ); - byte bStyle; - HWND hWndXB = uiXBid == 0 ? NULL : FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); + UINT usWinNum = WVW_WHICH_WINDOW; + UINT uiXBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) ); + BOOL bShow = ( BOOL ) ( HB_ISLOG( 3 ) ? hb_parl( 3 ) : TRUE ); + byte bStyle; + HWND hWndXB = uiXBid == 0 ? NULL : FindControlHandle( usWinNum, WVW_CONTROL_SCROLLBAR, uiXBid, &bStyle ); if( uiXBid == 0 || hWndXB == NULL ) { @@ -790,4 +790,3 @@ HB_FUNC( WVW_XBSHOW ) /* SCROLLBAR ends */ - diff --git a/harbour/extras/gtwvw/wvwtbar.c b/harbour/extras/gtwvw/wvwtbar.c index 5303f5bfd1..489f7a6634 100644 --- a/harbour/extras/gtwvw/wvwtbar.c +++ b/harbour/extras/gtwvw/wvwtbar.c @@ -83,22 +83,22 @@ *nStyle: toolbar style, defaults to TBSTYLE_FLAT | TBSTYLE_TOOLTIPS *nSystemBitmap: 0:none, 1:small, 2:large (defaults: 1) * small=16x16 large=24x24 - **nImageWidth/Height are in effect only if nSystemBitmap==0 + * nImageWidth/Height are in effect only if nSystemBitmap==0 */ HB_FUNC( WVW_TBCREATE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndParent = pWindowData->hWnd; - HWND hWndTB; - int iMaxTextRows = ( int ) ( HB_ISNIL( 2 ) ? 0 : ( hb_parl( 2 ) ? 1 : 0 ) ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndParent = pWindowData->hWnd; + HWND hWndTB; + int iMaxTextRows = ( int ) ( HB_ISNIL( 2 ) ? 0 : ( hb_parl( 2 ) ? 1 : 0 ) ); // DWORD dwStyle = (DWORD) ( HB_ISNIL( 3 ) ? TBSTYLE_FLAT | TBSTYLE_TOOLTIPS : hb_parni( 3 ) ); - DWORD dwStyle = ( DWORD ) ( HB_ISNIL( 3 ) ? TBSTYLE_ALTDRAG | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | TBSTYLE_TRANSPARENT | TBSTYLE_WRAPABLE : hb_parnl( 3 ) ); + DWORD dwStyle = ( DWORD ) ( HB_ISNIL( 3 ) ? TBSTYLE_ALTDRAG | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | TBSTYLE_TRANSPARENT | TBSTYLE_WRAPABLE : hb_parnl( 3 ) ); - int iSystemBitmap = ( int ) ( HB_ISNIL( 4 ) ? 1 : hb_parni( 4 ) ); - int iImageWidth = ( int ) ( iSystemBitmap == 0 && HB_ISNUM( 5 ) ? hb_parni( 5 ) : -1 ); - int iImageHeight = ( int ) ( iSystemBitmap == 0 && HB_ISNUM( 6 ) ? hb_parni( 6 ) : -1 ); - TBADDBITMAP tbab = { 0 }; + int iSystemBitmap = ( int ) ( HB_ISNIL( 4 ) ? 1 : hb_parni( 4 ) ); + int iImageWidth = ( int ) ( iSystemBitmap == 0 && HB_ISNUM( 5 ) ? hb_parni( 5 ) : -1 ); + int iImageHeight = ( int ) ( iSystemBitmap == 0 && HB_ISNUM( 6 ) ? hb_parni( 6 ) : -1 ); + TBADDBITMAP tbab = { 0 }; InitCommonControls(); @@ -128,13 +128,13 @@ HB_FUNC( WVW_TBCREATE ) switch( iSystemBitmap ) { case 1: - iImageHeight = 16; + iImageHeight = 16; break; case 2: - iImageHeight = 24; + iImageHeight = 24; break; default: - iImageHeight = iImageWidth; + iImageHeight = iImageWidth; break; } } @@ -165,15 +165,15 @@ HB_FUNC( WVW_TBCREATE ) if( iSystemBitmap > 0 ) { - tbab.hInst = HINST_COMMCTRL; + tbab.hInst = HINST_COMMCTRL; - tbab.nID = iSystemBitmap == 1 ? IDB_STD_SMALL_COLOR : IDB_STD_LARGE_COLOR; - pWindowData->iStartStdBitmap = SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 0, ( WPARAM ) &tbab ); + tbab.nID = iSystemBitmap == 1 ? IDB_STD_SMALL_COLOR : IDB_STD_LARGE_COLOR; + pWindowData->iStartStdBitmap = SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 0, ( WPARAM ) &tbab ); - tbab.nID = iSystemBitmap == 1 ? IDB_VIEW_SMALL_COLOR : IDB_VIEW_LARGE_COLOR; + tbab.nID = iSystemBitmap == 1 ? IDB_VIEW_SMALL_COLOR : IDB_VIEW_LARGE_COLOR; pWindowData->iStartViewBitmap = SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 0, ( WPARAM ) &tbab ); - tbab.nID = iSystemBitmap == 1 ? IDB_HIST_SMALL_COLOR : IDB_HIST_LARGE_COLOR; + tbab.nID = iSystemBitmap == 1 ? IDB_HIST_SMALL_COLOR : IDB_HIST_LARGE_COLOR; pWindowData->iStartHistBitmap = SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 0, ( WPARAM ) &tbab ); } else @@ -183,8 +183,8 @@ HB_FUNC( WVW_TBCREATE ) pWindowData->iStartHistBitmap = 0; } - pWindowData->iTBImgWidth = iImageWidth; - pWindowData->iTBImgHeight = iImageHeight; + pWindowData->iTBImgWidth = iImageWidth; + pWindowData->iTBImgHeight = iImageHeight; SendMessage( hWndTB, TB_SETMAXTEXTROWS, ( WPARAM ) iMaxTextRows, ( LPARAM ) 0 ); @@ -207,39 +207,39 @@ HB_FUNC( WVW_TBCREATE ) /*WVW_TBAddButton([nWinNum], nCommand, xBitmap, cLabel, nBitmapType,; * lMap3Dcolors, lDropdown) - **adds one button on the right of existing buttons - **xBitmap: - **nBitmap is resource id. or use cBitmap as bitmap file name. - **(bitmap from resources cannot have > 256 colors) + * adds one button on the right of existing buttons + * xBitmap: + * nBitmap is resource id. or use cBitmap as bitmap file name. + * (bitmap from resources cannot have > 256 colors) * - **cLabel: if lDisplayText, it will be displayed below the bitmap - * otherwise it will be used as tooltip - **nBitmapType: 0:custom, 1:system std bitmap, 2:system view bitmap, 3:system hist bitmap - **lMap3Dcolors: defaults to .f. - * (meaningfull for custom bitmap only) - * if .t. the following color mapping will be performed: - * RGB(192,192,192) --> COLOR_3DFACE ("transparent") - * RGB(128,128,128) --> COLOR_3DSHADOW - * RGB(223,223,223) --> COLOR_3DLIGHT - * This might be desirable to have transparent effect. - * LIMITATION: this will work on 256 colored bitmaps only + * cLabel: if lDisplayText, it will be displayed below the bitmap + * otherwise it will be used as tooltip + * nBitmapType: 0:custom, 1:system std bitmap, 2:system view bitmap, 3:system hist bitmap + * lMap3Dcolors: defaults to .f. + * (meaningfull for custom bitmap only) + * if .t. the following color mapping will be performed: + * RGB(192,192,192) --> COLOR_3DFACE ("transparent") + * RGB(128,128,128) --> COLOR_3DSHADOW + * RGB(223,223,223) --> COLOR_3DLIGHT + * This might be desirable to have transparent effect. + * LIMITATION: this will work on 256 colored bitmaps only */ HB_FUNC( WVW_TBADDBUTTON ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iCommand = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int iCommand = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ); - char * szBitmap = HB_ISCHAR( 3 ) ? ( char * ) hb_parcx( 3 ) : NULL; - UINT uiBitmap = HB_ISNUM( 3 ) ? ( UINT ) hb_parni( 3 ) : 0; + char * szBitmap = HB_ISCHAR( 3 ) ? ( char * ) hb_parcx( 3 ) : NULL; + UINT uiBitmap = HB_ISNUM( 3 ) ? ( UINT ) hb_parni( 3 ) : 0; - char * szLabel = HB_ISNIL( 4 ) ? ( char * ) "" : ( char * ) hb_parcx( 4 ); - int iBitmapType = HB_ISNIL( 5 ) ? 0 : ( int ) hb_parni( 5 ); - BOOL bMap3Dcolors = HB_ISLOG( 6 ) ? hb_parl( 6 ) : FALSE; - BOOL bDropdown = HB_ISLOG( 7 ) ? hb_parl( 7 ) : FALSE; - HWND hWndTB; - USHORT usOldHeight; + char * szLabel = HB_ISNIL( 4 ) ? ( char * ) "" : ( char * ) hb_parcx( 4 ); + int iBitmapType = HB_ISNIL( 5 ) ? 0 : ( int ) hb_parni( 5 ); + BOOL bMap3Dcolors = HB_ISLOG( 6 ) ? hb_parl( 6 ) : FALSE; + BOOL bDropdown = HB_ISLOG( 7 ) ? hb_parl( 7 ) : FALSE; + HWND hWndTB; + USHORT usOldHeight; hWndTB = pWindowData->hToolBar; if( hWndTB == NULL ) @@ -302,9 +302,9 @@ HB_FUNC( WVW_TBADDBUTTON ) */ HB_FUNC( WVW_TBBUTTONCOUNT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndTB; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndTB; hWndTB = pWindowData->hToolBar; if( hWndTB == NULL ) @@ -323,11 +323,11 @@ HB_FUNC( WVW_TBBUTTONCOUNT ) */ HB_FUNC( WVW_TBDELBUTTON ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iButton = HB_ISNUM( 2 ) ? hb_parni( 2 ) : -1; - HWND hWndTB; - USHORT usOldHeight; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int iButton = HB_ISNUM( 2 ) ? hb_parni( 2 ) : -1; + HWND hWndTB; + USHORT usOldHeight; hWndTB = pWindowData->hToolBar; if( hWndTB == NULL || iButton < 0 ) @@ -359,15 +359,15 @@ HB_FUNC( WVW_TBDELBUTTON ) */ HB_FUNC( WVW_TBGETBUTTONRECT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iButton = HB_ISNUM( 2 ) ? hb_parni( 2 ) : -1; - HWND hWndTB; - RECT rc; - RECT rcRect = { 0 }; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int iButton = HB_ISNUM( 2 ) ? hb_parni( 2 ) : -1; + HWND hWndTB; + RECT rc; + RECT rcRect = { 0 }; - PHB_ITEM aXY = hb_itemNew( NULL ); - PHB_ITEM temp; + PHB_ITEM aXY = hb_itemNew( NULL ); + PHB_ITEM temp; hWndTB = pWindowData->hToolBar; if( hWndTB == NULL || iButton < 0 || ! SendMessage( hWndTB, TB_GETRECT, ( WPARAM ) iButton, ( LPARAM ) &rc ) ) @@ -401,13 +401,13 @@ HB_FUNC( WVW_TBGETBUTTONRECT ) */ HB_FUNC( WVW_TBENABLEBUTTON ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iButton = HB_ISNUM( 2 ) ? hb_parni( 2 ) : -1; - BOOL bEnable = HB_ISLOG( 3 ) ? hb_parl( 3 ) : TRUE; - int iCommand; - HWND hWndTB; - USHORT usOldHeight; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int iButton = HB_ISNUM( 2 ) ? hb_parni( 2 ) : -1; + BOOL bEnable = HB_ISLOG( 3 ) ? hb_parl( 3 ) : TRUE; + int iCommand; + HWND hWndTB; + USHORT usOldHeight; hWndTB = pWindowData->hToolBar; if( hWndTB == NULL || iButton < 0 ) @@ -446,8 +446,8 @@ HB_FUNC( WVW_TBENABLEBUTTON ) */ HB_FUNC( WVW_TBDESTROY ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); if( ! ( pWindowData->hToolBar == NULL ) ) { @@ -465,11 +465,11 @@ HB_FUNC( WVW_TBDESTROY ) */ HB_FUNC( WVW_TBINDEX2CMD ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndTB = pWindowData->hToolBar; - int iIndex = hb_parni( 2 ); - int iCmd = IndexToCommand( hWndTB, iIndex ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndTB = pWindowData->hToolBar; + int iIndex = hb_parni( 2 ); + int iCmd = IndexToCommand( hWndTB, iIndex ); hb_retni( ( int ) ( iCmd > 0 ? iCmd : -1 ) ); } @@ -480,10 +480,10 @@ HB_FUNC( WVW_TBINDEX2CMD ) */ HB_FUNC( WVW_TBCMD2INDEX ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - HWND hWndTB = pWindowData->hToolBar; - int iCmd = hb_parni( 2 ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + HWND hWndTB = pWindowData->hToolBar; + int iCmd = hb_parni( 2 ); hb_retni( CommandToIndex( hWndTB, iCmd ) ); } @@ -505,10 +505,10 @@ HB_FUNC( WVW_TBCMD2INDEX ) /*WVW_SetToolTopActive([nWinNum], [lToggle]) */ HB_FUNC( WVW_SETTOOLTIPACTIVE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - BOOL bActive = pWindowData->bToolTipActive; + BOOL bActive = pWindowData->bToolTipActive; if( ! HB_ISNIL( 2 ) ) { @@ -530,17 +530,17 @@ HB_FUNC( WVW_SETTOOLTIPACTIVE ) /* */ HB_FUNC( WVW_SETTOOLTIP ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - TOOLINFO ti = { 0 }; - POINT xy = { 0 }; - int iTop, iLeft, iBottom, iRight; + TOOLINFO ti = { 0 }; + POINT xy = { 0 }; + int iTop, iLeft, iBottom, iRight; - USHORT usTop = hb_parni( 2 ), - usLeft = hb_parni( 3 ), - usBottom = hb_parni( 4 ), - usRight = hb_parni( 5 ); + USHORT usTop = hb_parni( 2 ), + usLeft = hb_parni( 3 ), + usBottom = hb_parni( 4 ), + usRight = hb_parni( 5 ); if( ! pWindowData->bToolTipActive ) { @@ -552,19 +552,19 @@ HB_FUNC( WVW_SETTOOLTIP ) hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight ); } - ti.cbSize = sizeof( TOOLINFO ); - ti.hwnd = pWindowData->hWnd; - ti.uId = WVW_ID_BASE_TOOLTIP + usWinNum; + ti.cbSize = sizeof( TOOLINFO ); + ti.hwnd = pWindowData->hWnd; + ti.uId = WVW_ID_BASE_TOOLTIP + usWinNum; if( SendMessage( pWindowData->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) ) { - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); - iTop = xy.y; - iLeft = xy.x; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop ); + iTop = xy.y; + iLeft = xy.x; - xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); - iBottom = xy.y - 1; - iRight = xy.x - 1; + xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 ); + iBottom = xy.y - 1; + iRight = xy.x - 1; ti.lpszText = hb_parc( 6 ); ti.rect.left = iLeft; @@ -580,13 +580,13 @@ HB_FUNC( WVW_SETTOOLTIP ) HB_FUNC( WVW_SETTOOLTIPTEXT ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - TOOLINFO ti; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + TOOLINFO ti; - ti.cbSize = sizeof( TOOLINFO ); - ti.hwnd = pWindowData->hWnd; - ti.uId = 100000; + ti.cbSize = sizeof( TOOLINFO ); + ti.hwnd = pWindowData->hWnd; + ti.uId = 100000; if( SendMessage( pWindowData->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) ) { @@ -599,24 +599,24 @@ HB_FUNC( WVW_SETTOOLTIPTEXT ) HB_FUNC( WVW_SETTOOLTIPMARGIN ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - RECT rc = { 0 }; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + RECT rc = { 0 }; - rc.left = hb_parni( 3 ); - rc.top = hb_parni( 2 ); - rc.right = hb_parni( 5 ); - rc.bottom = hb_parni( 4 ); + rc.left = hb_parni( 3 ); + rc.top = hb_parni( 2 ); + rc.right = hb_parni( 5 ); + rc.bottom = hb_parni( 4 ); SendMessage( pWindowData->hWndTT, TTM_SETMARGIN, 0, ( LPARAM ) &rc ); } HB_FUNC( WVW_SETTOOLTIPWIDTH ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iTipWidth = SendMessage( pWindowData->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 ); + int iTipWidth = SendMessage( pWindowData->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 ); if( HB_ISNUM( 2 ) ) { @@ -630,10 +630,10 @@ HB_FUNC( WVW_SETTOOLTIPWIDTH ) HB_FUNC( WVW_SETTOOLTIPBKCOLOR ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - COLORREF cr = SendMessage( pWindowData->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 ); + COLORREF cr = SendMessage( pWindowData->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 ); if( HB_ISNUM( 2 ) ) { @@ -646,10 +646,10 @@ HB_FUNC( WVW_SETTOOLTIPBKCOLOR ) HB_FUNC( WVW_SETTOOLTIPTEXTCOLOR ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - COLORREF cr = SendMessage( pWindowData->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 ); + COLORREF cr = SendMessage( pWindowData->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 ); if( HB_ISNUM( 2 ) ) { @@ -662,9 +662,9 @@ HB_FUNC( WVW_SETTOOLTIPTEXTCOLOR ) HB_FUNC( WVW_SETTOOLTIPTITLE ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); - int iIcon; + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + int iIcon; if( ! HB_ISNIL( 3 ) ) { @@ -681,8 +681,8 @@ HB_FUNC( WVW_SETTOOLTIPTITLE ) HB_FUNC( WVW_GETTOOLTIPWIDTH ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); hb_retni( SendMessage( pWindowData->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 ) ); } @@ -691,8 +691,8 @@ HB_FUNC( WVW_GETTOOLTIPWIDTH ) HB_FUNC( WVW_GETTOOLTIPBKCOLOR ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); hb_retnl( ( COLORREF ) SendMessage( pWindowData->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 ) ); } @@ -701,8 +701,8 @@ HB_FUNC( WVW_GETTOOLTIPBKCOLOR ) HB_FUNC( WVW_GETTOOLTIPTEXTCOLOR ) { - UINT usWinNum = WVW_WHICH_WINDOW; - WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); + UINT usWinNum = WVW_WHICH_WINDOW; + WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); hb_retnl( ( COLORREF ) SendMessage( pWindowData->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 ) ); } diff --git a/harbour/extras/hbusb/core.c b/harbour/extras/hbusb/core.c index 9cc6284ed3..69838405da 100644 --- a/harbour/extras/hbusb/core.c +++ b/harbour/extras/hbusb/core.c @@ -47,8 +47,8 @@ HB_FUNC( LIBUSB_SET_DEBUG ) /* Returns a list of USB devcices attached to your system. */ HB_FUNC( LIBUSB_GET_DEVICE_LIST ) { - libusb_device ** devicelist; - ssize_t count; + libusb_device ** devicelist; + ssize_t count; count = libusb_get_device_list( ( libusb_context * ) hb_parptr( 1 ), &devicelist ); @@ -66,11 +66,11 @@ HB_FUNC( LIBUSB_FREE_DEVICE_LIST ) /* Gets the number of the bus that a device is attached to. */ HB_FUNC( LIBUSB_GET_BUS_NUMBER ) { - uint8_t busnumber; - libusb_device ** devicelist; + uint8_t busnumber; + libusb_device ** devicelist; - devicelist = ( libusb_device ** ) hb_parptr( 1 ); - busnumber = libusb_get_bus_number( devicelist[ hb_parni( 2 ) ] ); + devicelist = ( libusb_device ** ) hb_parptr( 1 ); + busnumber = libusb_get_bus_number( devicelist[ hb_parni( 2 ) ] ); hb_retni( busnumber ); } @@ -78,11 +78,11 @@ HB_FUNC( LIBUSB_GET_BUS_NUMBER ) /* Gets the address on the bus that a device is attached to. */ HB_FUNC( LIBUSB_GET_DEVICE_ADDRESS ) { - uint8_t deviceaddress; - libusb_device ** devicelist; + uint8_t deviceaddress; + libusb_device ** devicelist; - devicelist = ( libusb_device ** ) hb_parptr( 1 ); - deviceaddress = libusb_get_device_address( devicelist[ hb_parni( 2 ) ] ); + devicelist = ( libusb_device ** ) hb_parptr( 1 ); + deviceaddress = libusb_get_device_address( devicelist[ hb_parni( 2 ) ] ); hb_retni( deviceaddress ); } @@ -105,11 +105,11 @@ HB_FUNC( LIBUSB_GET_DEVICE_SPEED ) /* Gets the maximum packet size for a particular endpoint in the active device configuration. */ HB_FUNC( LIBUSB_GET_MAX_PACKET_SIZE ) { - int maxpacketsize; - libusb_device ** devicelist; + int maxpacketsize; + libusb_device ** devicelist; - devicelist = ( libusb_device ** ) hb_parptr( 1 ); - maxpacketsize = libusb_get_max_packet_size( devicelist[ hb_parni( 2 ) ], ( unsigned char ) hb_parni( 3 ) ); + devicelist = ( libusb_device ** ) hb_parptr( 1 ); + maxpacketsize = libusb_get_max_packet_size( devicelist[ hb_parni( 2 ) ], ( unsigned char ) hb_parni( 3 ) ); hb_retni( maxpacketsize ); } @@ -117,11 +117,11 @@ HB_FUNC( LIBUSB_GET_MAX_PACKET_SIZE ) /* Increments the reference count of a device. */ HB_FUNC( LIBUSB_REF_DEVICE ) { - libusb_device * device; - libusb_device ** devicelist; + libusb_device * device; + libusb_device ** devicelist; - devicelist = ( libusb_device ** ) hb_parptr( 1 ); - device = libusb_ref_device( devicelist[ hb_parni( 2 ) ] ); + devicelist = ( libusb_device ** ) hb_parptr( 1 ); + device = libusb_ref_device( devicelist[ hb_parni( 2 ) ] ); HB_SYMBOL_UNUSED( device ); } @@ -138,12 +138,12 @@ HB_FUNC( LIBUSB_UNREF_DEVICE ) /* Open a device and obtain a device handle */ HB_FUNC( LIBUSB_OPEN ) { - int success; - libusb_device_handle * handle; - libusb_device ** devicelist; + int success; + libusb_device_handle * handle; + libusb_device ** devicelist; - devicelist = ( libusb_device ** ) hb_parptr( 1 ); - success = libusb_open( devicelist[ hb_parni( 2 ) ], &handle ); + devicelist = ( libusb_device ** ) hb_parptr( 1 ); + success = libusb_open( devicelist[ hb_parni( 2 ) ], &handle ); hb_storptr( success == 0 ? handle : NULL, 3 ); @@ -182,8 +182,8 @@ HB_FUNC( LIBUSB_GET_CONFIGURATION ) int configuration; int success; - configuration = 0; - success = libusb_get_configuration( ( libusb_device_handle * ) hb_parptr( 1 ), &configuration ); + configuration = 0; + success = libusb_get_configuration( ( libusb_device_handle * ) hb_parptr( 1 ), &configuration ); hb_storni( success == 0 ? configuration : 0, 2 ); @@ -282,12 +282,12 @@ HB_FUNC( LIBUSB_ATTACH_KERNEL_DRIVER ) /* Get the USB descriptor for a given device. */ HB_FUNC( LIBUSB_GET_DEVICE_DESCRIPTOR ) { - struct libusb_device_descriptor desc; - libusb_device ** devicelist; - int success; + struct libusb_device_descriptor desc; + libusb_device ** devicelist; + int success; - devicelist = ( libusb_device ** ) hb_parptr( 1 ); - success = libusb_get_device_descriptor( devicelist[ hb_parni( 2 ) ], &desc ); + devicelist = ( libusb_device ** ) hb_parptr( 1 ); + success = libusb_get_device_descriptor( devicelist[ hb_parni( 2 ) ], &desc ); hb_storptr( &desc, 3 ); hb_storni( desc.idVendor, 4 ); @@ -302,9 +302,9 @@ HB_FUNC( LIBUSB_GET_DEVICE_DESCRIPTOR ) /* Perform a USB bulk transfer. */ HB_FUNC( LIBUSB_BULK_TRANSFER ) { - int success; - unsigned char data[ 512 ]; - int transferred; + int success; + unsigned char data[ 512 ]; + int transferred; success = libusb_bulk_transfer( ( libusb_device_handle * ) hb_parptr( 1 ), ( unsigned char ) hb_parni( 2 ), data, sizeof( data ), &transferred, hb_parni( 3 ) ); @@ -317,9 +317,9 @@ HB_FUNC( LIBUSB_BULK_TRANSFER ) /* Perform a USB interrupt transfer. */ HB_FUNC( LIBUSB_INTERRUPT_TRANSFER ) { - int success; - unsigned char data[ 512 ]; - int transferred; + int success; + unsigned char data[ 512 ]; + int transferred; success = libusb_interrupt_transfer( ( libusb_device_handle * ) hb_parptr( 1 ), ( unsigned char ) hb_parni( 2 ), data, sizeof( data ), &transferred, hb_parni( 3 ) );