diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f93aea250f..e132c4c24b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,30 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-26 11:21 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * source/common/hbver.c + * Changed version information layout: + "Harbour a build x.y-z" -> "Harbour x.y.za" format. + + * contrib/gtwvg/gtwvg.c + ! Fixed compile error. (commented line, please check this code) + [ pGT->iLocalGTHandle = pWVT->iHandle; ] + + * contrib/gtwvg/wvtutils.c + * contrib/gtwvg/wvtcore.c + * contrib/gtwvg/wvtpaint.prg + * contrib/gtwvg/wvtclass.prg + % hb_arraySet( ..., hb_itemPut*() ) -> hb_arraySet*( ... ) + * if() -> iif() + * != on strings to IS*() macros. + ; TODO: I'd suggest to change "WVT" references to "WVG" + to avoid confusion with core WVT. At least in those places + which wouldn't break compatibility (like source names). + If there is no objection I can do it. + + * source/rtl/gtwvt/gtwvt.c + * Minor cleanup. + 2008-06-25 15:55 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/gtwvg.c * Some futuristic additions and synchronization with GTWVT. diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index b01b4c7216..8b2762bdc5 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -2941,7 +2941,7 @@ static int hb_gt_wvt_wnd_Create( PHB_GT pGT, int iTop, int iLeft, int iBottom, i HB_GTLOCAL( pGT ) = ( void * ) pWVT; - pGT->iLocalGTHandle = pWVT->iHandle; +// pGT->iLocalGTHandle = pWVT->iHandle; pWVT->ROWS = iBottom - iTop + 1; pWVT->COLS = iRight - iLeft + 1; diff --git a/harbour/contrib/gtwvg/wvtclass.prg b/harbour/contrib/gtwvg/wvtclass.prg index f70487cf23..982aad8bf0 100644 --- a/harbour/contrib/gtwvg/wvtclass.prg +++ b/harbour/contrib/gtwvg/wvtclass.prg @@ -628,7 +628,7 @@ METHOD MouseOver() CLASS wvtDialog mCol >= o:nLeft .and. mCol <= o:nRight } ) ::nObjOver := nObj - ::oObjOver := if( nObj > 0, ::aObjects[ nObj ], nil ) + ::oObjOver := iif( nObj > 0, ::aObjects[ nObj ], nil ) if nObj > 0 ::aObjects[ nObj ]:nmRow := mRow ::aObjects[ nObj ]:nmCol := mCol @@ -801,7 +801,7 @@ CLASS WvtObject DATA nAlignVert DATA nAngle - ACCESS ToolTip INLINE if( ::cTooltip == nil, '', ::cTooltip ) + ACCESS ToolTip INLINE iif( ::cTooltip == nil, '', ::cTooltip ) ASSIGN ToolTip( cTip ) INLINE ::cToolTip := cTip DATA bHandleEvent @@ -854,7 +854,7 @@ CLASS WvtObject Wvt_InvalidateRect( ::nTop, ::nLeft, ::nTop, ::nLeft ) METHOD Eval( bBlock ) INLINE ; - if( ISBLOCK( bBlock ), Eval( bBlock, self ), nil ) + iif( ISBLOCK( bBlock ), Eval( bBlock, self ), nil ) METHOD CreatePopup() METHOD ShowPopup() @@ -1041,7 +1041,7 @@ CLASS WvtBrowse FROM WvtObject DATA bTotalColumns DATA bCurrentColumn - ACCESS cDesc INLINE if( ::cText == nil, '', ::cText ) + ACCESS cDesc INLINE iif( ::cText == nil, '', ::cText ) ASSIGN cDesc( cText ) INLINE ::cText := cText METHOD New() @@ -1076,8 +1076,8 @@ METHOD Create() CLASS WvtBrowse ::nTop := ::oBrw:nTop-2 ::nLeft := ::oBrw:nLeft-2 - ::nBottom := if( ::lHSBar, ::oBrw:nBottom, ::oBrw:nBottom+1 ) - ::nRight := if( ::lVSBar, ::oBrw:nRight , ::oBrw:nRight+2 ) + ::nBottom := iif( ::lHSBar, ::oBrw:nBottom, ::oBrw:nBottom+1 ) + ::nRight := iif( ::lVSBar, ::oBrw:nRight , ::oBrw:nRight+2 ) ::PaintBlock( 1 ) ::PaintBlock( 2 ) @@ -1428,7 +1428,7 @@ METHOD Update( nPanel, cText, cColor ) if nPanel > 0 .and. nPanel <= len( ::aPanels ) oPanel := ::aPanels[ nPanel ] oPanel:Text := cText - oPanel:cColor := if( cColor == nil, 'N/W', cColor ) + oPanel:cColor := iif( cColor == nil, 'N/W', cColor ) oPanel:Refresh() endif @@ -1524,8 +1524,8 @@ METHOD Refresh() CLASS WvtPanel CLASS WvtLabel FROM WvtObject - ACCESS Text INLINE if( ::cText == nil, '', ::cText ) - ASSIGN Text( cTxt ) INLINE ::cText := if( cTxt == nil, '', cTxt ) + ACCESS Text INLINE iif( ::cText == nil, '', ::cText ) + ASSIGN Text( cTxt ) INLINE ::cText := iif( cTxt == nil, '', cTxt ) METHOD New() METHOD Create() @@ -1988,7 +1988,7 @@ METHOD New( oParent, nID, nTop, nLeft, nBottom, nRight ) CLASS WvtImage METHOD Create() CLASS WvtImage - ::bPaint := {|| if( file( ::cImage ), ; + ::bPaint := {|| iif( file( ::cImage ), ; Wvt_DrawImage( ::nTop, ::nLeft, ::nBottom, ::nRight, ::cImage ),'' ) } aadd( ::aPaint, { ::bPaint,; @@ -2948,7 +2948,7 @@ METHOD Create() CLASS WvtBanner ::oLabel:lStrikeout := ::lStrikeout ::oLabel:lUnderline := ::lUnderline ::oLabel:nAlignVert := ::nAlignVert - ::oLabel:nAlignHorz := if( ::nDirection == 0, 0, 1 ) + ::oLabel:nAlignHorz := iif( ::nDirection == 0, 0, 1 ) ::oLabel:nTextColor := ::nTextColor ::oLabel:nBackColor := ::nBackColor ::oLabel:nTextColorHoverOn := ::nTextColorHoverOn @@ -2958,7 +2958,7 @@ METHOD Create() CLASS WvtBanner ::nCurSeconds := Seconds() ::nTextLen := len( ::cText ) - ::nTextIndex := if( ::nDirection == 0, 1, ::nTextLen ) + ::nTextIndex := iif( ::nDirection == 0, 1, ::nTextLen ) ::nCurAlign := ::nDirection ::Super:Create() @@ -3010,7 +3010,7 @@ METHOD Refresh() CLASS WvtBanner ::nTextIndex++ if ::nTextIndex > ::nTextLen ::nTextIndex := 1 - ::nCurAlign := if( ::nCurAlign == 0, 1, 0 ) + ::nCurAlign := iif( ::nCurAlign == 0, 1, 0 ) endif if ::nCurAlign == 0 // Left @@ -3022,7 +3022,7 @@ METHOD Refresh() CLASS WvtBanner ::nTextIndex-- if ::nTextIndex < 0 ::nTextIndex := ::nTextLen - ::nCurAlign := if( ::nCurAlign == 0, 1, 0 ) + ::nCurAlign := iif( ::nCurAlign == 0, 1, 0 ) endif if ::nCurAlign == 0 // Left @@ -3204,8 +3204,8 @@ METHOD Create() CLASS WvtProgressBar DEFAULT ::nTop TO 0 DEFAULT ::nLeft TO 0 - DEFAULT ::nBottom TO if( ::lVertical, ::nTop + 9, ::nTop ) - DEFAULT ::nRight TO if( ::lVertical, ::nLeft + 1, ::nLeft + 19 ) + DEFAULT ::nBottom TO iif( ::lVertical, ::nTop + 9, ::nTop ) + DEFAULT ::nRight TO iif( ::lVertical, ::nLeft + 1, ::nLeft + 19 ) DEFAULT ::nTextColor TO RGB( 255,255,255 ) DEFAULT ::nBackColor TO RGB( 198,198,198 ) diff --git a/harbour/contrib/gtwvg/wvtcore.c b/harbour/contrib/gtwvg/wvtcore.c index 38f888b3cf..ad07b9c245 100644 --- a/harbour/contrib/gtwvg/wvtcore.c +++ b/harbour/contrib/gtwvg/wvtcore.c @@ -2994,7 +2994,6 @@ HB_FUNC( WVT_SAVESCREEN ) POINT xy = { 0,0 }; int iTop, iLeft, iBottom, iRight, iWidth, iHeight; PHB_ITEM info = hb_itemArrayNew( 3 ); - PHB_ITEM temp = hb_itemNew( NULL ); xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); iTop = xy.y; @@ -3012,10 +3011,9 @@ HB_FUNC( WVT_SAVESCREEN ) BitBlt( _s->hCompDC, 0, 0, iWidth, iHeight, _s->hdc, iLeft, iTop, SRCCOPY ); SelectObject( _s->hCompDC, oldBmp ); - hb_arraySet( info, 1, hb_itemPutNI( temp, iWidth ) ); - hb_arraySet( info, 2, hb_itemPutNI( temp, iHeight ) ); - hb_arraySet( info, 3, hb_itemPutNL( temp, ( ULONG ) hBmp ) ); - hb_itemRelease( temp ); + hb_arraySetNI( info, 1, iWidth ); + hb_arraySetNI( info, 2, iHeight ); + hb_arraySetNL( info, 3, ( ULONG ) hBmp ); hb_itemReturnRelease( info ); } diff --git a/harbour/contrib/gtwvg/wvtpaint.prg b/harbour/contrib/gtwvg/wvtpaint.prg index 530f0b251a..30087524e1 100644 --- a/harbour/contrib/gtwvg/wvtpaint.prg +++ b/harbour/contrib/gtwvg/wvtpaint.prg @@ -297,15 +297,15 @@ FUNCTION Wvt_MakeDlgTemplate( nTop, nLeft, nRows, nCols, aOffSet, cTitle, nStyle nW := ( nW * nXM / nBaseUnitsX ) nH := ( nH * nYM / nBaseUnitsY ) - If ValType( nStyle ) <> "N" + If !ISNUMBER( nStyle ) nStyle := + WS_CAPTION + WS_SYSMENU ; + WS_GROUP + WS_TABSTOP + DS_SETFONT ; + WS_THICKFRAME + WS_VISIBLE + WS_POPUP ; + DS_3DLOOK EndIf - aAdd( aDlg[ 1 ] , If( Empty( nHelpId ), 0, nHelpId ) ) - aAdd( aDlg[ 1 ] , If( Empty( nExStyle ), 0, nExStyle ) ) + aAdd( aDlg[ 1 ] , iif( Empty( nHelpId ), 0, nHelpId ) ) + aAdd( aDlg[ 1 ] , iif( Empty( nExStyle ), 0, nExStyle ) ) aAdd( aDlg[ 1 ] , nStyle ) aAdd( aDlg[ 1 ] , 0 ) aAdd( aDlg[ 1 ] , nX ) @@ -314,14 +314,14 @@ FUNCTION Wvt_MakeDlgTemplate( nTop, nLeft, nRows, nCols, aOffSet, cTitle, nStyle aAdd( aDlg[ 1 ] , nH ) aAdd( aDlg[ 1 ] , 0 ) aAdd( aDlg[ 1 ] , 0 ) - aAdd( aDlg[ 1 ] , If( ValType( cTitle ) == "C", cTitle, "" ) ) + aAdd( aDlg[ 1 ] , iif( ValType( cTitle ) == "C", cTitle, "" ) ) //IF ( nStyle & DS_SETFONT ) == DS_SETFONT if hb_bitAnd( nStyle, DS_SETFONT ) == DS_SETFONT - aAdd( aDlg[ 1 ], If( ValType( nPointSize ) == "N", nPointSize, 8 ) ) - aAdd( aDlg[ 1 ], If( ValType( nWeight ) == "N", nWeight , 400 ) ) - aAdd( aDlg[ 1 ], If( ValType( lItalic ) == "L", lItalic , .F. ) ) - aAdd( aDlg[ 1 ], If( ValType( cFaceName ) == "C", cFaceName , "MS Sans Serif" ) ) + aAdd( aDlg[ 1 ], iif( ValType( nPointSize ) == "N", nPointSize, 8 ) ) + aAdd( aDlg[ 1 ], iif( ValType( nWeight ) == "N", nWeight , 400 ) ) + aAdd( aDlg[ 1 ], iif( ValType( lItalic ) == "L", lItalic , .F. ) ) + aAdd( aDlg[ 1 ], iif( ValType( cFaceName ) == "C", cFaceName , "MS Sans Serif" ) ) EndIf Return( aDlg ) @@ -368,16 +368,16 @@ Function Wvt_AddDlgItem( aDlg, nTop, nLeft, nRows, nCols, aOffSet,; aDlg[ 1,4 ]++ // item count - aAdd( aDlg[ 2 ] , If( ValType( nHelpId ) == "N", nHelpId , 0 ) ) - aAdd( aDlg[ 3 ] , If( ValType( nExStyle ) == "N", nExStyle, 0 ) ) - aAdd( aDlg[ 4 ] , If( ValType( nStyle ) == "N", nStyle , WS_CHILD + WS_VISIBLE ) ) + aAdd( aDlg[ 2 ] , iif( ValType( nHelpId ) == "N", nHelpId , 0 ) ) + aAdd( aDlg[ 3 ] , iif( ValType( nExStyle ) == "N", nExStyle, 0 ) ) + aAdd( aDlg[ 4 ] , iif( ValType( nStyle ) == "N", nStyle , WS_CHILD + WS_VISIBLE ) ) aAdd( aDlg[ 5 ] , nX ) aAdd( aDlg[ 6 ] , nY ) aAdd( aDlg[ 7 ] , nW ) aAdd( aDlg[ 8 ] , nH ) aAdd( aDlg[ 9 ] , cnId ) aAdd( aDlg[ 10 ] , cnDlgClass ) - aAdd( aDlg[ 11 ] , If( ValType( cText ) <> "C", If( ValType( cText ) == "N", cText, "" ) , cText ) ) + aAdd( aDlg[ 11 ] , iif( ISCHARACTER( cText ), cText, iif( ISNUMBER( cText ), cText, "" ) ) ) aAdd( aDlg[ 12 ] , 0 ) Return aDlg @@ -393,7 +393,7 @@ Function Wvt_CreateDialog( acnDlg, lOnTop, cbDlgProc, ncIcon, nTimerTicks, hMenu hDlg := 0 cType := Valtype( acnDlg ) - nDlgMode := if( cType == 'C', 0, if( cType == 'N', 1, 2 ) ) + nDlgMode := iif( cType == 'C', 0, iif( cType == 'N', 1, 2 ) ) if cType == 'A' xTemplate := Wvt__MakeDlgTemplate( acnDlg[ 1 ] , acnDlg[ 2 ] , acnDlg[ 3 ] , acnDlg[ 4 ] , ; @@ -435,7 +435,7 @@ Function Wvt_DialogBox( acnDlg, cbDlgProc, hWndParent ) endif cType := Valtype( acnDlg ) - nDlgMode := if( cType == 'C', 0, if( cType == 'N', 1, 2 ) ) + nDlgMode := iif( cType == 'C', 0, iif( cType == 'N', 1, 2 ) ) if cType == 'A' xTemplate := Wvt__MakeDlgTemplate( acnDlg[ 1 ] , acnDlg[ 2 ] , acnDlg[ 3 ] , acnDlg[ 4 ] , ; diff --git a/harbour/contrib/gtwvg/wvtutils.c b/harbour/contrib/gtwvg/wvtutils.c index f9c2898e2e..290f5c0aa4 100644 --- a/harbour/contrib/gtwvg/wvtutils.c +++ b/harbour/contrib/gtwvg/wvtutils.c @@ -1903,14 +1903,13 @@ BOOL wvt_Array2Rect(PHB_ITEM aRect, RECT *rc ) PHB_ITEM wvt_Rect2Array( RECT *rc ) { - PHB_ITEM aRect = hb_itemArrayNew( 4 ); - PHB_ITEM element = hb_itemNew( NULL ); + PHB_ITEM aRect = hb_itemArrayNew( 4 ); + + hb_arraySetNL(aRect, 1, rc->left ); + hb_arraySetNL(aRect, 2, rc->top ); + hb_arraySetNL(aRect, 3, rc->right ); + hb_arraySetNL(aRect, 4, rc->bottom ); - hb_arraySet(aRect, 1, hb_itemPutNL( element, rc->left )); - hb_arraySet(aRect, 2, hb_itemPutNL( element, rc->top )); - hb_arraySet(aRect, 3, hb_itemPutNL( element, rc->right )); - hb_arraySet(aRect, 4, hb_itemPutNL( element, rc->bottom )); - hb_itemRelease(element); return aRect; } @@ -1931,11 +1930,10 @@ BOOL wvt_Array2Point(PHB_ITEM aPoint, POINT *pt ) PHB_ITEM wvt_Point2Array( POINT *pt ) { PHB_ITEM aPoint = hb_itemArrayNew(2); - PHB_ITEM element = hb_itemNew(NULL); - hb_arraySet(aPoint, 1, hb_itemPutNL(element, pt->x)); - hb_arraySet(aPoint, 2, hb_itemPutNL(element, pt->y)); - hb_itemRelease(element); + hb_arraySetNL(aPoint, 1, pt->x ); + hb_arraySetNL(aPoint, 2, pt->y ); + return aPoint; } @@ -1956,11 +1954,10 @@ BOOL wvt_Array2Size(PHB_ITEM aSize, SIZE *siz ) PHB_ITEM wvt_Size2Array( SIZE *siz ) { PHB_ITEM aSize = hb_itemArrayNew(2); - PHB_ITEM element = hb_itemNew(NULL); - hb_arraySet(aSize, 1, hb_itemPutNL(element, siz->cx)); - hb_arraySet(aSize, 2, hb_itemPutNL(element, siz->cy)); - hb_itemRelease(element); + hb_arraySetNL(aSize, 1, siz->cx); + hb_arraySetNL(aSize, 2, siz->cy); + return aSize; } @@ -1968,36 +1965,26 @@ PHB_ITEM wvt_Size2Array( SIZE *siz ) void wvt_Rect2ArrayEx( RECT *rc ,PHB_ITEM aRect ) { - PHB_ITEM element = hb_itemNew(NULL); - - hb_arraySet(aRect, 1, hb_itemPutNL(element, rc->left)); - hb_arraySet(aRect, 2, hb_itemPutNL(element, rc->top)); - hb_arraySet(aRect, 3, hb_itemPutNL(element, rc->right)); - hb_arraySet(aRect, 4, hb_itemPutNL(element, rc->bottom)); - hb_itemRelease(element); + hb_arraySetNL(aRect, 1, rc->left); + hb_arraySetNL(aRect, 2, rc->top); + hb_arraySetNL(aRect, 3, rc->right); + hb_arraySetNL(aRect, 4, rc->bottom); } //----------------------------------------------------------------------// void wvt_Point2ArrayEx( POINT *pt, PHB_ITEM aPoint) { - - PHB_ITEM element = hb_itemNew(NULL); - - hb_arraySet(aPoint, 1, hb_itemPutNL(element, pt->x)); - hb_arraySet(aPoint, 2, hb_itemPutNL(element, pt->y)); - hb_itemRelease(element); + hb_arraySetNL(aPoint, 1, pt->x); + hb_arraySetNL(aPoint, 2, pt->y); } //----------------------------------------------------------------------// void wvt_Size2ArrayEx( SIZE *siz, PHB_ITEM aSize ) { - PHB_ITEM element = hb_itemNew(NULL); - - hb_arraySet(aSize, 1, hb_itemPutNL(element, siz->cx)); - hb_arraySet(aSize, 2, hb_itemPutNL(element, siz->cy)); - hb_itemRelease(element); + hb_arraySetNL(aSize, 1, siz->cx); + hb_arraySetNL(aSize, 2, siz->cy); } //----------------------------------------------------------------------// diff --git a/harbour/source/common/hbver.c b/harbour/source/common/hbver.c index 764d69dd9c..93bddfab3b 100644 --- a/harbour/source/common/hbver.c +++ b/harbour/source/common/hbver.c @@ -559,8 +559,8 @@ char * hb_verHarbour( void ) CA-Cl*pper 5.3b returns: "Clipper (R) 5.3b Intl. (Rev. 338) (1997.04.25)" */ - snprintf( pszVersion, 80, "Harbour %s build %d.%d-%d Intl. (Rev. %d)", - HB_VER_STATUS, HB_VER_MAJOR, HB_VER_MINOR, HB_VER_REVISION, + snprintf( pszVersion, 80, "Harbour %d.%d.%d%s Intl. (Rev. %d)", + HB_VER_MAJOR, HB_VER_MINOR, HB_VER_REVISION, HB_VER_STATUS, hb_verSvnID() ); return pszVersion; diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index 3d3faa4252..811b322de6 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -671,9 +671,6 @@ static void hb_gt_wvt_AddCharToInputQueue( PHB_GTWVT pWVT, int iKey ) iPos = 0; if( iPos != pWVT->keyPointerOut ) pWVT->keyPointerIn = iPos; - - /* Pritpal Bedi - 06 Jun 2008 */ - //hb_gt_wvt_FireEvent( pWVT, HB_GTE_INKEY, iKey, 0 ); } static BOOL hb_gt_wvt_GetCharFromInputQueue( PHB_GTWVT pWVT, int * iKey )