Skip to content

1. Getting started

Gary Criblez edited this page Jun 26, 2020 · 4 revisions

AJUI Banner is a fairly simple component to handle.

To start with, we will briefly present three code extracts that allow you to create banners.

In all cases, you must add a form object that will contain the banner and that must meet the following conditions:

  • This is an object form associated with a picture variable.
  • It must be called AJUI_Banner and be put in place on the first page of your form.
  • If it is on another page of the form, add the page number to its property name (eg AJUI_Banner2 for page 2, AJUI_Banner3 for page 3, etc.).
  • Generally the form object is positioned in the foreground except for specific cases according to your needs.

The management of the picture visibility is not handled by the component. We advise you to set the form object to invisible by default and make it visible when required. We also recommend that you avoid using the form object in page zero (even if it is possible to do so) because the form objects of the other pages often override it.

Case 1: "Window" banner with text

Form.banner:=New AJUI_Banner
Form.banner.Banner("window")
Form.banner.isPicture(False)
Form.banner.Message("You're welcome")
Form.banner.DrawBanner()

Case 2: "Window" banner with picture

Form.banner:=New AJUI_Banner
Form.banner.Banner("window")
Form.banner.isPicture(True)
Form.banner.PicturePath("Images"+Folder separator+"yourPicture.png")
Form.banner.DrawBanner()

Case 3: Tag banner positioned at the bottom right

Form.banner:=New AJUI_Banner
Form.banner.Banner("cornerRibbon")
Form.banner.Message("Corner Ribbon")
Form.banner.BannerPosition("bottom-right")
Form.banner.DrawBanner()

You are then free to try out the different possibilities of banner construction and model them at your convenience.

Reminder on restrictions: The component requires the text to fit on a single line, so make sure to adapt the size of the banner to the size of your text.

For the "spinner" and "windowSpinner" types, you just have to reproduce what you did for the "window" type by just changing the name of the type. Also try to change the scale for the " spinner " and modify the alignment for " windowSpinner ". Don't forget to use the "StopSpinner" formula to stop the animations.

AJUI_Banner class

Since V18R3, you can replace the returned instance by New AJUI_Banner with the call of the Banner class. The functions of the Banner class use the same names and parameters as for the formulas obtainable by New AJUI_Banner. The default values are also the same.

The only difference in terms of code is when the instance is created:

  //with formulas
    $myBanner:=new AJUI_Banner ()

  //with class
    $myBanner:= AJUI_Banner.new ()

Clone this wiki locally