USA
Email this Page | | Feedback
WeatherBug Desktop App

Labs

Change Location

Leopard v2.2 (Powered by WeatherBug®) User Guide

http://leopard.weatherbug.com
leopard@weatherbug.com

Created by Brandon Watts
brandonwatts@gmail.com
http://www.leopardprogramming.com

CONTENTS:

1.     Introduction
2.     Editor
3.     Building a Window
4.     Adding Controls
5.     WeatherBug Controls
6.     Printing to Controls
7.     Using Onclick Events
8.     WeatherBug Onclick Events
9.     Window Properties
10.   OnOpen/OnClose Events
11.   Variables and Math
12.   Logic and Looping
13.   Timer and Subroutines
14.   Graphics Window
15.   Text Window
16.   No Window
17.   Troubleshooting/Tips
18.   Register Leopard
19.   License Agreement/Legal Information


Back to Top

INTRODUCTION

Welcome to the Leopard programming language! Unlike other complicated programming languages, Leopard simplifies the process, making programming easy and fun. In a short amount of time, you'll be creating your very own software. Leopard is a fantastic educational tool for students, and it's been used in classrooms all over the world.

New features that have been added to v2.2 include support for multiple onclick events, logic, looping, subroutines, a timer, and so much more!

This document is designed to give you an overview of all the features that Leopard contains. Be sure to also look at the example programs that are included with this distribution in order to better understand how the language works.

For those of you who wish to create executable files that can run independently of Leopard, and in turn, also gain access to priority support, please consider registering Leopard. Your support will help the product to continue improving.

Please feel free to contact me if you have any questions or comments.

Enjoy!

Brandon Watts
brandonwatts@gmail.com
http://leopard.weatherbug.com
http://www.leopardprogramming.com

Back to Top

EDITOR

The Leopard interface was built to be very easy to understand and use. Here's an overview of the menu options in the editor:

File

  • New - Clears the editor of all code.
  • Open - Opens a previously saved .lep file.
  • Save - Saves the current code to a .lep file.
  • Exit - Closes Leopard.

Run

  • Run - Executes the program in the editor.
  • Compile - Creates an executable file from your program.

Options

  • Pixel Grid - Helps with control alignment.
  • Change Font - Changes the font of the editor.
  • Change Text Color - Changes the text color of the editor.
  • Print Code - Prints a copy of the current code from your printer.

Help

  • Help Topics - Opens this file.
  • About Leopard - Displays various Leopard information.

Back to Top

BUILDING A WINDOW

Let's now build a simple window. First, specify the type of window that you want to use, which for this example is a regular window. You do this by typing the following command in the editor:

window

Now you enter the text that you want to appear in the title bar of the window:

window title
My First Window

Next, decide on the size of the window:

window size
300
200

The first number is the width of the window, and the second number is the height. These numbers are declared in pixels.

Once the window has been constructed, you need to let Leopard know that you are done programming by using this vital command:

end

This command must be at the end of every one your programs! If it's not included, your program will not run properly.

Your program should look something like this:

window

window title
My First Window

window size
300
200

end

Click Run to execute your program. Congratulations - you've built your first Windows program!

Notice how I have spaced the commands apart instead of typing them one after the other like this:

window
window title
My First Window
window size
300
200
end

That's the wrong way to write a Leopard program. Allowing adequate space between the commands helps readability, and it also ensures that Leopard will be able to interpret your code properly. Make it a regular practice to use considerable white space between each command set.

Back to Top

ADDING CONTROLS

Now that you know how to build a simple window, let's add some controls to it.

Here's the list of controls that you can use:

  • textbox
  • textedit
  • text
  • button
  • bmpbutton
  • listbox
  • combobox
  • radiobutton
  • checkbox
  • groupbox
  • menu
  • imagebox
  • web
  • web browser

In these examples, just change the numbers to the dimensions of the control that you want to create. The first two numbers specify the location on the window (width/height) where the control appears. The last two numbers are the width and height of the control itself. This applies to most of the controls that you will utilize. If you only see two numbers, then that means that they represent the window location of the control. If the text of a certain control gets cut off, then just make the control bigger.

Textbox:

textbox
10
10
90
90

Textedit:

textedit
10
10
90
90

Text:

text
Hello World!
10
10
90
20

Button:

button
Click Me
10
10
60
20

Bmpbutton:

bmpbutton
name.bmp
10
10

The graphic used for this control must be a proper bitmap, and it should be placed in the folder where Leopard is running from, along with your program file.

