2012-11-21 00:14 UTC+0100 Viktor Szakats (harbour syenar.net)

* contrib/gtwvg/gtwgud.c
  * contrib/gtwvg/gtwvgd.c
  * contrib/gtwvg/wvgcore.c
  * contrib/gtwvg/wvgcuig.c
  * contrib/gtwvg/wvgutils.c
  * contrib/gtwvg/wvgwin.c
  * contrib/gtwvg/wvgwing.c
  * src/rtl/gtwvt/gtwvt.c
    % deleted extraneous {} block operators
This commit is contained in:
Viktor Szakats
2012-11-20 23:15:36 +00:00
parent b6f1b15455
commit ba3ed238e1
9 changed files with 36 additions and 347 deletions

View File

@@ -10,6 +10,17 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2012-11-21 00:14 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/gtwvg/gtwgud.c
* contrib/gtwvg/gtwvgd.c
* contrib/gtwvg/wvgcore.c
* contrib/gtwvg/wvgcuig.c
* contrib/gtwvg/wvgutils.c
* contrib/gtwvg/wvgwin.c
* contrib/gtwvg/wvgwing.c
* src/rtl/gtwvt/gtwvt.c
% deleted extraneous {} block operators
2012-11-20 23:45 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/gtwvg/wvgutils.c
! fixed to use HB_OS_WIN_CE macro to detect WinCE, not

View File

