Here's how to create a user-defined statusbar to replace the Alpha Five statusbar.

At the Alpha Five Control Panel, go to the Code tab, right click on the white background and select "New toolbar"

Create a blank new toolbar (see fig. 1).

Add just one "object" to the toolbar by clicking the "Free-form Xdialog" button. (This will allow us to create a special kind of toolbar that uses Xdialog commands. For more information on Xdialog refer to the Learning Xdialog book).

Then click the "Define Xdialog Code" button.


  Fig. 1

On the "Xdialog Body" tab of this dialog (fig. 2) define the following snippet of Xdialog code.

{text=1000,1:globaltext}


  Fig. 2

This tells Alpha Five to create a text object 1000 characters long, and 1 "row" high, to display the contents of a variable called "globaltext"

We chose 1000 to make sure that the vertical bar that Alpha Five draws to the right of a toolbar is pushed off the screen even on machines with the highest resolution.

Globaltext will be a global variable. We will define that later.

On the Toolbar Appearance tab of the toolbar editor (fig. 3), make sure that the "Toolbar Locked" box is checked. Also set the only docking position to be "bottom" and uncheck the "remember toolbar position" toolbar.


  Fig. 3

Also make sure that the toolbar title is filled in. Use the name statusbar. (It is not important what you call it, but you must remember the name for later).

Save your toolbar, (let's call it StatusBar)

Next, open the Interactive window (fig. 4).


  Fig. 4

First, DIM globaltext as character variable. The statusbar will show the contents of this variable.

Then set globaltext to the initial text for the toolbar: "this is so very cool".

Then open the toolbar. The xbasic command to open a toolbar is a5_toolbar_open(toolbarname)

Please Note: You can also open a toolbar by double clicking on it in the Control Panel.

Fig. 5 below shows what the bottom of the screen looks like after you have run the "statusbar" toolbar.


  Fig. 5

Note that we have turned off Alpha Five's built-in statusbar.

The xbasic to do this is:

statusbar.show()

and

statusbar.hide()

Now, here is how we can write text to statusbar (fig. 6).


  Fig. 6

I show the Xbasic commands being executed in the Interactive window.

In the first line of code, we change the contents of the global variable to some new text. This does not immediately refresh the statusbar. You need to tell the toolbar to refresh itself using the command:

Ui_dlg_refresh("statusbar")

Note that statusbar is the toolbar title that we defined in the toolbar editor.

In a live application, you might want to use the ui_modeless_dlg_exists() command before sending the toolbar a refresh command, or else an error will result.

To turn off the statusbar, the xbasic command is:

Ui_modeless_dlg_close("statusbar")

Fig. 7 shows what the statusbar looks like after the refresh command.


  Fig. 7

As this tutorial shows, it is really easy to create your own statusbar.