home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d547
/
powersource.lha
/
PowerSource
/
PowerSource.DOC
< prev
next >
Wrap
Text File
|
1991-09-19
|
65KB
|
1,303 lines
- PowerSource version 3.0 -
© Copyright 1991 Jaba Development
written in Aztec C version 5.0a by
Jan van den Baard
Credit must go to:
Jan Geißler. For his suggestions and bug report (tool.library).
Yves Perrenoud. For his suggestions, bug reports and beta testing.
DISCLAIMER
----------------------------------------------------------------------------
The author is NOT responsible for the suitability or accuracy of this
documentation and/or the program(s) it describes. Any damage directly
or indirectly caused by the use or misuse of this documentation and/or the
program(s) it describes is the responsibility of the user her/him self.
----------------------------------------------------------------------------
COPYRIGHT
----------------------------------------------------------------------------
PowerSource, © Copyright 1990-91 by Jaba Development. All rights reserved.
This program may be distributed non-commercially only providing that the
executable, source code, documentation and copyright notices remain
unchanged and are included with the distribution. This program is FREEWARE
so no financial donation is necessary (but welcome). If you use this
program to create gadgets and/or menus for a commercial or shareware
program I would appreciate a little note about it in the documentation. I'm
sorry but I have a big ego. Send me A postcard of your home-town if you use
this program so I will known where this program is used. If you have added
a nice new feature or you have enhanced a few things please let me know
about it. It would be better to release one PowerSource with all features
than ten with different features.
----------------------------------------------------------------------------
NON-COMMERCIAL ELECTRONIC DISTRIBUTIONS (BBSs)
----------------------------------------------------------------------------
It is allowed for non-commercial BBSs to distribute an archive with only the
following files in it to save your users some money when they have to
download this program. It is not allowed to upload this on BBSs which claim
copyrights on the uploaded material!
PowerSource.DOC - main program documentation
PowerSource.info - main program icon
PowerSource - main program
tool.library - shared library (© 1991 Jaba Development)
----------------------------------------------------------------------------
TABLE OF CONTENTS:
OVERVIEW I
REQUIREMENTS II
STARTING POWERSOURCE III
THE PROJECT MENU IV
THE GADGETS MENU V
THE FPEN & BPEN MENUS VI
THE GENERATED SOURCE VII
THE IMAGE BANK VIII
COMPILING IX
HISTORY X
FUTURE XI
NOTES XII
----------------------------------------------------------------------------
I. OVERVIEW
----------------------------------------------------------------------------
PowerSource is designed to save the Amiga programmer a lot of time in
creating intuition gadgets and menus. This version of PowerSource has the
following features:
o - a complete intuition user interface.
o - editing gadgets for a workbench or a custom screen.
o - editing gadgets for a window or a requester.
o - editing intuition menus.
o - full control over the window flags.
o - adding, modifying, moving and deleting texts for gadgets and window.
o - adding, editing, moving, re-sizing, deleting and copying of gadgets.
o - editing gadgets with the "WB 2.0" look.
o - loading IFF-ILBM brushes as gadget rendering.
o - a special "Image Bank" which holds all imaginary.
o - loading IFF-ILBM colormaps for custom screens.
o - a palette editor to create your own custom colours.
o - title line gadget information.
o - fully mouse and keyboard controlled.
o - generation of source code in C or Assembler.
o - generation of Assembler source which does not need the intuition
headers to assemble.
o - generation of static data & structures in C.
o - binary saving for later loading and editing.
o - Images are shared and can be used by multiple gadgets while only once
in memory and in the generated source.
o - borders are shared and can be used by multiple gadgets while only
once in memory and in the generated source.
o - full control over the generated source labels.
o - etc. etc. etc. etc............
----------------------------------------------------------------------------
II. REQUIREMENTS
----------------------------------------------------------------------------
PowerSource was programmed in Aztec C V5.0a on an Amiga 2000 Kick 1.3 with
5 Meg memory and a 52Meg HardDisk + A2630 Accelerator card (I've upgraded
a little....). Since the program has grown into 138 KByte and I don't have
access to a 512 KByte machine I could not test it on a mere 512k machine but
I don't think it should give to much problems. What you do need to work with
PowerSource is a C Compiler (try registering DICE...) and/or an Assembler
with all the standard include files. PowerSource also requires a copy of
the "tool.library", which is also on this disk, to be copied into the LIBS:
directory of the PowerSource boot disk. This program is tested with the
NTSC-PAL program by Nico François (FISH 387) in NTSC mode and it ran fine so
it should not give any problems on NTSC machines unless you try to load a
PS file that contains a window out of NTSC limits. Also some testing has
been done with Kickstart 2.0 and it ran fine.
----------------------------------------------------------------------------
III. STARTING POWERSOURCE
----------------------------------------------------------------------------
PowerSource can be run from the CLI or the workbench. If you run PowerSource
from the workbench all you have to do is double-click the "PowerSource" icon
or one of the "PS" icons. If you want to run PowerSource from the CLI just
type "PowerSource [filename]" where "filename" is an optional name of the
"PS" file you want to edit. When you have started PowerSource without a file
name a little window opens in the middle of the screen with the following
gadgets:
WINDOW - selecting this gadget tells PowerSource that you want to
edit gadgets for a window.
REQUESTER - selecting this gadget tells PowerSource that you want to
edit gadgets for a requester.
1 - custom screen, depth = 1, 2 colors.
2 - custom screen, depth = 2, 4 colors.
3 - custom screen, depth = 3, 8 colors.
4 - custom screen, depth = 4, 16 colors. (SLOWS UP THE 68000)
5 - custom screen, depth = 5, 32 colors.
WORKBENCH - if you select this gadget PowerSource still opens it's own
screen but the colors are the same as your workbench and
the generated structures will be for the workbench screen.
When you are done click "OK" and a screen opens with a little window on it.
If you click on "CANCEL" you leave the program again.
NOTE: If you have selected to edit gadgets for a requester you will see a
window with a colored rectangle in it. This rectangle represents the
requester you are working on. You can size and position the window
in order to get the requester how and where you want it.
Now let's create our first gadget. Move the mouse pointer to where you want
the top-left corner of the gadget to be and click the left mouse button.
If you look at the screen title now you will see some information displayed.
This information means, from left to right:
o - the mouse pointer X coordinate.
o - the mouse pointer Y coordinate.
o - the gadget left edge.
o - the gadget top edge.
o - the gadget width.
o - the gadget height.
NOTE: The values are relative to the top-left corner of the window/requester
This information is important to place and size your gadget exactly
the way it should be.
If you move the mouse pointer the values in the info-line will change and a
box will follow the mouse pointer relative to the top-left corner. This box
represents the gadget. When the box is the way you want the gadget to be you
must click the left mouse button again and the gadget will be added to the
window or requester. Now you have created your first gadget with PowerSource
so let's take a look at the menus to see what else you can do.
----------------------------------------------------------------------------
IV. THE PROJECT MENU
----------------------------------------------------------------------------
This menu consists of the following items:
About: <right Amiga ?>
Function: display information about the copyright, the author and the
memory available. Just click on the CONTINUE gadget to get rid of
it.
New: <right Amiga N>
Function: erases all gadgets and changes made sofar and resets the display
to the default. If the changes made where not saved a requester
opens telling you this and asking you if you really want to do
this. Click on the NO gadget if you made a mistake by calling this
function otherwise click on the YES gadget. Also you will be asked
If you want the images, if there are any, to be erased from the
Image Bank. Also it is possible to change the edit screen depth
with the "Please select" window you have seen when PowerSource
started.
NOTE: If you proceed with this function and the changes where not
saved there is no way to get back the information.
Load: <right Amiga L>
Function: This opens the file requester. In this file requester you can type
or select the name of the 'PS' file you want to load.
NOTE: The program only loads 'PS' files. If you try to load a file
that is not a 'PS' file a requester appears telling you that
the file you have selected was of an Unknown type.
When the file you have selected is successfully loaded. The screen
displays now displays the gadgets e.c.t. found in the file.
Save: <right Amiga S>
Function: This opens the file requester in which you can type or select a
name under which the current display is saved. You should always
save the display before you exit the program. This ensures the
file is always up to date. If you do not save the display before
quitting the program any changes made since the last time you
saved will be lost.
Generate Source:
C: <right Amiga C>
Function: This generates the source code in C of the display edited sofar.
A requester pops up showing the following gadgets:
WINDOW - Select this one if you want the window or
requester to be included in the source
generation.
SCREEN - Select this one if you want the screen to
be included in the source generation.
COLORS - Select this one if you want the screen
colors to be included in the source
generation. ( This has only effect when
generating source of custom screens! )
RENDER TEXTS - Select this one if you want the window or
requester texts to be included in the
source generation.
BORDER ONLY - Select this one if you want the border only
gadgets to be included in the source
generation.
SPECIAL GADGET - Select this one if you want the special
gadget (See THE GENERATED SOURCE.) to be
included in the source generation.
SPECIAL INFO - Select this one if you want the information
(See THE GENERATED SOURCE.) to be included
in the source generation.
GADGETS - Select this one if you want the gadgets to
be included in the source generation.
MENUS - Select this on if you want the menus to be
included in the source generation.
By default all gadgets are switched on so just click on the
gadgets you do not want generated and click OK. Clicking CANCEL
will abort the operation.
In the file requester you can type or select the name under which
the generated source code is saved.
Assembler: <right Amiga A>
Function: As with C only the generated source code is in MC68000 Assembler.
Preferences: <right Amiga P>
Function: This is used to (un)set certain preferred program flags. It opens
a window with the following gadgets:
Skip zero bit-planes : This tells PowerSource to skip any image
bitplanes that only contains zero's. This will
reduce the size of the image data source
PowerSource generates.
Auto Gadget -> Image size: This tells PowerSource to automatically adjust
the dimensions of the gadget to the dimensions
of the loaded image.
Image Copy : This tells PowerSource to also copy any images
that might be attached to a gadget.
Text Copy : This tells PowerSource to also copy any texts
that might be attached to a gadget.
Static Structures : This tells PowerSource to generate "static" data
and structures if C source is generated.
RAW Assembler Source : This tells PowerSource to generate numbers
instead of standard intuition names for the
flags, etc. when assembler source is generated.
This makes it possible to assemble the generated
source without having to include the intuition
headers.
OS 2.0 HighBorder : This tells PowerSource to also create a selected
Border for OS 2.0 bordered gadgets. This will
give the gadgets a "recessed" look when they are
selected. This one was suggested by Yves
Perrenoud.
Coordinates : The sets up PowerSource to display the mouse
coordinates in the screen title bar. NOTE : The
coordinates displayed are relative to the window
it's top-left corner! Also when editing on a
lo-res screen the coordinates can screw up the
menus! Again suggested by Yves Perrenoud
WINDOW or REQUESTER : Switch from editing gadgets for a window to
editing gadgets for a requester or viceversa.
Save : Save the preferences to a file called
'DEVS:PowerSource.PREFS'.
Use : Set the preferences in the program.
Save & Use : Both save and set these preferences.
Close WorkBench or
Open WorkBench: <right Amiga W>
Function: This enables you to close/open the workbench screen. You can close
the workbench screen if your (!!computer!!) memory is running a
little low.
NOTE: It's only possible to close the workbench screen if there
are no programs running that use the workbench screen. This
means that if you started PowerSource from the CLI it is
not possible to close the workbench screen because the CLI
is a program that makes use of the workbench screen.
Quit: <right Amiga Q>
Function: Quits PowerSource if you select YES in the requester that opened
to ask you to if you really want to do this.
----------------------------------------------------------------------------
V. THE GADGETS MENU
----------------------------------------------------------------------------
In this menu a lot of functions are defined which asks you to pick a gadget
to perform a certain action. If you accidentally activated one of these
functions you can press the 'ESC' key instead of selecting a gadget to exit
that function.
The following items are defined in this menu:
Move a gadget: <F1>
Function: When 'Move a gadget' is selected the message 'PICK GADGET TO MOVE'
is displayed in the screen title bar. Now click on the gadget you
want to move and the title will display the information of the
selected gadget. Now move the box which represents the gadget with
the mouse to it's new location and click on the left mouse button
and the gadget is moved to the new location.
Size a gadget: <F2>
Function: When the message 'PICK GADGET TO RE-SIZE' is displayed you can
click on the gadget you want to re-size. Again the gadget
information is displayed in the screen title. Now move the mouse
pointer to size the box until it has the size you want the gadget
to be. Just click the left mouse button and the gadget is resized.
NOTE: When the gadget has a shared border all gadgets which use
the same border are equally resized!
Copy a gadget: <F3>
Function: This function enables you to make a copy of a gadget. Once the
message 'PICK GADGET TO COPY' is displayed you can click on the
gadget you want to copy. If the gadget has Images and/or texts
attached to it and 'Image Copy' and/or 'Text Copy' was switched on
in the preferences window these images and/or texts will also be
copied. Otherwise the copied gadget will have a border as gadget
render and no texts. Move the box representing the copy to the
location you want it and click the left mouse button. Copying a
gadget which has a border attached to it will share it's border
with the created copy of the gadget. NOTE: BORDERONLY gadgets and
NOBORDER gadgets do NOT share the borders! Also the borders cannot
be shared between BOOLEAN and STRING gadgets. So a BOOLEAN gadget
only shares it's border with another BOOLEAN gadget and a STRING
gadget only shares it's border with another STRING gadget.
Delete a gadget: <F4>
Function: When the message 'PICK GADGET TO DELETE' is displayed you can
click on the gadget you want to delete and it's gone.
NOTE: Once the gadget is deleted there is no turning back.
Edit a gadget: <F5>
Function: This function enables you to edit the complete set of gadget flags
intuition has to offer and some other special things. When the
message 'PICK GADGET TO EDIT' is displayed in the screen title you
can click on the gadget to edit. Now a window is opened with the
following gadgets in it:
Under FLAGS:
GADGHNONE - nothing happens with the gadget when it is selected.
GADGHCOMP - the gadget hitbox is displayed complemented when the
gadget is selected.
GADGHBOX - a box is drawed around the gadget when it is selected.
GRELBOTTOM - the gadget top edge is relative to the bottom of the
window.
GRELRIGHT - the gadget left edge is relative to the right of the
window.
GRELWIDTH - the gadget width is relative to the window width.
GRELHEIGHT - the gadget height is relative to the window height.
SELECTED - the gadget is displayed in selected mode.
GADGDISABLED - the gadget cannot be selected. This flag will only be set
in the source code.
Under ACTIVATION:
TOGGLESELECT - the gadget can switched to selected mode by clicking on
it and to unselected mode by clicking on it again.
RELVERIFY - intuition waits to send a message until the left mouse
button is released with the pointer still above the
gadget.
GADGIMMEDIATE - intuition sends a message as soon as this gadget is
selected.
RIGHTBORDER - the gadget is placed in the right window border.
LEFTBORDER - the gadget is placed in the left window border.
TOPBORDER - the gadget is placed in to top window border.
BOTTOMBORDER - the gadget is placed in the bottom window border.
ENDGADGET - this gadget closes a requester
FOLLOWMOUSE - this gadget signals the window when the mouse moves.
Under PROP SPECIAL:
AUTOKNOB - intuition provides the gadget with it's own knob
FREEHORIZ - the knob may be moved horizontally.
FREEVERT - the knob may be moved vertically.
PROPBORDERLESS - intuition does not draw a border around the gadget.
HBODY - enter the steps the prop gadget can take horizontal here
VBODY - enter the steps the prop gadget can take vertical here
Under STRING SPECIAL:
UNDOBUFFER - create an undo buffer for this gadget.
STRINGCENTER - the string is centered in the gadget.
STRINGRIGHT - the string starts at the right of the gadget.
LONGINT - allow numbers to be entered.
ALTKEYMAP - this gadget has it's own keymap.
SIZE - enter the maximum amount of characters that can be typed
in this gadget here.
Under SOURCE LABEL NAME:
In this string gadget you can type in the name of the gadget that it will
have in the generated source code.
NOTE: Any spaces found in this name will be replaced by a '_'. Avoid
using names that are the same as symbols and commands of the target
language.
Under GADGET TYPE:
BOOL - make this gadget a boolean gadget.
PROPORTIONAL - make this gadget a prop gadget.
STRING - make this gadget a string gadget.
BORDERONLY - this is a special flag not defined by intuition but it is
used to tell PowerSource only to generate the border
structure of this gadget in the source code. This flag can
only be set on a BOOL gadget that has no texts or images
attached to it.
GZZGADGET - this flag should be set with gadgets that are in the border
of a GIMMEZEROZERO window.
NOBORDER - this is a special flag not defined by intuition but it is
used to tell PowerSource not to generate source of the
border of this gadget. The border will still be present
during editing but will not show in the generated source.
This flag can only be set on BOOL and STRING gadgets with
no images attached to it.
OS2BORDER - this is a special flag not defined by intuition but it is
used to tell PowerSource to put a "WB 2.0" border around
the gadget. This gives the impression, if the WB 2.0 colors
are set, that the gadget is recessed.
Selecting OK will set the flags edited to the gadget and selecting CANCEL
will resume to editing without setting the edited flags.
Gadget text:
Add a text: <F6>
Function: This enables you to add texts to a gadget. When the message
'PICK GADGET TO ADD TEXT' is displayed in the screen title you can
click on the gadget to which a text should be added. In the window
that appears the following gadgets are displayed:
Under Enter or edit text :
In this string gadget you must type the text you want to add to the gadget
Under DrawModes:
JAM1 - only the frontpen color is used.
JAM2 - both the front and back pens are used.
COMPLEMENT - complements the colors used.
INVERSVID - swaps the front and back pen colors.
Selecting CANCEL will resume to editing without adding the text to the
gadget. Selecting OK will close the text window and if you move the mouse
pointer in your edit window you will see the text next to the pointer. Now
move the text to where you want it to be and click the left mouse button
and the text is added to the gadget.
NOTE: If you didn't type a text in the string gadget the function is
cancelled even if you have selected OK. To get the text in the middle
of the gadget you should press F1 when the IntuiText editor is closed
The centering can be one pixel off but who cares....
Modify a text: <right Amiga 1>
Function: When the message 'PICK GADGET TO MODIFY TEXT' is displayed you can
click on the gadget which has a text you want to modify. A window
in which all the texts added to the gadget are listed is opened.
If the text you want to modify is not displayed in the list use
the prop gadget to scroll the list until it is displayed. Now
click on OK and the same window as with 'Add a text' is opened
only the text and it's drawmodes are preset. Now modify what you
want and click on OK and the text is modified.
Delete a text: <right Amiga 2>
Function: When the message 'PICK GADGET TO DELETE TEXT' is displayed in the
screen title click on the gadget which has the text you want to
delete. Now the 'text selector' is opened in which you can select
the text you want to delete. Click on OK and the text is gone.
Move a text: <right Amiga 3>
Function: When the message 'PICK GADGET TO MOVE TEXT' is displayed you can
click on the gadget which has the text you want to move. In the
'text selector' that opens you can select the text you want to
move. Now select OK and if you move the mouse pointer inside the
edit window and you will see the text next to the pointer. Move
the text to it's new location and click the left mouse button and
the text is moved.
IFF Image Render:
Get Gadget Image: <F7>
Function: When the message 'PICK GADGET TO RENDER' is displayed click on the
gadget you want to attach an IFF Image to. Now the "Image Bank"
window is opened. In the Image Bank you can select a image or load
an image. Look at the "THE IMAGE BANK" chapter for an explanation
of the ImageBank.
Get Select Image: <F8>
Function: The same as with "Get Gadget Image" only this time the image is
used as selected rendering.
NOTE: You cannot add a select image to a gadget that has no
gadget render image attached to it.
Delete Images: <right Amiga 4>
Function: When the message 'PICK GADGET TO DELETE IMAGES' is displayed click
on the gadget which has the images you want deleted and they are
gone.
NOTE: Both the GadgetRender AND the SelectRender Images are
deleted.
Image Bank: <TAB>
Function: This opens the Image Bank to load and or remove images from it.
See the "THE IMAGE BANK" chapter for an explanation of the Image
Bank.
Load (IFF) ColorMap: <F9>
Function: This function is only available when you are editing gadgets for a
custom screen. In the file requester you can type or select the
name of the IFF ILBM file which contains the colors you want set
in your edit screen. If the loading was successful the colors in
the file are now set in the edit screen. When placing texts for a
window/requester you can press F2 and the text will be centered
horizontally at the current y coordinate and when you press F3 the
text will be centered vertically at the current x coordinate.
Edit ColorMap: <F10>
Function: This function is only available when you are editing gadgets for a
custom screen. In the palette editor you can edit each color of
the edit screen. With the R, G and B prop gadgets you can set the
RED, GREEN and BLUE values of the selected color. With the 2,4,8,
16 or 32 (depending on the screen depth) colored gadgets below you
can select the color to edit. Selecting OK will set the edited
colors in the edit screen and resume to editing. RESET will reset
the colors as they where before you have entered the palette
editor. CANCEL will resume to editing without setting the edited
colors.
Refresh all gadgets: <HELP>
Function: If for some reason the display is distorted you can call this
function to redraw the entire display.
OS-2 Border colors: <right Amiga 5>
Function: This item enables you to set the "LightSide" and the "DarkSide"
color of the OS-2 borders. The color currently selected in the
"FPen" menu represents the "LightSide" of the gadget and the color
selected in the "BPen" menu represents the "DarkSide".
Depending on whether you are editing gadgets for a window or a requester the
next item will read:
Window or Requester:
The items 'Add a text', 'Modify a text', 'Delete a text' and 'Move a text'
perform the same action as the functions in 'Gadget text' with the exception
that the texts are assigned to the window or requester rather than to a
gadget.
When you are editing gadgets for a window two items are displayed:
Edit Flags: <right Amiga F>
Function: This will bring up a window in which all the intuition window
Flags are displayed:
WINDOWSIZING - the window sizing gadget is included.
WINDOWDRAG - the window can be dragged around with the title bar.
WINDOWDEPTH - the window can be put on top or below another window.
WINDOWCLOSE - the close window gadget is included.
SIZEBRIGHT - the sizing gadget is placed in the right window border.
SIZEBBOTTOM - the sizing gadget is placed in the bottom window border.
NOCAREREFRESH - intuition does not send a message to the window if a
refresh is necessary.
SIMPLE_REFRESH - intuition does no refreshing at all. the program must
refresh the window itself when necessary.
SMART_REFRESH - any overlapped part of the window will be buffered and
restored when possible.
SUPER_BITMAP - the window can handle a graphics display that is larger
than the window itself.
BACKDROP - the window is always behind all other windows.
GIMMEZERZERO - the window border is handled extra. You should NOT put
gadgets in the window border of a GIMMEZEROZERO window
without setting the GZZGADGET flag in the gadget its
activation field. Also you should not put texts or
BORDERONLY gadgets in the window border because when the
generated source is assembled/compiled these won't or
only partly show.
BORDERLESS - the window border is not displayed.
ACTIVATE - the window is activated as soon as it opens.
REPORTMOUSE - the mouse pointer position is always reported.
RMBTRAP - the possibility to get a message if the right mouse
button is pressed. This can only be used if there are no
menus attached to the window.
NOTE: Only WINDOWSIZING, WINDOWDRAG, WINDOWDEPTH, WINDOWCLOSE, SIZEBRIGHT
and SIZEBBOTTOM are actually set when PowerSource is running. All
the other flags are only generated in the source code.
Edit IDCMP: <right Amiga I>
Function: This opens a window in which you can set the IDCMP flags of the
window. The following gadgets are displayed in the window:
SIZEVERIFY - signal if the user is trying to re-size the window.
NEWSIZE - signal if the user has resized the window.
REFRESHWINDOW - signal if the window must be refreshed.
ACTIVEWINDOW - signal if the window is activated.
INACTIVEWINDOW - signal if the window is deactivated.
GADGETDOWN - signal if a gadget is pressed.
GADGETUP - signal if a gadget is released.
CLOSEWINDOW - signal if the closewindow gadget is selected.
REQSET - signal if a requester opened on the window.
REQCLEAR - signal if the last requester is closed.
REQVERIFY - signal if a requester try's to open in the window.
MENUPICK - signal if a menu was picked.
MENUVERIFY - signal if the user try's to pick a menu.
MOUSEBUTTONS - signal if a mouse button is pressed or released.
MOUSEMOVE - signal if the mouse was moved.
NOTE: The REPORTMOUSE flag should be set in the window
or the FOLLOWMOUSE in a gadget.
DELTAMOVE - signal if the mouse had moved. The position is relative
to the previous position.
INTUITICKS - signal every 1/50 or 1/60 second. The message must be
replied before another INTUITICKS message is signalled.
NEWPREFS - signal if the preferences were changed.
DISKINSERTED - signal if a disk was inserted into one of the drives.
DISKREMOVED - signal if a disk was removed from one of the drives.
RAWKEY - signal if a key was pressed. the code is the 'RAW' key
code.
VANILLAKEY - signal if a key was pressed. the code is the 'treated'
ASCII value of the key.
WBENCHMESSAGE - signal a workbench message
LONELYMESSAGE - signal a non IDCMP message
NOTE: None of the above flags are actually set in PowerSource but they are
generated in the source code.
Title - Type the Window Title in here.
Label - Type the source label name in here.
Detail - The window DetailPen.
Block - The window BlockPen
MinX - The minimum width of the window.
MinY - The minimum height of the window.
MaxX - The maximum width of the window.
MaxY - The maximum height of the window.
Selecting CANCEL will prevent the changes to be set. OK sets the changes in
the flags e.c.t. and will resume editing.
Set BackFill: <right Amiga B>
Function: This enables you to set the backfill color of the window. I have
made this function available since I use windows with another
backfill color than color 0 a lot. Maybe you do to (?). You can
use a routine similar to the following to use this window backfill
color in your program:
void WindowBackFill(struct Window *window)
{
SetAPen(window->RPort,WDBACKFILL);
RectFill(window->RPort,window->LeftEdge+window->BorderLeft,
window->TopEdge+window->BorderTop,
window->Width-window->BorderLeft,
window->Height-3);
RefreshGList(window->FirstGadget,window,NULL,-1L);
}
The color used is set by the BPen menu (see THE FPEN & BPEN MENUS)
When you are editing gadgets for a requester:
Set BackFill: <right Amiga B>
Function: This enables you to set the backfill color of the requester.
The color used is set by the BPen menu (see THE FPEN & BPEN MENUS)
Edit Menus: <right Amiga E>
Function: This sets up PowerSource for menu editing. Once this has been
selected you will see a new menu if you press the right mouse
button.
Set Labels: <right Amiga T>
Function: This enables you to set your own specific labels for some of the
source code. When this is selected you will see a window with the
following gadgets in it:
Texts -> You can type in the source label of the window
or requester texts here.
Borders -> You can type in the source label of the border
only gadgets here.
Menus -> You can type in the source label of the menus
here.
Items -> You can type in the source label of the menu-
items here.
SubItems -> You can type in the source label of the sub-
items here.
Sp. Gadget -> You can type in the source label of the
special render gadget in here.
NewScreen -> You can type in the source label of the
NewScreen structure in here.
Requester -> You can type in the source label of the
requester structure in here.
Colors -> You can type in the source label of the colors
in here.
Images -> You can type in the source label of the images
in here.
Sh. Border -> You can type in the source label of the shared
borders in here.
OK -> Will set the changes and resume to editing.
CANCEL -> Will resume to editing without setting the
changes.
All labels will be checked. If you try to enter an empty label the
old label will be putten back and all spaces will be replaced by
'_'.
Menus->
Add a menu: <right Amiga A>
Function: This opens a little window in which you will find the following
gadgets:
MENU NAME - Here you can type the name of the menu.
AUTO FORMAT - This switches between automatic formatting and
placing of the menus and items. Clicking it
will switch the LEFT, TOP, WIDTH and HEIGHT
gadgets for you to specify your own dimensions
I suggest you use the User Formatting only
when it's really necessary because the
program makes little to no sanity checks on
your input.
MENUENABLED - Select this one if you want your menu to be
enabled (selectable).
LEFT - Put your left-edge value in here. Only active
with user formatting.
TOP - Put your top-edge value in here. Only active
with user formatting.
WIDTH - Put your menu width value in here. Only active
with user formatting.
HEIGHT - Put your menu height value in here. Only
active with user formatting.
OK - This will add the menu to the menustrip. NOTE
If you did not give the menu a name the
operation will be cancelled.
CANCEL - This will cancel the operation.
Edit menu:
Function: Attached to this menu you see all menus you have edited sofar in
a list. Selecting the menu you want will bring up the Menu Edit
window in which you can edit the menu. This item will be off if
no menus are defined.
Delete menu:
Function: Attached to this menu you see all menus you have edited sofar in
a list. Selecting the menu you want to delete brings up a
requester in which you will be asked if you are sure. Selecting
YES will delete the menu and NO will cancel the delete. This item
will be off if no menus are defined.
Insert menu before:
Function: Attached to this menu you see all menus you have edited sofar in
a list. Selecting the menu you want to insert a new menu BEFORE
will bring up the Menu Edit window in which you can edit the menu.
This item will be off if no menus are defined.
Edit items for:
Function: Attached to this menu you see all menus you have edited sofar in
a list. Selecting the menu you want to edit items for will setup
a new menustrip which will be explained below.
Test Menus: <right Amiga T>
Function: This will test the menus you have edited sofar. After selecting
this you can browse through the menus using the right mouse button
Pressing ESC will terminate the test.
Gadgets Menu: <right Amiga G>
Function: This simply returns you to gadget editing.
THE ITEMS MENU
Add item: <right Amiga A>
Function: This opens the Edit Item window in which the following gadgets can
be found:
HIGHCOMP - This tells intuition to complement the item
when the pointer is on it.
HIGHBOX - This tells intuition to draw a box around the
item when the pointer is on it.
HIGHNONE - This tells intuition not to change the item
when the pointer is on it.
COMMSEQ - This enables the user to use a shortcut key
instead of selecting this item.
CHECKED - This tells intuition to draw a little hook in
the item when it is selected.
CHECKIT - This tells intuition to draw a little hook in
in the item.
MENUTOGGLE - This toggles the little hook each time the item
has been selected.
ITEMENABLED - This enables the item (makes it selectable).
COMMAND KEY - The shortcut key (See COMMSEQ). This pops up a
requester when you enter a command key which
is already used on another item.
ITEM TEXT - The name of the item.
AUTO FORMAT - See "Add a menu"
JAM1 - the drawmode of the item text. Switches between
JAM1, JAM2, COMPLEMENT and INVERVID.
LEFT - See "Add a menu"
TOP - See "Add a menu"
WIDTH - See "Add a menu"
HEIGHT - See "Add a menu"
OK - This will append the edited item to the list.
CANCEL - This will cancel the operation.
Edit item:
Function: Attached to this menu you see all items you have edited sofar in
a list. Selecting the item you want will bring up the Item Edit
window in which you can edit the item. This item will be off if
no items are defined.
Delete item:
Function: Attached to this menu you see all items you have edited sofar in
a list. Selecting the item you want to delete brings up a
requester in which you will be asked if you are sure. Selecting
YES will delete the item and NO will cancel the delete. This item
will be off if no items are defined.
Insert item before:
Function: Attached to this menu you see all items you have edited sofar in
a list. Selecting the item you want to insert a new item BEFORE
will bring up the Item Edit window in which you can edit the item.
This item will be off if no items are defined.
Edit subitems for:
Function: Attached to this menu you see all items you have edited sofar in
a list. Selecting the item you want to edit subitems for will
setup a new menustrip which will be explained below.
Main Menu: <right Amiga M>
Function: This brings you back to the menu editing menu.
Set MutualExclude: <right Amiga E>
Function: To setup an item to exclude other items. Selecting this menu will
ask you to pick the item that should do the excluding. Now press
the right mouse button and select the item that you want. Now you
will be asked to drag-select the items you want excluded. By
drag-selecting is ment that you should keep the right mouse button
down while you press the left mouse button on each item you want
to exclude. Release the right mouse button once the last item has
been selected.
THE SUBITEMS MENU
The first four and the last two items in this menu do the same as with the
items in the "Items" menu but instead of editing items you will edit
subitems.
The only item that different is the following:
Item Menu: <right Amiga I>
Function: This will put you back to the Items menu.
Now there is also a command not specified in the menus. Pressing the '*' key
on the numeric keypad will dump the window you are working on to the printer
It uses the printer.device so make sure that you have set it up correctly.
When you press the '\' key (just left of the backspace key) PowerSource will
print all ID's of the gadgets created sofar.
----------------------------------------------------------------------------
VI. THE FPEN AND BPEN MENUS
----------------------------------------------------------------------------
When one of these two menus are selected you will see a row of 2,4,8,16 or
32 (depending on the screen depth) colored items. These items represent the
colors of the edit screen. With the items in the FPen menu you can set the
active FrontPen color. All gadgets added will have a border in this color
and all texts added will have this color as the FrontPen color. With the
items in the BPen menu you can set the active BackPen color. All texts added
will have this color as the BackPen color. The active BackPen color is also
used to set the BackFill color of the requester. The colors selected are
also used to set the OS 2 Border colors. (see "OS-2 Border colors")
----------------------------------------------------------------------------
VII. THE GENERATED SOURCE CODE
----------------------------------------------------------------------------
The following definitions are made at the end of the generated source:
NEWWINDOW or REQUESTER - a pointer to the NewWindow or Requester structure.
If you have edited some gadgets:
FIRSTGADGET - a pointer to the first gadget in the list.
If there where texts added to the window or requester:
FIRSTTEXT - a pointer to the first text in the list.
If there where 'BORDERONLY' gadgets defined:
FIRSTBORDER - a pointer to the first border in the list.
If you have edited gadgets for on a custom screen:
NEWSCREEN - a pointer to the NewScreen structure.
COLORCOUNT - the number of colors in the screen.
An array of USHORT values containing the colors which where on the edit
screen. These colors can be set by a simple LoadRGB4() call.
If you have edited gadgets for a window:
WDBACKFILL - the window backfill color used while editing.
If you have edited menus:
FIRSTMENU - the first menu in the strip.
If you have edited gadgets for a window and you have attached texts and/or
'BORDERONLY' gadgets to the window a special gadget is placed at the end of
the gadgetlist. This gadget is only there to draw the borders and the texts
when the window is opened or when the gadgets are refreshed.
The GadgetID's are defined as following: Label_ID
This means that if you, for example, added a gadget with the label "UP" than
"UP_ID" will represents this gadget it's ID.
The best way to see what the source looks like is to create some gadgets and
let PowerSource generate the source and then look at it. Basically all you
need to remember are the labels you give your gadgets to be able to access
all of the structures etc. that are linked to these gadgets. I don't really
know if the generated C source compiles under lattice , I don't have lattice
, but it should give no problems whatsoever.
----------------------------------------------------------------------------
VIII. THE IMAGE BANK
----------------------------------------------------------------------------
The Image Bank is designed to use a single Image on several gadgets at the
same time. This has two very big advantages. One, There will be only one
copy of the Image in memory, and Two, The generated source will only contain
the Image once. You can see this saves a lot of memory (and disk space).
The Image Bank window contains 6 or 7 depending on how you called it. When
you called it using the <TAB> key or the "Image Bank" Item the following
gadgets are in the window:
Load -) This will put up the FileRequester in which you can
select the name of an IFF ILBM file you want to load.
If the loading went OK the window now displays the
Image or, when it's to big, part of it. The colors of
the image are set on the screen. Everytime you load an
Image it will be appended to the already existing
images.
Remove -) This will remove the Image currently in the Image Bank
window from the Image Bank deallocating the memory it
takes up. If the Image still has gadgets which use it
a message will be displayed telling you this and the
image will not be removed.
NEXT -) This will display the next image and it's colors. If no
next image exists in the Image Bank the screen will
flash.
PREV -) This will display the previous image and it's colors.
If no previous image exits in the Image Bank the screen
will flash.
CONTINUE -) This will continue the editing.
When you called the Image Bank by pressing <F7> or <F8> or by selecting the
"Get Gadget Image" or "Get Select Image" items the first four gadgets will
be the same as above. Then two new gadgets are displayed:
OK -) This will select the image currently on the Image Bank
window. Then a requester pops up asking you if you want
to use the colors of the Image. Select "YES" if you
want this and "NO" if not.
CANCEL -) This will cancel the operation and resume to editing.
The Image Bank uses a simple checksum routine which should detect it if you
try to load the same image twice. The checksum routine is very simple and it
could be that two images have the same checksum. Therefore a requester pops
up telling you that the image you tryed to load is already in the bank and
then asking you if you want to keep it. When you want to keep the image just
click on YES otherwise click on NO.
----------------------------------------------------------------------------
IX. COMPILING
----------------------------------------------------------------------------
If you have the make utility type:
make pre ged
Otherwise compile the "defs.h" file with the "-ho defs.pre" option and all
other files with the "-so -hi defs.pre" options and then link them together.
----------------------------------------------------------------------------
X. HISTORY
----------------------------------------------------------------------------
VERSION 1.0 -> Let's not talk about this!
VERSION 2.0 -> First release, let's see how it goes.
VERSION 2.2a -> The generated window source now reads NULL at the
place of the window title if the title was empty.
The gadgets on the window won't interfere with the
placing of texts and gadgets in the window or
requester anymore.
Binary file structure expanded. Version 2.0 binary
files must first be patched before GadgetED 2.2a and
up can read them.
Added "Static Structures" switch in the preferences
window to enable to generate static C source code.
Added the NOBORDER switch to disable the generating
of gadget border source.
Added the "Text Copy" switch to enable to copy any
text attached to a gadget also.
Resolved a bug in "tsel.c" which gurud if more than 10
texts where in the "text selector" and the prop was
used. It worked fine when I first programmed this
function with the Aztec C version 3.6a compiler ?
Added the possibility to set your own window backfill
color.
Added the "RAW Assembler Source" switch to be able to
assemble the generated assembler source without having
to include the intuition headers.
Added OS-2.0 colored borders. This was suggested by
Jan Geißler. Thanks Jan!
Workbench usage only worked when both the GE file
and the GadgetED executable where in the same
directory, this is now fixed.
GadgetED locked up the system if the "tool.library"
wasn't found. This is now fixed. (I forgot a simple if
statement!)
VERSION 2.3 -> Fixed a bug that caused generating faulty C source
with gadgets that have multiple texts.
Fixed a bug in the palette requester which gurud on
LoRes screens.
Fixed the source generator to generate correct source
of GIMMEZEROZERO windows and GZZGADGETS (I hope...)
Added the posibility to set the colors of OS 2.0
colored borders.
GadgetED now defaults to Workbench screen editing if a
file could not be loaded upon startup.
Source generator now generates "V_HIRES" instead of
"HIRES" when assembler source for hires custom screens
is generated.
VERSION 2.4 -> 2.3 could edit or load colors on a workbench screen
using keyboard shortcuts. This has been removed.
GadgetED still crashed if the correct tool.library
was not found. This is now FIXED.
Fixed a very minor bug in the Gadget numbering. Thanks
Yves.
Fixed a bug in the Edit Gadget screen which caused
some gadgets to switch off never to be switched on
again. Thanks Yves.
Automatic sizing of OS 2 bordered grel gadgets was
really screwed up. This is now fixed.
Added "OS 2.0 HighBorder" switch in the preferences
window. Suggested by Yves Perrenoud.
Re-Sizing a gadget with an Image attached to it gurud.
This has been fixed.
VERSION 2.5 -> Added "Image Bank" to save memory and to generate
smaller image source. This also caused a radical
change in the binary file structure. You must patch
pre-2.5 binary file with PatchGE version 2.0 first!
Added "Free CHIP:" and "Free FAST:" in the "About"
window.
Added the "Image Bank" menu item.
Added coordinates when placing texts. Suggested by
Yves Perrenoud.
Added automatic centering of Gadget Text's. Suggested
by Yves Perrenoud.
Removed a bug in the OS 2.0 HighBorder routine which
could crash the machine.
Added the possibility to dump the current window to
the printer.
VERSION 3.0 -> CHANGED THE NAME TO PowerSource BECAUSE SINCE THE
PROGRAM IS ABLE TO EDIT MENUS THE NAME GadgetEd DID
NOT SEEM TO BE RIGHT!!!
Added a big new feature.... Menu Editing!
Added the possibility to change the screen resolution
when new is called.
Added the possibility to determine what source will be
generated and what source will not.
Added hotkeys to almost every menu for all you
keyboard freaks out there. (Now why would a keyboard
freak want to use this program.......?????)
GadgetED 2.5 crashed when the OS 2.0 HighBorder option
was on and a BORDERONLY gadget was created. This has
been fixed.
Changed the refresh routine which could crash the
Amiga when the window is resized during a refresh.
A little bug from the 2.5 beta version which caused
the gadgets not to be putten back on the window after
deleting a text has been fixed.
The text selector won't pop up anymore if only one
text is available.
The IntuiText editor would not cancel the operation if
OK was selected without having typed in the text which
resulted in a guru. This has been fixed.
The 2.5 beta version of GadgetED would not free a
considerable amount of memory upon exit. This has
been fixed.
Added the possibility to dump the edit window to the
printer. (bullshit...???)
The maxchars of string gadgets would stick on the last
one entered in the Edit Gadget screen. This has been
fixed.
The binary files now have a new icon which (I think)
looks much better on WB 2.0
The Window backfill routine now looks a lot better
running under OS 2.0.
The "DriPens" which give the OS 2.0 windows that
special look are now set when running under OS 2.0.
Copying a gadget gave a false width indicator on the
title bar information.
Added a simple checksum in the image bank which should
detect it when the user try's to load the same image
twice.
Changed the source code generator so it won't generate
C source that gives warnings with DICE.
Added optional coordinates. Idea by Yves Perrenoud.
Added a source label requester for labels which used
to be set by the program.
PowerSource now knows when one try's to load a binary
which it cannot read.
PowerSource now uses border sharing. Idea by Yves
Perrenoud.
Added the possibility to print the ID's of all gadgets
created.
Added text centering in the window/requester.
Removed a bug wich caused a crash when selecting New.
The FirstGadget pointer of the NewWindow structure
pointed to non-existing data.
Changed back the Edit Gadget screen from two colors to
four colors by special request of Yves perrenoud. It
looks better but takes up slightly more memory when
open.
----------------------------------------------------------------------------
XI. FUTURE
----------------------------------------------------------------------------
Here are some things which I plan for future versions of PowerSource:
o When OS 2.0 is burned into ROM PowerSource should be able to generate
and edit gadtools menus and gadgets.
o Also when OS 2.0 is burned into ROM a separate source generator is to
be made which generates source according to the new intuition flag
names.
o If requested enough by the users of this program PowerSource should
enable image rendering for the menus. How many programs use this.....
o Please give me some ideas.....
----------------------------------------------------------------------------
XII. NOTES
----------------------------------------------------------------------------
You'll have to excuse me for the way the source looks but I merly do this as
hobby so I'm not really very effective in the way I handle things in the
program. Since a lot of new features are included in this version there are
bound to be new bugs also so if you find bugs, I bet you will, or you have
ideas to make the program more user-friendly, please report to me at the
following address (I will try to implement all reasonable suggestions you
give me):
Standard mail: Jan van den Baard
Bakkerstraat 176
3082 HE, Rotterdam
Holland.
Or the electronic way at: Fidonet: 2:500/29 (Jan van.den.Baard)