Here is a brief progress report on HN v5 development for the month of January 2023.
The aim is to get the Chart demo project running inside HN5 Creator IDE.
The development is being carried out on a Windows 7 x64 machine building for x32.
Note, x64 builds work just as well as x32 ones.
The development language is Free Pascal which should ensure HN5 will be able to run on a variety of older and newer Operating Systems.
The main targets being Windows, MacOS + OS X, and then Linux.
HN5 CREATORRuntime EngineMore progress made on the graphics for drawing to canvases.
Commands for drawing rectangles, empty and filled, circles etc are now working.
The first screen shot below relates to running the Chart project's button 'DrawChart' script.
The axis shows clearly but no bars are drawn because the Chart's HN script DrawBars needs debugging.
Runtime shows result of pressing the DrawChart button:
http://www.tigabyte.com/Screenshots/01-2023/DrawChart_Graphics_w7_x32.jpg Editor showing some of the DrawBars script:
http://www.tigabyte.com/Screenshots/01-2023/Editor_DrawBars_script.jpg @ Draws bars and finds axis limits for DrawLabels subroutine.
Global redPen,greenPen,bluePen
Global xBase,yBase,yTop,cWidth,cHeight
Global xaMax,yaMax
Local n,x,y,num,h
Local ylist,xlist,yscale,xscale,ymax,xmax
Local ynlines,xnlines
@ *** Find x scale ***
Put field 1 into xlist
Put LinesFN(xlist) into xnlines
If xnlines=0 Then
Put 1 into xscale
Else
Put 0 into xmax
For n=1 to xnlines
Put line n of xlist into num
If num>xmax Then
Put num into xmax
EndIf
EndFor
If xmax=0 Then
Put 1 into xscale
Else
Put cWidth into xscale
Subtract 20 from xscale
Subtract xBase from xscale
Divide xscale by xmax
EndIf
EndIf
Put xmax into xaMax
@ *** Find y scale ***
Put field 2 into ylist
Put LinesFN(ylist) into ynlines
If ynlines=0 Then
Put 1 into yscale
Else
Put 0 into ymax
For n=1 to ynlines
Put line n of ylist into num
If num>ymax Then
Put num into ymax
EndIf
EndFor
If ymax=0 Then
Put 1 into yscale
Else
Put yBase into yscale
Subtract yTop from yscale
Divide yscale by ymax
EndIf
EndIf
Put ymax into yaMax
@ *** Draw Bars ***
If xnlines>0 Then
CanvasSetColor 1,redPen,greenPen,bluePen
For n=1 to xnlines
@ X
Put line n of xlist into x
Multiply x by xscale
Add xBase to x
@ Y
Put line n of ylist into h
Multiply h by yscale
Put yBase into y
Subtract h from y
@ Draw bar
CanvasFillRect 1,x,y,10,h
EndFor
EndIf
February 2023Work will again be focused on the graphics engine with the aim of displaying the Chart's graph.