MBS Xojo Plugins, version 25.1pr5

New in this prerelease of the 25.1 plugins: Download: monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.

You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.


For each loops in detail

Let's a look on the for-each loops in Xojo. They allow you to loop over a container data type very easily. That could be:

  • The entries in an array.
  • The keys in a Dictionary or the entries.
  • The FolderItems in a folder.
  • The rows in a Listbox or a RowSet.
  • The sessions, pages, controls, labels and views in the Web framework.
  • The characters or code points in a string.

To iterate over a container, it must implement the Iterable interface and return the new iterator object, which implements the Iterator interface. Xojo has over 20 classes built-in, that implement these interfaces.

(more)

Xojo Developer Magazine Year Books

Today the new books arrived from XDevMag. Always great to have all the articles from one year of the Xojo Developer Magazine in one book, where you can just browse through when you have some time in your hammock.

We'll give away a few over the year at various Xojo meetings

If you like to get one yourself, you can order them in the XDevMag book store. When you consider ordering them, better pick several years and let them ship together at a package price. There are also academic and subscriber discounts available and shipping from USA or Europe is available.


Connect to CubeSQL in Xojo

If you like SQLite and you look for a server version, you quickly find CubeSQL. If you like to connect to it using MBS Xojo SQL Plugin, you can use the SQLDatabaseMBS or SQLConnectionMBS class.

First you need to get a CubeSQL client library. Within our plugin is the built-in library, which you can activate using InternalCubeSQLLibraryMBS module. Otherwise you can of course use a libcubesql.dylib/so/dll of your choice.

(more)

XDevMag: VCard QR Code

Meet someone via QR code or file

article page

Let us point you to an article in the Xojo Developer Magazine in the 22.6 issue:

In this article, Stefanie Juchmes discusses how to embed vCard contact information into a QR code, offering a way to easily transfer contact details between smartphones. The concept is inspired by a conference experience where a QR code on a name badge allowed participants to quickly access a person's contact details. Rather than simply linking to a website, the article focuses on embedding a vCard (an electronic business card) directly into a QR code, allowing users to add the contact information directly to their address book.

The article provides a deep dive into the structure of a vCard, explaining its key components and how to format them properly for inclusion in a QR code. Key pieces of data in a vCard include the person’s name, email, phone numbers, address, URL, birthday, and notes, with examples of how each should be written. The process also involves handling optional fields and ensuring proper formatting with line breaks. The article illustrates this with sample code for creating a vCard and discusses how to store it within a QR code for easy sharing.

Finally, Stefanie shows how to implement this QR code generation using the MBS Xojo Barcode Plugin in Xojo, walking through the steps to create a QR code and save it either as a file or for display. The user interface (UI) allows for the entry of contact details, which are then used to generate the vCard data. She also explains how to handle file-saving options, allowing users to save their contact information as a .vcf file or generate a scannable QR code. The article concludes with an invitation to experiment with this tool for sharing contact information at future events.

see also BarcodeGeneratorMBS class.

Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.

(more)

XDevMag: An Overview of Overlays

Using Overlays with MBS

article page

Let us point you to an article in the Xojo Developer Magazine in the 22.5 issue:

This article introduces the concept of using overlays with the MBS Xojo Plugins, which are customizable screen areas that can be freely moved, resized, and interacted with through mouse events such as clicks and hover actions. The example in the article demonstrates how to create and manage an overlay using the OverlayMBS class. The author walks through the process of setting up an overlay, defining its position, size, and background, using a logo as an example. The article also discusses how to apply masks to hide unwanted parts of the image, achieving effects like removing white edges around a logo.

Further functionality is explored, such as making the overlay movable or resizable by the user and controlling its visibility through methods like Show, Hide, and Close. The overlay’s opacity can be adjusted using a grayscale mask or the Alpha property. The author also highlights the use of shadows and the ability to update the overlay dynamically, for instance, by adding text fields and drawing text on the overlay with customized font properties. This feature allows for creating information boxes or interactive elements within an application.