@@ -131,11 +131,8 @@ static void hb_gt_wvt_RegisterClass( HINSTANCE hInstance )
if( ! RegisterClass( &wndclass ) )
{
int iError = GetLastError();
if( iError != 1410 )
{
if( GetLastError() != 1410 )
hb_errInternal( 10001, "Failed to register WGU window class", NULL, NULL );
}
}
}
@@ -398,16 +395,12 @@ static void hb_gt_wvt_TranslateKey( PHB_GTWVT pWVT, int key, int shiftkey, int a
int nVirtKey = GetKeyState( VK_MENU );
if( nVirtKey & 0x8000 ) /* alt + key */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, altkey );
}
else
{
nVirtKey = GetKeyState( VK_CONTROL );
if( nVirtKey & 0x8000 ) /* control + key */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, controlkey );
}
else
{
nVirtKey = GetKeyState( VK_SHIFT );
@@ -651,13 +644,9 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
int iScanCode = HIWORD( lParam ) & 0xFF;
if( bCtrl && iScanCode == 76 ) /* CTRL_VK_NUMPAD5 */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, KP_CTRL_5 );
}
else if( bCtrl && wParam == VK_TAB ) /* K_CTRL_TAB */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, bShift ? K_CTRL_SH_TAB : K_CTRL_TAB );
}
else if( iScanCode == 70 ) /* Ctrl_Break key OR Scroll Lock Key */
{
if( bCtrl ) /* Not scroll lock */
@@ -666,14 +655,10 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
pWVT->IgnoreWM_SYSCHAR = HB_TRUE;
}
else
{
DefWindowProc( pWVT->hWnd, message, wParam, lParam ); /* Let windows handle ScrollLock */
}
}
else if( bCtrl && iScanCode == 53 && bShift )
{
hb_gt_wvt_AddCharToInputQueue( pWVT, K_CTRL_QUESTION );
}
else if( ( bAlt || bCtrl ) && (
wParam == VK_MULTIPLY || wParam == VK_ADD ||
wParam == VK_SUBTRACT || wParam == VK_DIVIDE ) )
@@ -698,9 +683,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
}
}
else if( pWVT->EnableShortCuts )
{
return DefWindowProc( pWVT->hWnd, message, wParam, lParam ) != 0;
}
}
}
break;
@@ -715,13 +698,9 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
if( ! pWVT->IgnoreWM_SYSCHAR )
{
if( bCtrl && iScanCode == 28 ) /* K_CTRL_RETURN */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, K_CTRL_RETURN );
}
else if( bCtrl && ( c >= 1 && c <= 26 ) ) /* K_CTRL_A - Z */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, K_Ctrl[ c - 1 ] );
}
else
{
switch( c )
@@ -1272,9 +1251,7 @@ static void hb_gt_wvt_Exit( PHB_GT pGT )
HB_GTSUPER_EXIT( pGT );
if( pWVT )
{
hb_gt_wvt_Free( pWVT );
}
}
/* ********************************************************************** */
@@ -1328,6 +1305,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_ISGRAPHIC:
pInfo->pResult = hb_itemPutL( pInfo->pResult, HB_TRUE );
break;
case HB_GTI_ISUNICODE:
#if defined( UNICODE )
pInfo->pResult = hb_itemPutL( pInfo->pResult, HB_TRUE );
@@ -1335,18 +1313,22 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pInfo->pResult = hb_itemPutL( pInfo->pResult, HB_FALSE );
#endif
break;
case HB_GTI_INPUTFD:
pInfo->pResult = hb_itemPutNInt( pInfo->pResult,
( HB_PTRDIFF ) GetStdHandle( STD_INPUT_HANDLE ) );
break;
case HB_GTI_OUTPUTFD:
pInfo->pResult = hb_itemPutNInt( pInfo->pResult,
( HB_PTRDIFF ) GetStdHandle( STD_OUTPUT_HANDLE ) );
break;
case HB_GTI_ERRORFD:
pInfo->pResult = hb_itemPutNInt( pInfo->pResult,
( HB_PTRDIFF ) GetStdHandle( STD_ERROR_HANDLE ) );
break;
case HB_GTI_SETFONT:
pInfo->pResult = hb_itemPutL( pInfo->pResult, HB_FALSE );
if( hb_itemType( pInfo->pNewVal ) & HB_IT_ARRAY )
@@ -1355,29 +1337,19 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, 1 );
if( hb_itemType( pSome ) & HB_IT_STRING )
{
hb_strncpy( pWVT->fontFace, hb_itemGetCPtr( pSome ), sizeof( pWVT->fontFace ) - 1 );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, 2 );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->fontHeight = hb_arrayGetNI( pInfo->pNewVal, 2 );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, 3 );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->fontWidth = hb_arrayGetNI( pInfo->pNewVal, 3 );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, 4 );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->fontWeight = hb_arrayGetNI( pInfo->pNewVal, 4 );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, 5 );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->fontQuality = hb_arrayGetNI( pInfo->pNewVal, 5 );
}
}
break;
case HB_GTI_FONTSIZE:
@@ -1385,22 +1357,20 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
iVal = hb_itemGetNI( pInfo->pNewVal );
if( iVal > 0 )
{
pWVT->fontHeight = iVal;
}
break;
case HB_GTI_FONTWIDTH:
pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWVT->fontWidth );
if( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC )
pWVT->fontWidth = hb_itemGetNI( pInfo->pNewVal );
break;
case HB_GTI_FONTNAME:
pInfo->pResult = hb_itemPutC( pInfo->pResult, pWVT->fontFace );
if( hb_itemType( pInfo->pNewVal ) & HB_IT_STRING )
{
hb_strncpy( pWVT->fontFace, hb_itemGetCPtr( pInfo->pNewVal ), sizeof( pWVT->fontFace ) - 1 );
}
break;
case HB_GTI_FONTWEIGHT:
pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWVT->fontWeight );
@@ -1408,6 +1378,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pWVT->fontWeight = hb_itemGetNI( pInfo->pNewVal );
break;
case HB_GTI_FONTQUALITY:
pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWVT->fontQuality );
if( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC )
@@ -1422,9 +1393,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pInfo->pResult = hb_itemPutNI( pInfo->pResult, rc.bottom - rc.top );
iVal = hb_itemGetNI( pInfo->pNewVal );
if( iVal > 0 && pWVT->hWnd )
{
MoveWindow( pWVT->hWnd, 0, 0, rc.right - rc.left, iVal, TRUE );
}
break;
}
case HB_GTI_SCREENWIDTH:
@@ -1435,9 +1404,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pInfo->pResult = hb_itemPutNI( pInfo->pResult, rc.right - rc.left );
iVal = hb_itemGetNI( pInfo->pNewVal );
if( iVal > 0 && pWVT->hWnd )
{
MoveWindow( pWVT->hWnd, 0, 0, iVal, rc.bottom - rc.top, TRUE );
}
break;
}
case HB_GTI_DESKTOPWIDTH:
@@ -1937,54 +1904,34 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_EXSTYLE );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->exStyle = ( DWORD ) hb_itemGetNInt( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_STYLE );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->style = ( DWORD ) hb_itemGetNInt( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_X );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->x = hb_itemGetNI( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_Y );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->y = hb_itemGetNI( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_WIDTH );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->width = hb_itemGetNI( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_HEIGHT );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->height = hb_itemGetNI( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_PARENT );
if( hb_itemType( pSome ) & HB_IT_POINTER )
{
pWVT->pPP->pParentGT = hb_itemNew( hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_PARENT ) );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_VISIBLE );
if( hb_itemType( pSome ) & HB_IT_LOGICAL )
{
pWVT->pPP->bVisible = hb_itemGetL( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_ROWCOLS );
if( hb_itemType( pSome ) & HB_IT_LOGICAL )
{
pWVT->pPP->bRowCols = hb_itemGetL( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_WNDTYPE );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->iWndType = hb_itemGetNI( pSome );
}
/* Flag that caller configured itself */
pWVT->pPP->bConfigured = HB_TRUE;

View File

@@ -176,11 +176,8 @@ static void hb_gt_wvt_RegisterClass( HINSTANCE hInstance )
if( ! RegisterClass( &wndclass ) )
{
int iError = GetLastError();
if( iError != 1410 )
{
if( GetLastError() != 1410 )
hb_errInternal( 10001, "Failed to register WVG window class", NULL, NULL );
}
}
}
@@ -484,9 +481,7 @@ static int hb_gt_wvt_FireEvent( PHB_GTWVT pWVT, int nEvent, PHB_ITEM pParams )
nResult = hb_itemGetNI( hb_vmEvalBlockV( pWVT->pGT->pNotifierBlock, 2, pEvent, pParams ) );
if( pWVT->pNotifierGUI )
{
nResult = hb_itemGetNI( hb_vmEvalBlockV( pWVT->pNotifierGUI, 2, pEvent, pParams ) );
}
hb_itemRelease( pEvent );
hb_vmRequestRestore();
@@ -573,6 +568,7 @@ static void hb_gt_wvt_UpdateCaret( PHB_GTWVT pWVT )
iCaretSize = 0;
}
else
{
switch( iStyle )
{
case SC_INSERT:
@@ -591,6 +587,7 @@ static void hb_gt_wvt_UpdateCaret( PHB_GTWVT pWVT )
iCaretSize = 0;
break;
}
}
if( iCaretSize == 0 )
{
@@ -708,16 +705,12 @@ static void hb_gt_wvt_TranslateKey( PHB_GTWVT pWVT, int key, int shiftkey, int a
nVirtKey = GetKeyState( VK_MENU );
if( nVirtKey & 0x8000 ) /* alt + key */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, altkey );
}
else
{
nVirtKey = GetKeyState( VK_CONTROL );
if( nVirtKey & 0x8000 ) /* control + key */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, controlkey );
}
else
{
nVirtKey = GetKeyState( VK_SHIFT );
@@ -758,12 +751,10 @@ static HB_BOOL hb_gt_wvt_FitRows( PHB_GTWVT pWVT )
int borderHeight;
GetClientRect( pWVT->hWnd, &ci );
if( ! pWVT->bMaximized && ( ci.right - ci.left ) == ( pWVT->PTEXTSIZE.x * pWVT->COLS )
&&
( ci.bottom - ci.top ) == ( pWVT->PTEXTSIZE.y * pWVT->ROWS ) )
{
if( ! pWVT->bMaximized && ( ci.right - ci.left ) == ( pWVT->PTEXTSIZE.x * pWVT->COLS ) &&
( ci.bottom - ci.top ) == ( pWVT->PTEXTSIZE.y * pWVT->ROWS ) )
return HB_FALSE;
}
GetWindowRect( pWVT->hWnd, &wi );
borderWidth = ( wi.right - wi.left - ( ci.right - ci.left ) );
@@ -1547,13 +1538,9 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
int iScanCode = HIWORD( lParam ) & 0xFF;
if( bCtrl && iScanCode == 76 ) /* CTRL_VK_NUMPAD5 */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, KP_CTRL_5 );
}
else if( bCtrl && wParam == VK_TAB ) /* K_CTRL_TAB */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, bShift ? K_CTRL_SH_TAB : K_CTRL_TAB );
}
else if( iScanCode == 70 ) /* Ctrl_Break key OR Scroll Lock Key */
{
if( bCtrl ) /* Not scroll lock */
@@ -1562,14 +1549,10 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
pWVT->IgnoreWM_SYSCHAR = HB_TRUE;
}
else
{
DefWindowProc( pWVT->hWnd, message, wParam, lParam ); /* Let windows handle ScrollLock */
}
}
else if( bCtrl && iScanCode == 53 && bShift )
{
hb_gt_wvt_AddCharToInputQueue( pWVT, K_CTRL_QUESTION );
}
else if( ( bAlt || bCtrl ) && (
wParam == VK_MULTIPLY || wParam == VK_ADD ||
wParam == VK_SUBTRACT || wParam == VK_DIVIDE ) )
@@ -1594,9 +1577,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
}
}
else if( pWVT->EnableShortCuts )
{
return DefWindowProc( pWVT->hWnd, message, wParam, lParam ) != 0;
}
}
}
break;
@@ -1611,13 +1592,9 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
if( ! pWVT->IgnoreWM_SYSCHAR )
{
if( bCtrl && iScanCode == 28 ) /* K_CTRL_RETURN */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, K_CTRL_RETURN );
}
else if( bCtrl && ( c >= 1 && c <= 26 ) ) /* K_CTRL_A - Z */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, K_Ctrl[ c - 1 ] );
}
else
{
switch( c )
@@ -2431,9 +2408,7 @@ static void hb_gt_wvt_ShowWindow( PHB_GTWVT pWVT )
int iCmdShow;
if( pWVT->pPP->bConfigured )
{
iCmdShow = pWVT->pPP->bVisible ? SW_SHOWNORMAL : SW_HIDE;
}
else
{
/*
@@ -2443,13 +2418,9 @@ static void hb_gt_wvt_ShowWindow( PHB_GTWVT pWVT )
* at the point you desire in your code.
*/
if( hb_dynsymFind( "HB_NOSTARTUPWINDOW" ) != NULL )
{
iCmdShow = SW_HIDE;
}
else
{
iCmdShow = SW_SHOWNORMAL;
}
}
ShowWindow( pWVT->hWnd, iCmdShow );
}
@@ -3130,6 +3101,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWVT->fontWidth );
if( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC )
pWVT->fontWidth = hb_itemGetNI( pInfo->pNewVal );
break;
case HB_GTI_FONTNAME:
@@ -3145,12 +3117,14 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWVT->fontWeight );
if( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC )
pWVT->fontWeight = hb_itemGetNI( pInfo->pNewVal );
break;
case HB_GTI_FONTQUALITY:
pInfo->pResult = hb_itemPutNI( pInfo->pResult, pWVT->fontQuality );
if( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC )
pWVT->fontQuality = hb_itemGetNI( pInfo->pNewVal );
break;
case HB_GTI_SCREENHEIGHT:
@@ -3221,9 +3195,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
if( iVal != pWVT->CodePage )
{
if( ! pWVT->hWnd )
{
pWVT->CodePage = iVal;
}
#if ! defined( UNICODE )
else if( iVal == pWVT->boxCodePage )
{
@@ -3471,13 +3443,10 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
HB_GTWVT_LONG_PTR style = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE );
if( bMax && ( ! pWVT->bMaximizable ) )
{
style = style | WS_MAXIMIZEBOX;
}
else if( ( ! bMax ) && pWVT->bMaximizable )
{
style = style & ~WS_MAXIMIZEBOX;
}
SetWindowLongPtr( pWVT->hWnd, GWL_STYLE, style );
SetWindowPos( pWVT->hWnd, NULL, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_DEFERERASE );
@@ -3872,54 +3841,34 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_EXSTYLE );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->exStyle = ( DWORD ) hb_itemGetNInt( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_STYLE );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->style = ( DWORD ) hb_itemGetNInt( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_X );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->x = hb_itemGetNI( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_Y );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->y = hb_itemGetNI( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_WIDTH );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->width = hb_itemGetNI( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_HEIGHT );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->height = hb_itemGetNI( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_PARENT );
if( hb_itemType( pSome ) & HB_IT_POINTER )
{
pWVT->pPP->pParentGT = hb_itemNew( hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_PARENT ) );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_VISIBLE );
if( hb_itemType( pSome ) & HB_IT_LOGICAL )
{
pWVT->pPP->bVisible = hb_itemGetL( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_ROWCOLS );
if( hb_itemType( pSome ) & HB_IT_LOGICAL )
{
pWVT->pPP->bRowCols = hb_itemGetL( pSome );
}
pSome = hb_arrayGetItemPtr( pInfo->pNewVal, HB_GTI_PP_WNDTYPE );
if( hb_itemType( pSome ) & HB_IT_NUMERIC )
{
pWVT->pPP->iWndType = hb_itemGetNI( pSome );
}
/* Flag that caller configured itself */
pWVT->pPP->bConfigured = HB_TRUE;
@@ -3965,25 +3914,19 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_DEFERPAINT:
if( hb_itemType( pInfo->pNewVal ) & HB_IT_LOGICAL )
{
pWVT->bDeferPaint = hb_itemGetL( pInfo->pNewVal );
}
break;
case HB_GTI_ACTIVATESELECTCOPY:
if( pWVT->bSelectCopy )
{
pWVT->bBeginMarked = HB_TRUE;
}
break;
case HB_GTI_REFRESH:
if( pWVT->hWnd )
{
InvalidateRect( pWVT->hWnd, NULL, FALSE );
}
break;
case HB_GTI_NOTIFIERBLOCKGUI:
@@ -3994,9 +3937,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
pWVT->pNotifierGUI = NULL;
}
if( hb_itemType( pInfo->pNewVal ) & HB_IT_BLOCK )
{
pWVT->pNotifierGUI = hb_itemNew( pInfo->pNewVal );
}
break;
default:
@@ -4272,15 +4213,9 @@ static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
/* ********************************************************************** */
/*-*/
/*-*/
/*-*/
/*
* WVT specific functions
*/
/*-*/
/*-*/
/*-*/
static void hb_wvt_gtLoadGuiData( void )
{
@@ -4310,9 +4245,7 @@ static void hb_wvt_gtLoadGuiData( void )
/* workaround for wrong declarations in some old C compilers */
s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddress( h, "GradientFill" );
if( s_guiData->pfnGF )
{
s_guiData->hMSImg32 = h;
}
}
h = GetModuleHandle( TEXT( "user32.dll" ) );
@@ -4320,9 +4253,7 @@ static void hb_wvt_gtLoadGuiData( void )
{
s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" );
if( s_guiData->pfnLayered )
{
s_guiData->hUser32 = h;
}
}
}
@@ -4449,9 +4380,7 @@ static void hb_wvt_gtExitGui( PHB_GTWVT pWVT )
#if ! defined( HB_OS_WIN_CE )
HMENU hMenu = GetMenu( pWVT->hWnd );
if( hMenu )
{
DestroyMenu( hMenu );
}
#endif
for( i = 0; i < WVT_DLGML_MAX; i++ )
{
@@ -4471,13 +4400,9 @@ static void hb_wvt_gtExitGui( PHB_GTWVT pWVT )
pWVT->hdc = NULL;
}
if( pWVT->hFont )
{
DeleteObject( pWVT->hFont );
}
if( pWVT->hWndTT )
{
DestroyWindow( pWVT->hWndTT );
}
if( pWVT->hGuiDC )
{
DeleteDC( pWVT->hGuiDC );
@@ -4500,9 +4425,8 @@ static void hb_wvt_gtInitGui( PHB_GTWVT pWVT )
pWVT->hGuiDC = CreateCompatibleDC( pWVT->hdc );
if( pWVT->hGuiBmp )
{
DeleteObject( pWVT->hGuiBmp );
}
pWVT->hGuiBmp = CreateCompatibleBitmap( pWVT->hdc, pWVT->iGuiWidth, pWVT->iGuiHeight );
SelectObject( pWVT->hGuiDC, pWVT->hGuiBmp );
@@ -4556,9 +4480,7 @@ static void hb_wvt_gtCreateToolTipWindow( PHB_GTWVT pWVT )
icex.dwICC = ICC_BAR_CLASSES;
if( ! InitCommonControlsEx( &icex ) )
{
return;
}
/* Create the tooltip control. */
hwndTT = CreateWindow( TOOLTIPS_CLASS, TEXT( "" ),

View File

@@ -224,21 +224,14 @@ HB_BOOL hb_wvt_gtRenderPicture( int x1, int y1, int wd, int ht, IPicture * iPict
HB_VTBL( iPicture )->get_Height( HB_THIS_( iPicture ) & lHeight );
if( dc == 0 )
{
dc = ( int ) ( ( float ) dr * lWidth / lHeight );
}
if( dr == 0 )
{
dr = ( int ) ( ( float ) dc * lHeight / lWidth );
}
if( tor == 0 )
{
tor = dr;
}
if( toc == 0 )
{
toc = dc;
}
x = c;
y = r;
xe = c + toc - 1;
@@ -416,9 +409,7 @@ BOOL CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPA
case WM_DESTROY:
#endif
if( _s->pFunc[ iIndex ] != NULL && _s->iType[ iIndex ] == 2 )
{
hb_itemRelease( ( PHB_ITEM ) _s->pFunc[ iIndex ] );
}
_s->hDlgModeless[ iIndex ] = NULL;
_s->pFunc[ iIndex ] = NULL;
_s->iType[ iIndex ] = 0;
@@ -527,9 +518,7 @@ BOOL CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPA
case WM_DESTROY:
#endif
if( _s->pFuncModal[ iIndex ] != NULL && _s->iTypeModal[ iIndex ] == 2 )
{
hb_itemRelease( ( PHB_ITEM ) _s->pFuncModal[ iIndex ] );
}
_s->hDlgModal[ iIndex ] = NULL;
_s->pFuncModal[ iIndex ] = NULL;
_s->iTypeModal[ iIndex ] = 0;
@@ -587,21 +576,14 @@ HB_BOOL hb_wvt_DrawImage( HDC hdc, int x1, int y1, int wd, int ht, LPCTSTR lpIma
HB_VTBL( iPicture )->get_Height( HB_THIS_( iPicture ) & lHeight );
if( dc == 0 )
{
dc = ( int ) ( ( float ) dr * lWidth / lHeight );
}
if( dr == 0 )
{
dr = ( int ) ( ( float ) dc * lHeight / lWidth );
}
if( tor == 0 )
{
tor = dr;
}
if( toc == 0 )
{
toc = dc;
}
x = c;
y = r;
xe = c + toc - 1;
@@ -916,9 +898,7 @@ HB_FUNC( WVT_SETPEN )
HPEN hPen;
if( ! HB_ISNUM( 1 ) )
{
hb_retl( HB_FALSE );
}
iPenStyle = hb_parni( 1 );
iPenWidth = hb_parni( 2 );
@@ -929,17 +909,13 @@ HB_FUNC( WVT_SETPEN )
if( hPen )
{
if( _s->currentPen )
{
DeleteObject( _s->currentPen );
}
_s->currentPen = hPen;
hb_retl( HB_TRUE );
}
else
{
hb_retl( HB_FALSE );
}
}
/*
@@ -953,9 +929,7 @@ HB_FUNC( WVT_SETBRUSH )
LOGBRUSH lb = { 0, 0, 0 };
if( ! HB_ISNUM( 1 ) )
{
hb_retl( HB_FALSE );
}
lb.lbStyle = hb_parnl( 1 );
lb.lbColor = ( COLORREF ) hb_parnldef( 2, RGB( 0, 0, 0 ) );
@@ -968,17 +942,13 @@ HB_FUNC( WVT_SETBRUSH )
if( hBrush )
{
if( _s->currentBrush )
{
DeleteObject( _s->currentBrush );
}
_s->currentBrush = hBrush;
hb_retl( HB_TRUE );
}
else
{
hb_retl( HB_FALSE );
}
}
/*
@@ -1018,9 +988,7 @@ HB_FUNC( WVT_DRAWBOXRAISED )
hb_wvt_DrawBoxRaised( _s->hdc, iTop - 1, iLeft - 1, iBottom + 1, iRight + 1 );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawBoxRaised( _s->hGuiDC, iTop - 1, iLeft - 1, iBottom + 1, iRight + 1 );
}
#endif
}
@@ -1039,9 +1007,7 @@ HB_FUNC( WVT_DRAWBOXRECESSED )
hb_wvt_DrawBoxRecessed( _s->hdc, iTop - 1, iLeft - 1, iBottom + 1, iRight + 1 );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawBoxRecessed( _s->hGuiDC, iTop - 1, iLeft - 1, iBottom + 1, iRight + 1 );
}
#endif
}
@@ -1060,9 +1026,7 @@ HB_FUNC( WVT_DRAWBOXGROUP )
hb_wvt_DrawBoxGroup( _s->hdc, iTop, iLeft, iBottom, iRight );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawBoxGroup( _s->hGuiDC, iTop, iLeft, iBottom, iRight );
}
#endif
}
@@ -1081,9 +1045,7 @@ HB_FUNC( WVT_DRAWBOXGROUPRAISED )
hb_wvt_DrawBoxGroupRaised( _s->hdc, iTop, iLeft, iBottom, iRight );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawBoxGroupRaised( _s->hGuiDC, iTop, iLeft, iBottom, iRight );
}
#endif
}
@@ -1107,9 +1069,7 @@ HB_FUNC( WVT_DRAWIMAGE )
iRight = xy.x - 1 + hb_parvni( 6, 4 );
if( HB_ISNUM( 5 ) )
{
hb_wvt_gtRenderPicture( iLeft, iTop, ( iRight - iLeft ) + 1, ( iBottom - iTop ) + 1, _s->pGUI->iPicture[ hb_parni( 5 ) - 1 ] );
}
else
{
void * hImage;
@@ -1225,9 +1185,7 @@ HB_FUNC( WVT_DRAWOUTLINE )
{
hPen = CreatePen( hb_parni( 5 ), 0, ( COLORREF ) hb_parnl( 7 ) );
if( hPen )
{
hOldPen = ( HPEN ) SelectObject( _s->hdc, hPen );
}
}
else
{
@@ -1240,9 +1198,7 @@ HB_FUNC( WVT_DRAWOUTLINE )
if( _s->bGui )
{
if( hPen )
{
hOldPenGUI = ( HPEN ) SelectObject( _s->hGuiDC, hPen );
}
else
{
hOldPenGUI = ( HPEN ) SelectObject( _s->hGuiDC, _s->pGUI->penBlack );
@@ -1255,9 +1211,7 @@ HB_FUNC( WVT_DRAWOUTLINE )
{
SelectObject( _s->hdc, hOldPen );
if( hOldPenGUI )
{
SelectObject( _s->hGuiDC, hOldPenGUI );
}
DeleteObject( hPen );
}
}
@@ -1310,13 +1264,9 @@ HB_FUNC( WVT_DRAWLINE )
case 2: /* bottom */
if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */
{
y = iBottom - 1;
}
else
{
y = iBottom;
}
break;
case 3: /* Left */
@@ -1324,13 +1274,9 @@ HB_FUNC( WVT_DRAWLINE )
case 4: /* Right */
if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */
{
x = iRight - 1;
}
else
{
x = iRight;
}
break;
}
@@ -1460,9 +1406,7 @@ HB_FUNC( WVT_DRAWLINE )
SelectObject( _s->hdc, hOldPen );
if( hOldPenGUI )
{
SelectObject( _s->hGuiDC, hOldPenGUI );
}
DeleteObject( hPen );
hb_retl( HB_TRUE );
}
@@ -1486,9 +1430,7 @@ HB_FUNC( WVT_DRAWELLIPSE )
hb_retl( Ellipse( _s->hdc, iLeft, iTop, iRight, iBottom ) );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_retl( Ellipse( _s->hGuiDC, iLeft, iTop, iRight, iBottom ) );
}
#endif
}
@@ -1510,9 +1452,7 @@ HB_FUNC( WVT_DRAWRECTANGLE )
hb_retl( Rectangle( _s->hdc, iLeft, iTop, iRight, iBottom ) );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_retl( Rectangle( _s->hGuiDC, iLeft, iTop, iRight, iBottom ) );
}
#endif
}
@@ -1538,9 +1478,7 @@ HB_FUNC( WVT_DRAWROUNDRECT )
hb_retl( RoundRect( _s->hdc, iLeft, iTop, iRight, iBottom, iWd, iHt ) );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_retl( RoundRect( _s->hGuiDC, iLeft, iTop, iRight, iBottom, iWd, iHt ) );
}
#endif
}
@@ -1565,9 +1503,7 @@ HB_FUNC( WVT_DRAWFOCUSRECT )
hb_retl( DrawFocusRect( _s->hdc, &rc ) );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_retl( DrawFocusRect( _s->hGuiDC, &rc ) );
}
#endif
}
@@ -1597,9 +1533,7 @@ HB_FUNC( WVT_DRAWCOLORRECT )
hb_retl( FillRect( _s->hdc, &rc, hBrush ) );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_retl( FillRect( _s->hGuiDC, &rc, hBrush ) );
}
#endif
DeleteObject( hBrush );
}
@@ -1667,9 +1601,7 @@ HB_FUNC( WVT_DRAWGRIDVERT )
int iTabs = hb_parni( 4 );
if( ! iTabs )
{
hb_retl( HB_FALSE );
}
iCharWidth = _s->PTEXTSIZE.x;
iCharHeight = _s->PTEXTSIZE.y;
@@ -1752,9 +1684,7 @@ HB_FUNC( WVT_DRAWBUTTON )
FillRect( _s->hdc, &rc, hBrush );
#if defined( __SETGUI__ )
if( _s->bGui )
{
FillRect( _s->hGuiDC, &rc, hBrush );
}
#endif
DeleteObject( hBrush );
@@ -1763,27 +1693,21 @@ HB_FUNC( WVT_DRAWBUTTON )
case 1:
hb_wvt_DrawBoxRecessed( _s->hdc, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 );
if( _s->bGui )
{
hb_wvt_DrawBoxRecessed( _s->hGuiDC, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 );
}
break;
case 2:
break;
case 3:
hb_wvt_DrawOutline( _s->hdc, iTop, iLeft, iBottom, iRight );
if( _s->bGui )
{
hb_wvt_DrawOutline( _s->hGuiDC, iTop, iLeft, iBottom, iRight );
}
break;
case 4:
break;
default:
hb_wvt_DrawBoxRaised( _s->hdc, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 );
if( _s->bGui )
{
hb_wvt_DrawBoxRaised( _s->hGuiDC, iTop + 1, iLeft + 1, iBottom - 1, iRight - 1 );
}
break;
}
@@ -1804,13 +1728,9 @@ HB_FUNC( WVT_DRAWBUTTON )
xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 );
if( bImage )
{
xy.y = ( iBottom - 2 - iTextHeight );
}
else
{
xy.y = iTop + ( ( iBottom - iTop + 1 - iTextHeight ) / 2 );
}
if( iFormat == 1 )
{
@@ -1841,9 +1761,7 @@ HB_FUNC( WVT_DRAWBUTTON )
hb_strfree( hText );
}
else
{
iTextHeight = -1;
}
if( bImage )
{
@@ -2067,13 +1985,9 @@ HB_FUNC( WVT_DRAWLINEEX )
case 2: /* bottom */
if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */
{
y = iBottom - 1;
}
else
{
y = iBottom;
}
break;
case 3: /* Left */
@@ -2081,13 +1995,9 @@ HB_FUNC( WVT_DRAWLINEEX )
case 4: /* Right */
if( iFormat == 0 || iFormat == 1 ) /* Raised/Recessd */
{
x = iRight - 1;
}
else
{
x = iRight;
}
break;
}
@@ -2235,20 +2145,14 @@ HB_FUNC( WVT_DRAWOUTLINEEX )
iRight = xy.x + hb_parvni( 6, 4 );
if( _s->pGUI->hUserPens[ iSlot ] )
{
SelectObject( _s->hdc, _s->pGUI->hUserPens[ iSlot ] );
}
else
{
SelectObject( _s->hdc, _s->pGUI->penBlack );
}
hb_wvt_DrawOutline( _s->hdc, iTop, iLeft, iBottom, iRight );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawOutline( _s->hGuiDC, iTop, iLeft, iBottom, iRight );
}
#endif
}
@@ -2366,9 +2270,7 @@ HB_FUNC( WVT_DRAWTOOLBUTTONSTATE )
hb_wvt_DrawToolButtonFlat( _s->hdc, iTop, iLeft, iBottom, iRight );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawToolButtonFlat( _s->hGuiDC, iTop, iLeft, iBottom, iRight );
}
#endif
break;
@@ -2376,9 +2278,7 @@ HB_FUNC( WVT_DRAWTOOLBUTTONSTATE )
hb_wvt_DrawToolButtonUp( _s->hdc, iTop, iLeft, iBottom, iRight );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawToolButtonUp( _s->hGuiDC, iTop, iLeft, iBottom, iRight );
}
#endif
break;
@@ -2386,9 +2286,7 @@ HB_FUNC( WVT_DRAWTOOLBUTTONSTATE )
hb_wvt_DrawToolButtonDown( _s->hdc, iTop, iLeft, iBottom, iRight );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawToolButtonDown( _s->hGuiDC, iTop, iLeft, iBottom, iRight );
}
#endif
break;
}
@@ -2422,9 +2320,7 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON )
hb_wvt_DrawBoxRecessed( _s->hdc, iTop + 1, iLeft + 1, iBottom - 2, iRight - 2 );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawBoxRecessed( _s->hGuiDC, iTop + 1, iLeft + 1, iBottom - 2, iRight - 2 );
}
#endif
}
else
@@ -2432,9 +2328,7 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON )
hb_wvt_DrawBoxRaised( _s->hdc, iTop + 1, iLeft + 1, iBottom - 2, iRight - 2 );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawBoxRaised( _s->hGuiDC, iTop + 1, iLeft + 1, iBottom - 2, iRight - 2 );
}
#endif
}
@@ -2546,9 +2440,7 @@ HB_FUNC( WVT_DRAWSCROLLTHUMBVERT )
hb_wvt_DrawBoxRaised( _s->hdc, iTabTop + 1, iTabLft + 1, iTabBtm - 2, iTabRgt - 2 );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawBoxRaised( _s->hGuiDC, iTabTop + 1, iTabLft + 1, iTabBtm - 2, iTabRgt - 2 );
}
#endif
}
@@ -2599,9 +2491,7 @@ HB_FUNC( WVT_DRAWSCROLLTHUMBHORZ )
hb_wvt_DrawBoxRaised( _s->hdc, iTop + 1, iThumbLeft + 1, iBottom - 2, iThumbRight - 2 );
#if defined( __SETGUI__ )
if( _s->bGui )
{
hb_wvt_DrawBoxRaised( _s->hGuiDC, iTop + 1, iThumbLeft + 1, iBottom - 2, iThumbRight - 2 );
}
#endif
}
@@ -2647,9 +2537,7 @@ HB_FUNC( WVT_DRAWSHADEDRECT )
bGF = ( HB_BOOL ) _s->pGUI->pfnGF( _s->hdc, vert, 2, &gRect, 1, iMode );
#if defined( __SETGUI__ )
if( _s->bGui )
{
bGF = ( HB_BOOL ) _s->pGUI->pfnGF( _s->hGuiDC, vert, 2, &gRect, 1, iMode );
}
#endif
}
hb_retl( bGF );
@@ -2815,9 +2703,7 @@ HB_FUNC( WVT_DRAWPROGRESSBAR )
FillRect( _s->hdc, &rc, hBrush );
#if defined( __SETGUI__ )
if( _s->bGui )
{
FillRect( _s->hGuiDC, &rc, hBrush );
}
#endif
DeleteObject( hBrush );
}
@@ -2937,9 +2823,7 @@ HB_FUNC( WVT_LOADFONT )
if( hFont )
{
if( _s->pGUI->hUserFonts[ iSlot ] )
{
DeleteObject( _s->pGUI->hUserFonts[ iSlot ] );
}
_s->pGUI->hUserFonts[ iSlot ] = hFont;
}
}
@@ -2965,17 +2849,13 @@ HB_FUNC( WVT_LOADPEN )
if( hPen )
{
if( _s->pGUI->hUserPens[ iSlot ] )
{
DeleteObject( _s->pGUI->hUserPens[ iSlot ] );
}
_s->pGUI->hUserPens[ iSlot ] = hPen;
hb_retl( HB_TRUE );
}
else
{
hb_retl( HB_FALSE );
}
}
/*
@@ -3054,9 +2934,7 @@ HB_FUNC( WVT_RESTSCREEN )
hCompDC,
0, 0,
SRCCOPY ) )
{
bResult = HB_TRUE;
}
}
else
{
@@ -3067,9 +2945,7 @@ HB_FUNC( WVT_RESTSCREEN )
hb_parvni( 5, 1 ),
hb_parvni( 5, 2 ),
SRCCOPY ) )
{
bResult = HB_TRUE;
}
}
}
DeleteDC( hCompDC );

View File

@@ -1283,9 +1283,7 @@ HB_FUNC( WVG_PICTURE )
pWVT->gObjs = gObj;
}
else
{
hb_retni( 0 );
}
#else
hb_retni( 0 );
#endif
@@ -1311,9 +1309,7 @@ HB_FUNC( WVG_IMAGE )
{
case GOBJ_IMAGESOURCE_SLOT:
if( HB_ISNUM( 7 ) && hb_parni( 7 ) <= WVT_PICTURES_MAX )
{
iPicture = pWVT->pGUI->iPicture[ hb_parni( 7 ) - 1 ];
}
break;
case GOBJ_IMAGESOURCE_RESOURCE:
{
@@ -1352,21 +1348,15 @@ HB_FUNC( WVG_IMAGE )
gObj->iPicture = iPicture;
if( iSource == GOBJ_IMAGESOURCE_SLOT )
{
gObj->bDestroyPicture = HB_FALSE;
}
else
{
gObj->bDestroyPicture = HB_TRUE;
}
gObj->gObjNext = pWVT->gObjs;
pWVT->gObjs = gObj;
}
else
{
hb_retni( 0 );
}
#else
hb_retni( 0 );
#endif
@@ -1520,9 +1510,7 @@ static void hb_wvg_GridHorz( PHB_GTWVT pWVT, PHB_ITEM pArray, RECT * uRect )
if( ( uRect->left > iRight ) || ( uRect->top > iBottom ) ||
( uRect->bottom < iTop ) || ( uRect->right < iLeft ) )
{
return;
}
hdc = pWVT->hdc;
SelectObject( hdc, pWVT->currentPen );
@@ -1578,14 +1566,10 @@ void hb_gt_wvt_PaintGObjects( PHB_GTWVT pWVT, RECT * uRect )
if( iObjType == GOBJ_OBJTYPE_GRIDVERT )
{
if( hb_arrayGetNI( pArray, 4 ) > 0 )
{
hb_wvg_GridVert( pWVT, pArray, uRect );
}
}
else if( iObjType == GOBJ_OBJTYPE_GRIDHORZ )
{
hb_wvg_GridHorz( pWVT, pArray, uRect );
}
else
{
/* Take care of offsets 5th element */
@@ -1596,9 +1580,8 @@ void hb_gt_wvt_PaintGObjects( PHB_GTWVT pWVT, RECT * uRect )
}
}
else
{
iObjType = 0;
}
/* C A R E F U L */
#if 0
if( pArray )
@@ -1744,9 +1727,7 @@ void hb_gt_wvt_PaintGObjects( PHB_GTWVT pWVT, RECT * uRect )
/* It is inside of the boundaries */
}
else
{
hb_wvg_Outline( pWVT, gObj, iLeft - 1, iTop - 1, iRight + 1, iBottom + 1 );
}
break;
}
}

