diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 81816560b6..f7c59d9e5b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,10 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2002-09-02 16:58 UTC+0200 Maurilio Longo + * harbour/source/rtl/tbrowse.prg + ! fixed columns' width calulation on ::SetColumnWidth( oCol ) method + 2002-08-30 11:20 UTC-0300 Luiz Rafael Culik * source/rtl/tget.prg ! fix for DeleteAll() method when Variable is Date type Reported by Charles Kwon @@ -68,7 +72,7 @@ * contrib/odbc/odbc.c + Added SQLConnect function * contrib/odbc/todbc.prg - + Method new() now accepts additional parameters username and password. + + Method new() now accepts additional parameters username and password. If TODBC:new() is called with username and password, it uses SQLConnect insted of SQLDriverConnect to establish ODBC conenction. @@ -110,24 +114,24 @@ 2002-08-05 09:33 UTC+0100 Dave Pearson * source/compiler/genc.c * Corrected misspelling of "Alpha". - + 2002-08-03 22:50 UTC+0100 Tomaz Zupan * contrib/odbc/odbc.c - contrib/odbc/todbc.prg + contrib/odbc/todbc.prg * Added bof(), reccount(), lastrec() and recno() functionality to ODBC library. * contrib/odbc/browodbc.prg - * enabled statusline + * enabled statusline 2002-08-02 12:35 UTC-0400 David G. Holm * doc/howtobsd.txt - * Changed BSD reference in heading to FreeBSD. - * Removed reference to specific FreeBSD version number. + * Changed BSD reference in heading to FreeBSD. + * Removed reference to specific FreeBSD version number. 2002-08-02 12:05 UTC-0400 David G. Holm * source/rtl/set.c - ! When encountering SET ALTERNATE TO, close the file. - ! When encountering SET(_SET_EXTRAFILE,NIL), close the file. + ! When encountering SET ALTERNATE TO, close the file. + ! When encountering SET(_SET_EXTRAFILE,NIL), close the file. 2002-07-25 13:42 UTC+0100 Ignacio Ortiz * source/pp/ppcore.c @@ -151,8 +155,8 @@ 2002-07-19 15:45 UTC-0400 David G. Holm * source/rtl/gtwin/gtwin.c - ! Don't test for dead keys when dealing with international characters - that have a negative character value. + ! Don't test for dead keys when dealing with international characters + that have a negative character value. 2002-07-17 12:34 UTC-0300 Walter Negro * include/hbmath.h @@ -316,9 +320,9 @@ 2002-07-11 14:30 UTC-0400 David G. Holm * config/dos/djgpp.cf - + Added the -lm option to LDFLAGS to enable math error handling. + + Added the -lm option to LDFLAGS to enable math error handling. * source/rtl/gtwin/gtwin.c - ! Shift Tab is now properly reported as 271. + ! Shift Tab is now properly reported as 271. 2002-07-11 02:30 UTC-0300 Walter Negro * source/vm/itemapi.c @@ -1914,8 +1918,8 @@ the use of third-party (Apollo) include files. 2002-02-27 01:27 UTC+0100 Maurilio Longo - * harbour/source/rtl/tbrowse.prg - ! fixed columns' width calc (quick and not very much tested) + * harbour/source/rtl/tbrowse.prg + ! fixed columns' width calc (quick and not very much tested) 2002-02-26 21:50 UTC+0100 Tomaz Zupan * include/hbapi.h diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index cc2eeaab3e..ce1b1e4d01 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -268,7 +268,7 @@ METHOD New(nTop, nLeft, nBottom, nRight) CLASS TBrowse ::nRow := 0 ::nCol := 0 ::aSetStyle := ARRAY( 4096 ) - + ::aSetStyle[ TBR_APPEND ] := .f. ::aSetStyle[ TBR_APPENDING ] := .f. ::aSetStyle[ TBR_MODIFY ] := .f. @@ -490,12 +490,12 @@ METHOD SetColumnWidth( oCol ) CLASS TBrowse LOCAL xRes, cType, nTokenPos := 0, nL, cHeading LOCAL nWidthMax := ::nRight - ::nLeft +1 // Visible width of TBrowse - LOCAL nWidth := 0,nColWidth:=0,nLen:=0 + LOCAL nWidth := 0, nColWidth := 0, nLen := 0 + - // if oCol has :Width property set I use it - if oCol:Width <> nil //.AND. oCol:Width < (nWidthMax - 4) - nWidth := oCol:Width + if oCol:Width <> nil + nWidth := Min(oCol:Width, nWidthMax - 2) else if ISBLOCK( oCol:block ) @@ -507,18 +507,18 @@ METHOD SetColumnWidth( oCol ) CLASS TBrowse nLen := Len( Str( xRes ) ) case cType == "L" - nLen:=1 + nLen := 1 case cType == "C" nLen := Len( xRes ) case cType == "D" - nLen= len(DToC( xRes ) ) + nLen := Len(DToC( xRes ) ) otherwise nLen := 0 + endcase - cHeading := oCol:Heading + ";" while (nL := Len(__StrTkPtr(@cHeading, @nTokenPos, ";"))) > 0 @@ -526,14 +526,10 @@ METHOD SetColumnWidth( oCol ) CLASS TBrowse enddo endif - if nColWidth>nWidthMax - nColWidth:=nWidthMax - endif - if nlen>nWidthMax - nLen:=nWidthMax - endif - nWidth:= if(nColwidth>nLen,nColwidth,nLen) + nWidth:= Min(iif(nColwidth > nLen, nColwidth, nLen), nWidthMax - 2) + endif + return nWidth @@ -806,7 +802,7 @@ METHOD Hilite() CLASS TBrowse // Put cursor back on first char of cell value SetPos(nRow, nCol) - + #ifdef HB_COMPAT_C53 ::nRow := nRow ::nCol := nCol @@ -818,9 +814,9 @@ return Self METHOD PosCursor() CLASS TBrowse local nRow := ::nTop + ::RowPos + iif(::lHeaders, ::nHeaderHeight, 0) + iif(Empty(::HeadSep), 0, 1) - 1 - local nCol + local nCol local cType := ValType( Eval( ::aColumns[ ::ColPos ]:block ) ) - + nCol := ::aColumns[ ::ColPos ]:ColPos + iif(cType == "L", ::aColsWidth[::ColPos] / 2, 0 ) // Put cursor on first char of cell value @@ -1589,6 +1585,6 @@ METHOD SetStyle( nMode, lSetting ) CLASS TBROWSE IF ISLOGICAL( lSetting ) ::aSetStyle[ nMode ] := lSetting ENDIF - + RETURN lRet #endif