Finally, the article delves into the various events associated with the OverlayMBS class, including focus-related events, mouse interaction events, and window visibility events. These events enable developers to add advanced interactivity, such as detecting mouse movements, clicks, or focus changes. The author concludes by offering a practical tip to help users track event triggers, enhancing their understanding of overlay behavior in their applications. The techniques covered aim to help developers integrate dynamic and interactive overlays into their Xojo applications.

see OverlayMBS class.

Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.

(more)

Loop variants in Xojo

Recently a beginner asked about the differences between the loops and which too choose. Let's compare the loops by using them to count up from a start to an end value.

The first loop is the FOR loop. It counts a variable up from a start value to the end value. If the start value is bigger than the end value, the loop is skipped entirely. Let us show you the sample code:

Sub testFor(First as Integer, Last as Integer) For i As Integer = First To Last Log "For "+i.ToString Next End Sub

You are not limited to double, but you can use any data type you like, e.g. a double. Here we step by 0.3 instead of the default 1, so we count up from 1.0 to 2.8. After 2.8 comes 3.1 which is too big, so the loop exists.

(more)

XDevMag: Text Recognition

Using Appleā€™s Vision to Extract Text from an Image

article page

Let us point you to an article in the Xojo Developer Magazine in the 22.4 issue:

In this article, Stefanie Juchmes introduces how to use Apple’s Vision framework to recognize text within images on Mac and iOS systems using the MBS Xojo Plugins in Xojo. She explains the general capabilities of the Vision framework, such as recognizing text, barcodes, and classifying images into categories. The main focus of the article is text recognition, which can be achieved through Apple's Vision functions. The process begins with loading an image into the program using an open dialog, then passing the image to a method called VisionOCR. Depending on the macOS version, the method will either recognize the text's bounding boxes (on older versions, 10.13 and 10.14) or extract the actual text (on macOS 10.15 and higher).

The article provides detailed steps on handling different macOS versions and what functionalities are available for text recognition. On macOS 10.13 and 10.14, Vision can detect text positions but does not recognize the actual text, while macOS 10.15 and above can identify both the text and its position. The code snippet presented demonstrates how to detect text and its bounding boxes and how to handle errors using the VNRecognizeTextRequestMBS and VNDetectTextRectanglesRequestMBS methods. Additionally, the author explains how to store results and draw polygons around detected text areas on the image, which helps visualize the recognized regions.

Finally, the article covers how to extract the actual text from the image on macOS 10.15 and above, determine an appropriate font size, and display the recognized text on the image. The results can be output as text or processed further in a text field. The author also shows how to draw the image with the text onto a canvas, scaling it appropriately for display. This allows developers to integrate text recognition into their apps, making it easier to process and display text from images on macOS and iOS platforms.

Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.

(more)

Connect to Postgres in Xojo

Today we like to connect to Postgres Database server from Xojo using MBS Xojo SQL Plugin. For that we need the client libraries for Postgres, but where to get them?

macOS

For macOS you can download the Postgres App to get a local test server for Postgres on your Mac. You can directly point to the libpq.5.dylib within the application.

We adjusted the install names to make them work into the Frameworks folder of your application. The libpq library needs crypto and ssl libraries, so these must be in the same folder. You can find these with a test project here: PostgreSQL Libraries. You can add a these using a CopyFiles build step into the Frameworks folder of your application.

Var con As New SQLConnectionMBS Var cmd As New SQLCommandMBS Var ResourceFolder As FolderItem = SpecialFolder.Resources Var ContentsFolder As FolderItem = ResourceFolder.Parent Var FrameworksFolder As FolderItem = ContentsFolder.Child("Frameworks") Var LibFile As FolderItem = FrameworksFolder.child("libpq.5.dylib") If LibFile.Exists = False Then MessageBox "libpq not found?" End If con.SetFileOption con.kOptionLibraryPostgreSQL, LibFile
(more)

XDevMag: Phidgets

What are they and how to use them

