2013-02-21 17:52 UTC+0100 Viktor Szakats (harbour syenar.net)

* utils/hbmk2/hbmk2.hbp
  * utils/hbmk2/hbmk2.prg
  * utils/hbmk2/Makefile
    ! fixed to not run shell in corner case of:
        hbmk2 -plugin=my.hb [...]
    + documented one missing script/shell API
    + refactored hbmk2/hbshell code to not utilize file wide
      STATIC variables. It allows to _compile_ hbmk2.prg
      regardless of -n option usage
    + added some black magic to be able to _run_ hbmk2.prg
      with or without using -n option
    + additional tricks to avoid defining any unnecessary
      or potentially colliding public functions. It means
      hbmk2/hbrun can now run _itself_ as a script.
      both as .hrb and .prg flavor and regardless of
      -n option usage.

  * contrib/hbcurl/hbcurl.ch
    + added HB_CURLFTP_CREATE_DIR* constants

  * contrib/hbcurl/tests/ftp_uldl.prg
    ! updated FTP test URL
    * cleaned configuration parameters to be strictly
      in sync with libcurl docs
    + do not disable SSL host/peer verifications

  * tests/testhrb.prg
  * src/vm/runner.c
    * misc comment cleanup

  * tests/testhtml.prg
    * code cleanup

  * contrib/gtwvg/gtwgud.c
  * contrib/gtwvg/gtwvgd.c
  * contrib/hbgt/bitflags.c
  * contrib/hbmysql/readme.txt
  * contrib/hbmysql/tests/dbf2mysq.prg
  * contrib/hbmysql/tsqlbrw.prg
  * contrib/hbtip/mail.prg
  * contrib/rddads/ads1.c
  * contrib/xhb/dumpvar.prg
  * contrib/xhb/xhbmemo.prg
  * contrib/xhb/xhbtedit.prg
  * doc/gtapi.txt
  * extras/gtwvw/gtwvwd.c
  * extras/hbxlsxml/tests/example.prg
  * extras/httpsrv/uhttpd.prg
  * src/debug/dbgtarr.prg
  * src/debug/dbgthsh.prg
  * src/lang/l_sk.c
  * src/rdd/dbfcdx/dbfcdx1.c
  * src/rdd/usrrdd/rdds/arrayrdd.prg
  * src/rtl/filesys.c
  * src/rtl/gtos2/gtos2.c
  * src/rtl/gtwvt/gtwvt.c
  * src/rtl/net.c
  * src/rtl/teditor.prg
  * src/vm/thread.c
  * website/news1.html
    * cleaned all remaining national/misc dates
      to be in ANSI format (YYYY.MM.DD)
This commit is contained in:
Viktor Szakats
2013-02-21 16:55:35 +00:00
parent 823451df02
commit 4aff1d147d
36 changed files with 538 additions and 358 deletions

View File

@@ -10,6 +10,70 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2013-02-21 17:52 UTC+0100 Viktor Szakats (harbour syenar.net)
* utils/hbmk2/hbmk2.hbp
* utils/hbmk2/hbmk2.prg
* utils/hbmk2/Makefile
! fixed to not run shell in corner case of:
hbmk2 -plugin=my.hb [...]
+ documented one missing script/shell API
+ refactored hbmk2/hbshell code to not utilize file wide
STATIC variables. It allows to _compile_ hbmk2.prg
regardless of -n option usage
+ added some black magic to be able to _run_ hbmk2.prg
with or without using -n option
+ additional tricks to avoid defining any unnecessary
or potentially colliding public functions. It means
hbmk2/hbrun can now run _itself_ as a script.
both as .hrb and .prg flavor and regardless of
-n option usage.
* contrib/hbcurl/hbcurl.ch
+ added HB_CURLFTP_CREATE_DIR* constants
* contrib/hbcurl/tests/ftp_uldl.prg
! updated FTP test URL
* cleaned configuration parameters to be strictly
in sync with libcurl docs
+ do not disable SSL host/peer verifications
* tests/testhrb.prg
* src/vm/runner.c
* misc comment cleanup
* tests/testhtml.prg
* code cleanup
* contrib/gtwvg/gtwgud.c
* contrib/gtwvg/gtwvgd.c
* contrib/hbgt/bitflags.c
* contrib/hbmysql/readme.txt
* contrib/hbmysql/tests/dbf2mysq.prg
* contrib/hbmysql/tsqlbrw.prg
* contrib/hbtip/mail.prg
* contrib/rddads/ads1.c
* contrib/xhb/dumpvar.prg
* contrib/xhb/xhbmemo.prg
* contrib/xhb/xhbtedit.prg
* doc/gtapi.txt
* extras/gtwvw/gtwvwd.c
* extras/hbxlsxml/tests/example.prg
* extras/httpsrv/uhttpd.prg
* src/debug/dbgtarr.prg
* src/debug/dbgthsh.prg
* src/lang/l_sk.c
* src/rdd/dbfcdx/dbfcdx1.c
* src/rdd/usrrdd/rdds/arrayrdd.prg
* src/rtl/filesys.c
* src/rtl/gtos2/gtos2.c
* src/rtl/gtwvt/gtwvt.c
* src/rtl/net.c
* src/rtl/teditor.prg
* src/vm/thread.c
* website/news1.html
* cleaned all remaining national/misc dates
to be in ANSI format (YYYY.MM.DD)
2013-02-19 10:34 UTC+0100 Viktor Szakats (harbour syenar.net)
* utils/hbmk2/hbmk2.prg
! accept -n1 for compilation

View File

@@ -929,10 +929,10 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara
hb_vmRequestQuit();
return 0;
case WM_ENTERIDLE:
/* FSG - 12/05/2004 - Signal than i'm on idle */
/* FSG - 2004.05.12 - Signal than i'm on idle */
hb_idleState();
return 0;
/* Pritpal Bedi - 06 Jun 2008 */
/* Pritpal Bedi - 2008.06.06 */
case WM_ACTIVATE:
{
PHB_ITEM pEvParams = hb_itemNew( NULL );

View File

@@ -2155,11 +2155,11 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara
return 0;
case WM_ENTERIDLE:
/* FSG - 12/05/2004 - Signal than i'm on idle */
/* FSG - 2004.05.12 - Signal than i'm on idle */
hb_idleState();
return 0;
/* Pritpal Bedi - 06 Jun 2008 */
/* Pritpal Bedi - 2008.06.06 */
case WM_ACTIVATE:
{
PHB_ITEM pEvParams = hb_itemNew( NULL );

View File

@@ -333,6 +333,11 @@
#define HB_CURLFTPMETHOD_NOCWD 2 /* no CWD at all */
#define HB_CURLFTPMETHOD_SINGLECWD 3 /* one CWD to full dir, then work on file */
/* HB_CURLOPT_FTP_CREATE_MISSING_DIRS option */
#define HB_CURLFTP_CREATE_DIR_NONE 0
#define HB_CURLFTP_CREATE_DIR 1
#define HB_CURLFTP_CREATE_DIR_RETRY 2
/* HB_CURLOPT_RTSP_REQUEST option */
#define HB_CURL_RTSPREQ_NONE 0
#define HB_CURL_RTSPREQ_OPTIONS 1

View File

@@ -65,7 +65,7 @@ PROCEDURE Main( cDL, cUL )
? curl_easy_setopt( curl, HB_CURLOPT_USERPWD, "harbour:power" )
#endif
? curl_easy_setopt( curl, HB_CURLOPT_PROGRESSBLOCK, {| nPos, nLen | a := CurGet(), hb_DispOutAt( 10, 10, Str( ( nPos / nLen ) * 100, 6, 2 ) + "%" ), CurSet( a ) } )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, .F. )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, 0 )
? curl_easy_setopt( curl, HB_CURLOPT_POSTQUOTE, { "RNFR " + UPLOAD_FILE_AS, "RNTO " + RENAME_FILE_TO } )
? curl_easy_setopt( curl, HB_CURLOPT_VERBOSE, lVerbose )
@@ -118,7 +118,7 @@ PROCEDURE Main( cDL, cUL )
? curl_easy_setopt( curl, HB_CURLOPT_USERPWD, "harbour:power" )
#endif
? curl_easy_setopt( curl, HB_CURLOPT_PROGRESSBLOCK, {| nPos, nLen | a := CurGet(), hb_DispOutAt( 10, 10, Str( ( nPos / nLen ) * 100, 6, 2 ) + "%" ), CurSet( a ) } )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, .F. )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, 0 )
? curl_easy_setopt( curl, HB_CURLOPT_VERBOSE, lVerbose )
? "UPLOAD FILE FROM MEMORY:", curl_easy_perform( curl )
@@ -131,17 +131,17 @@ PROCEDURE Main( cDL, cUL )
? "Press key..."
Inkey( 0 )
hb_default( @cDL, "ftp://ftp.cisco.com/README" )
hb_default( @cDL, "ftp://ftp.cisco.com/pub/mibs/README-MIB.txt" )
/* Now let's download to a file */
? curl_easy_setopt( curl, HB_CURLOPT_DOWNLOAD )
? curl_easy_setopt( curl, HB_CURLOPT_URL, cDL )
? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYPEER, .F. )
? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYHOST, .F. )
// ? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYPEER, 0 )
// ? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYHOST, 0 )
? curl_easy_setopt( curl, HB_CURLOPT_DL_FILE_SETUP, "test_dl.bin" )
? curl_easy_setopt( curl, HB_CURLOPT_PROGRESSBLOCK, {| nPos, nLen | a := CurGet(), hb_DispOutAt( 11, 10, Str( ( nPos / nLen ) * 100, 6, 2 ) + "%" ), CurSet( a ) } )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, .F. )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, 0 )
? curl_easy_setopt( curl, HB_CURLOPT_VERBOSE, lVerbose )
? "DOWNLOAD FILE:", curl_easy_perform( curl )
@@ -155,11 +155,11 @@ PROCEDURE Main( cDL, cUL )
? curl_easy_setopt( curl, HB_CURLOPT_DOWNLOAD )
? curl_easy_setopt( curl, HB_CURLOPT_URL, cDL )
? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYPEER, .F. )
? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYHOST, .F. )
// ? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYPEER, 0 )
// ? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYHOST, 0 )
? curl_easy_setopt( curl, HB_CURLOPT_DL_BUFF_SETUP )
? curl_easy_setopt( curl, HB_CURLOPT_PROGRESSBLOCK, {| nPos, nLen | a := CurGet(), hb_DispOutAt( 11, 10, Str( ( nPos / nLen ) * 100, 6, 2 ) + "%" ), CurSet( a ) } )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, .F. )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, 0 )
? curl_easy_setopt( curl, HB_CURLOPT_VERBOSE, lVerbose )
? "DOWNLOAD FILE TO MEM:", curl_easy_perform( curl )
@@ -184,11 +184,11 @@ PROCEDURE Main( cDL, cUL )
? curl_easy_setopt( curl, HB_CURLOPT_DOWNLOAD )
? curl_easy_setopt( curl, HB_CURLOPT_DIRLISTONLY )
? curl_easy_setopt( curl, HB_CURLOPT_URL, cDL )
? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYPEER, .F. )
? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYHOST, .F. )
// ? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYPEER, 0 )
// ? curl_easy_setopt( curl, HB_CURLOPT_SSL_VERIFYHOST, 0 )
? curl_easy_setopt( curl, HB_CURLOPT_DL_BUFF_SETUP )
? curl_easy_setopt( curl, HB_CURLOPT_PROGRESSBLOCK, {| nPos, nLen | a := CurGet(), hb_DispOutAt( 11, 10, Str( ( nPos / nLen ) * 100, 6, 2 ) + "%" ), CurSet( a ) } )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, .F. )
? curl_easy_setopt( curl, HB_CURLOPT_NOPROGRESS, 0 )
? curl_easy_setopt( curl, HB_CURLOPT_VERBOSE, lVerbose )
? "DOWNLOAD DIRLIST TO STRING:", curl_easy_perform( curl )

View File

@@ -16,7 +16,7 @@
* Modification history:
* ---------------------
*
* 8/19/2001 Modifications for Harbour by Brian Hays, also placed in
* 2001.08.19 Modifications for Harbour by Brian Hays, also placed in
* the public domain.
*
*/

View File

@@ -2,9 +2,9 @@
* $Id$
*/
+---------------------------------------------------------------+
| 2001/November/22 - Harbour MySQL access classes - readme file |
+---------------------------------------------------------------+
+---------------------------------------------------------+
| 2001.11.22 - Harbour MySQL access classes - readme file |
+---------------------------------------------------------+
This is work in progress, so it has to be fully tested and needs a few more methods to cover MySQL possibilities.

View File

@@ -67,7 +67,7 @@ PROCEDURE Main( ... )
SET CENTURY ON
// At present time (23/10/2000) DBFCDX is default RDD and DBFNTX is
// At present time (2000.10.23) DBFCDX is default RDD and DBFNTX is
// now DBF (I mean the one able to handle .dbt-s :-))
rddSetDefault( "DBF" )

View File

@@ -115,7 +115,7 @@ METHOD Block() CLASS TBColumnSQL
xValue := iif( xValue, ".T.", ".F." )
CASE xType == "C"
// Chr(34) is a double quote
// Chr( 34 ) is a double quote
// That is: if there is a double quote inside text substitute it with a string
// which gets converted back to a double quote by macro operator. If not it would
// give an error because of unbalanced double quotes.

View File