View File

@@ -225,9 +225,7 @@ HB_FUNC( WVT_CHOOSECOLOR )
int i;
for( i = 0; i < 16; i++ )
{
crCustClr[ i ] = ( HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i + 1 ) : GetSysColor( COLOR_BTNFACE ) );
}
cc.lStructSize = sizeof( CHOOSECOLOR );
cc.hwndOwner = _s->hWnd;
@@ -236,13 +234,9 @@ HB_FUNC( WVT_CHOOSECOLOR )
cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN );
if( ChooseColor( &cc ) )
{
hb_retnl( cc.rgbResult );
}
else
{
hb_retnl( -1 );
}
}
/*
@@ -271,9 +265,7 @@ HB_FUNC( WVT_SETTOOLTIPACTIVE )
HB_BOOL bActive = _s->bToolTipActive;
if( HB_ISLOG( 1 ) )
{
_s->bToolTipActive = hb_parl( 1 );
}
hb_retl( bActive );
}
@@ -848,9 +840,7 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC )
for( iIndex = 0; iIndex < WVT_DLGML_MAX; iIndex++ )
{
if( _s->hDlgModeless[ iIndex ] == NULL )
{
break;
}
}
if( iIndex >= WVT_DLGML_MAX )
@@ -870,9 +860,7 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC )
{
pExecSym = hb_dynsymFindName( hb_itemGetCPtr( pFirst ) );
if( pExecSym )
{
pFunc = ( PHB_ITEM ) pExecSym;
}
iType = 1;
}
@@ -926,9 +914,7 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC )
{
/* if codeblock, store the codeblock and lock it there */
if( HB_IS_BLOCK( pFirst ) )
{
_s->pcbFunc[ iIndex ] = pFunc;
}
_s->pFunc[ iIndex ] = pFunc;
_s->iType[ iIndex ] = iType;
@@ -1079,9 +1065,8 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE )
p += nchar;
}
else
{
*p++ = 0;
}
/* add in the wPointSize and szFontName here iff the DS_SETFONT bit on */
if( ( lStyle & DS_SETFONT ) )
@@ -1220,17 +1205,13 @@ HB_FUNC( WVT_DLGSETICON )
HICON hIcon;
if( HB_ISNUM( 2 ) )
{
hIcon = LoadIcon( ( HINSTANCE ) wvg_hInstance(), MAKEINTRESOURCE( hb_parni( 2 ) ) );
}
else
{
void * cIcon;
hIcon = ( HICON ) LoadImage( ( HINSTANCE ) NULL, HB_PARSTR( 2, &cIcon, NULL ), IMAGE_ICON, 0, 0, LR_LOADFROMFILE );
if( ! hIcon )
{
hIcon = ( HICON ) LoadImage( GetModuleHandle( NULL ), HB_PARSTR( 2, &cIcon, NULL ), IMAGE_ICON, 0, 0, 0 );
}
hb_strfree( cIcon );
}
@@ -1241,9 +1222,7 @@ HB_FUNC( WVT_DLGSETICON )
}
if( hIcon )
{
hb_retnint( ( HB_PTRDIFF ) hIcon );
}
}
HB_FUNC( WVT_GETFONTHANDLE )