article page

Let us point you to an article in the Xojo Developer Magazine in the 22.3 issue:

This article introduces readers to Phidgets, small input/output devices developed by Phidgets Inc. that can be used for a variety of applications such as sensors for humidity, light, pressure, temperature, and more. The article explains how to connect these devices to a computer through hubs, either wired or wireless, and how the MBS Xojo plugin can facilitate interaction between Phidgets and Xojo software. The author walks through the process of creating a weather station with a light sensor, barometer, and temperature sensor, demonstrating how to gather data from these sensors and display it in a Xojo interface.

The setup for working with Phidgets involves connecting them to the computer through hubs, with each hub offering multiple ports. In a Xojo project, the layout includes elements like label fields to display data from sensors and buttons to control the program. The author walks through the process of adding a library for Phidgets in the program, ensuring that the necessary code is in place to load and use the library for communication between Xojo and the Phidgets hardware. This is followed by a demonstration of how to initialize and configure the sensors using specific Phidget classes and handle events triggered by sensor data changes.

Finally, the article explores how to control data updates from sensors to avoid unnecessary changes being triggered too frequently. This is accomplished by adjusting properties such as data interval and change triggers to control when events are fired based on meaningful changes in sensor data. The program includes a button to close the Phidgets connection properly and end the session. The article concludes with a reminder of the steps taken, providing a comprehensive guide for readers interested in integrating Phidgets with Xojo for hardware interfacing projects.

see Phidgets plugin and Phidgets classes.

Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.

(more)

MBS Xojo Plugins, version 25.1pr4

New in this prerelease of the 25.1 plugins: Download: monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.

You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.


XDevMag: Find Yourself

How to determine the location of devices with MBS under Windows and Mac

article page

Let us point you to an article in the Xojo Developer Magazine in the 22.6 issue:

The article "Find Yourself" by Stefanie Juchmes explains how to determine the location of a device using MBS Xojo Plugins for both Windows and Mac platforms. On Windows, the process involves using the WindowsLocationManagerMBS class to request access to location data and start event handling. The article outlines how to create a class that inherits from this class, use the StartEvents method, and handle location updates through the LocationChanged event. It covers different status reports like whether location services are not supported, errors, or when the location service is running, allowing the application to react appropriately.

For Mac, the location retrieval process works similarly, using the CoreLocation framework and the CLLocationManagerMBS class. The process starts by checking if location services are available and enabled on the device. The class created in the Mac example inherits from CLLocationManagerMBS, and location updates are retrieved through the didUpdate event. Latitude, longitude, altitude, and timestamp can be fetched, and the article also touches on querying the data in a formatted text string, which can include speed, direction, and accuracy metrics. The process is straightforward, similar to the Windows implementation, with a focus on handling location updates and stopping them once the data is retrieved.

In addition to basic location retrieval, the article also explores advanced functionality on Mac, like using a GeoCoder to convert geographic coordinates into a street address. The author explains how to set up a GeoCoderHandler class to handle the completion event once the geocoding process is finished. This feature allows the user to obtain both address information for a set of coordinates and vice versa, making it versatile. By providing detailed examples and code snippets for both platforms, the article gives readers a comprehensive understanding of how to use MBS to get location data and even turn coordinates into readable addresses on Mac.

see CLLocationManagerMBS and WindowsLocationManagerMBS classes.

Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.

(more)

XDevMag: Parse your Mails in Xojo

Using EmailParser

article page

Let us point you to an article in the Xojo Developer Magazine in the 22.1 issue:

In this article, Stefanie Juchmes provides an introduction to parsing emails using Xojo and the MBS Xojo CURL Plugin. She explains the process of reading and analyzing email content by first obtaining the email in an "eml" file format. This can be done by exporting it from an email application like Apple Mail. The email is then loaded into the program using the MimeEmailMBS class, which can be initialized with different file types such as a MemoryBlock, String, or FolderItem. Once the email is loaded, various properties such as the subject and received date are accessed to extract basic information.