Listbox:

listbox
10
10
90
90

Combobox:

combobox
10
10
90
90

Radiobutton:

radiobutton
Click Me
10
10
90
90

Checkbox:

checkbox
Click Me
10
10
90
90

Groupbox:

groupbox
Group
10
10
90
90

Menu:

menu

Imagebox

imagebox
image.jpg
50
90
200
150

This control supports JPG, GIF, BMP, ICO, EMF, and WMF images. This image should be placed in the folder where Leopard is running from, along with your program file.

Web

web
<embed code>
no scrollbars
10
10
320
280

The Web control gives you the ability to include specific pieces of content from the Internet in your Leopard programs. For example, you can copy and paste the embed code for a YouTube video or any other resource on the Internet in the designated line above to use it in your project. HTML code is also allowed in this control, so you can use images, create links, and change the appearance of items.

If you want the Web control to contain scrollbars, just type "scrollbars" instead of "no scrollbars" in the code for the control.

This command can also be used to display the regional WeatherBug maps that are referenced in Section 8. The usage would look something like this:

listboxthree onclick
change webtwo
weatherbug radar SE

Web Browser

web browser
http://www.leopardprogramming.com
10
10
500
300

You can also use this control to display a local HTML file: C:\MySite\Page.html

Of course, one control isn't always enough. In Leopard, you can use ten instances of each control, with the exception of the listbox, combobox, menu, Web and Web browser controls. The listbox, combobox, and menu controls can only be used one time, while the Web and Web browser controls can be used five times in one program.

For example, if you wanted ten button controls, you would use the button code that was presented earlier, only this time you would add the number to the end, such as:

buttontwo
buttonthree
buttonfour
buttonfive
buttonsix
buttonseven
buttoneight
buttonnine
buttonten

So the complete syntax for the third button would be something like:

buttonthree
Click Me
10
10
60
20

A program with two button controls would be written like this:

window

window title
My Sample

window size
300
200

button
Button #1
110
10
60
60

buttontwo
Button #2
110
100
60
60

end

Remember to always start with the first control and add others as needed.

Back to Top

WEATHERBUG CONTROLS

This is the list of WeatherBug controls that you can use:

weatherbug
weatherbug camera

You can use five instances of each of these controls.

WeatherBug:

weatherbug
20876
300x250
20
10

In this code, "20876" is the zip code that you want the WeatherBug module to display the current weather information for. This control uses Flash to display the content, so if you don't have it installed on your computer, then the control won't appear as intended. 300x250 is one of the available configurations of the control, and depending on which configuration you choose, you'll see the temperature, wind speed and direction, forecast, and so on.

The available configurations are as follows:

300x250
250x250
180x150
125x125
120x600
728x90
temperature

WeatherBug Camera:

weatherbug cameratwo
AWSHQ
10
10

For this control, "AWSHQ" represents the camera image that you want to display in your Leopard program. To retrieve the name of a camera image, go to weatherbug.com, find the weather camera image that you want to use, right-click on it, and then select Properties. The URL location for the image will be something like:

http://wwc.instacam.com/instacamimg/AWSHQ/...

Use the name that's in the place of "AWSHQ" in order to properly display the image with the WeatherBug Camera control.

Here's a sample program that uses one of the WeatherBug controls:

window

window title
WeatherBug Flash Example

window size
355
325

background color
blue

weatherbug
350x250
30501
15
20

end

Back to Top

PRINTING TO CONTROLS

Before we learn how to use onclick commands, let's first figure out how to print to certain controls when the window opens. These commands should be issued after the controls have been created.

Printing to textbox and textedit controls is very simple. If you want to print to the first textbox, type:

print textbox
Text

If you would like to print to texteditfour, then you would type:

print texteditfour
Text

Just use the print command with the name of the textbox or textedit that you want to print to, and on the next line, specify the text that you want printed.

Here is an example of what this code might look like in a program:

window

window title
Control Test

window size
300
300

textbox
10
10
120
120

print textbox
Test

end

You can also print to listbox and combobox controls, too. Use the same code that you used to print to the textbox and textedit controls, except this time, name the listbox or combobox selection. You can only use one combobox and listbox control in Leopard, but they can each hold ten items. Here's an example:

print listbox
One

print listboxtwo
Two

Used in a real program it would look like this:

window

window title
Listbox

window size
300
300

listbox
10
10
120
120

print listbox
One

print listboxtwo
Two

end

This works the same way with comboboxes. You can place up to ten items in the combobox and listbox controls, but as is the case with the standard controls, always name the first item and work your way up to ten.

