Article Preview
Buy Now
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):
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
, orexit
. 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 namedOverlay
, which inherits from theOverlayMBS
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 theconstructor
.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 theLogoMBS
method. The size of the logo can then be specified in the parameters. We insert this image into thePict
property of our overlay instance. Obviously, you can use another picture of your choice instead of our logo.With the
UpdateShow
method from theOverlay
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.