Skip to content

Author: Paul Lefebvre

Updating Code That Used The Graphics Property

Prior to Xojo 2018r3 Window and Canvas both had a Graphics property that you could access and draw to. This was deprecated in 2011 because it had significant performance issues on all platforms. The preferred way to draw your graphics since 2011 has been to use the Window.Paint or Canvas.Paint event handlers and the supplied parameter g As Graphics.

Starting with Xojo 2018r3, this Graphics property was removed from Window and Canvas so if you had code that was still relying on it, that code will no longer compile. Here are some tips on how you can migrate your code to use the Paint event handlers and tell the Canvas to update with a call to Invalidate.

Comments closed

Hour of Code: Xojo Dojo

December 3rd kicks off Computer Science Education Week 2018! Computer Science Education Week is held in early December every year in recognition of the birthday of computing pioneer Admiral Grace Hopper. Alongside this is the Hour of Code promotion where schools throughout the world get students to try at least 1 hour of programming at some point during the week.

Each year for Hour of Code, I volunteer at the local Middle School to talk to the students about what it is like to be a programmer and do a little bit of programming. This year I plan to demonstrate Xojo Dojo with a Raspberry Pi and show the kids how much fun coding and Xojo programming can be.

Comments closed

Drawing Objects in a Canvas with the Paint Event

The Canvas control is a great way to draw pretty much anything to a window. With a Canvas, do all your drawing in its Paint event handler for the best quality and performance.

I’ve had many people ask for an example for how to create a Canvas that allows you to:

  • Draw pictures within it (as objects)
  • Move these objects
  • Remove them
  • Add labels to them
  • Programmatically select one

This example demonstrates how to do all these things. It has a large Canvas on the window with several buttons that let you add and manage the objects on the Canvas.

Comments closed

Adventures in Regular Expressions

As you probably know, every version of Xojo includes an extensive list of release notes that is included in the Documentation folder as an HTML file called ReleaseNotes.htm.

To make these even easier to access, I needed a way to get these into the wiki. It would be easiest if I could just copy and paste the HTML contents onto a wiki page, but MediaWiki can’t quite process all the HTML in that file so I needed a way to clean it up a bit.

Comments closed

#JustCode Challenge Week 14 – Marching Band ScoreKeeper

For the final week of the #JustCode Challenge I’ve made an iOS app that keeps the score for high school marching band shows. The ScoreKeeper app lets you add a show or event and then set the scores when they are announced at the end of the show. Though this is for marching band, it can easily be adjusted to keep track of a set of scores for any sort of competition or game.

Comments closed

Localize Your Edit Menu on Mac

On macOS you may have noticed two special menu items that appear at the bottom of the Edit menu: “Start Dictation” and “Emoji & Symbols”. These menu items are added automatically by macOS provided your Xojo app follows a few simple rules.

Comments closed

Quick Control Library Tips

When you start using Xojo one of the first things you’ll see is that there are many, many types of built-in controls. The area where you see all the controls is called the Library and each project type (desktop, web or iOS) has its own set of controls.

No matter the what type of project you are creating, learn these tips to make using the Library and finding controls fast and easy.

Comments closed

#JustCode Challenge Week 13 – Xojo Speed

When Geoff and I were driving around Germany with Christian Schmitz of MBS Software before the MBS Xojo Conference started, the topic of speed limits on the autobahn came up. Christian mentioned than many cars in Germany have the speedometer set to display a speed that is a little higher than what you are actually doing. I have noticed that my Toyota Tacoma shows 70mph on the speedometer when it is really going more like 67.

Geoff wondered if there was a way to determine how accurate your car’s speedometer was and it made me think of a Xojo iOS app I had made a while ago: Xojo Speed.

Run Xojo Speed on your iPhone while you’re driving and it uses the iOSLocation class to calculate the miles per hour or kilometers per hour in a large, easy-to-read display.

Comments closed

#JustCode Challenge Week 12 – MultiTemp

It’s week 12 of #JustCode and I’m in in Munich, Germany at the MBS Xojo Developer Conference! I’ve never been to Germany and had no idea what the temperature would be, so instead of using the Weather Channel, I found a web API called OpenWeatherMap and built an iOS app to fetch the weather for display in a table. I even implemented the new table refresh feature added to Xojo 2018r2.

Comments closed