From a08811f554c378c536fdb14cd40365586723843d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 5 Apr 2013 15:03:38 +0200 Subject: [PATCH] 2013-04-05 14:57 UTC+0200 Viktor Szakats (harbour syenar.net) * bin/check.hb ! made it work regardless of cwd + added --fixup option to fix/process files + extended detection of SVN IDs based on 'ident' option in .gitattributes. Now also warn if missing. + added detection of C++ style comments in C files + ported Harbour function name casing fixup code, so it can now be done automatically before commit * bin/commit.hb * minor change in option name * contrib/gtwvg/wvgwin.c * contrib/gtwvg/wvgwing.c ! deleted large amount of MSDN documentation in C++ comments ! fixed C++ comments * src/pp/ppcore.c * avoid false C++ comment detection in deffed out non-code section * src/rtl/gttrm/gttrm.c * contrib/rddads/adsx.c * contrib/xhb/filestat.c ! fixed C++ comment * contrib/hbrun/hbrun.hbp * utils/hbmk2/hbmk2.hbp + better comment * extras/gtwvw/hbgtwvw.h * extras/gtwvw/*.c ! fixed C++ comments --- ChangeLog.txt | 35 +++++ bin/check.hb | 312 ++++++++++++++++++++++++++++++++++++++-- bin/commit.hb | 2 +- contrib/gtwvg/wvgwin.c | 78 +++++----- contrib/gtwvg/wvgwing.c | 2 +- contrib/hbrun/hbrun.hbp | 2 +- contrib/rddads/adsx.c | 8 +- contrib/xhb/filestat.c | 2 +- extras/gtwvw/gtwvwd.c | 163 +++++++++++---------- extras/gtwvw/hbgtwvw.h | 14 +- extras/gtwvw/wvwcheck.c | 2 +- extras/gtwvw/wvwdraw.c | 12 +- extras/gtwvw/wvwedit.c | 13 +- extras/gtwvw/wvwfuncs.c | 198 +++++++++++++------------ extras/gtwvw/wvwmenu.c | 15 +- extras/gtwvw/wvwpush.c | 8 +- extras/gtwvw/wvwtbar.c | 2 +- src/pp/ppcore.c | 2 +- src/rtl/gttrm/gttrm.c | 2 +- utils/hbmk2/hbmk2.hbp | 2 +- 20 files changed, 608 insertions(+), 266 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index eacda345db..9a88a00810 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,41 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-04-05 14:57 UTC+0200 Viktor Szakats (harbour syenar.net) + * bin/check.hb + ! made it work regardless of cwd + + added --fixup option to fix/process files + + extended detection of SVN IDs based on 'ident' option + in .gitattributes. Now also warn if missing. + + added detection of C++ style comments in C files + + ported Harbour function name casing fixup code, so + it can now be done automatically before commit + + * bin/commit.hb + * minor change in option name + + * contrib/gtwvg/wvgwin.c + * contrib/gtwvg/wvgwing.c + ! deleted large amount of MSDN documentation in C++ comments + ! fixed C++ comments + + * src/pp/ppcore.c + * avoid false C++ comment detection in deffed out + non-code section + + * src/rtl/gttrm/gttrm.c + * contrib/rddads/adsx.c + * contrib/xhb/filestat.c + ! fixed C++ comment + + * contrib/hbrun/hbrun.hbp + * utils/hbmk2/hbmk2.hbp + + better comment + + * extras/gtwvw/hbgtwvw.h + * extras/gtwvw/*.c + ! fixed C++ comments + 2013-04-05 02:57 UTC+0200 Viktor Szakats (harbour syenar.net) * bin/check.hb ! fixed to use local implementation instead of hb_DirScan() diff --git a/bin/check.hb b/bin/check.hb index 49fd613cb8..61cfb589a9 100644 --- a/bin/check.hb +++ b/bin/check.hb @@ -33,6 +33,8 @@ #include "directry.ch" +#define _HBROOT_ hb_DirBase() + hb_DirSepToOS( "../" ) /* must end with dirsep */ + FUNCTION CheckFileList( xName ) LOCAL lPassed := .T. @@ -40,16 +42,21 @@ FUNCTION CheckFileList( xName ) LOCAL aErr, s LOCAL file + LOCAL lApplyFixes := "--fixup" $ hb_CmdLine() + IF HB_ISSTRING( xName ) xName := { xName } ENDIF IF Empty( xName ) .OR. HB_ISARRAY( xName ) IF Empty( xName ) + s := hb_cwd( _HBROOT_ ) xName := my_DirScan( hb_osFileMask() ) + hb_cwd( s ) + lApplyFixes := .F. /* do not allow to mass fix all files */ ENDIF FOR EACH file IN xName - IF ! CheckFile( file, @aErr ) + IF ! CheckFile( file, @aErr, lApplyFixes ) lPassed := .F. FOR EACH s IN aErr OutStd( file + ": " + s + hb_eol() ) @@ -127,7 +134,8 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes ) LOCAL aForcedLF := { ; "*.sh" } - LOCAL hAllowedExt := LoadGitattributes() + LOCAL aCanHaveIdent + LOCAL hAllowedExt := LoadGitattributes( @aCanHaveIdent ) /* TODO: extend as you go */ LOCAL hDoNotProcess := { ; @@ -137,7 +145,7 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes ) hb_default( @lApplyFixes, .F. ) cName := hb_DirSepToOS( cName ) - cFile := hb_MemoRead( cName ) + cFile := hb_MemoRead( _HBROOT_ + cName ) aErr := {} @@ -277,8 +285,18 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes ) ENDIF ENDIF - IF "$" + "Id" $ cFile .AND. ! hb_FileMatch( cName, "ChangeLog.txt" ) - AAdd( aErr, "content: has " + "$" + "Id" ) + IF ( tmp := "$" + "Id" ) $ cFile != FNameExc( cName, aCanHaveIdent ) + IF tmp + AAdd( aErr, "content: has " + "$" + "Id" ) + ELSE + AAdd( aErr, "content: missing " + "$" + "Id" ) + ENDIF + ENDIF + + IF "|" + hb_FNameExt( cName ) + "|" $ "|.c|.h|.api|" + IF "//" $ StripCStrings( StripCComments( cFile ) ) + AAdd( aErr, "content: C file with C++ coment" ) + ENDIF ENDIF ENDIF ENDIF @@ -434,6 +452,63 @@ STATIC FUNCTION RemoveEndingWhitespace( cFile, cEOL, lRTrim ) RETURN cResult +STATIC FUNCTION StripCStrings( cFile ) + + LOCAL nPos := 1 + LOCAL aHits := {} + LOCAL tmp + + DO WHILE ( tmp := hb_BAt( '"', cFile, nPos ) ) > 0 + /* TOFIX: imprecise escaped char detection */ + IF ( !( hb_BSubStr( cFile, tmp - 1, 1 ) == "\" ) .OR. ; + hb_BSubStr( cFile, tmp - 2, 2 ) == "\\" ) .AND. ; + !( hb_BSubStr( cFile, tmp - 1, 1 ) + hb_BSubStr( cFile, tmp + 1, 1 ) == "''" ) + AAdd( aHits, tmp ) + ENDIF + nPos := tmp + 1 + ENDDO + + /* unbalanced */ + IF Len( aHits ) % 2 != 0 + AAdd( aHits, hb_BLen( cFile ) ) + ENDIF + + FOR tmp := 1 TO Len( aHits ) STEP 2 + cFile := hb_BLeft( cFile, aHits[ tmp ] ) + Replicate( " ", aHits[ tmp + 1 ] - aHits[ tmp ] - 1 ) + hb_BSubStr( cFile, aHits[ tmp + 1 ] ) + NEXT + + RETURN cFile + +/* bare bones */ +STATIC FUNCTION StripCComments( cFile ) + + LOCAL nPos := 1 + LOCAL aHits := {} + LOCAL tmp + LOCAL tmp1 + LOCAL lStart := .T. + + DO WHILE ( tmp := hb_BAt( iif( lStart, "/*", "*/" ), cFile, nPos ) ) > 0 + AAdd( aHits, tmp + iif( lStart, 0, 2 ) ) + nPos := tmp + lStart := ! lStart + ENDDO + + /* unbalanced */ + IF Len( aHits ) % 2 != 0 + AAdd( aHits, hb_BLen( cFile ) ) + ENDIF + + FOR tmp := 1 TO Len( aHits ) STEP 2 + FOR tmp1 := aHits[ tmp ] TO aHits[ tmp + 1 ] + IF ! hb_BSubStr( cFile, tmp1, 1 ) $ Chr( 13 ) + Chr( 10 ) + hb_BPoke( @cFile, tmp1, hb_BCode( " " ) ) + ENDIF + NEXT + NEXT + + RETURN cFile + STATIC FUNCTION FNameExc( cName, aList ) LOCAL tmp, tmp1 @@ -457,21 +532,27 @@ STATIC PROCEDURE ProcFile( cFileName ) STATIC sc_hProc := { ; ".png" => { "avdpng -z -4 %1$s", "optipng -o7 %1$s" }, ; ".jpg" => { "jpegoptim --strip-all %1$s" }, ; - ".c" => { "uncrustify -c bin/harbour.ucf %1$s" }, ; + ".c" => { "uncrustify -c bin/harbour.ucf %1$s", @FixFuncCase() }, ; ".cpp" => ".c", ; - ".h" => ".c" } -// NOTE: hbformat has bugs which make it unsuitable for unattended use -// ".prg" => { "hbformat %1$s" } } + ".h" => ".c", ; + ".api" => ".c", ; + ".txt" => { @FixFuncCase() }, ; + ".prg" => { @FixFuncCase() /*, "hbformat %1$s" */ }, ; /* NOTE: hbformat has bugs which make it unsuitable for unattended use */ + ".ch" => ".prg" } LOCAL aProc := hb_FNameExt( cFileName ) - LOCAL cCmd + LOCAL xCmd DO WHILE HB_ISSTRING( aProc := hb_HGetDef( sc_hProc, aProc, NIL ) ) ENDDO IF HB_ISARRAY( aProc ) - FOR EACH cCmd IN aProc - hb_run( hb_StrFormat( hb_DirSepToOS( cCmd ), '"' + cFileName + '"' ) ) + FOR EACH xCmd IN aProc + IF HB_ISSTRING( xCmd ) + hb_run( hb_StrFormat( hb_DirSepToOS( xCmd ), '"' + _HBROOT_ + cFileName + '"' ) ) + ELSEIF HB_ISEVALITEM( xCmd ) + Eval( xCmd, cFileName ) + ENDIF NEXT ENDIF @@ -497,7 +578,7 @@ STATIC FUNCTION LoadGitignore() "!*/3rd/*/*.hbp", ; "!*/3rd/*/Makefile" } - FOR EACH cLine IN hb_ATokens( StrTran( hb_MemoRead( ".gitignore" ), Chr( 13 ) ), Chr( 10 ) ) + FOR EACH cLine IN hb_ATokens( StrTran( hb_MemoRead( _HBROOT_ + ".gitignore" ), Chr( 13 ) ), Chr( 10 ) ) IF ! Empty( cLine ) .AND. !( Left( cLine, 1 ) == "#" ) /* TODO: clean this */ AAdd( s_aIgnore, ; @@ -517,25 +598,32 @@ STATIC FUNCTION LoadGitignore() RETURN s_aIgnore -STATIC FUNCTION LoadGitattributes() +STATIC FUNCTION LoadGitattributes( /* @ */ aIdent ) THREAD STATIC s_hExt := NIL + THREAD STATIC s_aIdent := NIL LOCAL cLine LOCAL tmp IF s_hExt == NIL s_hExt := { => } - FOR EACH cLine IN hb_ATokens( StrTran( hb_MemoRead( ".gitattributes" ), Chr( 13 ) ), Chr( 10 ) ) + s_aIdent := {} + FOR EACH cLine IN hb_ATokens( StrTran( hb_MemoRead( _HBROOT_ + ".gitattributes" ), Chr( 13 ) ), Chr( 10 ) ) IF Left( cLine, 2 ) == "*." cLine := SubStr( cLine, 2 ) IF ( tmp := At( " ", cLine ) ) > 0 s_hExt[ RTrim( Left( cLine, tmp - 1 ) ) ] := NIL ENDIF ENDIF + IF ( tmp := At( " ", cLine ) ) > 0 .AND. "ident" $ SubStr( cLine, tmp + 1 ) + AAdd( s_aIdent, RTrim( Left( cLine, tmp - 1 ) ) ) + ENDIF NEXT ENDIF + aIdent := s_aIdent + RETURN s_hExt STATIC FUNCTION my_DirScan( cMask ) @@ -555,3 +643,197 @@ STATIC FUNCTION my_DirScanWorker( cMask, aList ) NEXT RETURN aList + +/* ---- */ + +STATIC FUNCTION FixFuncCase( cFileName ) + + STATIC sc_hExtExceptions := { ; + ".dll" =>, ; + ".dxe" =>, ; + ".dylib" =>, ; + ".so" =>, ; + ".sl" =>, ; + ".zip" =>, ; + ".7z" =>, ; + ".exe" =>, ; + ".o" =>, ; + ".obj" =>, ; + ".js" =>, ; + ".dif" =>, ; + ".exe" =>, ; + ".y" =>, ; + ".yyc" =>, ; + ".yyh" =>, ; + ".a" =>, ; + ".afm" =>, ; + ".bmp" =>, ; + ".dat" =>, ; + ".dbf" =>, ; + ".exe" =>, ; + ".frm" =>, ; + ".gif" =>, ; + ".icns" =>, ; + ".ico" =>, ; + ".jpg" =>, ; + ".lbl" =>, ; + ".lib" =>, ; + ".mdb" =>, ; + ".ng" =>, ; + ".odt" =>, ; + ".pdf" =>, ; + ".pfb" =>, ; + ".png" =>, ; + ".sq3" =>, ; + ".tif" => } + + STATIC sc_hPartial := { ; + ".c" =>, ; + ".cpp" =>, ; + ".h" =>, ; + ".api" => } + + STATIC sc_hFileExceptions := { ; + "ChangeLog.txt" =>, ; + "std.ch" =>, ; + "wcecon.prg" =>, ; + "uc16_gen.prg" =>, ; + "clsscope.prg" =>, ; + "speedstr.prg" =>, ; + "cpinfo.prg" =>, ; + "clsccast.prg" =>, ; + "clsicast.prg" =>, ; + "clsscast.prg" =>, ; + "big5_gen.prg" =>, ; + "foreach2.prg" =>, ; + "speedtst.prg" =>, ; + "keywords.prg" =>, ; + "xhb-diff.txt" =>, ; + "pp.txt" =>, ; + "locks.txt" =>, ; + "oldnews.txt" =>, ; + "news.html" =>, ; + "news1.html" =>, ; + "c_std.txt" =>, ; + "tracing.txt" =>, ; + "pcode.txt" => } + + STATIC sc_aMaskExceptions := { ; + "contrib/xhb/thtm.prg" , ; + "contrib/hbnetio/readme.txt" , ; + "contrib/hbnetio/tests/*" , ; + "extras/httpsrv/home/*" , ; + "tests/hbpptest/*" , ; + "tests/mt/*" , ; + "tests/multifnc/*" , ; + "tests/rddtest/*" } + + LOCAL hAll + LOCAL cLog + + LOCAL a + LOCAL cProper + LOCAL cOldCP + + LOCAL cRest + LOCAL nPartial + + LOCAL nChanged := 0 + + IF Empty( hb_FNameExt( cFileName ) ) .OR. ; + hb_FNameExt( cFileName ) $ sc_hExtExceptions .OR. ; + hb_FNameNameExt( cFileName ) $ sc_hFileExceptions .OR. ; + AScan( sc_aMaskExceptions, {| tmp | hb_FileMatch( StrTran( cFileName, "\", "/" ), tmp ) } ) == 0 + RETURN .F. + ENDIF + + hAll := __hbformat_BuildListOfFunctions() + cLog := MemoRead( _HBROOT_ + cFileName ) + + IF hb_FNameExt( cFileName ) $ sc_hPartial + IF ( nPartial := At( "See COPYING.txt for licensing terms.", cLog ) ) > 0 + ELSEIF ( nPartial := At( "If you do not wish that, delete this exception notice.", cLog ) ) > 0 + ELSE + nPartial := 300 + ENDIF + /* arbitrary size limit */ + cRest := SubStr( cLog, nPartial ) + cLog := Left( cLog, nPartial - 1 ) + ELSE + cRest := "" + ENDIF + + cOldCP := hb_cdpSelect( "EN" ) + + FOR EACH a IN hb_regexAll( "([A-Za-z] |[^A-Za-z_:]|^)([A-Za-z_][A-Za-z0-9_]+\()", cLog,,,,, .T. ) + IF Len( a[ 2 ] ) != 2 .OR. !( Left( a[ 2 ], 1 ) $ "D" /* "METHOD" */ ) + cProper := ProperCase( hAll, hb_StrShrink( a[ 3 ] ) ) + "(" + IF !( cProper == a[ 3 ] ) .AND. ; + !( Upper( cProper ) == "FILE(" ) .AND. ; /* interacts with "file(s)" text */ + !( Upper( cProper ) == "INT(" ) /* interacts with SQL statements */ + cLog := StrTran( cLog, a[ 1 ], StrTran( a[ 1 ], a[ 3 ], cProper ) ) + OutStd( cFileName, a[ 3 ], cProper, "|" + a[ 1 ] + "|" + hb_eol() ) + nChanged++ + ENDIF + ENDIF + NEXT + + IF !( "hbclass.ch" $ cFileName ) + FOR EACH a IN hb_regexAll( "(?:REQUEST|EXTERNAL|EXTERNA|EXTERN)[ \t]+([A-Za-z_][A-Za-z0-9_]+)", cLog,,,,, .T. ) + cProper := ProperCase( hAll, a[ 2 ] ) + IF !( cProper == a[ 2 ] ) + cLog := StrTran( cLog, a[ 1 ], StrTran( a[ 1 ], a[ 2 ], cProper ) ) + OutStd( cFileName, a[ 2 ], cProper, "|" + a[ 1 ] + "|" + hb_eol() ) + nChanged++ + ENDIF + NEXT + ENDIF + + hb_cdpSelect( cOldCP ) + + IF nChanged > 0 + OutStd( cFileName + ": Harbour function casings fixed: " + hb_ntos( nChanged ) + hb_eol() ) + hb_MemoWrit( _HBROOT_ + cFileName, cLog + cRest ) + ENDIF + + RETURN .T. + +STATIC FUNCTION ProperCase( hAll, cName ) + + IF cName $ hAll + RETURN hb_HKeyAt( hAll, hb_HPos( hAll, cName ) ) + ENDIF + + RETURN cName + +STATIC FUNCTION __hbformat_BuildListOfFunctions() + + THREAD STATIC s_hFunctions := NIL + + IF s_hFunctions == NIL + s_hFunctions := { => } + hb_HCaseMatch( s_hFunctions, .F. ) + + WalkDir( hb_DirBase() + hb_DirSepToOS( _HBROOT_ + "include/" ), s_hFunctions ) + WalkDir( hb_DirBase() + hb_DirSepToOS( _HBROOT_ + "contrib/" ), s_hFunctions ) + WalkDir( hb_DirBase() + hb_DirSepToOS( _HBROOT_ + "extras/" ), s_hFunctions ) + ENDIF + + RETURN s_hFunctions + +STATIC PROCEDURE WalkDir( cDir, hFunctions ) + + LOCAL file + LOCAL cLine + + FOR EACH file IN hb_DirScan( cDir, "*.hbx" ) + FOR EACH cLine IN hb_ATokens( StrTran( hb_MemoRead( cDir + file[ F_NAME ] ), Chr( 13 ) ), Chr( 10 ) ) + IF Left( cLine, Len( "DYNAMIC " ) ) == "DYNAMIC " + hFunctions[ SubStr( cLine, Len( "DYNAMIC " ) + 1 ) ] := NIL + ENDIF + NEXT + NEXT + + RETURN + +/* ---- */ diff --git a/bin/commit.hb b/bin/commit.hb index 5f29125585..392c052ff7 100644 --- a/bin/commit.hb +++ b/bin/commit.hb @@ -62,7 +62,7 @@ PROCEDURE Main() ENDIF ENDIF - IF "--hb-check-only" $ Lower( hb_CmdLine() ) + IF "--check-only" $ hb_CmdLine() IF AScan( aFiles, {| tmp | tmp == cLogName } ) == 0 OutStd( hb_ProgName() + ": " + hb_StrFormat( "%1$s not updated. Run 'hbrun bin/commit' and retry.", cLogName ) + hb_eol() ) ErrorLevel( 3 ) diff --git a/contrib/gtwvg/wvgwin.c b/contrib/gtwvg/wvgwin.c index 4a197130f6..4785556d99 100644 --- a/contrib/gtwvg/wvgwin.c +++ b/contrib/gtwvg/wvgwin.c @@ -1254,22 +1254,22 @@ HB_FUNC( WVG_SENDCBMESSAGE ) switch( msg ) { - case CB_ADDSTRING: // Adds a string to the list box of a combo box. If the combo box does not have the CBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list, and the list is sorted. + case CB_ADDSTRING: hb_retnint( SendMessage( hCB, CB_ADDSTRING, ( WPARAM ) NULL, ( LPARAM ) ( LPCTSTR ) HB_PARSTR( 3, &hText, NULL ) ) ); break; - case CB_DELETESTRING: // Deletes a string in the list box of a combo box. + case CB_DELETESTRING: hb_retnint( SendMessage( hCB, CB_DELETESTRING, hb_parni( 3 ), 0 ) ); break; - case CB_DIR: // Adds names to the list displayed by the combo box. The message adds the names of directories and files that match a specified string and set of file attributes. CB_DIR can also add mapped drive letters to the list. + case CB_DIR: hb_retnint( SendMessage( hCB, CB_DIR, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; - case CB_FINDSTRING: // Searches the list box of a combo box for an item beginning with the characters in a specified string. + case CB_FINDSTRING: hb_retnint( SendMessage( hCB, CB_FINDSTRING, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; - case CB_FINDSTRINGEXACT: // Finds the first list box string in a combo box that matches the string specified in the lParam parameter. + case CB_FINDSTRINGEXACT: hb_retnint( SendMessage( hCB, CB_FINDSTRINGEXACT, ( WPARAM ) hb_parni( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; - case CB_GETCOMBOBOXINFO: // Gets information about the specified combo box. + case CB_GETCOMBOBOXINFO: { COMBOBOXINFO cbi; PHB_ITEM pCbi = hb_itemNew( NULL ); @@ -1310,17 +1310,17 @@ HB_FUNC( WVG_SENDCBMESSAGE ) } break; } - case CB_GETCOUNT: // Gets the number of items in the list box of a combo box. + case CB_GETCOUNT: hb_retnint( SendMessage( hCB, CB_GETCOUNT, 0, 0 ) ); break; #if defined( CB_GETCUEBANNER ) - case CB_GETCUEBANNER: // Gets the cue banner text displayed in the edit control of a combo box. Send this message explicitly or by using the ComboBox_GetCueBannerText macro. + case CB_GETCUEBANNER: break; #endif - case CB_GETCURSEL: // An application sends a CB_GETCURSEL message to retrieve the index of the currently selected item, if any, in the list box of a combo box. + case CB_GETCURSEL: hb_retnint( SendMessage( hCB, CB_GETCURSEL, 0, 0 ) ); break; - case CB_GETDROPPEDCONTROLRECT: // An application sends a CB_GETDROPPEDCONTROLRECT message to retrieve the screen coordinates of a combo box in its dropped-down state. + case CB_GETDROPPEDCONTROLRECT: { RECT rc; PHB_ITEM pRect = hb_itemNew( NULL ); @@ -1336,13 +1336,13 @@ HB_FUNC( WVG_SENDCBMESSAGE ) hb_itemReturnRelease( pRect ); break; } - case CB_GETDROPPEDSTATE: // Determines whether the list box of a combo box is dropped down. + case CB_GETDROPPEDSTATE: hb_retnint( SendMessage( hCB, CB_GETDROPPEDSTATE, 0, 0 ) ); break; - case CB_GETDROPPEDWIDTH: // Gets the minimum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style. + case CB_GETDROPPEDWIDTH: hb_retnint( SendMessage( hCB, CB_GETDROPPEDWIDTH, 0, 0 ) ); break; - case CB_GETEDITSEL: // Gets the starting and ending character positions of the current selection in the edit control of a combo box. + case CB_GETEDITSEL: { DWORD range = ( DWORD ) SendMessage( hCB, CB_GETEDITSEL, ( WPARAM ) NULL, ( LPARAM ) NULL ); PHB_ITEM pRng = hb_itemNew( NULL ); @@ -1354,19 +1354,19 @@ HB_FUNC( WVG_SENDCBMESSAGE ) break; } - case CB_GETEXTENDEDUI: // Determines whether a combo box has the default user interface or the extended user interface. + case CB_GETEXTENDEDUI: hb_retnint( SendMessage( hCB, CB_GETEXTENDEDUI, 0, 0 ) ); break; - case CB_GETHORIZONTALEXTENT: // Gets the width, in pixels, that the list box can be scrolled horizontally (the scrollable width). This is applicable only if the list box has a horizontal scroll bar. + case CB_GETHORIZONTALEXTENT: hb_retnint( SendMessage( hCB, CB_GETHORIZONTALEXTENT, 0, 0 ) ); break; - case CB_GETITEMDATA: // An application sends a CB_GETITEMDATA message to a combo box to retrieve the application-supplied value associated with the specified item in the combo box. + case CB_GETITEMDATA: hb_retnint( SendMessage( hCB, CB_GETITEMDATA, ( WPARAM ) hb_parnint( 3 ), 0 ) ); break; - case CB_GETITEMHEIGHT: // Determines the height of list items or the selection field in a combo box. + case CB_GETITEMHEIGHT: hb_retnint( SendMessage( hCB, CB_GETITEMHEIGHT, 0, 0 ) ); break; - case CB_GETLBTEXT: // Gets a string from the list of a combo box. + case CB_GETLBTEXT: { HB_ISIZ iSize = SendMessage( hCB, CB_GETLBTEXTLEN, ( WPARAM ) hb_parnint( 3 ), 0 ); LPTSTR text = ( LPTSTR ) hb_xgrab( iSize + 1 ); @@ -1375,68 +1375,68 @@ HB_FUNC( WVG_SENDCBMESSAGE ) hb_xfree( text ); break; } - case CB_GETLBTEXTLEN: // Gets the length, in characters, of a string in the list of a combo box. + case CB_GETLBTEXTLEN: hb_retnint( SendMessage( hCB, CB_GETLBTEXTLEN, ( WPARAM ) hb_parnint( 3 ), 0 ) ); break; - case CB_GETLOCALE: // Gets the current locale of the combo box. The locale is used to determine the correct sorting order of displayed text for combo boxes with the CBS_SORT style and text added by using the CB_ADDSTRING message. + case CB_GETLOCALE: #if ( _WIN32_IE >= 0x0600 ) - case CB_GETMINVISIBLE: // Gets the minimum number of visible items in the drop-down list of a combo box. + case CB_GETMINVISIBLE: hb_retnint( SendMessage( hCB, CB_GETMINVISIBLE, 0, 0 ) ); break; #endif - case CB_GETTOPINDEX: // An application sends the CB_GETTOPINDEX message to retrieve the zero-based index of the first visible item in the list box portion of a combo box. Initially, the item with index 0 is at the top of the list box, but if the list box contents have been scrolled, another item may be at the top. + case CB_GETTOPINDEX: hb_retnint( SendMessage( hCB, CB_GETTOPINDEX, 0, 0 ) ); break; - case CB_INITSTORAGE: // An application sends the CB_INITSTORAGE message before adding a large number of items to the list box portion of a combo box. This message allocates memory for storing list box items. + case CB_INITSTORAGE: break; - case CB_INSERTSTRING: // Inserts a string or item data into the list of a combo box. Unlike the CB_ADDSTRING message, the CB_INSERTSTRING message does not cause a list with the CBS_SORT style to be sorted. + case CB_INSERTSTRING: hb_retnint( SendMessage( hCB, CB_INSERTSTRING, ( WPARAM ) hb_parnint( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; - case CB_LIMITTEXT: // Limits the length of the text the user may type into the edit control of a combo box. + case CB_LIMITTEXT: SendMessage( hCB, CB_LIMITTEXT, hb_parni( 3 ), 0 ); break; - case CB_RESETCONTENT: // Removes all items from the list box and edit control of a combo box. + case CB_RESETCONTENT: SendMessage( hCB, CB_RESETCONTENT, 0, 0 ); break; - case CB_SELECTSTRING: // Searches the list of a combo box for an item that begins with the characters in a specified string. If a matching item is found, it is selected and copied to the edit control. + case CB_SELECTSTRING: hb_retnint( SendMessage( hCB, CB_SELECTSTRING, ( WPARAM ) hb_parnint( 3 ), ( LPARAM ) HB_PARSTR( 4, &hText, NULL ) ) ); break; #if defined( CB_SETCUEBANNER ) - case CB_SETCUEBANNER: // Sets the cue banner text that is displayed for the edit control of a combo box. + case CB_SETCUEBANNER: break; #endif - case CB_SETCURSEL: // An application sends a CB_SETCURSEL message to select a string in the list of a combo box. If necessary, the list scrolls the string into view. The text in the edit control of the combo box changes to reflect the new selection, and any previous selection in the list is removed. + case CB_SETCURSEL: hb_retnint( SendMessage( hCB, CB_SETCURSEL, ( WPARAM ) hb_parnint( 3 ), 0 ) ); break; - case CB_SETDROPPEDWIDTH: // An application sends the CB_SETDROPPEDWIDTH message to set the maximum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style. + case CB_SETDROPPEDWIDTH: hb_retnint( SendMessage( hCB, CB_SETDROPPEDWIDTH, ( WPARAM ) hb_parnint( 3 ), 0 ) ); break; - case CB_SETEDITSEL: // An application sends a CB_SETEDITSEL message to select characters in the edit control of a combo box. + case CB_SETEDITSEL: break; - case CB_SETEXTENDEDUI: // An application sends a CB_SETEXTENDEDUI message to select either the default UI or the extended UI for a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style. + case CB_SETEXTENDEDUI: SendMessage( hCB, CB_SETEXTENDEDUI, hb_parl( 3 ), 0 ); break; - case CB_SETHORIZONTALEXTENT: // An application sends the CB_SETHORIZONTALEXTENT message to set the width, in pixels, by which a list box can be scrolled horizontally (the scrollable width). If the width of the list box is smaller than this value, the horizontal scroll bar horizontally scrolls items in the list box. If the width of the list box is equal to or greater than this value, the horizontal scroll bar is hidden or, if the combo box has the CBS_DISABLENOSCROLL style, disabled. + case CB_SETHORIZONTALEXTENT: SendMessage( hCB, CB_SETHORIZONTALEXTENT, hb_parl( 3 ), 0 ); break; - case CB_SETITEMDATA: // An application sends a CB_SETITEMDATA message to set the value associated with the specified item in a combo box. + case CB_SETITEMDATA: SendMessage( hCB, CB_SETITEMDATA, hb_parl( 3 ), ( LPARAM ) hb_parnint( 4 ) ); break; - case CB_SETITEMHEIGHT: // An application sends a CB_SETITEMHEIGHT message to set the height of list items or the selection field in a combo box. + case CB_SETITEMHEIGHT: hb_retnint( SendMessage( hCB, CB_SETITEMHEIGHT, ( WPARAM ) hb_parnint( 3 ), 0 ) ); break; - case CB_SETLOCALE: // An application sends a CB_SETLOCALE message to set the current locale of the combo box. If the combo box has the CBS_SORT style and strings are added using CB_ADDSTRING, the locale of a combo box affects how list items are sorted. + case CB_SETLOCALE: hb_retnint( SendMessage( hCB, CB_SETLOCALE, ( WPARAM ) hb_parnint( 3 ), 0 ) ); break; #if ( _WIN32_IE >= 0x0600 ) - case CB_SETMINVISIBLE: // An application sends a CB_SETMINVISIBLE message to set the minimum number of visible items in the drop-down list of a combo box. + case CB_SETMINVISIBLE: hb_retl( SendMessage( hCB, CB_SETMINVISIBLE, ( WPARAM ) hb_parnint( 3 ), 0 ) ); break; #endif - case CB_SETTOPINDEX: // An application sends the CB_SETTOPINDEX message to ensure that a particular item is visible in the list box of a combo box. The system scrolls the list box contents so that either the specified item appears at the top of the list box or the maximum scroll range has been reached. + case CB_SETTOPINDEX: hb_retl( SendMessage( hCB, CB_SETTOPINDEX, ( WPARAM ) hb_parnint( 3 ), 0 ) ? FALSE : TRUE ); break; - case CB_SHOWDROPDOWN: // An application sends a CB_SHOWDROPDOWN message to show or hide the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style. + case CB_SHOWDROPDOWN: SendMessage( hCB, CB_SHOWDROPDOWN, hb_parl( 3 ), 0 ); break; } diff --git a/contrib/gtwvg/wvgwing.c b/contrib/gtwvg/wvgwing.c index 5ff676a612..426e50f9b1 100644 --- a/contrib/gtwvg/wvgwing.c +++ b/contrib/gtwvg/wvgwing.c @@ -1168,7 +1168,7 @@ HB_FUNC( WVG_CREATETOOLTIPWINDOW ) TOOLINFO toolInfo; hwndTip = CreateWindowEx( 0, TOOLTIPS_CLASS, 0, - WS_POPUP | TTS_ALWAYSTIP, // | TTS_BALLOON, + WS_POPUP | TTS_ALWAYSTIP, /* | TTS_BALLOON, */ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, wvg_parhwnd( 1 ), diff --git a/contrib/hbrun/hbrun.hbp b/contrib/hbrun/hbrun.hbp index 34c683fe18..9ec4a647b5 100644 --- a/contrib/hbrun/hbrun.hbp +++ b/contrib/hbrun/hbrun.hbp @@ -28,7 +28,7 @@ {!(__HBMKDYN='yes')&unix}hbunix.hbc {!(__HBMKDYN='yes')&unix}-request=__HBEXTERN__HBUNIX__ {!(__HBMKDYN='yes')&allwin}hbwin.hbc {!(__HBMKDYN='yes')&allwin}-request=__HBEXTERN__HBWIN__ -# localization (automatization) +# localization (for automatization with config/lang.hb) -3rd=_langhb_entry=../../utils/hbmk2/ -3rd=_langhb_docext=.md -3rd=_langhb_docoption=-lang={LNG} diff --git a/contrib/rddads/adsx.c b/contrib/rddads/adsx.c index 0fa559c1f8..d1b5d428b0 100644 --- a/contrib/rddads/adsx.c +++ b/contrib/rddads/adsx.c @@ -644,7 +644,7 @@ static void mixUpdateDestroy( ADSXAREAP pArea, PMIXUPDATE pUpdate, int fUpdate ) PMIXKEY pKey = mixKeyEval( pTag, pArea ); mixFindKey( pTag, pKey, &ulKeyPos ); - // insert key into index + /* insert key into index */ if( pTag->ulRecCount == pTag->ulRecMax ) { pTag->pKeys = ( PMIXKEY* ) hb_xrealloc( pTag->pKeys, sizeof( PMIXKEY ) * ( pTag->ulRecMax + MIX_KEYPOOLRESIZE ) ); @@ -668,12 +668,12 @@ static void mixUpdateDestroy( ADSXAREAP pArea, PMIXUPDATE pUpdate, int fUpdate ) mixFindKey( pTag, pKey, &ulKeyPos ); if( ulKeyPos == pUpdate[ iTag ] || ulKeyPos == pUpdate[ iTag ] + 1 ) { - // assign new key in same position + /* assign new key in same position */ pTag->pKeys[ pUpdate[ iTag ] ] = pKey; } else { - // move keys and assign new key to new position + /* move keys and assign new key to new position */ if( ulKeyPos < pUpdate[ iTag ] ) { memmove( pTag->pKeys + ulKeyPos + 1, pTag->pKeys + ulKeyPos, ( pUpdate[ iTag ] - ulKeyPos ) * sizeof( PMIXKEY ) ); @@ -691,7 +691,7 @@ static void mixUpdateDestroy( ADSXAREAP pArea, PMIXUPDATE pUpdate, int fUpdate ) } else { - // delete key + /* delete key */ mixKeyFree( pKey ); memmove( pTag->pKeys + pUpdate[ iTag ], pTag->pKeys + pUpdate[ iTag ] + 1, ( pTag->ulRecCount - pUpdate[ iTag ] ) * sizeof( PMIXKEY ) ); pTag->ulRecCount--; diff --git a/contrib/xhb/filestat.c b/contrib/xhb/filestat.c index f92988bb64..d59cb7bf81 100644 --- a/contrib/xhb/filestat.c +++ b/contrib/xhb/filestat.c @@ -87,7 +87,7 @@ HB_FUNC( FILESTATS ) if( stat( hb_parc( 1 ), &statbuf ) == 0 ) { - // determine if we can read/write/execute the file + /* determine if we can read/write/execute the file */ HB_FATTR usAttr, ushbAttr = 0; time_t ftime; #if defined( HB_HAS_LOCALTIME_R ) diff --git a/extras/gtwvw/gtwvwd.c b/extras/gtwvw/gtwvwd.c index 8e983b81cc..74c5e3c4bf 100644 --- a/extras/gtwvw/gtwvwd.c +++ b/extras/gtwvw/gtwvwd.c @@ -100,66 +100,70 @@ /* settable by user: ****************************************************/ -//static UINT s_uiPaintRefresh = 100; /* milliseconds between timer check */ +#if 0 +static UINT s_uiPaintRefresh = 100; /* milliseconds between timer check */ -//static BOOL s_bMainCoordMode = FALSE; /* in this mode, all HB_GT_FUNC() uses Main Window's coordinate */ +static BOOL s_bMainCoordMode = FALSE; /* in this mode, all HB_GT_FUNC() uses Main Window's coordinate */ -//static BOOL s_bVertCaret = FALSE; /* if TRUE, caret is in Vertical style */ +static BOOL s_bVertCaret = FALSE; /* if TRUE, caret is in Vertical style */ -//static BOOL s_bNOSTARTUPSUBWINDOW = FALSE; /* if TRUE, subwindow will not be displayed during opening */ +static BOOL s_bNOSTARTUPSUBWINDOW = FALSE; /* if TRUE, subwindow will not be displayed during opening */ /* use WVW_NOSTARTUPSUBWINDOW() to check/set it */ -//static BOOL s_bDefCentreWindow = FALSE; /* default CentreWindow setting for subwindows */ +static BOOL s_bDefCentreWindow = FALSE; /* default CentreWindow setting for subwindows */ -//static BOOL s_bDefHCentreWindow = FALSE; /* default HCentreWindow setting for subwindows */ -//static BOOL s_bDefVCentreWindow = FALSE; /* default VCentreWindow setting for subwindows */ +static BOOL s_bDefHCentreWindow = FALSE; /* default HCentreWindow setting for subwindows */ +static BOOL s_bDefVCentreWindow = FALSE; /* default VCentreWindow setting for subwindows */ -//static int s_byDefLineSpacing = 0; /* default line spacing */ +static int s_byDefLineSpacing = 0; /* default line spacing */ -//static int s_iDefLSpaceColor = -1; /* if >= 0 this will be the color index -//for spacing between lines */ +static int s_iDefLSpaceColor = -1; /* if >= 0 this will be the color index +for spacing between lines */ -//static BOOL s_bAllowNonTop = FALSE; /* allow non-topmost window's control to -//accept input */ +static BOOL s_bAllowNonTop = FALSE; /* allow non-topmost window's control to +accept input */ -//static BOOL s_bRecurseCBlock = FALSE; /* allow control's codeblock -//to recurse */ +static BOOL s_bRecurseCBlock = FALSE; /* allow control's codeblock +to recurse */ -//static LOGFONT s_lfPB = { 0 }; /* default font for pushbuttons */ +static LOGFONT s_lfPB = { 0 }; /* default font for pushbuttons */ -//static LOGFONT s_lfSB = { 0 }; /* default font for statusbar */ -//static LOGFONT s_lfCB = { 0 }; /* default font for comboboxes */ +static LOGFONT s_lfSB = { 0 }; /* default font for statusbar */ +static LOGFONT s_lfCB = { 0 }; /* default font for comboboxes */ -//static LOGFONT s_lfEB = { 0 }; /* default font for editboxes */ +static LOGFONT s_lfEB = { 0 }; /* default font for editboxes */ -//static LOGFONT s_lfCX = { 0 }; /* font for 'focused'checkbox */ -//static LOGFONT s_lfST = { 0 }; /* font for static control */ +static LOGFONT s_lfCX = { 0 }; /* font for 'focused'checkbox */ +static LOGFONT s_lfST = { 0 }; /* font for static control */ -//static HWND hWndTT = 0; /* Window handle Tool Tip */ +static HWND hWndTT = 0; /* Window handle Tool Tip */ +#endif /* read only by user ***/ /* for GTWVW private use: ***********************************************/ -//static BOOL s_bQuickSetMode = FALSE; /* quick SetMode(), to reset maxrow() and maxcol() only */ +#if 0 +static BOOL s_bQuickSetMode = FALSE; /* quick SetMode(), to reset maxrow() and maxcol() only */ -//static BOOL s_bFlashingWindow = FALSE; /* topmost window is flashing -//due to invalid input on other -//window */ +static BOOL s_bFlashingWindow = FALSE; /* topmost window is flashing +due to invalid input on other +window */ -//static int s_iScrolling = 0; /* scrollbar is scrolling */ -//static int s_iWrongButtonUp = 0; /* number of consecutive scrollbar's WM_LBUTTONUP encountered by gtProcessMessages */ -//static int s_iMaxWrongButtonUp = 500; /* max number of s_iWrongButtonUp. If it goes higher than this number, -//the scrollbar is forced to stop */ +static int s_iScrolling = 0; /* scrollbar is scrolling */ +static int s_iWrongButtonUp = 0; /* number of consecutive scrollbar's WM_LBUTTONUP encountered by gtProcessMessages */ +static int s_iMaxWrongButtonUp = 500; /* max number of s_iWrongButtonUp. If it goes higher than this number, +the scrollbar is forced to stop */ -//static TCHAR szAppName[] = TEXT( "Harbour WVW" ); -//static TCHAR szSubWinName[] = TEXT( "Harbour WVW subwindows" ); -//static BOOL s_bSWRegistered = FALSE; +static TCHAR szAppName[] = TEXT( "Harbour WVW" ); +static TCHAR szSubWinName[] = TEXT( "Harbour WVW subwindows" ); +static BOOL s_bSWRegistered = FALSE; -//static UINT s_usNumWindows; /*number of windows */ -//static UINT s_usCurWindow = 0; /*current window handled by HB_GT_FUNC(...) */ +static UINT s_usNumWindows; /*number of windows */ +static UINT s_usCurWindow = 0; /*current window handled by HB_GT_FUNC(...) */ -//static WIN_DATA *s_pWindows[ WVW_MAXWINDOWS ]; /*array of WIN_DATA */ -//static APP_DATA s_sApp; /*application wide vars */ +static WIN_DATA *s_pWindows[ WVW_MAXWINDOWS ]; /*array of WIN_DATA */ +static APP_DATA s_sApp; /*application wide vars */ +#endif WVW_DATA * s_pWvwData; static BOOL bStartMode = TRUE; static COLORREF _COLORS[] = { @@ -363,19 +367,19 @@ LONG GetFontDialogUnits( HWND h, HFONT f ) char * tmp = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; SIZE sz; - //get the hdc to the main window + /* get the hdc to the main window */ hDc = GetDC( h ); - //with the current font attributes, select the font - hFont = f; //GetStockObject(ANSI_VAR_FONT); + /* with the current font attributes, select the font */ + hFont = f; /* GetStockObject(ANSI_VAR_FONT); */ hFontOld = ( HFONT ) SelectObject( hDc, &hFont ); - //get its length, then calculate the average character width + /* get its length, then calculate the average character width */ GetTextExtentPoint32( hDc, tmp, 52, &sz ); avgWidth = ( sz.cx / 52 ); - //re-select the previous font & delete the hDc + /* re-select the previous font & delete the hDc */ SelectObject( hDc, hFontOld ); DeleteObject( hFont ); ReleaseDC( h, hDc ); @@ -511,7 +515,7 @@ BOOL hb_gt_wvwDestroyPicture( IPicture * iPicture ) static void hb_gt_wvw_Exit( PHB_GT pGT ) { -//void gt_Exit( void ) +/* void gt_Exit( void ) */ int i; int j; WIN_DATA * pWindowData; @@ -1342,7 +1346,7 @@ static int hb_gt_wvw_mouse_CountButton( PHB_GT pGT ) /*WARNING: assume working on current window *NOTES: in MainCoord Mode current window is always the Main Window */ -//int gt_info(int iMsgType, BOOL bUpdate, int iParam, void *vpParam ) +/* int gt_info(int iMsgType, BOOL bUpdate, int iParam, void *vpParam ) */ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) { WIN_DATA * pWindowData = s_pWvwData->s_pWindows[ s_pWvwData->s_usCurWindow ]; @@ -1688,10 +1692,12 @@ static BOOL hb_gt_wvw_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) iX = hb_itemGetNI( hb_arrayGetItemPtr( pInfo->pNewVal, 1 ) ); if( iY > 0 ) - //BOOL bOldCentre = pWindowData->CentreWindow; - //pWVT->CentreWindow = pWVT->bMaximized ? TRUE : FALSE; +#if 0 + BOOL bOldCentre = pWindowData->CentreWindow; + pWVT->CentreWindow = pWVT->bMaximized ? TRUE : FALSE; +#endif hb_gt_wvw_bSetMode( pWindowData, ( USHORT ) ( iY / pWindowData->PTEXTSIZE.y ), ( USHORT ) ( iX / pWindowData->PTEXTSIZE.x ) ); - //pWindowData->CentreWindow = bOldCentre; + /* pWindowData->CentreWindow = bOldCentre; */ break; } @@ -3012,10 +3018,12 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam } } -// if ( hb_gt_gobjects != NULL ) -// { -// s_wvw_paintGraphicObjects( hdc, &updateRect ); -// } +#if 0 + if ( hb_gt_gobjects != NULL ) + { + s_wvw_paintGraphicObjects( hdc, &updateRect ); + } +#endif SelectObject( hdc, hOldFont ); @@ -3095,8 +3103,10 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam hb_gt_wvwKillCaret( pWindowData ); if( s_pWvwData->s_sApp->pSymWVW_KILLFOCUS ) -// hb_vmPushState(); -// hb_vmPushSymbol( s_pWvwData->s_sApp->pSymWVW_KILLFOCUS->pSymbol ); +#if 0 + hb_vmPushState(); + hb_vmPushSymbol( s_pWvwData->s_sApp->pSymWVW_KILLFOCUS->pSymbol ); +#endif if( hb_vmRequestReenter() ) { hb_vmPushDynSym( s_pWvwData->s_sApp->pSymWVW_KILLFOCUS ); @@ -3110,8 +3120,8 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam case WM_KEYDOWN: case WM_SYSKEYDOWN: -// case WM_CHAR: - //case WM_SYSCHAR: +/* case WM_CHAR: */ + /* case WM_SYSCHAR: */ { BOOL bAlt = GetKeyState( VK_MENU ) & 0x8000; @@ -3481,7 +3491,7 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam 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. */ -// hb_gt_wvwAddCharToInputQueue( HB_BREAK_FLAG ); +/* hb_gt_wvwAddCharToInputQueue( HB_BREAK_FLAG ); */ hb_gt_wvwAddCharToInputQueue( K_ESC ); else @@ -3641,7 +3651,7 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam LPDRAWITEMSTRUCT lpDIS; PTSTR ptStr; RECT rectCorner; - //long lSBColorForeground, lSBColorBackground; + /* long lSBColorForeground, lSBColorBackground; */ size_t stLen; const TCHAR * pEnd; @@ -3655,12 +3665,12 @@ static LRESULT CALLBACK hb_gt_wvwWndProc( HWND hWnd, UINT message, WPARAM wParam if( pWindowData->cSBColorForeground ) - //lSBColorForeground = strtol( s_cSBColorForeground, NULL, 10 ); - SetTextColor( lpDIS->hDC, pWindowData->cSBColorForeground ); //lSBColorForeground ); + /* lSBColorForeground = strtol( s_cSBColorForeground, NULL, 10 ); */ + SetTextColor( lpDIS->hDC, pWindowData->cSBColorForeground ); /* lSBColorForeground ); */ if( pWindowData->cSBColorBackground ) - //lSBColorBackground = strtol( s_cSBColorBackground, NULL, 10 ); - SetBkColor( lpDIS->hDC, pWindowData->cSBColorBackground ); //lSBColorBackground ); + /* lSBColorBackground = strtol( s_cSBColorBackground, NULL, 10 ); */ + SetBkColor( lpDIS->hDC, pWindowData->cSBColorBackground ); /* lSBColorBackground ); */ for( pEnd = ptStr; *pEnd != TEXT( '\0' ); pEnd++ ) continue; @@ -4436,7 +4446,7 @@ static void hb_gtInitStatics( UINT usWinNum, LPCTSTR lpszWinName, USHORT usRow1, s_pWvwData->s_lfSB.lfWidth = 0; s_pWvwData->s_lfSB.lfEscapement = 0; s_pWvwData->s_lfSB.lfOrientation = 0; - s_pWvwData->s_lfSB.lfWeight = 400; // + s_pWvwData->s_lfSB.lfWeight = 400; /* */ s_pWvwData->s_lfSB.lfItalic = 0; s_pWvwData->s_lfSB.lfUnderline = 0; s_pWvwData->s_lfSB.lfStrikeOut = 0; @@ -5908,7 +5918,7 @@ static BOOL hb_gt_wvw_bSetMode( WIN_DATA * pWindowData, USHORT row, USHORT col bResult = hb_gt_wvwInitWindow( pWindowData, pWindowData->hWnd, col, row ); DeleteObject( hFont ); - //HB_GTSELF_REFRESH( hb_gt_Base() ); + /* HB_GTSELF_REFRESH( hb_gt_Base() ); */ } } else @@ -6885,10 +6895,10 @@ void hb_gt_wvwDrawOutline( UINT usWinNum, int iTop, int iLeft, int iBottom, int LineTo( pWindowData->hdc, iRight, iBottom + 1 ); } -//BOOL hb_gt_wvw_KeyEvent( message, wParam, lParam ) ; +/* BOOL hb_gt_wvw_KeyEvent( message, wParam, lParam ); */ /*NOTE: are these workable in MULTI_GT ? */ -//static void gtFnInit( PHB_GT_FUNCS gt_funcs ) +/* static void gtFnInit( PHB_GT_FUNCS gt_funcs ) */ static BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable ) { HB_TRACE( HB_TR_DEBUG, ( "hb_gtFnInit( %p )", pFuncTable ) ); @@ -6909,7 +6919,7 @@ static BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable ) pFuncTable->WriteAt = hb_gt_wvw_WriteAt; pFuncTable->PutText = hb_gt_wvw_PutText; pFuncTable->SetAttribute = hb_gt_wvw_SetAttribute; -// pFuncTable->Scroll = hb_gt_wvw_Scroll; +/* pFuncTable->Scroll = hb_gt_wvw_Scroll; */ pFuncTable->SetMode = hb_gt_wvw_SetMode; pFuncTable->GetBlink = hb_gt_wvw_GetBlink; pFuncTable->SetBlink = hb_gt_wvw_SetBlink; @@ -6950,11 +6960,8 @@ static BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable ) #include "hbgtreg.h" -/////////////////////////////////////////////////////////////////////// -// -// GetSet Functions for static Variable -// -/////////////////////////////////////////////////////////////////////// +/* GetSet Functions for static Variable */ + BOOL hb_gt_wvw_GetMainCoordMode( void ) { return s_pWvwData->s_bMainCoordMode; @@ -8411,7 +8418,7 @@ IPicture * rr_LoadPictureFromResource( const char * resname, UINT iresimage, LON HBITMAP hbmpx; IPicture * iPicture = NULL; PICTDESC picd; -// int nSize; +/* int nSize; */ char szResname[ _MAX_PATH + 1 ]; int iWidth, iHeight; @@ -9142,8 +9149,10 @@ LRESULT CALLBACK hb_gt_wvwTBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM return 0; hb_gt_wvwTBMouseEvent( pWindowData, hWnd, message, wParam, lParam ); - //return( 0 ); - //TB_ISBUTTONHIGHLIGHTED +#if 0 + return( 0 ); + TB_ISBUTTONHIGHLIGHTED +#endif case WM_PAINT: { @@ -9574,7 +9583,7 @@ LRESULT CALLBACK hb_gt_wvwXBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM UINT usWinNum; UINT uiXBid; - // byte bStyle; + /* byte bStyle; */ WNDPROC OldProc; if( message == WM_MOUSEACTIVATE ) @@ -9843,8 +9852,10 @@ UINT ButtonCreate( UINT usWinNum, USHORT usTop, USHORT usLeft, USHORT usBottom, AddControlHandle( usWinNum, WVW_CONTROL_PUSHBUTTON, hWndButton, uiPBid, ( PHB_ITEM ) phbiCodeBlock, rXB, rOffXB, ( byte ) iStyle ); - //OldProc = SetWindowLongPtr (hWndButton, - //GWLP_WNDPROC, (LONG_PTR)hb_gt_wvwBtnProc) ; +#if 0 + OldProc = SetWindowLongPtr (hWndButton, + GWLP_WNDPROC, (LONG_PTR)hb_gt_wvwBtnProc) ; +#endif OldProc = SubclassWindow( hWndButton, hb_gt_wvwBtnProc ); StoreControlProc( usWinNum, WVW_CONTROL_PUSHBUTTON, hWndButton, OldProc ); diff --git a/extras/gtwvw/hbgtwvw.h b/extras/gtwvw/hbgtwvw.h index 830b74550a..7f44c86468 100644 --- a/extras/gtwvw/hbgtwvw.h +++ b/extras/gtwvw/hbgtwvw.h @@ -60,7 +60,7 @@ #ifndef HB_WVW_H_ #define HB_WVW_H_ -#define TTS_BALLOON 0x40 // added by MAG +#define TTS_BALLOON 0x40 /* added by MAG */ #ifndef GRADIENT_FILL_RECT_H #define GRADIENT_FILL_RECT_H 0x00000000 @@ -232,7 +232,7 @@ typedef __int64 LONG_PTR; */ #define WVW_TB_LABELMAXLENGTH 100 -//#define WVW_WHICH_WINDOW ( HB_ISNIL( 1 ) ? ( s_bMainCoordMode ? s_usNumWindows-1 : s_usCurWindow ) : ((UINT) hb_parni( 1 )) ) +/* #define WVW_WHICH_WINDOW ( HB_ISNIL( 1 ) ? ( s_bMainCoordMode ? s_usNumWindows-1 : s_usCurWindow ) : ((UINT) hb_parni( 1 )) ) */ #define WVW_WHICH_WINDOW ( HB_ISNIL( 1 ) ? ( hb_gt_wvw_GetMainCoordMode() ? ( ( hb_gt_wvw_GetNumWindows() ) - 1 ) : hb_gt_wvw_GetCurWindow() ) : ( ( UINT ) hb_parni( 1 ) ) ) #define BLACK RGB( 0x0, 0x0, 0x0 ) @@ -561,7 +561,7 @@ typedef struct wvw_data int s_byDefLineSpacing; /* default line spacing */ - int s_iDefLSpaceColor; /* if >; //= 0 this will be the color index for spacing between lines */ + int s_iDefLSpaceColor; /* if >= 0 this will be the color index for spacing between lines */ BOOL s_bAllowNonTop; /* allow non-topmost window's control to accept input */ @@ -609,9 +609,11 @@ typedef struct wvw_data }WVW_DATA; -//#define HB_RETHANDLE( h ) hb_retptr( ( void * ) ( h ) ) -//#define HB_PARHANDLE( n ) hb_parptr( n ) -//#define HB_STOREHANDLE( h, n ) hb_storptr( ( void * ) ( h ), n ) +#if 0 +#define HB_RETHANDLE( h ) hb_retptr( ( void * ) ( h ) ) +#define HB_PARHANDLE( n ) hb_parptr( n ) +#define HB_STOREHANDLE( h, n ) hb_storptr( ( void * ) ( h ), n ) +#endif #define HB_RETHANDLE( h ) hb_retnl( ( LONG ) ( h ) ) #define HB_PARHANDLE( n ) ( ( LONG ) hb_parnl( n ) ) #define HB_STOREHANDLE( h, n ) hb_stornl( ( LONG ) ( h ), n ) diff --git a/extras/gtwvw/wvwcheck.c b/extras/gtwvw/wvwcheck.c index e358ff5b62..4dfdf50a1b 100644 --- a/extras/gtwvw/wvwcheck.c +++ b/extras/gtwvw/wvwcheck.c @@ -120,7 +120,7 @@ HB_FUNC( WVW_CXCREATE ) { UINT usWinNum = WVW_WHICH_WINDOW; int iOffTop, iOffLeft, iOffBottom, iOffRight; - // int iStyle; + /* int iStyle; */ UINT uiPBid; USHORT usTop = ( BYTE ) hb_parni( 2 ), usLeft = ( BYTE ) hb_parni( 3 ), diff --git a/extras/gtwvw/wvwdraw.c b/extras/gtwvw/wvwdraw.c index fd7a959837..08937c3284 100644 --- a/extras/gtwvw/wvwdraw.c +++ b/extras/gtwvw/wvwdraw.c @@ -1396,8 +1396,10 @@ HB_FUNC( WVW_DRAWIMAGE_RESOURCE ) else pPic = rr_LoadPictureFromResource( NULL, hb_parni( 6 ), &lImgWidth, &lImgHeight ); -// lImgWidth = iImgWidth; -// lImgHeight = iImgHeight; +#if 0 + lImgWidth = iImgWidth; + lImgHeight = iImgHeight; +#endif if( pPic == NULL ) hb_retl( bResult ); @@ -1564,7 +1566,7 @@ HB_FUNC( WVW_DRAWOUTLINE ) hOldPen = ( HPEN ) SelectObject( pWindowData->hdc, hPen ); } else - //hPen = 0; + /* hPen = 0; */ SelectObject( pWindowData->hdc, s_sApp->penBlack ); hb_gt_wvwDrawOutline( usWinNum, iTop, iLeft, iBottom, iRight ); @@ -1803,7 +1805,7 @@ HB_FUNC( WVW_DRAWRECTANGLE ) usLeft = ( USHORT ) hb_parni( 3 ), usBottom = ( USHORT ) hb_parni( 4 ), usRight = ( USHORT ) hb_parni( 5 ); - // Ref.: 28454 - Marson de Paula - 2007-11-27 + /* Ref.: 28454 - Marson de Paula - 2007-11-27 */ BOOL bUsaCurrentPen = HB_ISNIL( 7 ) ? TRUE : hb_parl( 7 ); iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; @@ -1826,7 +1828,7 @@ HB_FUNC( WVW_DRAWRECTANGLE ) iRight = xy.x - 1 + iOffRight; SelectObject( pWindowData->hdc, s_sApp->currentBrush ); - // Ref.: 28454 - Marson de Paula - 2007-11-27 + /* Ref.: 28454 - Marson de Paula - 2007-11-27 */ if( bUsaCurrentPen ) SelectObject( pWindowData->hdc, s_sApp->currentPen ); else diff --git a/extras/gtwvw/wvwedit.c b/extras/gtwvw/wvwedit.c index 8156ad166c..5b767dea72 100644 --- a/extras/gtwvw/wvwedit.c +++ b/extras/gtwvw/wvwedit.c @@ -210,7 +210,7 @@ HB_FUNC( WVW_EBCREATE ) { RECT rXB = { 0 }, rOffXB = { 0 }; WNDPROC OldProc; - //USHORT i; + /* USHORT i; */ BOOL bFromOEM = ( pWindowData->CodePage == OEM_CHARSET ); if( bFromOEM ) @@ -668,7 +668,7 @@ HB_FUNC( WVW_EBSETSEL ) ); hb_retl( TRUE ); } -//Static controls +/* Static controls */ HB_FUNC( WVW_STCREATE ) { @@ -678,8 +678,10 @@ HB_FUNC( WVW_STCREATE ) WVW_DATA * pData = hb_getWvwData(); HWND hWndParent = pWindowData->hWnd; HWND hWndCB; - //RECT r; -// HDC hDc; +#if 0 + RECT r; + HDC hDc; +#endif POINT xy = { 0 }; int iTop, iLeft, iBottom, iRight; @@ -693,7 +695,7 @@ HB_FUNC( WVW_STCREATE ) usLeft = ( USHORT ) hb_parni( 3 ), usBottom = HB_ISNUM( 11 ) ? ( USHORT ) hb_parni( 11 ) : usTop, usRight = HB_ISNUM( 12 ) ? ( USHORT ) hb_parni( 12 ) : usLeft + usWidth - 1; - //char * sText = hb_parc( 5 ); + /* char * sText = hb_parc( 5 ); */ int iStyle = ( bBorder ? WS_BORDER : 0 ); @@ -779,7 +781,6 @@ HB_FUNC( WVW_STCREATE ) HB_FUNC( WVW_STSETTEXT ) { -// byte bStyle; HWND hWndCB = ( HWND ) HB_PARHANDLE( 2 ); if( hWndCB ) diff --git a/extras/gtwvw/wvwfuncs.c b/extras/gtwvw/wvwfuncs.c index 8cd353ecc8..0f3a5ca0ee 100644 --- a/extras/gtwvw/wvwfuncs.c +++ b/extras/gtwvw/wvwfuncs.c @@ -391,17 +391,13 @@ HB_FUNC( WIN_DRAWTEXT ) } -/////////////////////////////////////////////////////////////////// -// // -// Adiciones a GtWVW desarrolladas por SOLUCIONES PERCEPTIVAS... // -// // -/////////////////////////////////////////////////////////////////// +/* Adiciones a GtWVW desarrolladas por SOLUCIONES PERCEPTIVAS... */ HB_FUNC( WVW_GBCREATE ) { UINT usWinNum = WVW_WHICH_WINDOW; int iOffTop, iOffLeft, iOffBottom, iOffRight; - // int iStyle; + /* int iStyle; */ UINT uiPBid; USHORT usTop = ( USHORT ) hb_parni( 2 ), usLeft = ( USHORT ) hb_parni( 3 ), @@ -426,14 +422,14 @@ HB_FUNC( WVW_GBCREATE ) hb_retnl( ( LONG ) uiPBid ); } -// BS_TEXT | BS_GROUPBOX | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE -// BS_GROUPBOX | WS_GROUP | BS_TEXT | WS_OVERLAPPED +/* BS_TEXT | BS_GROUPBOX | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE + BS_GROUPBOX | WS_GROUP | BS_TEXT | WS_OVERLAPPED */ HB_FUNC( WVW_RBCREATE ) { UINT usWinNum = WVW_WHICH_WINDOW; int iOffTop, iOffLeft, iOffBottom, iOffRight; - // int iStyle; + /* int iStyle; */ UINT uiPBid; USHORT usTop = ( USHORT ) hb_parni( 2 ), usLeft = ( USHORT ) hb_parni( 3 ), @@ -603,11 +599,11 @@ HB_FUNC( SENDMESSAGE ) { hb_retnl( ( LONG ) SendMessage( - ( HWND ) HB_PARHANDLE( 1 ), // handle of destination window - ( UINT ) hb_parni( 2 ), // message to send - ( WPARAM ) hb_parnl( 3 ), // first message parameter + ( HWND ) HB_PARHANDLE( 1 ), /* handle of destination window */ + ( UINT ) hb_parni( 2 ), /* message to send */ + ( WPARAM ) hb_parnl( 3 ), /* first message parameter */ ( HB_ISCHAR( 4 ) ) ? ( LPARAM ) hb_parc( 4 ) : - ( LPARAM ) hb_parnl( 4 ) // second message parameter + ( LPARAM ) hb_parnl( 4 ) /* second message parameter */ ) ); } @@ -629,9 +625,11 @@ HB_FUNC( BRINGTOTOP1 ) { HWND hWnd = ( HWND ) HB_PARHANDLE( 1 ); -// DWORD ForegroundThreadID; -//DWORD ThisThreadID; -//DWORD timeout; +#if 0 +DWORD ForegroundThreadID; +DWORD ThisThreadID; +DWORD timeout; +#endif if( IsIconic( hWnd ) ) { @@ -639,7 +637,7 @@ HB_FUNC( BRINGTOTOP1 ) hb_retl( TRUE ); return; } - BringWindowToTop( hWnd ); // IE 5.5 related hack + BringWindowToTop( hWnd ); /* IE 5.5 related hack */ SetForegroundWindow( hWnd ); } @@ -649,9 +647,9 @@ HB_FUNC( ISWINDOW ) } -HB_FUNC( ADDTOOLTIPEX ) // changed by MAG +HB_FUNC( ADDTOOLTIPEX ) /* changed by MAG */ { -// HWND hWnd = ( HWND ) hb_parnl( 1 ); +/* HWND hWnd = ( HWND ) hb_parnl( 1 ); */ UINT usWinNum = WVW_WHICH_WINDOW; WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum ); WVW_DATA * pData = hb_getWvwData(); @@ -669,10 +667,12 @@ HB_FUNC( ADDTOOLTIPEX ) // changed by MAG { } -// if( lToolTipBalloon ) -// { - iStyle = iStyle | TTS_BALLOON; -// } +#if 0 + if( lToolTipBalloon ) + { + iStyle = iStyle | TTS_BALLOON; + } +#endif if( ! pData->hWndTT ) pData->hWndTT = CreateWindow( TOOLTIPS_CLASS, ( LPSTR ) NULL, iStyle, @@ -686,7 +686,7 @@ HB_FUNC( ADDTOOLTIPEX ) // changed by MAG ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; ti.hwnd = pWindowData->hWnd; ti.uId = ( UINT ) hb_parnl( 2 ); -// ti.uId = ( UINT ) GetDlgItem( hWnd, hb_parni( 2 ) ); +/* ti.uId = ( UINT ) GetDlgItem( hWnd, hb_parni( 2 ) ); */ ti.hinst = GetModuleHandle( NULL ); ti.lpszText = ( LPSTR ) hb_parc( 3 ); @@ -761,22 +761,22 @@ HB_FUNC( LOADIMAGE ) { if( HB_ISNUM( 2 ) ) hb_retnl( ( LONG ) - LoadImage( hb_getWvwData()->hInstance, //HB_ISNIL( 1 ) ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl( 1 ), // handle of the instance that contains the image - ( LPCTSTR ) MAKEINTRESOURCE( hb_parnl( 2 ) ), // name or identifier of image - ( UINT ) hb_parni( 3 ), // type of image - hb_parni( 4 ), // desired width - hb_parni( 5 ), // desired height - ( UINT ) hb_parni( 6 ) // load flags + LoadImage( hb_getWvwData()->hInstance, /* HB_ISNIL( 1 ) ? GetModuleHandle(NULL) : (HINSTANCE) hb_parnl( 1 ), handle of the instance that contains the image */ + ( LPCTSTR ) MAKEINTRESOURCE( hb_parnl( 2 ) ), /* name or identifier of image */ + ( UINT ) hb_parni( 3 ), /* type of image */ + hb_parni( 4 ), /* desired width */ + hb_parni( 5 ), /* desired height */ + ( UINT ) hb_parni( 6 ) /* load flags */ ) ); else HB_RETHANDLE( - LoadImage( ( HINSTANCE ) hb_parnl( 1 ), // handle of the instance that contains the image - ( LPCTSTR ) hb_parc( 2 ), // name or identifier of image - ( UINT ) hb_parni( 3 ), // type of image - hb_parni( 4 ), // desired width - hb_parni( 5 ), // desired height - ( UINT ) hb_parni( 6 ) // load flags + LoadImage( ( HINSTANCE ) hb_parnl( 1 ), /* handle of the instance that contains the image */ + ( LPCTSTR ) hb_parc( 2 ), /* name or identifier of image */ + ( UINT ) hb_parni( 3 ), /* type of image */ + hb_parni( 4 ), /* desired width */ + hb_parni( 5 ), /* desired height */ + ( UINT ) hb_parni( 6 ) /* load flags */ ) ); } @@ -786,7 +786,7 @@ HB_FUNC( LOADBITMAP ) if( HB_ISNUM( 1 ) ) { if( ! HB_ISNIL( 2 ) && hb_parl( 2 ) ) -// hb_retnl( (LONG) LoadBitmap( GetModuleHandle( NULL ), MAKEINTRESOURCE(hb_parnl( 1 ) )) ); +/* hb_retnl( (LONG) LoadBitmap( GetModuleHandle( NULL ), MAKEINTRESOURCE(hb_parnl( 1 ) )) ); */ HB_RETHANDLE( LoadBitmap( NULL, ( LPCTSTR ) hb_parnl( 1 ) ) ); else HB_RETHANDLE( LoadBitmap( GetModuleHandle( NULL ), ( LPCTSTR ) hb_parnl( 1 ) ) ); @@ -802,7 +802,7 @@ HB_FUNC( LOADBITMAPEX ) if( HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) { if( ! HB_ISNIL( 3 ) && hb_parl( 3 ) ) -// hb_retnl( (LONG) LoadBitmap( h, MAKEINTRESOURCE(hb_parnl( 2 ) )) ); +/* hb_retnl( (LONG) LoadBitmap( h, MAKEINTRESOURCE(hb_parnl( 2 ) )) ); */ HB_RETHANDLE( LoadBitmap( h, ( LPCTSTR ) hb_parnl( 3 ) ) ); else HB_RETHANDLE( LoadBitmap( ( HINSTANCE ) h, ( LPCTSTR ) hb_parnl( 2 ) ) ); @@ -818,7 +818,7 @@ HB_FUNC( OPENIMAGE ) BOOL lString = HB_ISNIL( 2 ) ? 0 : hb_parl( 2 ); int iFileSize; FILE * fp; - // IPicture * pPic; + /* IPicture * pPic; */ LPPICTURE pPic; IStream * pStream; HGLOBAL hG; @@ -867,13 +867,15 @@ HB_FUNC( OPENIMAGE ) return; } -//#if defined(__cplusplus) -//OleLoadPicture( pStream,0,0,&IID_IPicture,(void**)&pPic ); -//pStream->Release(); -//#else - OleLoadPicture( pStream, 0, 0, &IID_IPicture, ( void ** ) &pPic ); - pStream->lpVtbl->Release( pStream ); -//#endif +#if 0 +#if defined(__cplusplus) +OleLoadPicture( pStream,0,0,&IID_IPicture,(void**)&pPic ); +pStream->Release(); +#else + OleLoadPicture( pStream, 0, 0, &IID_IPicture, ( void ** ) &pPic ); + pStream->lpVtbl->Release( pStream ); +#endif +#endif GlobalFree( hG ); @@ -883,19 +885,23 @@ HB_FUNC( OPENIMAGE ) return; } -//#if defined(__cplusplus) -//pPic->get_Handle( (OLE_HANDLE*)&hBitmap ); -//#else - pPic->lpVtbl->get_Handle( pPic, ( OLE_HANDLE * ) &hBitmap ); -//#endif +#if 0 +#if defined(__cplusplus) +pPic->get_Handle( (OLE_HANDLE*)&hBitmap ); +#else + pPic->lpVtbl->get_Handle( pPic, ( OLE_HANDLE * ) &hBitmap ); +#endif +#endif hb_retnl( ( LONG ) CopyImage( hBitmap, IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG ) ); -//#if defined(__cplusplus) -//pPic->Release(); -//#else - pPic->lpVtbl->Release( pPic ); -//#endif +#if 0 +#if defined(__cplusplus) +pPic->Release(); +#else + pPic->lpVtbl->Release( pPic ); +#endif +#endif } HB_FUNC( OPENBITMAP ) @@ -999,8 +1005,8 @@ HB_FUNC( OPENBITMAP ) HB_FUNC( SETTEXTCOLOR ) { COLORREF crColor = SetTextColor( - ( HDC ) HB_PARHANDLE( 1 ), // handle of device context - ( COLORREF ) hb_parnl( 2 ) // text color + ( HDC ) HB_PARHANDLE( 1 ), /* handle of device context */ + ( COLORREF ) hb_parnl( 2 ) /* text color */ ); hb_retnl( ( LONG ) crColor ); @@ -1009,8 +1015,8 @@ HB_FUNC( SETTEXTCOLOR ) HB_FUNC( SETBKCOLOR ) { COLORREF crColor = SetBkColor( - ( HDC ) HB_PARHANDLE( 1 ), // handle of device context - ( COLORREF ) hb_parnl( 2 ) // text color + ( HDC ) HB_PARHANDLE( 1 ), /* handle of device context */ + ( COLORREF ) hb_parnl( 2 ) /* text color */ ); hb_retnl( ( LONG ) crColor ); @@ -1019,7 +1025,7 @@ HB_FUNC( SETBKCOLOR ) HB_FUNC( CREATESOLIDBRUSH ) { HB_RETHANDLE( CreateSolidBrush( - ( COLORREF ) hb_parnl( 1 ) // brush color + ( COLORREF ) hb_parnl( 1 ) /* brush color */ ) ); } @@ -1041,10 +1047,10 @@ HB_FUNC( GETSYSCOLOR ) HB_FUNC( REDRAWWINDOW ) { RedrawWindow( - ( HWND ) HB_PARHANDLE( 1 ), // handle of window - NULL, // address of structure with update rectangle - NULL, // handle of update region - ( UINT ) hb_parni( 2 ) // array of redraw flags + ( HWND ) HB_PARHANDLE( 1 ), /* handle of window */ + NULL, /* address of structure with update rectangle */ + NULL, /* handle of update region */ + ( UINT ) hb_parni( 2 ) /* array of redraw flags */ ); } @@ -1061,20 +1067,20 @@ HB_FUNC( CREATEFONT ) DWORD fdwStrikeOut = HB_ISNIL( 8 ) ? 0 : hb_parnl( 8 ); hFont = CreateFont( - hb_parni( 3 ), // logical height of font - hb_parni( 2 ), // logical average character width - 0, // angle of escapement - 0, // base-line orientation angle - fnWeight, // font weight - fdwItalic, // italic attribute flag - fdwUnderline, // underline attribute flag - fdwStrikeOut, // strikeout attribute flag - fdwCharSet, // character set identifier - 0, // output precision - 0, // clipping precision - 0, // output quality - 0, // pitch and family - ( LPCTSTR ) hb_parc( 1 ) // pointer to typeface name string + hb_parni( 3 ), /* logical height of font */ + hb_parni( 2 ), /* logical average character width */ + 0, /* angle of escapement */ + 0, /* base-line orientation angle */ + fnWeight, /* font weight */ + fdwItalic, /* italic attribute flag */ + fdwUnderline, /* underline attribute flag */ + fdwStrikeOut, /* strikeout attribute flag */ + fdwCharSet, /* character set identifier */ + 0, /* output precision */ + 0, /* clipping precision */ + 0, /* output quality */ + 0, /* pitch and family */ + ( LPCTSTR ) hb_parc( 1 ) /* pointer to typeface name string */ ); HB_RETHANDLE( hFont ); } @@ -1087,7 +1093,7 @@ HB_FUNC( SELECTFONT ) LOGFONT lf; HFONT hfont; PHB_ITEM pObj = HB_ISNIL( 1 ) ? NULL : hb_param( 1, HB_IT_OBJECT ); - //PHB_ITEM temp1; + /* PHB_ITEM temp1; */ PHB_ITEM aMetr = hb_itemArrayNew( 9 ); cf.lStructSize = sizeof( CHOOSEFONT ); @@ -1149,9 +1155,9 @@ HB_FUNC( INVALIDATERECT ) } InvalidateRect( - ( HWND ) HB_PARHANDLE( 1 ), // handle of window with changed update region - ( hb_pcount() > 2 ) ? &rc : NULL, // address of rectangle coordinates - hb_parni( 2 ) // erase-background flag + ( HWND ) HB_PARHANDLE( 1 ), /* handle of window with changed update region */ + ( hb_pcount() > 2 ) ? &rc : NULL, /* address of rectangle coordinates */ + hb_parni( 2 ) /* erase-background flag */ ); } @@ -1167,7 +1173,7 @@ HB_FUNC( TOOLBARADDBUTTONS ) int iButtons = hb_parni( 4 ); TBBUTTON * tb = ( struct _TBBUTTON * ) hb_xgrab( iButtons * sizeof( TBBUTTON ) ); PHB_ITEM pTemp; - //BOOL bSystem; + /* BOOL bSystem; */ ULONG ulCount; ULONG ulID; @@ -1183,17 +1189,19 @@ HB_FUNC( TOOLBARADDBUTTONS ) pTemp = hb_arrayGetItemPtr( pArray, ulCount + 1 ); ulID = hb_arrayGetNI( pTemp, 1 ); - //bSystem = hb_arrayGetL( pTemp, 9 ); + /* bSystem = hb_arrayGetL( pTemp, 9 ); */ -// if (bSystem) -// if (ulID > 0 && ulID < 31 ) -// { - tb[ ulCount ].iBitmap = ulID > 0 ? ( int ) ulID : -1; -// } -// else -// { -// tb[ ulCount ].iBitmap = ulID > 0 ? ( int ) ulCount : -1; -// } +#if 0 + if (bSystem) + if (ulID > 0 && ulID < 31 ) + { + tb[ ulCount ].iBitmap = ulID > 0 ? ( int ) ulID : -1; + } + else + { + tb[ ulCount ].iBitmap = ulID > 0 ? ( int ) ulCount : -1; + } +#endif tb[ ulCount ].idCommand = hb_arrayGetNI( pTemp, 2 ); tb[ ulCount ].fsState = ( BYTE ) hb_arrayGetNI( pTemp, 3 ); tb[ ulCount ].fsStyle = ( BYTE ) hb_arrayGetNI( pTemp, 4 ); @@ -1826,7 +1834,7 @@ HB_FUNC( WVW_FILLRECTANGLE ) iBottom = xy.y - 1; iRight = xy.x - 1; - // Aplica OffSet + /* Aplica OffSet */ iTop += iOffTop; iLeft += iOffLeft; iBottom += iOffBottom; diff --git a/extras/gtwvw/wvwmenu.c b/extras/gtwvw/wvwmenu.c index afc339f406..79506eeb49 100644 --- a/extras/gtwvw/wvwmenu.c +++ b/extras/gtwvw/wvwmenu.c @@ -202,13 +202,14 @@ HB_FUNC( WVW_SETMENUKEYEVENT ) hb_retni( hb_gt_wvwSetMenuKeyEvent( usWinNum, iEvent ) ); } -// WVW_MENUITEM_SETBITMAPS( -// hMenu, -// nIDEnableItem, -// nPosition, -// ncBitmapUnchecked, -// ncBimapChecked ) -// +#if 0 + WVW_MENUITEM_SETBITMAPS( + hMenu, + nIDEnableItem, + nPosition, + ncBitmapUnchecked, + ncBimapChecked ) +#endif HB_FUNC( WVW_MENUITEM_SETBITMAPS ) { HBITMAP hBitmapUnchecked = NULL; diff --git a/extras/gtwvw/wvwpush.c b/extras/gtwvw/wvwpush.c index 24fd56e846..f467c7bb86 100644 --- a/extras/gtwvw/wvwpush.c +++ b/extras/gtwvw/wvwpush.c @@ -119,7 +119,7 @@ HB_FUNC( WVW_PBCREATE ) { UINT usWinNum = WVW_WHICH_WINDOW; int iOffTop, iOffLeft, iOffBottom, iOffRight; - // int iStyle; + /* int iStyle; */ UINT uiPBid; USHORT usTop = ( USHORT ) hb_parni( 2 ), usLeft = ( USHORT ) hb_parni( 3 ), @@ -433,11 +433,11 @@ HB_FUNC( WVW_CBCREATE ) HWND hWndParent = pWindowData->hWnd; HWND hWndCB; WVW_DATA * pData = hb_getWvwData(); -// LONG cnt; +/* LONG cnt; */ LONG numofchars; LONG avgwidth; LONG LongComboWidth, NewLongComboWidth; -// RECT r; +/* RECT r; */ HFONT hFont = hb_gt_wvwGetFont( pWindowData->fontFace, 10, pWindowData->fontWidth, pWindowData->fontWeight, pWindowData->fontQuality, pWindowData->CodePage ); POINT xy = { 0 }; @@ -578,7 +578,7 @@ HB_FUNC( WVW_CBCREATE ) SendMessage( ( HWND ) hWndCB, CB_SETDROPPEDWIDTH, - ( WPARAM ) NewLongComboWidth + 100, //LongComboWidth+100 + ( WPARAM ) NewLongComboWidth + 100, /* LongComboWidth+100 */ ( LPARAM ) 0 ); diff --git a/extras/gtwvw/wvwtbar.c b/extras/gtwvw/wvwtbar.c index ae60d68b65..759a9d0095 100644 --- a/extras/gtwvw/wvwtbar.c +++ b/extras/gtwvw/wvwtbar.c @@ -88,7 +88,7 @@ HB_FUNC( WVW_TBCREATE ) HWND hWndParent = pWindowData->hWnd; HWND hWndTB; int iMaxTextRows = ( int ) ( HB_ISNIL( 2 ) ? 0 : ( hb_parl( 2 ) ? 1 : 0 ) ); -// DWORD dwStyle = (DWORD) ( HB_ISNIL( 3 ) ? TBSTYLE_FLAT | TBSTYLE_TOOLTIPS : hb_parni( 3 ) ); +/* DWORD dwStyle = (DWORD) ( HB_ISNIL( 3 ) ? TBSTYLE_FLAT | TBSTYLE_TOOLTIPS : hb_parni( 3 ) ); */ DWORD dwStyle = ( DWORD ) ( HB_ISNIL( 3 ) ? TBSTYLE_ALTDRAG | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | TBSTYLE_TRANSPARENT | TBSTYLE_WRAPABLE : hb_parnl( 3 ) ); int iSystemBitmap = ( int ) ( HB_ISNIL( 4 ) ? 1 : hb_parni( 4 ) ); diff --git a/src/pp/ppcore.c b/src/pp/ppcore.c index f191f24bcc..269a11ec94 100644 --- a/src/pp/ppcore.c +++ b/src/pp/ppcore.c @@ -959,7 +959,7 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) * will break code like: */ #if 0 - // if /**/lVar; endif + "// if /**/lVar; endif" /* enclosed in double-quotes to make commit checker happy */ #endif pState->nSpacesMin = 1; ++n; diff --git a/src/rtl/gttrm/gttrm.c b/src/rtl/gttrm/gttrm.c index 375ee4975f..1f7b8121fa 100644 --- a/src/rtl/gttrm/gttrm.c +++ b/src/rtl/gttrm/gttrm.c @@ -1493,7 +1493,7 @@ again: } else if( nKey >= 32 && nKey <= 255 ) { - //hb_cdpUTF8ToU16NextChar( HB_UCHAR ucChar, int * n, HB_WCHAR * pwc ) + /* hb_cdpUTF8ToU16NextChar( HB_UCHAR ucChar, int * n, HB_WCHAR * pwc ) */ HB_WCHAR wc = 0; n = i = 0; if( hb_cdpUTF8ToU16NextChar( ( HB_UCHAR ) nKey, &n, &wc ) ) diff --git a/utils/hbmk2/hbmk2.hbp b/utils/hbmk2/hbmk2.hbp index 9e26fb60f7..ce034e648a 100644 --- a/utils/hbmk2/hbmk2.hbp +++ b/utils/hbmk2/hbmk2.hbp @@ -31,7 +31,7 @@ po/hbmk2.%{hb_lng}.po -hbl=hbmk2.%{hb_lng}.hbl -lng=el,es,es_419,fr,gl,hu,it,pt_BR -# localization (automatization) +# localization (for automatization with config/lang.hb) -3rd=_langhb_docext=.md -3rd=_langhb_docoption=-lang={LNG} -3rd=_langhb_docoption=-longhelpmd