Objo Studio v26.9.2 Released
I'm very happy to announce the immediate availability of Objo Studio 26.9.2.
I feel like I always say this but this is a big release. There are 72 completed items in the release tracker, spanning new features, improvements and bug fixes. A huge amount of work has gone into Web applications, but there's plenty here for Desktop developers too.
Web applications improvements
The Web target has received a lot of attention in this release. The visual designer, browser runtime and control set have all been substantially improved, with work across controls including ListBox, Chart, ComboBox, GroupBox and many others.
Web Canvas has changed particularly significantly. Rather than trying to squeeze those changes into this release post, I've written a separate article about them as I think they deserve a proper explanation.
One new Web feature that is worth highlighting here are custom HTTP endpoints.
A Web project can now specify a WebRequestHandler class which receives HTTP requests that aren't handled by the normal browser application routes. That makes it possible to implement things such as:
- Webhooks
- Health-check endpoints
- OAuth callbacks
- Lightweight JSON APIs
- Custom HTTP responses and redirects
You can even create a service-only Web project with no default page at all. This opens up some interesting possibilities for using Objo for small web services as well as traditional browser applications.
Printing your source code
This one came directly from a request on the forum.
There's now a new File > Print Source… command in Studio. You can print the current source item, selected items in the Navigator or an entire solution.
Studio generates a proper source listing with line numbers, syntax colouring, optional headers and footers and a contents page when appropriate. Long lines can either wrap or truncate.
You don't have to send it to a printer either. Source listings can be exported directly to PDF. The PDF contains real vector text, so the resulting document remains selectable and searchable rather than simply being a collection of screenshots.
System Symbols come to buttons and menus
The built-in SystemSymbol library continues to spread through Studio and the Objo framework.
Desktop Button controls can now display either a Picture icon or a SystemSymbol, and the symbol can be positioned before, after, above or below the button text.
MenuItem also gains a Symbol property, with full support in the Menu Bar Designer and Studio's generated code.
Web buttons support System Symbols too, giving Desktop and Web applications another easy way to use consistent, scalable iconography without having to create and manage image assets.
Simpler parameterised database queries
Database code has become considerably less verbose.
SelectSQL, ExecuteSQL, SelectSQLAsync and ExecuteSQLAsync can now take values directly after the SQL statement. These are safely bound in order to ? placeholders in the query.
For example:
db.ExecuteSQL("INSERT INTO people (name, age) VALUES (?, ?)", "Garry", 45)
Previously you would need to explicitly create and populate a prepared statement for cases like this.
Prepared statements are still available when you need them, but for the very common case of executing a parameterised query once, the new syntax is considerably nicer.
Better Git diffs for VCS-friendly solutions
One small thing that has irritated me for a while is how source files from VCS-friendly .objosln solutions look when viewed outside Studio.
Studio calculates indentation rather than storing it as whitespace in the editor's source model. That's useful internally, but it meant that the .objobasic files written to disk appeared completely left aligned when viewed in GitHub or a normal diff tool. 26.9.2 fixes that.
VCS-friendly solutions now write Studio's calculated indentation into the .objobasic files on disk. Git diffs consequently look much more like the code you see inside Studio.
This is purely an on-disk representation. Studio removes the generated indentation when loading the source, so it doesn't change compilation or the way the editor works. Existing solutions continue to load as before.
Applications can now initiate drag-and-drop operations
Desktop controls could already receive dragged data. They can now initiate a drag as well.
The new DragItem class lets an application start a native drag operation containing text or custom application data. DragData has also gained HasData and GetData methods for retrieving those custom values at the destination.
That means you can now build proper drag-and-drop workflows between controls rather than only accepting content dragged in from elsewhere.
Lots of smaller improvements
There are plenty of other awesome little changes in 26.9.2 too.
Integer.Zero, Double.Zero and String.Empty have been added for consistency with other value types. Window.Show() can now optionally take a display index to make opening a window on a particular monitor much easier. Array.Clear() has been added as the preferred way to empty an array, and Dictionary and HashSet can now optionally treat String keys as case-sensitive.
Studio also does a better job of showing the currently selected search scope, and there has been a large amount of polish and bug fixing throughout the Web designer and browser controls.
As always, the complete list is available in the changelog.
Enjoy!