One month till Xojo.Connect 2020 in Nashville


Just one month till the XOJO.CONNECT 2020 in Nashville, Tennessee, USA. Tickets are still available for $999 USD.



It will be held March 25-27, 2020 in Nashville, TN at the Sheraton Music City Hotel. This conferences is the best place to meet Xojo developers from around the world in real live, make contacts, present yourself as expert and learn what is new in Xojo. Tickets are available in the Xojo store and if you bring your partner, you can order an extra guest ticket for the dinner events.

Check out the conference highlights video if you want to see what it's like - or ask one of the many attendees from the forum!

Wether you are full or part time Xojo developer, this is your chance to learn all about the Web 2.0 framework, the Android progress and what's new in the Xojo world.

MBS Xojo Plugins, version 20.1pr5


New in this prerelease of the 20.1 plugins:
  • Added EvaluateMT and CallFunctionMT methods to JavaScriptEngineMBS class.
  • Added SkipMode parameter to constructors for FileListMBS class to skip over files/folders and hidden items.
  • Disabled a warning from our own check code about data size of SQLDatabaseMBS class.
  • Fixed NameFieldStringValue in NSSavePanelMBS to properly set with empty text.
  • Updated SQLAPI to version 5.0.5.
  • Changed AbsolutePathMBS (and AbsolutePath) to return directory path with double colon.
  • Fixed problem with DynaPDF's graphics class integration on Windows 64-bit when running Xojo report to PDF.
  • Fixed a problem with recursive templates for ExtractPageText and ExtractPageTextRect functions in DynaPDFMBS class.
  • Added ExifThumbnail function to GM16ImageMBS and GMImageMBS class.
  • Added ExifThumbnail property to JPEGImporterMBS class.
  • Added Looping property to MFPMediaPlayerMBS class.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

Reading JPEG Thumbnails from EXIF


For next MBS Xojo Plugins we add new methods to JPEGImporterMBS class to read thumbnail from EXIF data in a JPEG file. This allows you to very quickly get a thumbnail image. We support ScaleFactor property for some years now, which allows you to read a JPEG scaled down and get only the pixel data decompressed you need. We use this often for a preview. The time differences may be for a test image here: 5.6 milliseconds for the thumbnail at 160x120, 64 milliseconds for a preview at 504x378 and 276 milliseconds for full image at 4032x3024 pixels. So in your projects, if you need to show JPEGs quickly, you may first check for a thumbnail, then for a scaled down preview and only if user double click the entry load the whole picture.

Here some sample code:

Dim file As FolderItem = SpecialFolder.Desktop.Child("test.jpg") // first read header and check for thumbnail in EXIF Dim j As New JPEGImporterMBS j.file = file j.ReadExifData = True If j.ReadHeader Then Dim thumbnailData As String = j.ExifThumbnail If thumbnailData.LenB > 0 Then thumbnailPic = picture.FromData(thumbnailData) End If // now read a scaled down image Dim factor As Double = Min( j.Height / 300.0, j.Width / 300.0) If factor >= 8.0 Then j.ScaleFactor = 8 Elseif factor >= 4.0 Then j.ScaleFactor = 4 Else j.ScaleFactor = 2 End If j.Import Pic2 = j.Picture // finally read full image j.ScaleFactor = 0 j.Import Pic3 = j.Picture Else MsgBox j.ErrorMessage End If
Coming soon for MBS Plugins version 20.1pr5. See also CGImageSourceMBS class for MacOS to get quickly thumbnails for various image formats.

Programming your own Solar System with Xojo + MBS SceneKit


Stefanie wrote another blog post for the official Xojo blog:



Programming your own Solar System with Xojo and MBS SceneKit

If you join Xojo Connect conference next month, please come to Stefanie's presentation: Scenekit - Stefanie Juchmes, 4 pm on 26th March. Please don't hesitate to send us questions.

Upgrading WebKit for Windows support


As you may have seen Xojo 2019r3 uses a newer version of Chromium Embedded Framework for WebKit support on Windows. For us this means we have to put the upgrade of our Chromium plugin classes on the todo list.

For MBS Xojo Plugins 20.1 we upgrade our Chromium classes. You can try it with the recent 20.1pr4 pre-release version.

The changes include a few fixes for ChromiumCookieManagerMBS and ChromiumWebPluginInfoMBS class which both had crashing bugs, but seem to work fine now. You guys can be happy to use a high level language like Xojo where the compiler always makes sure your delegates have the right parameters as any mismatch can cause hard to track bugs later. Luckily we fixed it and now leverage C++ compiler to test those, too.

