MBS Xojo Plug-ins
The new MBS Xojo Plugins 21.2 are coming early April 2021 and include the new CDViewPortControlBaseMBS class to build a control based on ChartDirector with two connected views. 2021-03-30 ¶ Combined Components with MBS FileMaker Plugin. « Three months till Eur Home Notarized MBS Xojo Pl » Notarized MBS FileMaker Plugin When loading our plugin for FileMaker on MacOS 10.15 Catalina, you may have seen such a dialog. We now made a notarized version of the download: MBSFMPlugin93-notarized.dmg This plugin download is notarized. If you want to use the MBS Xojo DynaPDF Plugin, you need a suitable license of DynaPDF and the MBS Xojo DynaPDF Plugin. You can of course just test the plugin without a license and try all functions before you order. There are four different license levels available for DynaPDF. Which license you need depends strongly on which methods you plan to use. If you want to use the MBS Xojo DynaPDF Plugin, you need a suitable license of DynaPDF and the MBS Xojo DynaPDF Plugin. You can of course just test the plugin without a license and try all functions before you order. There are four different license levels available for DynaPDF.
In this article I want to introduce you the new functionalities from the MBS Xojo Plugins in version 21.1.
BiggerNumber and BigNumber
With BigNumber you can already process very large numbers with a high accuracy, but for some applications it can be important to have an even higher accuracy and therefore we have now BiggerNumber too. Objects of the BiggerNumberMBS class can have a floating point number with 2560 bits. They have a precision up to 617 digits behind the decimal point. Compared to a normal double value we have 5 times as many bits available. If BiggerNumberMBS is so accurate, why would you need BigNumberMBS class at all?
The answer is, if the speed of your applications is more important to you than the accuracy, use BigNumber, but if you need high accuracy, use BiggerNumber. If you use large integer numbers, use LargeNumberMBS. This class provides integer numbers up to 1200 digits long. With the innovation of BiggerNumberMBS also some mathematical formulas are added, like the calculation of cosines, sinus and tangent. There are over 30 new methods available for BiggerNumberMBS and BigNumberMBS classes.
SQL
We have some new functionalities for SQL. I have the pleasure to introduce two new methods SQLSelectAsRowSetMT and SQLSelectAsRowSet from the SQLConnectionMBS class. They work very similar. The methods execute a SQL command and return the result as RowSet object. Internally they create a SQLCommandMBS with the given command and call Execute. The difference between this both methods is that SQLSelectMT performed on a preemptive thread, so it does not block the application and can yield time to other Xojo threads. It must be called in a Xojo thread to enjoy the benefits. If it was called in main thread, the main thread will be blocked, but the other background threads keep running.
With the FindTableName method from the SQLGlobalsMBS class, we can query the table name, that we used in a SQL SELECT statement. Our example
Dim sql As String = 'SELECT First, Last FROM MyTable WHERE ID = 1'
Dim TableName As String = SQLGlobalsMBS.FindTableName(sql)
returns MyTable because it is the source table.
Also new in this class is the UnInitialize method. It is shutdown the SQL engine explicitly. You can call it if you close the App or use it with the destructor. For the use it is necessary to destroy all connections like for example all SQLDatabaseMBS and SQLConnectionMBS objects.
Finally we got support for edit and update to RecordSet class.
CURL
We have also a new property for the CURLMBS, CURLNMBS and the CURLSMBS class. In the OptionAWSSigV4 property we can set a string that makes AWS V4 signature authentication on HTTP(S) header providable. The string is the collection of specific arguments that are used for creating outgoing authentication headers.
A Second block of properties from this topic are the property hyperVersion from the classes CURLSVersionMBS, CURLVersionMBS and CURLNVersionMBS. In this property you see the Human readable string of a used hyper library.
DuckDB
We have a brand new topic area: DuckDB.
The classes from this section provide you functionality of the DuckDB engine. DuckDB is an open source database engine similar to SQLite, but with column based data storage (instead of row based like SQLite). Depending on what you do with the database, this implementation may be much faster since it is optimized to quickly walk over values in a column. Check the new DuckDatabaseMBS class. DuckDB will evolve and we may enhance the plugin classes in further releases.
JSON
For the JSONMBS class we have a few new properties. You can read the properties and can find out whether the JSON Object has a special datatype. For example you can read the property IsNumber if you want to know wether the object is a numeric value. The property will return true for numbers or false for other types like text. In the same way you can use the new properties IsArray, IsBoolean, IsNull and IsObject.
DynaPDF
For the DynaPDFImageMBS class we have also new properties that’s helps us with the color setting and the handling of Images in a PDF Document. In the property FillColor, you can define the current fill color, that is used for drawing. In the property FillColorSpace you can set the color space in which the fill color should be interpreted.
In the ImageIndex property we can read which index our image has in the PDF working environment. We can then pass this index to multiple methods. From the property ImageHandle we can read the image handler if known.
GraphicsMagick
We have two new methods for GMImage. With the GMImage.IsLoggingEnabled method we can check if the login of events is active. With the SetLogEventMask method we can decide which events are logged. You can define this events in the parameters as a string separated by comma.
GM.SetLogEventMask(„coder,annotate')
By default the logging goes to stderr. In this way on macOS you may need to run your app via Terminal to see logs there.
It is also possible to disable logging. In this case we simply enter a „none“ in the parameters.
New functionalities for Apple users
The MBS Xojo Plugins in version 21.1 offers also some new features for Apple users.
NSNetService
The new NSNetServiceMBS class and the NSNetServiceBrowserMBS class use multicast DNS to convey information about network services to and from your application. The API of NSNetServiceMBS provides a convenient way to publish the services offered by your application and to resolve the socket address for a service. The types of services you access by using NSNetServiceMBS, are the same types that you access directly by using TCPSockets. For example your local web server may advertise HTTP services, which you could look for. Applications can also define their own custom services to provide specific data to clients and use their own service names.
The NSNetServiceBrowserMBS class provides network service browser that finds published services on a network using multicast DNS. Each network service browser performs one search at a time, so if you want to perform multiple simultaneous searches, you need to use multiple network service browsers. A network service browser performs all searches asynchronously by using the current run loop to execute the search in the background. The results from the search are returned through the associated delegate object, which your client application must provide.
Memory Statistics
We have the new class MemoryStatisticsMBS. With this class we can get information about the allocated memory. From the properties we can read information like the number of free bytes, the number of used bytes or the number of total bytes. The result is then logged for example.
System.DebugLog Str(m.bytesFree)+' free, '+Str(m.bytesTotal)+' total'
Data Detection
The new class NSDataDetectorMBS offers you some new possibilities. It analyzes text for data with a special regular expression. The text is scanned for terms of daily use. So dates, addresses, links, phone numbers and transit information can be recognized.
In this example you can see, how you can use this data detection for links and Mail addresses.
At first we define the type of date we want to detect in the text. In this example Links. Mail addresses belongs to the type links. We define an NSErrorMBS object to cache possible errors. We pass the Type and error object to the Data detector Constructor. With the method matches, we search in the text, that we pass in the parameters, for links. The results is saved in an array. In the property URL in one of this result objects, we then found the URL that was detected.
Dim types As Integer = NSTextCheckingResultMBS.NSTextCheckingTypeLink
Dim Error As NSErrorMBS
Dim DataDetector As New NSDataDetectorMBS(types, error)
Dim s As String = 'Email us at john@mbs.test today!'
// look for the links now
Dim m() As NSTextCheckingResultMBS = DataDetector.matches(s, 0)
// show first link
Dim r As NSTextCheckingResultMBS = m(0)
MsgBox r.URL
PDF Kit
We have some new interesting functionalities for the PDFKit. At first we start with the PDFDocumentMBS functionalities. With the method beginFindStrings you search in a document for strings. In contrast to beginFindString we can enter an array of strings to search for.
Also we can query the attributes of the Author, the creation date, the creator, the producer, the subject and the title. In addition we have methods that display notifications like „string match is found“ in a document or a notification that writes 'operation finishes working' on a document.
For the PDFPageMBS class we have the new thumbnailOfSize method. The method returns an image of the page that is define by the object, with the size that we define in the parameters.
The PDFViewControlMBS control has some new events with which you can work in your applications. We have the new mouse events: CocoaMouseDown, CocoaMouseDrag and CocoaMouseUp. All of them fires before the regular mouse events. And work in combination with the control. For example the CocoaMouseDown fires only if the Mouse was clicked in the PDFViewControlMBS control.
Additionally we get more interesting events like: PerformFind, PerformGoToPage, PerformPrint, PrintJobTitle as String (fires when we overrides the job title), WillChangeScaleFactor and WillClickOnLink.
For the PDFViewMBS class we have also interesting methods. With the areaOfInterestForPoint method we can determine the type of the area that is currently under the mouse (as example).
The setHighlightedSelections method sets a highlighted selection. This selection behaves differently from a user selection, because when we click in another area, this area is not deselected. You have to deselect it explicitly. To deselect it, set the selection to nil.
We have over 200 new methods and properties to work with annotations. As a representative, I would like to introduce just a few here from the PDFAnnotationMBS class. The setChoices method make it possible to set choices as array. The choices are an array of strings that are indicating the options in either a list or pop-up menu. The setValue method allows us to set a key-value pair in an annotation dictionary. The key must be valid for the PDF annotation's object type, and must have a value that is acceptable for the key type.
If you want to query the line style for a given name the lineStyleFromName method can be used. In the opposite you can use nameForLineStyle to query the name for a line style.
New functionalities for Windows users
Last but not least I want to introduce the new functionalities for Windows users.
Direct Show
Some of the innovations can be found in the DirectShow section, which is for video recording on Windows. The method AMVideoControl from the DirectShowBaseFilterMBS class queries the video controls for this filter.
In the DirectShowCaptureGraphBuilderMBS class we get the new method FindPin that retrieves a particular pin on a filter, or determines whether a given pin matches the specified criteria. In the parameters we set the pin direction, so we can set if it is an input or an output pin. As result of the method we get a pin object. Typically, an application will not need to use this method. It is provided for unusually complex tasks, when the RenderStream method cannot build the filter graph. Use this method to retrieve a desired pin from a capture filter, and then build the rest of the graph manually.
Also new in this class is the GetStreamConfig method. It queries the stream config object for its graph. An example can look like this:
dim graph as DirectShowCaptureGraphBuilderMBS // your graph
dim filter as DirectShowBaseFilterMBS // your filter
dim StreamConfig as DirectShowAMStreamConfigMBS
StreamConfig = g.GetStreamConfig(DirectShowPinMBS.PIN_CATEGORY_STILL, filter)
We have our graph and our filter and can then set in the parameters of GetStreamConfig the category of the pin. You find the possible categories in the PinMBS class as shared methods.
For the DirectShowGUIDMBS class we have a method that can work contrary: The Operator method. The first direction is that it converts a GUID to a text. For this we set nothing in the parameters. The other direction is that it converts a text to a GUID. For this we set in the parameters the text that should convert to the GUID. The method raises an exception if the text has the wrong format.
WebView 2
For the WebView2ControlMBS class we have two new methods. Th method HTMLText gives us the HTML Text of the current Website. If you want the website Text as plain text you can use the second new method PlainText.
dim web as WebView2ControlMBS // your control
dim text as string = web.plaintext
dim html as string = web.HTMLText
We hope you will also find some interesting new features. We wish you a lot of fun with MBS Xojo Plugins version 21.1. If you need a license or have any questions, please contact us.
Platforms to show: AllMacWindowsLinuxCross-Platform
XLBookMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
The MBS Xojo XL Plugin is based on LibXL, a powerful library to handle Excel files.
You'll need your own license for LibXL. For more information go here:
https://www.monkeybreadsoftware.de/xojo/plugin-xls.shtml
When you have obtained license file inside your XOJO project place XLBookMBS.SetKeyGlobal call with LibXL license in app.open.
- 9 properties
- property ActiveSheet as Integer
- property BiffVersion as Integer
- property CalcMode as integer
- Property ErrorMessage as string
- property Handle as Integer
- property IsDate1904 as boolean
- property IsTemplate as boolean
- property RefR1C1 as Integer
- property RgbMode as boolean
- 71 methods
- method AddCustomNumFormat(customNumFormat as string) as Integer
- method AddFont(initFont as XLFontMBS = nil) as XLFontMBS
- method AddFormat(initFormat as XLFormatMBS = nil) as XLFormatMBS
- method AddPicture(path as folderitem) as Integer
- method AddPicture(path as string) as Integer
- method AddPictureData(data as string) as Integer
- method AddRichString as XLRichStringMBS
- method AddSheet(name as string = ', initSheet as XLSheetMBS = nil) as XLSheetMBS
- method AddStyledText(StyledText as StyledText) as XLRichStringMBS
- method BookVersion as Integer
- method Constructor(xml as boolean = false)
- method CopyContent(dest as XLBookMBS, Options as XLCopyOptionsMBS = nil)
- method CustomNumFormat(fmt as Integer) as string
- method DefaultFont(byref fontSize as Integer) as string
- method DelSheet(index as Integer) as boolean
- method Font(index as Integer) as XLFontMBS
- method FontCount as Integer
- method Fonts as XLFontMBS()
- method Format(index as Integer) as XLFormatMBS
- method FormatCount as Integer
- method Formats as XLFormatMBS()
- method InsertSheet(index as Integer, name as string = ', initSheet as XLSheetMBS = nil) as XLSheetMBS
- method Load(path as folderitem) as boolean
- method Load(path as string) as boolean
- method LoadMT(path as folderitem) as boolean
- method LoadMT(path as string) as boolean
- method LoadPartially(path as folderitem, sheetIndex as Integer, firstRow as Integer, lastRow as Integer) as boolean
- method LoadPartially(path as string, sheetIndex as Integer, firstRow as Integer, lastRow as Integer) as boolean
- method LoadPartiallyUsingTempFile(path as folderitem, sheetIndex as Integer, firstRow as Integer, lastRow as Integer, TempFile as folderitem) as boolean
- method LoadPartiallyUsingTempFile(path as string, sheetIndex as Integer, firstRow as Integer, lastRow as Integer, TempFile as String) as boolean
- method LoadRaw(data as MemoryBlock) as boolean
- method LoadRaw(data as string) as boolean
- method LoadRawMT(data as MemoryBlock) as boolean
- method LoadRawMT(data as string) as boolean
- method LoadRawPartially(data as MemoryBlock, sheetIndex as Integer, firstRow as Integer, lastRow as Integer) as boolean
- method LoadRawPartially(data as string, sheetIndex as Integer, firstRow as Integer, lastRow as Integer) as boolean
- method LoadUsingTempFile(path as folderitem, TempFile as folderitem) as boolean
- method LoadUsingTempFile(path as string, TempFile as String) as boolean
- method MoveSheet(SourceIndex as integer, DestIndex as Integer) as boolean
- method PackColor(ColorValue as color) as Integer
- method PackColor(red as Integer, green as Integer, blue as Integer) as Integer
- method PackDate(d as date) as Double
- method PackDate(year as Integer, month as Integer, day as Integer, hour as Integer = 0, min as Integer = 0, sec as Integer = 0, msec as Integer = 0) as Double
- method PackDateTime(d as dateTime) as double
- method Picture(index as Integer, byref data as string) as Integer
- method PictureCount as Integer
- method Save(path as folderitem) as boolean
- method Save(path as folderitem, UseTempFile as Boolean) as boolean
- method Save(path as string) as boolean
- method Save(path as string, UseTempFile as Boolean) as boolean
- method SaveMT(path as folderitem) as boolean
- method SaveMT(path as string) as boolean
- method SaveRaw(byref data as MemoryBlock) as boolean
- method SaveRaw(byref data as string) as boolean
- method SaveRawMT(byref data as MemoryBlock) as boolean
- method SaveRawMT(byref data as string) as boolean
- method SetDefaultFont(fontName as string, fontSize as Integer)
- method SetKey(name as string, key as string)
- method SetKeyGlobal(name as string, key as string)
- method SetLocale(locale as string)
- method Sheet(index as Integer) as XLSheetMBS
- method SheetCount as Integer
- method Sheets as XLSheetMBS()
- method SheetType(index as Integer) as Integer
- method UnpackColor(ColorValue as Integer) as color
- method UnpackColor(ColorValue as Integer, byref red as Integer, byref green as Integer, byref blue as Integer)
- method UnpackDate(Value as Double) as date
- method UnpackDate(Value as Double, byref year as Integer, byref month as Integer, byref day as Integer) as boolean
- method UnpackDate(Value as Double, byref year as Integer, byref month as Integer, byref day as Integer, byref hour as Integer, byref min as Integer, byref sec as Integer) as boolean
- method UnpackDate(Value as Double, byref year as Integer, byref month as Integer, byref day as Integer, byref hour as Integer, byref min as Integer, byref sec as Integer, byref msec as Integer) as boolean
- method UnpackDateTime(Value as double) as dateTime
- 15 shared methods
- shared method available as boolean
- shared method LibVersion as string
- shared method LibVersionNumber as Integer
- shared method Load2(path as folderitem) as XLBookMBS
- shared method Load2(path as folderitem, byref ErrorMessage as String) as XLBookMBS
- shared method Load2(path as string) as XLBookMBS
- shared method Load2(path as string, byref ErrorMessage as String) as XLBookMBS
- shared method LoadError as String
- shared method LoadLibrary(File as FolderItem) as boolean
- shared method LoadLibrary(Path as string) as boolean
- shared method LoadRaw2(data as MemoryBlock) as XLBookMBS
- shared method LoadRaw2(data as MemoryBlock, byref ErrorMessage as String) as XLBookMBS
- shared method LoadRaw2(data as string) as XLBookMBS
- shared method LoadRaw2(data as string, byref ErrorMessage as String) as XLBookMBS
- shared method SetKeyGlobal(name as string, key as string)
- 15 constants
Call Modes
Constant | Value | Description |
---|---|---|
CalcModeAuto | 1 | automatic calculation |
CalcModeAutoNoTable | 2 | automatic except for data tables |
CalcModeManual | 0 | manual calculation |
Picture Format Constants
Constant | Value | Description |
---|---|---|
PictureTypeDIB | 4 | DIB format |
PictureTypeEMF | 5 | EMF format |
PictureTypeError | &hFF | Error. Check XLBookMBS.ErrorMessage method. |
PictureTypeGIF | 2 | GIF format. |
PictureTypeJPEG | 1 | JPEG format |
PictureTypePICT | 6 | Mac PICT format. |
PictureTypePNG | 0 | PNG format |
PictureTypeTIFF | 7 | TIFF format |
PictureTypeWMF | 3 | WMF format |
Sheet Types
Constant | Value | Description |
---|---|---|
SheetTypeChart | 1 | Sheet is a chart. |
SheetTypeSheet | 0 | This is a normal sheet. |
SheetTypeUnknown | 2 | Type is unknown. |
This class has no sub classes.
Some methods using this class:
- XLRichStringMBS.Constructor(book as XLBookMBS)
- XLSheetMBS.CopySheet(dest as XLBookMBS, Options as XLCopyOptionsMBS = nil)
Some properties using for this class:
- XLAutoFilterMBS.Book as XLBookMBS
- XLFilterColumnMBS.Book as XLBookMBS
- XLFontMBS.Book as XLBookMBS
- XLFormatMBS.Book as XLBookMBS
- XLRichStringMBS.Book as XLBookMBS
- XLSheetMBS.Book as XLBookMBS
Mbs Xojo Plugins
Some examples using this class:
Blog Entries
Xojo Developer Magazine
The items on this page are in the following plugins: MBS XL Plugin.
Mbs Xojo Complete Plugins Set
Mbs Xojo Plugins
XLAutoFilterMBS - XLCopyOptionsMBS