In this article I want to introduce you the new functionalities from the MBS Xojo Plugins in version 20.3.
Dynamic Declares
The classes of this topic handle the loading of dynamic C libraries and calling functions within them. Currently there are three classes.
The DeclareLibraryMBS class Allows you to load a DLL on Windows, a dylib on MacOS and shared object on Linux. It inspects the available functions and load functions by name. You can enter a path or pass a folderItem when you create an instance of this class.
The DeclareFunctionMBS class give you the possibility to call C functions. In comprehension to the built-in declares in Xojo, those functions allow a much more dynamic calling of functions with various calling conventions. We support also the possibility to define declares at runtime.
With the DeclareCallBackMBS class you can create callback functions dynamically. In the parameters you pass the function pointer to a C function which later calls back your callback.
Java
In the JavaVMMBS class we have two new methods, named DefineClass, that allow us to load a class with raw class data from the buffer. In the parameters, we specify the class name and the data either as a string or a memory block.
(more)
Get the top developer tools and third party components for the Xojo cross-platform development platform at a huge savings until 31st
July August 2020.
Omegabundle for Xojo 2020 is a collection of the most useful tool sets, add-ons, digital books and components for use with Xojo Inc's Xojo development environment. If purchased separately and not including any additional offers, the total cost would be over $3,711.00. Omegabundle for Xojo 2020 costs $399.
Buy now on the Paradigma Software store.
Xojo is an award-winning, cross-platform development tool for the Desktop (macOS, Windows, Linux), Web, iOS (iPad/iPhone) and Raspberry Pi. With Xojo, you can create native applications by using drag-and-drop to build your user interface and then one straight-forward programming language to enable the functionality. Xojo is powerful and modern, yet easy to use and learn.
(more)

New in this prerelease of the 20.4 plugins:
Download:
monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.
Our
MBS Xojo DynaPDF Plugin is quite popular and we try to improve it regularly.
In the current version 20.3 we added support for ClearRectangle and FillPath methods, one of the changes for API 2.0 in Xojo. We set Helvetica 12 in point as default font for every new PDF document. If you change the font, this font reference will be discarded on saving as DynaPDF cleans up the object tree when writing the PDF. But new users may not run into an error, because no font is set.
Earlier in 20.2 we added support for ignoring ClearRect calls in graphics class to be able to draw over an existing PDF page and not fill all the space with white color. With our own
DynapdfGraphicsPathMBS class we got even support for drawing paths with the new Xojo methods to do so. In
DynaPDFPageMBS class we got properties visible in the debugger, so you can directly inspect the boxes for the page. The SetCellPicture method for
DynaPDFTableMBS class takes directly a picture to make this easier for developers to pass pictures. In
DynaPDFMBS class we deprecated all the Ansi versions of the functions. Unicode support got better over the years and nobody should need those any more. And when you call SetFont without passing an encoding, we default to unicode.
Changes like the above may help to make use of the plugin more easier. For next version 20.4 we have a few more little changes to improve the plugin. First we have the problem that not everyone implements an Error event to catch problems. We add
DynaPDFErrorExceptionMBS class to raise an exception if either the Error event is missing or you return the new constant kErrorEventRaise in the Error event. The error event can be implemented by subclassing
DynaPDFMBS class or by using addHandler command. By using exceptions, you will not miss an error. But you may still want to use the Error event to ignore warnings, which could raise an exception otherwise.
Another change we thought about is to add more properties. A first one to add is ActiveFontInfo as
DynaPDFFontInfoMBS to the properties. This allows you to see the current font set in the debugger. Let us know if you have ideas for properties we could add to make your live easier.
A DynaPDF Starter license is included in
OmegaBundle and can be updated to DynaPDF Lite license at a
discounted price.
For everyone using MBS Plugins with PostgreSQL can now get the library in version 12.3 on our website:
Libraries Download
Please use option on connection to point to the libpq.dylib for MacOS or libpq.dll for Windows.
You can just include the dylibs/DLLs in same folder as the application and point to them. For macOS you may need to code sign for redistribution as we just signed it with our code signature. The macOS libraries are changed to look for the crypto and ssl libraries in same folder as libpq.dylib file.