Back to Top

USING ONCLICK EVENTS

Onclick events enable you to make your programs do some more useful things. They specify what happens when a user clicks on a certain control.

To use them, just type the name of the control and add "onclick" to it.

Examples:

button onclick
menu onclick
bmpbuttonthree onclick
listboxeight onclick

You then follow that code with the command that you want to execute.

You can also chain multiple onclick events together (up to five) for each control so that more than one action can be performed at a time once an event has been triggered.

button onclicktwo
button onclickthree
button onclickfour
button onclickfive

You'll see how this is accomplished by following along with the commands below.

ONCLICK COMMAND LIST:

notice
print textbox
print textedit
printer textbox
printer textedit
write file
append file
playwav
stopwav
print
delete
internet
e-mail
close window
cursor
date
drives
filedialog
make directory
remove directory
printerdialog
run
time
run text
fontdialog
cd open
cd close
play avi
play avi fullscreen
restart
read file textedit
read file textbox
play mp3
stop music
pause music
play midi
colordialog
download file
textedit file
textbox file
play mpeg
play mpeg fullscreen
pause video
stop video
change window title
file check
change text
rename file
maximize
minimize
change web
change web browser

EXPLANATIONS:

To display a notice box:

buttonseven onclick
notice
Leopard

To print to a textbox:

bmpbutton onclick
print textboxfour
Look at me!

To print to a textedit control:

radiobutton onclick
print texteditthree
Look at me!

To create a new file:

menu onclick
write file
test.txt
Complete!

Instead of using the ".txt" file extension, you can name your own. Leopard commands that create or open files like this place/run them in the directory where the program is being executed unless you give them a direct path to place/run the files, such as: C:\MyFolder\test.txt.

To append to a file (add to it):

button onclick
append file
name.dat
Append

To play a wav file:

checkbox onclick
playwav
sample.wav

To stop a wav file:

radiobuttonsix onclick
stopwav

To print text from a printer:

listboxtwo onclick
print
Here I come!

To print text from a textedit control to your printer:

menu onclick
printer textedittwo
next

To print text from a textbox control to your printer:

menu onclick
printer textboxtwo
next

To delete a file (be careful with this):

checkbox onclick
delete
file.txt

To open the default browser and go to a Web site:

menu onclick
internet
www.leopardprogramming.com

To open the default e-mail application and put an address in the "To:" field:

radiobuttontwo onclick
e-mail
brandonwatts@adelphia.net

To close the program window:

menu onclick
close window
next

To change the cursor:

bmpbutton onclick
cursor
crosshair

Instead of the crosshair, you can also use:

text
arrow
hourglass
normal

To find out what the current date is:

checkboxnine onclick
date
next

To see what hard drives are on the computer:

bmpbutton onclick
drives
next

To open a filedialog box:

menu onclick
filedialog
next

To make a directory (folder):

buttonfive onclick
make directory
Leopard

To remove a directory (folder):

listbox onclick
remove directory
Leopard

To see the printerdialog:

bmpbutton onclick
printerdialog
next

To run an executable file:

radiobutton onclick
run
Program.exe

To see the current time:

checkboxfour onclick
time
next

To open a text file in Notepad:

listboxtwo onclick
run text
beta.txt

To see the fontdialog:

menu onclick
fontdialog
next

To open the CD tray:

radiobutton onclick
cd open
next

To close the CD tray:

menu onclick
cd close
next

To play an avi file:

checkbox onclick
play avi
name.avi

To play an avi file fullscreen:

checkboxtwo onclick
play avi fullscreen
name.avi

To put the contents of a file into a textedit control:

radiobuttonfour onclick
read file texteditten
name.txt

To put the contents of a file into a textbox control:

radiobuttonfour onclick
read file textboxten
name.txt

To play an MP3 file:

menu onclick
play mp3
song.mp3

To play a midi file:

bmpbuttonfive onclick
play midi
song.mid

To stop the audio from an MP3 or midi file:

button onclick
stop music
next

To pause the audio from an MP3 or midi file:

button onclick
pause music
next

To display the colordialog:

checkboxtwo onclick
colordialog
next

To download a file from the Internet:

radiobuttonthree onclick
download file
http://www.domain.com/me.jpg
C:\me.jpg

The "C:\me.jpg" part of the code tells Leopard where to save the downloaded file on the computer.

To save the contents of a textbox control to a file:

menu onclick
textboxthree file
file.html

To save the contents of a textedit control to a file:

