xDev Magazine Issue 16.5

The September/October (16.5) issue of xDev Magazine is now available. Here's a quick preview of what's inside:

**Reports Revisited** by Ulrich Bogun and Martin Trippensee
Xojo's built-in reporting gets flack for not being full-featured, but it's more powerful than you think. Ulrich and Martin have figured out a way to hack it for better reports!

**An Excel Database** by Paul Budd
Should you use Excel as a database? Probably not. But you can, and there are times (like when you aren't in control of the decisions), that it's useful to be able to use SQL to query a spreadsheet.

**Give Yourself to the Dark Side, Part V** by Sam Rowlands
Sam's article a few issues ago on "Dark Mode" sliders was derailed by Apple's changes with MacOS Mojave, so he's back to revise his methods.

**Refactoring a Controller Module, Part 2** by JC Cruz
Jose continues his explanation on how to refactor a controller module to support other models without breaking existing code.

*PLUS*: Progressbars, connecting to databases, Xojo 2018r2, hierarchies in a data mart, HavIBeenPwned, and more!

Meet Marc Zeedar, publisher of the xDev Magazine at the MBS Xojo Conference in Munich.

Live barcode detection with Xojo for MacOS

As you may know we have the AVFoundation classes to capture video from camera including functions for live getting a picture. You can pass that picture to CIDetectorMBS class to detect faces, QRCodes, texts or rectangles. Now we got a new option to have the detection running on a preemptive thread to keep the Xojo app more responsive:

We get live image in background thread, pass it to detector and get you the captureOutputDidOutputSampleBuffer event with detected features as parameter. This way you can do live detection with high performance.

If you need more, you can always get current frame on Mac & Windows and pass yourself to TesseractMBS class or zxingMultiFormatReaderMBS class yourself to detect text or barcodes.

Coming soon in next prerelease of MBS Xojo Plugins 18.4.

MBS Xojo Plugins, version 18.4pr5

New in this prerelease of the 18.4 plugins:
  • Changed ID used in code signatures to match the ID in the info.plist of the plugin dylibs for Mac App Store checks.
  • Changed plugins to load LDAP framework dynamically instead of linking to it directly.
  • Updated Growl Windows code to work better with 64-bit and TCP mode. WindowsGrowlMBS class is now cross platform.
  • Added filter methods to NSViewMBS.
  • Added AVPlayerMBS Playing property.
  • Added more convenience functions for Contacts classes: allContacts, AllFetchKeys, unifiedContactsMatchingPredicate, unifiedContactWithIdentifier, unifiedMeContact for CNContactStoreMBS class and new CNContactFetchRequestMBS constructor.
  • Updated LibXML2 to version 2.9.8.
  • Added CNContactStoreMBS.groupsByName and CNContactStoreMBS.groupsForContact functions.
  • New BitRotateMBS function is now threaded, so it will use 2 to 4 threads to do work faster.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

HTMLViewer JavaScript communication for Xojo

The MBS Xojo Plugins provide various functions for HTMLViewer to use JavaScript in Xojo applications. Here a few details on the various ways to run JavaScript in the HTMLViewer in Xojo.

So we have WebViewMBS class (WebKit 1.x), WKWebViewControlMBS control (WebKit 2.x), Internet Explorer methods on HTMLViewer, ChromiumBrowserMBS class for Chromium Embedded Framework and LinuxWebViewMBS class for WebKit on Linux. (more)

NSProgressIndicator with colors in Xojo

Please take a look on the following progress indicators:

The example project for this applies CoreImage filters to the standard control to change it's colors.
Coming with next MBS Xojo Plugin prerelease. Or email us, if you like to try today.

Playing with LibXSLT

For our plugins I updated libxml2 to a newer version. And while doing that, I saw there is also libxslt available, which can be used together with libxml2 to support XSLT.

So I built LibXLST for all platforms (2x Mac, 4x iOS, 3x Linux and 2x Windows!) for me. Once the libraries can be linked to the plugin, I started make a new function for the MBS FileMaker Plugin: XML.ApplyStylesheet.

It allows you to apply a style sheet to an XML document and transform the XML to something new. Fore example you transform from one XML to other. This includes transforming XML to just text or html text. We'll certainly include a few examples with next plugins.

If you have ideas for more functions, please let me know.

By the way XSLT 2.0 is a common wish, but the problem is that there aren't many libraries for C/C++ doing that. And for example the Saxon library is quite expensive for redistribution.

Xojo has such a function built-in: XMLDocument.Transform, so no need currently for a plugin there.

MBS Xojo Plugins, version 18.4pr4

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

Why you need the Migration Assistant to move to a new Mac

Over the years I enjoyed to clone disks on my Macs. It's always good to make copies of everything with Carbon Copy Cloner or similar applications. You have a backup disk handy to boot your Mac in case of an emergency. External SSDs with USB-C or Thunderbolt interfaces got cheaper. Time Machine and an online backup are also useful, but serve a different thing. Usually before you move your stuff to a new Mac, you may want to make a copy to one of your external disks.

There are two problems with restoring from a clone to a new Mac. First, you have sometimes a MacOS version mismatch. The 10.13.6 coming with a new MacBook Pro is not the same as the one coming for an older MacOS 10.13.6. Probably some newer drivers are missing.

Second, there are Secure Tokens. If you format a Mac disk and clone from a backup, you don't get your secure tokens for the admin users. So you can't enable things like File Vault. Your user is not trusted by the OS itself. You have to go through the normal OS installer to install a fresh copy of MacOS and the installer will grant a secure token to the first user you create, later all new admin users you create get one, too. The migration assistant also grants the secure token automatically, so you get it. But if you just clone, there is no way get one.

And now a speed tip for migration assistant. You want a fast connection to clone. The fastest you can get on a Mac is usually Thunderbolt 3 with 20 Gigabits. So connect both Macs with a new Thunderbolt cable. If one Mac is older, maybe Thunderbolt 2, maybe with adapter for 10 Gigabit. If not Thunderbolt, use a good Ethernet cable, so you get gigabit connection. The worst may be to have an older Wifi network and doing migration with a 50 MBs connection.

Good luck with migration!
Keep a backup of the old state for some time in case something missed to copy to the new Mac.

MBS Xojo Plugins, version 18.4pr3

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

Line Wrap for Textarea in Xojo Mac applications

Today we have a method for you to turn on/off line wrapping in a Textarea control in a Xojo Mac application by using NSTextContainerMBS and NSScrollViewMBS classes with NSTextViewMBS class in our MBS Xojo MacCocoa Plugin:

Sub SetLineWrap(TextView as NSTextViewMBS, isWrap as Boolean) dim cLargeNum as Double = 10000000 dim myScrollView as NSScrollViewMBS = TextView.enclosingScrollView dim myTextContainer as NSTextContainerMBS = TextView.textContainer if not isWrap then myScrollView.hasHorizontalScroller = True myScrollView.autoresizingMask = TextView.NSViewHeightSizable+TextView.NSViewWidthSizable myTextContainer.containerSize = NSMakeSizeMBS(cLargeNum, cLargeNum) myTextContainer.widthTracksTextView = false TextView.setMaxSize(cLargeNum, cLargeNum) TextView.isHorizontallyResizable = True TextView.autoresizingMask = TextView.NSViewNotSizable else myScrollView.hasHorizontalScroller = False myScrollView.autoresizingMask = 0 myTextContainer.containerSize = NSMakeSizeMBS(myTextContainer.containerSize.Width, cLargeNum) myTextContainer.widthTracksTextView = True TextView.setMaxSize(TextView.visibleRect.Width, cLargeNum) TextView.isHorizontallyResizable = false TextView.autoresizingMask = TextView.NSViewHeightSizable+TextView.NSViewWidthSizable end if TextView.needsDisplay = True End Sub
As you see the main difference between both modes is whether the text content view resizes with the the textarea control. Normally it does, but to disable line wrap, we disable that and allow it to size to a huge size horizontally.

New MacBook Pro tested

We got a new MacBook Pro to test here with Core i9 CPU. This is really a mobile powerhouse and you can easily get all 12 cores busy with some real work. It looks like the MacBook Pro can do that load for half an hour easily. Yes, it may get warm above the keyboard, but it stays cold for the lower parts.

While battery may be advertised as running for 10 hours with normal usage like web surfing, well at the full work load, e.g. while compiling large project with Xcode, it may only run 70 minutes till the battery is empty. And that is to be expected as the 83.6 watt-hour battery can only deliver the 50 to 60 watts needs for the CPU for just over an hour.

GeekBench shows 4058 for Single-Core Score and 13845 for Multi-Core Score on the older MacBook Pro (15 inch, 2016) with Core i7 @2.9 GHz.

The new MacBook Pro 15 inch with Core i9 @2.9 GHz shows 5430 Single-Core Score and 23700 Multi-Core Score.

To compare, the 2 year newer model is 33% faster single-core and 70% faster multi-core.

We do not see any speed problems with the CPU and look forward to let this machine increase our productivity with more RAM and CPU power on the go than we ever had before.

AVCaptureVideoDataOutput improvements

We have the AVCaptureVideoDataOutputMBS Class in MBS Xojo AVFoundation Plugin. This class allows you to get live data from the camera as CMSampleBufferMBS objects. Now this was a bit slow as we did all the processing on the main thread. But for doing something useful in 30fps, you need time on the main thread for your Xojo app and we need to move as much work as possible of the heavy work away from the main thread.

So for next pre-release we cache properties in CVImageBufferMBS class. If you query NSImageMBS, JPEGData or CIImageMBS there, we will create them for you and remember the values, so in case you call the methods again, we have the values directly available and don't recreate them.

As conversion of the camera data (e.g. in YUV format) to RGB may be expensive, we want to do the conversion on the preemptive threads. So we added PrepareCIImage, PrepareJPEGData and PrepareNSImage properties to AVCaptureVideoDataOutputMBS class. If you set them, we will do the part of the work you requested on the preemptive thread and than pre-fill CMSampleBufferMBS and CVImageBufferMBS with the data, so query calls on the properties will be very quick.

This does not reduce the CPU time needed for the whole app, but moves more work to other threads, so you have more time on the main thread for your application doing something with the video.

If you plan to display video, please do not draw it yourself to a canvas, but use the AVCaptureVideoPreviewLayerMBS class or the AVCaptureViewControlMBS control (the control is 64-bit only).

If you know other places, where we could do processing on background thread and call event later on main thread with results, please let us know.

MBS Xojo Plugins, version 18.4pr2

New in this prerelease of the 18.4 plugins:
  • Added CancelAllCommands and Commands methods for SQLConnectionMBS and SQLDatabaseMBS clases.
  • Changed CURL functions to turn gzip decompression on by default and follow redirections.
  • Deprecated EnumHostFont functions in DynaPDFMBS in favor of newer GetSysFontInfos functions.
  • Changed DynaPDFMBS.Error event to not run in preemptive thread while MT method runs.
  • Fixed bug with DynaPDFMBS.GetSysFontInfo skipping one font.
  • Changed HotKeyMBS to not link to Carbon framework for use in Mac App Store.
  • Changed DynaPDFMBS.CreateTable to automatically load font Helvetica, so you have a font defined, if you don't set one yourself.
  • Updated DynaPDF to version
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

Omegabundle 2018 for Xojo extended

Omegabundle for Xojo 2018 Developer Tools Bundle Announced; Save 89% on Top Tools
Due to request of some buyers who missed first deadline, we extend the offer for another two weeks.

You can buy it several times, e.g. one for each of your developers. Or buy multiple copies to get more than one OS for Valentina Server.

Read More

Xojo 2018 Release 2

A new release of Xojo is now available for download. With over 160 changes and improvements, this release focuses on optimizations and fixes, particularly for Windows and iOS.

Xojo 2018 Release 2 includes:
  • Continued Windows optimizations
  • iOS Improvements, such as:
    • iOSTable supports pull-to-refresh
    • iOSTable better supports varying row heights with iOSCustomTableCellviOSView supports large titles on iOS 11+
    • iOSHTMLViewer now uses WKWebView for better compatibility
  • Added SpecialFolder.Resources and GetResource methods
  • SQLiteDatabase updated to 3.23.1
  • HTMLViewer uses WebKit2 on Linux (if available) and latest Chromium Embedded Framework 3 on Windows (when WebKit is selected)
The complete list of improvements can be found in the release notes in the product download.

Due to the changes in the graphics class and the WebKit upgrade for Windows, please use latest MBS Plugins 18.3 or better 18.4 prerelease.

MBS Xojo Conference in Munich next month

Just one month till the start of our European MBS Xojo Conference 2018.

Over fifty developers from twelve countries are signed up including Xojo CEO Geoff Perlman and Xojo Evangelist Paul Lefebvre.

The schedule:

Sep 4thDayoptional sight seeing tour
Sep 4thEveningoptional get-together with everyone arriving early
Sep 5thDayoptional Xojo training (English)
Eveningoptional get-together with everyone arriving early
Sep 6th9:00 to 18:00First day of conference with keynotes
EveningDinner event in Augustiner Keller
Sep 7th9:00 to 18:00Second day of conference with more sessions
Eveningoptional dinner together

We all look forward to presentations about Android, the new Web Framework other news in the Xojo keynote.

Register here. Attending the conference costs regularly 699 Euro plus VAT, including food and beverage in the Maritim Hotel as well as an accompanying social program.

Sessions are to be held in English. Our conference is conceived as a networking event for the Xojo community. The conference is an ideal opportunity for sharing your thoughts and your own development experience with fellow users and developers. If you like to hold a presentation, please contact us as soon as possible.

PS: OmegaBundle includes a transferable coupon to save 100 Euro on the registration fee.

MBS Xojo Plugins, version 18.4pr1

New in this prerelease of the 18.4 plugins: Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.
The biggest plugin in space...


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