diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e4c478f23f..21f630b75f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,17 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-25 09:26 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/gtwvg/wvgcuig.c + * contrib/gtwvg/wvgwin.c + * contrib/gtwvg/wvgutils.c + * contrib/gtwvg/wvgcore.c + * contrib/gtwvg/wvgsink.c + * contrib/gtwvg/wvgwing.c + % Using hb_par*def(). + * WVT_CHOOSEFONT() fixed. Parameters italic, underline, strikeout + didn't work. + 2010-06-25 09:05 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/gtwvg/gtwvg.c * contrib/gtwvg/gtwvg.h diff --git a/harbour/contrib/gtwvg/wvgcore.c b/harbour/contrib/gtwvg/wvgcore.c index bade84bbbc..a61eb7a1cf 100644 --- a/harbour/contrib/gtwvg/wvgcore.c +++ b/harbour/contrib/gtwvg/wvgcore.c @@ -1026,7 +1026,7 @@ HB_FUNC( WVT_SETBRUSH ) } lb.lbStyle = hb_parnl( 1 ); - lb.lbColor = HB_ISNUM( 2 ) ? ( COLORREF ) hb_parnl( 2 ) : RGB( 0,0,0 ); + lb.lbColor = ( COLORREF ) hb_parnldef( 2, RGB( 0, 0, 0 ) ); lb.lbHatch = hb_parnl( 3 ); #if ! defined( HB_OS_WIN_CE ) hBrush = CreateBrushIndirect( &lb ); @@ -1221,13 +1221,13 @@ HB_FUNC( WVT_DRAWLABEL ) logfont.lfItalic = ( BYTE ) hb_parl( 14 ); logfont.lfUnderline = ( BYTE ) hb_parl( 15 ); logfont.lfStrikeOut = ( BYTE ) hb_parl( 16 ); - logfont.lfCharSet = ( !HB_ISNUM( 13 ) ? ( BYTE ) _s->CodePage : ( BYTE ) hb_parni( 13 ) ); + logfont.lfCharSet = ( BYTE ) hb_parnidef( 13, _s->CodePage ); logfont.lfOutPrecision = 0; logfont.lfClipPrecision = 0; - logfont.lfQuality = ( !HB_ISNUM( 12 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 12 ) ); + logfont.lfQuality = ( BYTE ) hb_parnidef( 12, DEFAULT_QUALITY ); logfont.lfPitchAndFamily = FF_DONTCARE; - logfont.lfHeight = ( !HB_ISNUM( 9 ) ? _s->fontHeight : hb_parni( 9 ) ); - logfont.lfWidth = ( !HB_ISNUM( 10 ) ? (_s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ) : hb_parni( 10 ) ); + logfont.lfHeight = hb_parnidef( 9, _s->fontHeight ); + logfont.lfWidth = hb_parnidef( 10, _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ); HB_TCHAR_COPYTO( logfont.lfFaceName, ( !HB_ISCHAR( 8 ) ? _s->fontFace : hb_parcx( 8 ) ), HB_SIZEOFARRAY( logfont.lfFaceName ) - 1 ); @@ -1245,7 +1245,7 @@ HB_FUNC( WVT_DRAWLABEL ) SetBkColor( _s->hdc, bgClr ); SetTextColor( _s->hdc, fgClr ); - SetTextAlign( _s->hdc, ( !HB_ISNUM( 4 ) ? TA_LEFT : hb_parvni( 4 ) ) ); + SetTextAlign( _s->hdc, hb_parnidef( 4, TA_LEFT ) ); hOldFont = ( HFONT ) SelectObject( _s->hdc, hFont ); ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL ); @@ -1256,7 +1256,7 @@ HB_FUNC( WVT_DRAWLABEL ) { SetBkColor( _s->hGuiDC, bgClr ); SetTextColor( _s->hGuiDC, fgClr ); - SetTextAlign( _s->hGuiDC, ( !HB_ISNUM( 4 ) ? TA_LEFT : hb_parvni( 4 ) ) ); + SetTextAlign( _s->hGuiDC, hb_parnidef( 4, TA_LEFT ) ); hOldFontGui = ( HFONT ) SelectObject( _s->hGuiDC, hFont ); ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL ); @@ -1294,7 +1294,7 @@ HB_FUNC( WVT_DRAWOUTLINE ) if ( HB_ISNUM( 5 ) ) { - hPen = CreatePen( hb_parni( 5 ), 0, ( !HB_ISNUM( 7 ) ? 0 : ( COLORREF ) hb_parnl( 7 ) ) ); + hPen = CreatePen( hb_parni( 5 ), 0, ( COLORREF ) hb_parnl( 7 ) ); if ( hPen ) { hOldPen = (HPEN) SelectObject( _s->hdc, hPen ); @@ -1357,7 +1357,7 @@ HB_FUNC( WVT_DRAWLINE ) iAlign = hb_parni( 7 ); iStyle = hb_parni( 8 ); iThick = hb_parni( 9 ); - cr = !HB_ISNUM( 10 ) ? 0 : ( COLORREF ) hb_parnl( 10 ); + cr = ( COLORREF ) hb_parnl( 10 ); x = iLeft; y = iTop; @@ -1810,8 +1810,8 @@ HB_FUNC( WVT_DRAWBUTTON ) HB_BOOL bText = HB_ISCHAR( 5 ); HB_BOOL bImage = ( HB_ISNUM( 6 ) || HB_ISCHAR( 6 ) ); int iFormat = hb_parni( 7 ); - COLORREF textColor = !HB_ISNUM( 8 ) ? _s->COLORS[ 0 ] : ( COLORREF ) hb_parnl( 8 ); - COLORREF bkColor = !HB_ISNUM( 9 ) ? _s->COLORS[ 7 ] : ( COLORREF ) hb_parnl( 9 ); + COLORREF textColor = ( COLORREF ) hb_parnldef( 8, _s->COLORS[ 0 ] ); + COLORREF bkColor = ( COLORREF ) hb_parnldef( 9, _s->COLORS[ 7 ] ); /* int iImageAt = hb_parni( 10 ); */ xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); @@ -2079,7 +2079,7 @@ HB_FUNC( WVT_DRAWLABELEX ) SetBkColor( _s->hdc, bgClr ); SetTextColor( _s->hdc, fgClr ); - SetTextAlign( _s->hdc, ( !HB_ISNUM( 4 ) ? TA_LEFT : hb_parni( 4 ) ) ); + SetTextAlign( _s->hdc, hb_parnidef( 4, TA_LEFT ) ); SelectObject( _s->hdc, _s->pGUI->hUserFonts[ iSlot ] ); ExtTextOut( _s->hdc, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL ); @@ -2088,7 +2088,7 @@ HB_FUNC( WVT_DRAWLABELEX ) { SetBkColor( _s->hGuiDC, bgClr ); SetTextColor( _s->hGuiDC, fgClr ); - SetTextAlign( _s->hGuiDC, ( !HB_ISNUM( 4 ) ? TA_LEFT : hb_parni( 4 ) ) ); + SetTextAlign( _s->hGuiDC, hb_parnidef( 4, TA_LEFT ) ); SelectObject( _s->hGuiDC, _s->pGUI->hUserFonts[ iSlot ] ); ExtTextOut( _s->hGuiDC, xy.x, xy.y, 0, NULL, text, lstrlen( text ), NULL ); @@ -2742,7 +2742,7 @@ HB_FUNC( WVT_DRAWSHADEDRECT ) int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5,3 ); int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5,4 ); - int iMode = !HB_ISNUM( 6 ) ? GRADIENT_FILL_RECT_H : hb_parni( 6 ); + int iMode = hb_parnidef( 6, GRADIENT_FILL_RECT_H ); vert[ 0 ].x = iLeft; vert[ 0 ].y = iTop; @@ -2819,7 +2819,7 @@ HB_FUNC( WVT_DRAWTEXTBOX ) SetTextAlign( _s->hdc, TA_TOP | TA_LEFT | TA_NOUPDATECP ); SetTextColor( _s->hdc, fgClr ); SetBkColor( _s->hdc, bgClr ); - SetBkMode( _s->hdc, !HB_ISNUM( 11 ) ? OPAQUE : hb_parni( 11 ) ); + SetBkMode( _s->hdc, hb_parnidef( 11, OPAQUE ) ); SelectObject( _s->hdc, ( HFONT ) ( HB_PTRDIFF ) hb_parnint( 12 ) ); DrawText( _s->hdc, text, lstrlen( text ), &rc, iAlignH | DT_WORDBREAK | DT_TOP ); @@ -2829,7 +2829,7 @@ HB_FUNC( WVT_DRAWTEXTBOX ) SetTextAlign( _s->hGuiDC, TA_TOP | TA_LEFT | TA_NOUPDATECP ); SetTextColor( _s->hGuiDC, fgClr ); SetBkColor( _s->hGuiDC, bgClr ); - SetBkMode( _s->hGuiDC, !HB_ISNUM( 11 ) ? OPAQUE : hb_parni( 11 ) ); + SetBkMode( _s->hGuiDC, hb_parnidef( 11, OPAQUE ) ); SelectObject( _s->hGuiDC, ( HFONT ) ( HB_PTRDIFF ) hb_parnint( 12 ) ); DrawText( _s->hGuiDC, text, lstrlen( text ), &rc, iAlignH | DT_WORDBREAK | DT_TOP ); @@ -2914,7 +2914,7 @@ HB_FUNC( WVT_DRAWPROGRESSBAR ) } else { - crBarColor = !HB_ISNUM( 8 ) ? _s->COLORS[ 0 ] : ( COLORREF ) hb_parnl( 8 ); + crBarColor = ( COLORREF ) hb_parnldef( 8, _s->COLORS[ 0 ] ); lb.lbStyle = BS_SOLID; lb.lbColor = crBarColor; @@ -2955,13 +2955,13 @@ HB_FUNC( WVT_CREATEFONT ) logfont.lfItalic = ( BYTE ) hb_parl( 5 ); logfont.lfUnderline = ( BYTE ) hb_parl( 6 ); logfont.lfStrikeOut = ( BYTE ) hb_parl( 7 ); - logfont.lfCharSet = ( !HB_ISNUM( 8 ) ? ( BYTE ) _s->CodePage : ( BYTE ) hb_parni( 8 ) ); + logfont.lfCharSet = ( BYTE ) hb_parnidef( 8, _s->CodePage ); logfont.lfOutPrecision = 0; logfont.lfClipPrecision = 0; - logfont.lfQuality = ( !HB_ISNUM( 9 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 9 ) ); + logfont.lfQuality = ( BYTE ) hb_parnidef( 9, DEFAULT_QUALITY ); logfont.lfPitchAndFamily = FF_DONTCARE; - logfont.lfHeight = ( !HB_ISNUM( 2 ) ? _s->fontHeight : hb_parni( 2 ) ); - logfont.lfWidth = ( !HB_ISNUM( 3 ) ? ( _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ) : hb_parni( 3 ) ); + logfont.lfHeight = hb_parnidef( 2, _s->fontHeight ); + logfont.lfWidth = hb_parnidef( 3, _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ); HB_TCHAR_COPYTO( logfont.lfFaceName, ( !HB_ISCHAR( 1 ) ? _s->fontFace : hb_parcx( 1 ) ), HB_SIZEOFARRAY( logfont.lfFaceName ) - 1 ); @@ -3039,13 +3039,13 @@ HB_FUNC( WVT_LOADFONT ) logfont.lfItalic = ( BYTE ) hb_parl( 6 ); logfont.lfUnderline = ( BYTE ) hb_parl( 7 ); logfont.lfStrikeOut = ( BYTE ) hb_parl( 8 ); - logfont.lfCharSet = ( !HB_ISNUM( 9 ) ? ( BYTE ) _s->CodePage : ( BYTE ) hb_parni( 9 ) ); + logfont.lfCharSet = ( BYTE ) hb_parnidef( 9, _s->CodePage ); logfont.lfOutPrecision = 0; logfont.lfClipPrecision = 0; - logfont.lfQuality = ( !HB_ISNUM( 10 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 10 ) ); + logfont.lfQuality = ( BYTE ) hb_parnidef( 10, DEFAULT_QUALITY ); logfont.lfPitchAndFamily = FF_DONTCARE; - logfont.lfHeight = ( !HB_ISNUM( 3 ) ? _s->fontHeight : hb_parni( 3 ) ); - logfont.lfWidth = ( !HB_ISNUM( 4 ) ? ( _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ) : hb_parni( 4 ) ); + logfont.lfHeight = hb_parnidef( 3, _s->fontHeight ); + logfont.lfWidth = hb_parnidef( 4, _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ); HB_TCHAR_COPYTO( logfont.lfFaceName, ( !HB_ISCHAR( 2 ) ? _s->fontFace : hb_parcx( 2 ) ), HB_SIZEOFARRAY( logfont.lfFaceName ) - 1 ); @@ -3075,7 +3075,7 @@ HB_FUNC( WVT_LOADPEN ) iPenStyle = hb_parni( 2 ); iPenWidth = hb_parni( 3 ); - crColor = !HB_ISNUM( 4 ) ? RGB( 0,0,0 ) : ( COLORREF ) hb_parnl( 4 ); + crColor = ( COLORREF ) hb_parnldef( 4, RGB( 0,0,0 ) ); hPen = CreatePen( iPenStyle, iPenWidth, crColor ); diff --git a/harbour/contrib/gtwvg/wvgcuig.c b/harbour/contrib/gtwvg/wvgcuig.c index d1a07a9dba..29815bbe46 100644 --- a/harbour/contrib/gtwvg/wvgcuig.c +++ b/harbour/contrib/gtwvg/wvgcuig.c @@ -283,7 +283,7 @@ HB_FUNC( WVG_SETGOBJDATA ) bSuccess = HB_FALSE; break; case GOBJ_OBJDATA_COLORBK: - gObj->crRGBBk = HB_ISNUM( 3 ) ? ( COLORREF ) ( HB_PTRDIFF ) hb_parnint( 3 ) : ( COLORREF ) 0; + gObj->crRGBBk = ( COLORREF ) ( HB_PTRDIFF ) hb_parnint( 3 ); break; case GOBJ_OBJDATA_BLOCK: if( gObj->bBlock ) @@ -585,19 +585,19 @@ HB_FUNC( WVG_LABEL ) LOGFONT lf; HFONT hFont; - lf.lfEscapement = ( !HB_ISNUM( 6 ) ? 0 : ( hb_parni( 6 ) * 10 ) ); + lf.lfEscapement = hb_parni( 6 ) * 10; lf.lfOrientation = 0; - lf.lfWeight = ( !HB_ISNUM( 12 ) ? 0 : hb_parni( 12 ) ); - lf.lfItalic = ( !HB_ISNUM( 15 ) ? 0 : ( BYTE ) hb_parl( 15 ) ); - lf.lfUnderline = ( !HB_ISNUM( 16 ) ? 0 : ( BYTE ) hb_parl( 16 ) ); - lf.lfStrikeOut = ( !HB_ISNUM( 17 ) ? 0 : ( BYTE ) hb_parl( 17 ) ); - lf.lfCharSet = ( !HB_ISNUM( 14 ) ? ( BYTE ) pWVT->CodePage : ( BYTE ) hb_parni( 14 ) ); + lf.lfWeight = hb_parni( 12 ); + lf.lfItalic = ( BYTE ) hb_parl( 15 ); + lf.lfUnderline = ( BYTE ) hb_parl( 16 ); + lf.lfStrikeOut = ( BYTE ) hb_parl( 17 ); + lf.lfCharSet = ( BYTE ) hb_parnidef( 14, pWVT->CodePage ); lf.lfOutPrecision = 0; lf.lfClipPrecision = 0; - lf.lfQuality = ( !HB_ISNUM( 13 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 13 ) ); + lf.lfQuality = ( BYTE ) hb_parnidef( 13, DEFAULT_QUALITY ); lf.lfPitchAndFamily = FF_DONTCARE; - lf.lfHeight = ( !HB_ISNUM( 10 ) ? pWVT->fontHeight : hb_parni( 10 ) ); - lf.lfWidth = ( !HB_ISNUM( 11 ) ? (pWVT->fontWidth < 0 ? -pWVT->fontWidth : pWVT->fontWidth ) : hb_parni( 11 ) ); + lf.lfHeight = hb_parnidef( 10, pWVT->fontHeight ); + lf.lfWidth = hb_parnidef( 11, pWVT->fontWidth < 0 ? -pWVT->fontWidth : pWVT->fontWidth ); HB_TCHAR_COPYTO( lf.lfFaceName, ( !HB_ISCHAR( 9 ) ? pWVT->fontFace : hb_parc( 9 ) ), HB_SIZEOFARRAY( lf.lfFaceName ) - 1 ); @@ -624,9 +624,9 @@ HB_FUNC( WVG_LABEL ) gObj->lpText = hb_strdup( hb_parcx( 4 ) ); #endif - gObj->iAlign = HB_ISNUM( 5 ) ? hb_parni( 5 ) : TA_LEFT; + gObj->iAlign = hb_parnidef( 5, TA_LEFT ); gObj->crRGBText = ( COLORREF ) hb_parnint( 7 ); - gObj->crRGBBk = HB_ISNUM( 8 ) ? ( COLORREF ) hb_parnint( 8 ) : ( COLORREF ) 0; + gObj->crRGBBk = ( COLORREF ) hb_parnint( 8 ); gObj->hFont = hFont; gObj->bDestroyFont = HB_TRUE; @@ -661,9 +661,9 @@ HB_FUNC( WVG_LABELEX ) gObj->lpText = hb_strdup( hb_parcx( 4 ) ); #endif - gObj->iAlign = HB_ISNUM( 5 ) ? hb_parni( 5 ) : TA_LEFT; + gObj->iAlign = hb_parnidef( 5, TA_LEFT ); gObj->crRGBText = ( COLORREF ) hb_parnint( 6 ); - gObj->crRGBBk = HB_ISNUM( 7 ) ? ( COLORREF ) hb_parnint( 7 ) : ( COLORREF ) 0; + gObj->crRGBBk = ( COLORREF ) hb_parnint( 7 ); gObj->hFont = pWVT->pGUI->hUserFonts[ hb_parni( 8 ) - 1 ]; gObj->bDestroyFont = HB_FALSE; @@ -717,7 +717,7 @@ HB_FUNC( WVG_OUTLINE ) gObj->iWidth = hb_parni( 6 ); /* iThick */ gObj->iStyle = hb_parni( 7 ); /* iShape */ - gObj->crRGB = !HB_ISNUM( 8 ) ? 0 : ( COLORREF ) hb_parnl( 8 ); + gObj->crRGB = ( COLORREF ) hb_parnl( 8 ); if ( gObj->iWidth > 0 ) { @@ -1156,7 +1156,7 @@ HB_FUNC( WVG_SHADEDRECT ) gObj->aOffset.iBottom = hb_parvni( 5,3 ); gObj->aOffset.iRight = hb_parvni( 5,4 ); - gObj->iData = !HB_ISNUM( 6 ) ? GRADIENT_FILL_RECT_H : hb_parni( 6 ); + gObj->iData = hb_parnidef( 6, GRADIENT_FILL_RECT_H ); gObj->vert[ 0 ].x = 0; gObj->vert[ 0 ].y = 0; @@ -1235,7 +1235,7 @@ HB_FUNC( WVG_TEXTBOX ) gObj->iAlign = iAlignH; gObj->crRGBText = ( COLORREF ) hb_parnint( 9 ); - gObj->crRGBBk = HB_ISNUM( 10 ) ? ( COLORREF ) hb_parnint( 10 ) : ( COLORREF ) 0; + gObj->crRGBBk = ( COLORREF ) hb_parnint( 10 ); gObj->hFont = ( HFONT ) ( HB_PTRDIFF ) hb_parnint( 11 ); gObj->bDestroyFont = HB_FALSE; diff --git a/harbour/contrib/gtwvg/wvgsink.c b/harbour/contrib/gtwvg/wvgsink.c index f96e21264b..e813d5b938 100644 --- a/harbour/contrib/gtwvg/wvgsink.c +++ b/harbour/contrib/gtwvg/wvgsink.c @@ -415,10 +415,10 @@ HB_FUNC( WVG_AXCREATEWINDOW ) /* ( hWndContainer, CLSID, menuID=0, x, y, w, h, s LPTSTR cCaption = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); hb_retptr( ( void * ) ( HB_PTRDIFF ) CreateWindowEx( - HB_ISNUM( 9 ) ? hb_parnl( 9 ) : 0 /* Exstyle */, + hb_parnl( 9 ) /* Exstyle */, TEXT( "ATLAXWin" ), cCaption, - HB_ISNUM( 8 ) ? hb_parni( 8 ) : WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS /* Style */, + hb_parnidef( 8, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS ) /* Style */, hb_parni( 4 ) /* x */, hb_parni( 5 ) /* y */, hb_parni( 6 ) /* w */, diff --git a/harbour/contrib/gtwvg/wvgutils.c b/harbour/contrib/gtwvg/wvgutils.c index d68292fdd2..41af1ccaf1 100644 --- a/harbour/contrib/gtwvg/wvgutils.c +++ b/harbour/contrib/gtwvg/wvgutils.c @@ -143,11 +143,11 @@ HB_FUNC( WVT_CHOOSEFONT ) lf.lfHeight = PointSize; lf.lfWidth = hb_parni( 3 ); lf.lfWeight = hb_parni( 4 ); - lf.lfItalic = !HB_ISNUM( 6 ) ? 0 : ( BYTE ) hb_parl( 6 ); - lf.lfUnderline = !HB_ISNUM( 7 ) ? 0 : ( BYTE ) hb_parl( 7 ); - lf.lfStrikeOut = !HB_ISNUM( 8 ) ? 0 : ( BYTE ) hb_parl( 8 ); + lf.lfItalic = HB_ISNUM( 6 ) ? ( BYTE ) hb_parni( 6 ) : ( BYTE ) hb_parl( 6 ); + lf.lfUnderline = HB_ISNUM( 7 ) ? ( BYTE ) hb_parni( 7 ) : ( BYTE ) hb_parl( 7 ); + lf.lfStrikeOut = HB_ISNUM( 8 ) ? ( BYTE ) hb_parni( 8 ) : ( BYTE ) hb_parl( 8 ); lf.lfCharSet = DEFAULT_CHARSET; - lf.lfQuality = !HB_ISNUM( 5 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 5 ); + lf.lfQuality = ( BYTE ) hb_parnidef( 5, DEFAULT_QUALITY ); lf.lfPitchAndFamily = FF_DONTCARE; if ( HB_ISCHAR( 1 ) ) { @@ -226,9 +226,9 @@ HB_FUNC( WVT_CHOOSECOLOR ) cc.lStructSize = sizeof( CHOOSECOLOR ); cc.hwndOwner = _s->hWnd; - cc.rgbResult = HB_ISNUM( 1 ) ? ( COLORREF ) hb_parnl( 1 ) : 0; + cc.rgbResult = ( COLORREF ) hb_parnl( 1 ); cc.lpCustColors = crCustClr; - cc.Flags = ( WORD ) ( HB_ISNUM( 3 ) ? hb_parnl( 3 ) : CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN ); + cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN ); if ( ChooseColor( &cc ) ) { @@ -250,7 +250,7 @@ HB_FUNC( WVT_MESSAGEBOX ) LPTSTR title = HB_TCHAR_CONVTO( hb_parc( 1 ) ); LPTSTR msg = HB_TCHAR_CONVTO( hb_parc( 2 ) ); - hb_retni( MessageBox( _s->hWnd, title, msg, HB_ISNUM( 3 ) ? hb_parni( 3 ) : MB_OK ) ); + hb_retni( MessageBox( _s->hWnd, title, msg, hb_parnidef( 3, MB_OK ) ) ); HB_TCHAR_FREE( title ); HB_TCHAR_FREE( msg ); } @@ -1505,7 +1505,7 @@ HB_FUNC( WVT__GETOPENFILENAME ) ofn.hwndOwner = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow(); ofn.lpstrTitle = lpstrTitle; ofn.lpstrFilter = lpstrFilter; - ofn.Flags = HB_ISNUM( 5 ) ? hb_parnl( 5 ) : OFN_SHOWHELP|OFN_NOCHANGEDIR; + ofn.Flags = hb_parnldef( 5, OFN_SHOWHELP | OFN_NOCHANGEDIR ); ofn.lpstrInitialDir = lpstrInitialDir; ofn.lpstrDefExt = lpstrDefExt; ofn.nFilterIndex = hb_parni( 8 ); @@ -1552,7 +1552,7 @@ HB_FUNC( WVT__GETSAVEFILENAME ) ofn.hwndOwner = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow(); ofn.lpstrTitle = lpstrTitle; ofn.lpstrFilter = lpstrFilter; - ofn.Flags = ( HB_ISNUM( 5 ) ? hb_parnl( 5 ) : OFN_FILEMUSTEXIST|OFN_EXPLORER|OFN_NOCHANGEDIR ); + ofn.Flags = hb_parnldef( 5, OFN_FILEMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR ); ofn.lpstrInitialDir = lpstrInitialDir; ofn.lpstrDefExt = lpstrDefExt; ofn.nFilterIndex = hb_parni(8); diff --git a/harbour/contrib/gtwvg/wvgwin.c b/harbour/contrib/gtwvg/wvgwin.c index 5712886927..3a7e1c90d9 100644 --- a/harbour/contrib/gtwvg/wvgwin.c +++ b/harbour/contrib/gtwvg/wvgwin.c @@ -166,7 +166,7 @@ HB_FUNC( WVG_SENDDLGITEMMESSAGE ) hb_retnl( ( long ) SendDlgItemMessage( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) , ( int ) hb_parni( 2 ) , ( UINT ) hb_parni( 3 ) , - ( HB_ISNUM( 4 ) ? ( WPARAM ) hb_parnint( 4 ) : 0 ), + ( WPARAM ) hb_parnint( 4 ), ( cText ? ( LPARAM ) cText : ( LPARAM ) hb_parnint( 5 ) ) ) ); @@ -299,7 +299,7 @@ HB_FUNC( WVG_GETDLGITEMTEXT ) HB_FUNC( WVG_CHECKDLGBUTTON ) { hb_retl( CheckDlgButton( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ), - ( UINT )( HB_ISNUM( 3 ) ? hb_parni( 3 ) : hb_parl( 3 ) ) ) ); + ( UINT ) ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : hb_parl( 3 ) ) ) ); } /*----------------------------------------------------------------------*/ @@ -335,7 +335,7 @@ HB_FUNC( WVG_MESSAGEBOX ) LPTSTR lpMsg = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); LPTSTR lpTitle = HB_TCHAR_CONVTO( HB_ISCHAR( 3 ) ? hb_parc( 3 ) : "Info" ); - hb_retni( MessageBox( hWnd, lpMsg, lpTitle, HB_ISNUM( 4 ) ? hb_parni( 4 ) : MB_OK ) ); + hb_retni( MessageBox( hWnd, lpMsg, lpTitle, hb_parnidef( 4, MB_OK ) ) ); HB_TCHAR_FREE( lpTitle ); HB_TCHAR_FREE( lpMsg ); @@ -460,7 +460,7 @@ HB_FUNC( WVG_CREATEBRUSH ) LOGBRUSH lb = { 0,0,0 }; lb.lbStyle = hb_parni( 1 ); - lb.lbColor = HB_ISNUM( 2 ) ? ( COLORREF ) hb_parnl( 2 ) : RGB( 0, 0, 0 ); + lb.lbColor = ( COLORREF ) hb_parnldef( 2, RGB( 0, 0, 0 ) ); lb.lbHatch = hb_parni( 3 ); #if ! defined( HB_OS_WIN_CE ) hb_retnint( ( HB_PTRDIFF ) CreateBrushIndirect( &lb ) ); @@ -645,7 +645,7 @@ HB_FUNC( WVG_NOT ) HB_FUNC( WVG_TRACKPOPUPMENU ) { HMENU hMenu = ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ); - UINT uFlags = HB_ISNUM( 2 ) ? hb_parnl( 2 ) : TPM_CENTERALIGN | TPM_RETURNCMD; + UINT uFlags = hb_parnldef( 2, TPM_CENTERALIGN | TPM_RETURNCMD ); int x = hb_parni( 3 ); int y = hb_parni( 4 ); HWND hWnd = HB_ISNUM( 5 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 5 ) : GetActiveWindow(); @@ -678,9 +678,9 @@ HB_FUNC( WVG_CHOOSECOLOR ) cc.lStructSize = sizeof( CHOOSECOLOR ); cc.hwndOwner = HB_ISNUM( 4 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 4 ) : NULL; - cc.rgbResult = ( COLORREF ) ( HB_ISNUM( 1 ) ? hb_parnl( 1 ) : 0 ); + cc.rgbResult = ( COLORREF ) hb_parnl( 1 ); cc.lpCustColors = crCustClr; - cc.Flags = ( WORD ) ( HB_ISNUM( 3 ) ? hb_parnl( 3 ) : CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN ); + cc.Flags = ( WORD ) hb_parnldef( 3, CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN ); if( ChooseColor( &cc ) ) hb_retnl( cc.rgbResult ); diff --git a/harbour/contrib/gtwvg/wvgwing.c b/harbour/contrib/gtwvg/wvgwing.c index b7caac2c46..a441d9e9cf 100644 --- a/harbour/contrib/gtwvg/wvgwing.c +++ b/harbour/contrib/gtwvg/wvgwing.c @@ -523,7 +523,7 @@ HB_FUNC( WVG_STATUSBARSETTEXT ) if( hWndSB && IsWindow( hWndSB ) ) { - int iPart = HB_ISNUM( 2 ) ? hb_parni( 2 ) : 1; + int iPart = hb_parnidef( 2, 1 ); TCHAR szText[ 1024 ]; int iFlags; TCHAR *szCaption;