menu onclick
texteditthree file
file.html

To play an mpeg file in a small window:

buttonthree onclick
play mpeg
filename.mpeg

To play an mpeg file fullscreen:

listboxfour onclick
play mpeg fullscreen
filename.mpeg

To pause the video:

bmpbutton onclick
pause video
next

To stop the video:

bmpbuttonfour onclick
stop video
next

To change the text in the window titlebar:

comboboxfive onclick
change window title
New Text

To see if a file exists:

radiobuttontwo onclick
file check
name.bmp

To change the text of a text control:

menu onclick
change textthree
New Text

To rename a file:

buttonseven onclick
rename file
oldfile.txt
newfile.txt

To maximize the program window:

checkbox onclick
maximize
next

To minimize the program window:

radiobuttonfour onclick
minimize
next

To change the content of a Web control:

listboxthree onclick
change web
<embed code>

This command can also be used to display the regional WeatherBug maps that are referenced in Section 8. The usage would look something like this:

listboxthree onclick
change webtwo
weatherbug radar SE

To change the page that is displayed in a Web browser control:

checkboxfive onclick
change web browser
go
www.weatherbug.com

In place of the go command, you can also use the following commands without supplying a URL:

back
forward
home
search
refresh
stop

If you combine these onclick commands with onclick events for separate controls, then you can begin to do some very useful stuff. Just experiment with it a bit, and see what you come up with.

The onclick code is written after the code for creating the controls. A sample program with one control would look something like this:

window

window title
Onclick

window size
200
170

checkbox
Launch URL
53
30
80
80

checkbox onclick
notice
Launching URL...

checkbox onclicktwo
internet
www.leopardprogramming.com

end

Remember, this is just the beginning. Look at the included sample programs to get a better idea of how this works.

Back to Top

WEATHERBUG ONCLICK EVENTS

WEATHERBUG ONCLICK COMMAND LIST:

weatherbug local
weatherbug forecast
weatherbug alerts
weatherbug video
weatherbug rss
weatherbug camera
weatherbug radar
weatherbug temperatures
weatherbug wind chill
weatherbug infrared satellite
weatherbug visible satellite
weatherbug wind speed
weatherbug highs today
weatherbug lows tonight
weatherbug highs tomorrow
weatherbug lightning
weatherbug storm tracker
change weatherbug
change weatherbug camera

EXPLANATIONS:

To display the local weather conditions:

buttonfive onclick
weatherbug local
20876

To display the forecast:

checkboxthree onclick
weatherbug forecast
30501

To check for weather alerts:

bmpbuttonseven onclick
weatherbug alerts
GA

In this code, "GA" displays any alerts for the state of Georgia, but you can also use "national" to display all of the alerts in the United States.

To watch your live local weather forecast:

menu onclick
weatherbug video
20876

To display the RSS feed for a specific zip code:

radiobuttoneight onclick
weatherbug rss
20876

To view the current image from a specific weather camera:

listboxthree onclick
weather camera
AWS HQ Camera
AWSHQ

Section 5 has more information on how to find the name of a camera image so that you can use it in Leopard.

To view the radar map for a specific region:

buttontwo onclick
weatherbug radar
SE Radar Map
SE

The following regions are available to be used:

US
SE
NE
SW
NW
NC
SC

To view the temperature map for a specific region:

comboboxfour onclick
weatherbug temperatures
NW Temperature Map
NW

To view the wind chill map for a specific region:

comboboxfour onclick
weatherbug temperatures
NW temperature map
NW

To view the infrered satellite map for a specific region:

buttonfive onclick
weatherbug infrared satellite
NE infrared satellite map
NE

To view the visible satellite map for a specific region:

bmpbuttontwo onclick
weatherbug visible satellite
SE visible satellite map
SE

To view the wind speed map for a specific region:

checkbox onclick
weatherbug wind speed
US wind speed map
US

To view the highs today map for a specific region:

listboxseven onclick
weatherbug highs today
NC Highs Today Map
NC

To view the lows tonight map for a specific region:

menu onclick
weatherbug lows tonight
NC Low Tonight Map
NC

To view the highs tomorrow map for a specific region:

comboboxten onclick
weatherbug highs tomorrow
SW Highs Tomorrow Map
SW

To view the lightning map for a specific region:

comboboxfour onclick
weatherbug lightning
SE Lightning Map
SE

To view the interactive storm tracker map:

buttonsix onclick
weatherbug storm tracker
WeatherBug Storm Tracker

