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.
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.
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 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
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.
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.