Skip to content

Category: Tips

sort code tips and tricks

Quick Tip: Centering a Picture on any Graphic Context

Sure you can create a Subclass of any Picture, Canvas or class and write code to center another Picture in its respective Graphics contexts. But taking the class extension approach means that you can reuse the same code for any of these (or any additional class) offering a Graphic context, so you can pass along the Picture you want to center and re-scale (if needed) in its area.

Comments closed

Tip: LinkLabel on Desktop

The Xojo Web Framework offers the WebLink class ready to use which handles showing the text with the proper visuals and the opening of the underlying URL in the browser. But if you need to have that feature on Desktop, it’s not that hard! Continue reading so I can show you one possible implementations to create your own LinkLabel class on Desktop.

Comments closed

Using Class Extensions to Validate Email and URL Data

Often in our projects we need to apply some kind of validation of the user input so we get the data we are expecting. For example, getting a valid email addresses or URL. I want to share with you a couple of String Class extensions you can use to see (and conform) whether the user typed a valid email or URL, this is not a silver bullet (there are always exceptions), but it can save you some time now and in future projects.

Comments closed

Tip: Country Selector for Web Apps

All of us are used to dealing with that web form where we select a country from a long, long list of more than 200 hundred countries. It would certainly be more useful, less stressful and a better usability practice to preselect the country name from the IP of the client visitor. Continue reading to learn how you can put a bit of intelligence into your web forms using a WebPopupMenu subclass.

Comments closed

Var, Dim or both?

API 2.0 added Var as an alias for Dim. Var is more recognized by coders from other languages and that’s great. Easily readable code is the goal, so I use both.

Comments closed

Doing Progress Right

The ProgressBar control and loops go hand-in-hand. If there is a ProgressBar on a Window, you can bet a For loop is close by. But there are right and wrong ways to do this, and most of the time I see progress code, I see the wrong way.

Comments closed

Default Values Tip

Often when debugging an application, you’ll need to enter the same data in the same fields over & over. There is a temptation to set the value of the field to the test data. The downside of this is that you need to remove all those defaults before deploying your application.

Comments closed