With newer plugin you can use Chromium with all Xojo versions since the introduction of WebKit support. We now support 3 different versions of the Chromium Embedded Framework used by Xojo with the same plugin. When you start using the plugin classes, we check which CEF version is used and use the right function pointers. Enjoy!

MBS Xojo Plugins, version 20.1pr4


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

Improve your work live balance with do not disturb


To improve the balance between work and live, some simple things can help:

First, it's a great idea to set a rule in the household to have no phones for meals. So I just leave my iPhone in the office, so it doesn't grab my attention. Some families have baskets for the phones so when you enter kitchen, you put it there. We'll see if we do this when our children get older and we get more devices.

Next figure out the time you allow others to disturb you. The default setting for iOS is to be silent between 22:00 at night and 7:00 o'clock in the morning. Now it seems to work better for me to move those times to 20:00 and 9:00 o'clock. In the morning I may get up long before 9, but to get ready, have breakfast and read through emails, it may be 9 when I am ready to take calls.

For the evening it's difficult alone to get away from work and not work till midnight, but at least the iPhone won't disturb me when I am busy doing some focused work, or watch a movie with my family.

What do you do to get some rest from screens?

Multithreaded plugin functions can increase speed of Xojo application


Have you seen the "NSImageMBS multithreading" or "Threaded Encryption and Hashes" example projects in Xojo?


Do you notice that with 4 Xojo threads, the plugin can actually get 4 CPU cores busy and get work done faster?

Over the last releases we added quite a few MT methods. Those are plugin methods which perform work on a preemptive thread. The Xojo thread calling them yields CPU time to other threads while it waits for the preemptive thread to finish work. And if you use several threads in Xojo already, this will help you keep more CPU cores busy. (more)

Building slides for Xojo.Connect


As a speaker you should now take the time to prepare slides a month before the XOJO.CONNECT conference in Nashville, Tennessee, USA.
What is your favorite MBS Plugin feature from the last 12 months we should highlight?



It will be held March 25-27, 2020 in Nashville, TN at the Sheraton Music City Hotel. This conferences is the best place to meet Xojo developers from around the world in real live, make contacts, present yourself as expert and learn what is new in Xojo. Tickets are available in the Xojo store and if you bring your partner, you can order an extra guest ticket for the dinner events.

Check out the conference highlights video if you want to see what it's like - or ask one of the many attendees from the forum!

Wether you are full or part time Xojo developer, this is your chance to learn all about the Web 2.0 framework, the Android progress and what's new in the Xojo world.

MBS Xojo Plugins, version 20.1pr3


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

Customized File Open and Save Dialogs for Windows


This week, I learnt a lot about the APIs from Microsoft for open and save dialogs. For Xojo we got new WinFileOpenDialogMBS and WinFileSaveDialogMBS classes. Both are based on WinFileDialogMBS class and report errors via WinFileDialogExceptionMBS. To return items, we use WinShellItemMBS class and WinShellItemArrayMBS for a list of items. To define file types, we got the WinFileTypeMBS class. The dialog may look like this:



We customized the title, the OK button, the label for the file name and added a list of file types to fill the file types popup menu. As you see there are custom controls on the dialog with two text fields and a checkbox with a popupmenu below. We added a lot of events for the WinFileDialogMBS class, so you not just learn about changed selections, folder changes, but also about events to custom controls. In the CheckButtonToggled event as an example we can react on the checkbox and enable/disable the popupmenu below.

While most people are happy with the built-in OpenFileDialog and SaveFileDialog classes, our plugin classes offer many more features for Windows specific projects. Please check NSOpenPanelMBS and NSSavePanelMBS classes for MacOS to do similar things. And we still have OpenDialogMBS as a cross platform class.

The example project with a lot of settings:



Please try soon with next prerelease of MBS Xojo Plugins 20.1.

Our JavaScript engine, a game changer


Yesterday Sean Beach, one of our clients in New York emailed me back about our JavaScript integration. To quote him:

"Wanted to follow back and say that this plugin is a game changer for my showcontrol product. Thanks so much!”

The discussion was about our JavaScript functions and a couple of his questions got answered in our Tips for our JavaScript functions blog post:

"This document is fantastic, and actually answers most of my questions from the previous email."

We are delighted about the feedback we got!

The same day Stefanie got two of her latest articles published about using JavaScript to calculate distances.

On our FileMaker blog the version using our FileMaker Plugin:
FileMaker and JavaScript - the perfect combination

And even on the official Xojo blog an article about our Xojo class to run JavaScript:
Xojo and JavaScript – A Perfect Combination