Nickenich, Germany - (July 21st, 2020) -- MonkeyBread Software today is pleased to announce
MBS Xojo Plugins 20.3 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 2600 classes and 70,000 documented features, and the versatile plugins have gained more new functions:
As Apple announced their move to Apple Silicon processors, we are already working on an update to our plugin to support it. For now we already defined function
SystemInformationMBS.isBigSur to return whether the newer macOS version 11.0 is running. The
SystemInformationMBS.isARM function returns 1 if you run on an ARM based CPU and this currently returns 0 everywhere, but will in future return 1 if your application runs natively on newer Mac hardware with Apple Silicon. And the function
SystemInformationMBS.isTranslated will tell your solution whether it runs Intel code on Apple Silicon in emulation.
With our new
DeclareLibraryMBS class you can load shared libraries written in C/C++ and list their functions. You pick a function and use the
DeclareFunctionMBS class to prepare a call and then run the function. Parameters are automatically converted to the right datatypes and the result converted to a variant. The new
DeclareCallBackMBS class allows to define a callback, which can be thread safe. While the functions do similar things like the declare statement in Xojo, they are more dynamic and you can define the function call at runtime, specify calling conventions and support variable arguments.
For Windows we added a set of classes to acquire photos from various devices like cameras or scanners. Check the
WinPhotoAcquireMBS class for the acquire functions. Use standard dialogs with
WinPhotoAcquireDeviceSelectionDialogMBS and
WinPhotoAcquireOptionsDialogMBS classes to find devices and set options.
Since Xojo uses direct draw for drawing in a picture or canvas, we now have
DirectDrawGraphicsMBS class to offer you more options. Currently you can draw dashed lines for vector graphics. Let us know for future versions what new methods you like to have here.
The
WKWebViewMBS class for working with WebKit 2.x got new methods to get the PDF or a web archive of the current page. You can do select all, paste, copy and cut via methods and query HTML and plain text for the website. If the page is a PDF itself, you can now query the data for the PDF document via MainResourceData directly. If needed, you can adjust the page zoom or media type for CSS.
Our encryption plugin got upgraded to allow SHA3 hashes with 224 to 512 bits in length. We added functions for Base64 URL encoding an a new example to show
JWT RS 256 signature creation and verification.
For Windows we added support to load DebugBar into a HTMLViewer. This is a third-party add-on for Internet Explorer to inspect the DOM tree, run JavaScript and see CSS properties. Use our ShowDebugBar method in the
IEWebBrowserMBS class to load DebugBar and use it in your Xojo application.
The
XLSheetMBS class can now use WriteStringAsNumber to write a number passing it a string,
SDAVAssetExportSessionMBS class allows more control on exporting videos in AVFoundation, DynaPDF got support for ClearRectangle and FillPath methods in Graphics class, the
JavaVMMBS class can now define a class at runtime, examples are upgraded to use 64-bit as targets and
WindowsGraphicsDeviceContextMBS class allows to get the HDC for a graphics object with proper cleanup later.
Finally we updated CURL library to version 7.71.1, DynaPDF to 4.0.40.116, LCMS to 2.11, LibXL to 3.9.1, SQLAPI to 5.1, SQLite to 3.32.0, Xcode to 11.5, VLC to version 3.0.11.
See
release notes for a complete list of changes.
With the MBS Xojo ChartDirector Plugin and an ChartDirector license you can create charts in Xojo. These diagrams can then be displayed on the user interface, integrated into a PDF document or saved as an external file. With ChartDirector you have many different chart types and a wide range of design options at your disposal. You can create diagrams according to your wishes. For example, you can specify axis colors, data colors, data labels, or backgrounds. Select fonts, use gradient or transparent colors and decorate charts with symbol pictures. The X, Y and a second Y axis on the right can be designed separately. You can also add and customize a legend for your chart. There are almost no limits to your imagination. Here are a few examples of charts created using the Chart Director and the MBS Xojo ChartDirector Plugin on Xojo. ChartDirector license must be purchased separately from the plug-in license and one is included with the OmegaBundle 2020. Below eight examples:
CDXYChartMBS on the left with three data sets and CDPieChartMBS on the right with 3D effect and custom label formatting.
(more)

