home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d583
/
tpledit.lha
/
TplEdit
/
TplEdit.doc
< prev
next >
Wrap
Text File
|
1992-01-04
|
16KB
|
379 lines
1mNote****************************************************
If you paid more than 5 $US/DM/£UK for a disk including
this program - your dealer is a thief and you're a fool.
**************************************************Koessi0m
1mTplEdit0m.DOC
V 2.00 BETA
1mTplEdit0m is a 1mgadtools0m template editor used to edit display templates
that can then be compiled into a program.
1mTplEdit0m ONLY RUNS UNDER 2.0 ! THIS IS A BETA
Additional code done by
Koessi 11.1991 - phone Germany 02192 7630
This is version 2.0. Placed in the public domain.
Parts of this docfile still reflect 1.0 situation. \8-)
1mUSAGE0m
from Cli you can start immediately with a project if you add
its filename as a parameter on the commandline.
e.g. "1mTplEdit0m tplcontrol"
from WorkBench
you can start immediately with a project if you
doubleclick on that projects icon with its default
tool set to 1mTplEdit0m or shift-click it together
with the 1mTplEdit0m-icon.
In WorkBench-mode 1mTplEdit0m will create a projecticon
when first time saving a project.
1mMENUS0m
Project
Save save database.
SaveC... save database as C code.
Excl Main() only includable.
Incl Main() completely standalone to test.
See section SOURCE CODE GENERATION for further information.
SaveAs save database as (you pick the name)
SaveAsC... save C source as (you pick the name)
Excl Main() only includable.
Incl Main() completely standalone to test.
See section SOURCE CODE GENERATION for further information.
Load load a new project.
Merge merge another project into the actual one.
Quit quit program - same as closing any window.
Gadgets Specify the appropriate gadget type, do not specify
3mInvisible0m(not implemented yet).
Edit
LockLinkTo Create a 3mListView0m and 3mString0m gadget. Select the
3mListView0m gadget so that it's information is displayed
in the control window. Then select the LOCKTO menu
option. Finally, click on the 3mString0m gadget.
Due to bugs in 1mgadtools0m, the 3mString0m gadget's dimensions
will be forced to conform.
To create a specific size for the 3mListView0m try different
values of Buf/Space.
UnLockLink To unlock a link select the 3mListView0m gadget so that it's
information is displayed in the control window. Then
select this menu option.
SortRegions Sorts created gadgets and 3mBevelBoxes0m to ease hitting them.
NOTE: This option changes the order of building the gadgets
and various defines ! So if you are already working with
other codefiles that depend on the generated code you MUST
recompile them all !
Snap The mouse coordinates may be snapped to various
intervals.
NOTE: 1mTplEdit0m is only able to load database format files which
are saved via SAVE or SAVEAS. 1mTplEdit0m cannot reverse
engineer C source files it generates.
1mTplEdit0m 2.0 can still read database files done with
version 1.0 - but some minor errors may appear.
1mTplEdit0m will warn you if you quit without saving, or try
to load a new project without having saved the old one.
Menus can be accessed from either window.
1mTPL CONTROL WINDOW:0m
The control window allows you to edit gadgets in the project window.
Actions:
NEW
Press this to create a brandnew one.
Move the mouse to the project window and specify a square
by placing the mouse in the starting position, holding down
the select while moving the mouse to the ending position and
release the mouse. The gadget now exists.
COPY
Press this and klick on an already created gadget in the project
window. It will be doubled (the region name will have a numeric
appendix) and you can move the original directly to its new place.
MOVE
Press this and move the gadgets you select in the project window.
SIZE
Press this and resize the gadgets you select in the project window.
Sizing always modifies the lower right hand corner of an existing
gadget. 3mCheckBox0m and 3mMX0m gadgets cannot be sized!
EXCL
Press this after selecting some gadget in the project window.
The next gadget you select will belong to the same ExclGroup as the
last one. If they are 3mButton0m or 3mCheckBox0m they will exclude each
other from staying selected; others will disable eachother.
To free a gadget from any exclusion, exclude it with itself. \8-)
DEL
Press this and delete the next gadget you select in the project
window.
TEST
Press this to play around in the project window.
Gadgets:
Specify the appropriate gadget type, do not specify 3mInvisible0m
(not implemented yet).
TextPos:
This will specify text placement if it applies.
It also specifies the GTSL_LevelPlace for 3mSlider0m-gadgets
Values:
MaxVal
This slider will specify the GTSL_Max for 3mSlider0m-gadgets
and the maximum legal colournumber for 3mPalette0m-gadgets.
It also shows you the maximum possible value for the default
selection in 3mListView0m, 3mMX0m and 3mCycle0m gadgets.
Buf/Space
This slider will specify the GTSL_MaxLevelLen for 3mSlider0m-gadgets
and the spaces set between the items of 3mListView0m and 3mMX0m gadgets.
DefVal
This slider will specify the GTSL_Level for 3mSlider0m-gadgets,
the default selection in 3mListView0m, 3mMX0m, 3mCycle0m and
3mPalette0m-gadgets.
List of Items:
You might want to specify a non-empty string list for 3mListView0m,
3mMX0m or 3mCycle0m gadgets. This is done by typing in the 3mString0m-gadget
and hitting return.
add
The same as hitting return.
up
This will sort the selected item one step higher.
down
This will sort the selected item one step lower.
del
This will delete the selected item.
SpecialFlags:
CHECKED
Preselect 3mMX0m or 3mButton0m gadgets.
BORDER
Draw a border around 3mText0m or 3mNumber0m gadgets.
RECESSED
Draw a 3mBevelBox0m in recessed manner.
HIGHLABEL
Highlight the labelstring of gadgets using one.
VERTICAL
Select vertical orientation for 3mSlider0m or 3mScroller0m gadgets.
READONLY
Make the items of a 3mListView0m gadget uneditable. They will be
shown in an automatically created 3mText0m gadget.
IMMEDIATE
RELVERIFY
Sets the corresponding flags for 3mSlider0m or 3mScroller0m Gadgets.
DISABLED
Makes the gadget appear ghosted.
Region Name:
You MUST specify a REGION name.
EACH GADGET MUST HAVE A UNIQUE REGION NAME!
Label/Format:
Edit the labelstring you want to apply to your gadget.
If the gadget is a 3mSlider0m, this can be a printf-styled format
string (default: "%4ld"). the "%ld" will be replaced by decimal
digits by default. The function DispFunc() is declared in the
produced code to perform this.
Default Str:
Edit the default string you want to apply to your 3mString0m gadgets.
UPDATE
You can change various parameters, including the items in a
select/cycle list, by clicking on the appropriate gadget from
TEST mode, making the appropriate modifications in the TPL CONTROL
window, and then hitting UPDATE.
WARNING WARNING: To copy a 3mString0m gadget's info to the
TPL CONTROL window you must hit RETURN in the window after
activating it! Otherwise you might update the wrong gadget's info.
NOTE: 3mListView0m, 3mMX0m, 3mText0m and 3mNumber0m gadgets cannot be deactivated
and so their hit boxes remain active. There is a two pixel
boundary around every gadget which you can click on to 'grab'
such gadgets, or grab 3mString0m gadgets without clicking in them.
Use SortRegions in the menus to cleanup - especially to push
3mBevelBoxes0m (borders) into the back.
1mSOURCE CODE GENERATION:0m
To generate source code select the SaveC or SaveAsC menu options.
"Excl Main()" will create only includable files.
"Incl Main()" will create completely standalone code to test.
The C source files generated are named by appending
"_defs.h" and ".c" at the project's name denoted as xxx below:
"xxx_defs.h" - the headerfile
If standalone code is created, this will do proper includes.
It contains variables references for easy access / modification
by the host program.
For example, the Buf_REGION pointers point to the stringbuffer
for the associated 3mString0m gadget after it is created so you do
not have to figure it out.
Variables are generated for each gadget based on its REGION name.
denoted as %% below:
NG_%% These #define's yield a pointer to the proper
NewGadget structure from NGAry based on the
REGION name.
NGAry Array of NewGadget structures, ng_VisualInfo and
ng_TextAttr initialized by InitGads() call (for now,
eventually this will be specifiable from the editor)
GAD_%% A #define representing the GadgetID for a given
gadget. Eventually you will be able to specify
a #define of your own to offset all the id's.
Gad_%% A pointer to the gadget after creation, useful
when making GT_SetGadgetAttrs() calls.
Buf_%% A pointer to the string buffer (3mString0m) after
it is created.
NodeAry_%% If any items are specified for a 3mListView0m, 3mMX0m or
3mCycle0m, they are stored in this array, with
Succ and Pred fields linked together and to
the List_%% list.
List_%% A LIST structure (3mListView0m), already initialized
to either an empty list or linked into a
NodeAry_%% array of nodes. May be modified
before the gadget is created or afterwords,
following 1mgadtools0m guidelines.
Ary_%% A char ** array pointer (3mCycle0m, 3mMX0m), preset
to the cycle specification. Points to
StatAry_%%. The reason this is simply a
pointer to another global array is to allow
the host program to modify it before creating
the gadgets.
StatAry_%% holds static array (3mCycle0m, 3mMX0m) of char *'s.
Other Defines
WLEF window placement parameters. These parameters
WTOP generate a window of exactly the same screen
WWID positioning and dimensions as was last saved.
WHEI
GLEF_%d gadget placement parameters.
GTOP_%d
GWID_%d
GHEI_%d
BLEF_%d BevelBorder placement parameters.
BTOP_%d
BWID_%d
BHEI_%d
"xxx.c" If InclMain() is chosen from the menus this
generated c-sourcefile will include "xxx_defs.h"
and can simply be compiled (using DICE) like:
dcc xxx.c -otest -2.0
If ExclMain() was chosen it will include "defs.h"
that has to be supported by the host program.
"defs.h" should also contain
#include "xxx_defs.h"
The host program should declare the following
variables:
Window *EWin;
struct VisualInfo *VisInfo;
Screen *Src;
The following routines are declared in xxx.c:
void FreeGads(void);
int InitGads(void);
void drawborders(void);
__geta4 long DispFunc(Gadget *, WORD);
1mNOTES0m /* partly from Matt's version 1.0 */
Some 1mgadtools0m types / flags are as yet unsupported.
I intend to change the variable naming conventions so as to
support linking with multiple 1mTplEdit0m generated object files,
including separating out the #include's and #define's. I will
retain single-application mode variable-naming conventions as
an option.
SOURCE CODE: Source code generated by 1mTplEdit0m should be
completely portable. However, the example TEST code and
1mTplEdit0m source is DICE specific in that it assumes all
libraries will be openned automatically.
Other compilers will most likely generate undefined symbol
errors during linking. In fact, DICE may even do so if you
do not have the absolute latest version (I just added some
of the below to the auto library). Shouldn't be a big deal
though...
intuition.library
graphics.library
asl.library
gadtools.library
The test program makes similar assumptions. I will eventually
do this myself so as to make the program portable. Please note
that this is an BETA release.
I may not have a lot of time to refine this program and invite
anybody who wishes to take it on as a major project to contact
me! I only ask that the general design philosophy be retained
and the code placed in the public domain.
BIX: mdillon
INTERNET: dillon@overload.Berkeley.CA.US
1mSOURCE0m: /* updated to version 2.0 by Koessi 11.91 */
I have included the project "tplcontrol", that will produce
(using ExclMain() from SaveC-menu) exactly the files
"tplcontrol.c" and "tplcontrol_defs.h" which are used
for the whole design of the TPLCONTROL window.
/* guess which was first ? \8-) */
Try "1mTplEdit0m tplcontrol" to play around.
Using InclMain() will produce standalone code resulting in
an executable like the supplied "test".
I don't have any access to SAS or Aztec Compilers, so I can't
check for compatibility.
Have Fun. Koessi.
1mBUGS0m:
When I resize the project-window, having a project just
loaded but no gadget yet selected my machine blacks out ...