Unlimited Browser v0.02 Specification

1.       What is Unlimited Browser?

2.       Restrictions

3.       How to create an interface

4.       Programming considerations

1. What is Unlimited Browser?

Unlimited Browser (ULB) is a program, which can be used to create very spectacular User Interfaces. It is very ease to use, all you have to do is to draw your UI, create the elements, write the code for them, and there you go… Ready J. It uses DirectX 7, but if you don’t have it, don’t panic, it will work without it too. Works very nice with XP, here were some small problems under 98.

ULB has a main purpose, that is to create multimedia presentations, or ULB can be used to act as the User Interface of a Multimedia CD – Rom, Presentations, Slideshows, or anything, you can imagine, it could be used for.

ULB features:

-          Timers and timeouts

-          SlideShows

-          Moving objects

-          Link inside static objects

-          Programmable Actions

-          Much much more, you’ll discover later in this document

2. Restrictions

At this moment (v0.02) has a few restrictions:

-          the interface description must be in browser.dat

-          naming restrictions apply for link buttons (see the Links section)

-          Files must be .BMP

Reasons for these restrictions: this program was not intended for use by the public, only in small circles was it supposed to be spread, but there was a need from the public, to create more features, especially to create a more dynamic structure of objects, so the program needed to evolve. I will work on these restrictions later, promise J.

2.1 The format of the Browser.Dat file

The BROWSER.DAT file is in the directory, where the loader resides (For changing the Icon for the loader, contact me). The first three lines of the file are reserved to be used by the loader, the rest is the source of the program. These two lines are commented for the Browser, and must look in the following way:

|&DIR=pics&|

|&MODULE=Codex.Browser.ULM&|

|&BACKGROUND=YES&|

|&TITLE=My_Title&|

|&ICON=FILE.ICO&|

so as you can see, the first line defines the directory, where the browser module resides, the second line is the name of the module. Do not use spaces in these two lines, as stated before, they are special kind of comments. The browser modules container directory should be in the one, where the BROWSER.DAT file resides.

The third line tells the browser,whether to have a black background (i.e. the rest of the programs won’t be visible) or not to have one. The fourth line is th tile of the application. The fourth line will be the icon of the application. Do not use spaces in the Application Title. If you don’t have an icon, put there: UNUSED. The icon must reside in the directory, where the Browser module is to be found.

After these lines, your source comes.

3. How to create an interface

Simply create a .BMP file, which will be your UI. I usually use Photoshop, because it’s the best I could find out there right now. I don’t say, that it is easy to use, but with a few hours of learning you’ll create really spectacular Graphics with that. So let’s suppose, that you have your graphics. Don’t forget, that it must be 800x600. Now save the file under BMP format. Open it with Paint (I say the simplest method to create the UI), and simply start selecting the objects of your interface, my advice is to use Cut (to see, what’s left) remember the starting positions and size (it is the best, if you write them directly into the program (aka browser.dat)), you took out, paste them into a new Paint, save under a name, you like, write the name into browser.dat too. When you have nothing left of the picture, you are ready.

Now you can go, and ad the features you want your user interface to have to browser dat. For a complete tutorial check out this link.

4. Programming considerations

The visual objects supported by ULB at this moment are:

-          Static images (simple pictures)

-          StaticLink objects (Link area inside a static object)

-          Link objects (work like buttons)

-          One HTML Browser (You might need it someday too)

ULB also can handle the following (non visual) objects:

-          Timers

-          SlideShows

ULB has support for actions, described later down here...

The color coding is the following: Class names, and object properties are written in blue. String like varibles are in red. Action and ActionObject names are written in bold, the res t is simple and nice black. All the code is written using Courier New. The string parameters should be included in quotes: “This is My String”. If you omit the string, It won’t contain any spaces after parsing the input file.

Unlimited browser introduces the concept of ActionObject. ActionObjects are objects, such as a normal object, but they have also code that they execute, without any special specification. Just imagine it as the constructor function of a normal object, but in ULM this constructor can be called more than once. Such an ActionObject is the Timer.

4.1 Static Images

You create a static image with the following syntax:

@Image():Static {

  pos = 10,10;

  size = 20,20;

  base = %picturename.BMP;

}

Every object definition in ULB begins with the @ sign. After this comes the name of the object, so that you know, how to call it. At this moment only the mentioned properties are available for a StaticImage. pos means the position on the main form, zero based. size is the size of the image, and finally base is the name of the picture that will be loaded for our Static object. Consider about the % sign preceding the name of the picture. This notation is used for the Static images, and StaticLink objects. If the picture name contains spaces, include them in quotas: base = %“my file.bmp”;.

