+ website/css/shCore.css
+ website/js
+ website/js/shBrushHarbour.js
+ website/js/shCore.js
+ added components for http://alexgorbatchev.com/SyntaxHighlighter/
a JS based syntax highlighter by Alex Gorbatchev
+ website/css/shThemeDefault.css
+ added Harbour theme (it's based on the php one)
* website/menu/harbour-menu.js
! fixed wrongly displayed bitmaps when used from
under a subdir.
* website/samples/array16.prg.html
* website/samples/arreval.prg.html
* website/samples/begin.prg.html
* website/samples/byref.prg.html
* website/samples/codebl.prg.html
* website/samples/codebloc.prg.html
* website/samples/dates3.prg.html
* website/samples/foreach.prg.html
* website/samples/function.cfm.html
* website/samples/hello.prg.html
* website/samples/initexit.prg.html
* website/samples/longdev.prg.html
* website/samples/mousetst.prg.html
* website/samples/onidle.prg.html
* website/samples/osshell.prg.html
* website/samples/parseini.ini.html
* website/samples/parseini.prg.html
* website/samples/switch.prg.html
* website/samples/testbrdb.prg.html
* website/samples/testbrw.prg.html
* website/samples/testhtml.prg.html
* website/samples/testidle.prg.html
* website/samples/tstmacro.prg.html
+ replaced static syntax highlighting
with new JS based one. Old system
used old HTML standard and old unfixed
copies of tests. See f.e.:
http://harbour-project.sourceforge.net/samples/testbrw.prg.html
In new system the code can be copied
as is from the source to these pages.
(it'd be even better if a directly link could
be used to the source repo on the web)
+ updated all code with fresh copies
from /tests directory
* tests/parseini.prg
* tests/testhtml.prg
* minor cleanups
* website/samples/array16.html
* website/samples/arreval.html
* website/samples/begin.html
* website/samples/byref.html
* website/samples/codebl.html
* website/samples/codebloc.html
* website/samples/dates3.html
* website/samples/foreach.html
* website/samples/hello.html
* website/samples/HowToBuildOnLinux.html
* website/samples/HowToBuildOnWindows.html
* website/samples/initexit.html
* website/samples/longdev.html
* website/samples/mousetst.html
* website/samples/onidle.html
* website/samples/osshell.html
* website/samples/parseini.html
* website/samples/switch.html
* website/samples/testbrdb.html
* website/samples/testbrw.html
* website/samples/testhtml.html
* website/samples/testidle.html
* website/samples/tstmacro.html
+ changed to use absolute paths to refer to
common page elements
165 lines
4.4 KiB
HTML
165 lines
4.4 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/xregexp/2.0.0/xregexp-min.js"></script>
|
|
<script type="text/javascript" src="http://www.xregexp.com/addons/backcompat.js"></script>
|
|
<script type="text/javascript" src="/js/shCore.js"></script>
|
|
<script type="text/javascript" src="/js/shBrushHarbour.js"></script>
|
|
<link href="/css/shCore.css" rel="stylesheet" type="text/css" />
|
|
<link href="/css/shThemeDefault.css" rel="stylesheet" type="text/css" />
|
|
<script type="text/javascript">SyntaxHighlighter.all()</script>
|
|
</head>
|
|
<body>
|
|
|
|
<script type="syntaxhighlighter" class="brush: harbour"><![CDATA[
|
|
|
|
// Harbour Class TBrowse and TBColumn sample
|
|
|
|
#include "inkey.ch"
|
|
|
|
PROCEDURE Main()
|
|
|
|
LOCAL oBrowse := TBrowseNew( 5, 5, 16, 30 )
|
|
LOCAL aTest0 := { "This", "is", "a", "browse", "on", "an", "array", "test", "with", "a", "long", "data" }
|
|
LOCAL aTest1 := { 1, 2, 3, 4, 5, 6, 7, 8, 10000, - 1000, 54, 456342 }
|
|
LOCAL aTest2 := { Date(), Date() + 4, Date() + 56, Date() + 14, Date() + 5, Date() + 6, Date() + 7, Date() + 8, Date() + 10000, Date() - 1000, Date() - 54, Date() + 456342 }
|
|
LOCAL aTest3 := { .T., .F., .T., .T., .F., .F., .T., .F., .T., .T., .F., .F. }
|
|
LOCAL n := 1
|
|
LOCAL nCursor
|
|
LOCAL cColor
|
|
LOCAL nRow, nCol
|
|
#ifndef HB_COMPAT_C53
|
|
LOCAL nKey
|
|
LOCAL nTmpRow, nTmpCol
|
|
LOCAL lEnd := .F.
|
|
#endif
|
|
|
|
oBrowse:colorSpec := "W+/B, N/BG"
|
|
oBrowse:ColSep := hb_UTF8ToStrBox( "│" )
|
|
oBrowse:HeadSep := hb_UTF8ToStrBox( "╤═" )
|
|
oBrowse:FootSep := hb_UTF8ToStrBox( "╧═" )
|
|
oBrowse:GoTopBlock := {|| n := 1 }
|
|
oBrowse:GoBottomBlock := {|| n := Len( aTest0 ) }
|
|
oBrowse:SkipBlock := {| nSkip, nPos | nPos := n, ;
|
|
n := iif( nSkip > 0, Min( Len( aTest0 ), n + nSkip ), ;
|
|
Max( 1, n + nSkip ) ), n - nPos }
|
|
|
|
oBrowse:AddColumn( TBColumnNew( "First", {|| n } ) )
|
|
oBrowse:AddColumn( TBColumnNew( "Second", {|| aTest0[ n ] } ) )
|
|
oBrowse:AddColumn( TBColumnNew( "Third", {|| aTest1[ n ] } ) )
|
|
oBrowse:AddColumn( TBColumnNew( "Forth", {|| aTest2[ n ] } ) )
|
|
oBrowse:AddColumn( TBColumnNew( "Fifth", {|| aTest3[ n ] } ) )
|
|
oBrowse:GetColumn( 1 ):Footing := "Number"
|
|
oBrowse:GetColumn( 2 ):Footing := "String"
|
|
|
|
oBrowse:GetColumn( 2 ):Picture := "@!"
|
|
|
|
oBrowse:GetColumn( 3 ):Footing := "Number"
|
|
oBrowse:GetColumn( 3 ):Picture := "999,999.99"
|
|
oBrowse:GetColumn( 4 ):Footing := "Dates"
|
|
oBrowse:GetColumn( 5 ):Footing := "Logical"
|
|
// needed since I've changed some columns _after_ I've added them to TBrowse object
|
|
oBrowse:Configure()
|
|
|
|
Alert( oBrowse:ClassName() )
|
|
Alert( oBrowse:GetColumn( 1 ):ClassName() )
|
|
|
|
oBrowse:Freeze := 1
|
|
nCursor := SetCursor( 0 )
|
|
cColor := SetColor( "W+/B" )
|
|
nRow := Row()
|
|
nCol := Col()
|
|
hb_DispBox( 4, 4, 17, 31, hb_UTF8ToStrBox( "┌─┐│┘─└│ " ) )
|
|
#ifdef HB_COMPAT_C53
|
|
oBrowse:SetKey( 0, {| ob, nkey | Defproc( ob, nKey ) } )
|
|
WHILE .T.
|
|
oBrowse:ForceStable()
|
|
IF oBrowse:applykey( Inkey( 0 ) ) == -1
|
|
EXIT
|
|
ENDIF
|
|
ENDDO
|
|
#else
|
|
WHILE ! lEnd
|
|
oBrowse:ForceStable()
|
|
|
|
nKey := Inkey( 0 )
|
|
|
|
DO CASE
|
|
CASE nKey == K_ESC
|
|
SetPos( 17, 0 )
|
|
lEnd := .T.
|
|
|
|
CASE nKey == K_DOWN
|
|
oBrowse:Down()
|
|
|
|
CASE nKey == K_UP
|
|
oBrowse:Up()
|
|
|
|
CASE nKey == K_LEFT
|
|
oBrowse:Left()
|
|
|
|
CASE nKey == K_RIGHT
|
|
oBrowse:Right()
|
|
|
|
CASE nKey == K_PGDN
|
|
oBrowse:pageDown()
|
|
|
|
CASE nKey == K_PGUP
|
|
oBrowse:pageUp()
|
|
|
|
CASE nKey == K_CTRL_PGUP
|
|
oBrowse:goTop()
|
|
|
|
CASE nKey == K_CTRL_PGDN
|
|
oBrowse:goBottom()
|
|
|
|
CASE nKey == K_HOME
|
|
oBrowse:home()
|
|
|
|
CASE nKey == K_END
|
|
oBrowse:end()
|
|
|
|
CASE nKey == K_CTRL_LEFT
|
|
oBrowse:panLeft()
|
|
|
|
CASE nKey == K_CTRL_RIGHT
|
|
oBrowse:panRight()
|
|
|
|
CASE nKey == K_CTRL_HOME
|
|
oBrowse:panHome()
|
|
|
|
CASE nKey == K_CTRL_END
|
|
oBrowse:panEnd()
|
|
|
|
CASE nKey == K_TAB
|
|
hb_DispOutAt( 0, 0, Time() )
|
|
|
|
ENDCASE
|
|
|
|
ENDDO
|
|
#endif
|
|
SetPos( nRow, nCol )
|
|
SetColor( cColor )
|
|
SetCursor( nCursor )
|
|
|
|
RETURN
|
|
|
|
#ifdef HB_COMPAT_C53
|
|
|
|
FUNCTION defproc( ob, nkey )
|
|
|
|
IF nKey == K_TAB
|
|
hb_DispOutAt( 0, 0, Time() )
|
|
ob:Refreshall()
|
|
ENDIF
|
|
|
|
RETURN 1
|
|
|
|
#endif
|
|
|
|
]]></script>
|
|
|
|
</body>
|
|
</html>
|