« Rewritten Phidgets Pl… | Home | Query custom function… »

News from the MBS Xojo Plugins Version 22.0

In this article I want to introduce you the new functionalities from the MBS Xojo Plugins in version 22.0.

Scintilla

With the new part Scintilla you get a text code editor at your fingertips. With the DesktopScintillaControlMBS control and the ScintillaControlMBS control you can integrate the text editor into your solutions. You can not only write simple texts but also mark special keywords. Scintilla provides lexers for well-known programming and markup languages, which you can load as needed.

It provides lexers for syntax highlighting in over 100 languages including SQL, JavaScript and HTML. We added a Xojo lexer to highlight code for XojoScript. You can also specify your own keywords that will be highlighted in your texts. Scintilla supports not only the highlighting of words but also features that other script editors have, such as setting breakpoints or showing and hiding parts of the script for better clarity. The Advanced Script Editor in your application. Test it out!

Dyna PDF

There are also innovations in the DynaPDF area. Sometimes it can be quite difficult to display fonts the way you want them to be displayed, especially when there is the factor of two different output languages. You can now create an alternate font list. These glyphs are used when the desired font cannot be used. Multiple lists can be created because different fonts and languages require different fallback fonts. For example, one could create a list for proportional fonts and another one for fixed pitch fonts, or different lists for different languages. Each list can be activated or deactivated with ActivateAltFontList as often as you like. Changing the active alternate font list is very fast and causes no overhead. Once a font list was created it can be filled with data with SetAltFonts. A font list that is no longer needed can be deleted with DeleteAltFontList. Alternate font list are tested if one more glyphs were not found in the current font. Since the fonts in the list are used as fallback they should be compatible to the active font in regard to properties like serif, sans serif, proportional or fixed pitch, and so on. A list should be sorted by priority and not by name. That means index 0 should contain a font name that is most probably the best match. If this one was not available or incompatible then the next font in the list will be tested until the end of the list was reached. If no suitable font was found then system fonts are tested. The fonts in the list should support the language that must be output. Otherwise, the fonts can never be selected. An alternate font list can be arbitrary large but it is usually best to restrict the number fonts in a list to speed up processing.

With the new method DeleteOCUINode we can remove an existing Optional Content User Interface Node from the PDF. This will be removed from the display tree of the current layer. If you specify a 0 as index the whole tree will be deleted. If you want to use OCUINs and you have imported a PDF document with ImportPDFFile into your working environment, you have to call the ImportOCProperties method to import the Optional Content Properties.

LCMS

We also have some new features for our LCMS2 section. This area allows colormatching without synchronization. An important area in this topic is of course the alpha channel of a graphic. This is now supported by the new features. Alpha channels can be calculated in two different ways. Once straight and once pre-multiplied. With the straight kind it often comes to imprecision in the alpha channel. Pre-multiplied alpha allows correct filtering and blending. The PREMUL_SH and T_PREMUL methods from the LCMS2MBS module now support pre-multiplied conversions. The new helper method DetectRGBProfileGamma can try to calculate the gamme level.

DesktopWindow

For Xojo 2021r3 we added over 100 more methods to take DesktopWindow instead of just Window, so you can pass whatever you prefer. A couple of window properties got changed to Variant, so you can assign either there. We adjusted event names of our Desktop Controls to match Xojo's event names and changed the view of our controls in the IDE.

New functionalities for Mac and iOS users

The MBS Xojo Plugins in version 22.0 offers some more new features for Mac and iOS users

Cocoa Text

There is also news from the Cocoa Text area which deals with styled text handling in Cocoa. We have 2 new classes in this section which are derived from the new class NSTextBlockMBS. A text block appears as an attribute of a paragraph, and as part of the paragraph style. The most important subclass of NSTextBlockMBS is NSTextTableBlockMBS, which represents a block of text that appears as a cell in a table. The table itself is a NSTextTable object. All NSTextBlockMBS objects reference this table, which controls their sizing and positioning. With the method setTextBlocks from the class NSMutableParagraphStyleMBS we can set such a text block. With the method textBlocks from the class NSParagraphStyleMBS we get back a text block that contains a certain paragraph.

WKWebviewer

Now we come to the new features of WebKit2. We can display a file upload panel. For this we use the runOpenPanelWithParameters event in WKWebViewControlMBS control. To get the result afterwards call the runOpenPanelWithParametersCompleted method later. The new event only works in macOS 64-bit applications.

MapView Show all Annotations

Since some versions we have the possibility to integrate Apple maps into our Xojo applications on the Mac. Among other things, annotations can be displayed on the map, for example in the shape of pins. If we now want to display all annotations at a glance, we have the new method ShowAllAnnotations in MKMapViewMBS class. It zooms the map to show all annotations. The plugin loops over the annotations to calculate a bounding rectangle for all annotations and zooms the map to make them all visible with some border space around.

Events, Contacts and Calendar

The events section has also received some new functionalities. You can use the new method locationWithMapItem to create new structured locations with MapKit items. This Location can be used to trigger the alarm of a calendar item. We can use the new method structuredLocation from the EKEventMBS class to pass this location.

You can use the new property birthdayContactIdentifier of the class EKEventMBS to get the contact ID of a birthday event, so you can display the current birthdays with name, address and phone number to send a flower greeting or to call the birthday child to congratulate him personally.

There is also news from the Contacts section. We have here the new class CNChangeHistoryEventMBS. This is super class for many other classes. These classes indicate if something has changed in a contact or a group, for example if a new contact has been added. With the new method ChangeHistoryEvents from the new CNFetchResultMBS class we can fetch these change items. We then get the name of the class, which tells us something about whether a contact or group has been added, deleted or changed. We get an instance of the CNFetchResultMBS class from the new methods enumeratorForContactFetchRequest and enumeratorForChangeHistoryFetchRequest from the CNContactStoreMBS class. Both methods execute the given fetch request and return an enumerator for the results.

Property Bag functionality for Windows user

There is also a new feature for Windows users. We have two new methods in the DirectShowPropertyBagMBS class. First, we can use CountProperties to read the number of properties located in the property bag. With the method PropertyName we get the name of a specific property by specifying the index in the parameters.

We hope you will also find some interesting new features. We wish you a lot of fun with MBS Xojo Plugins version 22.0. If you need a licence or have any questions, please contact us.

03 02 22 - 11:32