Home ARBP Blogs and Opinions REAL Studio 2010 Release 4 [Updated]

REAL Studio 2010 Release 4 [Updated]

Open as PDF  Print Version
20 Oct 2010 bob.keeney  
avatar
 
 

Views: (898)
Replies: (1)
Votes: (0)
Favorited: (0)
The March To Cocoa Continues
REAL Software continues to improve, add new features, and otherwise arm wrestle Cocoa into submission in REAL Studio.  The 2010 R4 release has some new features that are Cocoa only or have limited support in Carbon.  This means that you really want to start migrating your apps to Cocoa.

However, this is not going to be a painless experience as I quickly found out in one of my projects.  The R4 release has a major problem (for me at least) in that Cocoa builds broke the ability to tab between TextField and TextArea controls.  The TextArea control will accept tabs even when its AcceptTabs property is set to false.  More thoughts on this in a separate post.

This is the first release where the IDE runs ONLY on Intel Macs.  If you're still using a PPC based Mac the last version you can use is REAL Studio 2010 R3.2.

New Things:
The OpenDialog class has a new property, MultiSelect, that allows the user to select multiple files.  It still returns a single folderitem so it won't break existing code but there are two new properties, Count and Item that will let you iterate through the list of selected objects.  The drawback is that this code is Cocoa only on Mac OS X.  Works fine on Windows and I did not test in Linux.

Database Parameter Bindings
This new feature is supposed to help protect from SQL injection attacks.  It is similar to the Java database parameter binding.  It also promises to speed up repetitive queries by quite a bit.  In my testing it was a lot faster doing the same query 1000 times in a row.

Unfortunately, a few things were left out in the initial R4 release.  The ODBC Database Plugin was not updated for parameter bindings and the SQLite (REALSQLDatabase) is hindered by an error being reported by the database engine that really isn't an error.  Because of these simple errors, I would suspect that a dot release is forthcoming.

StaticText to Label
The StaticText control is now the Label class.  Otherwise, it has no changes.  This change is good from many aspects because new users to REAL Studio are often confused about the purpose of the StaticText control.  The name implies it can never change which, as you quickly discover, is not true.  

Most other development environments call this the Label control so the change is welcome.  The drawback, however, is that projects created in Release 4 are not backwards compatible.

Segmented Control
REAL Studio has a new Segmented Control.  Segmented controls are used a lot in Mac OS X applications and up until now you either had to create your own or use any one of a number of 3rd party controls.

The MacControlStyle property controls how the segmented control draws in Cocoa.  In Windows and Carbon builds this property is ignored and you only have one choice of button type.  

Carbon apps are only partially supported.  You can add icons to the Carbon build but they look like crap as they don't maintain proportion and expand to fit the segment width.  A workaround is to force the segment width to the same size as the icon.  They look fine in Windows and Cocoa.  I did not test Linux.

One bug that I was able to reproduce consistently was closing a project with the segment control consistently caused a hard crash.  Report ID:  14136

Listbox Enhancements
The listbox has a new ColumnTag.  Just like the RowTag property, this property lets you store a variant in each column of the listbox.

The listbox also has a new AddRow method allowing you to specify all columns of text as a ParamArray.  This is a convenience feature, but if you use a lot of listboxes, this is a very welcome feature.

Graphics.Antialias
A new property has been added to the graphics object that will help some users.  The AntiAlias property now smooths graphics for you.  The property is true by default and will smooth text and lines.  To use it on Windows, the Application.UseGDIPlus must be true (which is false by default).

Due to anti-aliasing rules, expect your text to look different on each platform.

[Update] This section is not valid.  The Release Notes from RS had this entry but it is not true. 
SQLite RowID Changes
This is a change that might bite a fair number of developers.  If you have relied upon the rowid property in SQLite you should plan on migrating by telling your tables what the primary key is.  This might mean you have to update your database by creating a new table (with the new primary key), copying over all the data, and then deleting your old table.


Add/Remove Handlers
We now have the ability to dynamically add event handlers to a class.  The example given on the beta list is perhaps the best example I've found so far.  Add a timer to a subclassed canvas.  In the open event add the following:

