News from the MBS Xojo Plugins in Version 25.4
In this article I want to introduce you the new functionalities from the MBS Xojo Plugins in version 25.4.
Math
The Int128MBS and UInt128MBS classes are brand new and allow you to handle large 128-bit numbers. You can use them with or without a sign. The classes also provide operations for working with these numbers. If you are interested in this topic, please take a look at our blog article 128-bit math in Xojo.
Favicon
When you are surfing the Internet, you will often see small images displayed next to website names. These small images are called favicons. You can now query them in the WebView for a website. To do this, use the GetFavicon methods from the DesktopWebView2ControlMBS and WebView2ControlMBS classes to get the actual image data of the favicon. This method raises the FaviconCompleted events. Then we have the new FaviconChanged events from the same classes. When the favicon had a different URL than the previous URL, this event is raised. The events give us the data as JPEG or PNG data. You can find the current URI for a favicon in the FaviconURI property.
WordFile
You can also use the plugins to influence Word files. If the Word file contains changes, it may log which text was deleted. We skip deleted text by default. But now you can decide for yourself. The SkipDeletedText method from the WordFileMBS class is available for this purpose. It sets whether to skip deleted text with a Boolean value.
Phyton
We can set a new recursion limit with the new RecursionLimit property from the PythonMBS class. By default, the recursion level you use is set to 1000 recursions. If your project requires more than this, you can now extend it.
New functionalities for Mac
The MBS Xojo Plugins in version 25.4 offers some more new features for Mac users.
Store Kit 2
For years we had support for in-app purchases in MBS Xojo Plugins using the StoreKit framework from Apple for macOS or iOS. You can use that to have users try your application and then pay for them to unlock the full version of the app. The StoreKit framework got deprecated, but is still working well. But MBS wouldn't be MBS if we didn't try to provide you with the latest features as quickly as possible. So you can now use StoreKit2MBS. Most features require macOS 12 and iOS 15 or newer. Please also see our blog article StoreKit 2 for Xojo.
NS Responder
For the NSResponderMBS class, which is the parent class of many event and command processing classes for iOS and Mac, we have added the new insertText method, which inserts text into a responder, e.g., into a search field's text editor.
Var currentEditor As NSTextMBS = NSSearchFieldControlMBS1.View.currentEditor If currentEditor <> Nil Then // we are in edit mode currentEditor.insertText "Hello" End If
Photo Library
We also have a new method for you in the PHPhotoLibraryMBS class: performChangesAndWait. We perform a block that requests changes to be made in the photo library. Previously, these changes ran asynchronously with the performChanges method. Now, with performChangesAndWait, we have a synchronous method that waits until the changes have been made and then returns a true result in case of success.
System Information
In some cases, it can be very useful to know which Mac you are currently using. For these cases, you can now use the MacProductName method from the SystemInformationMBS class. It queries the product name of the Mac we are working on.
Also new in the same class is the MacProductSOCName method. It provides us with the name of the system on chip in the current Mac.
MessageBox _ SystemInformationMBS.MacProductName + EndOfLine + _ SystemInformationMBS.MacProductSOCName + EndOfLine + _ SystemInformationMBS.MacModel + EndOfLine + _ SystemInformationMBS.ComputerName
UI View
We also added the methods beginAppearanceTransition and endAppearanceTransition to UIViewControllerMBS class for iOS. Them tells a child controller its appearance is about to change or its appearance has changed. If you are implementing a custom container controller, use this method to tell the child that its views are about to appear or disappear.
New functionalities for Windows
Also we offer new features for Windows users
WMI
For WMI queries, we updated the WMIObjectMBS class. Use the new functions to query properties with arrays directly. Previously we could only read array properties with strings. The following methods are now available to assist you in your work:
- GetPropertyBooleanArray
- GetPropertyDoubleArray
- GetPropertyInt16Array
- GetPropertyInt32Array
- GetPropertyInt64Array
- GetPropertyInt8Array
- GetPropertySingleArray
- GetPropertyUInt16Array
- GetPropertyUInt32Array
- GetPropertyUInt64Array
- GetPropertyUInt8Array
All these values will be cast if they do not correspond to the appropriate data type.
Memory Usage
For Windows users, we have added further innovations to the DesktopWebView2ControlMBS and WebView2ControlMBS classes in addition to the favicons. Here we have the new MemoryUsageTargetLevel properties. This is where you can obtain or set the desired memory consumption level of the WebView. This is useful for inactive apps that still want to run scripts and/or keep network connections alive and therefore could not call TrySuspend and Resume to reduce memory consumption. These apps can set memory usage target level to kMemoryUsageTargetLevelLow when the app becomes inactive, and set back to kMemoryUsageTargetLevelNormal when the app becomes active.
We hope you will also find some interesting new features. We wish you a lot of fun with MBS Xojo Plugins version 25.3. If you have any Ideas for new cool features, need a license or have any questions, please contact us.