We are happy to see that our JavaScript integration is so well received by clients from around the world. And it just started with a hint from one user in early December to take a look into this topic.

Check out the JavaScriptEngineMBS class for Xojo and the JavaScript functions for FileMaker!

20 Years Monkeybread Software Party


This year in April our company will turn 20 years old.
We'll plan to have a big party here in Germany near our office with over 100 guests.

Today we send invitations to guests who have not yet responded.

If you like to join and you miss an invitation, you can contact us and ask whether your invitation got lost.

As people confirm they are coming, we'll add them to the guest list. If we run out of space, we may put people on the wait list.
If you can't make it, please respond soon, so we don't need to contact you again later.

MBS Xojo Plugins, version 20.1pr2


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

Airplay related classes for AVFoundation


For MacOS, we add AVRouteDetectorMBS class to detect if multiple routes are available, e.g. for Airplay.
And for MacOS 10.15 we add AVRoutePickerViewControlMBS control to show the standard control from Apple to select the output device:



If you have an Airplay enabled device, it should show up in the popup menu.
Our example project uses AVRouteDetectorMBS class to detect if multiple routes are available. If that is true, we show the AVRoutePickerViewControlMBS control and let the user pick the destination for the current video player.

Tips for our JavaScript functions


Here a few tips we recently learnt for our JavaScript engine based on Duktape in the MBS Plugins for FileMaker and Xojo:
  1. Use performance.now() to get time within JavaScript and measure how long something takes. Here an example where we measure how many milli seconds it takes to run a loop one million times:
    function testFunction() {
        for (var i = 0; i < 1e6; i++) {}
    }
    
    var t1 = performance.now();
    testFunction();
    var t2 = performance.now();
    
    Print('test took: ' + (t2 - t1) + ' milliseconds');
  2. All global functions and properties in JavaScript are attached to the global object. You can access them explicitly via globalThis keyword.
  3. List global properties via JavaScript:
    Var list = Object.keys(globalThis);
    The list will include all global names including functions like Print registered by MBS Plugin.
  4. Check Duktape.version for the version number. If we update the engine, you can check the version number and compare. Currently the value is 20500 for version 2.5.
  5. Use unicode escapes in strings if needed to mask special characters. While the engine handles UTF-8 fine, you can escape some characters with \u followed with a hex 4 digit number, e.g.
  6. n = '\u0041';
    Which will assign "A" to variable n.
  7. Use built-in functions to encode text as hex or base64 via Duktape.enc:
    Duktape.enc('base64', 'Hello')
    This returns "SGVsbG8=".
  8. Use Duktape.dec and TextDecoder class to decode base64/hex encoded text to UTF-8 string:
    var result = new TextDecoder().decode(Duktape.dec('base64', 'Zm9v'));
    Result is now a variable with text "foo".
  9. Access call stack with Duktape.act function. Query Duktape.act(i) with various values of i. Pass -1 for the act() call, -2 for the current function and -3 for the caller of current function. The returned object contains properties for lineNumber and function. When you query function.name, you get the name of the function.
  10. Add console object if needed. You can add a console object and include a log function, which sends arguments to a Print function:
    console = { log: function() { Print(Array.prototype.join.call(arguments, ' ')); } };
  11. Provide environment some JavaScript may need. If some JavaScript expects a global window object to store something, you can simply create a dummy one:
    window = {};
    This may not provide functionality, but allows at least code to check for this to work.
  12. Prefer functions over evaluating code. Code in functions is parsed and uses registers for the virtual machine, while code evaluated may use named variables, so if you can put your code in a function and just evaluate the function call, things may execute a bit faster.
  13. Be aware all numbers in JavaScript are doubles. Evaluate "9999999999999999" and you get "10000000000000000" back. Comparing numbers may not give the result you expect as "0.1+0.2==0.3" evaluates to false.
If you have questions, please do not hesitate to contact us. See also JS.Evaluate and related JavaScript functions in MBS FileMaker Plugin and JavaScriptEngineMBS class in MBS Xojo Plugins.

17 Years Xojo Developer Magazine


Did you notice that over the last 17 years we got 103 issues of the Xojo developer magazine?



As you know the magazine is more up to date than any book and we highly recommend a subscription for all Xojo developers. Keep up to date on news, development best practice and learn tips and tricks.

Today you get all 103 back issues with 7360 pages in total including 400 pages mentioning MBS classes, modules or controls. Check the Welcome to Xojo bundle for new users.

You need a subscription? Contact us via form before 5th Feb 2020 to win one of three short subscriptions (3 issues).

Archives

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