To change the Zip Code that is used in a WeatherBug control:

buttonfour onclick
change weatherbug
90210
250x250

To change the image that is displayed in a WeatherBug Camera control:

buttonsix onclick
change weatherbug camera
ATLHS

A sample program would look something like this:

window

window title
National Weather

window size
223
110

background color
black

font
arial 8

text color
white

text
National Weather
66
15
100
20

radiobutton
Forecast
10
40
60
20

radiobuttontwo
Temps
90
40
60
20

radiobuttonthree
Alerts
160
40
60
20

radiobutton onclick
weatherbug forecast
national

radiobuttontwo onclick
weatherbug temperatures
National Temps
US

radiobuttonthree onclick
weatherbug alerts
national

end

Back to Top

WINDOW PROPERTIES

Besides just constructing a basic window with controls and onclick events, there are also other window properties that you can define. Place these commands right after your window construction (window title, window size).

To specify a background color for the window:

background color
blue

You can use any one of these colors:

white
black
lightgray
darkgray
yellow
brown
blue
darkblue
red
darkred
pink
darkpink
green
darkgreen
cyan
darkcyan
buttonface

There are also certain controls that can have their own color setting. Instead of using background color, use this:

textbox color
textedit color
combobox color
listbox color

Follow those commands with the color of your choice, such as:

combobox color
green

You can use any one of the colors that are listed above.

To specify a font for the text in the window (including controls):

font
matisse_itc 15

Notice how I put an underscore character (_) between the spaces in the font's name. This is required for the font to work. The number 15 is just the size of the font. You can increase or decrease that number until it is right for your needs.

You can also program other settings for the font. For example, if you wanted the font to be bold:

font
courier_new 8 bold

Here's an example program that uses some of these commands:

window

window title
Test

window size
150
100

background color
blue

text color
green

font
comic_sans_ms 15

text
Testing...
10
10
100
100

end

Back to Top

ONOPEN/ONCLOSE EVENTS

Leopard also allows you to trigger certain events when the window first opens. This code should go right before the "end" command.

OnOpen events work just like onclick events in the sense that you can only use up to five of them.

onopen
onopentwo
onopenthree
onopenfour
onopenfive

Besides these commands that execute when the window is opened, you can also setup events to execute when the user attempts to quit the program.

onclose
onclosetwo
onclosethree
onclosefour
onclosefive

Here's a simple program that utilizes these features:

window

window title
Test

window size

200
250

background color
black

onopen
notice
Hello!

onopentwo
notice
Welcome to the program.

onclose
close confirm
Are you sure?

end

Back to Top

VARIABLES AND MATH

Variables are essentially pieces of information that are stored in your computer's memory for later use. They are vital in most programming languages, and they help make things more interactive in Leopard, as well.

The first thing that we can learn to do with variables is declare them, or set them up after the basic window is created. All that is required is this:

varone
First

"First" would be the value assigned to that variable. You can declare up to ten variables.

varone
vartwo
varthree
varfour
varfive
varsix
varseven
vareight
varnine
varten

Numeric variables are a special kind of variable in Leopard because they allow you to perform mathematical calculations. Numbers are exclusively used with numeric variables, and just like regular variables, you can also declare up to ten of them. Here's what they look like when first declared:

numvarone
7

How are variables useful? Well, now that that piece of information is stored, we can use it as many times as we would like. In an onclick event, you would do something like this:

button onclick
notice
varone

The value that you assigned to varone would appear in the notice box. Here's a program that creates a file from two variables:

window

window title
Variables

window size
170
100

varone
var.txt

vartwo
It really works!

radiobutton
<<Create>>
40
0
80
70

radiobutton onclick
write file
varone
vartwo

end

A program that utilizes numeric variables would look something like this:

window

window title
Math

window size
200
150

numvarone
5

numvartwo
3

menu

menu onclick
add
numvarone
numvartwo

end

In addition to the add command, you can also use subtract, multiply, and divide.

At times, you may wish to place the contents of a textbox or textedit control in a variable, and you do that by using the following onclick event and specifying the control name and the variable that you want to use.

texteditfour var
varthree

To change the value of a variable, just use the change onclick event:

change varseven
Different Value

To place the contents of a file in a variable, use the following code:

varone file
test.txt

Variable prompts are used to get input from the user. A variable prompt can be used for each variable. To use it, set it up in an onclick event:

menu onclick
varone prompt
Enter Value:

Also valid:

menu onclick
numvarone prompt
Enter Value:

