Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 22.5 ('Gyroscope')
Instant purchase and download via GumRoad!

COLUMN

An Overview of Overlays

Using Overlays with MBS

Issue: 22.5 (September/October 2024)
Author: Stefanie Juchmes-Simonis
Author Bio: Stefanie studied computer science at the university in Bonn. She became acquainted with Xojo through the work of her brother-in-law and secured a junior developer position in early 2019 at Monkeybread Software.
Article Description: No description available.
Article Length (in bytes): 11,568
Starting Page Number: 85
Article Number: 22508
Resource File(s):

Download Icon project22508.zip Updated: 2024-09-02 10:58:35

Related Link(s): None

Excerpt of article text...

In this article, I would like to introduce you to our overlays from the MBS Xojo plugins. These are areas that you can create on the screen, give them a background, move them as freely as you wish, and use with several mouse events, such as click, enter, or exit. For example, you can mark certain areas in your applications, display notes, and much more.

Let's take a look at the overlays using an example. We use the OverlayMBS class for the overlays. Since we want to work with some events of this class later, we first create a class named Overlay, which inherits from the OverlayMBS class.

Next, we create a button in our main window that we will use to display our new overlay later. In the code behind the pressed event, we first create a new instance of the class we just created. We pass the starting position of the overlay (100,100) and the size of the overlay (250x250) to the constructor.

As we still need the overlay in several areas, we store it in a property of the type Overlay. Since we can't see the area, we create an image for it. We want to use our logo as the background. This is returned to us as a picture from the LogoMBS method. The size of the logo can then be specified in the parameters. We insert this image into the Pict property of our overlay instance. Obviously, you can use another picture of your choice instead of our logo.

With the UpdateShow method from the Overlay class, we then have everything ready to display our overlay (see Figure 1).

...End of Excerpt. Please purchase the magazine to read the full article.