A few days ago FileMaker posted the videos from the DevCon sessions. If you attended the conference, you can download videos and slides.
Some presenters seem to like our MBS Plugin and you see it in the presentation. e.g. the colors in the scripts.
Did you see which presentations include MBS Plugin?
Also with end of month our DevCon sale ends. Everyone from DevCon got a license?
For next prerelease we have something new.
We add three new classes:
AppReceiptMBS,
AppReceiptIAPMBS and
AppReceiptVerificatorMBS.
The
AppReceiptMBS class allows you to load the receipt from within your own app or from a given file. You can query identifier, app versions, various dates like purchase date or expiration date. Using the
AppReceiptIAPMBS class we provide an array of the in-app purchases. For each in-app purchase you can query details like product identifier, purchase or cancellation dates, quantity or the transaction identifier.
Our
AppReceiptVerificatorMBS class can verify if app receipt is valid. Either you pass in a receipt, bundle identifier and app version to check if some receipt file is valid for a given app. Or you just ask if the application's own receipt is valid.
We hope this helps Xojo developers using the Mac App Store. As we also have the whole StoreKit framework covered from Apple, you can use the MBS Plugins for a complete In-App Purchase solution.
Plugin will be available soon as part of pr8 or if you like to try it on the weekend, I could email you a copy.
we just go notice about a Xojo developer meeting in North Carolina, USA:
Are you in the RTP, North Carolina area? Join @Patrick McCabe and other Xojo devs at the next meeting, 7PM September 8th 2014 at Rally Point Sports Grill!
Jay is going to give a short explanation and demo of Database's in Xojo.
Address for Meeting:
Rally Point Sports Grill
1837 N. Harrison Ave
Cary, NC 27513
(919) 678-1088
rallypointsportgrill.com
It is located right off Interstate 40, in the shopping center across from SAS. They have a private room which is reserved for the group, the room is located to the left when you enter the restaurant.
Join the group for updates on all meetings: groups.google.com/forum/#!forum/rtpnc-xojo-usergroup
Just three weeks left until the conference starts. If you like to attend, please register soon. We already have participants from 10 countries and the hotel will soon run out of available rooms.
Stéphane Pinel will be present and talk about this topics:
Keynote- What happened in 2014
- Xojo 2014r3, the iOS take off
- Works in progress
- What's next?
- Q&A
Xojo for iOS in deep- iOS support in the IDE
- Introducing the new Xojo Framework
- Extending iOS support using Declares
Social networks from Xojo- When/Why using social networks from your apps?
- How to do it?
- Live examples with Twitter & Facebook
The dates:
17th -
Xojo Training in German
18th and 19th -
MBS Xojo Conference in English
20th -
Xojo Training in English
With plugin version 4.3 we introduce a couple of new
toolbar functions. First we can install a background image. The
Toolbar.InstallBackground function takes a picture from a container and installs the necessary functions to have a background picture. The plugin can draw the picture behind toolbar buttons, so you can customize your application. If you call again with different picture, you can change it or pass no image and clear it.
Configure Toolbar
The toolbar on Mac can be configured by the user. Normally the user will choose the menu command to customize it. Or you call the plugin function
Window.RunToolbarCustomizationPalette and show the palette by script.
The configuration settings are saved as XML text. You can query current configuration of a toolbar in a window using
Window.GetToolbarConfiguration and set it later with
Window.SetToolbarConfiguration. This allows you to hide certain buttons by using special configuration. As the configuration settings are stored as xml, you can edit them yourself.
Your own toolbar buttons
To enable the plugin to add your own toolbar items, please call once
Toolbar.Install function. This will instruct the plugin to install the necessary callbacks to intercept some toolbar functions which are called by the OS to find out what toolbar items FileMaker provides. This way plugin can add your custom identifiers to the list.
Now you can register toolbar items using the function
Toolbar.Register. Call it once on startup of solution for each button you may want to introduce. You need to define your own unique identifier string for the toolbar button. Be aware that FileMaker already has a few identifiers defined already like NewRecordToolbarItemIdentifier. OS X also defines identifiers for standard items like NSToolbarFlexibleSpaceItem. With the parameters you define which script is called for this button by specifying a filename, a script name and the script parameter. For the button itself you specify an image (best PNG with mask), which is scaled down to the required sizes. You can specify a label for the toolbar and a second label for use in the customization panel. Of course you can also specify a tooltip as a help text.
Now when you registered your toolbar item, you can use the identifier in the configuration xml. In a script triggered by opening the layout, you can setup the right xml to be used for toolbar and enable the buttons you need. Your toolbar may look like the picture above.
(more)
Often we have to keep properties with references to other objects, but want to avoid circle references causing memory leaks. So we have to have a clear reference tree from root object to child objects. If we want a reference from child back to parent, we need to use a weak reference.
Other use is if you have two windows where one window needs to reference other, but one of the windows should be able to get away without leaving a reference to a dead window. Sometimes we have trouble as a window was closed already, but we have a reference to it. Accessing it causes an exception as controls are dead already.
So how to make a weak property?
First you create the normal property, e.g. test as window. Next you select it to convert it to computed property. The private property created by Xojo now changes type to WeakRef. The setter changes to this:
Sub Set()
if value = nil then
mTest = nil
else
mTest = new WeakRef(value)
end if
End
As you see we now create a weak Reference for the given value. If value is nil, we don't need the weak reference, so we set to nil.
For the getter, we simply take the value from WeakRef the value and return it. We use a variant for easy casting:
Sub Get()
if mTest <>Nil then
dim v as Variant = mTest.Value
return v
end if
End
The property can now be used like other properties. You don't really notice it is using a weak reference. Just you have to prepare for the case the property is suddenly nil.
New in this prerelease of the 4.3 plugins:
- Changed JSON.GetObjectItemTree to also look into arrays. Please pass index in array as parameter.
- Added new toolbar functions to add your own toolbar items.
- Added new functions for Mac to configure the toolbar in a FileMaker window.
- Added FM.DisableRuntimeEndWindow function.
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
New in this prerelease of the 14.3 plugins:
- Added JPEGData and PNGData to CGImageMBS class.
- Added MemoryBlock.ConvertRGB12BitTo8BitMBS.
- Added PDFDocumentMBS.appendPage.
- Fixed JSONMBS.Constructor. Now creates an empty JSON object. If you need an array node, please use JSONMBS.NewArray.
- Added containerURLForSecurityApplicationGroupIdentifier and containerFolderForSecurityApplicationGroupIdentifier to NSFileManagerMBS class.
- Added WindowsTimerMBS class for high resolution timers.
- Fixed AUPlayerMBS.Pan for older Mac OS X.
- Added AUPlayerMBS.UseNewTimePitchUnit property.
- JSONMBS now passes through \u0000 as it can't handle chr(0) in a string.
- Added JSONMBS.ToString as property.
- Added DragItem.NSDraggingInfoMBS function.
- Improved NSDraggingInfoMBS class.
- Changed NSScrollViewMBS to have properties visible in debugger.
Download:
macsw.de/plugin/Prerelease. Or ask us to be added to our shared Dropbox folder.
PS: In newer plugins, the WindowsTimerMBS class got renamed to TimerMBS.
As you see I have currently a lot of fun working with the FileMaker toolbar.
So for next MBS FileMaker Plugin we have some new functions.
A little teaser to upcoming FileMaker plugin. What happened here?
If you use a normal Xojo Timer in your project, you can use periods down to around 16 ms. Even if you select 5 ms, you get about 16 ms. More than 60 action events per second are not possible. See this test project which measures what we get for a timer with 5 microseconds:
Now with next MBS Plugins, we have already prepared a replacement class: WindowsTimerMBS.
This class can provide an action event on main thread much closer to the 5 ms target as you see in this screenshot:
Of course timer can only fire if main thread is not busy, so if you do too much code in action event, the next event may be delayed.
I hope this makes a couple of Xojo developers happy, for example if you want to measure values 100 times per second on a serial port.
PS: In newer plugins, the WindowsTimerMBS class got renamed to TimerMBS.
Everyone producing runtimes with FileMaker 13 for Mac OS X has a problem. You need to sign the app for Gate Keeper. If your runtime is not signed, the Finder will ask the user when launching the application after download to delete the app! To avoid users get confused or not use the runtime, we sign the runtime.
How?
Signing the runtime got harder with new requirements in Mac OS X 10.9 and the upcoming Yosemite release. We not just need to sign the actual application, but also make sure we sign all the components. For the frameworks inside the runtime, we need to fix them to give them a few standard symlinks which are missing. Without those modifications, the bundle will not sign. Luckily all the PPC code and duplicate libraries got removed in FileMaker 13.0v3, so we don't need to do this yourself like in FileMaker 12. If you like to save a few bytes, you can delete the icon files: FM12Dict.icns, FM12Label.icns and FM12Plug.icns inside the runtime. Those are not referenced and never used.
Developer Account
In order to sign, you need to sign up for a Mac Developer Account with Apple. This costs $99 per year. In the Certificates, Identifiers & Profiles section, please go in Mac Apps section and there in Certificates. Create a new Developer ID, follow the instructions and download the certificate file. Double click it to add it to Keychain Manager and voila, it is installed and ready to use.
Sign Script
The complete script is here for download as zip archive:
signscript.zip
When you edit the script in a text editor (like BBEdit or TextWranger), you can change the path to the runtime, the name of the app and the name of the certificate. Please note that this script will not work without correct values. If your file name or path contain special character, escaping may be needed. For example a space character needs to be escaped with putting a backslash character just before the space character. You can learn how to escape a path by dragging and dropping the file or folder into the window of the Terminal application. The path is inserted and you can copy & paste it.
Now when everything is setup for your runtime in the script, you can drop the script on a Terminal window and press return key to start it. You'll see a couple of messages. This may include some complains from rm command trying to delete files which are not there. Nothing to worry about, the script just makes sure everything is correct. Further you see a couple of sign message for various parts of the application. The final line should show "signed bundle with Mach-O thin" and report success for signing your runtime app.
Verification
To check if app is okay for Gate Keeper you can first verify code signature using a call to codesign with a couple of v for more details and -d to display certificate:
codesign -d -vvvv /Users/cs/Desktop/Test/test.app
Next with spctl utility you can show if app is accepted. So we run spctl utility with verbose messages and -a parameter:
spctl -a -vv /Users/cs/Desktop/Test/test.app
Please change path to your runtimes before running above commands. The output should say "accepted" and now you are lucky and can archive and upload your runtime. Good luck!
proudly sponsored by INtex Publishing
PS: Please check MBS Plugins for included scripts for newer FileMaker versions and read the following tech note from Apple:
Technical Note TN2206
macOS Code Signing In Depth
developer.apple.com/library/prerelease/content/technotes/tn2206/
You may need to code sign your disk images when delivering software as well as the software inside.
Just four weeks left until the conference starts. If you like to attend, please register soon. We already have participants from 10 countries and the hotel will soon run out of available rooms.
We still have seats available for training in English and German.
Recently we added a new session about Extending the Framework from Tobias Bussmann. He will also show their huge web app for the Swiss Academy of Sciences made with Xojo.
Finally a few days ago we added a session be Valdemar de Sousa about In-App Purchases in the Mac App Store.
Hotel in Koblenz is reserved for 17th to 20th September 2014.
17th -
Xojo Training in German
18th and 19th -
MBS Xojo Conference in English
20th -
Xojo Training in English
If you put this code in a textarea's open event, you get a modern small auto hiding scroll bar:
dim n as NSScrollViewMBS = me.NSScrollViewMBS
n.scrollerStyle = NSScrollerMBS.NSScrollerStyleOverlay
n.verticalScroller.controlSize = NSScrollerMBS.NSSmallControlSize
n.verticalScroller.knobStyle = NSScrollerMBS.NSScrollerKnobStyleDark
n.scrollerKnobStyle = NSScrollerMBS.NSScrollerKnobStyleDark
n.verticalScroller.scrollerStyle = NSScrollerMBS.NSScrollerStyleOverlay
As you see plugin provides for a lot of framework classes a function to quickly get the plugin counterpart. For Textarea, we provide quick access to
NSTextViewMBS and
NSScrollViewMBS objects. And on the scrollview the plugin provides all the accessors and constants to do this.
With QuartzFilters we have the possibility to process PDF files while we create them and apply modifications. Beside color modifications like having only gray, sepia or b&w images in a PDF, we can use a filter to create a PDF file in PDF/X standard format. With a custom image compression filter we can reduce file size of PDFs. Especially those with a lot of images can be reduced by shrinking each image to a smaller JPEG compressed copy.
Creating the Filter
First you show the QuartzFilter Manager panel with executing the plugin command MBS("
QuartzFilterManager.ShowPanel"). This will show the panel where you can use plus button to make a new filter. With the new filter named, use the button on the right side to add the Image compression effect from the image effects menu. Than select options, e.g. JPEG with middle quality.
The prebuilt filter "Reduce File Size" also reduces all images to a maximum size of 512 pixel, but that is in our tests often too small. Replacing uncompressed images with JPEG versions reduces the size significantly alone.
Using the Filter
Once the filter is created, it should appear in the list returned by
QuartzFilterManager.Filters function. You can now use the plugin function
PDFKit.SetCurrentFilter to make this filter the current one. Your next call to
PDFKit.Combine,
PDFKit.GetPDFPagesPDF or
PDFKit.GetPDFPagePDF will use the filter. So the call to
PDFKit.Combine passing existing PDF in container can shrink it and you store the PDF in a new container.
Your milage may vary. Some PDFs can be compressed a lot this way, but others are not affected or even bigger! So be careful and compare size before and after and use the smaller one.
Those filters are also available in our
Combine PDFs utility and in our
MBS Xojo Plugins.
New in this prerelease of the 14.3 plugins:
- Added XML parameter for WinSpeechMBS class, so text can embed xml commands to control voice.
- Fixed a bug with PictureMBS, clipping and VM mapped files.
- Added Audioformat parameter to SpeakFile method in WinSpeechMBS class.
- Added SQLAnywherePreparedStatementMBS.kTypeNull and SQLPreparedStatementMBS.kTypeNull.
- Changed SQL Plugin to raise UnsupportedOperationException if you call SQLDatabaseMBS TableSchema or FieldSchema functions.
- Changed SQL Plugin to raise UnsupportedOperationException if you call update, edit, delete or deleteAll methods on a RecordSet.
- Added FileListMBS class constructor parameters to filter items on Windows.
Download:
macsw.de/plugin/Prerelease. Or ask us to be added to our shared Dropbox folder.
New in this prerelease of the 4.3 plugins:
- Changed QTMovie.OpenContainer and other functions to work with interactive containers containing M4V, MP3 and MOV files.
- Added parameter for CURL functions which set text options. You can pass a text encoding as parameter. Default is UTF-8 as before.
- Added FileDialog functions to set filters and limit dialog to specific file types.
- Added PDFKit.SetCurrentFilter and PDFKit.GetCurrentFilter.
- Added QuartzFilterManager.Filters, QuartzFilterManager.ShowPanel and QuartzFilterManager.HidePanel.
- Added Files.FileInfo function.
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
In 2012 we added to our plugins a
WinNotificationMBS class. This class was designed to send and receive broadcast messages on Windows between running apps. This way a helper app can send status updates easily to main app. Without the need to setup IPCSocket or other ways of communication.
Now Windows also sends a couple of messages to everyone about certain things. Like you can get a
WM_DISPLAYCHANGE message whenever the display setup changed. Also the
WM_DEVICECHANGE message informs about devices coming and going.
To use this, get a subclass of WinNotificationMBS and add the GotNotification event. Now listen for messages
WM_DISPLAYCHANGE (&h7E) and
WM_DEVICECHANGE (&h0219). The event will be called with those message codes so you can check state and update your app.
PS: On Mac you can also get similar events with
NSWorkSpaceMBS and
NSNotificationObserverMBS.
A few days ago Xojo 2014r2.1 was released. This is the final release to support Carbon as Cocoa will be the only option from 2014r3 on forward. So we are happy that the XmlDocument bugs have been fixed for Carbon target. Any other Carbon bug will probably never be fixed in the future.
For the Webkit support on Windows, Xojo went back from CEF3 to CEF1 version. The newer version had some side effects which made the older version a better choice. For our plugin, well the 14.2 plugins assume that 2014.2 uses CEF3. With 14.3 we put in an auto detect feature, so plugin can see what version of CEF is used and either use the CEF1 or the CEF3 API. So in case you use the
Chromium classes from our plugins, be careful.
Database classes got some updates on MySQL, ODBC and SQLite. Like better full text search with unicode support for SQLite.
For Mac App Store the RegEx plugin was fixed, so you can submit again apps using it. See
older blog post.
Please also check the
blog post about the HandleSpecialURL change in this release.
For the last days, we have been using this version and it's quite stable for our projects here. So we can recommend the update.
New in this prerelease of the 4.3 plugins:
- Please note that minimum Mac OS X version now is 10.6.
- Rewrote CPUID detection.
- Updated DynaPDF to version 3.0.33.97.
- Made first changes for future Mac OS X version.
- Fixed bug with DataMatrix encoding in barcode generation.
- Updated zint library to current version.
- Updated to OpenSSL 1.0.1i.
- Reimplemented Icon.GetIcon on Mac to user newer APIs.
- Fixed Files.FileKind for Windows.
- Added options for SQL.SetConnectionOption to turn on SSL for MySQL via new options: MYSQL_SSL_KEY, MYSQL_SSL_CERT, MYSQL_SSL_CA, MYSQL_SSL_CAPATH and MYSQL_SSL_CIPHER. If those are set, we pass the strings to mysql_ssl_set function.
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
New in this prerelease of the 14.3 plugins:
- Rewrote CPUID detection. Added new methods to CPUIDMBS class.
- Updated DynaPDF to version 3.0.33.97.
- Made first changes for future Mac OS X version.
- Added AUPlayerMBS.Reset.
- Fixed bug with DataMatrix encoding in barcode generation.
- Updated zint library to current version.
- Updated to Portaudio v19 20140130.
- Updated to OpenSSL 1.0.1i.
- Fixed problem with NSRunningApplicationMBS objects in dictionaries.
- Added options for SQLConnectionMBS and SQLDatabase to turn on SSL for MySQL via new options: MYSQL_SSL_KEY, MYSQL_SSL_CERT, MYSQL_SSL_CA, MYSQL_SSL_CAPATH and MYSQL_SSL_CIPHER. If those are set, we pass the strings to mysql_ssl_set function.
- Added ConnectionHandler event to SQLConnectionMBS and SQLDatabase classes.
- Fixed GKTurnBasedParticipantMBS.matchOutcome property to be writable.
Download:
macsw.de/plugin/Prerelease. Or ask us to be added to our shared Dropbox folder.
New in this prerelease of the 14.3 plugins:
- Updated LCMS2 to latest 2.7beta0 from 3rd August 2014.
- Updated LCMS2 used for GraphicsMagick to version 2.6.
- Fixed issue with NSFileHandlerMBS object and NSNotificationMBS.
- Improved NSPopupButtonMBS class with more properties.
- Changed GMImageMBS.SetImageMask to turn set matte = true to make sure we have an alpha channel.
- Fixed bug with internal NSObject to Variant conversion.
Download:
macsw.de/plugin/Prerelease. Or ask us to be added to our shared Dropbox folder.
New in this prerelease of the 4.3 plugins:
- Updated LCMS2 used for GraphicsMagick to version 2.6.
- Added Files.ReadJPEG, Files.ReadPDF and Files.ReadPNG.
- Added Barcode.SetOptions.
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
The early bird offer will end 11th August and that is also the end date for the hotel contingent. Please register quickly to make sure you get a room in the hotel.
Also we still have seats available for english and german training.
Hotel in Koblenz is reserved for 17th to 20th September 2014.
17th -
training in German
18th and 19th -
conference in English
20th -
training in English