2010-06-17 15:37 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* tests/wvtext.prg
    * Updates. Formatting. Show msgbox when MT is not present.

  * contrib/hbxbp/Makefile
    + Enabled for mingw64.

  * contrib/hbxpp/xppop.prg
  * contrib/hbxpp/xppopc.c
    + Added Xbase++ compatible operator overloading for $ on arrays.
This commit is contained in:
Viktor Szakats
2010-06-17 13:37:58 +00:00
parent 9cc47dbdc2
commit 5e35488ccc
5 changed files with 61 additions and 62 deletions

View File

@@ -16,6 +16,17 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-06-17 15:37 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* tests/wvtext.prg
* Updates. Formatting. Show msgbox when MT is not present.
* contrib/hbxbp/Makefile
+ Enabled for mingw64.
* contrib/hbxpp/xppop.prg
* contrib/hbxpp/xppopc.c
+ Added Xbase++ compatible operator overloading for $ on arrays.
2010-06-17 13:11 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/harbinit.prg
* harbour/src/vm/runner.c

View File

@@ -54,7 +54,7 @@ PRG_HEADERS := \
# Try to be in sync with hbqt, but not too hard, since this
# lib doesn't need QT external component directly.
ifeq ($(filter $(HB_PLATFORM),dos),)
ifeq ($(filter $(HB_COMPILER),mingw64 watcom bcc pocc pocc64 poccarm),)
ifeq ($(filter $(HB_COMPILER),watcom bcc pocc pocc64 poccarm msvcia64),)
ifneq ($(HB_WITH_QT),no)
HB_INC_DEPEND := -I$(TOP)$(ROOT)contrib/hbqt

View File

@@ -65,9 +65,15 @@ ANNOUNCE XPP_OP_OVERLOAD
INIT PROCEDURE xpp_Init()
ASSOCIATE CLASS xpp_op_Character WITH TYPE Character
ASSOCIATE CLASS xpp_op_Array WITH TYPE Array
RETURN
CREATE CLASS Character FUNCTION xpp_op_Character
OPTIONAL INHERIT HBCharacter
OPERATOR "[]" FUNCTION XPP_INDEX()
ENDCLASS
CREATE CLASS Array FUNCTION xpp_op_Array
OPTIONAL INHERIT HBArray
OPERATOR "$$" FUNCTION XPP_INCLUDE()
ENDCLASS

View File

@@ -142,3 +142,20 @@ HB_FUNC( XPP_INDEX )
}
}
}
HB_FUNC( XPP_INCLUDE )
{
PHB_ITEM pSelf = hb_stackSelfItem();
PHB_ITEM pKey = hb_param( 1, HB_IT_ANY );
if( HB_IS_ARRAY( pSelf ) )
{
hb_retl( hb_arrayScan( pSelf, pKey, NULL, NULL, HB_FALSE ) != 0 );
}
else
{
PHB_ITEM pResult = hb_errRT_BASE_Subst( EG_ARG, 1109, NULL, "$", 2, pKey, pSelf );
if( pResult )
hb_itemReturnRelease( pResult );
}
}

View File

@@ -90,7 +90,11 @@ PROCEDURE Main()
hb_GTInfo( HB_GTI_RESIZEMODE, iif( hb_GTInfo( HB_GTI_RESIZEMODE ) == HB_GTI_RESIZEMODE_ROWS, HB_GTI_RESIZEMODE_FONT, HB_GTI_RESIZEMODE_ROWS ) )
CASE nKey == K_F10
hb_threadStart( @thFunc() )
IF hb_MTVM()
hb_threadStart( @thFunc() )
ELSE
Alert( "MT mode not available. Rebuild this program with -mt switch and try again." )
ENDIF
CASE nKey == HB_K_RESIZE
DispScreen()
@@ -236,7 +240,7 @@ PROCEDURE thFunc()
' Rows and ' + hb_ntos( MaxCol() ) + ' Columns'
DispOutAt( 0, 0, padc( cTitle, maxcol() + 1 ), 'N/GR*' )
use test shared
USE test SHARED
aStruct := DbStruct()
oBrowse := TBrowse():New( 1, 0, maxrow(), maxcol() )
@@ -329,71 +333,32 @@ STATIC FUNCTION TBPrev( oTbr )
RETURN lMoved
//-------------------------------------------------------------------//
STATIC FUNCTION BlockField( i )
RETURN {|| fieldget( i ) }
RETURN {|| fieldget( i ) }
//-------------------------------------------------------------------//
STATIC FUNCTION BrwHandleKey( oBrowse, nKey, lEnd )
LOCAL lRet := .T.
DO CASE
CASE nKey == K_ESC
lEnd := .T.
CASE nKey == K_ENTER
lEnd := .T.
CASE nKey == K_DOWN
oBrowse:Down()
CASE nKey == K_UP
oBrowse:Up()
CASE nKey == K_LEFT
oBrowse:Left()
CASE nKey == K_RIGHT
oBrowse:Right()
CASE nKey == K_PGDN
oBrowse:pageDown()
CASE nKey == K_PGUP
oBrowse:pageUp()
CASE nKey == K_CTRL_PGUP
oBrowse:goTop()
CASE nKey == K_CTRL_PGDN
oBrowse:goBottom()
CASE nKey == K_HOME
oBrowse:home()
CASE nKey == K_END
oBrowse:end()
CASE nKey == K_CTRL_LEFT
oBrowse:panLeft()
CASE nKey == K_CTRL_RIGHT
oBrowse:panRight()
CASE nKey == K_CTRL_HOME
oBrowse:panHome()
CASE nKey == K_CTRL_END
oBrowse:panEnd()
CASE nKey == K_MWBACKWARD
oBrowse:down()
CASE nKey == K_MWFORWARD
oBrowse:up()
OTHERWISE
lRet := .F.
CASE nKey == K_ESC ; lEnd := .T.
CASE nKey == K_ENTER ; lEnd := .T.
CASE nKey == K_DOWN ; oBrowse:Down()
CASE nKey == K_UP ; oBrowse:Up()
CASE nKey == K_LEFT ; oBrowse:Left()
CASE nKey == K_RIGHT ; oBrowse:Right()
CASE nKey == K_PGDN ; oBrowse:pageDown()
CASE nKey == K_PGUP ; oBrowse:pageUp()
CASE nKey == K_CTRL_PGUP ; oBrowse:goTop()
CASE nKey == K_CTRL_PGDN ; oBrowse:goBottom()
CASE nKey == K_HOME ; oBrowse:home()
CASE nKey == K_END ; oBrowse:end()
CASE nKey == K_CTRL_LEFT ; oBrowse:panLeft()
CASE nKey == K_CTRL_RIGHT ; oBrowse:panRight()
CASE nKey == K_CTRL_HOME ; oBrowse:panHome()
CASE nKey == K_CTRL_END ; oBrowse:panEnd()
CASE nKey == K_MWBACKWARD ; oBrowse:down()
CASE nKey == K_MWFORWARD ; oBrowse:up()
OTHERWISE ; lRet := .F.
ENDCASE
RETURN lRet
//-------------------------------------------------------------------//