diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4873c1eb32..b2f6064baa 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,13 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-12-16 10:06 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/classes.c + * pacified BCC warning + + + harbour/tests/mt/mttest11.prg + + added new test for asynchronous screen updating in MT mode + 2008-12-15 08:07 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/wvtwin.ch + Added more constants. diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index d876f35dac..a81b5c8e18 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -1381,7 +1381,7 @@ const char * hb_clsFuncName( USHORT uiClass ) const char * hb_clsMethodName( USHORT uiClass, USHORT uiMethod ) { if( uiClass && uiClass <= s_uiClasses && - uiMethod < hb_clsMthNum( s_pClasses[ uiClass ] ) ) + ( UINT ) uiMethod < ( UINT ) hb_clsMthNum( s_pClasses[ uiClass ] ) ) { PMETHOD pMethod = s_pClasses[ uiClass ]->pMethods + uiMethod; if( pMethod->pMessage ) diff --git a/harbour/tests/mt/mttest11.prg b/harbour/tests/mt/mttest11.prg new file mode 100644 index 0000000000..3ea63cd71b --- /dev/null +++ b/harbour/tests/mt/mttest11.prg @@ -0,0 +1,51 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * demonstration/test code for asynchronous screen updating without + * breaking foreground screen operations. + * + * Copyright 2008 Przemyslaw Czerpak + * www - http://www.harbour-project.org + * + */ + +proc main() + local getList := {} + local cVar := space( 20 ) + + CLEAR SCREEN + + if ! hb_mtvm() + ? "No MT support in HVM. Clock will not be shown." + WAIT + else + hb_threadStart( @thFunc() ) + endif + + @ 10, 10 SAY "Insert cVar:" GET cVar + READ + SetPos( 12, 0 ) + ? "Result -> [" + cVar + "]" + WAIT + +return + +func thFunc() + local cTime + while .T. + cTime := dtoc( date() ) + " " + time() + /* use hb_dispOutAt() which does not change current default + * color and cursor position so can be executed without bad + * side effects for other threads which updates screen. + * This functions also accepts colors as numeric values. + * Similar functionality have hb_dispBox() and hb_scroll(). + * All these functions changes only screen buffer but do not + * touch cursor position and current color settings. + */ + hb_dispOutAt( 0, maxcol() - len( cTime ) + 1, cTime, "GR+/N" ) + hb_idleSleep( 1 ) + enddo +return nil