ÜÛÛÛÛÛÜ ÛÛÛÛÛÛÜ ÜÛÛÛÛÛÜ ÜÛÛÛÛÛÛ ÞÛÛÝ ÜÛÛÛÛÛÜ ÜÛÛÛÛÛÜ (tm) ÛÛ ÜÜÜ ÛÛ ÛÛ ÛÛÜÜÜÛÛ ÛÛÜÜÜÜ ÛÛ ÛÛ ÛÛÜÜÜÛÛ ÛÛ ÛÛ ÛÛÛÛÛÛ ÛÛßßßÛÛ ÛÛßßßß ÛÛ ÛÛ ÛÛßßßÛÛ ßÛÛÛÛÛß ÛÛ ßÛÛ ÛÛ ÛÛ ÛÛ ÞÛÛÝ ßÛÛÛÛÛß ÛÛ ÛÛ Ver. 2.0 1.1 General Description ----------------------- Grafica(tm) is a powerfull library in Turbo Pascal. With this library you can made wonderfull graphic interfaces, like Win95, OS/2, etc. You have many Windows types, many butons types and it is very flexible. Grafica(tm) is made by Gabriel Ciobotaru, Alex Sovu and Adrian Suditu. You can reach us to: Phone: +40-1-629.54.27 (voice) FAX: +40-1-686.36.90 FidoNet: 2:530/106 E-mail: grafica@ysnet.pcnet.ro If you have questions or problems, please call us or leave us a message. In the next chapters you will find more technical details about Grafica(tm) and details about how to use. You must read this entire file for understanding how Grafica works. You will find some hot tips about programming with Grafica. Please excuse the english, my national language is not english, and I am not a writter, I am a programmer. 1.2 Order informations ---------------------- This version of Grafica(tm) is shareware. If you like this library, please register. It is the only way to support our next releases and to improve others new features. If you register you will receive: - a FULL Grafica(tm) Unit, without the shareware screen. - you will receive some more new features. - you will have access to a hot-line or E-mail List for any questions, problems or details about Grafica(tm) and programming in Grafica(tm). - you will receive ON FREE the next minor update versions, and you will have a small update price for a major version. - you will receive the SOURCE CODE from the 2DA application. - you will receive some SOURCE CODES from Grafica(tm). - more new fonts for UTIL256 unit to use with setfont procedure. - FULL documentation at MOUSE, STRINGOP and UTIL256 units with some sources. - with your support, we will develop more new features and you will benefite for this. - and more new and cool stuff. To register, please see the file register.frm. Also agents and distributors in other countries are very welcomed. Please contact us for this (please see the beginning of this document). If you want to receive the FULL source codes from ALL Grafica units, please ask for the price. 2. GRAFICA TECHNICAL DETAILS ---------------------------- 2.1 Mode of use and initialisation. ----------------------------------- First you must use this TPU libraries. The base units are: stringop,grafica,g_applic,util256,mouse; This you can add graph, dos, crt or any TPU. The Grafica unit is an OOP application. The name of the main object is g_application. For a small applicaton you must use this source for any Grafica application: === Begin of source code === uses stringop,grafica,g_applic,util256,mouse type adapplic=object(g_application) {here you can insert virtual procedures, like backgound or any other stuff} end; var w : adapplic ; begin w.init; {init of grafica} {your programm} w.done; {when your program is finnished] end. === End of source code === 2.2 Grafica's procedures and functions. --------------------------------------- NOTE! For more details and examples, please see the source code of the application TEST.EXE (TEST.PAS). Here you have almost all the procedures and functions from Grafica, and the best details about using a procedure or function is a example source code. 2.2.3 constructor init; ----------------------- This initialise the variabiles and check for mouse, Sound Blaster (if enabled), memory, etc. It initilise the graph mode, load the background (if is defined), play the startup sound (if sound is enabled), and finnaly show the mouse cursor. 2.2.4 procedure initgrafic; --------------------------- Normally, this is for use internal of Grafica, but you can use this procedure for your own Graph initialisation. This procedure initialize the 640x480x16 graph mode and by default it include in EXE the graphic driver and the font characters. Grafica use its own font characters, something like default, but with some Turbo Pascal fixed bugs. Also this characters are a bit different from Pascal's Default font. The name of Graph driver must be "egavgaproc" and the fonts name must be "littproc" and "os2f8x5proc". 2.2.5 procedure ini_paleta; virtual; ------------------------------------ This procedure inits the Grafica Palette. This is a virtual procedure, so you can use your own defined colors. 2.2.6 procedure initpaleta; --------------------------- This procedure sets the default Grafica palette (gray). 2.2.7 procedure incl; --------------------- This procedure includes the Graph driver (EGAVGA) the the fonts. Please see chapter 2.2.4. 2.2.8 procedure background; virtual; ------------------------------------ This procedure sets the background. By default, there is no background. The background color is black. You can define your own background procedures, with images or an color. (note that this procedure is virtual). 2.2.9 procedure playsound(st:string); ------------------------------------- This procedure plays a sound file (if sound is enabled). The variable st is the name of the file. Thie sound format of this file is RPD. In this packet it is included a conversion program from WAV/VOC to RPD. Example: playsound('c:\util\sounds\cool.rpd'); 2.2.10 procedure refwins(x,y:integer); -------------------------------------- This procedure refresh the open windows, and the last one is moved to the x and y coordonates. You can use the variable "stay" if you wand only a refresh and not to move the windows to a desired location (Ex: "refwins(stay,stay"). Or you can move at a location only one axis. The other position will stay in the same place (Ex: "refwins(152,stay)"). 2.2.11 procedure setbuton(nr:word;k:boolean); --------------------------------------------- Set active or inactive state of a button. nr means the number of the button from the current object. if k is true, the button is active, else it is inactive. 2.2.12 procedure buton(x1,y1,x2,y2:integer; tip:word; s:string; sc,enable:boolean); --------------------------------------------------------------- WARNING!!! This procedure will only DRAW a button and will not be stored in the pointers link. This procedure is designed for use internal of grafica, but for a more flexibility, you can use this, for example in a non movable windows. Use procedure "newbut" for putting a button in an object (ex: in a window). x1,y1 - means the left up corner of the button. x2,y2 - means the right down corner of the button. tip - means the type of the button (you have 11 different types of buttons from 0 to 10). s - the text string that should be printed on the button. sc - if is false, the space of the button will be out the coordonates. enable- if is true, the button is enable (you can push-it), else is disabled. 2.2.13 procedure linie(x1,y1,x2,y2:integer; col,tip:byte; stare: boolean); -------------------------------------------------------------------------- This procedure DRAW a line (like 3D). WARNING!!! This only draw a line and it is used internal of grafica. x1,y1,x2,y2 - are the coordonates of the line. col - means the color number of the line. tip - means the type of the line: 1 for simple line 2 for a complex and nice line (any directions). stare - is only for the type 2 of the line. This means that the line must be IN or OUT of the surface. 2.2.14 procedure input_proc(x1,y1,x2,y2: integer; var st: string); ------------------------------------------------------------------ This is the procedure for the input process. This will only input a string from the keyboard. If you want to add an input field into a window or object, use procedure newinput. This is supposed to be used internal of grafica. x1,y1,x2,y2 - the coordonates of the input box. st - the string that should be printed before the input process begins. Also in this variable, the procedure will return the input string entered by the user from the keyboard. 2.2.15 procedure input_draw(x1,y1,x2,y2: integer; st:string); ------------------------------------------------------------- This procedure will refresh the input process with the typed string. It is designed for internal of Grafica, but you can use this procedure for your own advanced application. The parameters are the same like input_proc procedure. (see 2.2.14). 2.2.16 function get_input(nr: byte): string; --------------------------------------------- This function must be used after newinput procedure. This will return the string entered by the user in a input field from an object (windows, etc) nr - the number of the input field (in the order of newinput procedure, from the currend object/window). 2.2.17 procedure fill(x1,y1,x2,y2: integer; col,tip:byte); ---------------------------------------------------------- This procedure generates a fill (ONLY WILL DRAW, but will not be stored into the object or window link). x1,y1,x2,y2 - the coordonates of the fill box. col - the fill color. tip - the pattern. 2.2.18 procedure procent(x1,y1,x2,y2:integer;pr,color:byte); ------------------------------------------------------------ This procedure will DRAW (WARNING !!! Only draw). a procentage field. x1,y1,x2,y2 - the coordonates for the procentage bar. color - the color of the bar. pr - the procents that must be show (from 0 to 100). 2.2.19 procedure sterge_procent; -------------------------------- This procedure will erase the procent bar. 2.2.20 procedure check(x1,y1:integer;text:string;tp:byte;ok:boolean); --------------------------------------------------------------------- This procedure will DRAW (WARNING !!! Only draw) a check button. Use newcheck for linking a check button into a object or a window. x1,y1 - the coordonates. text - the text string that must be printed after the check button. The hot key will be between two ~. tp - the type of the check button. (from 1 to 3). ok - if is true, the check button will be set, else will not be set. 2.2.21 procedure tex(x,y:integer;text:string;enable:boolean); ------------------------------------------------------------- This procedure will print a text string. x,y - the coordonates. text - the text string. enable - the writting mode of the text. 2.2.22 procedure bitmap(x,y:integer;p:pointer); ----------------------------------------------- This procedure will show a image at x,y coordonates. p is the pointer to the image. 2.2.23 procedure afisbmp(x,y:integer); -------------------------------------- This procedure will show the image stored with the procedure newbmp. This should be used only internal of grafica, but we make a public procedure for advanced applications. 2.2.24 procedure window(x1,y1,x2,y2:integer;nume:string); --------------------------------------------------------- This procedure will DRAW (WARNING !!! Only draw) a window. x1,y1,x2,y2 - the coordonates. nume - the window header text. 2.2.25 procedure nonnume(x1,y1,x2,y2:integer); ---------------------------------------------- This procedure will DRAW a window without the header (nonmovable window). 2.2.26 procedure btin(x1,y1,x2,y2:integer;s:string;c1,c2:byte; tip:boolean); ---------------------------------------------------------------------------- This procedure will DRAW a button with a text. x1,y1,y2,y2 - the coordonates s - the text c1,c2 - the colors of the text and the hot chars. tip - the type of the button. (In or Out). 2.2.27 procedure btin1(x1,y1,x2,y2:integer;s:string;c1,c2:byte; tip:boolean); ----------------------------------------------------------------------------- The same like btin procedure, but a different style. (see 2.2.26). 2.2.28 procedure btin2(x1,y1,x2,y2,d1x,d1y:integer;s:string;c1,c2,dp:byte; tip,enable: boolean); -------------------------------------------------------------------------- DRAW a button, but this is a more flexible procedure. x1,y1,x2,y2 - the coordonates. d1x,d1y - the deep show. s - the string that should be printed on the button. c1,c2 - the colors (see 2.2.26) dp - the push deep of the button tip - if the button will be in or out. enable - if the button will be enable. 2.2.29 procedure chenar(x1,y1,x2,y2:integer); --------------------------------------------- This procedure will draw a box. 2.2.30 procedure chenar1(x1,y1,x2,y2,col:integer; stare: boolean); ------------------------------------------------------------------ This procedure will draw a box with a specified color like one arround a button. x1,y1,x2,y2 - the coordonates. col - the color. stare - if can be pushed or not. 2.2.31 procedure chenar2(x1,y1,x2,y2:integer; stare: boolean); -------------------------------------------------------------- The same like procedure chenar1, but without color set. (see 2.2.30). 2.2.32 procedure chenar3(x1,y1,x2,y2:integer; dp:word); ------------------------------------------------------- This procedure will draw a box like one arround the windows. x1,y1,x2,y2 - the coordonates. dp - the deep of the box. 2.2.33 procedure chenar4(x,y,r:integer; bo: boolean); ----------------------------------------------------- This will draw a round button. x,y - the coordonates r - the radius bo - if will be checked. 2.2.34 procedure writetext(x1,y1:integer;text:string;sc:boolean;cc:byte); ------------------------------------------------------------------------- This procedure will write a text string. x1,y1 - the coordonates text - the text string. sc - if the text will be printed in or out. cc - the color of the text. 2.2.35 procedure interp(s: string; var c: char); ------------------------------------------------ This procedure is designed for use internal of Grafica, but you can use this for your own application. This procedure will return in variable "c" the hot char from a string. Ex: if the string is 'You ~a~re the best', the hot char will be 'a', the first char between ~. s - the string. c - the char returned. 2.2.36 procedure refwin(x,y:integer); ------------------------------------- This procedure will refresh ALL opened windows (windows made with the procedure newwin. x,y - the coordonates where should be placed the last window. 2.2.39 procedure newwin(x1,y1,x2,y2:integer;nume:string;antet:boolean); ----------------------------------------------------------------------- This procedure ADD a new window into the desktop. This will be aded to the pointer link of the windows. This Window will be stored, so you can move-it (with the mouse), cleaned or you can add more object into this window (buttons, lines, fills, input fields, texts, check buttons, etc..). x1,y1,x2,y2 - the coordonates of the window. nume - the text that will be prinded on the window header. antet - if the window will have a header (this means that will be (or not) a movable window). 2.2.40 procedure newbut(x1,y1,x2,y2:integer;nume:string; tip:word; behav:boolean; hotchar:strs); ------------------------------------------------------------------ This procedure will ADD a button into the current Window. This will draw a button, and will store into a pointer link all the informations about this button. x1,y1,x2,y2 - the coordonates of the button. nume - the text that will be printed on the button. tip - the type of the button. You have 11 types of buttons (from 0 to 10). behav - how the buttons will push. hotchar - This is the seccond hot char. The first hot char must be in the text printed on the button. This first hot char will be between the ~ sign. Ex. if in nume variable you will place "Push to ~Q~uit", the Q char will be printed with a hot color (red) and when the user will press Q, the button will push. The seccond hotchar you can set #13 (the ENTER key), and the user if will push Q (or q) or ENTER key the button will push. 2.2.41 procedure newline(x1,y1,x2,y2:integer;col,tip:byte; prs:boolean); ------------------------------------------------------------------------ This procedure will add and draw a new line into the current Window. All the informations will be stored. x1,y1,x2,y2 - the coordonates. col - the line color. tip - the type of the line (1 or 2) prs - it is only for the type 2, for in or out. For more details, please see linie procedure at 2.2.13. 2.2.42 procedure newfill(x1,y1,x2,y2: integer; col,tip:byte); ------------------------------------------------------------- This procedure will ADD and DRAW a new fill into the current window. All the informations will be stored. x1,y1,x2,y2 - the coordonates. col - the fill color. tip - the fill pattern. 2.2.43 procedure newinput(x1,y1,x2,y2: integer; stri: string; hot:char); ------------------------------------------------------------------------ This procedure will ADD and DRAW a input field into the current window. All the informations will be stored. x1,y1,x2,y2 - the coordonates. stri - the string that will be already printed in the input field. hot - the hot char for the input field. When this char is pressed, the input process will be activated. Or else, you can go with the mouse pointer on input box. 2.2.44 procedure newtext(x,y:integer;text:string); -------------------------------------------------- This procedure will ADD and print a text into the current window. All the informations will be stored. x,y - the coordonates. text - the text string. 2.2.45 procedure newbmap(x,y:integer;p:pointer;m:word); ------------------------------------------------------- This procedure will add a new bitmap into the current window. All informations will be stored. x,y - the coordonates. p - the pointer to the image. m - the size of the image. 2.2.46 procedure newbmp(x1,y1,x2,y2:integer); --------------------------------------------- This procedure will GET and will ADD the image into the current window. All informations will be stored. x1,y1,x2,y2 - the coordonates where will get the image. 2.2.47 procedure newchenar(x1,y1,x2,y2: integer; col,tip:byte;stare:boolean); ----------------------------------------------------------------------------- This procedure will add and draw a new box into the current window. All informations will be stored. x1,y1,x2,y2 - the coordonates. col - the color. tip - the type of the box (1 to 3) 1 for simple box 2 for complex box 3 the box will be printed with the color specified in col variable. stare - only for 1 and 2 box type. Means that the box will be in or out 2.2.48 procedure newcheck(x1,y1:integer;text:string;tp:byte;ok:boolean); ------------------------------------------------------------------------ This procedure will ADD and draw a new check button into the current window All informations will be stored. x1,y1 - the coordonates. text - the text that will be printed befor the check button. tp - the type of the check button (from 1 to 3). ok - if the check button will be on or off. 2.2.49 procedure newtracker(x1,y1,x2,min,max,cur: integer); ----------------------------------------------------------- This procedure will ADD and DRAW a tracker bar into the current window. All informations will be stored. x1,y1 - the left upper corner of the tracker bar. x2 - the X coordonate of the right corner. min - the min value (lower). max - the max value (upper). cur - the current value that must be shown. 2.2.50 procedure newprocent(x1,y1,x2,y2:integer;proce,color:byte); ------------------------------------------------------------------ This procedure will ADD and draw a procent bar into the current window. All informations will be stored. x1,y2,x2,y2 - the coordonates. proce - the procent that will be shown by default (0 to 100). color - the bar color. 2.2.51 procedure change_procent(nr,val:byte); --------------------------------------------- This procedure will change the procent status. nr - the number of the procent bar from the current window. val - the new procent value (0 to 100). 2.2.52 function check_result(nr_check:integer):boolean; ------------------------------------------------------- This function will return the check button state (on or off). nr_check - the number of the check button from the current window. Will return true if the button is checked or false if the button is not checked. 2.2.53 procedure clrwin(no:integer); ------------------------------------ This procedure will clear all the informations about the objects from a window, and the window itself. no - the number of the window that will be erased (closed). 2.2.54 procedure explode(x1,y1,x2,y2,n:integer); ------------------------------------------------ This procedure is used internal of Grafica at the open of the windows. This will explode a box. x1,y1,x2,y2 - the finnal window box coordonates. n - the number of explodes steps. 2.2.55 procedure process_coordonates; ------------------------------------- If a window is out (partial) from the screen, the window will be adjusted to meet the screen size. 2.2.56 procedure gimage; ------------------------ This procedure gets the image of the entire screen. 2.2.57 procedure eimage; ------------------------ This procedure will erase the image stored with gimage procedure. 2.2.58 procedure pimage; ------------------------ This procedure will put the image stored with gimage. 2.2.59 function mouse_pressed:boolean; -------------------------------------- This function return true if the mouse button is pressed. 2.2.60 procedure handleevent; virtual; -------------------------------------- This is the most important and amazing procedure from the Grafica. This procedure will handle all the events from the desktop. This procedure will take cere of the button push, windows moves, input field, etc. This procedure must be used afer a window is opened and after all the object are drawed and stored. When you call this procedure, its wait for a event (push of button). When it happend an event, will exit this procedure. In the "cm" variable you will have the event number (the number of the button is pressed). Please see chapter 2.3 for more details about variable. When the window is moved, input a box, or check a check button, the procedure will not exit. For more details about using this procedure, please see the source code included (TEST.PAS). 2.2.61 procedure mousenotexist; ------------------------------- This procedure will advise you that the mouse does not exists. It ask you if you want to quit. If yes, then it exit the program. 2.2.62 function grerror:boolean; -------------------------------- Will return if it is a graphic error. 2.2.63 function nocolors(s: string): string; -------------------------------------------- This function will erase the ~ sign from a string. That will cause a non color string when will be printed. s - the input string with the ~ sign. and will return the string without ~ signs. 2.2.64 function da:boolean; --------------------------- This will write a message "Do you wish to continue (Y/n)? ", and wait for the user input. If it enter Y, will be printed Yes text, and the function will return true, else false. Also for Yes user can send ENTER, or ESC for NO. The valid answers will be only Y (y) or N (N) or ENTER or ESC. 2.2.65 function inwindow:boolean; --------------------------------- If the mouse pointer is into the current window, the function will return true, else false. 2.2.66 destructor done; ----------------------- This must be used when you want to close your application. This procedure will play the shutdown sound (if sound enabled), close graph, and return to the original screen mode. 2.2.67 procedure error; ----------------------- This procedure will show a error message. (Just for fun :-) ). 2.2.68 function get_tracker(nr: byte): integer; ------------------------------------------------ This function will return the current position of a specified tracker bar. nr - the number of the tracker bar within a window. The function will return the number selected by the user. 2.2.69 procedure tracker_draw(x1,y1,x2,min,max,cur: integer; bool: boolean); ---------------------------------------------------------------------------- This procedure will DRAW (WARNING!!! Only DRAW) the trackerbar. Please see the procedure newtracker (2.2.49). This procedure is designed for use internal of Grafica, but you are free to use this for your own proposes. x1,y1,x2 - the coordonates min, max - the min (lower) and max (upper) value cur - the current value of the tracker bar bool - if bool is true will draw the entire tracker bar, else only the text and the button (for animation). 2.2.70 procedure tracker_proc(x1,y1,x2,min,max: integer; var cur: integer); --------------------------------------------------------------------------- This procedure will process and return the new selected value. This procedure is designed for use internal of Grafica, but you are free to use this for your own proposes. x1,y1,x2 - the coordonates. min,max - the min and max values. cur - the current tracker value. After processing, will return the new tracker value selected by the user. 2.3 Grafica's constants ----------------------- In this chapter you will find all the constants and variables that are needs in programming Grafica. 2.3.1 winopen ------------- The RPD sound that must be played at the open of a window. Default is: winopen:string[80]='open.rpd'; 2.3.2 winclose -------------- The RPD sound that must be played at the close of a window. Default is: winclose:string[80]='close.rpd'; 2.3.3 startgrafica ------------------ The RPD sound that must be played at the startup of Grafica. Default is: startgrafica:string[80]='start.rpd'; 2.3.4 closegrafica ------------------ The RPD sound that must be played at the shotdown of Grafica. Default is: closegrafica:string[80]='shutdown.rpd'; 2.3.5 spac ---------- Sets the border of the window (in pixels). Default is: spac:word=5; 2.3.6 fer_tip ------------- Sets the type of the window (from 0 to 6) Default is: fer_tip: word=1; 2.3.7 t_color ------------- If t_color is true, the text between ~ signs will be written with red color else (if false) the text will be underlined with the same color of the text out of ~ signs. Default is: t_color: boolean=true; 2.3.8 hi_text ------------- Sets the color of the text between ~ signs. Default is: hi_text: byte=4; 2.3.9 _paleta ------------- Sets the palette type. Default is: _paleta: byte=4; 2.3.10 _in * DO NOT CHANGE THE DEFAULT VALUE ---------- This is true. Use for buttons or text where the buttons or texts must be in. Also you can use true. 2.3.11 _out * DO NOT CHANGE THE DEFAULT VALUE ----------- This is false. Use for buttons or text where the buttons or texts must be out. Also you can use false. 2.3.12 offcol ------------- Sets the color of the text written on a disable button. The default value is: offcol:byte=11; 2.3.13 blackmouse ----------------- Set the cursor mode of the mouse. If this is true, the mouse cursor will be black, else will be white. Default is: blackmouse: boolean=true; NOTE ! Use before constructor init procedure from Grafica. 2.3.14 faranume * DO NOT CHANGE THE DEFAULT VALUE --------------- It is false, and use only for windows, when you want to make a window without the header. 2.3.15 punenume * DO NOT CHANGE THE DEFAULT VALUE --------------- It is true, and use only for windows, when you want to make a window with header. 2.3.16 clearwin --------------- If is false, it doesn't clear a window ( clrwin() ). Default is: clearwin:boolean=true; 2.3.17 realrefresh ------------------ If is true, will redraw the entire background and openned windows. If is false will but a bar at the place of window and doesn't redraw all the openned objects and background. The color of the bar is set with colbk variable. Default value is: realrefresh:boolean=true; 2.3.18 colbk ------------ Sets the background color. Default is: colbk:integer=0; 2.3.19 stay * DO NOT CHANGE THE DEFAULT VALUE ----------- If at refwin or refwins procedures, in coordonates you will specify stay, then the windows will doesn't move. Please see procedures refwin and refwins. 2.3.20 grf_mode --------------- Sets the graph mode. It is good if you don't change this value. Default: grf_mode: integer=2; 2.3.21 grf_driv --------------- Sets the graph driver. It is good if you don't change this value. Default: grf_driv: integer=9; 2.3.22 mar_che -------------- Sets the size of the check boxes in pixels. Default is: mar_che: byte=15; 2.3.23 w_exp ------------ If at the open of the window, the window will explode or not. Default is: w_exp: boolean=true; 2.3.24 nr_expl -------------- Sets the number of window explodes. Default is: nr_expl: word=10; 2.3.25 ex_delay --------------- Sets the delay between the movement of the window explode. Default is: ex_delay: word=15; 2.3.26 muta_fer --------------- If the windows will allow to be moved. Default is: muta_fer:boolean=true; 2.3.27 but_delay ---------------- Sets the delay between a button is pressed and it is released when the button is pressed by the keyboard. Default is: but_delay:word=150; 2.3.28 but_release ------------------ If is true, the buttons will be pressed and will be released. Else the button will not be pressed and released, but in the program will return that the button is pressed. Default is: but_release:boolean=true; 2.3.29 fontenable ----------------- Sets the text font which the text is written. Default is: fontenable:word=0; 2.3.30 os2 * DO NOT CHANGE THE DEFAULT VALUE ---------- If you press a button and then with the mouse button still pressed you move the pointer to another button, this button will be pressed. This is for newbut procedure when you must specify the button behav. (true or false). This value is true. 2.3.31 windoze * DO NOT CHANGE THE DEFAULT VALUE -------------- This is the reverse like os2 variable. (see 2.3.30) This value is false and the buttons will behav. like MS-Windows. 2.3.32 soundenable ------------------ If is true, the sound will be enabled, else disabled. The sound at open /close, startup/shutdown of the windows/Grafica. Default is: soundenable:boolean=false; 2.3.33 base ----------- Set the base address of your Sound Card. Base should be: 1 for Base Address 210h 2 for Base Address 220h (Default on most cards) 3 for Base Address 230h etc.. Default is: base:byte=2; 2.3.34 irq ---------- Sets the IRQ for your Sound Card. Default is: irq:byte=7; 2.3.35 dma ---------- Sets the DMA Channel for your Sound Card. Default is: dma:byte=1; 2.3.36 dmahi ------------ Sets the High DMA channel of your card (leave at 0 if no 16-bit). Default is: dmahi:byte=0; 2.3.37 memimage --------------- If is true, the image will be stored in memory, and when will be a modification, it is restored from memory. (at the move of windows, etc). This will gets some memory, but it is more faster if you have many openned windows. If is false, all the windows will be redrawed when you move a window. this will not use memory, but if you have many openned windows, will be more slower. Default is: memimage:boolean=true; 2.3.38 deep ----------- Sets the deep of the buttons in pixels. Default is: 1. 2.4 Grafica's variables ----------------------- 2.4.1 os2font -------------- Specify at font types. This will means that the program will use our own font called os2font. 2.4.2 event_x & event_y ------------------------ Mouse cursor position. 2.4.3 event_ch --------------- The last entered character. If have been pressed a function key, will set the key code after the #0 key. 2.4.4 cm -------- The last event. You will find (after handleevent procedure has been finished) the number of the button that has been pressed, starting from 2 (1 means that the user press the button from the upper left corner of a window, that means close). For more details, please see handleevent procedure (2.2.60). 2.4.5 relief ------------ If this will be set to true, all the texts will be printed in 3D, but it is more slower. Default is false. 2.4.6 ???!!! ------------ Thats all for the shareware version. In this shareware version you have many others variables and features to set, but will be undocumented. Please register and you will find all the variables. Sorry for that but we must support the registration, for developing other new features that only you will benefite. 3. G_APPLIC UNIT TECHNICAL DETAILS ---------------------------------- 3.1 General description ----------------------- In this unit are some Applications of Grafica (Viewer, File browser, Display Message, nice clock, etc.) 3.2 G_APPLIC's procedures and functions --------------------------------------- This you will find all the procedures and functions in G_APPLIC unit. 3.2.1 procedure viewer(x,y: integer; hdd,tx:string); ---------------------------------------------------- Here you have the Grafica's viewer. You can specify a text file and you can browse. You can use the cursor keys (for left, right, up, down) or some other keys (PageUp, PageDown). Or you can use the mouse to browse the file. x,y - the coordonates where the viewer's window must be placed. hdd - the header of the viewer's window. tx - the path+filename of the file that must be viewed. 3.2.2 procedure texl(x,y:integer;text:string); ---------------------------------------------- You can write a text string with littlefont. x,y - the coordonates text - the text string 3.2.3 procedure dispmsg(ant,st:string); --------------------------------------- This procedure will display a window with a message. The window will be set up with the text message and text lines. The text lines will be centred in the window. You can go to a new line with the ` char. Also this window will have a Ok button. When is pressed the window will be closed. ant - the header of the window. st - the string that must be printed in the window. You can use ` for a new like and the text between ~ char will be printed in red. 3.2.4 function browse(plx,ply: integer; s,hdr: string): string; --------------------------------------------------------------- You can browse through your files. This is a easy and nice interface. You can move the select bar with cursor keys (up/down), you can change the directory with ENTER (like Norton Commander). Also you can specify a direct path+filename, you can change the willcard. You can change the directory manually. You have OK and Cancel buttons, and .. and \ buttons for a fast change directory (.. for .. dir. and \ for root dir.). You can move this browse window. You have the file attributes, the size, date and time. plx,ply - the coordonates of the browse window. s - the files that must be displayed (willcard accepted (*.*, etc..) ). hdr - the header of the window. The function will return the full path+filename of the selected file. If the user press Cancel button, will return ''. 3.2.5 procedure clock(x1,y1,x2,y2: integer; name: string); ---------------------------------------------------------- This procedure will display a nice analog clock that will running. You can specify ANY sizes. x1,y1,x2,y2 - the left upper corner and the right down corner of the clock. name - the header of the clock window. 4. STRINGOP UNIT TECHNICAL DETAILS ---------------------------------- 4.1 General Description ----------------------- This unit operates with strings, make modifications, transformations, etc. 4.2 STRINGOP's functions ------------------------ This is described the functions of STRINGOP UNIT. 4.2.1 function hexwordstr(by: word): string ; --------------------------------------------- Transform a word number into a hex number. The result will be a string. 4.2.2 function lowercases(s: string): string ; ---------------------------------------------- Transform a string into lowercases. All the characters will be with lowercases. 4.2.3 function hmssstring(o,m,se,su: word): string ; ---------------------------------------------------- Transfor the time stamp into a string. o - the hour. m - the minutes. se - the secconds. su - hundredths of seconds. 4.2.4 function real2str(i:real): string ; ----------------------------------------- This function transform a real variable into a string. 4.2.5 ???!!!!???xxxx -------------------- There are more new and cool functions that operates with strings/numbers, etc to make your life easyer. Please register and you will have the description of this functions. 5. UTIL256 UNIT TECHNICAL DETAILS --------------------------------- 5.1 General description ----------------------- This unit have many utilities for 256 colors video modes. 5.2 UTIL256's functions and procedures -------------------------------------- Here you can find technical details about how to use the util256's functions and procedures. 5.2.1 procedure SetPal(col,r,g,b: byte); ---------------------------------------- Set the palette from a specified color. col - the number of the color r,g,b - the RGB value (red green blue). 5.2.2 procedure SetAllPal(pal: palette256); ------------------------------------------- This procedure sets the entire palette. Pal variable must be palette256 structure. This means that pal must have the follwing structure: type palette256 = array[0..255] of record r,g,b : byte; end; From 0 to 255 are the colors, and r,g,b the RGB values. 5.2.3 procedure GetAllPal(var pal: palette256); ----------------------------------------------- This procedure return the current palette. 5.2.4 procedure FadeUp(pal: palette256; del: word); --------------------------------------------------- This procedure fadeup the entire screen (palette). It starts from 0,0,0 (all screen black) to the palette specified in pal variable. del - the delay from the fade steps. 5.2.5 procedure FadeDown(pal: palette256; del: word); ----------------------------------------------------- This procdure fadedown the entire screen (palette). It starts from the palette color to all 0 (black screen). The variables are the same like fadeup procedure (5.2.4). 5.2.6 procedure Fade(pal,pal3: palette256; nr,del: word); --------------------------------------------------------- Fade from one palette to another palette. pal - the starting palette. pal3 - the final palette. nr - the number of fades (step) del - the delay between fades. 5.2.7 procedure ClearPal(var pal: palette256; rr,gg,bb: byte); -------------------------------------------------------------- This procedure sets the entire palette to a color. pal - the palette. rr,gg,bb - the RGB value of the color. All the palette will have the same color. 5.2.8 procedure init320x200; ---------------------------- This procedure inits the 320x200x256 video mode. 5.2.9 procedure WaitRetrace; ---------------------------- This procedure waits for the video card for finish the fade or operations. 5.2.10 procedure _putpixel(x,y,col:word); ----------------------------------------- This procedure put a pixel into a 256 mode display. x,y - the coordonates of the pixel. col - the color. 5.2.11 procedure _bar(px1,py1,px2,py2: integer; col: byte); ----------------------------------------------------------- This procedure will draw a bar with a specified color. px1,py1,px2,py2 - the bar coordonates col - the bar color. 5.2.12 procedure _line(x1,y1,x2,y2,col:integer); ------------------------------------------------ This procedure draws a line. x1,y1,x2,y2 - the coordonates. col - the line color. 5.2.13 procedure LoadMemFont; ----------------------------- This procedure load the current font into memory. 5.2.14 function LoadFont(name: string; var poi:pointer): integer; ------------------------------------------------------------------ This functions load a font. (The files with .fnt extensions). name - the filename of the font. poi - the returned pointer of the font. This functions return 0 if OK, else if error. 5.2.15 procedure registerfont(fon: pointer); -------------------------------------------- This procdure will register the font, and the new font will be activated. fon - the font pointer returned by loadfont procedure. 5.2.16 procedure printxy256(x,y: integer; col,m: word; sr: string); ------------------------------------------------------------------- Print a text to the x,y coordonates. x,y - the text coordonates. col - the text color. m - the text background color. sr - the text string. 5.2.17 ???xxx????!!!!! ---------------------- That's all for a shareware version. Please register and you will get more new & professional documented features. Note that almost all of this procedures are written in assembler for a faster speed. 6. MOUSE UNIT TECHNICAL DETAILS ------------------------------- This should be the technical details for the mouse unit, but this is a shareware version, and the registered user must have more, more advantages. Here you will have ALL the necesary tools for mouse like cursor definitions, (you have a lots of cursor images allready definited), informations about mouse, sensitivity, visual page, position, mouse state, and more, more mouse functions that will make your life much much easyer,.... if you register (and mine, of course).