Ok, if you want to create project, you need to enter its name. Click on the inputbox marked "Project name". It'll be selected by the dotted line and cursor will appear. This is a filename inputbox, so you can only enter symbols allowed in filename. When you entered project name and pressed ENTER to confirm it, you can change common directory name (default is "DATA"). This's directory, where most of additional files will be stored. You can either change inputbox by clicking on it or move dotted line cursor by pressing SHIFT+ARROW KEYS. When all the settings here is done, click "new project"
Now you'll face the next importrant interface element: window. This window is for directory selecting. You can scroll window information (if window is viewing only portion of it) by holding MMB and drag the mouse or change the distance between directory names (change magnification level) by holding MMB+other one and drag. If you haven't middle mouse button you can use "`"(TILDE) key to switch on/off emulation of its pressing. Now enter the directory, where you want to locate your project and click on "Proceed".
A directory with same name as a project will be created there. Then, all of the modules needed to run the interface will be copied to this directory and common subdirectory will be created. Some files will be added: project parameters file to the modules and interface elements files to common directory.
Now you're in the main editor workspace. The program brings you to the settings screen so you can modify some constants according your targets. There's some other types of inputboxes, allowing to enter integer numbers. Notice two small +/- buttons near each inputbox. These buttons greatly helps, you can easily increase/decrease values with them by 1(RMB), 10(LMB), 100(Ctrl+RMB), 1000(Ctrl+LMB).
Also you can see long bar and buttons with the pictograms near it. Editor is splitted into several screens (every of them allows you to edit certain objects) and these buttons are for switching between the screens. Long bar is for displaying and entering messages.
Later you'll see inputboxes and buttons covered by black'n'white dots - they're 'jammed'. It means, you cannot use it now because of certain reasons. Now let's understand the basics of the interface structure.
Box is a rectangular area on the page. Buttons, windows, scrollers, input fields and other things on page are boxes with different parameters.
Image is also rectangular area, but on the special canvas called skin. Skin is a drawing, that define all raster graphics (appearance of boxes) of your interface project. You can modify standart skins for your purposes or create your own in one of your favorite painting programs.
Message is simply a static text string. Messages are intended for box labels and quick notes (notes, that appear on the info box or simply near mouse cursor, when user points to certain boxes).
Font consist of symbol image libraries and pack of parameters that defines how to print them.
Also (and it easies the work very much) you can clone selected boxes. To do this, select boxes and drag LMB like moving them. Press F7 while dragging and boxes will be cloned to the choosen place when you release mouse button
One selected box is marked by another type of dotline. Properties of this box is shown on working panel in the top of the screen. You can modify these parameters and changes will be applied to all selected boxes. Notice, if you press +/- buttons, corresponding parameter of every selected box will increase / decrease by same value, not equated as if you enter value in the inputbox.
Workspace is marked by the grid, its parameters can be edited in options page. Purpose of the grid is simple - you can stretch the workspace to fit it in certain resolution only by changing grid cell size. X, Y - coordinates and Xsize, Ysize are measured in integer grid cells.
The box in your program will be recognized by a tag. When user press button, enter value in the inputbox, move the scroller, corresponding sub will return tag number. I recommend giving every box its own unique tag to eliminate possible bugs. Later will be explained how to link buttons and inputboxes in groups with the tags.
Frame is an image, that defines the box appearance (how it's done will be explained later)
You can define a message or an image for button label. For inputboxes you defining the length of string (in symbols), that can be entered.
Nine buttons in the center of the panel is for setting box alignment. The text in a boxes usually aligned to center of the box, but you can change it to the top, or bottom-left corner for example. The button switches align rectangle from all the box to space inside frame.
You also can set the font for every button, so text there can be printed in different styles.
QuickNote is message that pop-ups, when you hold the cursor on the button too long. It mainly used by novices for quick familarizing the program. You just enter message number in the box marked "Help".
Defining the image is easy - press RMB on empty area and drag mouse like creating a box. Moving (LMB) and resizing (RMB) is also similar to a box. However, selecting multiple images is not implemented.
But every image is not simply a rectangular area, it's an array of areas. Sub-images are situated like cells in a grid. You can set InRow parameter, it defines how many sub-images are in one row of this grid. This table shows how items are numerated:
00 | 01 | 02 | 03 |
04 | 05 | 06 | 07 |
08 | 09 | 10 | 11 |
Window cam be magnified by user if the magnification bounds has been set (you can set them (and magnification level too) for X and Y axises separately). For default, they're all 1's (size is original). In example, if you set XMGNMAX to 2, user will be able to double workspace x-size in the program.
You can set the grid for window workspace. In example, if you making an image editor for N*M images, it's good to have grid with N*M resolution for image editing window. The grid is implemented for ease the programming, its parameters affects only corresponding procedures.
Yeah, window can hold a group of workspaces! It's very useful feature that allows you to make lists (of files, images, etc..). You can define (in editor or in program) quantity of workspaces and InRow parameter (workspaces in a row).
Though you can set InRow number, you also can allow program to change it automatically, in other words items can be arranged to fit along the height or width of the box.
Font
Protuberance can handle multicolor (NxM pictures of letters ripped from the graphic image) and monocolor fonts (8xN Future Library fonts). But you also need to set some parameters. Size is just a h/v size of a every letter.
Color is needed only for monocolor fonts - just enter RGB values. If it's 8bit color depth then nearest color of the palette will be used.
You can define the spacing between letters. It's not just a value - it is interval. What is it for? Sometimes, text isn't fits the box, so it's good to reduce horizontal spacing to print it all. But if spacing is too low (it can be less than zero), text becomes unreadable, so set minimum value keeping this in mind. If minimum horizontal spacing is insufficient, some text will be cutted and "..." symbol will be printed.
Special symbols are "..." (explained above) and cursor. You can set them selecting symbol in the upper window by LMB and pressing corresponding button.
Length mask is another importrant feature - it's for defining every symbol his own length. You can create it with button and set symbol length by first setting its length in xsize (it will not affect the font that has lengthmask) and click RMB on the symbol in the upper window. For example, see how SMALL.PFN font in PROTUBERANCE has been set.
Font may consist of several layers, e.g. several sequental fonts may be printed each over another. And you can relatively shift layers by alter corresponding values. In example, for "bump" font, you need to print grey-colored text shifted by one pixel down first, then black-colored with no shifting. To do it, make 1st font grey, set yshift to 1, layers to 2, make 2st font black. See how it done in protuberance fonts. You can also made "shadowed" or "true-bump" fonts. Try improvise with that.
Filename is just Future Library font file ("FNT") or picture ("BMP","GIF","PCX"). In font design page you just can switch font filenames. They can be defined if file i/o page - select "font skins" and choose file in the filelist and press "Load". If it's Future Library font - it will be copied to the common directory, stored in the font file base and available for use. Graphic images must be "cutted" into several letters, so you must define how it will be done (set letter size, quantity and items-in-row (like as for images).
Variables and constants
sxres, syres, sbytes - current screen resolution (in pixels) and color depth (1 - 8Bit, 2 - 16Bit, 4 - 32Bit)
scrxres, scryres, coldepth - screen resolution and color depth by default
gxsiz, gysiz, sqsiz - current grid resolution (in grid cells) and cell size (in pixels)
xp, yp - workarea shift (in pixels)
xgrid, ygrid, sqs - grid resolution and cell size by default
comdir$ - common directory
pagefile$, skinfile$, imgfile$, wndfile$, msgfile$, fontfile$ - system files to load by default
boxmax, pagemax, imgmax, msgmax, wndmax, fontmax, lenmaskmax - maximum of interface objects
msgbuf - amount of XMS memory for messages
pagebuf - amount of XMS memory for pages
xmsiobuf - amount of base memory for XMS i/o operations buffer
filemax - maximum quantity of files and directories that can be stored
mx, my - mouse cursor coordinates (in pixels)
mb - mouse button status (1 - right, 2 - left, 4 - middle button pressed)
mmb - middle mouse button emulation (0 - off, 1 - on)
exitcode - set it to non-zero to perform shell exit
filequa - quantity of files and directories stored by DIRGET
EMS pages and handles
0 (bhn) - main screen buffer (sxres*syres)
1 (dhn) - sensitive area (gxres*gyres)
2 (shn) - skin
3 (whn) - secondary screen buffer (sxres*syres)
Programming
For quick access to your project, modify PATH variable in your AUTOEXEC.BAT file in C: root directory. You'll probably encounter this string:
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\
Insert there directory of your QB files, in example, if your QB is in the C:\QB\QB45 change the string to:
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;C:\QB\QB45
Then, copy there all *.LIB and *.QLB files (including PFL.LIB, PFL.QLB) that you use. Restart your machine. Now you can lauch QB with all these libs from any directory, in example, if your project is C:\QB\MYPROJ\myproj.bas you can lauch FAR or WC, go to C:\QB\MYPROJ\, type in QB /LFUTURE45.QLB, load file and start programming. If you'll lauch QB from its directory first, then your prog, you'll encounter problems with path to additional files in COMMON DIRECTORY of the project.
It's also recommended to store LIB and QLB modified specially for this project (in case you want to add some modules in FLBUILD) in its directory. Here's the minimum list of modules required:
So, you lauched QB with the library (to use this set of modules type QB /LPFL). Now open main module with name you choosed when created project. PROGRAM.BAS and ADMODULE.BAS also will be loaded. You'll substantially edit PROGRAM.BAS file. But you also can add other modules to your main file. To do this, load ADVANCED.BAS module using "Load File" command, then move subs you needed from this file to project's main module, then save all, unload ADVANCED.BAS using "Unload File" and save all again.
In next chapter PROGRAM.BAS subs will be described. You will fill them with code gradually during your work.
Mainly used for:
Initialization code of your program - memory allocation, variables definition, DATA reading, etc.
Mainly used for:
Memory deallocation and saving config.
Parameters:
I$ - the string, returned by INKEY$.
I% - ASCII code for symbol keys and (300 + scancode) for others. In example, I% = 48 for "0" key (ASCII code = 48), I% = 375 for LEFTARROW key (scancode = 75).
Note:
Check shifters (SHIFT, ALT, CTRL) state with LSHIFTPRESSED, RSHIFTPRESSED, CTRLPRESSED, ALTPRESSED functions and SHIFTERSGET sub.
Parameters:
n% - number of the page being set
Mainly used for:
Setting values
Mainly used for:
Maintaining all parts of the program that must work "on the background" - such as sequental window refresh, infoboxes update (such as clock). It's recommended to reduce the time needed for one step of this sub. Try to split time-wasteful task in small but speedy steps. In example, don't draw whole image by one step - draw just horizontal line by step. Otherwise you'll notice how hardly mouse cursor and whole program will react on your actions.
Parameters:
w% - number of the checking box
tag% - tag of the box
pressed% - set this variable to 1 for making the button 'pressed'
jammed% - set this variable to 1 for making the button 'jammed'
Returns:
button state (1 * pressed% + 2 * jammed%)
Parameters:
w% - number of the clicked box
tag% - tag of the box
Parameters:
w% - number of the box
tag% - tag of the box
vi% - for returning INTEGER
vs! - for returning SINGLE
v$ - for returning STRING
Returns:
box STRING
Parameters:
w% - number of the box
tag% - tag of the box
vg% - 0 if direct input is used, 1 if increment/decrement is used
vi% - box STRING converted to INTEGER
vs! - box STRING converted to SINGLE
if increment/decrement is used, vi% and vs! will be equal to this decrement
Note: See tutorial for advanced value setting group (with +/- buttons) programming
Parameters:
w% - number of the box
tag% - tag of the box
Parameters:
w% - number of the box
tag% - tag of the box
Parameters:
tag% - tag (number) of the window
Parameters:
w% - number of the window box
tag% - tag (number) of the window
Col% - color to clear window with
Mainly used for:
All calculations and settings needed for displaying window
Parameters:
w% - number of the window box
tag% - tag (number) of the window
num% - number of the workspace (list item)
x1%, y1%, x2%, y2% - coordinates of topleft and bottomright workspace corners
Parameters:
w% - number of the window box
tag% - tag (number) of the window
Parameters:
w% - number of the window box
tag% - tag (number) of the window
v% - number of the workspace under mouse cursor
Parameters:
w% - number of the window box
tag% - tag (number) of the window
X1%, Y1% - windows coordinates of dragging start
X2%, Y2% - window coordinates of mouse cursor
dx%, dy% - difference between coordinates
First you need to init XMS array by calling function XMSDAINIT that return XMS handle of the allocated XMS space (and you can refer to array by this handle). Parameter itemsmax% is maximum quantity of items in your array. Sizebyt% is size in bytes of the array stack (set it to maximum space you might use plus some more).
Mow you can store items in array by XMSDAPUT and retrieve by XMSDAGET. Just specify the handle of array (handle%) and number of item (num%). Offset% and Segment% - address of base memory to get from / put to, sizebyt& - size of item.
Troubleshooting
I run my program and messages (or everything) disappeared!
Perhaps you forgot to deallocate XMS memory (DeallocateXMS sub) or exited your program with Ctrl-Break several times. Try to save all and reload QB IDE.
I have added some buttons and they are not visible under QB!
It seems that you have running Protuberance Editor and QB IDE with your program simultaneously. Note that if you add some new objects in editor, maximum quantity of them stored in your project (*.PPR) file may be changed on disk but not in memory of QB IDE (project file is also used as INCLUDE for program). So, reload QB in this case (save all except PPR file). You can also alter the maximum quantities of objects in options page (in example, set the maximum boxes number to 100 to avoid these errors in future if you never have more than 100 boxes on a page)
Bugs and limitations
Credits
Protuberance is created by Matt Merkulov
Using Future Library by Jorden Chamid and Michael Rye Sorencen
Disk routines by Rich Geldreich
I would like to greet Nyron, Redojeker, Orphus, Max Kechaykin, Nick Gorkun, Andrey Selyakin, and all QBers!
Thanks Red Flag, Pain, To/Die/For, Sonata Arctica, Apocalyptica, Enigma, Blind Guardian, R. E. M., Zodiac, Vacuum, Metallica, Aerosmith, Scorpions, Electric Light Orchestra, Beatles, Dire Straits, Queen, U2, Alan Parsons, Gregorian, Theatre of Tragedy for their music.
Contact
I waiting for your impressions, comments, bug reports, created program submissions. Feel free to email or post messages on site messageboard. If you'll use Protuberance Interface, please give me a credit and mention FSoft site address.
Fomalhaut Software Site: http://fsoft.cjb.net
E-Mail: Agravein@fsoft.cjb.net