New in this prerelease of the 20.3 plugins:
- Upgraded examples to use 64-bit targets. This was made automatically to enable 64-bit targets, HiDPI and dark mode for all projects. Thanks to Arbed!
- Added NSAppearanceNameDarkAqua shared method to NSAppearanceMBS class for dark mode.
- Added flipped parameter to RenderImage method in NSViewMBS class.
- Changed NSURLSessionMBS classes to only load on Xojo 2015 or newer.
Download:
monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

If you use Xojo reporting and you like to output them to a PDF, get the
MBS Xojo DynaPDF Plugin, currently in the
OmegaBundle 2020 to implement this feature in your application:
// new PDF environment
Dim pdf As New MyDynapdfMBS
// create a new PDF file
Dim f As FolderItem = SpecialFolder.Desktop.Child("report.pdf")
Call pdf.CreateNewPDF(f)
// get graphics for a page
Dim g As Graphics = pdf.PageGraphics
// now get report
Dim rpt As New NameReport
// and a printer setup
Dim ps As New PrinterSetup
// run report
If rpt.Run(PrintableListBox, ps) Then
If rpt.Document <> Nil Then
// let it output to PDF
rpt.Document.Print(g)
End If
End If
// close it
Call pdf.CloseFile
By using PageGraphics as Graphics, you can easily use Xojo's drawing commands for PDF pages and have your application output it's drawing not just to printer, but also to PDF files.
See blog post:
Code above is intentionally kept brief as all error checking is skipped. If used in real world, you may need to check e.g. if CreateNewPDF returns an error as the file could not be created.
Please do not hesitate to contact us with your questions.

New in this prerelease of the 20.3 plugins:
- Removed old RegisterMBSPlugin function taking integer parameter.
- Added ValidNotBefore and ValidNotAfter properties for X509MBS class.
- Updated VLC to version 3.0.11.
- Fixed crash in Tracks function in VLCMediaMBS class.
- Added EncodeBase64URLMBS and DecodeBase64URLMBS functions.
- Added JWT RS 256 example project to sign or verify.
- Added GetFileContents with isPath parameter to WinDataObjectMBS class.
- Fixed a crash with cleanup of SQL clients for SQLConnectionMBS and SQLDatabaseMBS.
- Added SubTitle, toolbarStyle and titlebarSeparatorStyle properties to NSWindowMBS class.
- Added mediaType and pageZoom properties to WKWebViewMBS class.
- Added PDFData method to WKWebViewMBS class.
- Updated DynaPDF to version 4.0.40.116.
- Added kcoResetAnnotAppearance constant to DynaPDFMBS class.
- Added FlushPagesEx and ResetAnnotAP methods to DynaPDFMBS class.
Download:
monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.
Get the top developer tools and third party components for the Xojo cross-platform development platform at a huge savings until 31st
July August 2020.
Omegabundle for Xojo 2020 is a collection of the most useful tool sets, add-ons, digital books and components for use with Xojo Inc's Xojo development environment. If purchased separately and not including any additional offers, the total cost would be over $3,711.00. Omegabundle for Xojo 2020 costs $399.
Buy now on the Paradigma Software store.
Xojo is an award-winning, cross-platform development tool for the Desktop (macOS, Windows, Linux), Web, iOS (iPad/iPhone) and Raspberry Pi. With Xojo, you can create native applications by using drag-and-drop to build your user interface and then one straight-forward programming language to enable the functionality. Xojo is powerful and modern, yet easy to use and learn.
(more)
On my next visit to Vienna, we plan another developer meeting:
Wer hat Interesse an einem Xojo Entwicklertreffen nächste Woche in Wien?
ca. 18 bis 21 Uhr.
Einfach gemütlich zusammen sitzen in einem Restaurant oder Biergarten und über Xojo plaudern.
Gerne zeige ich auch neue Pluginfunktionen oder helfe bei Problemen mit Xojo Projekten. Einfach Computer mitbringen und was zeigen.
Wer noch dabei sein möchte, bitte bei der
Umfrage eintragen.
Recently a client asked about JWT signatures. So we created an example project to create and verify JWT RS256 signatures in Xojo. This includes new EncodeBase64URLMBS and DecodeBase64URLMBS functions in MBS Xojo Encryption Plugin. We use SignData function in OpenSSLMBS class to sign the data and later use VerifyData function to verify the signature.
Create Signature
This example code takes values from fields on the window and creates the signature to show it in another field:
Sub Create()
// take values from fields and make sure encoding is right and line endings
Dim Header As String = Self.Header.Text.ConvertEncoding(encodings.UTF8)
Dim Payload As String = Self.Payload.Text.ConvertEncoding(encodings.UTF8)
Dim PrivateKey As String = ReplaceLineEndings(Self.PrivateKey.Text, EndOfLine.UNIX).ConvertEncoding(encodings.UTF8)
Dim Password As String = Self.Password.Text.ConvertEncoding(encodings.UTF8)
// now prepare string to sign
Dim EncodedString As String = EncodeBase64URLMBS(header) + "." + EncodeBase64URLMBS(Payload)
// sign it with RSA key and SHA 256 hash
Dim Signature As String = OpenSSLMBS.SignData(EncodedString, PrivateKey, Password, OpenSSLMBS.kAlgorithmSHA256)
// encode signature
Dim SignatureEncoded As String = EncodeBase64URLMBS(Signature)
// and build JWT RS 256 signature
Dim result As String = EncodedString + "." + SignatureEncoded
output.Text = result
End Sub
(more)

