Skip to content

Category: Tutorials

tutorials, longer instructional posts, how to’s

ContainerControl: Composed User Interface Components

Xojo’s Library offers a good amount of UI controls ready to use: buttons, input text controls, lists, popup menus, progress bars, panels, labels, a control to play movies, etc. However, sometimes we need to display exactly the same combination of controls, using the same layout, in several windows of an app. What’s the best approach in these cases?

Comments closed

Creating your own ComboBox Subclass with Sorted Menu Items

The Xojo ComboBox desktop control is a powerful one. It combines the capabilities of a TextField with the PopupMenu. That means that you can choose from the available options in the associated menu or you can type another value in the ComboBox text field. What about getting the ComboBox to do things not included in the class?

Comments closed

Converting Web Projects to Web Framework 2.0

With the release of Xojo 2020r1 comes the new 2.0 version of our web framework. While the way in which you build web applications hasn’t fundamentally changed, this new version is a from-the-ground-up rewrite and utilizes API 2.0 for greatly improved consistency. This means that the conversion process is going to be time-consuming, but will be well worth the effort as web applications built upon Web Framework 2.0 will be more robust, handle more users, be more responsive and have a far more modern look and feel.

Comments closed

Top-Rounded Rectangle

On the forum a user asked if there was a way to create a rectangle with only the top left and top right corners being rounded. Xojo’s built-in RoundRectangle control draws with all four corners rounded, so that was not an option.

One solution is to use a GraphicsPath to draw exactly what you want. With a GraphicsPath you can use the AddArc() method to add rounded corners and then draw the lines for the rest of the rectangle.

Comments closed

Starting Graphics with GraphicsPath

In Xojo there is a new class, GraphicsPath, that you can use to create graphics as a mathematical description of shapes and lines; ranging from simple lines to Bézier curves, arcs, rectangles, there are many advantages to using these! For example, as a class on its own, it doesn’t even needs a graphical context (Graphics) in order to describe the shapes you want to use, and the mathematical representation means more control and precision. Simply put, you only need to join the points!

Comments closed