home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
fish
/
911-930
/
ff922
/
designerdemo
/
designerdemo.help
< prev
next >
Wrap
Text File
|
1994-05-04
|
28KB
|
609 lines
introhelp
The Designer
(C) Ian OConnor 1993
Release : 1.0
Demostration Version, Distribute Freely
The Designer is shareware, you may distribute copies of this demo
version to anybody but all files must stay unchanged and all must be
included in the distribution. This software is provided "AS IS", without
warranty of any kind, either expressed or implied. The author is not
responsible for any damage or loss of data due to use of this program,
these are solely the users concern.
This program was written to make designing Intuition interfaces for your
programs easier and quicker. It will produce code to open and close
Windows, make Menus, open Libraries, make Images and much more. It also
has the ability to produce IDCMP handling routines for your applications
and a few other useful routines.
It produces a file, that you can compile and use in your program, that
contains all the routines you need. It is recommended that you do not
edit this file because you will then be able to update it in the future
for new features etc.
The actual production of the source is handled by a program called a
producer, stored in the same directory as The Designer. You select which
language you want be selecting the relevant producer in code options.
Help is provided on most functions, telling you what they do and how
they are used. You can read the help file seperately if you prefer.
This program is provided as is, I can guarantee nothing. I am not aware
of any bugs in this program, although it is unlikely that there are none.
Bug reports can be sent to me at the address below but only send them if
you are registering, I will then fix any problems in due course.
My postal address is
I OConnor
3 Askerton Close
Nine Elms
Swindon
SN5 9XB
UK
To get the full version of the Designer send 15 pounds sterling to the
above address, it must be in sterling and drawable on a UK bank.
This will get you a fully working registered version posted to you as
soon as possible.
Ian OConnor
end
mainhelp
Main Window
This is the window presented on running the program, the creation of
windows, menus and importing of images is all handled here, as well as
code production and file operations. The gadgets are as follows.
About : A little message.
Prefs : Here you can set up your own prefs for The Designer. Only
options about the editor are here.
Code : Allows you to set code preferences changing what is
produced, library options are also here.
Open, Save : File operations. Designer files have a .Des appended to
their filenames.
Generate : Saves the .des file and calls the Producer specified in
the code options.
Help : General help on most of the Designer.
New, Delete and Edit allow you to play with the Windows, Menus and
Images the Designer produces.
Keyboard shortcuts are underlined on the gadgets except for W, M and I
which change the list displayed.
end
maincodehelp
Main Code Help
Here Several options acting on the whole product are set. If comment
code is checked then the code produced is commented to its maximum
extent. This overrides the comment field of window code. If WaitPointer
is checked then a standard Release 2.0 waitpointer is included, to use it
a command like this is needed :
SetPointer(Win, WaitPointer, 16, 16, -6, 0);
[ pWaitPointer in pascal ]
If IDCMP Handler is checked then the framework of an idcmp handler is
produced for each window and menu designed. These functions should then
be copied into your own code and edited.
Makelibs means that library opening code will be created, see Libraries.
The Code :
Pascal :
For each window 2 or 3 functions will be created :
Function OpenWindow'WindowLabel':Boolean;
Procedure CloseWindow'WindowLabel';
Procedure RendWindow'WindowLabel'; Optional
The first of these may need parameters depending on its code options.
Just check the header in the unit for details.
Their also exist several global variables for each window :
'WindowLabel' : pWindow;
'WindowLabel'glist : pGadget;
'WindowLabel'VisualInfo : Pointer;
'WindowLabel'Gads : array[] of pgadget; Optional
'WindowLabel'Depth : Word; Optional
as well as a few others for the window gadgets.
For each menu one function is produced
Function MakeMenu'MenuLabel'( VisulaInfo : Pointer): Boolean;
the menus can be freed with FreeMenu as normal.
The global 'MenuLabel' is a pointer to the allocated menu structure.
All images are created as const data and are allocated to chip ram by
the makeimages fuction, free them on exit with free images, only free
them if they are succesfully allocated.
Several procedures are included to make life easier :
Procedure Settagitem( pt : ptagitem ; tag : long ; data : long);
procedure printstring(pwin:pwindow;x,y:word;s:string;f,b:byte;
font:ptextattr;dm:byte);
procedure stripintuimessages(mp:pmsgport;win:pwindow);
procedure closewindowsafely(win : pwindow);
function generalgadtoolsgad(kind : long;
x,y,w,h,id : word;
ptxt : pbyte;
font : ptextattr;
flags : long;
visinfo : pointer;
pprevgad : pgadget;
userdata : pointer;
taglist : ptagitem
):pgadget;
function getstringfromgad(pgad:pgadget):string;
function getintegerfromgad(pgad:pgadget):long;
function GadSelected(pgad:pgadget):Boolean;
procedure gt_setsinglegadgetattr(gad:pgadget;win:pwindow;
tag1,tag2:long);
C :
For details of the functions produced read them! The definitions are
in the header file produced and the functions do approximately the
same as the above Pascal ones.
OpenDiskFonts will produce a function that you can call, after the
diskfont library is open, to load any fonts that are on disk and not
in ROM or RAM. If this is not done then any font used but not loaded
will be replaced by the default font.
end
libhelp
Open Libraries Help
If the procedure to open libraries is created then the libraries to
open, the earliest version acceptable and whether to fail whole program
if unopenable is set in the choose libraries window, in the code window.
Whether to produce these functions is set in the code window. The
functions created would be
Pascal : Function OpenLibs:boolean;
Procedure CloseLibs;
C : int OpenLibs(void);
void CloseLibs(void);
Open Libs will return False if unable to open a library and told to fail
if that library unopened. If the procedure fails then all libraries will
be closed, if it does not abort on fail you should check the library you
want is open before use.
CloseLibs must not be called before OpenLibs, any special code like
opening asl or arp but not both must be written by you.
Default values are set that open those libraries required by the code
produced by the Designer, even if you open libraries yourself you must
open these libraries :
Intuition V37
Graphics V37
GadTools V37
DiskFont V36
Your program should have a bit like this if you use these functions:
Pascal : If OpenLibs then
Begin
{ rest of program }
CloseLibs;
End
else
writeln('Cannot open all libraries.');
C : If ( OpenLibs()==0 )
{
/*
Continue program
*/
CloseLibs();
}
else
{
/*
OpenLibs Failed
*/
}
end
windowedithelp
Edit Window Help
This is the main part of the program. Here you can design the windows
that will be produced for you.
The following operate on the selected or all selected Gadgets in the
window at that time. To select a gadget you should just activate it by
clicking on it in a way to send a message. Multiple selects are done
by holding down a Shift key when selecting. Clicking on a blank bit of
the window while holding down shift will create a box which will select
all gadgets inside the box, if it is not cancelled with the right button.
Gadgets :
Size : Allows you to change size of selected Gadget.
Clone : Allows you to copy and place current selected gadgets.
Delete : Deletes selected gadgets.
Move : Moves all selected gadgets.
Align : Allows you to align all selected Gadgets to a given
line and side.
Spread : Space all selected gadgets out in given direction with
given space in between them.
Graphics :
Bevel : Create and edit bevel boxes on the window.
Text : Create and edit text on the window.
Image : Place imported images on the window.
Options :
Screen : Edit edit screen mode.
Tags : Edit window tags.
Code : Edit window created code options.
Sizes : Edit window sizes.
IDCMP : Edit IDCMP message types received by program.
Help : This help text.
Gadget Information :
Most of the GadTools gadgets can be modified in some way during their
life. The type of modifications that can be done and how to read
information from these gadgets is detailed below.
Notes :
Setting a Palette gadget depth to 0 will mean code will be produced
that sets the depth to the screen depth, it will also mean a variable
<WinLabel>Depth will contain this depth (not the number of colours).
Tags that can be modified :
Button : GA_Disabled (BOOL)
string : GTST_String (STRPTR)
GA_Disabled (BOOL)
Integer : GTIN_Number (ULONG)
GA_Disabled (BOOL)
CheckBox : GTCB_Checked (BOOL)
GA_Disabled (BOOL)
MX : GTMX_Active (UWORD)
Cycle : GTCY_Labels (STRPTR *) (Set only V37 up)
GTCY_Active (UWORD)
GA_Disabled (BOOL)
Slider : GTSL_Min (WORD)
GTSL_Max (WORD)
GTSL_Level (WORD)
GA_Disabled (BOOL)
Scroller : GTSC_Top (WORD)
GTSC_Total (WORD)
GTSC_Visible (WORD)
GA_Disabled (BOOL)
ListView : GTLV_Labels (struct List *)
GTLV_Top (UWORD)
GTLV_Selected (UWORD)
Palette : GTPA_Color (UBYTE)
GA_Disabled (BOOL)
The procedure GT_SetSingleGagdetAttr is supplied in any produced
pascal source so that you can easily change these values with only one
call.
Reading Information :
Button : IDCMP_GADGETUP received when pressed.
String : If STRINGA_ExitHelp then IDCMP_GADGETUP with
code=0x5F received.
If tab pressed IDCMP_GADGETUP with code=0x09 received.
If Return pressed IDCMP_GADGETUP with code=0 received.
Use GetStringFromGad( pGadget ):String to get text in
pascal.
Integer : If STRINGA_ExitHelp then IDCMP_GADGETUP with
code=0x5F received.
If tab pressed IDCMP_GADGETUP with code=0x09 received.
If Return pressed IDCMP_GADGETUP with code=0 received.
Use GetInetgerFromGad( pGadget ):Long to get Integer
in pascal
CheckBox : IDCMP_GADGETUP received when state changed, use
CheckedBox( pGadget ):Boolean to read state in pascal.
MX : IDCMP_GADGETDOWN received when pressed with active
number in code field of intuimessage.
Cycle : IDCMP_GADGETUP received when pressed with active
number in code field of intuimessage.
Slider : If GA_Immediate then IDCMP_GADGETDOWN with position
in code field.
If GA_RelVerify then IDCMP_GADGETUP with position
in code field.
Scroller : If GA_Immediate then IDCMP_GADGETDOWN with position
in code field.
If GA_RelVerify then IDCMP_GADGETUP with position
in code field.
ListView : IDCMP_GADGETUP messages will be received with code
containing item selected.
Palette : IDCMP_GADGETUP messages will be received with code
containing colour selected.
Boolean Gadgets :
These are constructed on top of the GadTools Generic class, boolean
gadgets are those used in buttons, toggle switches, mutual excludes
and so on. The inclusion of this type is meant to allow the use of
some gadgets with definable imagery. You can choose the placing and
type of text with much more precision, select the activation methods,
the highlighting method and images to use in the different state and
the initial state. Experimentation will show what can be done.
OnGadget and OffGadget should be used to enable/disable and the
messages received will be IDCMP_GADGETUP and IDCMP_GADGETDOWN if
you select IMMEDIATE and RELVERIFY respectively. The toggle gadgets in
the Tools window are of this type and GetFile gadgets can be made
using this type.
You should still use graphics that look like the other types. The
style of gadgets should be kept. To make the gadgets work properly
you should set their size to be the same as the images used.
end
windowcodehelp
Help on Window code options
These options change the kind of procedures produced to open and close
windows.
You should really check if the window is open unless it is only called
once, then this would be wasted code.
Opening only if can create gadgets is also a good idea.
Having more than one gadget font can make windows look over-complicated
and creates larger programs, but is sometimes required.
Return boolean can allow a program to fail if the window is unopenable,
this only applys to pascal because you can ignor the return in C.
A custom message port can be supplied and the window will be closed
safely.
Calculating border sizes allows for different height of title bars, not
doing so fixes them at the edited size.
Producing a pgadget array allows referencing the gadgets by your code
and is usually necessary.
Attaching a menu created is easily done and options allow definition of
the code produced.
Commenting code allows you to read over the unit and see what is
happening, commenting is done if the Main Code options Comment is set.
WorkBench AppWindows allow icons to be dragged onto your window, if it
is on the Workbench screen. It requires a seperate message port which is
supplied as a parameter to the openwindow procedure, also supplied to
the openwindow function is a long for the appwin id.
The gadget list window, which can be opened from here, or automatically
via preferences, allows you to change the order of the gadgets. This
changes their gadget IDs the first gadget ID is also set here, usually 0.
This window can also be used to edit gadgets which cannot be activated,
ie if you put them behind another accidently or an error occurs and they
cannot be created. High acts in the same way as clicking ont the window
does, ie Shift High does not unhighlight other gadgets.
Note:
If you wish to open more than one copy of a window then all you have to
do is set the window label to pw^.win in Pascal or w->win in C. This will
result in the window, the gadgets, the glist and the visualinfo being
inside a structure, so you can pass a pointer to the structure to open
the window and a different pointer for a different copy. To do this you
will have to delete the variables initiations in the produced file but
it is not too difficult.
end
windowsizehelp
Window Sizes Help
Allows you to directly edit the window size, zoom size and the maximum
and minimum sizes. All changes will be made to the window when OK or
Update are selected but if you move or size the window before updating
then your input will be overwritten with the new size. These sizes are
the actual ones on screen, including the borders, if border sizes are
calculated then the window size will be modified suitably. If InnerWidth
and InnerHeight are not set to 0 they will be used instead of width and
height. It would probably be sensible to use InnerW and InnerH all the
time, this along with calculating border sizes will produce windows as
good as a gimmezz, as far as sizeing goes. When InnerWidth and
InnerHeight ar in use the width and height values are not editable.
end
windowidcmphelp
Window IDCMP Help
Choose which IDCMP messages will be sent to the window by Intuition. See
RKM for full documentation. Suitable IDCMP will be added for gadgets as
used by the window anyway.
IDCMP Flags :
MOUSEBUTTONS : Supply info about mouse button presses.
MOUSEMOVE : Tell when mouse moves.
DELTAMOVE : As above with change of position.
GADGETDOWN : Gadget message.
GADGETUP : Gadget message.
CLOSEWINDOW : CloseWindow gadget pressed.
MENUPICK : Menu Item Selected.
MENUVERIFY : Is it OK to draw a menu ?
MENUHELP : Help key pressed on menu item.
REQSET : Requester set on window.
REQCLEAR : Requester removed from window.
NEWSIZE : Window has been resized.
REFRESHWINDOW : Window needs redrawing.
SIZEVERIFY : Can window be resized ?
ACTIVEWINDOW : Window made active.
INACTIVEWINDOW : Window deactivated.
VANILLAKEY : Vanilla key code passed.
RAWKEY : Raw key code passed.
NEWPREFS : 1.3 Prefs changed.
DISKINSERTED : Floppy disk inserted.
DISKREMOVED : Floppy disk removed.
INTUITICKS : Timing message.
IDCMPUPDATE : Boopsi Message.
CHANGEWINDOW : Window Sized or moved.
end
tagshelp
Help on editing tags for window
The tags specified here define a lot of details for your window. Not all
will be displayed while editing but they will all be in the code
generated.
Specific Information
WindowTitle : Title string for window.
ScreenTitle : Title string for screen when window is active.
WindowLabel : Label referred to in source.
CustomScreen : Allows Custom Screen Pointer to be passed to window
opening routine.
PubScreen : Similar to above but Public screen.
PubScreenName : Pass a pointer to a null terminated string giving
name of public screen to open on.
PubScrFallBack : Fall back to default screen if cannot find public
requested.
MouseQueue : Mouse message backlog limit.
RptQueue : Repeat key backlog limit.
SizeGadget : Do you want a sizing gadget ?.
SizeBRight : Put Size Gadget in right border.
SizeBBottom : Put Size Gadget in bottom border.
DragBar : Allows window title bar dragging.
DepthGadget : Allows user to change window depth.
CloseGadget : Window has a close gadget.
ReportMouse : Send mouse movements to window.
NoCareRefresh : Do not receive refreshwindow messages, bad idea with
gadtools.
Borderless : Make window borderless, usually just backdrop windows
have this.
BackDrop : Window is always at the back, can only have one per
screen.
GimmeZeroZero : 0,0 of window is below title bar and right of left
border.
Activate : Activate window on opening.
RMBTrap : Trap menu events, do not allow menu selections.
SimpleRefresh : No intuition refreshing at all.
Smartrefresh : Intuition handles most refreshing.
Autoadjust : Move/Size window so that it goes on the screen.
MenuHelp : Receive IDCMP_MENHELP when user presses help button
on menus.
Zoom : Supply zoom gadget array of values.
For full information see manuals.
end
textlistwindowhelp
Help on text editing window
Editing strings to be placed in the window, it is all pretty self
explanatory. All fonts are supported and can be easily selected. The
drawmodes are standard as well, just try them if you are not sure what
they do.
The text gets display at the bottom of the window, Update puts the texts
on the edit window, if placed.
All the texts must be placed before they are drawn. Clicking on the edit
window in edit text mode allows you to move the currently selected text.
end
imagelisthelp
Help on images in window
Any image loaded in can be placed on a window. They are removed if the
image is deleted. A list of those placed is available, an image can be
placed any number of times on a window.
The exact positioning of an image can be changed by changing the numbers
on the image choosing window. The image drawing gadget works in the same
way as the text drawing gadget, it moves the currently selected image
about the window.
end
bevelhelp
Help on creating Bevel Boxes
These use the GadTools BevelBox procedure to draw 3-D Bevel Boxes on
screen. Normal boxes bring out an area to show it can be selected,
Recessed boxes show the user it cannot be selected and Double boxes
seperate out areas of a window.
Bevel Boxes cannot be selected on screen so you have to edit them using
the options in the edit window. Update redraws the edit window so that
you see any changes you have made to box types.
end
menuhelp
Help on editing Menus
Menus can be created as stand alone to be used as you wish, or they can
be attached to windows designed in the program. The layout of the menus
is all pretty obvious to an amiga user. Titles are the left column, Items
in the centre and SubItems to the right.
The font and colour of the text can be changed easily, and graphic items
can be used instead of text, the second listview in each column contains
a list of all the imported images imported.
There is a problem with these if you try to use an image taller than the
screen, the machine crashes, or at least, mine does.
The menu you create can be tested using the Test button, this updates
the menu attached to the menu edit window. This is not necessary if the
Autotest option is set in prefs. The option to turn autotesting off
exists because it can slow down menu creation quite a lot.
There must be at least one Title on each menu, the number of Titles,
Items and SubItems is limited only by intuition.
Mutual exclusion is possible for items and subitems. The items/subitems
you wish to exclude from the selected item/subitem should be checked on
the menu. You should 'Test' the menu before doing this if it is not 'auto
tested' to make sure it is up to date. Failure to do this might cause
problems reading the menus. I recommend you set the menutoggle bits of
all items to be excluded while excluding them to make the job easier,
turning then off afterwards to get the required menu actions. You must
test the menu for this to take effect, it does not work otherwise. If
it autotests then it is impossible to set up most situations.
If the code option IDCMP Handlers is set then a procedure will be
produced for each menu which is the framework for processing input for
the menu. You should copy these procedures into your own program and edit
them so they carry out the required actions. If you want MENUHELP then
copying this procedure twice will enable response to those messages also.
end
imagehelp
Help on editing Images
Any non-Ham IFF image can be imported into the Designer and the code
produced will contain an Image structure which can be used as desired by
you. Most of the fields in this image structure are defined by the image
itself but you can chenge the PlanePick and PlaneOnOff fields.
The PlanePick field specifies which bitplanes the image is drawn in.
For each bitplane in the image there must be a corresponding destination
bitplane in PlanePick. The designer will ensure that the PlanePick value
is always legal.
The PlaneOnOff field just selects ehether the planes not written to by
the image are set or cleared. Default is all cleared.
Use the view button to update the display so you can see what the image
looks like.
To move the images into chip ram this is necessary :
Pascal : If MakeImages then
Begin
{ rest of program }
FreeImages;
End
else
writeln('Cannot make images.');
C : It is only necessary to call this function if your compiler
does not support __chip. Set the option in main code to
choose whether __chip is used or these functions are produced.
If ( MakeImages()==0 )
{
/*
Continue program
*/
FreeImages();
}
else
{
/*
MakeImages Failed
*/
}
Colour maps are created in the produced files and can be used when an
image display window is opened, set whether they are or not in prefs.
The maps are oly produced if the images imported have a colour map, it
is not required for success. At the moment only 4096 colours are
supported, 24 bit palettes are converted down to 12 bit internally.
LoadRGB4 is used to set these to a viewport. To set a colourmap to a
screen use :
Pascal : LoadRGB4( @pscr^.viewport, pword(colours), numcolours);
C : LoadRGB4( &Scr->ViewPort, (UWORD *)colours, numcolours);
If you wish to edit a window with an imported palette then the only way
to do this is at the moment is to open an image view window on the edit
screen.
end
END
Error In Help Data.
Error In Help Data.
Error In Help Data.
Error In Help Data.
end
ENDFILE