Jey Visual Pascal V 0.5
What is JVP?
Jey Visual Pascal or JVP in short is a programming tool for easy and fast
creation and programming of windows, gadgets and menus under the Amiga
standard operating system libraries, i.e., exec, dos, intuition, graphics,
diskfont and so on. It also provides the support for other standard or
common used libraries such as ASL, ARP and so on. It is claimed that using
JVP saves 50% of the programmer time. Creating gui's is done by several
mouse click&drags only, and thus it should be pleasant too.
The main idea behind JVP is very close to other visual languages, but the
way it implements the idea is a little different. Creating and handling
gadgets and windows always consumes a lot of the programmer time and on
the other hand a good gui is as important as the main code, no matter what
it does, good look and ease of use is the must for every software from small
to large. So any programming method such as JVP which let you create the gui
in several minutes means that it has saved you more than 50% of the chore,
and you will have to fill up the blank areas of the code which will give
life to the gui.
Features
(NOTE: Some features will only be accessible in the full version.)
General features:
- It saves 50% of the programmer's time, while keeps simplicity.
- There is a menu file (or form file) and a pascal source file for
every project, thus changing the menu is always possible and is
independent of the pascal code so you need not to modify or even
recompile the main code. This lead you to create one software with
many different gui's for different users tastes!
- At first stage JVP was developed to support old 1.3 OS, and the
final executables could be run under 1.3, but it is possible to
remove this feature and get "Run only under OS2+" feature!
- Supports both Latin and Persian gadgets.
Gui creator features:
- Build windows and good looking gadgets by click&drag only.
- You can see the final result promptly (something like WYSIWYG).
- The process of programming is simple, first add windows and
gadgets to them, then save the gui and pascal source files.
- Dragging windows and gadgets may be done under desired grid size
constraint.
- Every desined window or gadget can be modified, duplicated or
killed by a single click.
- All window and gadget intuition standard flags are modifiable
easily.
- Gadgets can be aligned easily within a window.
- Gadget texts can be aligned easily too.
- Creating special gadgets is embeded, e.g. FileReq and FontReq
gadgets are the common ones.
- The JVP gui creator is made by JVP itself! So one may generate a
better JVP gui creater in future!
- Windows in a project can be browsed.
- Currently it supports two screen modes: MedRes and HiRes Lace.
Pascal source features:
- After creating the gui, you should save it as the gui data file
and also save the pascal source prototype for that gui. The pascal
source created by JVP is as plane as possible and avoids from
disorder or messy programming.
- Handling windows and gadgets are done by some simple procedures
and functions and you need not to know anything about window or
gadget structure.
- all windows and gadgets are identified by their number not
pointers.
- All windows data are stored in memory and are managed by JVP
automatically. These data are accessible at runtime even when
the windows are closed! for example at runtime one may read or
write the text of a string gadget in window #6 of a gui without
the need to open it!
- It is possible for expert users to get the window and gadget
pointers too. This way, it is possible to do anything you want!
- The final executable size will not grow dramatically by adding
more windows and gadgets.
- In default state, windows act for both keyboard and mouse. For
example every window no matter it has or has not a close gadget,
returns a signal for pressing ESC key.
- There are some standard gadget control modes used commonly in all
softwares which can be set by programmer when designing the gui.
Using these control modes, JVP automatically manage them, e.g.,
pressing ESC or close gadget of any window means Cancel mode, i.e.,
any changes made to the window contents should not be considered
and JVP will restore the previous states of gadgets when closing
that window. Or you may set a certain gadget in Return mode, then
by pressing that gadget or activating it (if string gadget), the
window will be closed and the current window settings will be
accepted (stored in memory).
- You can let the user to save the state of all windows and gadgets
by adding a single standard routine (SaveGui). Thus having a
configuration menu option should not be a headache.
- It is possible to have different gui's loaded into one program
with no conflicts.
- There are some internal functions which let the programmer to
easily change the gadgets at runtime.
- Gadget fonts can be changed easily.
- It is compatible with both Kick and Maxon Pascal compilers.
How to do?
Programming by JVP comprises of two parts (as other visuals), gui (or form)
and the main code. JVP comes with a visual gui creater and a pascal unit
(compiled for Kick/Maxon pascal) which is the main core of JVP.
There are specific steps toward programming by JVP:
In the JVP gui creator do the following:
- At first, create a window by "Add Window" gadget.
- Create a gadget by "Add Gadget".
- Modify your window and gadgets at your desire.
- Repeat 1 to 3 at your desire.
- Save the Gui to a file.(The default name is in the form of "*.mnu")
- Save the Pascal source to another file.(The default name is in the
form of "*.p")
Now your "Form" or "Gui" or ".mnu" file is ready and you should program for
it. You can modify the gui later if needed. The gui file is a binary file but
the pascal source is a plane text file.
Load the pascal source code generated by JVP into one of the Kick pascal
or Maxon pascal compilers and then run it, you will see your window and
gadgets working but do nothing! Now you should only fill up the blank spaces
between "Begin" and "End"'s in the source code. All gadgets and windows are
named automatically and are easy to address by human.
At this point I explain a little about the JVP pascal unit by example:
JVP Unit
Thanks to the unit idea in pascal which let programmers to share their
routines in a standard and easy method.
The pascal source created by JVP gui manager uses some of the functions
and procedures in the JVP unit. Using the JVP unit you can program very
easily and with the least pain.
JVP unit will tackle the gui operations in whole and removes the complexity
of the Amiga OS commands in a pascal source code. e.g. when initialising the
gui, you need not to define too many variables, pointers and records and use
the os commands (i.e. intuition, diskfont, asl, ...) to setup the windows and
gadgets! But you only invoke a simple command like below:
LoadGUI(filename);
This simple command and all other JVP commands are defined in the JVP unit
and are accessible when using it. Let's see an example source code
generated by JVP gui manager:
----- Sample Source code for JVP: -------------------------------
(*** Jey Visual Pascal ***)
(*** $VER: Jey Visual Pascal 0.50 ***)
(*** Hossein Shirdashtzadeh 1376-77 ***)
Program JVP_Program(Input,Output);
Uses JVP;
{********* Const **********}
Const
Menu_1{My Window}=1;
M1_Gad_1{My Gadget}=1;
M1_Gad_2{My Gadget2}=2;
Menu_2{My Secound Window}=2;
M2_Gad_1{My Gadget3}=1;
M2_Gad_2{My Gadget4}=2;
M2_Gad_3{My Gadget5}=3;
{*********My Secound Window***********}
Procedure Proc_Menu_2{My Secound Window};
Var
OutReal:Real;
OutString:String;
Menu_ID:integer;
Menu_Win:p_window;
Begin
Menu_ID:=0;
Menu_Win:=InitGui(Menu_2{My Secound Window});
While Not (Menu_ID in [-1]) do
Begin
Menu_ID:=Get_Gui_ID(Menu_2{My Secound Window},0,1,OutString,OutReal);
Case Menu_ID of
M2_Gad_1{My Gadget3}:
Begin
End;
M2_Gad_2{My Gadget4}:
Begin
End;
M2_Gad_3{My Gadget5}:
Begin
End;
Otherwise;
End;{Case}
End;
CloseGui(Menu_2{My Secound Window});
End;
{*********My Window***********}
Var
OutReal:Real;
OutString:String;
Menu_ID:integer;
Menu_Win:p_window;
{********* Main ***********}
Begin
Menu_ID:=0;
LoadGui('ram:test.mnu');
Menu_Win:=InitGui(Menu_1{My Window});
While Not (Menu_ID in [-1]) do
Begin
Menu_ID:=Get_Gui_ID(Menu_1{My Window},0,1,OutString,OutReal);
Case Menu_ID of
M1_Gad_1{My Gadget}:
Begin
End;
M1_Gad_2{My Gadget2}:
Begin
End;
Otherwise;
End;{Case}
End;
CloseGui(Menu_1{My Window});
End.
-----------------------------------------------------------------
We assume that "Ram:test.mnu" was created by JVP gui creator and contains
the gui data. By compiling and runnig this program we see that the first
window will open and only by pressing the close gadget or ESC will vannish.
As it is clear from the code, after using JVP, every window and gadget has
been numbered by constant values in the program header. These are done by
JVP gui creator. It has designated the window and gadget names in comments
too. After that, there are two procedures defined for the two windows which
has been created in JVP gui creator. Each procedure is filled by some
standard variables and commands. The variables are used to transfer string,
real and integer values between the program and JVP gadgets. In the main
routine the first JVP command is "LoadGui()" which loads a menu or gui
binary file containing all JVP windows and gadgets. After that and also in
all other JVP procedures, the first JVP command is "Initgui()" that will open
the relevant window and return the pointer to the window structure. This
pointer can be ignored by most of programmers, but experts will enjoy it.
Next we see a "While" loop that consists of a control command.
This command
is "Get_GUI_ID()". By this command the number of activated gadget is
transfered to our program and based on the "Case" we will do our task.
Each branch of the "Case" is designated by the commented name of the
pertaining gadget in the window.
After the "While" loop we see a "CloseGUI()" command which will close the
window. But based on the mode of the gadget pressed, it will close with
one of the two modes: "Cancel" (or "Unchanged") and "Return" (or "Changed").
If there are some proportional gadgets, string gadgets and toggle gadgets
in the window, their state will remain unchanged if the pressed gadget is
of "Cancel" type one. And the changes will remain if the pressed gadget
is of "Return" type one. Note that all windows data are stored in memory
and are managed by JVP automatically.
This is the standard format of a JVP pascal source. As you see there is no
need to build records and pointers to create windows and gadgets. This lead
to simpler program. Also one will know what is doing and what should do.
Other Similar Softwares
As I know and searched, there is no other software with this idea,
specially for pascal. But if you know about one I still wish to see and
compare.
Future
It would be very nice if the pascal source could be edited and compiled
within the JVP gui manager. I will build an internal editor in future, if
I gain enough requests for JVP. Currently there is no good free command
line pascal comiler as I know and it is very hard to me to build my own
pascal comiler, so if anyone know about such a compiler, I hope to help me.
Where To Find JVP?
JVP demo is now available on the Aminet at: /pub/dev/lang/jvp.lha
How to contact me?
You may contact me by email:
shirdash@www.dci.co.ir
or by snail:
Hossein Shirdashtzadeh
No. 132,
Kerdabad, Jey st.,
Isfahan,
Iran
Zip: 81599
or by phone:
(+98)-031-510155 (Speak in English or Persian)