The "Enter Value:" text appears above the prompt textbox. Next, you just use another onclick command to use the variable that was collected from the user:

checkboxeight onclick
internet
varone

On a side note, if you choose to declare the variable at the beginning of the program, then the value that you assigned to it will appear in the text field of the variable prompt. A good example of these features is demonstrated in this program:

window

window title
Internet

window size
200
90

varone
http://

menu

checkbox
Launch URL
50
0
90
30

menu onclick
varone prompt
Enter URL:

checkbox onclick
internet
varone

end

Numeric variables work in a similiar way.

In the end, learning to use variables effectively can help you to make your programs more interactive.

Back to Top

LOGIC AND LOOPING

Adding basic logic to your programs enables them to perform different actions depending on the value of a variable. Leopard uses "if" blocks of code for this.

Let's say that the value of a variable used in your program frequently changes due to the user's actions or some other event, and if the value is set at true, then you want a notice box to indicate that.

For the purposes of this example, let's set the value of a variable to true:

varone
True

We'll then establish an onclick event that calls on the "if" code:

button onclick
if
varone

You can create and call on up to five "if" blocks of code (if, iftwo, ifthree, iffour, iffive), and the varone reference tells the code to evaluate the varone variable.

Let's now create the "if" code (this code is placed after all of the onclick events):

if
True
then
notice
True
else
notice
False
end if

Do you see what happened there? The code checks the varone variable to see if it's set at True, and since it is, a notice box will be displayed that indicates that. If the variable wasn't specified as True, then the else code would be used, and a notice box would be displayed that said False.

If you didn't want the code to do anything if the value of the variable wasn't set at True, then you could use the "next" command like this:

if
True
then
notice
True
else
next
end if

This would just end the "if" code and cause the program to continue execution of any other onclick events.

Here's a quick program that uses the code above. Feel free to change the value of the variable in order to see how it works.

window

window title
True or False

window size
300
300

varone
True

menu

menu onclick
if
varone

if
True
then
notice
True
else
notice
False
end if

end

Now that your programs have some logic, let's also learn how to take advantage of looping. All that you need to do is create a numvar that contains the number of times that you want to loop the onclick events, and then set the loop code to execute as the first onclick event.

Here's a complete program that features looping:

window

window title
Hello World

window size
300
300

numvarone
10

textedit
10
10
200
200

menu

menu onclick
loop
numvarone

menu onclicktwo
print textedit
Hello world!

menu onclickthree
print textedit
It's nice to see you!

end

As you'll see, this program prints the two lines of text in the textedit control one after the other a total of ten times.

Back to Top

TIMER AND SUBROUTINES

Sometimes it's nice to have actions execute after a delay instead of right away. The timer function makes this possible.

You'll need to create a numvar that can be used with the timer. You can specify any number that you would like, but each 1000 equals one second. For example, 4000 equals four seconds.

Please examine the following program that switches between WeatherBug weather stations and features the timer plus looping to get an idea of how this works:

window

window title
Timer

window size
350
350

numvarone
5

numvartwo
5000

weatherbug
10001
250x250
10
10

onopen
loop
numvarone

onopentwo
timer
numvartwo

onopenthree
change weatherbug
90001
250x250

onopenfour
timer
numvartwo

onopenfive
change weatherbug
10001
250x250

end

Subroutines are also nice to use within your Leopard code because you can create a subroutine that can be called at any time, and because of this, you won't have to keep typing repetitive blocks of code unnecessarily.

Up to five of them can be created (subroutine, subroutinetwo, subroutinethree, subroutinefour, subroutinefive), and here's an example program that uses one:

window

window title
Subroutine

window size
350
350

button
Go
50
50
70
70

button
Go
50
150
70
70

button onclick
call subroutine
next

buttontwo onclick
call subroutine
next

subroutine
notice
Subroutine Called

end

Back to Top

GRAPHICS WINDOW

The graphics window allows you to do some basic drawing by programming various graphical commands.

Setting up a graphics window is easy because you initially use the same commands that you used for the window programs above, except you type "graphics window" instead of "window" at the beginning of your code. Here's an example:

graphics window

window title
Graphics

window size
260
200

end

This starts you off with a basic template to work with.

Listed below are all of the commands that are available for the graphics window. If you are confused as to how they work in a program, then just look at the example at the end of this section or examine the included sample programs.

To bring the pen up (prevents visible drawing):

up

To bring the pen down (allows visible drawing):

down

To center the pen in the window:

home

To go forward a certain amount of pixels in the current direction:

go
50