View File

@@ -556,9 +556,7 @@ HB_FUNC( WVG_TRACKPOPUPMENU )
POINT xy = { 0, 0 };
if( ! HB_ISNUM( 3 ) )
{
GetCursorPos( &xy );
}
else
{
xy.x = x;
@@ -715,9 +713,7 @@ HB_FUNC( WVG_ISMENUITEMCHECKED )
lSuccess = GetMenuItemInfo( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ), TRUE, &lpmii );
if( lSuccess )
{
hb_retl( lpmii.fState & MFS_CHECKED ? TRUE : FALSE );
}
else
hb_retl( FALSE );
}

View File

@@ -363,9 +363,7 @@ static HBITMAP hPrepareBitmap( LPCTSTR szBitmap, UINT uiBitmap,
);
if( ! bResult )
{
DeleteObject( hBitmap2 );
}
else
{
DeleteObject( hBitmap );
@@ -954,9 +952,8 @@ HB_FUNC( WVG_FONTCREATE )
hb_arraySetNInt( aFont, 15, ( HB_PTRDIFF ) hFont );
}
else
{
aFont = wvg_logfontTOarray( &lf, HB_TRUE );
}
hb_itemReturnRelease( aFont );
}
@@ -1020,9 +1017,7 @@ HB_FUNC( WVG_ADDTOOLBARBUTTON )
hb_strfree( hCaption );
if( hb_parl( 6 ) )
{
SendMessage( hWndTB, TB_SETMAXTEXTROWS, ( WPARAM ) 0, ( LPARAM ) 0 );
}
/* add button */
tbb.iBitmap = hb_parni( 2 );

