More Scintilla questions

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)

Different variations to make a JSON in Xojo

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 Licenses and XDC Tickets on sale

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.

New in MBS Xojo Plugins in version 23.1

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)

MonkeyBread Software Releases the MBS Xojo Plugins in version 23.1

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.


WebView2 and Cookies in Xojo

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)

Xojo Tips

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)

MBS Xojo Plugins, version 23.1pr6

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.

xDev Magazine 21.2 Issue

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!

Email and MBS Plugin

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)
The biggest plugin in space...

Archives

Mar 2023
Feb 2023
Jan 2023
Dec 2022
Nov 2022
Oct 2022
Sep 2022
Aug 2022
Jul 2022
Jun 2022
May 2022
Apr 2022
Mar 2022
Feb 2022
Jan 2022
Dec 2021
Nov 2021
Oct 2021
Sep 2021
Aug 2021
Jul 2021
Jun 2021
May 2021
Apr 2021
Mar 2021
Feb 2021
Jan 2021
Dec 2020
Nov 2020
Oct 2020
Sep 2020
Aug 2020
Jul 2020
Jun 2020
May 2020
Apr 2020
Mar 2020
Feb 2020
Jan 2020
Dec 2019
Nov 2019
Oct 2019
Sep 2019
Aug 2019
Jul 2019
Jun 2019
May 2019
Apr 2019
Mar 2019
Feb 2019
Jan 2019
Dec 2018
Nov 2018
Oct 2018
Sep 2018
Aug 2018
Jul 2018
Jun 2018
May 2018
Apr 2018
Mar 2018
Feb 2018
Jan 2018
Dec 2017
Nov 2017
Oct 2017
Sep 2017
Aug 2017
Jul 2017
Jun 2017
May 2017
Apr 2017
Mar 2017
Feb 2017
Jan 2017
Dec 2016
Nov 2016
Oct 2016
Sep 2016
Aug 2016
Jul 2016
Jun 2016
May 2016
Apr 2016
Mar 2016
Feb 2016
Jan 2016
Dec 2015
Nov 2015
Oct 2015
Sep 2015
Aug 2015
Jul 2015
Jun 2015
May 2015
Apr 2015
Mar 2015
Feb 2015
Jan 2015
Dec 2014
Nov 2014
Oct 2014
Sep 2014
Aug 2014
Jul 2014
Jun 2014
May 2014
Apr 2014
Mar 2014
Feb 2014
Jan 2014
Dec 2013
Nov 2013
Oct 2013
Sep 2013
Aug 2013
Jul 2013
Jun 2013
May 2013
Apr 2013
Mar 2013
Feb 2013
Jan 2013
Dec 2012
Nov 2012
Oct 2012
Sep 2012
Aug 2012
Jul 2012
Jun 2012
May 2012
Apr 2012
Mar 2012
Feb 2012
Jan 2012
Dec 2011
Nov 2011
Oct 2011
Sep 2011
Aug 2011
Jul 2011
Jun 2011
May 2011
Apr 2011
Mar 2011
Feb 2011
Jan 2011
Dec 2010
Nov 2010
Oct 2010
Sep 2010
Aug 2010
Jul 2010
Jun 2010
May 2010
Apr 2010
Mar 2010
Feb 2010
Jan 2010
Dec 2009
Nov 2009
Oct 2009
Sep 2009
Aug 2009
Jul 2009
Apr 2009
Mar 2009
Feb 2009
Dec 2008
Nov 2008
Oct 2008
Aug 2008
May 2008
Apr 2008
Mar 2008
Feb 2008