@@ -495,7 +495,7 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TIPMail
ELSE
// nPos := nLinePos + 2
/* 04/05/2004 - <maurilio.longo@libero.it>
/* 2004.05.04 - <maurilio.longo@libero.it>
Instead of testing every single line of mail until we find next boundary, if there is a boundary we
jump to it immediatly, this saves thousands of EOL test and makes splitting of a string fast
*/

View File

@@ -231,8 +231,8 @@ static void DumpArea( ADSAREAP pArea ) /* For debugging: call this to dump ads
pusLen = MAX_STR_LEN;
AdsGetIndexExpr( pArea->hOrdCurrent, pucIndexExpr, &pusLen );
pusLen = 1024; /*ADS top/bottom are 1,2 instead of 0,1*/
u32RetVal = AdsGetScope( pArea->hOrdCurrent, ADS_TOP, pucTemp, &pusLen );
pusLen = 1024; /* ADS top/bottom are 1,2 instead of 0,1 */
u32RetVal = AdsGetScope( pArea->hOrdCurrent, ADS_TOP, pucTemp, &pusLen );
pusLen = 1024;
ulRetFilt = AdsGetScope( pArea->hOrdCurrent, ADS_BOTTOM, pucFilter, &pusLen );
@@ -856,7 +856,7 @@ static HB_ERRCODE adsGoTo( ADSAREAP pArea, HB_ULONG ulRecNo )
* will return the error 5022 (AE_INVALID_RECORD_NUMBER), invalid record
* number.
*
* Sut 24 Sep 2005 16:24:18 CEST, Druzus
* 2005.09.24 16:24:18 CEST, Druzus
* IMHO such GOTO operation should reposition our RDD to phantom record
*/
UNSIGNED32 u32RetVal, u32RecNo;
@@ -864,7 +864,7 @@ static HB_ERRCODE adsGoTo( ADSAREAP pArea, HB_ULONG ulRecNo )
HB_TRACE( HB_TR_DEBUG, ( "adsGoTo(%p, %lu)", pArea, ulRecNo ) );
/* -----------------7/19/2001 3:04PM-----------------
/* -----------------2001.07.19 15:04-----------------
The following call is a necessary workaround for ace32.dll
prior to 6.1. There were bugs where
AdsGotoRecord() can FAIL to move the record pointer
@@ -872,7 +872,7 @@ static HB_ERRCODE adsGoTo( ADSAREAP pArea, HB_ULONG ulRecNo )
A call to AdsGetRecordNum() before it clears the problem. -BH
--------------------------------------------------*/
/*
* Thu 25 Aug 2005 11:56:20 CEST, Druzus
* 2005.08.25 11:56:20 CEST, Druzus
* This trick force to resolving pending relations. It means
* that this ADS clients does not reset pending relation in
* AdsGotoRecord() and it is resolved later. Similar situation
@@ -2162,7 +2162,7 @@ static HB_ERRCODE adsGetValue( ADSAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem
pField = pArea->area.lpFields + uiIndex - 1;
/* This code was optimized for use ADSFIELD() macro instead */
/* AdsGetFieldName() function for speed. ToninhoFwi, 22/07/2003 */
/* AdsGetFieldName() function for speed. ToninhoFwi, 2003.07.22 */
switch( pField->uiType )
{
@@ -2592,7 +2592,7 @@ static HB_ERRCODE adsPutValue( ADSAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem
if( ! uiIndex || uiIndex > pArea->area.uiFieldCount )
return HB_FAILURE;
/* -----------------10/30/2003 3:54PM----------------
/* -----------------2003.10.30 15:54-----------------
ADS has Implicit Record locking that can mask programming errors.
Implicit locking can occur the first time a value is written to a
@@ -2627,7 +2627,7 @@ static HB_ERRCODE adsPutValue( ADSAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem
szText = pArea->pRecord;
/* This code was optimized for use ADSFIELD() macro instead */
/* AdsGetFieldName() function for speed. ToninhoFwi, 22/07/2003 */
/* AdsGetFieldName() function for speed. ToninhoFwi, 2003.07.22 */
switch( pField->uiType )
{
@@ -2741,7 +2741,7 @@ static HB_ERRCODE adsPutValue( ADSAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem
bTypeError = HB_FALSE;
nLen = hb_itemGetCLen( pItem );
/* ToninhoFwi - 09/12/2006 - In the previous code nLen was limited to 0xFFFF
/* ToninhoFwi - 2006.12.09 - In the previous code nLen was limited to 0xFFFF
so, I comment it, because ADS support up to 4Gb in memo/binary/image fields.
Advantage documentations says that we need use AdsSetBinary in binary/image
fields. I tested these special fields with AdsSetString() and it works, but
@@ -2976,7 +2976,7 @@ static HB_ERRCODE adsCreate( ADSAREAP pArea, LPDBOPENINFO pCreateInfo )
So, per field it should be ( 6 + 4 + 8 + 2 = 20 ):
uiMaxFieldNameLength + 20
* 9/19/2006 BH: this is an oversized buffer since most fields don't have
* 2006.09.19 BH: this is an oversized buffer since most fields don't have
* 128-byte names. But the overhead in counting up the bytes is worse than
* allocating a bigger buffer. We need to make sure it's not too big, though.
* ADS docs say max # of fields is fnameLen + 10

View File

@@ -74,8 +74,7 @@ PROCEDURE __OutDebug( ... )
*
* return a string containing a dump of a variable
*
*
* 24/09/2006 - FSG
* 2006.09.24
* - Added recursion limit
* - Added front function with limited parameters and removed support for TAssociative Array
*/

View File

@@ -135,7 +135,7 @@ METHOD MemoInit( xUDF ) CLASS xhb_TMemoEditor
IF ::ExistUdf()
/* Keep calling user function until it returns 0
05/08/2004 - <maurilio.longo@libero.it>
2004.08.05 - <maurilio.longo@libero.it>
Clipper 5.2 MemoEdit() treats a NIL as ME_DEFAULT
*/
DO WHILE AScan( { ME_DEFAULT, NIL }, nUdfReturn := ::CallUdf( ME_INIT ) ) == 0
@@ -179,9 +179,9 @@ METHOD Edit() CLASS xhb_TMemoEditor
Eval( ::bKeyBlock, ::ProcName, ::ProcLine, ReadVar() )
/* 2006/SEP/15 - E.F. - After SetKey() is executed, if exist nextkey,
* I need trap this nextkey to memoedit process
* <nKey> first and the <nNextKey> on the next loop.
/* 2006.09.15 - E.F. - After SetKey() is executed, if exist nextkey,
* I need trap this nextkey to memoedit process
* <nKey> first and the <nNextKey> on the next loop.
*/
nNextKey := NextKey()
@@ -191,7 +191,7 @@ METHOD Edit() CLASS xhb_TMemoEditor
ENDIF
/* 24/10/2005 - <maurilio.longo@libero.it>
/* 2005.10.24 - <maurilio.longo@libero.it>
Taken from clipper norton guide:
The user function: <cUserFunction>, a user-defined function
@@ -289,8 +289,7 @@ METHOD KeyboardHook( nKey ) CLASS xhb_TMemoEditor
METHOD HandleUdf( nKey, nUdfReturn, lEdited ) CLASS xhb_TMemoEditor
/* 05/08/2004 - <maurilio.longo@libero.it>
/* 2004.08.05 - <maurilio.longo@libero.it>
A little trick to be able to handle a nUdfReturn with value of NIL
like it had a value of ME_DEFAULT
*/
@@ -362,8 +361,8 @@ METHOD HandleUdf( nKey, nUdfReturn, lEdited ) CLASS xhb_TMemoEditor
OTHERWISE // ME_UNKEY (1 TO 31)
/* 2006/AUG/02 - E.F. - (NG) Process requested action corresponding to
* key value.
/* 2006.08.02 - E.F. - (NG) Process requested action corresponding to
* key value.
*/
nKey := nUdfReturn
@@ -426,7 +425,7 @@ FUNCTION xhb_MemoEdit( ;
__defaultNIL( @nRight, MaxCol() )
__defaultNIL( @lEditMode, .T. )
__defaultNIL( @nLineLength, NIL )
/* 24/10/2005 - <maurilio.longo@libero.it>
/* 2005.10.24 - <maurilio.longo@libero.it>
NG says 4, but clipper 5.2e inserts 3 spaces when pressing K_TAB
*/
__defaultNIL( @nTabSize, 3 )
@@ -435,7 +434,7 @@ FUNCTION xhb_MemoEdit( ;
__defaultNIL( @nWindowRow, 0 )
__defaultNIL( @nWindowColumn, nTextBuffColumn )
// 2006/JUL/22 - E.F. Check argument types.
// 2006.07.22 - E.F. Check argument types.
//
IF ! HB_ISNIL( cString ) .AND. ! HB_ISSTRING( cString ) .AND. ! HB_ISMEMO( cString )
Throw( ErrorNew( "BASE", 0, 1127, "<cString> Argument type error", ProcName() ) )
@@ -478,7 +477,7 @@ FUNCTION xhb_MemoEdit( ;
ENDIF
// 2006/JUL/22 - E.F. To avoid run time error.
// 2006.07.22 - E.F. To avoid run time error.
IF nTop > nBottom .OR. nLeft > nRight
Throw( ErrorNew( "BASE", 0, 1127, "<nTop,nLeft,nRight,nBottom> Argument error", ProcName() ) )
ENDIF
@@ -487,7 +486,7 @@ FUNCTION xhb_MemoEdit( ;
xUDF := NIL
ENDIF
/* 24/10/2005 - <maurilio.longo@libero.it>
/* 2005.10.24 - <maurilio.longo@libero.it>
Clipper MemoEdit() converts Tabs into spaces
*/
oEd := xhb_TMemoEditor():New( StrTran( cString, Chr( 9 ), Space( nTabSize ) ), ;
@@ -506,7 +505,7 @@ FUNCTION xhb_MemoEdit( ;
oEd:MemoInit( xUDF )
oEd:RefreshWindow()
// 2006/AUG/06 - E.F. Clipper's <cUserFunction> in .T. or. F. is samething.
// 2006.08.06 - E.F. Clipper's <cUserFunction> in .T. or. F. is samething.
//
IF ! HB_ISLOGICAL( xUDF ) // .OR. cUserFunction
@@ -517,9 +516,9 @@ FUNCTION xhb_MemoEdit( ;
ENDIF
ELSE
// 2006/JUL/24 - E.F. - If xUDF is in .F. or .T. cause diplay memo content and exit,
// so we have to repos the cursor at bottom of memoedit
// screen after that.
// 2006.07.24 - E.F. - If xUDF is in .F. or .T. cause diplay memo content and exit,
// so we have to repos the cursor at bottom of memoedit
// screen after that.
SetPos( Min( nBottom, MaxRow() ), 0 )
ENDIF

View File

@@ -52,7 +52,7 @@
/*
* Pritpal Bedi <pritpal@vouchcac.com>
* 28Feb2004
* 2004.02.28
*
* Suppor for Clipper's MemoEdit( ..., nTextBufferRow, nTextBufferCol, nWindowRow, nWindowCol )
* Rearrangement of code in logical sections.
@@ -63,7 +63,7 @@
/*
*
* Teditor Fix: v3.0beta 2004/04/17
* Teditor Fix: v3.0beta 2004.04.17
* Copyright 2004 Giancarlo Niccolai <antispam /at/ niccolai /dot/ ws>
*
* Minimal revision for proper working (expecially with word warping).
@@ -75,7 +75,7 @@
*/
/*
* Teditor Fix: v2.0 2003-11-17
* Teditor Fix: v2.0 2003.11.17
* Copyright 2003 Lance Owens <servant@gnosis.org>
*
* This Revised Version has a completely rewritten edit method key commands, with dynamic line and paragraph reformatting.
@@ -232,7 +232,7 @@ CREATE CLASS XHBEditor
METHOD K_Mouse( nKey )
METHOD K_Esc()
// 2006/07/19 - E.F. - Added datas and methods.
// 2006.07.19 - E.F. - Added datas and methods.
VAR cInsLabel // <Insert> label to display at toggle insert
VAR lVerticalScroll INIT .T. // True if vertical scrolling is active (default)
VAR bKeyBlock // To process set key codeblock
@@ -249,7 +249,7 @@ CREATE CLASS XHBEditor
METHOD BrowseText( nPassedKey, lHandleOneKey )
// 2006/07/25 - E.F. - Internal use only.
// 2006.07.25 - E.F. - Internal use only.
METHOD GetCol( nRow, nCol ) INLINE iif( nRow > 0 .AND. nRow <= ::LastRow(), iif( nCol > 0 .AND. nCol <= Min( ::nWordWrapCol + 1, ::LineLen( nRow ) ), SubStr( ::aText[ nRow ]:cText, nCol, 1 ), "" ), "" )
METHOD IsEmptyLine( nRow ) INLINE iif( nRow > 0 .AND. nRow <= ::LastRow(), Empty( ::aText[ nRow ]:cText ), .T. )
@@ -273,7 +273,7 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS
__defaultNIL( @nWndRow, 0 )
__defaultNIL( @nWndCol, 0 )
// 2006/JUL/22 - E.F. To avoid run time error.
// 2006.07.22 - E.F. To avoid run time error.
IF nTop > nBottom .OR. nLeft > nRight
Throw( ErrorNew( "BASE", 0, 1127, "Argument error: <nTop,nRight,nLeft,nBottom>", ProcName() ) )
ENDIF
@@ -286,7 +286,7 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS
::nOrigCursor := SetCursor()
// 2006/JUL/21 - E.F. To avoid out of boundaries.
// 2006.07.21 - E.F. To avoid out of boundaries.
// Editor window boundaries
::nTop := Min( Max( 0, nTop ), MaxRow() )
::nLeft := Min( Max( 0, nLeft ), MaxCol() )
@@ -298,8 +298,8 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS
::nNumCols := ::nRight - ::nLeft + 1
::nNumRows := ::nBottom - ::nTop + 1
// 2006/AUG/18 - E.F. Adjusted nLineLenght in accordance with Clipper's
// memoedit.
// 2006.08.18 - E.F. Adjusted nLineLenght in accordance with Clipper's
// memoedit.
IF ! HB_ISNUMERIC( nLineLength )
nLineLength := ::nNumCols
ELSE
@@ -344,8 +344,8 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS
// If memofield was created with Clipper, it needs to have __SoftCR() stripped
// 2006/JUL/20 - E.F. - We should not replace SoftCR with Chr( 32 ).
// See Text2Array function for more details.
// 2006.07.20 - E.F. - We should not replace SoftCR with Chr( 32 ).
// See Text2Array function for more details.
// IF hb_BChar( 141 ) $ cString
// acsn := Chr( 32 ) + Chr( 141 ) + Chr( 10 )
// cString := StrTran( cString, acsn, " " )
@@ -458,9 +458,9 @@ METHOD RefreshWindow() CLASS XHBEditor
FOR i := 0 TO Min( ::nNumRows - 1, ::LastRow() - 1 )
// 2006/JUL/23 - E.F. Adjusted to avoid out of bound.
// Don't replace ::GetLine( nRow ) by ::aText[ nRow ]:cText here,
// because getline return line number in tbrwtext.prg (debug).
// 2006.07.23 - E.F. Adjusted to avoid out of bound.
// Don't replace ::GetLine( nRow ) by ::aText[ nRow ]:cText here,
// because getline return line number in tbrwtext.prg (debug).
hb_DispOutAt( Min( ::nTop + i, ::nBottom ), ::nLeft, ;
PadR( iif( ::nFirstRow + i <= ::LastRow(), SubStr( ::GetLine( ::nFirstRow + i ), ::nFirstCol, ::nNumCols ), Space( ::nNumCols ) ), ::nNumCols ), ;
::LineColor( ::nFirstRow + i ) )
@@ -529,9 +529,9 @@ METHOD RefreshLine( lRefreshColSel ) CLASS XHBEditor
DispBegin()
// 2006/AUG/02 - E.F.
// Don't replace ::GetLine( nRow ) by ::aText[ nRow ]:cText here
// because getline return line number in tbrwtext.prg (debug).
// 2006.08.02 - E.F.
// Don't replace ::GetLine( nRow ) by ::aText[ nRow ]:cText here
// because getline return line number in tbrwtext.prg (debug).
hb_DispOutAt( ::Row(), ::nLeft, PadR( SubStr( ::GetLine( ::nRow ), ::nFirstCol, ::nNumCols ), ::nNumCols, " " ), ::LineColor( ::nRow ) )
IF lRefreshColSel
@@ -539,7 +539,7 @@ METHOD RefreshLine( lRefreshColSel ) CLASS XHBEditor
nFirstCol := Max( ::nTextCol, ::nWndCol )
nFirstCol := Max( nFirstCol, ::nLeft )
/* 2006/SEP/20 - E.F. - Fine cursor adjustment. */
/* 2006.09.20 - E.F. - Fine cursor adjustment. */
// nCol := nFirstCol + ::nColSelStart - 1
nCol := Max( ::nLeft, nFirstCol + ::nColSelStart - 1 )
@@ -572,9 +572,9 @@ METHOD RefreshColumn() CLASS XHBEditor
DispBegin()
// 2006/AUG/02 - E.F.
// Don't replace ::GetLine( nRow ) by ::aText[ nRow ]:cText here
// because getline return line number in tbrwtext.prg (debug).
// 2006.08.02 - E.F.
// Don't replace ::GetLine( nRow ) by ::aText[ nRow ]:cText here
// because getline return line number in tbrwtext.prg (debug).
FOR i := 0 TO Min( ::nNumRows - 1, ::LastRow() - 1 )
hb_DispOutAt( ::nTop + i, nOCol, SubStr( ::GetLine( ::nFirstRow + i ), ::nCol, 1 ), ::LineColor( ::nFirstRow + i ) )
NEXT
@@ -708,7 +708,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor
ENDIF
/*
* 2006/AUG/12 -E.F. Trap Set key only if nKey is NIL.
* 2006.08.12 -E.F. Trap Set key only if nKey is NIL.
*/
IF nPassedKey == NIL
IF ( ::bKeyBlock := SetKey( nKey ) ) != NIL
@@ -765,7 +765,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor
CASE K_CTRL_B // Reformat paragraph
IF ::lEditAllow
::ClrTextSelection()
::ReformParagraph() // 2006/JUL/29 -E.F. Added.
::ReformParagraph() // 2006.07.29 -E.F. Added.
ENDIF
EXIT
#else
@@ -937,7 +937,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor
::ClrTextSelection()
ENDIF
ELSE
// 2006/JUL/22 - E.F. - Insert is allowed only in edit mode.
// 2006.07.22 - E.F. - Insert is allowed only in edit mode.
IF ::lEditAllow
::ClrTextSelection()
::InsertState( ! ::lInsert )
@@ -979,7 +979,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor
IF ::lEditAllow // Clipper compatibility
::K_Bs()
ELSE
// 2006/JUL/22 - E.F. - Clipper backspace in read only is same as left movement.
// 2006.07.22 - E.F. - Clipper backspace in read only is same as left movement.
::Left()
ENDIF
EXIT
@@ -1168,7 +1168,7 @@ METHOD GoTop() CLASS XHBEditor
METHOD Right() CLASS XHBEditor
IF ::lWordWrap
// 2006/07/19 - E.F. Changed max right point to pos cursor to next.
// 2006.07.19 - E.F. Changed max right point to pos cursor to next.
//
IF ::nCol > ::nWordWrapCol .AND. ::nRow < ::LastRow()
::GotoPos( ::nRow + 1, 1, .T. )
@@ -1207,11 +1207,10 @@ METHOD WordRight() CLASS XHBEditor
DispBegin() // to minimize flicker.
// 2006/JUL/21 - E.F. Changed to verify empty character instead space.
// In any circunstancies wordright stop at space.
// Added verification in not wordwrap mode if reach
// rightmost position.
//
// 2006.07.21 - E.F. Changed to verify empty character instead space.
// In any circunstancies wordright stop at space.
// Added verification in not wordwrap mode if reach
// rightmost position.
DO while ::nCol <= nMaxCol .AND. ! Empty( ::GetCol( ::nRow, ::nCol ) )
::Right()
@@ -1243,16 +1242,16 @@ METHOD WordRight() CLASS XHBEditor
IF ::lRightScroll
IF ::lWordWrap
// 2006/JUL/21 - E.F. - If cursor reach rightmost position
// go to the next line.
// 2006.07.21 - E.F. - If cursor reach rightmost position
// go to the next line.
IF ::nCol > nMaxCol .AND. ::nRow < ::LastRow()
::Down()
::Home()
IF Empty( ::GetCol( ::nRow, ::nCol ) )
::WordRight()
ENDIF
// 2006/JUL/21 - E.F. - If cursor stop at empty char and it is the
// last reachable position go back to the previous word.
// 2006.07.21 - E.F. - If cursor stop at empty char and it is the
// last reachable position go back to the previous word.
ELSEIF ::nCol >= nMaxCol .AND. ::nRow == ::LastRow()
IF ! Empty( ::GetCol( ::nRow, ::nCol ) )
::end()
@@ -1262,7 +1261,7 @@ METHOD WordRight() CLASS XHBEditor
::WordRight()
ENDIF
ELSE
// 2006/JUL/21 - E.F. - If cursor reach rightmost position go to back to prior word.
// 2006.07.21 - E.F. - If cursor reach rightmost position go to back to prior word.
IF ::nCol > nMaxCol
::Wordleft()
ENDIF
@@ -1277,7 +1276,7 @@ METHOD WordRight() CLASS XHBEditor
METHOD End() CLASS XHBEditor
// 2006/07/19 - E.F. Changed to avoid the cursor out of line.
// 2006.07.19 - E.F. Changed to avoid the cursor out of line.
//
::GotoCol( Min( ::LineLen( ::nRow ) + 1, Max( ::nNumCols, ::nWordWrapCol + 1 ) ) )
@@ -1291,7 +1290,7 @@ METHOD Left() CLASS XHBEditor
IF ::nCol == 1
IF ::lWordWrap
IF ::nRow > 1
// 2006/07/19 E.F. left should be at max in the leftmost column.
// 2006.07.19 E.F. left should be at max in the leftmost column.
//
::GotoPos( ::nRow - 1, Max( ::nNumCols, ::nWordWrapCol + 1 ), .T. )
ENDIF
@@ -1330,8 +1329,8 @@ METHOD WordLeft() CLASS XHBEditor
ENDIF
// 2006/JUL/21 - E.F. - Changed to verifiy empty char instead space. In any
// circunstancies wordleft stop at space.
// 2006.07.21 - E.F. - Changed to verifiy empty char instead space. In any
// circunstancies wordleft stop at space.
//
DO while ::nCol > 1 .AND. ! Empty( ::GetCol( ::nRow, ::nCol ) )
::Left()
@@ -1343,8 +1342,8 @@ METHOD WordLeft() CLASS XHBEditor
::Left()
ENDDO
// 2006/JUL/24 -E.F. - If cursor stoped at empty char, then
// go to the next word.
// 2006.07.24 -E.F. - If cursor stoped at empty char, then
// go to the next word.
IF ! ::lWordWrap .AND. ;
::nCol < ::LineLen( ::nRow ) .AND. ;
Empty( ::GetCol( ::nRow, ::nCol ) )
@@ -1417,7 +1416,7 @@ METHOD K_Ascii( nKey ) CLASS XHBEditor
RETURN Self
ENDIF
// 2006/JUL/22 - E.F. - IF there is no line into memo add a new one.
// 2006.07.22 - E.F. - IF there is no line into memo add a new one.
IF ::LastRow() == 0
::AddLine( "", .F. )
ENDIF
@@ -1475,7 +1474,7 @@ METHOD K_Bs() CLASS XHBEditor
IF ::nRow > 1 .AND. ::nRow <= ::LastRow()
// 2006/JUL/21 - E.F. - Determine new ::nCol position.
// 2006.07.21 - E.F. - Determine new ::nCol position.
//
::nCol := Min( ::LineLen( ::nRow - 1 ) + 1, ::nWordWrapCol )
@@ -1499,7 +1498,7 @@ METHOD K_Bs() CLASS XHBEditor
::SplitLine( ::nRow )
ENDIF
// 2006/JUL/21 - E.F. - Delete the rightmost char and pos the cursor on it.
// 2006.07.21 - E.F. - Delete the rightmost char and pos the cursor on it.
IF ::LineLen( ::nRow ) >= ::nWordWrapCol
::aText[ ::nRow ]:cText := SubStr( ::aText[ ::nRow ]:cText, 1, ::LineLen( ::nRow ) - 1 ) + " "
::nCol := Min( ::nCol + 1, ::nWordWrapCol + 1 )
@@ -1514,9 +1513,9 @@ METHOD K_Bs() CLASS XHBEditor
ENDIF
ENDIF
// 2006/JUL/19 - E.F. When backspace reach column 1 and the line is
// empty and exist next line, we need set linelen to
// zero and set lSoftCR to true as Clipper does.
// 2006.07.19 - E.F. When backspace reach column 1 and the line is
// empty and exist next line, we need set linelen to
// zero and set lSoftCR to true as Clipper does.
//
IF ::nCol == 1 .AND. Empty( ::aText[ ::nRow ]:cText ) .AND. ;
::nRow + 1 <= ::LastRow()
@@ -1571,8 +1570,8 @@ METHOD K_Del() CLASS XHBEditor
::aText[ ::nRow ]:cText += " "
ENDIF
// 2006/JUL/21 - E.F. If current line is empty and cursor is in
// the first column, remove it after del.
// 2006.07.21 - E.F. If current line is empty and cursor is in
// the first column, remove it after del.
//
IF ::IsEmptyLine( ::nRow ) .AND. ::nCol == 1
::RemoveLine( ::nRow )
@@ -1589,7 +1588,7 @@ METHOD K_Del() CLASS XHBEditor
::lChanged := .T.
nCurRow := ::nRow
nCurCol := ::nCol
// 2006/07/19 - E.F. Merge line only if ::nRow+1 is valid,
// 2006.07.19 - E.F. Merge line only if ::nRow+1 is valid,
// to avoid bound error.
//
IF ::nRow + 1 <= ::LastRow()
@@ -1672,7 +1671,7 @@ METHOD K_Return() CLASS XHBEditor
IF ::lEditAllow
// 2006/JUL/24 - E.F. - Fixed <Enter> at insert mode.
// 2006.07.24 - E.F. - Fixed <Enter> at insert mode.
#if 0
IF ::lInsert
IF ::nRow == ::LastRow()
@@ -1749,7 +1748,7 @@ METHOD K_Esc() CLASS XHBEditor
SetCursor( nCursor )
SetPos( nCurRow, nCurCol )
// 2006/JUL/21 - E.F - Exit only if "Y" is pressed.
// 2006.07.21 - E.F - Exit only if "Y" is pressed.
//
::lExitEdit := ( Upper( hb_keyChar( nKey ) ) == "Y" )
ENDIF
@@ -1968,8 +1967,8 @@ METHOD GotoCol( nCol ) CLASS XHBEditor
IF nCol >= 1
// 2006/JUL/21 E.F. - Clipper allow cursor movement to left/right into
// line, with or without chars.
// 2006.07.21 E.F. - Clipper allow cursor movement to left/right into
// line, with or without chars.
// Note: ::nWordWrapCol can be different than ::nNumCols if user has
// informed nLineLength > 0.
nCol := Max( 1, Min( nCol, Max( ::nNumCols, ::nWordWrapCol + 1 ) ) )
@@ -2014,8 +2013,8 @@ METHOD GotoPos( nRow, nCol, lRefresh ) CLASS XHBEditor
IF nCol >= 1
// 2006/JUL/21 E.F. - Clipper allow cursor movement to left/right into
// line, with or without chars.
// 2006.07.21 E.F. - Clipper allow cursor movement to left/right into
// line, with or without chars.
// Note: ::nWordWrapCol can be different than ::nNumCols if user has
// informed nLineLength > 0
nCol := Max( 1, Min( nCol, Max( ::nNumCols, ::nWordWrapCol + 1 ) ) )
@@ -2167,7 +2166,7 @@ METHOD SplitLine( nRow ) CLASS XHBEditor
// Old method was: else split at current cursor position
// cSplittedLine := Left( cLine, ::nCol - 1 )
// 2006/07/19 - E.F. - Changed cut point at witdh of line to maintain.
// 2006.07.19 - E.F. - Changed cut point at witdh of line to maintain.
// amount of chars same as Clipper.
//
// cSplittedLine := Left( cLine, ::nWordWrapCol )
@@ -2181,7 +2180,7 @@ METHOD SplitLine( nRow ) CLASS XHBEditor
//
// GAD
IF !( Right( cSplittedLine, 1 ) == " " ) .AND. nFirstSpace > 1
// 2006/JUL/21 - E.F. - Added condition to not stay out of max columns.
// 2006.07.21 - E.F. - Added condition to not stay out of max columns.
IF Len( cSplittedLine ) < ::nNumCols
cSplittedLine += " "
ENDIF
@@ -2196,7 +2195,7 @@ METHOD SplitLine( nRow ) CLASS XHBEditor
// I have to recheck if trim is viable here ???
//
// 2006/JUL/21 - E.F. Only insert a line in any circunstancies.
// 2006.07.21 - E.F. Only insert a line in any circunstancies.
//
IF nStartRow + 1 <= ::LastRow()
IF ::LineLen( nStartRow + 1 ) == 0 .OR. Len( AllTrim( cLine ) ) > 0
@@ -2316,7 +2315,7 @@ METHOD SetPos( nRow, nCol ) CLASS XHBEditor
METHOD InsertState( lInsState ) CLASS XHBEditor
// 2006/JUL/22 - E.F. - Insert only in edit mode.
// 2006.07.22 - E.F. - Insert only in edit mode.
IF ::lEditAllow .AND. HB_ISLOGICAL( lInsState ) .AND. ::lInsert != lInsState
::lInsert := lInsState
@@ -2337,7 +2336,7 @@ METHOD InsertState( lInsState ) CLASS XHBEditor
RETURN Self
//
// 2006/JUL/15 - E.F. - Display "<insert>" message
// 2006.07.15 - E.F. - Display "<insert>" message
//
METHOD DisplayInsert( lInsert ) CLASS XHBEditor
@@ -2564,8 +2563,8 @@ METHOD SetTextSelection( cAction, nCount ) CLASS XHBEditor
IF ::nRowSelEnd == ::LastRow()
// ::nRowSelEnd := ::LastRow()-1
/* 2006/SEP/17 - E.F. - At this point we need add a new line
to be able to select the last row.
/* 2006.09.17 - E.F. - At this point we need add a new line
to be able to select the last row.
*/
IF ! Empty( ::aText[ ::nRowSelEnd ]:cText )
::AddLine()
@@ -2713,14 +2712,14 @@ METHOD DelText() CLASS XHBEditor
RETURN self
ENDIF
// 2006/SEP/17 - E.F. - changed to ::top() to avoid cursor out of bound.
// 2006.09.17 - E.F. - changed to ::top() to avoid cursor out of bound.
// ::Gotop()
::Top()
::aText := {}
// 2006/JUL/22 - E.F. - There is no need to add line here.
// See K_ASCII() method.
// 2006.07.22 - E.F. - There is no need to add line here.
// See K_ASCII() method.
// AAdd( ::aText, HBTextLine():New() )
::lChanged := .T.
@@ -2789,7 +2788,7 @@ METHOD DelTextSelection() CLASS XHBEditor
ENDIF
ENDIF
// 3/03/2008 8:26a.m. added next 4 lines to fix array out of bounds RTL
// 2008.03.03 08:26 added next 4 lines to fix array out of bounds RTL
IF ::nRow > ::LastRow()
::Addline( "", .F. )
::GoBottom()
@@ -2972,8 +2971,8 @@ STATIC FUNCTION Text2Array( cString, nWordWrapCol )
LOCAL lTokenized := .F.
LOCAL cSoftCR := __SoftCR()
// 2005/JUL/19 - E.F. - SoftCR must be removed before convert string to
// array. It will be treated by HBEditor.
// 2005.07.19 - E.F. - SoftCR must be removed before convert string to
// array. It will be treated by HBEditor.
IF cSoftCR $ cString
cString := StrTran( cString, cSoftCR )
ENDIF
@@ -3022,14 +3021,14 @@ STATIC FUNCTION Text2Array( cString, nWordWrapCol )
cLine := SubStr( cLine, nFirstSpace + 1 )
ELSE
cSplittedLine := Left( cLine, nWordWrapCol )
// 2006/07/19 - E.F. Changed cut point of second split.
// 2006.07.19 - E.F. Changed cut point of second split.
// cLine := SubStr( cLine, nWordWrapCol + 1 )
cLine := SubStr( cLine, Len( cSplittedLine ) + 1 )
ENDIF
AAdd( aArray, HBTextLine():New( cSplittedLine, .T. ) )
ELSE
// remainder of line is shorter than split point
// 2006/JUL/21 - E.F. Only add a new line if cLine is not empty.
// 2006.07.21 - E.F. Only add a new line if cLine is not empty.
//
IF Len( cLine ) > 0
AAdd( aArray, HBTextLine():New( cLine, .F. ) )
@@ -3087,14 +3086,15 @@ METHOD BrowseText( nPassedKey, lHandleOneKey ) CLASS XHBEditor
ELSE
::MoveCursor( nKey )
/* 02/09/2004 - <maurilio.longo@libero.it>
#if 0
/* 2004-09-02 - <maurilio.longo@libero.it>
If I'm on a readonly editor don't call KeyboardHook() because
it calls HandleUserKey() which calls Edit() which sees this is
a readonly editor and calls again BrowseText() which..,
a readonly editor and calls again BrowseText() which.. */
IF ! oSelf:MoveCursor( nKey )
oSelf:KeyboardHook( nKey )
ENDIF
*/
#endif
ENDIF
// If I want to handle only one key and then exit...

View File

@@ -232,8 +232,6 @@ See as example GTGUI in src/rtl/gtgui/gtgui.c
It supports only TONE and CLIPBOARD operations.
GUI libraries can use it or create other GT driver inheriting from
this one.
NOTE: src/rtl/gtgui/gtdef.c is a hack which overloads the default
Harbour build time GT driver and should not be replicated.
gtnul - base GT driver from which each other inherits.
@@ -304,8 +302,8 @@ gtwvt - GT driver for MS-Windows. It creates its own GUI window
for use with GTWVT.
To let the memory refreshed, I must remind
everybody that it is a superb work of Peter Rees contributed
to xHarbour on 22nd December 2003.
GTWVG - GUI emulation of GTWVT. It implements itself on top of GTWVT.
to xHarbour on 2003.12.22.
gtwvg - GUI emulation of GTWVT. It implements itself on top of GTWVT.
GTWVG ( WVTGUI in xHarbour ) offers functions and classes to
present a console application look like a windows one.
It renderes GUI elements on top of Clipper elements

View File

@@ -1512,14 +1512,14 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
break;
case HB_GTI_SCREENHEIGHT:
/* NOTE 20040618 currently not includes StatusBar and ToolBar, if any.
* TODO I Think it should return ALL window height, incl
* StatusBar and ToolBar
* ie. hb_gt_wvwCalcPixelHeight()
* SEEALSO hb_gt_wvwCalcPixelHeight()
/* NOTE 2004.06.18 currently not includes StatusBar and ToolBar, if any.
* TODO I Think it should return ALL window height, incl
* StatusBar and ToolBar
* ie. hb_gt_wvwCalcPixelHeight()
* SEEALSO hb_gt_wvwCalcPixelHeight()
*/
/*NOTE 20040719 screenheight includes linespacing, if any */
/*NOTE 2004.07.19 screenheight includes linespacing, if any */
pInfo->pResult = hb_itemPutNI( pInfo->pResult, hb_wvw_LineHeight( pWindowData ) * pWindowData->ROWS );
@@ -1548,9 +1548,9 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_DESKTOPHEIGHT:
{
/*NOTE 20040618 currently includes StatusBar and ToolBar, if any.
*TODO Think: should it return chars area only?
*SEEALSO hb_gt_wvwCalcPixelHeight() - usSBHeight - usTBHeight
/* NOTE 2004.06.18 currently includes StatusBar and ToolBar, if any.
* TODO Think: should it return chars area only?
* SEEALSO hb_gt_wvwCalcPixelHeight() - usSBHeight - usTBHeight
*/
RECT rDesk = { 0 };
@@ -1575,12 +1575,12 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_DESKTOPROWS:
{
/*NOTE 20040618 currently includes StatusBar and ToolBar, if any.
*TODO I Think it should it return chars area only?
*SEEALSO hb_gt_wvwCalcPixelHeight() - usSBHeight - usTBHeight
/* NOTE 2004.06.18 currently includes StatusBar and ToolBar, if any.
* TODO I Think it should it return chars area only?
* SEEALSO hb_gt_wvwCalcPixelHeight() - usSBHeight - usTBHeight
*/
/*NOTE 20040719 screenheight includes linespacing, if any */
/* NOTE 2004.07.19 screenheight includes linespacing, if any */
RECT rDesk = { 0 };
HWND hDesk;
@@ -2165,7 +2165,7 @@ static void hb_gt_wvwCreateObjects( UINT usWinNum )
{
LOGBRUSH lb = { 0 };
/* 20040921 IMPORTANT:
/* 2004.09.21 IMPORTANT:
All these PENs and BRUSHes creations are temporarily disabled
because WINDOW #1's CAN'T BE DELETED LATER!
See also hb_gt_wvwCloseWindow() and gt_Exit()
@@ -2174,7 +2174,7 @@ static void hb_gt_wvwCreateObjects( UINT usWinNum )
or
(2) do the creation and deletion only when required
*/
/* 20040923 choose #1 of above option */
/* 2004.09.23 choose #1 of above option */
if( usWinNum > 0 )
return;
@@ -2807,7 +2807,7 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam
* BeginPaint resets the update rectangle - don't move it or nothing is drawn!
*/
/* 20050625 TODO: MSDN says app should NOT call BeginPaint if GetUpdateRect returns zero */
/* 2005.06.25 TODO: MSDN says app should NOT call BeginPaint if GetUpdateRect returns zero */
hdc = BeginPaint( hWnd, &ps );
@@ -3468,7 +3468,7 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam
fake an Alt+C
*/
/* 20040610
/* 2004.06.10
reject if not accepting input (topmost window not on focus) */
if( ! hb_gt_wvwAcceptingInput() )
{
@@ -3479,8 +3479,8 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam
}
if( usWinNum == 0 )
/* bdj note 20060724:
We should put this line here, as per FSG change on 20060626:
/* bdj note 2006.07.24:
We should put this line here, as per FSG change on 2006.06.26:
hb_gtHandleClose()
However, if there is no gtSetCloseHandler, ALT+C effect is not produced as it should.
So for now I put it back to the old behaviour with the following two lines, until hb_gtHandleClose() is fixed.
@@ -3498,7 +3498,7 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam
return 0;
case WM_ENTERIDLE:
/* FSG - 12/05/2004 - Signal than i'm on idle */
/* FSG - 2004.05.12 - Signal than i'm on idle */
hb_idleState();
return 0;
@@ -5204,7 +5204,7 @@ static void hb_gt_wvwCloseWindow( void ) /*assume s_pWvwData->s_usNumWindows >=
if( s_pWvwData->s_sApp->pSymWVW_TIMER )
KillTimer( pWindowData->hWnd, WVW_ID_BASE_TIMER + s_pWvwData->s_usNumWindows - 1 );
/* 20040921 IMPORTANT:
/* 2004.09.21 IMPORTANT:
All these PENs and BRUSHes deletions return OK,
but GDI objects are reported as still in use by Task Manager.
We now temporarily disable PENs and BRUSHes creation during
@@ -5215,7 +5215,7 @@ static void hb_gt_wvwCloseWindow( void ) /*assume s_pWvwData->s_usNumWindows >=
or
(2) do the creation and deletion only when required
*/
/* 20040923 choose #1 of above option
/* 2004.09.23 choose #1 of above option
DeleteObject( ( HPEN ) pWindowData->penWhite );
DeleteObject( ( HPEN ) pWindowData->penWhiteDim );
DeleteObject( ( HPEN ) pWindowData->penBlack );
@@ -6502,7 +6502,7 @@ static void DrawTransparentBitmap( HDC hdc, HBITMAP hBitmap, short xStart,
DeleteDC( hdcCopy );
}
/* 20060724 Notes:
/* 2006.07.24 Notes:
(1) Transparency
if bTransparent is .t., top-left pixel is used as the transparent color,
@@ -6534,7 +6534,7 @@ BOOL hb_gt_wvwDrawImage( UINT usWinNum, int x1, int y1, int wd, int ht, const ch
if( ! pPic )
return FALSE;
/* 20060724 canNOT do it this way:
/* 2006.07.24 canNOT do it this way:
pPic->lpVtbl->get_Width( pPic,&lWidth );
pPic->lpVtbl->get_Height( pPic,&lHeight );
iWidth = (int) lWidth;
@@ -7001,7 +7001,7 @@ WVW_DATA * hb_getWvwData( void )
/* */
/* 20040713 this function was named WVW_lOpenWindow()
/* 2004.07.13 this function was named WVW_lOpenWindow()
* now it is wvw_nOpenWindow()
* it now returns numeric
@@ -8507,12 +8507,12 @@ IPicture * rr_LoadPicture( const char * filename, LONG * lwidth, LONG * lheight
/* PENDING decision:
20040908 TODO: GTWVT deliberately adds new parm aOffset before nRoundHeight
I hate it when doing such thing
2004.09.08 TODO: GTWVT deliberately adds new parm aOffset before nRoundHeight
I hate it when doing such thing
*/
/* Supporting functions */
/* Supporting functions */
static BITMAPINFO * PackedDibLoad( PTSTR szFileName )

View File

@@ -172,9 +172,9 @@ PROCEDURE Main()
oObj:columnWidth( 13, 80 ) // Valor IPI
xEmpresa := "EMPRESA DEMONSTRACAO LTDA"
xDataImp := "22.03.2011"
xDataImp := "2011.03.22"
xTitulo := "RELATORIO PARA DEMONSTRAR XML EXCEL"
xPeriodo := "01.02.2011 a 28.02.2011"
xPeriodo := "2011.02.01 a 2011.02.28"
xOrdem := "DATA DE EMISSAO"
nLinha := 0

View File

@@ -12,7 +12,7 @@
*
* Credits:
* Based on first version posted from Mindaugas Kavaliauskas on
* developers NG on December 15th, 2008 whom give my thanks to have
* developers NG on 2008.12.15 whom give my thanks to have
* shared initial work.
* Francesco.
*

View File

@@ -123,7 +123,7 @@ METHOD addWindows( aArray, nRow ) CLASS HBDbArray
oBrwSets:AddColumn( oCol := HBDbColumnNew( "", {|| PadR( __dbgValToStr( aArray[ oBrwSets:cargo[ 1 ] ] ), nWidth - nColWidth - 1 ) } ) )
/* 09/08/2004 - <maurilio.longo@libero.it>
/* 2004.08.09 - <maurilio.longo@libero.it>
Setting a fixed width like it is done in the next line of code wich I've
commented exploits a bug of current tbrowse, that is, if every column is
narrower than tbrowse but the sum of them is wider tbrowse paints

View File

@@ -127,7 +127,7 @@ METHOD addWindows( hHash, nRow ) CLASS HBDbHash
oBrwSets:AddColumn( oCol := HBDbColumnNew( "", {|| PadR( __dbgValToStr( hb_HValueAt( hHash, oBrwSets:cargo[ 1 ] ) ), nWidth - nColWidth - 1 ) } ) )
/* 09/08/2004 - <maurilio.longo@libero.it>
/* 2004.08.09 - <maurilio.longo@libero.it>
Setting a fixed width like it is done in the next line of code wich I've
commented exploits a bug of current tbrowse, that is, if every column is
narrower than tbrowse but the sum of them is wider tbrowse paints

View File

@@ -7,7 +7,7 @@
* Language Support Module (sk)
*
* Copyright 2008, 2012 Gyula Bartal <gybartal@gmail.com> (from CSWIN)
* Update October 1, 2012 Jaroslav Janík <jarojanik@hotmail.com>
* Copyright 2012 Jaroslav Janík <jarojanik@hotmail.com>
* www - http://harbour-project.org
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -6878,7 +6878,7 @@ static HB_ERRCODE hb_cdxGoCold( CDXAREAP pArea )
* Without changes in locking scheme we can do only one thing which
* is enough if there is only one index file: lock first index only
* before SUPER_GOCOLD
* Druzus, 05 Oct 2003 10:27:52 CEST
* Druzus, 2003.10.05 10:27:52 CEST
*/
while( pTag )

View File

@@ -292,7 +292,7 @@ STATIC FUNCTION AR_CREATE( nWA, aOpenInfo )
/* Check if database is already present in memory slots */
/*
07/11/2008 FSG - dbCreate() doesn't check if a dbf file exists. So I will not check it.
2008.11.07 FSG - dbCreate() doesn't check if a dbf file exists. So I will not check it.
If you need to check if a table exists use hb_FileArrayRdd() function that works in
similar way of File(), i.e.:
IF hb_FileArrayRdd( cFullName )

View File

@@ -229,7 +229,7 @@
#endif
#if defined( HB_OS_HAS_DRIVE_LETTER )
/* 27/08/2004 - <maurilio.longo@libero.it>
/* 2004.08.27 - <maurilio.longo@libero.it>
HB_FS_GETDRIVE() should return a number in the range 0..25 ('A'..'Z')
HB_FS_SETDRIVE() should accept a number inside same range.

View File

@@ -74,7 +74,7 @@
* hb_gt_os2_GetBlink()
* hb_gt_os2_SetBlink()
*
* Copyright 2000 - 2001 Maurilio Longo <maurilio.longo@libero.it>
* Copyright 2000-2001 Maurilio Longo <maurilio.longo@libero.it>
* hb_gt_DispBegin() / hb_gt_DispEnd()
* hb_gt_ScreenPtr() and hb_gt_xYYYY() functions and virtual screen support inside hb_gt_XXXX()s
* 16 bit KBD subsystem use inside hb_gt_os2_ReadKey()
@@ -111,7 +111,7 @@
#define SELTOFLAT( ptr ) ( void * ) ( ( ( ( ( ULONG ) ( ptr ) ) >> 19 ) << 16 ) | ( 0xFFFF & ( ( ULONG ) ( ptr ) ) ) )
#if defined( HB_OS_OS2_GCC )
/* 25/03/2000 - maurilio.longo@libero.it
/* 2000.03.25 - maurilio.longo@libero.it
OS/2 GCC hasn't got ToolKit headers available */
#include <stdlib.h>
#else
@@ -562,7 +562,7 @@ static void hb_gt_os2_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
box drawing chars. (Maurilio Longo - maurilio.longo@libero.it)
*/
/* 21/08/2001 - <maurilio.longo@libero.it>
/* 2001.08.21 - <maurilio.longo@libero.it>
NOTE: Box drawing characters need page 437 to show correctly, so, in your
config.sys you need to have a CODEPAGE=x,y statement where x or y
is equal to 437

View File

@@ -1864,11 +1864,11 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara
return 0;
case WM_ENTERIDLE:
/* FSG - 12/05/2004 - Signal than i'm on idle */
/* FSG - 2004.05.12 - Signal than i'm on idle */
hb_idleState();
return 0;
/* Pritpal Bedi - 06 Jun 2008 */
/* Pritpal Bedi - 2008.06.06 */
case WM_ACTIVATE:
hb_gt_wvt_AddCharToInputQueue( pWVT, ( LOWORD( wParam ) == WA_INACTIVE ? HB_K_LOSTFOCUS : HB_K_GOTFOCUS ) );
return 0;

View File

@@ -67,7 +67,7 @@
#include "hb_io.h"
/* 25/03/2004 - <maurilio.longo@libero.it>
/* 2004.03.25 - <maurilio.longo@libero.it>
not needed anymore as of GCC 3.2.2 */
#include <pwd.h>

View File

@@ -695,7 +695,7 @@ METHOD Edit( nPassedKey ) CLASS HBEditor
nKey := nPassedKey
ENDIF
// 03/sept/2002 - maurilio.longo@libero.it
// 2002.09.03 - maurilio.longo@libero.it
// NOTE: I think this code should only be present on classes derived from TEditor which is
// a low level "editing engine".. For now I leave it here...
IF ( bKeyBlock := SetKey( nKey ) ) != NIL

View File

@@ -49,14 +49,19 @@
* If you do not wish that, delete this exception notice.
*
*/
/*
* The following functions are added Feb 01,2002 by
* Alexander Kresin <alex@belacy.belgorod.su>
* The following parts are Copyright of the individual authors.
* www - http://harbour-project.org
*
* Copyright 2002 Alexander Kresin <alex@belacy.belgorod.su>
* HB_HRBLOAD()
* HB_HRBDO()
* HB_HRBUNLOAD()
* HB_HRBGETFUNSYM()
*
* See COPYING.txt for licensing terms.
*
* HB_HRBLOAD()
* HB_HRBDO()
* HB_HRBUNLOAD()
* HB_HRBGETFUNSYM()
*/
#include "hbvmint.h"
@@ -642,7 +647,7 @@ static void hb_hrbDo( PHRB_BODY pHrbBody, int iPCount, PHB_ITEM * pParams )
hb_hrbInit( pHrbBody, iPCount, pParams );
/* May not have a startup symbol, if first symbol was an INIT Symbol (was executed already).*/
/* May not have a startup symbol, if first symbol was an INIT Symbol (was executed already). */
if( pHrbBody->lSymStart >= 0 && hb_vmRequestQuery() == 0 )
{
hb_vmPushSymbol( &pHrbBody->pSymRead[ pHrbBody->lSymStart ] );

View File

@@ -267,7 +267,7 @@ void hb_threadReleaseCPU( void )
#elif defined( HB_OS_OS2 )
/* 23/nov/2000 - maurilio.longo@libero.it
/* 2000.11.23 - maurilio.longo@libero.it
Minimum time slice under OS/2 is 32 milliseconds, passed 1 will be rounded to 32 and
will give a chance to threads of lower priority to get executed.
Passing 0 causes current thread to give up its time slice only if there are threads of

View File

@@ -8,24 +8,26 @@
PROCEDURE Main( x )
LOCAL pHrb, cExe := "Msg2()", n
LOCAL pHrb, cExe := "Msg2()"
n := iif( x == NIL, 0, Val( x ) )
LOCAL n := iif( x == NIL, 0, Val( x ) )
? "calling Msg ... From exe here !"
Msg()
? "========================="
// ? "Loading('exthrb.hrb' )"
// pHrb := hb_hrbLoad("exthrb.hrb" )
#if 0
? "Loading( 'exthrb.hrb' )"
pHrb := hb_hrbLoad( "exthrb.hrb" )
// ? "Loading(HB_HRB_BIND_DEFAULT,'exthrb.hrb' )"
// pHrb := hb_hrbLoad(HB_HRB_BIND_DEFAULT,"exthrb.hrb" )
? "Loading( HB_HRB_BIND_DEFAULT, 'exthrb.hrb' )"
pHrb := hb_hrbLoad( HB_HRB_BIND_DEFAULT, "exthrb.hrb" )
// ? "Loading(HB_HRB_BIND_LOCAL,'exthrb.hrb' )"
// pHrb := hb_hrbLoad(HB_HRB_BIND_LOCAL,"exthrb.hrb" )
? "Loading( HB_HRB_BIND_LOCAL, 'exthrb.hrb' )"
pHrb := hb_hrbLoad( HB_HRB_BIND_LOCAL, "exthrb.hrb" )
#endif
? "Loading(" + iif( n == 0, "HB_HRB_BIND_DEFAULT", iif( n == 1,"HB_HRB_BIND_LOCAL","HB_HRB_BIND_OVERLOAD" ) ) + ",'exthrb.hrb' )"
? "Loading(" + iif( n == 0, "HB_HRB_BIND_DEFAULT", iif( n == 1, "HB_HRB_BIND_LOCAL", "HB_HRB_BIND_OVERLOAD" ) ) + ", 'exthrb.hrb' )"
pHrb := hb_hrbLoad( n, "exthrb.hrb" )
? "========================="
@@ -44,7 +46,7 @@ PROCEDURE Main( x )
Msg() // test unload protection when using OVERLOAD ... then .hrb not anymore unloadable
? "========================="
? "END"
? "END"
RETURN

View File

@@ -75,8 +75,7 @@ METHOD SetTitle( cTitle ) CLASS THTML
METHOD AddLink( cLinkTo, cLinkName ) CLASS THTML
::cBody := ::cBody + ;
"<a href='" + cLinkTo + "'>" + cLinkName + "</a>"
::cBody += "<a href='" + cLinkTo + "'>" + cLinkName + "</a>"
RETURN Self
@@ -86,16 +85,15 @@ METHOD AddHead( cDescr ) CLASS THTML
// ::cBody += ...
// ???
::cBody := ::cBody + ;
"<h1>" + cDescr + "</h1>"
::cBody += "<h1>" + cDescr + "</h1>"
RETURN NIL
METHOD AddPara( cPara, cAlign ) CLASS THTML
cAlign := iif( cAlign == NIL, "Left", cAlign ) // Added Patrick Mast 2000-06-17
hb_default( @cAlign, "Left" )
::cBody := ::cBody + ;
::cBody += ;
"<p align='" + cAlign + "'>" + hb_eol() + ;
cPara + hb_eol() + ;
"</p>"

View File

@@ -25,6 +25,12 @@ ifneq ($(HB_HAS_WATT),)
HB_PRGFLAGS += -DHB_HAS_WATT
endif
# Not possible to override default entry
# function cleanly when using plain GNU Make
# to build, so we're using _APPMAIN(), which
# is better than MAIN()
HB_PRGFLAGS += -DHBMK_USE_APPMAIN
HB_PRGFLAGS += -DHBMK_WITH_ALL_EMBEDDED_HEADERS
include $(TOP)$(ROOT)config/bin.mk

View File

@@ -13,6 +13,12 @@
hbmk2.prg
# use alternate public entry function name
# to not collide with any known ones when
# running scripts.
-main=__hbmk_public_entry
-DHBMK_USE_CUSTMAIN
-DHBMK_WITH_ALL_EMBEDDED_HEADERS
-lhbpmcom{dos}

View File

@@ -58,13 +58,9 @@
*
*/
#if __pragma( n ) >= 1
/* Keeping it tidy */
#pragma -w3
#pragma -es2
#else
#error Missing required Harbour option: -n
#endif
/* Keeping it tidy */
#pragma -w3
#pragma -es2
/* Optimizations */
#pragma -km+
@@ -577,10 +573,6 @@ EXTERNAL hbmk_KEYW
#define PathMakeAbsolute( cPathR, cPathA ) hb_PathJoin( cPathA, cPathR )
/* NOTE: Security token to protect against plugins accessing our
internal structures referenced from context variable */
STATIC s_cSecToken := NIL
#ifndef _HBMK_EMBEDDED_
/* Request for runner and shell */
@@ -610,27 +602,49 @@ EXTERNAL hb_HKeepOrder
EXTERNAL hb_FGetAttr
EXTERNAL hb_FSetAttr
/* For hbshell */
STATIC s_cDirBase_hbshell
STATIC s_cProgName_hbshell
STATIC s_hLibExt := { => }
STATIC s_hCH := { => }
STATIC s_hOPTPRG := { => }
STATIC s_hINCPATH := { => }
STATIC s_hCHCORE := { => }
STATIC s_hbmk
#define HB_HISTORY_LEN 500
#define HB_LINE_LEN 256
STATIC s_nRow
STATIC s_nCol := 0
STATIC s_aHistory := {}
STATIC s_lPreserveHistory := .T.
STATIC s_lWasLoad := .F.
STATIC s_lInteractive := .T.
/* For hbshell */
#define _HBSH_cDirBase 1
#define _HBSH_cProgName 2
#define _HBSH_hLibExt 3
#define _HBSH_hCH 4
#define _HBSH_hOPTPRG 5
#define _HBSH_hINCPATH 6
#define _HBSH_hCHCORE 7
#define _HBSH_hbmk 8
#define _HBSH_nRow 9
#define _HBSH_nCol 10
#define _HBSH_aHistory 11
#define _HBSH_lPreserveHistory 12
#define _HBSH_lWasLoad 13
#define _HBSH_lInteractive 14
#define _HBSH_MAX_ 15
PROCEDURE _APPMAIN( ... )
/* Trick to make it run if compiled without -n/-n1/-n2
(or with -n-) option.
(typically as scripts and precompiled scripts) */
/* NOTE: Avoid file wide STATICs to keep this working */
#if __pragma( n ) < 1
hbmk_local_entry( hb_ArrayToParams( hb_AParams() ) )
#endif
#if defined( HBMK_USE_CUSTMAIN ) /* for .hbp build */
PROCEDURE __hbmk_public_entry( ... ) /* for hbrun builds (or any builds via .hbp) */
hbmk_local_entry( ... )
RETURN
#elif defined( HBMK_USE_APPMAIN )
PROCEDURE _APPMAIN( ... ) /* for GNU Make build (we can't override default entry, so we use this alternate built-in one */
hbmk_local_entry( ... )
RETURN
#else
PROCEDURE __hbmk_fake_entry( ... ) /* for scripts and precompiled scripts with -n/-n1/-n2 option */
hbmk_local_entry( ... )
RETURN
#endif
STATIC PROCEDURE hbmk_local_entry( ... )
LOCAL aArgsProc
LOCAL nResult
@@ -645,23 +659,29 @@ PROCEDURE _APPMAIN( ... )
LOCAL nTargetPos
LOCAL lHadTarget
LOCAL cParam1L
/* for temp debug messages */
Set( _SET_DATEFORMAT, "yyyy.mm.dd" )
/* Expand wildcard project specs */
/* Check if we should go into shell mode */
cParam1L := iif( PCount() >= 1, Lower( hb_PValue( 1 ) ), "" )
IF ( Right( Lower( hb_FNameName( hb_argv( 0 ) ) ), 5 ) == "hbrun" .OR. ;
Left( Lower( hb_FNameName( hb_argv( 0 ) ) ), 5 ) == "hbrun" .OR. ;
hb_PValue( 1 ) == "." .OR. ;
HBMK_IS_IN( Lower( hb_FNameExt( hb_PValue( 1 ) ) ), ".hb|.hrb|.dbf" ) ) .AND. ;
!( ! Empty( hb_PValue( 1 ) ) .AND. ;
( Left( hb_PValue( 1 ), 6 ) == "-hbreg" .OR. ;
Left( hb_PValue( 1 ), 8 ) == "-hbunreg" ) )
cParam1L == "." .OR. ;
hb_FNameExt( cParam1L ) == ".dbf" .OR. ;
( HBMK_IS_IN( hb_FNameExt( cParam1L ), ".hb|.hrb" ) .AND. !( Left( cParam1L, 1 ) == "-" ) ) ) .AND. ;
!( ! Empty( cParam1L ) .AND. ;
( Left( cParam1L, 6 ) == "-hbreg" .OR. ;
Left( cParam1L, 8 ) == "-hbunreg" ) )
__hbshell( ... )
RETURN
ENDIF
/* Expand wildcard project specs */
aArgsProc := {}
FOR EACH tmp IN hb_AParams()
DO CASE
@@ -764,7 +784,7 @@ PROCEDURE _APPMAIN( ... )
ENDIF
/* Build one target */
nResult := hbmk( aArgsTarget, nTargetPos, 1, @lPause, @lExitStr )
nResult := __hbmk( aArgsTarget, nTargetPos, 1, @lPause, @lExitStr )
/* Exit on first failure */
IF nResult != _EXIT_OK
@@ -788,7 +808,7 @@ PROCEDURE _APPMAIN( ... )
RETURN
#endif /* _HBMK_EMBEDDED_ */
#endif /* ! _HBMK_EMBEDDED_ */
#if defined( __PLATFORM__WINDOWS ) .OR. ;
defined( __PLATFORM__DOS ) .OR. ;
@@ -1208,7 +1228,7 @@ STATIC PROCEDURE hbmk_harbour_dirlayout_init( hbmk )
RETURN
FUNCTION hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExitStr )
STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExitStr )
LOCAL hbmk
@@ -1389,10 +1409,6 @@ FUNCTION hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExitStr )
LOCAL cStdOutErr
IF s_cSecToken == NIL
s_cSecToken := StrZero( hb_rand32(), 10, 0 )
ENDIF
hbmk := hbmk_new()
hbmk[ _HBMK_aArgs ] := aArgs
@@ -9295,8 +9311,10 @@ STATIC FUNCTION ctx_to_hbmk( ctx )
LOCAL hbmk
IF HB_ISHASH( ctx ) .AND. s_cSecToken $ ctx
hbmk := ctx[ s_cSecToken ]
LOCAL cSecToken := hbmk_SecToken()
IF HB_ISHASH( ctx ) .AND. cSecToken $ ctx
hbmk := ctx[ cSecToken ]
IF HB_ISARRAY( hbmk ) .AND. Len( hbmk ) == _HBMK_MAX_
RETURN hbmk
ENDIF
@@ -9453,45 +9471,62 @@ FUNCTION hbmk_Register_Input_File_Extension( ctx, cExt )
RETURN NIL
STATIC FUNCTION hbmk_SecToken()
/* NOTE: Security token to protect against plugins accessing our
internal structures referenced from context variable */
STATIC s_cToken := NIL
STATIC s_mutexToken := hb_mutexCreate()
hb_mutexLock( s_mutexToken )
IF s_cToken == NIL
s_cToken := StrZero( hb_rand32(), 10, 0 )
ENDIF
hb_mutexUnlock( s_mutexToken )
RETURN s_cToken
/* ; */
STATIC FUNCTION PlugIn_make_ctx( hbmk, cState )
RETURN { ;
"cSTATE" => cState , ;
"params" => hbmk[ _HBMK_aPLUGINPars ] , ;
"vars" => hbmk[ _HBMK_hPLUGINVars ] , ;
"cPLAT" => hbmk[ _HBMK_cPLAT ] , ;
"cCOMP" => hbmk[ _HBMK_cCOMP ] , ;
"nCOMPVer" => hbmk[ _HBMK_nCOMPVer ] , ;
"cCPU" => hbmk[ _HBMK_cCPU ] , ;
"cBUILD" => hbmk[ _HBMK_cBUILD ] , ;
"cOUTPUTNAME" => hbmk[ _HBMK_cPROGNAME ] , ;
"cTARGETNAME" => hbmk_TARGETNAME( hbmk ) , ;
"cTARGETTYPE" => hbmk_TARGETTYPE( hbmk ) , ;
"lREBUILD" => hbmk[ _HBMK_lREBUILD ] , ;
"lCLEAN" => hbmk[ _HBMK_lCLEAN ] , ;
"lDEBUG" => hbmk[ _HBMK_lDEBUG ] , ;
"lMAP" => hbmk[ _HBMK_lMAP ] , ;
"lSTRIP" => hbmk[ _HBMK_lSTRIP ] , ;
"lDONTEXEC" => hbmk[ _HBMK_lDONTEXEC ] , ;
"lIGNOREERROR" => hbmk[ _HBMK_lIGNOREERROR ] , ;
"lTRACE" => hbmk[ _HBMK_lTRACE ] , ;
"lQUIET" => hbmk[ _HBMK_lQuiet ] , ;
"lINFO" => hbmk[ _HBMK_lInfo ] , ;
"lBEEP" => hbmk[ _HBMK_lBEEP ] , ;
"lRUN" => hbmk[ _HBMK_lRUN ] , ;
"lINC" => hbmk[ _HBMK_lINC ] , ;
"cCCPATH" => hbmk[ _HBMK_cCCPATH ] , ;
"cCCPREFIX" => hbmk[ _HBMK_cCCPREFIX ] , ;
"cCCSUFFIX" => hbmk[ _HBMK_cCCSUFFIX ] , ;
"cCCEXT" => hbmk[ _HBMK_cCCEXT ] , ;
"nCmd_Esc" => hbmk[ _HBMK_nCmd_Esc ] , ;
"nScr_Esc" => hbmk[ _HBMK_nScr_Esc ] , ;
"nCmd_FNF" => hbmk[ _HBMK_nCmd_FNF ] , ;
"nScr_FNF" => hbmk[ _HBMK_nScr_FNF ] , ;
"cWorkDir" => hbmk[ _HBMK_cWorkDir ] , ;
"nExitCode" => hbmk[ _HBMK_nExitCode ] , ;
s_cSecToken => hbmk }
"cSTATE" => cState , ;
"params" => hbmk[ _HBMK_aPLUGINPars ] , ;
"vars" => hbmk[ _HBMK_hPLUGINVars ] , ;
"cPLAT" => hbmk[ _HBMK_cPLAT ] , ;
"cCOMP" => hbmk[ _HBMK_cCOMP ] , ;
"nCOMPVer" => hbmk[ _HBMK_nCOMPVer ] , ;
"cCPU" => hbmk[ _HBMK_cCPU ] , ;
"cBUILD" => hbmk[ _HBMK_cBUILD ] , ;
"cOUTPUTNAME" => hbmk[ _HBMK_cPROGNAME ] , ;
"cTARGETNAME" => hbmk_TARGETNAME( hbmk ) , ;
"cTARGETTYPE" => hbmk_TARGETTYPE( hbmk ) , ;
"lREBUILD" => hbmk[ _HBMK_lREBUILD ] , ;
"lCLEAN" => hbmk[ _HBMK_lCLEAN ] , ;
"lDEBUG" => hbmk[ _HBMK_lDEBUG ] , ;
"lMAP" => hbmk[ _HBMK_lMAP ] , ;
"lSTRIP" => hbmk[ _HBMK_lSTRIP ] , ;
"lDONTEXEC" => hbmk[ _HBMK_lDONTEXEC ] , ;
"lIGNOREERROR" => hbmk[ _HBMK_lIGNOREERROR ] , ;
"lTRACE" => hbmk[ _HBMK_lTRACE ] , ;
"lQUIET" => hbmk[ _HBMK_lQuiet ] , ;
"lINFO" => hbmk[ _HBMK_lInfo ] , ;
"lBEEP" => hbmk[ _HBMK_lBEEP ] , ;
"lRUN" => hbmk[ _HBMK_lRUN ] , ;
"lINC" => hbmk[ _HBMK_lINC ] , ;
"cCCPATH" => hbmk[ _HBMK_cCCPATH ] , ;
"cCCPREFIX" => hbmk[ _HBMK_cCCPREFIX ] , ;
"cCCSUFFIX" => hbmk[ _HBMK_cCCSUFFIX ] , ;
"cCCEXT" => hbmk[ _HBMK_cCCEXT ] , ;
"nCmd_Esc" => hbmk[ _HBMK_nCmd_Esc ] , ;
"nScr_Esc" => hbmk[ _HBMK_nScr_Esc ] , ;
"nCmd_FNF" => hbmk[ _HBMK_nCmd_FNF ] , ;
"nScr_FNF" => hbmk[ _HBMK_nScr_FNF ] , ;
"cWorkDir" => hbmk[ _HBMK_cWorkDir ] , ;
"nExitCode" => hbmk[ _HBMK_nExitCode ] , ;
hbmk_SecToken() => hbmk }
STATIC FUNCTION PlugIn_ctx_get_state( ctx )
RETURN ctx[ "cSTATE" ]
@@ -11059,7 +11094,7 @@ STATIC FUNCTION HBM_Load( hbmk, aParams, cFileName, nNestingLevel, lProcHBP, cPa
IF lFound
aArgs := AClone( hbmk[ _HBMK_aArgs ] )
aArgs[ hbmk[ _HBMK_nArgTarget ] ] := cHBP
nResult := hbmk( aArgs, hbmk[ _HBMK_nArgTarget ], hbmk[ _HBMK_nLevel ] + 1, @hbmk[ _HBMK_lPause ] )
nResult := __hbmk( aArgs, hbmk[ _HBMK_nArgTarget ], hbmk[ _HBMK_nLevel ] + 1, @hbmk[ _HBMK_lPause ] )
IF nResult != 0
RETURN nResult
ENDIF
@@ -13367,8 +13402,30 @@ STATIC FUNCTION hbmk_CoreHeaderFiles()
#endif
#define _EXT_ENV_ "HB_EXTENSION"
STATIC FUNCTION hbsh()
THREAD STATIC t_hbsh := NIL
IF t_hbsh == NIL
t_hbsh := Array( _HBSH_MAX_ )
t_hbsh[ _HBSH_hLibExt ] := { => }
t_hbsh[ _HBSH_hCH ] := { => }
t_hbsh[ _HBSH_hOPTPRG ] := { => }
t_hbsh[ _HBSH_hINCPATH ] := { => }
t_hbsh[ _HBSH_hCHCORE ] := { => }
t_hbsh[ _HBSH_nCol ] := 0
t_hbsh[ _HBSH_aHistory ] := {}
t_hbsh[ _HBSH_lPreserveHistory ] := .T.
t_hbsh[ _HBSH_lWasLoad ] := .F.
t_hbsh[ _HBSH_lInteractive ] := .T.
ENDIF
RETURN t_hbsh
STATIC PROCEDURE __hbshell( cFile, ... )
LOCAL hbsh := hbsh()
LOCAL aExtension := {}
LOCAL hbmk
LOCAL cHBC
@@ -13384,12 +13441,12 @@ STATIC PROCEDURE __hbshell( cFile, ... )
/* Save originals */
s_cDirBase_hbshell := hb_DirBase()
s_cProgName_hbshell := hb_ProgName()
hbsh[ _HBSH_cDirBase ] := hb_DirBase()
hbsh[ _HBSH_cProgName ] := hb_ProgName()
/* Detect Harbour dir layout */
hbmk := s_hbmk := hbmk_new()
hbmk := hbsh[ _HBSH_hbmk ] := hbmk_new()
hbmk_init_stage2( hbmk )
IF ! hbmk_harbour_dirlayout_detect( hbmk, .T. )
IF __hbshell_CanLoadDyn()
@@ -13443,7 +13500,7 @@ STATIC PROCEDURE __hbshell( cFile, ... )
SWITCH cExt
CASE ".hb"
s_lInteractive := .F.
hbsh[ _HBSH_lInteractive ] := .F.
/* NOTE: Assumptions:
- one dynamic lib belongs to one .hbc file (true for dynamic builds in contrib)
@@ -13495,7 +13552,7 @@ STATIC PROCEDURE __hbshell( cFile, ... )
ENDIF
CASE ".hrb"
s_lInteractive := .F.
hbsh[ _HBSH_lInteractive ] := .F.
__hbshell_ext_init( aExtension )
hHRB := hb_hrbLoad( cFile )
hbshell_gtSelect( __hbshell_detect_GT( hHRB ) )
@@ -13610,6 +13667,8 @@ STATIC PROCEDURE __hbshell_LoadExtFromSource( aExtension, cFileName )
STATIC PROCEDURE __hbshell_ext_static_init()
LOCAL hbsh := hbsh()
LOCAL tmp
LOCAL nCount
LOCAL cName
@@ -13619,7 +13678,7 @@ STATIC PROCEDURE __hbshell_ext_static_init()
cName := __dynSGetName( tmp )
IF LEFTEQUAL( cName, "__HBEXTERN__" ) .AND. ;
! HBMK_IS_IN( cName, "__HBEXTERN__HBCPAGE__" )
s_hLibExt[ Lower( SubStr( cName, Len( "__HBEXTERN__" ) + 1, Len( cName ) - Len( "__HBEXTERN__" ) - Len( "__" ) ) ) ] := NIL
hbsh[ _HBSH_hLibExt ][ Lower( SubStr( cName, Len( "__HBEXTERN__" ) + 1, Len( cName ) - Len( "__HBEXTERN__" ) - Len( "__" ) ) ) ] := NIL
ENDIF
NEXT
@@ -13643,6 +13702,8 @@ STATIC PROCEDURE __hbshell_ext_init( aExtension )
extend header search path accordingly */
FUNCTION hbshell_ext_load( cName )
LOCAL hbsh := hbsh()
LOCAL cFileName
LOCAL hLib
LOCAL tmp
@@ -13652,29 +13713,29 @@ FUNCTION hbshell_ext_load( cName )
IF ! Empty( cName )
IF __hbshell_CanLoadDyn()
IF !( cName $ s_hLibExt )
IF !( cName $ hbsh[ _HBSH_hLibExt ] )
s_hbmk[ _HBMK_aINCPATH ] := {}
s_hbmk[ _HBMK_aCH ] := {}
s_hbmk[ _HBMK_aLIBUSER ] := {}
hbsh[ _HBSH_hbmk ][ _HBMK_aINCPATH ] := {}
hbsh[ _HBSH_hbmk ][ _HBMK_aCH ] := {}
hbsh[ _HBSH_hbmk ][ _HBMK_aLIBUSER ] := {}
s_hINCPATH[ cName ] := {}
s_hCH[ cName ] := {}
s_hOPTPRG[ cName ] := {}
hbsh[ _HBSH_hINCPATH ][ cName ] := {}
hbsh[ _HBSH_hCH ][ cName ] := {}
hbsh[ _HBSH_hOPTPRG ][ cName ] := {}
IF Empty( cVersion := HBC_Find( s_hbmk, cHBC := hb_FNameExtSet( cName, ".hbc" ) ) )
IF Empty( cVersion := HBC_Find( hbsh[ _HBSH_hbmk ], cHBC := hb_FNameExtSet( cName, ".hbc" ) ) )
OutErr( hb_StrFormat( I_( "hbshell: Warning: Cannot find %1$s" ), cHBC ) + _OUT_EOL )
ELSE
AEval( s_hbmk[ _HBMK_aINCPATH ], {| tmp | AAdd( s_hINCPATH[ cName ], tmp ) } )
AEval( s_hbmk[ _HBMK_aCH ], {| tmp | AAdd( s_hCH[ cName ], tmp ) } )
AAddNew( s_hOPTPRG[ cName ], "-D" + hb_StrFormat( _HBMK_HAS_TPL_HBC, StrToDefine( cName ) ) + "=" + cVersion )
AEval( hbsh[ _HBSH_hbmk ][ _HBMK_aINCPATH ], {| tmp | AAdd( hbsh[ _HBSH_hINCPATH ][ cName ], tmp ) } )
AEval( hbsh[ _HBSH_hbmk ][ _HBMK_aCH ], {| tmp | AAdd( hbsh[ _HBSH_hCH ][ cName ], tmp ) } )
AAddNew( hbsh[ _HBSH_hOPTPRG ][ cName ], "-D" + hb_StrFormat( _HBMK_HAS_TPL_HBC, StrToDefine( cName ) ) + "=" + cVersion )
/* NOTE: Hack. We detect if the .hbc had defined any libs to load.
(f.e. there will not be any libs if the .hbc was skipped due
to filters)
TODO: In the future the .hbc should specify a list of dynamic libs
to load, and we should load those, if any. */
IF ! Empty( s_hbmk[ _HBMK_aLIBUSER ] )
IF ! Empty( hbsh[ _HBSH_hbmk ][ _HBMK_aLIBUSER ] )
cFileName := FindInPath( tmp := hb_libName( cName + hb_libPostfix() ), ;
iif( hb_Version( HB_VERSION_UNIX_COMPAT ), GetEnv( "LD_LIBRARY_PATH" ), GetEnv( "PATH" ) ) )
IF Empty( cFileName )
@@ -13684,7 +13745,7 @@ FUNCTION hbshell_ext_load( cName )
IF Empty( hLib )
OutErr( hb_StrFormat( I_( "hbshell: Error loading '%1$s' (%2$s)." ), cName, cFileName ) + _OUT_EOL )
ELSE
s_hLibExt[ cName ] := hLib
hbsh[ _HBSH_hLibExt ][ cName ] := hLib
RETURN .T.
ENDIF
ENDIF
@@ -13700,11 +13761,13 @@ FUNCTION hbshell_ext_load( cName )
FUNCTION hbshell_ext_unload( cName )
IF cName $ s_hLibExt .AND. s_hLibExt[ cName ] != NIL
hb_HDel( s_hINCPATH, cName )
hb_HDel( s_hCH, cName )
hb_HDel( s_hOPTPRG, cName )
hb_HDel( s_hLibExt, cName )
LOCAL hbsh := hbsh()
IF cName $ hbsh[ _HBSH_hLibExt ] .AND. hbsh[ _HBSH_hLibExt ][ cName ] != NIL
hb_HDel( hbsh[ _HBSH_hINCPATH ], cName )
hb_HDel( hbsh[ _HBSH_hCH ], cName )
hb_HDel( hbsh[ _HBSH_hOPTPRG ], cName )
hb_HDel( hbsh[ _HBSH_hLibExt ], cName )
RETURN .T.
ENDIF
@@ -13712,10 +13775,12 @@ FUNCTION hbshell_ext_unload( cName )
FUNCTION hbshell_ext_get_list()
LOCAL aName := Array( Len( s_hLibExt ) )
LOCAL hbsh := hbsh()
LOCAL aName := Array( Len( hbsh[ _HBSH_hLibExt ] ) )
LOCAL hLib
FOR EACH hLib IN s_hLibExt
FOR EACH hLib IN hbsh[ _HBSH_hLibExt ]
aName[ hLib:__enumIndex() ] := iif( Empty( hLib ), Upper( hLib:__enumKey() ), hLib:__enumKey() )
NEXT
@@ -13957,6 +14022,8 @@ STATIC PROCEDURE __hbshell_ProcessStart()
/* TODO: rewrite the full-screen shell to be a simple stdout/stdin shell */
STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
LOCAL hbsh := hbsh()
LOCAL GetList
LOCAL cLine
LOCAL nMaxRow, nMaxCol
@@ -13984,8 +14051,8 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
__hbshell_HistoryLoad()
AAdd( s_aHistory, PadR( "quit", HB_LINE_LEN ) )
nHistIndex := Len( s_aHistory ) + 1
AAdd( hbsh[ _HBSH_aHistory ], PadR( "quit", HB_LINE_LEN ) )
nHistIndex := Len( hbsh[ _HBSH_aHistory ] ) + 1
hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS )
@@ -13993,7 +14060,7 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
Set( _SET_EVENTMASK, hb_bitOr( INKEY_KEYBOARD, HB_INKEY_GTEVENT ) )
s_nRow := 3
hbsh[ _HBSH_nRow ] := 3
__hbshell_Exec( "?? hb_Version()" )
@@ -14002,7 +14069,7 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
IF HB_ISARRAY( aCommand )
FOR EACH cCommand IN aCommand
IF HB_ISSTRING( cCommand )
AAdd( s_aHistory, PadR( cCommand, HB_LINE_LEN ) )
AAdd( hbsh[ _HBSH_aHistory ], PadR( cCommand, HB_LINE_LEN ) )
__hbshell_Info( cCommand )
__hbshell_Exec( cCommand )
ENDIF
@@ -14036,11 +14103,11 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
SC_NORMAL, SC_INSERT ) ) } )
bKeyUp := SetKey( K_UP, ;
{|| iif( nHistIndex > 1, ;
cLine := s_aHistory[ --nHistIndex ], ) } )
cLine := hbsh[ _HBSH_aHistory ][ --nHistIndex ], ) } )
bKeyDown := SetKey( K_DOWN, ;
{|| cLine := iif( nHistIndex < Len( s_aHistory ), ;
s_aHistory[ ++nHistIndex ], ;
( nHistIndex := Len( s_aHistory ) + 1, Space( HB_LINE_LEN ) ) ) } )
{|| cLine := iif( nHistIndex < Len( hbsh[ _HBSH_aHistory ] ), ;
hbsh[ _HBSH_aHistory ][ ++nHistIndex ], ;
( nHistIndex := Len( hbsh[ _HBSH_aHistory ] ) + 1, Space( HB_LINE_LEN ) ) ) } )
bKeyResize := SetKey( HB_K_RESIZE, ;
{|| lResize := .T., hb_keyPut( K_ENTER ) } )
@@ -14064,15 +14131,15 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
LOOP
ENDIF
IF Empty( s_aHistory ) .OR. !( ATail( s_aHistory ) == cLine )
IF Len( s_aHistory ) < HB_HISTORY_LEN
AAdd( s_aHistory, cLine )
IF Empty( hbsh[ _HBSH_aHistory ] ) .OR. !( ATail( hbsh[ _HBSH_aHistory ] ) == cLine )
IF Len( hbsh[ _HBSH_aHistory ] ) < HB_HISTORY_LEN
AAdd( hbsh[ _HBSH_aHistory ], cLine )
ELSE
ADel( s_aHistory, 1 )
s_aHistory[ Len( s_aHistory ) ] := cLine
ADel( hbsh[ _HBSH_aHistory ], 1 )
hbsh[ _HBSH_aHistory ][ Len( hbsh[ _HBSH_aHistory ] ) ] := cLine
ENDIF
ENDIF
nHistIndex := Len( s_aHistory ) + 1
nHistIndex := Len( hbsh[ _HBSH_aHistory ] ) + 1
cCommand := AllTrim( cLine, " " )
cLine := NIL
@@ -14096,9 +14163,9 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
__hbshell_Exec( cCommand )
ENDIF
IF s_nRow >= MaxRow()
IF hbsh[ _HBSH_nRow ] >= MaxRow()
hb_Scroll( 3, 0, MaxRow(), MaxCol(), 1 )
s_nRow := MaxRow() - 1
hbsh[ _HBSH_nRow ] := MaxRow() - 1
ENDIF
ENDIF
ENDIF
@@ -14145,6 +14212,8 @@ STATIC FUNCTION __hbshell_GetHidden()
STATIC PROCEDURE __hbshell_Info( cCommand )
LOCAL hbsh := hbsh()
IF cCommand != NIL
hb_DispOutAt( 0, 0, "PP: ", "W/N" )
hb_DispOutAt( 0, 4, PadR( cCommand, MaxCol() - 3 ), "N/R" )
@@ -14166,7 +14235,7 @@ STATIC PROCEDURE __hbshell_Info( cCommand )
" | # " + Space( 7 ) + "/" + Space( 7 ), ;
MaxCol() + 1 ), "N/BG" )
ENDIF
IF s_lPreserveHistory
IF hbsh[ _HBSH_lPreserveHistory ]
hb_DispOutAt( 1, MaxCol(), "o", "R/BG" )
ENDIF
@@ -14206,28 +14275,32 @@ STATIC PROCEDURE __hbshell_Err( oError, cCommand )
STATIC PROCEDURE __hbshell_Exec( cCommand )
LOCAL hbsh := hbsh()
LOCAL pHRB, cHRB, cFunc, bBlock, nRowMin
LOCAL aOPTPRG := {}
IF ! Empty( s_hCHCORE )
AAdd( aOPTPRG, "-i" + s_hbmk[ _HBMK_cHB_INSTALL_INC ] )
hb_HEval( s_hCHCORE, {| tmp | AAdd( aOPTPRG, "-u+" + tmp ) } )
IF ! Empty( hbsh[ _HBSH_hCHCORE ] )
AAdd( aOPTPRG, "-i" + hbsh[ _HBSH_hbmk ][ _HBMK_cHB_INSTALL_INC ] )
hb_HEval( hbsh[ _HBSH_hCHCORE ], {| tmp | AAdd( aOPTPRG, "-u+" + tmp ) } )
ENDIF
hb_HEval( s_hINCPATH, {| cExt |
AEval( s_hINCPATH[ cExt ], {| tmp | AAddNew( aOPTPRG, "-i" + tmp ) } )
AEval( s_hCH[ cExt ] , {| tmp | AAddNew( aOPTPRG, "-u+" + tmp ) } )
AEval( s_hOPTPRG[ cExt ] , {| tmp | AAddNew( aOPTPRG, tmp ) } )
RETURN NIL
} )
hb_HEval( hbsh[ _HBSH_hINCPATH ], ;
{| cExt |
AEval( hbsh[ _HBSH_hINCPATH ][ cExt ], {| tmp | AAddNew( aOPTPRG, "-i" + tmp ) } )
AEval( hbsh[ _HBSH_hCH ][ cExt ] , {| tmp | AAddNew( aOPTPRG, "-u+" + tmp ) } )
AEval( hbsh[ _HBSH_hOPTPRG ][ cExt ] , {| tmp | AAddNew( aOPTPRG, tmp ) } )
RETURN NIL
} )
cFunc := "STATIC FUNCTION __HBDOT()" + hb_eol() +;
"RETURN {||" + hb_eol() +;
" " + cCommand + hb_eol() +;
" RETURN __mvSetBase()" + hb_eol() +;
"}" + hb_eol()
cFunc := ;
"STATIC FUNCTION __HBDOT()" + hb_eol() +;
"RETURN {||" + hb_eol() +;
" " + cCommand + hb_eol() +;
" RETURN __mvSetBase()" + hb_eol() +;
"}" + hb_eol()
DevPos( s_nRow, s_nCol )
DevPos( hbsh[ _HBSH_nRow ], hbsh[ _HBSH_nCol ] )
BEGIN SEQUENCE WITH {| oError | __hbshell_Err( oError, cCommand ) }
@@ -14245,11 +14318,11 @@ STATIC PROCEDURE __hbshell_Exec( cCommand )
END /* SEQUENCE */
s_nRow := Row()
s_nCol := Col()
hbsh[ _HBSH_nRow ] := Row()
hbsh[ _HBSH_nCol ] := Col()
nRowMin := 3
IF s_nRow < nRowMin
s_nRow := nRowMin
IF hbsh[ _HBSH_nRow ] < nRowMin
hbsh[ _HBSH_nRow ] := nRowMin
ENDIF
__mvSetBase()
@@ -14272,19 +14345,21 @@ EXIT PROCEDURE __hbshell_exit()
STATIC PROCEDURE __hbshell_HistoryLoad()
LOCAL hbsh := hbsh()
LOCAL cHistory
LOCAL cLine
s_lWasLoad := .T.
hbsh[ _HBSH_lWasLoad ] := .T.
IF s_lPreserveHistory
IF hbsh[ _HBSH_lPreserveHistory ]
cHistory := StrTran( MemoRead( __hbshell_ConfigDir() + _FNAME_HISTORY_ ), Chr( 13 ) )
IF Left( cHistory, Len( _HISTORY_DISABLE_LINE + Chr( 10 ) ) ) == _HISTORY_DISABLE_LINE + Chr( 10 )
s_lPreserveHistory := .F.
hbsh[ _HBSH_lPreserveHistory ] := .F.
ELSE
FOR EACH cLine IN hb_ATokens( StrTran( cHistory, Chr( 13 ) ), Chr( 10 ) )
IF ! Empty( cLine )
AAdd( s_aHistory, PadR( cLine, HB_LINE_LEN ) )
AAdd( hbsh[ _HBSH_aHistory ], PadR( cLine, HB_LINE_LEN ) )
ENDIF
NEXT
ENDIF
@@ -14294,13 +14369,15 @@ STATIC PROCEDURE __hbshell_HistoryLoad()
STATIC PROCEDURE __hbshell_HistorySave()
LOCAL hbsh := hbsh()
LOCAL cHistory
LOCAL cLine
LOCAL cDir
IF s_lWasLoad .AND. s_lPreserveHistory
IF hbsh[ _HBSH_lWasLoad ] .AND. hbsh[ _HBSH_lPreserveHistory ]
cHistory := ""
FOR EACH cLine IN s_aHistory
FOR EACH cLine IN hbsh[ _HBSH_aHistory ]
IF !( Lower( AllTrim( cLine ) ) == "quit" )
cHistory += AllTrim( cLine ) + hb_eol()
ENDIF
@@ -14465,12 +14542,14 @@ STATIC FUNCTION __hbshell_detect_GT( hHRB )
/* Check if a header is a valid core one */
STATIC FUNCTION __hbshell_TryHeader( cName )
LOCAL hbsh := hbsh()
LOCAL lRetVal := .F.
BEGIN SEQUENCE WITH {| oError | Break( oError ) }
IF ! Empty( hb_compileFromBuf( "", hbmk_CoreHeaderFiles(), hb_ProgName(), "-q2", ;
"-i" + s_hbmk[ _HBMK_cHB_INSTALL_INC ], ;
"-i" + hbsh[ _HBSH_hbmk ][ _HBMK_cHB_INSTALL_INC ], ;
"-u+" + cName ) )
lRetVal := .T.
ENDIF
@@ -14482,10 +14561,12 @@ STATIC FUNCTION __hbshell_TryHeader( cName )
/* Public hbshell API usable in dot prompt and startup script */
FUNCTION hbshell_include( cName )
LOCAL hbsh := hbsh()
cName := Lower( cName )
IF !( cName $ s_hCHCORE ) .AND. __hbshell_TryHeader( cName )
s_hCHCORE[ cName ] := NIL
IF !( cName $ hbsh[ _HBSH_hCHCORE ] ) .AND. __hbshell_TryHeader( cName )
hbsh[ _HBSH_hCHCORE ][ cName ] := NIL
RETURN .T.
ENDIF
@@ -14493,10 +14574,12 @@ FUNCTION hbshell_include( cName )
FUNCTION hbshell_uninclude( cName )
LOCAL hbsh := hbsh()
cName := Lower( cName )
IF cName $ s_hCHCORE
hb_HDel( s_hCHCORE, cName )
IF cName $ hbsh[ _HBSH_hCHCORE ]
hb_HDel( hbsh[ _HBSH_hCHCORE ], cName )
RETURN .T.
ENDIF
@@ -14504,16 +14587,24 @@ FUNCTION hbshell_uninclude( cName )
PROCEDURE hbshell_include_list()
hb_HEval( s_hCHCORE, {| tmp | __hbshell_ToConsole( tmp ) } )
LOCAL hbsh := hbsh()
hb_HEval( hbsh[ _HBSH_hCHCORE ], {| tmp | __hbshell_ToConsole( tmp ) } )
RETURN
/* Public hbshell API */
FUNCTION hbshell_DirBase()
RETURN hb_UTF8ToStr( s_cDirBase_hbshell )
LOCAL hbsh := hbsh()
RETURN hb_UTF8ToStr( hbsh[ _HBSH_cDirBase ] )
FUNCTION hbshell_ProgName()
RETURN hb_UTF8ToStr( s_cProgName_hbshell )
LOCAL hbsh := hbsh()
RETURN hb_UTF8ToStr( hbsh[ _HBSH_cProgName ] )
FUNCTION hbshell_gtSelect( cGT )
@@ -14543,7 +14634,13 @@ STATIC FUNCTION __hbshell_gtDefault()
RETURN _HBMK_GT_DEF_
#endif
#endif /* _HBMK_EMBEDDED_ */
#else
/* public entry for embedded flavor */
FUNCTION hbmk( ... )
RETURN __hbmk( ... )
#endif /* ! _HBMK_EMBEDDED_ */
/* ------------------------------------------------------------- */
@@ -15602,6 +15699,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong )
{ "hbshell_gtSelect( [<cGT>] ) -> NIL" , hb_StrFormat( I_( "Switch GT. Default [*]: '%1$s'" ), Lower( __hbshell_gtDefault() ) ) }, ;
{ "hbshell_include( <cHeader> ) -> <lSuccess>" , I_( "Load Harbour header." ) }, ;
{ "hbshell_uninclude( <cHeader> ) -> <lSuccess>" , I_( "Unload Harbour header." ) }, ;
{ "hbshell_include_list() -> NIL" , I_( "Display list of loaded Harbour header." ) }, ;
{ "hbshell_ext_load( <cPackageName> ) -> <lSuccess>" , I_( "Load package. Similar to #request PP directive." ) }, ;
{ "hbshell_ext_unload( <cPackageName> ) -> <lSuccess>", I_( "Unload package." ) }, ;
{ "hbshell_ext_get_list() -> <aPackages>" , I_( "List of loaded packages." ) }, ;

View File

@@ -163,7 +163,7 @@ ul {
<td >&nbsp;</td>
<td valign="top"><font size="2" class="title_text"> Release of 1.0.0 RC 2</font>
<ul>
<li><span class="title_date"><font>July 01, 2008</font></span><font><br />
<li><span class="title_date"><font>July 1, 2008</font></span><font><br />
<br />
<span class="title">General</span>&nbsp;&nbsp; </font></li>
<li><font>SVN repository cleanup in /tags and /branches</font></li>
@@ -232,7 +232,7 @@ ul {
<td >&nbsp;</td>
<td valign="top"><span class="title_text"> Release of 1.0.0 RC 1 </span>
<ul>
<li><span class="title_date">June 04, 2008</span><br />
<li><span class="title_date">June 4, 2008</span><br />
<br />
<span class="title">General</span><br />
</li>
@@ -689,7 +689,7 @@ ul {
<td >&nbsp;</td>
<td valign="top"><span class="title_text">Release of Alpha build 46</span>
<ul>
<li class="title_date">June 05, 2006</li>
<li class="title_date">June 5, 2006</li>
</ul>
<span class="title"><br />
General</span>