The three fields presented here are common for all the objects that ULB handles at creation time, so I will just skip it in the later examples.

4.1.1 Methods of Class Static

4.1.1.1 Show

The Show method can be used to make a Static object Visible. This is the default state of an object. Example: Image.Show();

4.1.1.2 Hide

The Hide method can be used to hide an object. After the object is hidden, it can be made visible using the Show method. Example: Image.Hide();

4.1.1.3 Load

The Load method of the Static class can be used, to load a new image instead of the one already present there. It expects exactly one parameter, i.e. the name of the pictrue to load. Example: Image.Load(“c:\work\bitmap.bmp”);

4.1.1.4 Place

The Place method is used to place a Static object on the screen. It expects two parameters, the coordinates, where to place the object. Example: Image.Place(10,20);

4.1.1.5 Move

The Move methods moves the object, with the specified deltaX and deltaY pixels according to the current position. Example: Image.Move(1,1); moves the image one pixel to the left, and one pixel to down.

4.1.1.6 BringToFront

Brings the object in the front of the others.

4.1.1.7 SendToBack

Send the object behind the others.

4.2 StaticLinks

StaticLink extends Static, so every base method and base property of the Static class

A StaticLink object is actually an image, which has a rectangular area defined in it, that acts like a Link. You define a StaticLink in the following way:

@MyStaticLink(): StaticLink(10,10,300,100,MyAction) {

...

}

You might be used, that the second and third parameter specify the width and height, but in this case they are not. They represent the second (x,y) pair of the link area. MyAction is a quick action, or a normal action, for more about actions see there.

4.3 Link objects

The Link objects work as the Links in a web page. In fact this is an Image too, but it changes its picture, when the mouse moves over it. You define a Link in the following way:

@MyLink(ActionName):Hot {

  pos = 10,10;

  size = 20,20;

  base = base;

  onEnter = enterAction;

  onExit = exitAction;

}

As you can see, the class for Links is Hot. Don’t Ask why. More important is the action that this Link performs when clicked. The action assigned to MyLink is ActionName. This action will be called, when the user presses the mouse over this Link. This action must be define as later describbed in the Actions section.

The other big difference between a Static Image and a Hot Link is the base property. As you can see, the Link has only the base name of the image file, that will create the two states of the link. The base image (when the mouse is not over the image) is called: base_o.bmp, and the second image, the one, which will be drawn, when the mouse is over the link, is base_s.bmp. If you are just curious, o stands for original, and s stands for selected. So you must have these two pictures, for a link to work perfectlty.

For every Link there are the onEnter and onExit properties, so called event handlers. The values of this properties are the names of an action, which should be called, when the mouse enter respectively leaves the image. Example:

$enterAction {

  Message(“Mylink enter”);

}

$exitAction {

  Message(“Mylink exit”);

}

4.4 A HTML Browser

This is a classic Internet Explorer ActiveX control, so I think, it does not need any special explanation. It can handle the most common Browser tasks, such as Open, Back, Forward, of course, each of these has the corresponding command.

0 {

  pos = 10,10;

  size = 20,20;

  base = path_to_html;

}

Defines for you the Web Browser object. Be careful, when setting the path to html. It is relative to the directory, where the loader and the browser.dat file resides, so you cannot open c:\ for example.

4.4.1 Explorer