To go to a certain pixel position in the window:

goto
10 10

The numbers represent the x and y coordinates to go to (horizontal, vertical).

To turn the pen from the current direction using an angle:

turn
90

To set the pen to go north:

north

To fill the window with a background color:

fill
blue

To set the color of the pen:

pen
green

To set the size of the pen:

size
5

To set the font of the text drawn in the window (do this before drawing text):

font
comic_sans_ms 12

To insert text at the current position of the pen:

text
Hello World!

To specify a backcolor for items that are filled with color:

backcolor
blue

To draw a box

box
10
10

To draw a box that is filled with the color specified in the backcolor command:

boxfilled
70
70

To draw a circle:

circle
50

The number specifies the radius of the circle.

To draw a circle that is filled with the color specified in the backcolor command:

circlefilled
50

To draw an ellipse centered at the pen position:

ellipse
10
15

The numbers represent the width and height.

To draw an ellipse that is filled with the color specified in the backcolor command:

ellipsefilled
10
15

To draw a bitmap graphic on the screen:

drawbmp
name.bmp
20
60

Here's a sample program that uses some of the commands listed above:

graphics window

window title
Graphics

window size
260
200

fill
blue

pen
green

size
10

up

home

north

go
50

turn
90

go
60

down

turn
90

go
100

turn
90

go
100

turn
90

go
100

turn
90

go
100

end

Back to Top

TEXT WINDOW

A text window basically has the same interface as Notepad. It makes it easy to open and manipulate files with text.

Setting up a text window is easy because you initially use the same commands that you used for the window and graphics window programs above, except this time, you type "text window" instead of "window" or "graphics window" at the beginning of your code. Here's an example:

text window

window title
My Notepad

window size
300
200

end

After you have entered this code, run the program. You will notice that all of the basic functions are already there.

To extend this functionality a little bit further, you can also use the following two commands.

To print text to the window:

print text
Sample Text

To automatically open a file when the window is opened:

open file
name.txt

Here's a basic text window program:

text window

window title
My Notepad

window size
300
200

print text
Sample Text

end

Back to Top

NO WINDOW

A nice feature of Leopard is the ability to activate onclick commands without having an actual window. This is done by using the "no window" window type. You can use any of the onclick commands that don't require having an actual window. Just type the code below and click Run to see how simple this really is.

no window

event
weatherbug radar
SE Radar
SE

eventtwo
weatherbug temperatures
SE Temps
SE

end

A maximum of five events can be used.

It really is that easy! The "no window" window type is useful when you want to get certain tasks done without having to see and use a window or its controls.

Back to Top

TROUBLESHOOTING/TIPS

Problems can occur within Leopard due to improper command entry, or a number of other things. If you are a having a problem, look through this brief list of suggestions for some help.

  1. If you are experiencing a "file past end" error, then one possible solution is for you to space your commands out more. As was brought out in the beginning, if all of your code is crammed together, then Leopard will have a harder time differentiating one command set from another.

    Also, try to space the "end" command down from the rest of the code.

  2. Be sure to check the spelling of the commands and filenames used in your code. Improper spelling could cause problems.

  3. Check all of the files that you load in your program (such as text files and bitmaps) to make sure that you are using the proper path to load them.

  4. If a bad piece of code causes Leopard to close, and you didn't save it, then there's no need to worry that the code that you were working on is lost forever. Each time that you run a program in Leopard, the code is backed up to a file called "code.lep" in the main Leopard directory. When you reopen Leopard, you can load that file, and you'll be right back to where you were before the problem occured.

  5. If you want to make comments in your program for yourself or others in order to document what's going on, then feel free to do so. Leopard will ignore any code that's not part of a command set, although you may find it beneficial to make the comments stand out by using certain characters. Here's one of the previous examples that now includes comments:

:: This program was created by Brandon Watts.
:: brandonwatts@gmail.com
:: http://www.brandonwatts.net

:: Let's setup the window.

window

window title
Onclick

window size
200
170

:: I'd like to add a checkbox.

checkbox
Launch URL
53
30
80
80

:: Let's make the checkbox go to leopardprogramming.com.

checkbox onclick
internet
www.leopardprogramming.com

:: Voila - we're finished!
end

Back to Top

REGISTER LEOPARD

If you'd like to show your support for Leopard by registering the software to allow for priority support and creation of executables that run independently of Leopard, then the details are as follows:

Single User License - $25
Yearly Educational License - $20 Per Computer (Volume Discounts May Apply)

