Before using DynaPDF functions in our plugin, you have to initialize that part of the plugin. For that you call DynaPDF.Initialize function and pass path to the location of the DynaPDF dll or dylib.
Now our example code always used to use a $$DynaPDFInited variable to check the state. But that has two disadvantages:
First it may also be set if initialization failed. So if you run a script, it fails, you than put the library where it should be and try again, it will not initialize again.
Second with using a server, you may need to initialize both on server and client. But you only have one global variable. This causes trouble if initialization is done on client, but not on server.
Third on a server, if the Scripting Engine process is restarted, the variable has the wrong value as the DynaPDF library is unloaded with the end of that process.
So the new way we recommend is to use the DynaPDF.IsInitialized function to check the status. This way you can simply ask the plugin if it is initialized and call Initializ script as needed.
In the last days I was curious to see if I can do something about Textarea control on Windows. And this seems to work as it is a standard Windows control.
so for next plugins we have this methods for TextArea:
WinRTFDataMBS(SelectionOnly as boolean = false) as string
WinInsertImageMBS(data as string, Width as Integer, Height as Integer)
Insert image works only for Windows 8 and newer. For older versions we could build something with pasting using clipboard.
The RTF functions can read/write the content of the text area as RTF. This includes embedded images which you can't handle with Xojo's built in RTF functions.
Just one month left until FileMaker DevCon in San Antonio.
If you join the conference, please visit me at the MBS booth. If you do not visit the conference, but you are in the area, feel free to email me and we can meet at the bar and chat about plugins.
Also I got notice about the FileMaker Unconference .fmp[x]Berlin for 2015. It will be a three day conference 2nd to 4th June 2015.
I have a client who wants to talk to some huge accounting software using COM objects in Windows from Xojo. He has been looking into using Xojo for his work for years, but we already tried it several times and had lots of crashes. Some functions simply crash when called. I looked into helping him several times the last two years, but well, didn't see a real reason for those crashes.
Yesterday he called again and asked if I could help. He has a PutValue method for filling data which constantly crashes. GetValue works by the way.
This time I had an idea. To analyze the functions, I created a dummy Visual C project and used #import line. The build the project and Visual Studio creates the C++ includes for this type library. In C++ the function looks like this:
As you see the function takes one string, a variant and a byref variant for the result. Now Xojo creates this delegate:
Delegate Function PutValue_Func3(this As Ptr, FieldName_Param As Ptr, Value_Param As Ptr, RetVal_Param As Ptr) As Integer
And there is the mistake. The variant needs to be passed by Value, not by Reference. This causes crashes as stack contains not enough data 4 bytes for the pointer instead of 16 bytes of the variant structure.
I also found case 7195, so this problem could be there for over 5 years. So I now hope that Xojo engineers can find and fix this bug, so my client can enjoy using Xojo to write the apps instead of Delphi.
Next week the FileMaker users in Hamburg meet next week.
You can come and learn about our latest FileMaker plugin.
Meeting is in Block House Wandsbek in Hamburg at 7pm.
Even if you're not a soccer fan enjoying the 2014 World Cup in Brazil this summer, you can score for yourself with big savings! The publisher of xDev Magazine is such a crazy soccer fan (football, for the purists) that he's authorized a **15% off** coupon for anything on the xDev store. This even includes renewals and other special offers -- the only limitation is that the coupon requires at $25 minimum order.
Just enter WORLDCUP in the coupon code field during checkout to claim your savings. This code is valid until a new World Cup champion is crowned. So enjoy the World Cup and take advantage of this xDev discount today!
Nickenich, Germany - (June 24th, 2014) -- MonkeyBread Software today is pleased to announce MBS FileMaker Plugin 4.2 for Mac OS X or Windows, the latest update to their product that is easily the most powerful plugin currently available for FileMaker Pro. As the leading database management solution for Windows, Mac, and the web, the FileMaker Pro Integrated Development Environment supports a plugin architecture that can easily extend the feature set of the application. MBS FileMaker Plugin 4.2 has been updated and now includes over 2500 different functions, and the versatile plugin has gained more new functions:
For the FileMaker script editor the plugin now provides on Mac OS X a new button to copy scripts as formatted text. This allows you to easily copy and paste a script in the FileMaker forums or an email. If you have a text editor to compare text like TextWrangler, you can now use it to compare two versions of a script. Or even put your scripts as text into a version control system to track changes.
Our new Midi functions can find Midi devices on both Mac OS X and Windows. You can connect to a devices including virtual sources or destinations. Over the connection you can send Midi notes or receive Midi events.
If you need to have an user pick an item from a list, you can now use our new ListDialog functions. Fill the list with some values, show the dialog and query what the user chose. Multiple selection and preselection is possible. Currently Mac OS X only.
For the case you work often with lists of elements, we now have a couple of list related functions. You can compare lists, remove duplicates, sort lists or remove empty items.
More details in the release notes. Please take the time to check our 250 example databases and check where you can use our plugin features in your solutions.
NICKENICH, Germany (June 24th, 2014) -- Monkeybread Software releases version 14.2 of the MBS plug-in for Xojo and Real Studio.
The MBS plug-in comprises a collection of several plug-in parts which extend the Real Studio development environment with 2,000 classes featuring over 52,000 documented functions. Our plugins support all three platforms Mac OS X, Windows and Linux with all project types desktop, web and console.
Some of the highlights on the 14.2 update:
The new CoreText classes in our plugins cover the whole CoreText framework from Apple for working with fonts and rendering text with attributes. The older ATS classes are now deprecated and we suggest if you need such functions, you should move soon to the new classes.
For Windows you can use WebKit as renderer for a htmlviewer. This uses Chromium internally and with our new ChromiumBrowserMBS and ChromiumFrameMBS classes we can provide additional methods. You can get the text of the current page, the URL or the image. And of course the usual methods like going forward or backwards in history.
Our new AUPlayerMBS class allows you to play audio on Mac OS X with various parameters. This includes pitch, rate, pan and equalizer. Audio can loop and you can select the output device.
Our SQL Plugin got improvements. The SQLDatabaseMBS and SQLConnectionMBS classes have now a Scrollable property. SQLNumericMBS class got improvements with new shared methods for various number types.
As part of this update we also updated a couple of used libraries including CURL, GraphicsMagick, LCMS2, DynaPDF and OpenSSL. The Nikon plugin now works with newer SDK versions for newer camera models.
Updated adaptor.appendPicture to work with transparency.
Marked NavigationDialogMBS, HIViewMBS, MenubarMBS, MenuMBS and StandardAlertMBS classes as deprecated. Those are only for Carbon and should be replaced when you move projects to Cocoa.
Fixed bug in CTParagraphStyleSettingMBS class.
Most deprecated things in plugin now list replacement.
Upgraded OS Version query on Mac to work better on Mac OS X 10.10
MBS will be present at the FM Conferénce 2014 this year in Toulouse, France.
Feel free to join the event and meet us there and ask all the questions you have.
I may even have a little presentation about our MBS Plugin there.
For more details, please check fmconf.com website.
Often we need to keep a property somewhere, but it needs to be a weak reference. So if the target goes out of scope, our reference should become nil. Now we can of course use WeakRef class directly for this. But that requires some work and casting on every access. It is much nicer to wrap it in a computer property. This way the compiler can check types when using the property. Internally we map back to the weakRef object. So check this code:
ComputedProperty ParentWindow As window1
SubSet(value as ParentWindow)
if value<>Nilthen
mParentWindow = new weakref(value)
else
mParentWindow = nilendifEnd
FunctionGet() as ParentWindow
if mParentWindow<>nilthendim o as variant = mParentWindow.Value
Return o
endifEnd
End ComputedProperty
PropertyPrivate mParentWindow As WeakRef
As you see we have a private property with the actual weakRef. The computed property getter checks if we have a WeakRef and provides value of it. We use a variant to avoid the need of explicit casting. For the setter we either set our weakRef property to nil or a new weakRef pointing to the target value.
Please use weak references always for references in data structures where a leaf references back to the tree.
MBS will be present at the FM Summit 2014 this year in Scheveningen near Den Haag.
Feel free to join the event and meet us there and ask all the questions you have.
For more details, please check fmsummit.info website.
The meetings will take place as we have a couple of attendees:
Wednesday, 11th June, Xojo Developer Meeting, at Schweizer Haus (schweizerhaus.at)
Thursday, 12th June, FileMaker Developer Meeting
I'll be there from around 6pm to 10pm.
If you are interested in joining, please email me, so we know how many seats we need.
Meeting will be probably in a beer garden or restaurant somewhere near Vienna.
You can use CoreText on Mac OS X 10.5 and newer. With Mac OS X 10.6 and 10.7 a few new methods got added.
So if you use ATS classes, please move soon to CoreText.
Your feedback is welcome. Maybe you have an idea for missing convenience function?
The 2015 Xojo Developer Conference will take place April 29 - May 1, 2015 at the Radisson hotel in fabulous downtown Austin! The 2014 conference sold out so start planning today - save the date!
XDC is the best place for Xojo users to learn from the experts, network with other Xojo users from around the world and meet the Xojo engineers. We will have sessions for everyone wanting to get the most out of their tool - from topics for those who are just getting their feet wet, to sessions for the most advanced Xojo developer. More information about registration and the call for speakers will be available soon.