View File

@@ -452,9 +452,7 @@ static void hb_gt_wvt_UpdateCaret( PHB_GTWVT pWVT )
HB_GTSELF_GETSCRCURSOR( pWVT->pGT, &iRow, &iCol, &iStyle );
if( iRow < 0 || iCol < 0 || iRow >= pWVT->ROWS || iCol >= pWVT->COLS )
{
iCaretSize = 0;
}
else switch( iStyle )
{
case SC_INSERT:
@@ -1374,13 +1372,9 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
int iScanCode = HIWORD( lParam ) & 0xFF;
if( bCtrl && iScanCode == 76 ) /* CTRL_VK_NUMPAD5 */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, KP_CTRL_5 );
}
else if( bCtrl && wParam == VK_TAB ) /* K_CTRL_TAB */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, bShift ? K_CTRL_SH_TAB : K_CTRL_TAB );
}
else if( iScanCode == 70 ) /* Ctrl_Break key OR Scroll Lock Key */
{
if( bCtrl ) /* Not scroll lock */
@@ -1392,9 +1386,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
DefWindowProc( pWVT->hWnd, message, wParam, lParam ); /* Let windows handle ScrollLock */
}
else if( bCtrl && iScanCode == 53 && bShift )
{
hb_gt_wvt_AddCharToInputQueue( pWVT, K_CTRL_QUESTION );
}
else if( ( bAlt || bCtrl ) && (
wParam == VK_MULTIPLY || wParam == VK_ADD ||
wParam == VK_SUBTRACT || wParam == VK_DIVIDE ) )
@@ -1432,13 +1424,9 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
if( ! pWVT->IgnoreWM_SYSCHAR )
{
if( bCtrl && iScanCode == 28 ) /* K_CTRL_RETURN */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, K_CTRL_RETURN );
}
else if( bCtrl && ( c >= 1 && c <= 26 ) ) /* K_CTRL_A - Z */
{
hb_gt_wvt_AddCharToInputQueue( pWVT, K_Ctrl[ c - 1 ] );
}
else
{
switch( c )
@@ -1746,9 +1734,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT )
*/
iColor &= 0xff;
if( len == 0 )
{
iOldColor = iColor;
}
else if( iColor != iOldColor )
{
hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, pWVT->TextLine, ( UINT ) len );
@@ -2628,9 +2614,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
if( iVal != pWVT->CodePage )
{
if( ! pWVT->hWnd )
{
pWVT->CodePage = iVal;
}
#if ! defined( UNICODE )
else if( iVal == pWVT->boxCodePage )
{
@@ -2672,9 +2656,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
if( iVal != pWVT->boxCodePage )
{
if( ! pWVT->hWnd )
{
pWVT->boxCodePage = iVal;
}
else if( iVal == pWVT->CodePage )
{
if( pWVT->hFontBox != pWVT->hFont )