Sub Open()
mTimer = new Timer()
mTimer.period = 100
mTimer.Mode = timer.ModeMultiple

AddHandler mTimer.Action, AddressOf TimerFired


Self.Refresh

End Sub


Add a method TimerFired:
Sub TimerFired(sender As Timer)
iCnt = iCnt + 1
if iCnt > 10 then iCnt = 1

self.Refresh

End Sub


Add properties mTimer as Timer, and iCnt as integer.  In the Paint Event of the canvas add this:
Sub Paint(g As Graphics)
g.ForeColor = &c0000FF

dim iWidth as integer = g.width * (iCnt/10)


g.FillRect 0, 0, iwidth, g.Height

g.ForeColor = &c000000

g.DrawRect 0, 0, g.Width, g.Height
End Sub


This gives you a self updating canvas control.  I'm sure there are other, much better uses but it sure gives us some interesting possibilities.

One thing to be aware of in the example I gave above.  If the timer tires, it will control the refresh code of the canvas control.  If the window is currently being closed it's possible to get a hard crash because the refresh code is fired but the control doesn't exist any more.  This is a deficiency in the REALbasic framework and can be solved by removing the handler in the window.close event.

This is an advanced language feature, that in my opinion, many will not use.  But like many advanced features, when you need to it you'll be glad it's there.

Operator Subscripts
This one is rather tricky to explain so bear with me.  Say you have a class, MyClass that has an array.  Currently, you have to add an Item(index) method to access it and the code look something:

myClassInstance.Item(i) = x

MyClass is trying to emulate array-like behavior and the current way of doing it work fine.  The operator subscript will allow you to define the class so that you can do something like this:

myClassInstance(i) = x

This is another advanced language feature that will be handy if you work a lot with classes.

Other Updates:
The new minimum version supported by the IDE is now Windows XP.  Windows 2000 support is gone.  This is true for the IDE and your compiled Windows applications.  This isn't really much of a change, but a clarification in the dialogs.

Perhaps one of the nicer changes is that the StaticText (doh!  Label now) no longer leaks memory.  This was one of my pet peeves with R3.1 and R3.2 and it seems to no longer be an issue.

Web Apps Removed
For those testing the new Web Edition, the R4 release has it removed.  Don't fret, though, as it has returned in the R5 alphas and betas.  If my information holds true, R5 will be released before the end of the year.  What is unknown at this time, if if it will be a full release or a beta release.

Video Report
I have a video of this report, along with demonstrations and screenshots and additional information on the BKeeney website at https://www.bkeeney.com/realbasic-training-section/free-content/article/2-free-content/288-real-studio-2010-release-4 (free registration required to view this and over 2 hours of other free REAL Studio video content)
 
Tags: review (2) , REAL Studio 2010 Release 4 (1) Add Tags
 

Comments
REAL Studio 2010 Release 4

After being stuck on RB2009r5.1 I dared take the step to RB2010r4 yesterday. To make matters more complicated, I am not abel to run RB2009r5.1 Enterprise alongside RB2010r4 Professsional and have thus neglected all releases between.

The first thing I find that is very, very annoying is that the Check for Update window pops up EVERY time I start the IDE, no matter what the setting in Preferences is. The work-around seems to be to open RB using a project file (which is kind of dumb as the new Welcome screen contains an Open Recent... button). I can live with this....

Opening my major projects I have some stuff to take care of that has been depreceated on the way to RB2010r4, I can live with this as well.

What makes me very annoyed is the Transparence setting on the StaticText control that was introduced somewhere on the way - that is not set to true by default, thus breaking all my controls...

I am having some random issues with scroll wheel on my mouse, but this could be some driver issues on my Windows 7 (hopefully).

/Mattias


Written by: Mattias Sandström
20 Oct 2010

0


Login to leave a comment

 

ARBP Members Login

This Sign In is for registered ARBP members only. Please read the information on this page to discover the benefits of membership.



To start accessing the ARBP site you only have to register. After that you can purchase any of the memberships to unlock additional content.

Purchase REALbasic