The Explorer command (simply use this, it is a global command at this moment, but this can change every moment. Don’t worry about backward compatibility. There will be none J) opens the desired web page. It has one parameter, namely a String. If the first character of this String is ‘:’ then the page will be opened in the ActiveX plugin, else it will be opened in a new Internet Explorer Application. Examples:

  1. Explorer(http://www.codexonline.hu); This will open in a new window the given site.
  2. Explorer(:pages/index.htm); This will open the given page in the ActiveX control container. Realtive to where the browser.dat file resides.

4.4.2 GoBack

Forces the WebBrowser Component to Go back to the previous document. Can be used as ShellAction too. Example:GoBack();

4.4.2 GoForward

Forces the Browser component, to go forward one document. Example: GoForward();

4.5 Actions

Actions might be viewed, as procedures or functions from other programming languages. Every time, the user clicks a link, the corresponding action will be called. Here lies the definiton of an action:

$WebClick {

  Explorer(:web/index.htm);

}

The Action named main has a special role, namely, it is executed, when it is found. Not when all the data is loaded, simply when it is found, so usually I place this action at the end of the file. The parsing of the file begins at the beginning and every time, the parser has found something it simply sees, how can he handle it. And if it is the main action, simply executes it.

4.5.1 Quick Actions

Some Actions can be “quickened”, especially those, that do not need paramters. This means, that when you create your Hot object, you don’t need to define the action it should call, when pressed, instead you put there the % sign, followed by the Action name. Example:

@BackButton(%GoBack):Hot {

...

}

This defines the close button, and assigns to it the GoBack command, without having to define a new action, which explicitly calls GoBack();

4.5.2 Call

Actions can call other actions, using the Call command. Expects as parameter the name of the action.

4.6 Timers

Timer objects are ActionObjects. Now you might ask what is an action object. Lets take the following definition for it: An ActionObject is the mixing of object definiton, (based on a class) with some kind of action, this object is supposed to execute when created, or just anytime.

The definiton of an ActionObject differs from the definition of the Objects (such as Static, Hot, etc...) in the following: it begins with a ‘$’ sign, not a ‘@’ sign, such as the definition of every action. But the definition of an ActionObject differs from the definition of an Action in the following: it defines the class, to which it belongs, in the way, the objects do. Lets se for example the definiton of a Timer:

$ScrollDown:Timer(10) {

 Empty1.Move(0,1);

}

As you can see, the definiton begins in the style of the definition of a normal action, but after the name of the action it is specified, that this is an ActionObject of type Timer, so commands are next. Especially, this timer executes at every ten milliseconds, moving the object Empty1 down one pixel.

When we create a Timer it is created suspended, so you have to start it.

4.6.1 Start

This method of the Timer Action Class starts the timer. Usually start timers in the main action, or at a specific click. Example: ScrollDown.Start();

4.6.2 Stop

This method stops the timer. Example: ScrollDown.Stop();

4.6.3 SetTimeout

Use the timeout method for a lot of interresting tasks, such as creating timers, which execute for a given number of times, and then call a method. When the method is called, the timer won’t stop, you have to do it explicitly. The first parameter of the method is the number, after which the timeout Action (the second parameter) will be called. In the timeout procedure you can set again the timeout for your timer, so it will call itself infinitely. Example:

$ScrollDownTimeout {

  | Do whatever you want here, and the call the timer again. |

  ScrollDown.SetTimeout(100, ScrollDownTimeout);

}

$main {

  ScrollDown.SetTimeout(100, ScrollDownTimeout);

}

4.7 Slideshows

Slideshows are non visual objects, that hold images, and they are supposed to present them, at a given moment. Slideshows act together with timers, in a way, that the Slideshows advance command is called from a Timer. Look at the example.

We create a slideshow in the following way:

$MySlideS:SlideShow(Empty1) {

  MySlideS.Add(null0_1.bmp);

  MySlideS.Add(null0_2.bmp);

  MySlideS.Add(null0_3.bmp);

  MySlideS.Add(null0_4.bmp);

  MySlideS.Add(null0_5.bmp);

}

$Banner:Timer(2000) {

  Reklam.Advance();

}

So, as you can see, the Slideshow is an acion object too. It is assigned to an object, that might be a static a static link, or a hot object.

4.7.1 Add

The add command ads the given image to the slideshow. Example: MySlideS.Add(null0_1.bmp);

4.7.2 Advance

The advance command advances the slideshow to show the next image, i.e. forces the object assigned to the slideshow, (the placeholder) to load the next image. Example: MyslideS.Advance();

4.8 Other commands

4.8.1 Message

The message command takes one string parameter, and shows it in the form of a message box. Example: Message(“Hello World”);

4.8.2 SetSize

The SetSize command takes two parameters, both of them are numbers, and sets the size of the main form to those. Use the SetSize only in the main action. Example:

$main {

  SetSize(640,480);

}

5. Todos

-          More advanced interpreter (mathematic formulas needed)

-          More types of object and commands

-          Plugin arhitecture

-          More ActiveX plugins

-          Fixing the flickering bug (try to move a big object, and wonder how slow it’s redrawn)

-          Anything else??? Mail me.

6. Contact

You can send mail anytime to angelnow1999@freemail.hu hopefully I’ll answer that quick enough.

7. Copyright and the usual Yada-Yada

Well, hereby you are granted to use the Unlimited Browser and the interfaces you create in every circumstance, except that if you create something, that wants to make publicity for a terrorist corporation, or a drog dealers business I about to rise, because of the publicity made by ULB. Well in conclusion, terrorsits and drog dealers are not allowed to use ULB.

And of course, I am not responsible for any damage caused by the improper use of this program, or any of the interfaces created with it, any brain damage to you, your dog and cat, maybe the neighbors’s sleeping rat. You use the program at your own risk.

Best Regards

Angel