Craig A. Finseth, fin@finseth.com.
The Gadget program is an idiosyncratic collection of tools. Like a Swiss Army Knife -- a name which I avoided using -- it has lots of features that many people will never use, but a few features that you may discover that you can't live without. I hope you get addicted and enjoy it.
This documentation covers the Gadget in RealBasic program. Gadget is program that can generate a variety of screen test patterns and perform many utility functions. Have fun trying it out.
Gadget is provided as free software under the GNU Public License. Both the binary RealBasic project file and an XML dump (which includes full source) are provided as part of the distribution. RealBasic can be obtained from the RealBasic site.
Installation: just copy the
file somewhere convenient and run it. On Macintosh systems, be sure to use the Finder (or equvalent tool) for the copying.
Gadget will run just fine as is. However, there are some additional files that you really want to copy as well. These file are:
Last, the program also knows how to read the file extension information available at the File Extensions web site, http://filext.com/. Access that site and follow the instructions for downloading the Whole List. The final result is a file called allext.txt, which Gadget can parse and display in the File Info panel.
As noted, all of the screens and tools provide normal Copy capabilities. In addition, the program can copy and paste screen sizes and colors among the screens and tools.
When you use the Copy menu item, a complete representation of the tool's information, screen, or other data is copied to the clipboard as you would expect. When you use the Copy button where it appears on a Tool, the size or color is copied to the regular clipboard as well as to an internal clipboard (along with additional information) where it can be used to restore the value in the same or another screen.
For saving images to files, Gadget can save as PICT (on Macintosh systems) or as BMP (for Windows systems) on its own. If you are running QuickTime (from Apple Computer, it can save in additional formats as determined by QuickTime.
Any of these screens can be copied to the clipboard. They are all copied as pictures in their current size. In fact, the main use of this part of the program is to construct an appropriate test screen for saving via the clipboard or other means. You can then use other programs such as Graphic Converter, http://www.lemkesoft.com to show the saved image.
Any of the test pattern screens can also be printed. That said, you probably don't want to print any besides "Quick Text", which is intended as a printer test page: if you print the others, they will rescale to the printer page and go through a lot of ink.
These screens can also be saved to a file. They are saved as a graphics image.
This item brings up a panel that allows you to quickly set the screen size. It has options to set the screen size, set the width from the height according to a selected aspect ratio, set the height from the width according to a selected aspect ratio, copy the size to the clipboard, paste the size from the clipboard, and swap the width and height values.
This item brings up a panel that allows you to configure the General screen.
Many globes show a large "figure 8" somewhere over the Pacific Ocean. (Oddly, this figure does not show on photographs taken from space...(:-)) This figure is called an "analemma" and it shows the position of the Sun (in degrees of declination and minutes of right ascention (that is, minutes as in "hours and minutes" not "degrees and minutes")) relative to "where it is supposed to be."
For example, on May 14, the Sun is about 3 minutes and 41 seconds ahead of nominal and about 20 degrees north of the ecliptic.
I said "many globes" because some manufacturers are removing this useful piece of information from their globes. This screen makes up for this loss (as well as being cute).
This screen shows an analemma for the year 2000.
Note: the shape on an analemma varies over time, although not very much. Also, an analemma is not symmetric about the origin along either axis.
This screen has the program draw 1000 balloons, with randomly chosen starting points and colors. Note that when copied to the clipboard, printed, or saved, the random pattern is recalculated.
This screen draws a series of concentric circles.
This screen draws a grid of lines and dots for adjusting convergence.
This screen is one of four that provide the "usual" test bars. In this screen, the White bar is full saturation: all others are at 75% saturation.
This screen is one of four that provide the "usual" test bars. In this screen, all bars are at 75% saturation.
This screen is one of four that provide the "usual" test bars. In this screen, all bars are at full saturation (as one would expect from the name).
This screen is a generalized test pattern. The settings are controlled by the -- you guessed it -- General Settings panel. It can display the following screens:
This screen has the program draw 1000 lines, with randomly chosen starting points, ending points, and colors. Note that when copied to the clipboard, printed, or saved, the random pattern is recalculated.
This screen shows a 256-step luminosity ramp. You can also generate this image using the General screen.
This screen shows a 5-step luminosity ramp. You can also generate this image using the General screen.
This screen shows a 10-step luminosity ramp. You can also generate this image using the General screen.
This screen can be used to calibrate monitors for overscan. (Presumably, these montiors are fed from an NTSC- or PAL-output.) Corner marks are at 1% steps, and the safe title and safe action areas are shown.
As mentioned above, this screen is intended as a quick printer test screen. Each word is in the color that it names.
This screen has the program draw 500 rectangles, with randomly chosen starting points, ending points, and colors. Note that when copied to the clipboard, printed, or saved, the random pattern is recalculated.
This screen is one of four that provide the "usual" test bars. In this screen, the upper bars are at 75% saturation. The lower bars are assorted other colors.
This screen shows a spinning pattern, with lines drawn from each edge pixel to the opposite edge. Successive lines alternate between white and black.
This is a composite test pattern developed at the MIT Arhictecture Machine Group (now the Media Lab). It combines the convergence tests along with gray steps and color bars for adjusting monitors. Note that the background is not black! It is about 2% gray.
Each of these tools operates with its own panel. The included functions range across many uses, but overall reflect my needs for doing graphic design. Some are included just for fun.
In general, all tools provide copy, print, and file save functions. Unless otherwise noted, the copy function copy the text as shown in the panel as text to the clipboard. This includes enough text so that you can figure out what was copied.
Similarly, the print function prints the panel contents in a simple form. The idea is that you might use, say, the Column Width panel to make your calculations. You can then print it for a quick, full reference for the result.
This panel shows information about a specified date and time, including information about the phase of the moon for that date and time.
For the phase of the moon portion, the algorithm was originally written in PL/1 at the M.I.T. Architecture Machine Group. It was translated to Fortran, then to C by Brian Hess. It was rewritten several times by Craig A. Finseth. All of this work was done on the premise that a computer's bugs can not appear properly unless they have access to "correct" information about the phase of the moon.
The algorithm is a first-order approximation to the correct phase of the moon calculation. (The full, "correct" one has upwards of 30 sin terms). The base time is 10:21am 1/12/75 (GMT) and times before that do not work. (And, true to its nature, the program does not check for attempts to use such times.) A lunar cycle is assumed to be 42,532 minutes long. This algorithm is known to be incorrect. It, however, is retained in honor of the spirit of the original implementation (the approximation is the only thing left: even the time constants have been refined).
This panel lets you explore a font. You select the font, and can specify the character by entering it or by entering a binary, octal, decimal, or hex value. The panel also shows the first 256 characters of the font.
The panel allows you to specify the encoding and variant of the text being displayed. Due to limitations of RealBasic (version 4.5) that is used, it is not possible to show characters with code point values above 256. That feature is on the list for future versions.
You can also use this panel as a simple binary/octal/decimal/hex converter. If you want more extensive base conversions, or if you want to actually calculate using various bases, see the LokiBin program.
This panel can take a while to display: turn it off if things seem slow.
This panel tracks the mouse cursor and shows the current color in a variety of ways. It lets you quickly sample any color on the screen.
For copying to the clipboard, you should use the keyboard command: otherwise, you'll get the menu color sampled.
Similarly, for printing, use the keyboard command and the Enter key and make sure that the printer dialog box is not covering the color that you want to sample. (Realistically, you're better off copying to the clipboard and printing from there.)
The HSV and CMY values are those computed by RealBasic.
This panel allows you to enter all of the relevant parameters, then calculates the dimensions for column placement. The "Set Paper Size" popup simply populates the Height and Width fields for you.
Note that calculations are done without reference to units: you just need to be sure to enter all values in the same units.
This panel prompts for a file and shows all available information on that file. Note that more information is avialable on Macintosh systems than on Windows systems.
This panel allows you to enter all of the relevant parameters, then calculates the memory and pixel size used by an uncompressed image.
You can select:
The results are displayed in bytes, KBytes, and MBytes, as well as the total pixel counts.
This panel tracks the mouse cursor and shows the surrounding are magnified 2, 4, or 8 times. It lets you quickly view any part of the screen in closeup.
This panel copies the magnified area to the clipboard as a picture, not text.
For copying to the clipboard, you should use the keyboard command: otherwise, you'll get the menu sampled.
Similarly, for printing and saving to a file, use the keyboard command and the Enter key and make sure that the printer dialog box is not covering the area that you want magnified. Realistically, you're better off copying to the clipboard and printing or saving from there.
This panel provides for exploring the Mandelbrot image. You must enter the boundary coordinates manually. It's not the best Mandelbot program by any means, but is handy if you want to make a nice picture.
Copy, print, and file save transfer only the image.
This panel has two related functions. First, it lets you convert fractions to decimals or vice versa. Second, it lets you convert among inches, cm, points, and picas.
If you want more extensive unit conversions, see the Loki program. If you want to actually calculate using fractions, see the RPN Calculator tool.
This panel provides a quick interface to the system color picker. It lets you pick two colors and shows them side by side.
This panel provides a way to enter screen sizes, number of retrace lines, and screen refresh rates and it calculates the total number of lines and pixel and line clock rates.
This panel provides a list of the currently running processes. It only works on Macintosh systems. To update the list, close and reopen the panel. (If you print, save, or copy the list to the clipboard, the printed or copied information is updated).
This description assumes that you know how to run an RPN calculator. For those who don't, see the RPN reference. For a more complete calculator with units, see the Loki program. For a calculator that does binary/octal/hex math, see the LokiBin program.
All commands are given from the keyboard with the focus in the Entry field. The available keys are as listed.
key | operation |
space, CR, LF | Enter |
BS, DEL | erase last character |
0-9, ., ,, e, - | enter number |
! | factorial |
# | clear X |
% | percentage |
* | multiplication |
+ | addition |
, | radix (in ',' radix mode) |
- | subtraction |
. | radix (in '.' radix mode) |
/ | division |
@ | clear all |
D | compute delta percent |
F | enter fraction separator |
H | compute hypotenuse, given sides in X and Y |
I | compute side, given hypotenuse in Y and side in X |
L | recall last X |
P | enter PI |
R | roll down |
S | swap X and Y |
[ | square root |
\ | compute reciprocal |
] | square |
{ | cube root |
} | cube |
~ | negation; change sign (shows as +/-) |
RPN Calculator operates as a standard RPN calculator (:-). However, it's extended capabilities take a little explaining. These capabilities fall into the areas of input, operators, and display.
Any value can be entered as a fraction. Fractional values are entered as:
integer f numerator f denominator
Again, each of the integer, numerator, and denominator values can be an arbitrary number. The program performs the obvious calculation (integer + numerator/denominator) to determine the value.
If any of the components are missing, the program supplies defaults according to the following table.
f f | zero |
f f D | zero (0 + 0 / D) |
f N f | N / default denominator |
f N f D | N / D |
I f f | I |
I f f D | I / D |
I f N f | I + N / default denominator |
I f N f D | I + N / D |
Numbers are what you would expect:
These combinations permit some weird results: you can have up to three radix and/or EEX marks in a fraction!
Values are stored internally in a regular decimal form. When a value is displayed, it can be displayed in one of four ways. For these examples, a value of 1.76 and a denominator of 8 will be used.
This panel is a very general scaling calculator. It manipulates the the image size in pixels, the image aspect ratio, and the pixel shape. Given any two, it can calculate the third. You use the "Lock" selector to indicate which one is held constant at any time.
At the same time, it can scale an image by a factor, percentage, or delta percentage. The scaled image has its own aspect ratio and pixel shape.
Thus, you can use the tool to convert an image at one size, aspect ratio, and pixel shape to another.
Note that calculations are done without reference to units: you just need to be sure to enter all values in the same units.
This panel lets you enter some text and displays the text in one of several ways (printing or copying to the clipboard prints/copies all ways). You can view the string as characters or bytes: they differ when a character is represented as multiple bytes. Each character or byte can be shown as an octal, decimal, or hexadecimal number, as a carat-string (see my ASCII chart), or as separate bytes.
The "254" button places a string containing the bytes with values from 1 to 255 (except for 128) into the text.
This panel can take a while to display: turn it off if things seem slow.
This panel lets you enter some text, specifying the font, the size, and the bold/italic/underscore attributes. You can see the final text as well as its height and width (assuming no wrapping).
The panel allows you to specify the encoding and variant of the text being displayed. Due to limitations of RealBasic (version 4.5) that is used, it is not possible to show characters with code point values above 256. That feature is on the list for future versions. Encoding and Variant are best used by clearing the string, setting the values, and entering new text. Changing either on the fly will re-code the existing string, which may produce unexpected results.
This panel can take a while to display: turn it off if things seem slow.
This panel provides a list of the currently mounted disk-type volumes, along with their size and amount of space used/free. To update the list, close and reopen the panel. (If you print, save, or copy the list to the clipboard, the printed or copied information is updated).
Gadget comes with a number of configuration files, they are:
You can edit these files to add or change the information within. When making changes, please remember that these are data files intended to be read by a program. They are not general text documents for reading by people. Thus, the details of formatting matter.
These details include:>
In general, you should use a text editor rather than a word processor to edit the files. Text editors include:
In a pinch, you can use Notepad or Simple Text. You can add entries by carefully copying (and pasting) entire lines and making the smallest possible changes on exisiting lines.
If you do make any changes or additions and feel they may be of general interest, please feel free to send them to me for inclusion in future releases.
The binaries distributed include code from the "Monkey Brain" plugin that allow the program to get additional volume information and the process list (on Macintosh systems).
If you wish to generate a new version with all functions, you will need to obtain the current Monkey Brain plugin from the vendor at http://www.monkeybreadsoftware.de/realbasic/plugins.html. You will also need to make three changes in the Constants module:
If you don't make the above changes, compiling a new version of the program will omit the Monkey Brain calls. All other functions work. This approach seemed to be the best compromise of providing functions yet offering full source.
Copyright 2002,3 by Craig A. Finseth.
Go to Craig Finseth's home page, http://www.finseth.com/~fin/.