Scintilla is very powerful, but finding something in the documentation can be troublesome. let's summary a few questions from you guys around ScintillaControlMBS control:
How to show whitespace?
Please check ViewWS property and use the constants:
- kWhiteSpaceVisibleOnlyInIndent
- kWhiteSpaceVisibleAlways
- kWhiteSpaceVisibleAfterIndent
- kWhiteSpaceInvisible
e.g.
c.ViewWS = c.kWhiteSpaceVisibleAlways
(more)
Today we had a bit of fun with JSON coding in Xojo and through what different ways we have to make a JSON in Xojo with different ways.
Let's start with Xojo's built-in ways. So let us use JSONItem class:
Sub Xojo1()
Dim root As New JSONItem
Dim arr As New JSONItem
arr.Add(16)
arr.Add(42)
arr.Add(128)
root.Value("RootA") = "Hello world"
root.Value("ArrayOfNumbers") = arr
root.Compact = False
TextArea1.Text = root.ToString
End Sub
This makes a JSON like this:
{
"RootA": "Hello world",
"ArrayOfNumbers": [
16,
42,
128
]
}
(more)
Xojo Inc. runs a sale for Pi day (14th March).
If your license expired or will expire later in March, please use this offer to buy a new one:
All Xojo licenses and XDC tickets are 14% off for the next 3 days!
Get this special discount in the store today through Thursday only!
xojo.com/store/
Sale Ends Thursday, March 16 11:59PM CT
All Xojo license purchases come with a 90-day money back guarantee. If your license is set to auto-renew during the dates of the sale the discount will be automatically applied.
Also if you waited for a
XDC ticket, you can now grab it at a discount.
In this article I want to introduce you to the new functionalities from the MBS Xojo Plugins in version 23.1.
MongoDB
The new methods in MongoDB should make your work with Mongo DB much easier. We have added aggregate functions for you to query data by applying a filter, sorting rules and grouping either to the entire database or only to a specific collection. Also, we can query the TLS status of the database to see whether the connection is encrypted. Using the property Options from the class MongoURIMBS we can query the options of a URL. It fetches a JSON document containing all the options provided after the ? of a URI.
DynaPDF
Also in the DynaPDF section we have 2 new methods for you. You can rename named destinations with the method ChangeNamedDest in the DynaPDFMBS class. In the parameters you first specify the type of the object, then the object handle and finally the new name of the destination. The other method is the CreateStructureTreeEx method. Already since version 8.2 there is a related method CreateStructureTree, which creates a global structure tree that is required to create tagged PDF files. The new method has the additional possibility that we can specify the type of the root node. Otherwise the two methods work identically.
DynaPDF added support for writing PDF/UA-1 files and update the DynaPDF library to 4.0.72.208
(more)
Nickenich, Germany - (March 7th, 2023) -- MonkeyBread Software today is pleased to announce MBS Xojo Plugins 23.1 for macOS, Linux and Windows, the latest update to their product that is easily the most powerful plugin collection currently available for Xojo. MBS Xojo Plugins have been updated and now includes over 3000 classes and 80,000 documented features, and the versatile plugins have gained more new functions:
Our new WindowsOCREngineMBS class allows you to use the built-in OCR engine in Windows 10 or newer. You can pick a language for initialization, load an image from file, string or picture and perform OCR recognition on it. The result can be requested either as text or as objects with individual lines and words.
We continue on the MongoDB plugin and add aggregate functions to query data applying a filter, sort rules and grouping on either the whole database or only a given collection. You can run custom commands on the database and query TLS status.
The LibXL library got updated and we enjoy new functions. The XLSheetMBS class got functions to better handle selection, active cell and tab colors. The XLBookMBS class got a IsWriteProtected function. Finally the XL classes now work on Windows 64-bit on ARM.
We rewrote the Windows store classes, a set of classes to help you perform in-app purchases in your Windows app through Microsoft's Store. For this we added new video, license and image classes. The delegates have an ErrorCode parameter to report status better and you need to adapt your handlers. On the way we got new methods like GetAppLicenseSync.
The WebKit JavaScript engine can be used on Windows and Linux in addition to MacOS and iOS. This includes using it in web or console projects for evaluating JavaScript. For Windows and Linux you have to use LoadLibrary function in JSContextMBS class to load your copy of the JavaScriptCore library.
For our WebView2 control we added the WebView2CookieManagerMBS and WebView2CookieMBS classes for Windows. You can use it to query the current cookies set in the web viewer and use them e.g. for CURL functions. We implemented a PrintToPdf method for Windows to save a website as PDF file.
DynaPDF added support for writing PDF/UA-1 files. The newer CreateStructureTreeEx function can be used to create the required tag structures for your PDF documents. The ChangeNamedDest function can rename named destinations.
We added a yield option to LCMS2TransformMBS class, added offset and length parameters to ReadFileMBS function and provide CallDelegateOnPreemptiveThreadMBS to try preemptive threading. The RequestScreenCaptureAccess method on CGSWindowListMBS can query for permisions to capture the screen on macOS.
Finally we updated CURL library to version 7.88.1, DynaPDF to 4.0.72.208, LCMS2 to 2.15, LibXL to 4.1, libxml to 2.10.3, openssl to 1.1.1t, SQLite to 3.41.0, tiff library to version 4.5.0.
See release notes for a complete list of changes.
You may use the HTMLViewer in Xojo for your desktop projects. It uses on Windows either Chromium CEF in some version or the older Internet Explorer component. While the IE component is certainly old and outdated, the CEF version coming with your Xojo may also be older and considerably increases your application size. For CEF you carry about 200 MB of DLLs with you. Looking for an alternative, we got a WebView2 control in MBS Plugins:
We got our WebView2ControlMBS for Xojo based on the WebView2 control from Microsoft.
(more)
Let us show you a few tips with the Xojo development, which we found to be helpful in the last weeks:
CType
The CType() function allows you to convert a value to a different type and we found it helpful to convert from boolean to integers. We use it here to shrink our code for counting how many boolean variables are set. Please read this snippet:
Sub Test()
Dim FirstNameMatches As Boolean
Dim LastNameMatches As Boolean
Dim CompanyMatches As Boolean
Dim EmailMatches As Boolean
Dim PhoneMatches As Boolean
Dim ProductMatches As Boolean // customer bought this before
// evaluate here and set booleans
Dim MatchPoints As Integer
If FirstNameMatches Then
MatchPoints = MatchPoints + 1
end if
If LastNameMatches Then
MatchPoints = MatchPoints + 1
End If
If CompanyMatches Then
MatchPoints = MatchPoints + 1
End If
If EmailMatches Then
MatchPoints = MatchPoints + 3
End If
If PhoneMatches Then
MatchPoints = MatchPoints + 1
End If
If ProductMatches Then
MatchPoints = MatchPoints + 1
End If
If MatchPoints > MaxMatchPoints Then
// best match so far
MaxMatchPoints = MatchPoints
End If
End Sub
This is for matching a new order to existing customer database. The new order may have the same name, email, phone and we look for best match in existing table. For this we match the values and set these boolean variables. Then we count points on how many are set. For the email match we count three points as a special case. This usually finds us the right customer in a lot of cases, even if they changed name, email, company name or phone, but keep one or two values equal.
(more)