The article goes on to describe how to access more detailed content of the email, including plain text and HTML format, using properties like PlainText and HTMLText. It highlights the role of inline graphics in emails, especially in advertising, and shows how to retrieve information about these graphics using the Inlines property. Each inline graphic is represented by a MimeAttachmentMBS object, and the code allows the user to extract file names and other details. The section also explains how to handle email attachments similarly by accessing the MimeAttachmentMBS objects and determining the file types using the MimeType property.

Finally, the article covers how to analyze the email's header to gather details about the sender, recipients, and other metadata. Using the MimeHeaderMBS class, the article demonstrates how to extract the sender's and recipient's addresses, including the ability to handle multiple addresses in fields like bcc, cc, and to. The StringValue property is used to retrieve these as strings, while the Addresses method provides more detailed information. The article concludes with a suggestion to explore further email features in another article by the author, focusing on sending emails with inline graphics in the headers and footers.

Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.

(more)

Benefits of XSLT 2.0 and 3.0 Compared to XSLT 1.0

You have XSLT 1.0 in FileMaker and Xojo built-in as well as in our plugin function to use XSLT (XML.ApplyStylesheet). With our Saxon functions you get XSLT 3.0 and you can enjoy all the 2.0 and 3.0 features in your FileMaker solution and Xojo applications.

XSLT 2.0 and 3.0 introduce several significant improvements and new features compared to XSLT 1.0. Here are the key benefits of XSLT 2.0 and 3.0 over XSLT 1.0:

(more)

The SortMBS module

Please check out our SortMBS module. It contains optimized array methods for a few things. These functions are highly optimized and usually magnitudes faster than doing it in Xojo code yourself.

We have these functions overloading arrays directly:

method AddMBS(extends array1() as Type, array2() as Type)
method CopyMBS(extends source() as Color, dest() as Color, sourceIndex as Integer = 0, sourceCount as Integer = -2, destIndex as Integer = 0)
method EqualsMBS(extends array1() as Type, array2() as Type, array1offset as Integer = 0, count as Integer = -2, array2offset as Integer = 0) as Boolean
method ReverseMBS(extends theArray() as Type)
method SortMBS(extends theArray() as Type, descending as Boolean = false)
method SortMBS(extends theArray() as Type, theDelegate as SortVariantDelegateTypeMBS, descending as Type = false)
method SumMBS(extends source() as Type, sourceIndex as Integer = 0, sourceCount as Integer = -2) as Int64

The math functions like sum are implemented for Boolean, Currency, Double, Int32, Int64, Single, UInt32 and UInt64. The AddMBS function will append the values to another array. The CopyMBS will copy from one array to another array, optionally only a range of values.

(more)

MBS Xojo Plugins, version 25.1pr3

New in this prerelease of the 25.1 plugins: Download: monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.

You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.


Advertise your Linux app on the network

You may know that we have plenty of classes for Bonjour on macOS, iOS and Windows. For Linux we have the Avahi classes to browser for services. In our plugin version 25.1 we add new Avahi classes to register a service. What you use this for?

You may do an application for your Raspberry Pi to run there as a service. How to find the IP to connect over the network? If you use Avahi, your application can start the ServerSocket and get the port it uses. Then advertise this on the network and your other application on a different computer and look for the service and learn what IP and port to connect this. All automatically for IPv4 as well as IPv6.

link (more)

MBS Xojo Plugins, version 25.1pr2

New in this prerelease of the 25.1 plugins:
  • Added optional Names parameter to BuiltInCurves function in ECKeyMBS class.
  • Added CurveNameToID function to ECKeyMBS class.
  • Added ES256Verify and ES256Sign functions to ECKeyMBS class.
  • Added CustomerID property to DynaPDFMBS class.
  • Added Failed event to WebView2ControlMBS control to report when a WebView2 could not be created.
  • Improved GZipMBS class to handle unicode characters in the file path.
  • Updated CURL library to version 8.12.0.
  • Warning: CURL 8.12 has a bug with STARTTLS for SMTP causing a server timeout. We implemented a workaround until an official fix is available.