In order to qualify for the educational license, you must be a school representative, teacher, or student. Educational licensees gain access to a number of extras including exclusive educational forums and any developed lesson plans/program examples that are created for our users involved with education. They also receive any updated versions of Leopard that we release throughout the time period that is covered by their license for free.

To learn more about our registration options and purchase a Leopard license, please visit our Web site or contact us directly.

Thanks for your interest!

Back to Top

LICENSE AGREEMENT/LEGAL INFORMATION

Leopard v2.2 (Powered by WeatherBug) is distributed under the following License, and is hereafter referred to as Leopard.

Agreement:

LICENSE TERMS

Leopard is downloadable software. The copyright owner and Licensor of Leopard is "Brandon Watts." This version of Leopard was created for WeatherBug, and they have the right to distribute and promote it, however, the Licensor retains the ultimate rights to the software. This License is a binding legal agreement between the individual who uses Leopard ("You") and the Licensor.

LEOPARD IS COPYRIGHTED AND THE OWNER OF THE COPYRIGHT CLAIMS ALL EXCLUSIVE RIGHTS TO LEOPARD, EXCEPT AS LICENSED TO USERS HEREUNDER AND SUBJECT TO STRICT COMPLIANCE WITH THE TERMS OF THIS LICENSE.

As a condition for granting you a license to use Leopard, you agree to all of the following terms and conditions. You are deemed to have read, understand, and have accepted all such terms and conditions upon ongoing use of Leopard. If you fail to abide by any of the terms and conditions set forth herein, your license to use Leopard shall be immediately and automatically revoked, without any notice or other action by the Copyright Owner.

TERMS AND CONDITIONS

1.     You are granted a non-exclusive license to use Leopard subject to Your compliance with all of the terms and conditions of this License.

2.     You may not change any copyright or licensing information in any of the files included with this distribution, and you may not change or remove this license agreement.

3.     You may distribute the Leopard software package as is without any modifications to others.

4.     You may not distribute, copy, publish, assign, sell, bargain, convey, transfer, pledge, lease or grant any further rights to use Leopard.

5.     You will not have any proprietary rights in and to Leopard. You acknowledge and agree that the Licensor retains all copyrights and other proprietary rights in and to Leopard, unless stated otherwise.

6.     Your license to use Leopard shall be revocable by the Licensor upon written notice to you. This license shall automatically terminate upon your violation of the terms hereof or upon your use of Leopard beyond the scope of the license provided herein.

7.     Use of Leopard within the scope of this license is free of charge and no royalty or licensing fees shall be payable by you unless you choose to register the software. Use beyond the scope of this license shall constitute copyright infringement.

8.     This license shall be effective and bind you upon your use of Leopard.

9.     You accept Leopard on an "AS IS" and with all faults basis. No representations and warranties are made to you regarding any aspect of Leopard.

10.     THE LICENSOR HEREBY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, RELATIVE TO LEOPARD, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR MERCHANTIBILITY. LICENSOR SHALL NOT BE LIABLE OR RESPONSIBLE FOR ANY DAMAGES, INJURIES OR LIABILITIES CAUSED DIRECTLY OR INDIRECTLY FROM THE USE OF LEOPARD, INCLUDING BUT NOT LIMITED TO INCIDENTAL, ONSEQUENTIAL OR SPECIAL DAMAGES.

11.     Licensor's failure to enforce any rights hereunder or its copyright in Leopard shall not be construed as amending this agreement or waiving any of Licensor's rights hereunder or under any provision of state of federal law.

12.     Licensor retains all rights to change or modify the terms of use and distribution of Leopard at any time.

13.     Any programs that you create with Leopard solely belong to you, and you may distribute your source code in any way that you wish.

Copyright © 2007 Brandon Watts. All rights reserved.

OTHER INFORMATION

This software is not affiliated with any other software or service named "Leopard."

Leopard is written in Liberty BASIC. A special thanks goes to Carl Gundel and the rest of the LB community for their support and help with this project.

Thanks to Alyce Watson for the use of jpeg.dll.

Browser.dll License:

Copyright © 2002 by Doyle Whisenant <mechanic@sonet.net>. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Internet Explorer, IE, Internet Explorer Web Control are Copyright © Microsoft Corp.

Feedback

Let us know what you think of our new innovations! Your feedback will help us enhance our Labs products and maybe even trigger ideas on new products! Email: leopard@weatherbug.com

reviewed by TRUST e site privacy statement
Read our Terms of Use. By clicking to download WeatherBug, you agree to these terms.