New in this prerelease of the 23.1 plugins:
- Updated LCMS2 library to version 2.15.
- Applied SQLAPI patch for Oracle fix in memory leak.
- Added Offset and Length parameters for FolderItem.ReadFileMBS function.
Download:
monkeybreadsoftware.de/xojo/download/plugin/Prerelease/ or
from DropBox.
Or ask us to be added to our shared DropBox folder.

The March/April (21.2) issue of
xDev Magazine is now available. Here's a quick preview of what's inside:
Xojo Installer Fix by Marc Zeedar
Have you noticed that when you install a new version of Xojo, it doesn't copy over your previously installed plugins and scripts? That can cause things to not work as you expect if you don't remember to fix it manually. This simple app solves that problem.
Lessons from Legos by Marc Zeedar
In January, Marc worked on a retro Lego project and the experience prompted a lot of thoughts about the simlarities between Legos and programming.
Xojo Wordle Solver by Marc Zeedar
Wordle's a simple word-guessing game, but sometimes it can be a frustrating case of dumb luck. Marc wondered if Xojo could help, so he took up the challenge to write an app to help solve Wordles.
Exploring Steganography, Part 5 by Eugene Dakin
In this conclusion to his series, Eugene shows how to retrieve hidden text from a picture, as requested by xDev readers.
Plus: Topics such as running Xojo on Windows 11 Arm on Apple Silicon, Attributes, MBS XML, Group By function, and more!
Recently we got asked what we can do for emailing in MBS FileMaker Plugin and MBS Xojo CURL Plugin. While we recommend not to try and replicate a full Mail client, you can do a lot with our plugins and so let us sum up what we can do:
SMTP
We provide CURL functions and SendMail functions to send emails with more options than what is built-in to FileMaker.
Send Email
Our plugin can send emails via SMTP protocol.
Port is 25 by default, but alternatively you can use port 587 if a firewall blocks port 25. Or for smtps:// protocol we use port 465.
When you send an email, you retain the protocol from curl, so you can see what happens. This may show errors like invalid credentials, hitting the email size limit and on the end an OK message from the server for accepting the email.
(more)