Download: monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.

You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.


Differences between old and new Excel file format

I got asked what the differences between XLS and XSLX formats are for our LibXL functionality. Some of the features are only available if you opted for the new or old format. In general we nowadays prefer the newer XLSX format based on XML.

Here is a table to compare:

WhatXLSXLSX
File FormatBinary Interchange File Format (BIFF)Office Open XML Format
CompatibilityReadable by all Microsoft Excel versionsReadable by Excel 2007 and later versions
Rowsup to 65,536 rowsup to 1,048,576 rows
Columnsup to 256 columnsup to 16,384 columns
FormulasSupports older Excel functionsBetter compatibility with newer Microsoft Excel functions
(such as IFERROR, XLOOKUP, TEXTAFTER)
Maximum Number of Fonts50465429
Conditions Formatsnoyes
Picturesyesyes
Picture Linksnoyes
Cell Commentsyesno
Auto Filternoyes
Data Validationnoyes
Form Controlsnoyes

Check out the XL functions for our MBS FileMaker Plugin and the XL classes in our MBS Xojo Plugins, which allow you to read and write Microsoft Excel files using LibXL library.


MBS Xojo Plugins, version 25.1pr1

New in this prerelease of the 25.1 plugins:
  • Added AddSysPath method to PythonMBS class.
  • Added AvahiAddressResolverMBS, AvahiEntryGroupMBS, AvahiHostNameResolverMBS and AvahiRecordBrowserMBS classes.
  • Added mitigation against buffer overflow in Windows for snprintf function.
  • Added more methods and properties for AVCaptureDeviceMBS class.
  • Added PHPickerControlMBS control.
  • Added ReverseMBS function for arrays.
  • Added SetLicense, License and ClearLicense methods for SaxonMBS module.
  • Added SourceWithoutAttachments method to MimeEmailMBS class.
  • Added State property to AvahiClientMBS class.
  • Added View and ViewController properties to PHPickerViewControllerMBS class.
  • Added WindowsAVIWriteMBS class.
  • Changed SetLicenseKey in XLBookMBS class to raise exception if you pass invalid license, e.g. Windows license on macOS, instead of ignoring it.
  • Fixed a memory leak in AddInkList, InkAnnot and SetAnnotQuadPoints methods in DynaPDFMBS class.
  • Fixed a memory leak of a DynaPDFRectMBS object when calling UpdateWindow event in DynaPDFRasterImageMBS class.
  • Fixed crash in SortByFileName method in FileListMBS class introduced in v25.0.
  • Fixed PopOverWidth and PopOverHeight for PHPickerViewControllerMBS class.
  • Improved MidiPlaybackMBS class to raise exceptions if it wasn't initialized properly.
  • Improved Optimize() function in DynaPDFMBS class to automatically set kofInMemory flag if you have no open file.
  • Improved TrueItemsMBS function to be quicker.
  • Removed dependency to CXXABI_1.3.13 for Linux, introduced in 15.0.
  • Updated DynaPDF library to version 4.0.97.274.
  • Updated lcms library to version 2.17rc0.
  • Updated SQLite to version 3.48.0.
  • Updated avahi library.
  • Improved setting Baudrate in SerialPortMBS class to not try to change if the baud rate if the old and new rate are the same.
  • Implemented keep alive for MQTT feature in CURLSMBS class. Use OptionTCPKeepAlive property to enable.
Download: monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.

You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.


The biggest plugin in space...

Archives

Mar 2025
Feb 2025
Jan 2025
Dec 2024
Nov 2024
Oct 2024
Sep 2024
Aug 2024
Jul 2024
Jun 2024
May 2024
Apr 2024
Mar 2024
Feb 2024
Jan 2024
Dec 2023
Nov 2023
Oct 2023
Sep 2023
Aug 2023
Jul 2023
Jun 2023
May 2023
Apr 2023
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