In this article I want to introduce you the new functionalities from the MBS Xojo Plugins in version 23.3.
Some of you may have already come into contact with XPath. XPath is a query language with which you can address and evaluate parts of an XML document. With the new evaluate method from the class XMLDocumentMBS, you can now perform such a query under a given XPath expression. The result is then returned to you as an object of the new XMLXPathResultMBS class. Here you can use the properties to retrieve the information.
Encryption and Hash
The encryption part has also changed, because we have a total of 49 new cipher methods from the class CipherMBS which can return a wide variety of new ciphers. Here is a list:
Also, in the DigestMBS class we have 8 new methods that can return you different digests.
In addition, we have two new methods for each of the ScintillaControlMBS and DesktopScintillaControlMBS classes. The new method MarkerDefineRGBAImage set a translucent pixmap to be used to draw the marker. You pass the number of the marker in the parameters.
Also new is the methode RegisterRGBAImage. It registers an icon for auto completion. Autocompletion list items may display an image as well as text. Each image is first registered with an integer type. Then this integer is included in the text of the list separated by a '?' from the text. For example, "fclose?2 fopen" displays image 2 before the string "fclose" and no image before "fopen". The images are in RGBA format and set with RegisterRGBAImage. The set of registered images can be cleared with ClearRegisteredImages method and the '?' separator changed with AutoCompleteSeparator property.
There are also a few new features in the DynaPDFMBS class.With the method MarkTemplateAsWatermark you mark a template as watermark. It adds additional metadata to a template so that PDF editors like Adobe Acrobat are able to identify the template as watermark. Watermarks can be deleted with Acrobat and many other PDF editors. DynaPDF can delete such watermarks too with the new DeleteWatermark methode.
Since version 8.2 we already have the method OpenTag which allows to open the specified tag so that contents can be written into it. To be able to pass even more information we now have the new method OpenTagEx. Compared to the OpenTag method we can pass additional parameters which can be set in a JSON like format.
The new method AddDPartNode allows to add document part metadata directly in the PDF document. To use the function you have to create a DPartRoot dictionary first. For this purpose the method CreateDPartRoot is available. Note that the methode will fail if a DPartRoot dictionary was already imported or created by this function. You can check whether a DPartRoot dictionary exists with the HaveDPartRoot methode.
Read out attributes with GraphicsMagick
For GraphicsMagick, we have the new Describe method in the GM16ImageMBS and GMImageMBS classes. It helps you to analys your Images. It returns the attributes of an image without having to go through the console. In the parameters you can choose between three different detailed returns. If you specify a 1 or nothing in the parameter verbos, then you get the detailed return with the attributes to the image. If we specify a 0, we will get a short information about the image. If we specify a 2, then in addition to the information of the detailed variant you can read the number of colors from your image.
In the XL topic, which deals with writing, reading and changing Excel documents without Excel installed, there are new methods. With the new methods SetColPx and SetRowPx from the XLSheetMBS class we can set the column and row height in pixels. The new method Table() from the same class gets the table parameters by name. In the parameters you can pass the name. For example headerRowCount, that describes the number of header rows showing at the top of the table. If the methode return us 0, that means that the header row is not shown. With the method AddFormatFromStyle from the XLBookMBS class we got one method more, with which we adds a new format to the workbook from a predefined style.
Also in the JSONMBS class a method has been added to make your work easier. If you have many objects in a JSON array, it can be difficult to keep track of them. To make things a bit clearer we now have the method FilterObjectArray that will scan the array for you and filter the objects in the array by the filter criterion.
Dim j As JSONMBS = JSONMBS.NewArrayNode Dim j1 As JSONMBS = JSONMBS.NewObjectNode j1.AddItemToObject "id", JSONMBS.NewNumberNode(122) j1.AddItemToObject "name", JSONMBS.NewStringNode("John") j.AddItemToArray j1 Dim j2 As JSONMBS = JSONMBS.NewObjectNode j2.AddItemToObject "id", JSONMBS.NewNumberNode(123) j2.AddItemToObject "name", JSONMBS.NewStringNode("Matt") j.AddItemToArray j2 Dim j3 As JSONMBS = JSONMBS.NewObjectNode j3.AddItemToObject "id", JSONMBS.NewNumberNode(124) j3.AddItemToObject "name", JSONMBS.NewStringNode("Bob") j.AddItemToArray j3 Dim resultArray As JSONMBS = j.FilterObjectArray("id", JSONMBS.NewNumberNode(123)) Dim firstEntry As JSONMBS = resultArray.ArrayItem(0) Break
In this example we have people with associated IDs
The new operating system Sonoma
In fall of 2023, version 14 of the new macOS operating system, Sonoma, will be released. So that you can check whether this operating system has been installed on a computer, we have already integrated the methode isSonoma from the SystemInformationMBS module in our plugins in preparation for this. This will give you a true if it is the new operating system.
New functionalities for Mac
The MBS Xojo Plugins in version 22.1 offers some more new features for Mac users
PDFKit for iOS
We have had controls for PDFKit on the desktop under macOS for a few years now. In this release we have added two controls for iOS to these controls, so that you can now view your PDFs with PDFKit on iOS too. You can read more about this in our blogpost PDF Viewer controls for iOS
Let's stay directly with the innovations for iOS. Also with the new class QLPreviewControllerMBS we get an iOS equivalent for the QLPreviewViewControlMBS class for the desktop. A QLPreviewController can display previews for many common file types, including the following:
- iWork documents
- Microsoft Office documents
- Rich text format, or RTF, documents
- PDF files
- Text files with a uniform type identifier that conforms to the public.text type. To learn more, see Uniform type identifiers.
- Comma-separated values, or CSV, files
- 3D models in the USDZ format with both standalone and AR views for viewing the model
For the Topic MobileAds we have the new class UIViewControllerMBS. An object of this class manages a view hierarchy for your UIKit app.The UIViewController class defines the shared behavior that is common to all view controllers. You rarely create instances of the UIViewController class directly. Instead, you subclass UIViewController and add the methods and properties needed to manage the view controller's view hierarchy.
A view controller's main responsibilities include the following:
- Updating the contents of the views, usually in response to changes to the underlying data
- Responding to user interactions with views
- Resizing views and managing the layout of the overall interface
- Coordinating with other objects - including other view controllers - in your app
A long time ago we add posibilities with Cocoa to handle menus. An object of the NSMenuItemMBS class represents a menuitem from the Cocoa world. Now with the new method setAction you can set a target for the menu action.
If you've always wondered what you can recognize with Apple's built-in neuronal Network Vision, then the two new features from this section are for you. With Vision we can recognize texts, barcodes but also image categories. The new method supportedIdentifiers from the class VNClassifyImageRequestMBS returns us an array with the possible categories to which an image can be assigned. The supportedSymbologies method from the VNDetectBarcodesRequestMBS class does something similar. It returns an array with the barcode names that are supported in Vision by your system.
We have also added some new properties for WebKit2. In the class WKWebViewConfigurationMBS we have the property allowsInlineMediaPlayback that holds a boolean value that indicates whether HTML5 videos play inline or use the native full-screen controller. The allowsPictureInPictureMediaPlayback property indicates whether HTML5 videos can play Picture in Picture. With limitsNavigationsToAppBoundDomains define whether the web view limits navigation to pages within the app's domain. Also you can now set if the web view should automatically upgrade supported HTTP requests to HTTPS. in addition we have two new properties in the WKPreferencesMBS class.The boolean value of ElementFullscreenEnabled tells us if a web view can display content in full screen. The siteSpecificQuirksModeEnabled property indicates whether to apply site-specific compatibility workarounds.
New functionalities for Windows
Last but not least we offer some more new features for Windows users
Working with PDF documents on Windows
We have two new controls for Windows to display previews. The DesktopWinPreviewControlMBS and its counterpart WinPreviewControlMBS. We use both controls to display PDF documents using the preview built-in on windows 10 and newer. If you want to know more about this topic please have a look at our article PDF Viewer control for Windows .
While we're on the subject of PDFs, let's move on to what's new in WindowsPDF. In 23.2 we already introduced our new WindowsPDF topic. This area is intended to support you in working with your PDFs under Windows. In this release we want to extend the area with the ConvertImage method. This method converts a picture to PNG. It is a little utility function to use Windows' built-in image encoders and decoders to convert various image formats like HEIF/HEIC to a PNG image. The return of this method is a new image as string with the bytes of a PNG image.
Synchronous swimming with Bluetooth
Let's start with the new methods which are all about the Generic Attribute Profile (GATT). Until now we could only create a new GattDeviceService based on the device ID asynchronously by using the method FromIdAsync from the class WindowsGattDeviceServiceMBS. Now we have with the method FromId the possibility to execute this creation synchronously. So the program waits until the process is finished. Similar is the new method FromDeviceId from the WindowsGattSessionMBS class. This creates a new GattSession object from the specified deviceId. Again, we previously only had the FromDeviceIdAsync method that executed the process asynchronously. With the new method this is now possible synchronously.
Matching to this we have the method FromId from the class WindowsBluetoothLEDeviceMBS. This queries a BluetoothLEDeviceMBS object for the given Id. This method is also the new synchronous counterpart to the FromIdAsync method which runs asynchronously. If we want to use the Bluetooth address instead of the ID, we use the synchronous method FromBluetoothAddress.
We hope you will also find some interesting new features. We wish you a lot of fun with MBS Xojo Plugins version 23.3. If you have any Ideas for new cool features, need a license or have any questions, please contact us.