New in this prerelease of the 20.3 plugins:
Download:
monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.
We found
DebugBar, an extension for Internet Explorer and it still works in Windows 10, so we worked on an integration into Xojo as DebugBar doesn't do that as is.
For next
MBS Xojo Plugins we add the new ShowDebugBar function for
IEWebBrowserMBS class. Our plugin will look for the HTMLViewer in the window, then create a new window and host there the DebugBar component. Looks like this:
We have four tabs there. The first one allows you to inspect the DOM and you can use the green picker to select an element on the web site. If you move the mouse over one of the elements in the DOM tree, the element highlights on the website. You can also inspect styles and modify all in the text field below.
The HTTPs tab currently doesn't work, so check the Script tab, where you can see all JavaScripts, adjust them and execute some JavaScript right in the window.
There are a few issues and we'll see if we can resolve a few with the developers from DebugBar to make this as useful as possible for you. And they certainly appreciate if you
buy a DebugBar license.
See
DebugBar website
Download Features Order
Please don't hesitate to contact us with your questions.

The July/August (18.4) issue of
xDev Magazine is now available. Here's a quick preview of what's inside:
Introducing PowerXS (Part 1) by Marc Zeedar
Marc unveils his new framework cloning tool for XojoScripts that he was going to speak about at XOJO.CONNECT this year.
OOP Listbox (Part 2) by Markus Winter
Markus continues creating his object-oriented Listbox.
On the Scene Again (Part 3) by Stefanie Juchmes
More SceneKit, this time exploring solving and animating a popular brain teaser.
Porting a Mac App to iOS by Tom Baumgartner
How hard is it to port your Mac app to iOS? Tom recently did it and shows what it took.
MapKit (Part 5) by Markus Winter
Markus continues in his quest to draw maps with Xojo, this time going deeper into finding and displaying addresses.
PLUS: WWDC 2020, Xojo on Android, Web 2.0, Drag and Drop, Best of the Web, and more!
Vorübergehend bis zum Jahresende wurde in Deutschland die MWSt. von 19% auf 16% gesenkt.
Wenn Sie eine MBS Plugin Lizenz kaufen und aus Deutschland kommen, aber nicht vorsteuerabzugsberechtigt sind, können Sie ca. 2.5% sparen beim Einkaufspreis.
Für alle Geschäftskunden ändert sich effektiv nichts, weil Sie die Steuer ja verrechnet bekommen beim Vorsteuerabzug.
[English] VAT rate in Germany changed temporarily from 19% to 16%. While we appreciate a tax reduction, it's a hassle to implement for everyone with a shop, doesn't save much money for tax payers, but creates a big hole in the budget for the government.