Personalized Splash Screen : a simple solution

Jacques Paris, 03/09/2002

There are several ways to build and use splash screens; I have plated with a very simple one that requires a simple text editor, and eventually MapBasic to compile a 7 line program.

Overall design

The splash screen is triggered when MI is launched by a WOR placed in the MI startup.WOR. The splash.WOR opens a splash.TAB in a mapper (that can contain anything from image to simple text) and launches a splash_timer.MBX application that closes that mapper to be closed after a certain delay.

Building a splash screen

File names in italics are given as examples. Full path should be adjusted to your configuration.

1 - Prepare a table with what you want in it. Bests effects are probably obtained when working with a full screen and a maximized window. 

2 - Save it as splash.TAB

3 - Save workspace as splash.WOR

4 - Edit the wor in a text editor. Trim all unnecessary statements. Add the "run application" line. Note that this statement requires the full path for the application. Organize yourself accordingly.

Here is an example of a "working" wor after trimming (more trimming could be further done) and addition.

!Workspace
!Version 600
!Charset WindowsLatin1
Open Table "c:\mapinfo\splash" As splash Interactive
Map From splash 
Position (0.0520833,0.0520833) Units "in"
Width 4.91667 Units "in" Height 2.95833 Units "in" 
Set Window FrontWindow() ScrollBars Off Autoscroll On
Set Map
CoordSys Earth Projection 1, 0
Center (1.690140845,-1.098591549)
Zoom 463.1318504 Units "mi"
Preserve Zoom Display Zoom
Distance Units "mi" Area Units "sq mi" XY Units "degree"
Dim WorkspaceMaximizedWindow As Integer
WorkspaceMaximizedWindow = Frontwindow()
Set Window WorkspaceMaximizedWindow Max
Set Map Window WorkspaceMaximizedWindow Preserve Scale
Undim WorkspaceMaximizedWindow
run application "c:\mapinfo\splash_timer.mbx"

5 - In MapBasic, write the following program

dim tlen,tend as integer

tlen =5

tend=timer()+tlen

while timer()<tend

tlen=tlen+1

wend

close all

 

tlen is the duration for displaying the splash screen in seconds.

 

Compile it as splash_timer.MBX

6 - Locate the startup.wor and include a line that should read

run application "c:\mapinfo\splash.wor"

 

Save and launch MI

 

 

Ready to use example

 

The splash_1.zip file contains all the necessary files to run an example set for 5 seconds display

       

        splash.TAB (and consorts)

        splash.WOR

        splash_timer.MBX (and MB for the lazy ones)

        startup.wor

 

Install startup.WOR file where require (it may depend upon the installed MI version) and all the other files in a c:\mapinfo directory (or in any directory you want as long as you correct the paths in splash.WOR)