Main Menu

Recent posts

#1
PlanetSquires Software / Tiko Editor v1.3.2 release
Last post by Paul Squires - June 23, 2026, 04:10:50 PM
Version 1.3.2 release: https://github.com/PaulSquires/tiko/releases

Download the "Source code (zip)" file from the Release page (https://github.com/PaulSquires/tiko/releases), or directly via the following link: https://github.com/PaulSquires/tiko/releases/tag/v1.3.2
(the zip file also contains the necessary compiled exe and dll files)

To install, simply unzip to a folder path that does not contain spaces. To uninstall, delete the folder. Tiko does not install any additional files elsewhere in your system nor does it store information in the Windows Registry.

It is safe to copy the files from this version release over your previous v1.3.1 release because the download does not contain a settings.ini or keybindings.ini file that would overwrite your existing files.

Version 1.3.2 (June 23, 2026)
- Added:   Additional "Extra Keywords" for syntax highlighting. These are stored in \settings\keywords\extra_keywords.txt and can be edited directly using "Environment Options / Extra Keywords". The light and dark Theme files have been modified with new "pink" color for the keywords.
- Added:   English, French, German, and Spanish localization "#00439 Extra Keywords" added.
- Added:   Ability to specify the "Bookmark", "Breakpoint", and "DebugLine" editor icon colors via the theme files.
- Added:   "Find" icon and "Save All" icon to the left panel top menu.
- Changed: The left panel "Start Debugging" icon has been changed.
#2
José Roca Software / Re: AfxNova progress
Last post by José Roca - June 23, 2026, 02:21:52 PM
dwsText.JScript. JScript This is a property that I have added to DWSTRING to convert its content into a safe JavaScript expression for use with WebView2 ExecuteScript. You know, in the modern web browsers, all is javascript and utf-8.

' ========================================================================================
' JScript (PROPERTY)
' ------------------
' Converts the DWSTRING content into a safe JavaScript expression for use with
' WebView2 ExecuteScript.
'
' WebView2 requires UTF-8 text when passing strings to JavaScript. This property
' takes the internal UTF-8 byte sequence of the DWSTRING and generates a JS
' expression of the form:
'
'     new TextDecoder('utf-8').decode(Uint8Array.from([b1,b2,b3,...]))
'
' This guarantees that any Unicode text (including accents, symbols and emojis)
' is transmitted correctly to JavaScript without escaping issues, broken quotes,
' or encoding mismatches.
'
' The user can therefore pass DWSTRING values directly to ExecuteScript without
' worrying about UTF-8 handling or manual escaping.
'
' Usage example:
' m_pWebView->ExecuteScript("console.log(" & myString.JScript & ");")
'
' Notes:
' - The returned value is valid JavaScript code, not a literal string.
' - Ideal for passing arbitrary text safely from FreeBasic to JavaScript.
' ========================================================================================
' ========================================================================================
PRIVATE PROPERTY DWSTRING.JScript () AS STRING
   DWSTRING_DP("")
   DIM utf8Text AS STRING = this.utf8
   DIM p AS UBYTE PTR = STRPTR(utf8Text)
   DIM js AS STRING = "new TextDecoder('utf-8').decode(Uint8Array.from(["
   DIM L AS LONG = LEN(utf8Text)
   FOR i AS LONG = 0 TO L - 1
      js += STR(p[i])
      IF i < L - 1 THEN js += ","
   NEXT
   js += "]))"
   RETURN js
END PROPERTY
' ========================================================================================
#3
José Roca Software / Re: AfxNova progress
Last post by José Roca - June 23, 2026, 01:45:06 PM
This is done using JSON. WebView2 has methods to send and receive JSON strings. I already have JSON writer and reader classes that work with DWSTRING, BSTRING and DSafeArray. I'm procedeeing step by step because all this is new to me: asynchronous events, html, javascript, JSon... However, my wrapper classes will allow to use a javascript library like Konva as if it was a FreeBasic library, e.g. m_pCanvas->DrawText("text1", 10, 10, "This is a test string", 48, "Arial", "red", "transparent", 0, TRUE). Inside, the function does this:

' ========================================================================================
' Draws a text string on the Konva canvas.
' Parameters:
'   id          : Optional identifier for the text (case-sensitive)
'   x, y        : Coordinates of the text position (in pixels). Use -1, -1 to center the text.
'   dwsText     : The text string to display (Unicode aware)
'   fontSize    : Font size in pixels
'   fontFamily  : Font family name (e.g., "Arial", "Verdana")
'   fillColor   : Text fill color (HTML/CSS color string)
'   strokeColor : Outline color of the text (HTML/CSS color string)
'   strokeWidth : Width of the outline (in pixels)
'   draggable   : If TRUE, the text can be dragged with the mouse
' Description:
'   Creates a new Konva.Text object and adds it to the main layer.
'   If an id is provided, it is assigned to the shape so it can be
'   modified later (e.g., SetShadow, MoveTo, etc.)
' Usage example:
'   m_pCanvas->DrawText("txt1", 100, 150, "Hello world", 24, "Arial", "black", "transparent", 0, TRUE)
' ========================================================================================
PRIVATE SUB CWV2CanvasKonva.DrawText ( _
   BYREF id AS STRING = "", _
   BYVAL x AS LONG, _
   BYVAL y AS LONG, _
   BYREF dwsText AS DWSTRING, _
   BYVAL fontSize AS LONG = 20, _
   BYREF fontFamily AS STRING = "Arial", _
   BYREF fillColor AS STRING = "black", _
   BYREF strokeColor AS STRING = "transparent", _
   BYVAL strokeWidth AS LONG = 0, _
   BYVAL draggable AS BOOLEAN = FALSE)

   DIM idPart AS STRING
   IF id <> "" THEN idPart = "id:'" & id & "',"

   DIM js AS STRING
   js = _
      "var txt = new Konva.Text({" _
      & idPart _
      & "x:0," _
      & "y:0," _
      & "text:" & dwsText.JScript & "," _
      & "fontSize:" & STR(fontSize) & "," _
      & "fontFamily:'" & fontFamily & "'," _
      & "fill:'" & fillColor & "'," _
      & "stroke:'" & strokeColor & "'," _
      & "strokeWidth:" & STR(strokeWidth) & "," _
      & "draggable:" & IIF(draggable, "true", "false") _
      & "});" _
      & "layer.add(txt);" _
      & "var finalX = " & STR(x) & ";" _
      & "var finalY = " & STR(y) & ";" _
      & "var w = txt.width();" _
      & "var h = txt.height();" _
      & "if(finalX == -1){" _
      & "   finalX = (stage.width() - w) / 2;" _
      & "}" _
      & "if(finalY == -1){" _
      & "   finalY = (stage.height() - h) / 2;" _
      & "}" _
      & "txt.x(finalX);" _
      & "txt.y(finalY);" _
      & "layer.draw();"
   this.ExecuteScript(js, NULL)
END SUB
' ========================================================================================
#4
José Roca Software / Re: AfxNova progress
Last post by Paul Squires - June 22, 2026, 09:12:47 PM
Wow, that looks seriously impressive!

I am just thinking out loud - how would a FreeBasic programmer get FB data into the Javascript and then from the Javascript back to FB? It would be very convenient to be able to transfer data between the languages because you could use FB for the serious data intensive work and then Javascript for the visual stuff.
#5
José Roca Software / Re: AfxNova progress
Last post by José Roca - June 20, 2026, 10:16:05 AM
In the example attached in the previous post, clicking the mouse right button provides a localized menu with options to save or copy the content of the canvas. Ctrl+mouse wheel allows zooming, and Ctrl+P activates the Print/Preview dialog.
#6
José Roca Software / Re: AfxNova progress
Last post by José Roca - June 20, 2026, 10:08:58 AM
Using JavaScript Libraries from FreeBasic via WebView2: A Powerful Hybrid Technique

One of the most exciting capabilities unlocked by embedding WebView2 into a FreeBasic application is the ability to combine native code with the full power of modern JavaScript libraries. In the attached example, I demonstrate how to draw shapes, Unicode text, and even emojis by using a class derived from CWebView2 that executes JavaScript commands from the Konva.js graphics framework.

This technique is far more than a simple trick. It represents a clean, extensible, and extremely powerful architectural pattern.

Why this technique is so effective

1. You get a modern 2D graphics engine "for free"

Konva.js is a high‑performance HTML5 canvas framework designed for shapes, layers, animations, and interactive graphics. By calling its API from FreeBasic through WebView2, you instantly gain:

* smooth vector rendering
* layers and groups
* hit‑testing and interactivity
* animations and tweens
* pixel‑perfect text rendering
* full Unicode support, including emojis

All of this without writing a single line of low‑level canvas code in FreeBasic.

2. Unicode "just works" — including emojis

Because the rendering is handled by the browser engine, you automatically inherit:

* full UTF‑8 support
* complex scripts
* emoji rendering
* font fallback
* anti‑aliasing and subpixel smoothing

This eliminates the usual headaches of Unicode text in native GUI frameworks.

I have added a property called JScript to my DWSTRING class to allow the use utf-16 strings instead of utf-8.


3. Clean separation of responsibilities

The derived classes will handle:

* generating the JavaScript code
* sending it to WebView2
* managing the canvas state
* abstracting away the browser details

Meanwhile, the JavaScript library handles:

* drawing
* layout
* animation
* event handling

This keeps the FreeBasic side clean and focused.

4. No global variables, no manual cleanup

Because the event handlers are implemented as real COM objects, they:

* register themselves
* unregister themselves in the destructor
* are released automatically when the WebView2 instance is destroyed

This means the user does not need to store pointers, call Delete, or manage lifetimes manually. The system is robust and self‑contained.

What else can we do with this technique?

The beauty of this architecture is that Konva.js is only the beginning. Any JavaScript library that runs in a browser can be controlled from FreeBasic simply by deriving a new class and exposing methods that generate the appropriate JavaScript.

Here are some possibilities.

1. Charts and data visualization

You can create a CWebView2Charts class that wraps libraries such as:

Chart.js
ECharts
D3.js
Plotly
ApexCharts

This would allow FreeBasic applications to display:

* bar charts
* line charts
* pie charts
* heatmaps
* real‑time data visualizations
* interactive dashboards

All with modern styling and smooth animations.

2. UI components and widgets

By wrapping libraries like:

* Bootstrap
* Material UI
* jQuery UI

you could embed:

* dialogs
* sliders
* tabs
* accordions
* responsive layouts

directly inside a FreeBasic application.

3. Maps and geospatial visualization

Using libraries such as:

* Leaflet
* Mapbox GL
* OpenLayers

you could display:

* interactive maps
* markers
* routes
* heatmaps
* GPS data

all controlled from FreeBasic.

4. Game‑style rendering

With libraries like:

* PixiJS
* Phaser

you could build:

* 2D games
* simulations
* particle effects
* sprite animations

inside a native FreeBasic window.

A flexible, extensible architecture

The key idea is simple:

Derive a class from CWebView2, and implement methods that generate JavaScript for the library you want to use.

Each derived class becomes a bridge between FreeBasic and a modern JavaScript framework.

This approach gives FreeBasic developers access to:

* modern graphics
* interactive UI components
* advanced visualization
* high‑level animation
* rich text and Unicode
* High DPI rendering consistency

All without rewriting existing libraries or reinventing the wheel.

Conclusion

By combining FreeBasic with WebView2 and JavaScript libraries like Konva.js, we unlock a hybrid development model that is both powerful and elegant. Native code handles performance‑critical logic, while JavaScript libraries provide modern rendering and UI capabilities.

This technique is not only practical — it is extensible. New derived classes can wrap any JavaScript framework, enabling FreeBasic applications to incorporate charts, maps, animations, widgets, and much more.

It's a modern approach that dramatically expands what FreeBasic applications can do.

P.S. I have added automatic scrollbars to the example.
#7
José Roca Software / Re: cPDF Class
Last post by José Roca - June 17, 2026, 04:35:18 AM
Enjoy this vacation with your son. Those moments are what truly matter in life.
#8
José Roca Software / Re: cPDF Class
Last post by Richard Kelly - June 16, 2026, 11:27:36 PM
My son is coming from overseas for a few months and it's fishing season. This is a good spot for a pause, and, the cPDF project source can be found at:

cPDF Project Source

I will check in here from time to time to see if anybody has any issues.

Enjoy!
#9
José Roca Software / Re: cPDF Class
Last post by Richard Kelly - June 16, 2026, 05:56:55 PM
Thanks to Jose's speedy resolution of AfxSort.inc, I was able to finalize the sample report, adding each state's region and the % population change from 2010 to 2012.
#10
José Roca Software / Re: AfxNova progress
Last post by hajubu - June 16, 2026, 04:07:08 PM
hi, just updated  available - Testpan_AfxNova_Web_260616_690f2a3->related to the Array Macros ( Jose made a commit today )

see for available upd
Updated AfxNova_Web_260616_0310

see also Jose repo at Github
https://github.com/JoseRoca/AfxNova