Short: Amiga Visual Pascal *DEMO* v0.5 Author: Shirdash@www.dci.co.ir (Hossein Shirdashtzadeh) Uploader: Shirdash www dci co ir (Hossein Shirdashtzadeh) Type: dev/lang Architecture: m68k-amigaos What is it? ----------- "Jey Visual Pascal" or in short "JVP" is a developer tool for pascal programmers from beginners to professionals. It helps you to create, program and handle gui very easily and neat. The idea is very close to that of visual programming tools and compilers on PeeSee's. Please note that this demo version is not as sophisticated as the visuals which let you program within the JVP GUI Manager (JVPM), but if you and your friends send me mails or snails supporting and encouraging me to continue I will complete it and make it as a ShareWare. Currently, I have not enough time (because i think it is a risk!) to document JVP in full. But as a very short compact manual here is the way you can program in JVP: Compact Manual: --------------- Programming by JVP comprises of two parts (as other visuals), GUI (or Form) and the main code. JVP comes with a visual Gui creater called JVP Manager and a pascal unit (compiled for Kick/Maxon pascal) which is the main core of JVP. At the moment I do not explain the JVP Manager and I feel it is self explainatory and playing with its gadgets you will find the way ;-) But here I only write the main steps in the following: 1- At first create a window by "Add Window" gadget. 2- Create a gadget by "Add Gadget". 3- Modify your window and gadgets at your desire. 4- Save the Gui to a file.(The default name is in the form of "*.mnu") 5- Save the Pascal to another file.(The default name is in the form of "*.p") Note: This demo version let you create 3 windows at most and each window may have a maximum of 4 gadgets of any type. Now your "form" or "Gui" is ready and you should program for it. You can modify the gui later if needed. The Pascal source code generated for your gui is now ready to be compiled by Kick/Maxon compiler and running it, you will see your window and gadgets working! Now you should only fill up the spaces between "Begin" and "End" in the source code. All gadgets and windows are named automatically and easy to address by human. But if you try to modify the gui, will lose your manual codes currently, but if this software is supported by you, i will complete it so that your code remain unchanged. and even better i will provide a built in intelligent editor for editing the program. At the moment I explain more about the JVP pascal unit which let you program with more flexiblity. Learning JVP Unit Step By Step: ------------------------------- Using the JVP unit you can program very easily and with the least pain: This 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 the simple command below: LoadGUI(filename); This simple command and all other JVP commands are defined in the JVP unit and is accessible when using it: (Note: you should use JVP_DEMO for this release version.) ----- Sample Source code for JVP DEMO (1): ------------------------------- Program JeyVisualPascal; Uses JVP_DEMO; begin LoadGUI(filename); end. -------------------------------------------------------------------------- The "filename" contains the file name and the path of the gui file which has been created by JVP Manager. But compiling and runnig this program does nothing, because you have not said which window should be opened and what to do with them. Thus here you need to use the following command at least: Dummy:=InitGui(Window_Number); or if InitGui(Window_Number)<>nil then; in which "Dummy" is a dummy pointer varible. As a matter of fact the returnd pointer ("Dummy") is a pointer to the opened window structure and if openning the window is succesfull then it will be unequal to Nil. I can be used for those professionals who want to handle the window themselves! currently you need not to use it. "window_Number" is constant or variable in which you have put the window number in the gui that you want to be opened. For example you put Window_Number equal to 1: ----- Sample Source code for JVP DEMO (2): ------------------------------- Program JeyVisualPascal; Uses JVP_DEMO; const Window_Number=1; Var Dummy:Ptr; begin LoadGUI(filename); Dummy:=InitGui(Window_Number); Delay(300); end. -------------------------------------------------------------------------- Now after compiling and running this program, you will see the first window of the gui opened with all gadgets initialised and ready to work! I used the delay because the window will be closed automatically and exits the program. JVP unit will automatically close all windows and unloads the gui from the memory. Thus here you need not to worry about it, but when serious programming you will be noticed that closeing the gui's is vital. Now let's give life to the gui! After initialising a gui, you should use the following generic command to get the control of it: MenuID:=Get_Gui_ID(Window_Number,ID,WaitMode,OutString,OutReal); in which: Window_Number: It is the window number under request. ID: The requested gadget identification number. (Please hold on, I will explain it more later) WaitMode: An integer which instructs the JVP how the command should be managed. It is a little long to speak here but again hold on, I will explain it more later ;) OutString: A string type variable which is provided by you, and will be filled by the Get_Gui_ID command according to the gadget type.(Hold on, I will explain more later) OutReal: A real type variable which is provided by you, and will be filled by the Get_Gui_ID command according to the gadget type.(Hold on, I will explain more later) MenuID: It is an integer which contains the pressed gadget number in the requested window. (After running the Get_Gui_ID command) I hope it look simple but if not see the example here: ----- Sample Source code for JVP DEMO (3): ------------------------------- Program JeyVisualPascal; Uses JVP_DEMO; const Window_Number=1; Var Dummy:Ptr; OutString:String; OutReal:real; MenuID:integer; begin LoadGUI(filename); Dummy:=InitGui(Window_Number); MenuID:=Get_Gui_ID(Window_Number,0,1,OutString,OutReal); Writeln('You pressed gadget #', MenuID); CloseGui(Window_Number); UnLoadGUI; end. -------------------------------------------------------------------------- Running the above program will popup your first window and will stay until you press a gadget or a key. MenuID contains the number of pressed gadget. Also note to two other new procedures: "CloseGui(Window_Number);" and "UnLoadGui". "CloseGui()" closes a gui window in whole. "UnloadGui" unloads the gui and thus after that, further call to InitGui() will fail because there is no gui loaded into memory unless you load another gui by "LoadGui()" command. Now if you set value "2" instead of "1" for the WaitMode parameter in the get_gui_id command, you will see that the window will not close until you press its close gadget or press "Esc" key. Now I think it is enough, please read the provided examples in the archive, and if you felt that you are interested, please cntact me, I will be pleased to explain more but not now because I don't know how many ppl are interested. ************************************************************************* Requirements: ------------ It should run on any amiga but I have tested only on A1200,030,4Mfast. Features: --------- I could not find the like on Aminet, if you know there is a similar software please let me know. It should run under OS 1.3+, OS2+, OS3+ and any Amiga system! Installation: ------------- Simple, only copy the contents of "S" drawer in the archive to your "S:" and add "Vajegan_Amiga.font" to your "Fonts:". Finally copy "JVP_DEMO" itself anywhere you like and run it. For the JVP unit, only copy the contents of the "unit" drawer to your pascal unit drawer. (sorry for no installation script but i think it's simple enough;) Acknowledgements: ----------------- I wish to thank god who let me to create JVP (one of my dreams) and then My sister, Parvin for her efforts to test JVP by programming with it and also designing the JVP Manager by JVP itself! How to use it: -------------- See the compact manual above. WARANTY: -------- RUN IT AT YOUR OWN RISK. Document: --------- Sorry, currently I cannot provide any full document because I need your support and idea's first to continue or not! Why and How: ------------ This software is programmed in Kick-Pascal. I am searching for pascal programmers on the Amiga, if you are or know one please contact me or give me his/her email address. About Pascal: ----------- Most people say that pascal is dead or is not good for system programing, but I don't believe that. I think pascal is better than AMOS or BASIC or some other languges which do not seem to be dead. I think pascal is oppressed just like the Amiga. Copyright matters: ------------------ (c) 1997-1999, All rights reserved for Hossein Shirdashtzadeh. If you use this software to create any commercial program, you should send me a copy of it and also acknowledge that you have used JVP. You are free to spreading this archive while the contents are intact and should not be sold or purchased by any one. Future versions of "JVP" will be a "ShareWare", if you send me enough mails for supporting it when completed, otherwise I would be sorry to quit its developement :-( Please send me a mail that indicates your interest in JVP until 01-Apr-99. Email: shirdash@www.dci.co.ir Or send me by snail to the following address: No. 132, Kerdabad, Jey st., Isfahan, Iran Zip code: 81599 or call (English or persian only!) to: +98-031-510155 Note that if I don't recieve enough requests to continue until 01-Apr-99 then I will assume that JVP is useless and quit it. ----------------------------------------------------------------------------- My sig is: ----------------------------------------------------------------------------- ______"Vajegan" is The First Intelligent PERSIAN Editor For AMIGA_________ /// __ {---[ H. Shirdashtzadeh ]--{ TT /// * TT /<>\ } Proud AMIGA Pascal Programmer } _ * _ || K *_* || \_ / { A 1200, 030/50 MHz, 2Meg Chip { ((___)) ||___\\ ___// || ___// } 4M Fast ,HD 3.2G ,19.2K Modem } \\___/__((____))_{___/___II_{___/_______{ Iran, Isfahan, Nesf-eh-Jahaun { \X//"Every wise man is powerfull"______}____ Shirdash@www.dci.co.ir ___}