This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
0. Organizing your working desktop0.1 Installing the software .0.2 Required tools .0.3 Dos coding and Windows testing .
1. The components of a Windows application1.1 The business-application point of view .1.2 The main window .1.3 The PullDown Menu .1.4 The ButtonBar .1.5 The MessageBar .1.6 Dialog Boxes .1.7 Controls management .
2. Resources Management2.1 What are resources ? .2.2 EXE resources vs. DLL resources .2.3 Multimedia applications .
3. DataBases Management3.1 Reusing all your MsDos designs .3.2 Using FiveWin DataBase objects .3.3 DataBases and Non-Modal programming .3.4 Network programming .
4. Browses Management4.1 FiveWin own TWBrowse class .4.2 Placing browses in resources .4.3 Using FiveWin indexed filters ( SELECT clause ) .4.4 Drawing bitmaps inside browses .4.5 Browsing arrays .4.6 Browsing everything you want .
5. Printing5.1 Basic concepts about printing in Windows .5.2 Quick printing techniques! .5.3 Managing the printer as an object .5.4 Managing the FiveWin Report engine - I .5.5 Managing the FiveWin Report engine - II .5.6 Mixing graphics and text .5.7 Previewing your print-works .
6. Debugging6.1 Using the FiveWin debugger .6.2 Debugging techniques .6.3 Low level debugging techniques .
7. Documenting7.1 Developing Windows Help files .7.2 Managing HLP files from your applications .
8. Windows advanced8.1 Managing DLLs - Dynamic Link libraries .8.2 Managing DDE - Dynamic Data Exchange .8.3 Managing MAPI - Mail services .8.4 Managing ODBC - Open DataBase Connectivity and SQL .8.5 Managing VBXs - Visual Basic Control files .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
9. Object Oriented Programming in FiveWin9.1 FiveWin architecture .9.2 Classes and Objects .9.3 FiveWin and Windows API relationship .9.4 Developing business OOPS-based applications .
10. Distributing your applications10.1 Developing an installation program .
11. InterNet development11.1 Developing IntraNet/InterNet applications with FiveWin .
2.1 What are resources ?--------------------------------------------------------------------------------
Resources are one of the most important parts of Windows programming.To understand them you should consider that your program can bedivided in two parts:
- What the program does -behaviors-- The different pieces used to build the program -Data-
Once again we are talking about Object Oriented Programming. Obviously,both parts are highly dependant upon each other.
Some of the pieces used to build your program may be stored in aseparate .DLL file or even inside the EXE file. Thosepieces, let's call them resources, can be managed and changedexternally from the program. This is probably the most importantreason for the birth of what is called "Visual Programming".
"Visual Programming" is mainly about resources. The programmer maydraw resources using the mouse and certain design programs. In thenext stage, those resources get related to some behaviors. From thatmoment you are building, and using, Objects!
FiveWin has been designed to obtain high performance from Windowsresources. FiveWin proposes a way of programming based on resourceusage. We are convinced that drawing screens and other resourcesis the easiest and quickest way to develop a program. Thanks to thistechnology you can easily build 'Data-driven' programs. This means thatyour user interface is based on external and modifiable data. You caneasily modify a screen and use it without having to recompile or relink.
The most important part of this process is to understand how to buildan Object from a resource, and how to define -redefine- itsbehaviors. There are three main ways to build an Object in xBase:
1. @ nRow, nCol ...
This kind of construction builds an Object and displays it.When you do, @ ... GET ... you are building a GET Objectwith Clipper, and you also display it.
This way of building Objects is not based on resources.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
This is the main way of building an Object in xBase. The Objectis created, but it is not shown. To display it and activate it,you do:
ACTIVATE <ObjectClass> <ObjectName>
This system was proposed and used by dBase IV, and it isgoing to be the most important way to build Objects in xBase.This system it is also not based on resources.
3. REDEFINE <ObjectClass> <ObjectName> ID <Identifier>
In this case you are using resources. The Object is alreadycreated in the resource, but you need a way to modify and defineits behaviors. This is why the REDEFINE command is going to bethe most important command to modify behaviors in xBase.
Once you have redefined its behaviors, the Object will be activatedusing the command:
ACTIVATE <ObjectClass> <ObjectName>
In many cases the Objects are contained by a 'container' Object.This would be the case of a Window or a Dialog Box which containscertain controls. To activate those controls it is not necessaryto use the command ACTIVATE ... for each of them. It is enough toACTIVATE the container Object.
Lets review now, step by step, the process you should followto use resources in your programs:
1. You need a resource designer. We like to use Borland'sResource WorkShop. This designer comes with Borland's productsfor Windows, such as C++ and Turbo Pascal. You should contactBorland or a software distributor and get one! You'll thank us!
2. Using that designer you may start drawing the different screensof your program. This is a standard system for Windows programming.The screens you design must be stored inside a DLL. In the\FiveWin\DLL directory there is an 'empty' DLL you may use to storeyour screens in. (make a copy for every new project). You should tellthe resource editor to 'open' and use that DLL. Select open fileand type the name of that DLL.
3. When you design your screens you should give a name to each of them.This name will let you select them from inside your program. You shouldspecify a unique identifier, a number, for each element of a screen.This number will be used by the REDEFINE command to tell FiveWin whichObject you are using.
Practice with your resource editor to understand it and to becomefamiliar with its usage.
After that, from inside your program you should tell FiveWin thatyour program is going to use resources. To do this, use thefollowing command at the beginning of your program:
#include 'FiveWin.ch'
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
And when you are about to end the execution of your program, youshould tell FiveWin that you have finished using them:
SET RESOURCE TO // Release the resource
To use any of the Dialog Boxes you have defined in your DLL all youhave to do is the following:
function TestDialogBox()
local oDlglocal cName := "FiveWin"
DEFINE DIALOG oDlg NAME "MyDialog"
REDEFINE GET ID 110 VAR cName OF oDlg
REDEFINE BUTTON ID 120 OF oDlg ACTION nMsgBox( "Hello" )REDEFINE BUTTON ID 130 OF oDlg ACTION oDlg:End()
ACTIVATE DIALOG oDlg
return
In this example we are building a Dialog Box from the screen "MyDialog"stored inside the DLL we have specified in a SET RESOURCES TO "MyDLL.dll"earlier in the program.
In that screen there is a GET Object and two PushButtons (CommandButtons). From the resource editor we have assigned a value of 110 to theGET control and 120 to the first button and 130 to the second.
Every kind of control will have certain extensions typical to thiscommand. As an example, BUTTON has the clause ACTION to let usspecify what the Object will do when the button is pressed.
Review the source code of \EXAMPLES\FwBorl.prg where you will find severalexamples of using resources from DLLs.
When you get used to this system you will understand that it is theeasiest and quickest way of building programs.
2.2 EXE resources vs. DLL resources--------------------------------------------------------------------------------
There are two main ways to store the resources of your applications:
1.- Inside your .EXE file2.- Inside an external DLL
Both systems are very powerful, but there are some importantdifferences you should know:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
1.- The biggest benefit of storing an .RC file (using Microsoftresource compiler RC.EXE -included with Microsoft, Borland, Symantec...-)is that you may use DEFINEs as a replacement for the controls IDs.
This means you don't have to remember 'strange' numbers, and alsothat under any source code or resources modification you willmake fewer mistakes.
Sample:
REDEFINE GET cName ID 110 OF oDlg // using an ID number 110
Instead of that:
#define ID_NAME 110
REDEFINE GET cName ID ID_NAME OF oDlg
This one has the benefit that you may create a .CH file with allthose #define's and the resource editor let you use it when modifyingthe .RC file:
MyApp.RC
#include "WinApi.ch" // provided with FiveWin#include "MyApp.ch" // your IDs definitions are here !!!
Clients DIALOG ...CONTROL ... ID_NAME,
Based on our experience we do recommend storing a .RC file inside your.EXEs because it is much easier to control IDs and avoid errors.
The SAMPLES\Build.bat batch file we provide with FiveWin, automaticallywill call RC.EXE if detects a file with extension .RC with the samename of our application. Basically what we do in build.bat is:
RC -K MyApp
This will store MyApp.RC resources inside your MyApp.EXE file.
There is no need to specify a command SET RESOURCES TO ... in yourapplication if you take this route, because your EXE file alreadyknows how to locate the resources inside itself.
The only disadvantage of this system is that every time you build yourEXE you have to compile the RC and place it inside the EXE again -thoughthis process is extremely fast!-
2.- The big benefit of storing resources inside a DLL is thatyou may really have Data Driven DialogBoxes, because if you modifythe DLL resources (using your resource editor) there will be noneed to recompile again your EXE! This may be a great advantagewhen developing very large applications.
We provide an empty DLL to be copied when you develop a new applicationas an empty storage system where you may place all your resources:
COPY screens.dll MyApp.dll // we provide an 'empty' screens.dll
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
And you are ready to start using your resources. Remember that if youdecide to put your resources inside your app (using .RC and RC.EXE)there is no need to specify SET RESOURCES TO... as the .EXE alreadyhas all them inside.
The great disadvantage of this system is that you are not allowedto use labels if you use a DLL to store resources ! Neither Borlandresource editor nor Microsoft let you use a .CH or .H file whereyou may store your #define's if you store your resources inside a DLL.
Both systems are excellent, and we do recommend you to test both ofthem and decide by yourself which system suits better your needs.
Multimedia applications typically refers to applications that extensivelyuse sound and vision to interact with the final user. But, in fact, amultimedia application may use more ways to get a better interaction withthe final user mainly using new external devices controlled by theapplication, such as touch screens, electric pens, plastic card readers,fax-modems, voice recorders, artificial vision, etc...
FiveWin offers all the necessary extensions to develop sophisticatedmultimedia applications. Here we are going to see how to use sound, visionand how to manipulate any external device we may find useful. Also,we are going to explain some techniques that conveniently used will let usmake our applications look like any Multimedia app we may have seen.
Sound: There are two principal ways to reproduce sounds in our apps:Playing a WAV file and playing a MDI file.
WAV files are digital recordings of sounds. A WAV file it may be a personvoice, a song, noises, etc... We have the following functions to reproducethem:
* SndPlaySound( <cFileName>, <nMode> ) --> <lSuccess>Plays a WAV file from disk.(see Functions2 section SndPlaySound() full explanation)
* MsgSound() which it is exactly as the above SndPlaySound()Plays a WAV file from disk.but using the FiveWin Msg... functions style.
* SndPlayRes( <cResName>, <nMode> ) --> <lSuccess>Plays a WAV file from resources.(see Functions2 section SndPlaySound() full explanation)
Vision: There are two principal ways to display images in our apps:Managing Bitmaps BMP files and reproducing animated Video files.
BMP bitmaps files are the way Windows uses to store digital pictures andlater show them again at the screen or at the printer. You may store
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
your digital images at any other file format (using some convenientDLLs libraries) but later they will be turned into Bitmaps as Windowsis the only way that knows to manipulate them. We have the followingbitmaps support:
* Class TBitmap: Controls that show a related bitmap file.
* Class TBtnBmp: Controls that show one or two bitmap files,and that behaves like a PushButton, thus the user may clickthem and perform an action.
* Functions to dynamically load and display a bitmap:
(see Functions2 section PalBmpDraw() full explanation)
DeleteObject( <hBitmap> ) (for LoadBitmap(), for a TBitmap objectsee TBitmap METHOD End() )(see Functions1 section DeleteObject() full explanation)
AVI Animated video files is the way Windows stored a sequence of bitmapsmixed with audio (recorded from a video camera, cartoons, etc...). FiveWinimplements the Class TVideo to easily reproduce them. (See Class TVideofull explanation).
Windows has a powerful subsystem named MCI (Media Control Interface) thatlets you easily access to any kind of device which it is MCI compatible.The first thing you should do when studying a new device to manipulate isto check if it is MCI compatible. FiveWin implements the Class TMCI toeasily manage any kind of MCI compatible device (See Class TMCI fullexplanation).
To finally make your application look in a unique way (the final userwill not recognize that he is using a Windows application) there are someeasy techniques that could be used. You can easily avoid using a framein your main window, so there will not be a visible caption and typicalWindows small pushbuttons on the corners. Basically this can be donedoing:
DEFINE WINDOW oWnd STYLE nOr( WS_POPUP, WS_VISIBLE ) COLOR ...
ACTIVATE WINDOW oWnd MAXIMIZED ;ON PAINT ... (you could draw a full Bitmap on the window surface,
you could fill it with certain drawing effects, etc...)
See SAMPLES\Install.prg for a working sample of this technique of avoidingdisplay the window frame and related buttons.
Multimedia applications open a wide range of possibilities where onlyyour imagination and your Windows expertise are the limits. Once you startpractising with these concepts you will easily recognize these elementson most existing Multimedia applications, and you will start incorporatingthem in your own FiveWin apps.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
3.1 Reusing all your MsDos designs--------------------------------------------------------------------------------
FiveWin imposes no restriction at all to your current DataBase designsand techniques acquired in MsDos. You may feel free to continueworking as you normally do with DataBases.
There are just some points you should keep in mind for a betterunderstanding of Windows processes:
1.- By default any Windows task is given a maximum of 20 filesopened at the same time. In order to have the same conditions as wehave in MsDos you have to use the SetHandleCount() function thatFiveWin supplies:
If your application is going to manage 40 files at the same time, youwill have to do at the beginning of your application:
SetHandleCount( 40 )
Remember that DBFs that use memos also open an associated file DBT, andalso remember that normally when Windows is printing it opens sometemporary files (also FiveWin opens some more when doing PREVIEWs ofprinting works). If you get an error it may be that there are notenough files available. Increase its number with SetHandleCount().There is a maximum of 255 files available per application.
Also it is not a good idea to give 255 files to all your applicationsfor you will consume a lot of memory resources!
2.- If you are working with NonModal designs, the same DataBase mayget opened several times at the same time! By the same user! Clipperallows this but, in fact, your application is acting like an applicationfor a NetWork. You have to provide Multi-User control to your application!
For this, if you are using Windows 3.1 loading SHARE.EXE before loadingWindows, this is a MUST! If you are using Windows 3.11 or Windows 95(pre-releases versions) this is no needed as these new versionsautomatically load SHARE.EXE when starting.
Converting an application for working in a NetWork is quite easy.Review this documentation for our recommendations and guidance forNetWork programming. Don't worry if you have never code a multi-userapplication. It is really easy!
3.- FiveWin offers you a powerful DataBase Class that in fact savesyou a lot of tedious work. Just give a little of your time to understandthe FiveWin DataBase Class and you will save a lot of your precioustime!
DataBase objects saves you from coding a _lot_ of source code lines!Go for DataBase objects right now!
4.- If you are working with older versions of CA-Clipper (older than5.2 d) you may have serious troubles working with some CA-ClipperRDDs. Some of them cause big problems in MsDos but in Windows theymay crash your system. DbfCdx is not working properly even in version
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
5.2 d. There is a late patch for 5.2 d but we have not tested it yet,since we work most of the time, with Comix and SixDriver.
We do recommend working with compound indexes CDX as they save a lotof work. Get Comix or SixDriver and use them! They are excellent!
3.2 Using FiveWin DataBase objects--------------------------------------------------------------------------------
FiveWin DataBase objects have been designed with the purpose of reducingthe size of your code when you have to manipulate a DBF. They simplify verymuch all the work required to work with DataBases and they are totallycompatible with the standard way of manipulating DBFs in Clipper.
1. What is a DataBase Object ?
A DataBase object works mainly as a buffer, where you manipulate theData, and lately you save it to the real DBF.
2. How do I create a DataBase object ?
After you do the typical USE <cDbfName> ALIAS ..., then following thissentence you write:
local oDbf
USE <cDbfName> [ ALIAS ... INDEX ... ... ]
DATABASE oDbf
FiveWin will create automatically a DataBase object and will keep itsreference inside the oDbf variable.
The DataBase object will have as DATA the name of the fields of yourDBF. Sample:
USE Customer // Customer has a field called "First"DATABASE oDbf
oDbf:Load() // Loads values from the real DBF
MsgInfo( oDbf:First ) // There is a DATA "First" there,// ready to be used!
3. Why a FiveWin DataBase object reduces my code ?
Traditionally all Clipper programmers need to declare and use LOCALvariables as buffers where they manipulate the DBF values, and laterthey save the contents to the real DBF. This is a must if you arecoding for NetWorking, as you can not manipulate the fields directlywhen you are sharing a DataBase (you have to lock, replace and thenunlock).
Another alternative used by Clipper programmers is to use an arrayas a buffer, where they load the initial DBF values, then they aremanipulated and later they are saved to disk. Normally those operationsare named Scatter() and Gather(). The disadvantage of using arraysis that you can not use your fields names directly, instead you haveto define labels (#defines) with the risk of altering those sequencesand generating errors.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
FiveWin DataBase objects solve those problems totally, as you nolonger need to declare local variables one for each field. You justneed to declare one local variable for holding the DataBase Object.
In fact, the DataBase object keeps internally an array, in the sameway as you would use an array for a buffer, but with the benefit thatnow you can use the names of the fields to manipulate each field!
4. What cautions may I have when using DataBase objects ?
Clipper restricts symbols names up to 10 characters length, so youcan not use fields names with 10 characters, as in Clipper OOPSwhen you are assigning a DATA, Clipper internally places an underscoreat the beginning of the DATA name:
// ABCDEFGHIJ ==> Your field name
MsgInfo( oDbf:Abcdefghij ) // Will work fine!
oDbf:Abcdefghij = ... // Will not work!// as Clipper will do:// oDbf:_Abcdefghij// so exceeding 10 characters
Remember: If you are going to use FiveWin DataBase objects thenyou can not use fields with names longer than 9 characters !!!
5. Where can I find a working sample ?
Look at SAMPLES\Dbf01.prg for a working sample using a FiveWinDataBase object.
Enjoy DataBase objects, they are extremely powerful and saves youfrom a lot of work! And they are 100% compatible with your existingcode !!!
DataBases and Non-Modal programming--------------------------------------------------------------------------------
If you choose to develop your application using a Non-modal style you maybe aware of certain design rules:
1. What is a Non-modal application ?
If you use MDI windows in your app, or if you use DialogBoxes with theclause NOWAIT, then you are implementing Non-modal designs.
A non-modal design will let user select several things at the same time.If you place a browse inside a MDIChild window, that MdiChild windowmay be opened several times! Or if a DialogBox is editing a certainDatabase, it may be issued several times.
2. How a non-modal design affects my DataBases manipulation design ?
A non-modal design works exactly as if you were working on a NetWork,so NetWork programming rules have to be used. If a MdiChild windowopens several times (at the same time) the same DataBase it will bethe same situation as if different users were being opening severaltimes those Databases on a NetWork.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
3. Does Clipper offer DataBase capabilities for Non-modal programming ?
Yes! Clipper let you open the same physical database in different alias,though acting in the same way as if you were working on a NetWork.
Important: In order to let Clipper manage the same DataBase ondifferent alias, you HAVE to specify different ALIAS:
USE Customer ALIAS Cust1 NEWUSE Customer ALIAS Cust2 NEW
From that moment you have to use Cust1 or Cust2 to reference your fields.
4. How difficult is coding for a NetWork ?
If you have never coded for a NetWork, don't be afraid. In next itemin this documentation we explain the foundation for doing NetWorkcoding with Clipper. It is quite easy!
If you have never design a NetWork application with Clipper, don't be afraid!They are not so difficult. There are some rules you have to follow:
1. All DataBases will be opened 'SHARED' by default, except if youspecify 'EXCLUSIVE' clause, and also depending on your SET EXCLUSIVE ...state (see USE... and SET EXCLUSIVE... Clipper commands).
2. Once the DataBase is USEd as SHARED, several users on a NetWorkmay use it, or several non-modal MdiChild windows or Non-modal DialogBoxesmay access the DataBase info at the same time.
3. You can not manipulate the contents of a field directly. Beforereplacing the value of a field you have to lock the record. Basically thisis the typical procedure:
if MyAlias->( RLock() ) // Lock the recordMyAlias->Field := <NewValue> // Modify the contentsMyAlias->( DbUnLock() ) // UnLock the record
elseMsgAlert( "The DataBase is in use now! Try again!" )
endif
4. Some Database operations (as building an entire INDEX) mayrequire that you open a DataBase in EXCLUSIVE mode or that you lockthe entire Database, not just a record.
Use USE ... EXCLUSIVE to open a DataBase as exclusive or use thefunction FLock() to entirely lock a file.
5. Get yourself some book about NetWork coding for learningadvanced tips and tricks! You will become a NetWork programming masterpretty soon!
4.1 FiveWin own TWBrowse class--------------------------------------------------------------------------------
FiveWin implements its own browse which has some important differences fromthe traditional MsDos Clipper TBrowse. This difference is based on the factthat we wanted FiveWin browsers to execute as fast as possible. Windows is
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
a graphical environment, so applications user interface tends to be slowerthan their MsDos equivalents. If you want to work in the MsDos way, FiveWinalso provides a new class TCBrowse, which it is a column based browse.
FiveWin TWBrowse does not work with column objects, instead of those, itholds an codeblock (DATA bLine) which returns an array. The contents ofthis array is used to display each visible column content. This makes animportant difference: Lets suppose we have a 10 columns browse, whichalso has 25 rows on the screen. If we were working with traditional browseto fully repaint the browse we were doing the following:
10 columns x 25 rows = 250 codeblocks evaluations.
FiveWin TWBrowse = 25 codeblocks evaluations only !!!
This fact makes FiveWin TWBrowses extremely fast, though it changes a littlethe way you are used to work with browsers. The main idea is that DATA bLineholds a codeblock that returns an array:
The second difference is that being in a graphical environment our userswanted to also show bitmaps (graphics) as browse elements. How could wedistinct from normal data and bitmaps handles ? The solution was that acharacter string holds normal data, and numeric values are consideredbitmap handles:
When FiveWin TWBrowse evaluates this codeblock, it detects there is a numericvalue as an element of that array, so that number is treated as a handleof a bitmap, and it is automatically painted on its column position. Asyou can use expressions to return that numeric value, you have an easyway to paint different bitmaps based on any condition:
Important: Always use character expressions as elements for the bLine array!A number will means a bitmap handle. An invalid bitmap handle(if by mistake you supply a number instead of a string expression)will cause strange results!
Besides this difference, the TWBrowse object is almost identical to aMsDos Clipper TBrowse. We have just used 'Hungarian notation' (we specifythe type of a DATA -instvar- preceding the DATA name) to specify the typeof each TWBrowse object DATA:
Finally, FiveWin implements easy xBase commands to build a whole browsewith just one xBase command (there is no equivalent for this in MsDosClipper TBrowse):
See FiveWin Browse xBase commands and the Class TWBrowse explanationin this manual for a full description of the above xBase commands. Rememberthat FiveWin also provides a new powerful Class TCBrowse in case that youwant to work with column objects. TCBrowse is also a fast browse, thoughnot as fast as TWBrowse.
Using Borland's Resource WorkShop--------------------------------------------------------------------------------
* How to place a FiveWin Browse in a DialogBox:
1. Select the custom control toolbar button (it shows a little key onit).
2. You will be prompted for the name of the custom control to use:Write TWBrowse.
3. Draw the browse area on the Dialog Box and double click on it.
4.3 Using FiveWin indexed filters ( SELECT clause )--------------------------------------------------------------------------------
FiveWin Browses implement a powerful feature that allows us to retrievejust a part of a DataBase similar as a FILTER, but based on Indexes whichmakes it extremely fast and efficient (Clipper SET FILTER must notbe used with medium-big DataBases). Advanced Clipper RDDs likeComix or SixDriver implements some features that allow similarresults. Anyhow we decided to keep the SELECT clause for users ofstandard Clipper.
Lets see a sample of its use: Suppose you have a clients database indexedby surname. Lets suppose that you just want to review clients whosenames start with L, M, N. Then you do:
REDEFINE LISTBOX oBrw FIELDS Surname, Address, ...... SELECT Surname FOR "L" TO "N" ...
This will make the browse just show from "L" up to "N" surnames.
We called them Indexed Filters and we manage them using the LISTBOX ...FIELDS ... SELECT ... clause:
...
SELECT <cField> FOR <uValue1> [ TO <uValue2> ] ;...
Basically what FiveWin does is a SEEK of the <uValue1> when going TOP:to find the first element to be showed. If <uValue2> is provided (itis optional) we do a SEEK of the <uValue2> when going BOTTOM: (to findthe last element to be showed). If <uValue2> is not provided then weuse the following index value to stop the records showed.
From <uValue1> to <uValue2> (if defined) we check that <cField> isincluded in that range.
In order to make this powerful clause work properly some requirementsare necessary:
* The DataBase showed on the browse ( LISTBOX ... FIELDS ... ) must beindexed and the active Key must be the same as the <uValue1> we aregoing to seek. Please check carefully the types of the index expressionand the type of the <uValue1> and <uValue2> (this one if defined).
* FiveWin does not check it <uValue1> exists. This is very important:You have to check it YOURSELF: How ? Just do a SEEK <uValue1>. Ifexist ( If Find() ) then proceed with the browse. There are manydifferent possible default behaviors when the <uValue1> is notfound, this is why we have decided that it is your responsibilityto decide what to do if <uValue1> is not found.
FiveWin also offers a :SetFilter() method to change dynamically thecurrent SELECTion, without having to create again the DialogBox (or thewindow):
This clause has been extensively tested, and we guaranty it works properly.If you don't get a proper behavior it could be that you are not usingit properly. Please review your code and check that all the rulesthat we show here are being observed in your code.
If you get strange behavior it is a clear sign that you have someother problems. We offer an extensive working sample in theIDE\SOURCE\DOC.prg. Review and you will see how to get all the powerfrom this really useful clause.
FiveWin requires that all expressions to be shown on a browse to be ofcharacter type. The reason for this is that if you specify a number weunderstand it is a handle of a bitmap so there you want to show abitmap:
// Lets use different row colorsoLbx:nClrText = { || SelColor( Clientes->Nivel ) }oLbx:nClrForeFocus = { || SelColor( Clientes->Nivel ) }
// Uncomment this to quickly calculate the desired columns width// Right click with the mouse over the browse and you will// see the columns sizes!// oLbx:bRClicked = { || oLbx:ShowSizes() }
4.6 Browsing everything you want--------------------------------------------------------------------------------
The major advantage of FiveWin TWBrowse (strongly based on Clipper TBrowsemodel) is the capability of browsing anything you may need.
FiveWin TWBrowse is a generic browser machine capable of browsing informationof any type, though as DataBase browsing is usually more common, we haveadded certain built-in functionality to quickly build DataBases browsers.
There are certain DATAs and METHODs in a TWBrowse object, that convenientlyinitialized will let you browse anything:
DATAs bLine It will be used to display each browse line.It must return an array with all the columnselements to represent.
bSkip Used to skip certain amount of lines. Thiscodeblock is evaluated every time the currentselected line is going to change. bSkip receivesa numeric parameter indicating the desirednumber of lines to be skipped, and it has toconfirm that number returning it, or analternative number with the real number of linesto skip:
bSkip = { | nWant, nDo | ..., nDo }
nWant represent the desired number of lines toskip. nDo will indicate the final number oflines to skip.
bGoTop These codeblocks are evaluated for navigatingbGoBottom through the represented data. Properly assigned
will let you browse anything.
bLogicLen You must assign here the logical total lengthof the browse, to properly set the browsescrollbar.
As an example, lets see how we can browse an array just manipulatingthese DATAs:
Basic concepts about printing in Windows--------------------------------------------------------------------------------
The major difference between managing the printer in MsDos and in Windowsis the fact that in Windows we manage the printer in graphical mode.
This means that we are going to manage different sizes of fonts, that weare going to manage text and drawings, that we may need to preview allthat on the screen, and the most important thing: that different printersmay have different resolutions, and we have to control all that.
FiveWin automatize all these processes giving you maximum power with minimumcomplexity. FiveWin categorizes all printing works in these differenttypes:
* Quick printing techniques!* Managing the printer object* The Report Engine
Besides the sophisticated FiveWin Report Engine, FiveWin offers youRAD (rapid application development) techniques to quickly prototypeyour printouts, with no work at all on your side!:
* Generating a full report from the current workarea:
Just call the function Report() and you will get a full pagedreport automatically generated from the current workarea!
* Generating an automatic report from any Browse !!!:
If you do <oBrw>:Report() where <oBrw> is a reference to yourbrowse, FiveWin will generate a full report with the same contentsof your browse. So, the easiest way to implement a report in yourbrowse is placing a bitmap button on your DialogBox with theaction <oBrw>:Report().
* Making a printer HardCopy of any window or control !!!:
If you have a Dialog and you want to obtain a printout of it,the easiest way is just doing: <oDlg>:HardCopy( <nZoom> ) where<oDlg> is your Dialog object and <nZoom> is a scale factor -a value of 3 is normally recommended to obtain natural dimensions-You can use a bitmap instead of the Dialog, or any window orcontrol!
Combining these techniques you can very quickly prototype yourfirst application printouts. Don't forget them!
Remember to use these techniques on the first stages of yourapplication.
Managing the printer as an object--------------------------------------------------------------------------------
FiveWin manages the printer as an object, so controlling the printing
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
process is as easy as manipulating, from an object oriented point of view,the printer object.
* How to create a Printer object ?
FiveWin provides a TPrinter Class to manage the printer as an object,and some specific xBase commands to easier much more that manipulation:
PRINT oPrn NAME "My Printout" PREVIEW
PAGE...oPrn:Say( nRow, nCol, cText, ... )...
ENDPAGE
ENDPRINT
The PRINT command is building there a TPrinter object. From that momenton we may manipulate it directly, using all the DATA and METHODs offeredby the TPrinter Class.
* How to manipulate the Printer Object ?
Normally you create several pages using the commands:
PAGE...
ENDPAGE
And from inside that section you send messages to the Printer object.The most common message used is <oPrn>:Say() :
oPrn:Say( nRow, nCol, cText, ... )
Remember that the coordinates where you are printing depend upon thespecific printer resolution you may be using. In order to control this,you have to ask the printer object about its specific resolution:
oPrn:nVertRes() is the number of pixels in verticaloPrn:nHorzRes() is the number of pixels in horizontal
Now, you divide those values by the number of rows and cols that youwant to manage, and increase nRow, nCol according to those steps.See SAMPLES\TestPrn2.prg
* How to define a font that adapts to a specific Printer Object ?
To create a font object that adapts its size to the specific resolutionof a printer, we use as always the container clause OF :
local oPrn, oFont
PRINT oPrn
DEFINE FONT oFont NAME "Arial" SIZE 0, -10 OF oPrn
...
PAGE...
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Remember to destroy the font once you have finished printing.FiveWin Report Engine--------------------------------------------------------------------------------
We want to thank our friend Ignacio Ortiz de Zu.iga for his excellentwork and contribution to the FiveWin Report engine,
[ PICTURE <cPicture, ...> ] ;[ FONT <uFont> ] ;[ < total: TOTAL > [ FOR <bTotalExpr> ] ] ;[ < ColFmt:LEFT | CENTER | CENTERED | RIGHT > ] ;[ < lShadow:SHADOW > ] ;[ < lGrid:GRID > [ <nPen> ] ]
ENDREPORT
ACTIVATE REPORT <oReport> ;[ FOR <for> ] ;[ WHILE <while> ] ;[ ON INIT <uInit> ] ;[ ON END <uEnd> ] ;[ ON STARTPAGE <uStartPage> ] ;[ ON ENDPAGE <uEndPage> ] ;[ ON STARTGROUP <uStartGroup> ] ;[ ON ENDGROUP <uEndGroup> ] ;[ ON STARTLINE <uStartLine> ] ;[ ON ENDLINE <uEndLine> ] ;[ ON CHANGE <bChange> ]
With the command COLUMN (syntax above) you indicate all thecolumns that the report will have indicating the data and thetitle of each column. This can be very simple. For example:
COLUMN TITLE "Name" DATA Test->Name
------------------------REP02.PRG
IMPLEMENTING TOTALS:
If you want a Total on any column just add the word TOTAL in thecommand, for example:
COLUMN TITLE "Salary" DATA Test->Salary TOTAL
------------------------REP03.PRG
HEADERS & FOOTERS:
You can put any header and footer on the report by declaring themin the REPORT command. For example:
REPORT oReport TITLE "My First Report" ;HEADER "This is the header" ;FOOTER "This is the footer"
You can even specify how it will be written: left, centered or right,adding the word LEFT, RIGHT or CENTER|CENTERED. For example:
REPORT oReport TITLE "My First Report" ;HEADER "This is the header" RIGHT ;FOOTER "This is the footer" CENTER
Remember: by default Titles are centered and Headers and Footers arewritten on the left side.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
If you want more than one line for a title just put a comma betweeneach title. For example:
REPORT oReport ;TITLE "My First Report", "with FiveWin"
The same happens with headers and footers.
The report engine NEVER puts a white line between the header and thetitle or between the title and the column titles. It is up to you toput the blank lines wherever you want them. For example, if you wantto put a blank line between the header and the title, just indicate asecond line on the header with nothing on it -- just an empty chain:
REPORT oReport TITLE "My Report ;HEADER "My Header", " "
-------------------------REP05.PRG
USING EXPRESSIONS:
You can put almost anything you want in your reports because you canuse any expression that returns a character string, remember this isthe key to do almost anything you want. For example, if you want toput the date() on the report plus the current page number, justdo the following:
REPORT oReport TITLE "My Report" ,;"date:"+DtoC(Date()) ;
FOOTER "Page Number: "+ ;Str(oReport:nPage,3)
You can put expressions rather than character strings in almostanywhere: Titles, Headers, footers, Column titles, column data, etc...
--------------------------REP06.PRG
REPORT DESTINATION:
By default, the report is sent to the printer, but you can change itwhen you create the report:
When you send the report to the screen (PREVIEW), the report enginecreates all the pages until you push the button Preview, and thenyou will immediately see the first page created.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
When you create a Report you can specify a caption for it. Thiscaption would be the title of the preview Window if you send thereport to the screen, or it will be the description on the spooler ifyou send it to the printer. (In previous releases we used the wordNAME for this.)
-------------------------------REP07.PRG
USING FONTS:
You can use any font you want with your reports. This is the way youuse them:
First you have to define them with the command DEFINE FONT oFont ....
DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD
The size (width,height) specs. use different units of measure whenprinted versus displayed on screen. On screen, the units are pixels,but when printed, the units are font "points". Thus, for printedtext, we only use the second size specification (height) to give thepoint size, leaving the "width" as "0". The point size is given asa negative number, i.e. "10 point" is "-10". Remember that pointsize for proportionally spaced type is different than "pitch," whichis the term often used for non-proportionally spaced "typewriter" typelike Courier. Point size refers to letter height, whereas pitchrefers to the number of equal-spaced letters printed per inch. Regular"pica" sized typewriter type is 10 pitch - 10 letters per inch. Butrepresented in point size, this is 12 point -- very confusing becausethe smaller "elite" typewriter type is 12 pitch - 12 letters per inch,which is 9 point. (With "pitch," the bigger the number, the smallerthe font -- just the opposite of how "point" size works.) Now to addto the confusion, remember that in this Report Engine, we let FiveWinknow that we're working with point size instead of pixels by usingnegative numbers for points (and we must use points instead of pitchfor equal-spaced fonts like Courier). In this case, the "-" signisn't mathematical -- it doesn't mean (as math rules would suggest)that your point size gets smaller as the integer gets bigger. Justthe reverse. The bigger the integer, the bigger the point size. Ifyou're still confused, there's a fellow named Guttenberg on CIS whocan explain it all to you.
When you create the report, you specify the fonts you want to use,separating each one with a comma.
For example:
REPORT oReport TITLE ..... ;FONT oFont1, oFont2, oFont3
The first font in the list (oFont1) will be the standard font, so ifyou do not specify a font for a specific column it will use thestandard font (oFont1).
If you want a column to use the second font just do the following:
COLUMN TITLE ... DATA .... FONT 2
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
When you create the columns, you can specify a lot of behavior:
- PICTURE: As same as GETS- SIZE: Length of the column (number of Chars)- AT: Print at specific column (better not use it)- FONT: Font to use (number in the list of fonts)- TOTAL: if the column should have a total
If you specify that the column has a total, the DATA should be anumber. But if not, do not worry -- the report engine does not break.The TOTAL clause can have also a FOR condition. For example:
COLUMN DATA ... TOTAL FOR Test->Name = "Peter"
- LEFT|CENTER|CENTERED|RIGHT: You can also specify the way the text isgoing to be printed, left, center or right. By default, everything isleft formated except numeric data which is right.
----------------------------REP09.PRG
MULTILINE COLUMNS:
This is something you will really love: suppose you need to putanother column but you do not have enough width on the paper to do it?
You could use a smaller font, but this is not the best way. The bestway is to use multi lines for columns. That means that one databaseregister can use more than one line on the report. So we can dosomething like this:
Name Salary=================== ===========Test->First Test->SalaryTest ->Last
This is as simple as:
COLUMN DATA Test->First, Test->Last
Just separate with a comma the data you want to be printed.
You can do the same with the column title, like this:
COLUMN DATA Test->First, Test->Last ;TITLE "First Name" ,"Last Name"
If you put a TOTAL on that column, all the numeric data will be added.All the data will have the same picture, but I will explain laterhow to change this behavior.
--------------------------REP10.PRG
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
To make a group means to have a subtotal on a particular kind ofdata. With the report form you can make two groups. With other reportgenerators you can make up to 9, but with FiveWin Report Engine youhave no limit.
If you want the totals of the groups to be printed you must totalizeat least one column.
The data, of course, should be sorted in accord with the groupexpression.
To make a Group just do the following:
REPORT oReport ....COLUMN ....COLUMN ....
GROUP ON Test->State EJECT
END REPORT
The report will totalize each column that has been created with theTOTAL clause for every State and will make a page eject when theState changes.
You can even specify a Header, a Footer and a font to use for thatgroup (just one line on Headers and Footers):
GROUP ON Test->State ;FOOTER "Total State:" ;FONT 2 ;EJECT
Remember, you can have all the groups you want.
--------------------------REP11.PRG
SUMMARY REPORTS:
If you specify the clause SUMMARY when you create the report:
REPORT oReport TITLE ... SUMMARY
it will only print the information about groups. So the clauseSUMMARY should only be used when there is at least one group defined.
When you use the SUMMARY clause the report engine does not put anygroup separator line.
---------------------------REP12.PRG
CONTROLLING THE FLOW OF THE REPORT:
When you activate the report, it is possible to define FOR and WHILEconditions. For example:
ACTIVATE REPORT oReport ;
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Because the report engine can make a report even from an array, bydefault the WHILE condition is "!Eof()". So if you change the WHILEcondition, you must take care that if you are making a report from adatabase it is a good practice to include in the WHILE condition thetext ".and. !Eof()":
The INIT function is called just one time on the first page after thecolumn titles are printed.
The END function is called just one time on the last page after theGrand totals are printed.
The STARTPAGE is called on every start of a page. This is one of themost used because in this clause you will put bitmaps, lines, boxes,etc...
The ENDPAGE is called on every end of a page, when all the text isprinted (not very useful).
The STARTGROUP is called on every start of a group and before theheader of the group is printed (if there is one).
The ENDGROUP is called on every end of a group.
The STARTLINE is called on every start of a line of the report body.When STARTLINE is evaluated, the report engine is controlling if thefollowing line will fit in the current page, and if not, it will doan Eject and start a new page. Be carefull when using STARTLINE,because if you use Multiline columns there will be at least twoSTARTLINES for each record processed.
The ENDLINE is called on every end of line of the body report. WhenENDLINE is evaluated all the line has been printed and the currentreport line is been incremented.
The CHANGE is called on every "SKIP" if you are listing a database.For practical purposes, this function is called before the SKIP and
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
not after. This is also a clause you will use a lot.
In the source code we have include a blank line on StartGroup and asound beep when the report is finished.
IMPORTANT: Be careful when using these clauses. Remember you areinside the report flow, so you must take care of all the databases,indexes, etc.. that the report is using.
FiveWin Report Engine - II .--------------------------------------------------------------------------------
Report Samples See SAMPLES\Report directory--------------------------------------------------------------------------------REP01.PRG A very simple report .REP02.PRG Implementing totals .REP03.PRG Headers and footers .REP04.PRG Multi line on title, headers and footers .REP05.PRG The power of expressions .REP06.PRG To printer, to screen and to file. And caption use. .REP07.PRG Using fonts .REP08.PRG Configuring the columns .REP09.PRG Multi lines on columns .REP10.PRG Making groups .REP11.PRG Summary reports .REP12.PRG Controlling the flow of the report .REP13.PRG Understanding the report object .REP14.PRG Going backwards .REP15.PRG Printing arrays .REP16.PRG Shadows and grids .REP17.PRG Changing the aspect .REP18.PRG Bitmaps .REP19.PRG Boxes and lines .REP20.PRG Printing memos .REP21.PRG All together .
DATAs-------------------------------------------------------------------------------oDevice The target device where to printoTitle A TRLine object which contains the report titleoHeader A TRLine object which contains the report headeroFooter A TRLine object which contains the report footeroRptWnd The related report windowoBrush An optional brush to use at the report
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
aGroups An array with all the report TRGroups objects definedaColumns An array with all the report TRColumns objects definedaFont An array with all the report TFont objects definedaCols Internally used while printing. Don't use them!aText Internally used while printing. Don't use them!aData Internally used while printing. Don't use them!aPen An arrays of pens to use with the reportbFor A codeblock which holds the FOR clause. By default: {|| .t. }bWhile A codeblock which holds the WHILE clause. By default: {|| .not.EOF() }bInit A codeblock which holds the ON INIT clause.bEnd A codeblock which holds the ON END clause.bStartLine A codeblock which holds the ON NEWLINE clause.bEndLine A codeblock which holds the ON ENDLINE clause.bStartPage A codeblock which holds the ON NEWPAGE clause.bEndPage A codeblock which holds the ON ENDPAGE clause.bStartGroup A codeblock which holds the ON NEWGROUP clause.bEndGroup A codeblock which holds the ON ENDGROUP clause.bSkip A codeblock which holds how to skip to the next report line.bStdFont A codeblock which returns the default report font order to use.bPreview An optional codeblock to evaluate on the preview of the reportbChange A codeblock which holds the ON CHANGE clausecRptFile -not available yet- The Data-driven file which holds the report.cResName -not available yet- The resource name which holds the report.cTotalChr The character to use for drawing the report total lines. Default:"="cGroupChr The character to use for drawing the report group totals. Default:"-"cTitleUpChr The character to use for drawing the report column title up line.Default: "="cTitleDnChr The character to use for drawing the report column title down line.Default: "="cFile -not available yet- The name of the target file to produce.cName The name of the document to generate.cPageTotalcGrandTotalnWidth The width of the target device. Pixels per inch.nHeight The height of the target device. Pixels per inch.nMargin The report left margin after stabilizing the report.nRow The current report row being printed.nPage The current report page being printer.nMaxTitle The largest number of title lines used on all column titles.nMaxData The largest number of data lines used on all columns body.nSeparator The spaces width between columns.nLeftMargin The left margin of the page. Default: 0,2 inches.nRightMargin The right margin of the page. Default: 0,2 inches.nTopMargin The top margin of the page. Default: 0,2 inches.nDnMargin The down margin of the page. Default: 0,2 inches.nTitleRow Row where to start printing the report title.nBottomRow Last row available to the report body. (without the footer).nStdLineHeight The default report line height.nRptWidth The width of the report. Automatic updated when Stabilizing.nLogPixXnLogPixYnFirstdrownLastdrownTitleHeightnCounterlSummary Not detailed report body information, only report groups.lTotal If there is any column with total to be calculated.lFinish .t. when the report is finishing. Internally used.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
lStable .t. after the report has been stabilized.lGroup If there is any report group defined.lPrinter If the target device is the printer.lScreen -Not available yet- If the target device is the screen.lFirstRow .t. only when processing the first body line in each page.Internally used.lCreated If the report has been completely createdlPreview If a report preview is requiredlBreaklSpanish If Spanish language is usedlShadow If a shadow is going to be displayedlGrid If a Grid is going to be displayedCargo Generic cargo slot
METHODs-------------------------------------------------------------------------------New Method constructor: creates a new report. .AddColumn Add a TRColumn object to the report. .DelColumn Del a TRColumn object from the report. .InsColumn Insert a TRColumn object to the report. .AddGroup Add a new TRGroup object to the report. .DelGroup Del a TRGroup from the report. .Stabilize Stabilizes the report before starting printing (activate). .Skip Skip to next record on the current workarea -or equivalent-. .Init Evaluate the ::bInit codeblock if defined. .End Forces the termination of the report. .StartLine Executes the codeblock defined on the start of a line. .EndLine Ends printing the current line. .StartGroup Executes the codeblock defined on the start of a group. .EndGroup Executes the codeblock defined on the end of a group. .StartPage Executes the codeblock defined on the start of a page. .EndPage Executes the codeblock defined on the end of a page. .NeedNewPage Returns .t. if a new page is needed. -internal used- .NewLine Start a new line, and executes the startline codeblock. .BackLine .ColTitle Prints all report columns titles. .TotalLine Prints every report columns Separator lines. .PageTotal Prints all report column page & grand totals. .Activate Starts executing the report. .Play .Margin Modify any of the top, left, bottom & right report margins. .Say Draws a text .SayBitmap Draws a bitmap .Box Draws a box .Line Draws a line .Shadow Shadows an area .KillShadow .Grid Places a grid on the report .Inc2Pix Turns inches into pixels .
Class TrColumn .Class TRColumn-------------------------------------------------------------------------------
DATAoReport Its TReport object container.aData An array with all data codeblocks.aTitle An array with all titles codeblocks.aPicture An array with all pictures.bDataFont A codeblock that returns the font to use for the data.bTitleFont A codeblock that returns the font to use for the title.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
bTotalFont A codeblock that returns the font to use for the total.bTotalExpr A codeblock to return when a total must be calculated.cTotalPict A string holding the PICTURE to use for the data.nWidth The width of the column in pixels.nDataHeight The height of the column data.nTitleHeight The height of the column title.nTotal The accumulated total already calculated for the column.nCol The column position if defined.nSize The width in characters in pixels if defined by the user.nPad The relative position inside the column: LEFT, CENTER, RIGHTnPen The Report pen elements to uselTotal If the column has totallShadow If the column has to be filled with a shadow backgroundlGrid If the column has to be bordered with lines-------------------------------------------------------------------------------
METHODSNew Method constructor: creates a new column.Stabilize Stabilizes the column. It is called by the report stabilize.SayTitle Prints its title.SayData Prints its data.SayTotal Prints its total.
Class TRGroup FiveWin Report Engine Group objects-------------------------------------------------------------------------------
DATAs-------------------------------------------------------------------------------oReport Its TReport object container.aTotal An array of numeric totals, one for each report column.bGroup A codeblock which holds the group expression.bHeader A codeblock that returns the header of the group.bFooter A codeblock that returns the footer of the group.bHeadFont A TFont object to use to print the group header.bFootFont A TFont object to use to print the group footer.cValue It keeps the latest group evaluated expression.nCounterlEject If eject is to be performed on each group change.
METHODs-------------------------------------------------------------------------------New Method constructor: creates a new TRGroup object. .Reset Resets the accumulated total value of all aTotal to 0. .Header Prints the header of the group. .Footer Prints the footer of the group. .Total Prints the totals of the group. .HeaderHeight Returns the height of the group header. .FooterHeight Returns the height of the group footer. .Evaluate Calculates the group expression .Check Checks if the group condition has changed .
Class TrGroup .
Class TRLine FiveWin Report Engine Line objects .-------------------------------------------------------------------------------
DATAs-------------------------------------------------------------------------------oReport Its TReport object container.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
aLine An array of codeblocks with all the line data elements.aFont An array of codeblocks with all the fonts to be used. .aRow Internally used during printing.aWidth An array with each line element width.aPad An array with each line element pad type: LEFT, CENTER, RIGHTnCol Internally used to print the line.nHeight The height of the line.nWidth The largest width defined of its elements.
METHODs-------------------------------------------------------------------------------New Method constructor: creates a new TRLine object. .Stabilize Stabilizes the line. Called by the report stabilize method. .Say Prints the line. .
Class TrLine .
Previewing your print-works--------------------------------------------------------------------------------
You may generate an impressive preview of your printouts just specifyingthe clause PREVIEW when building a printer object:
PRINT oPrn NAME "My Printout" PREVIEW...PAGE
...oPrn:Say( nRow, nCol, cText, ... )...
ENDPAGE...
ENDPRINT
This will cause the printout to be reviewed first in screen, giving theuser the ability to preview and interactively select what to print or tocancel the printout work.
FiveWin uses standard Windows Metafiles files to store each of theprintout pages. In order to manage those metafiles, FiveWin looks forthe temporary directory on your system. Remember to set a TEMP directoryon your autoexec.bat:
SET TEMP=c:\temp
FiveWin will store temporarily the metafiles files inside that directory,and will delete them once the preview is finished. All these operationsare managed automatically by FiveWin.
8. Windows advanced8.1 Managing DLLs - Dynamic Link libraries--------------------------------------------------------------------------------What is and how to use a DLL ? .
DLLs management xBase commands--------------------------------------------------------------------------------DLL [STATIC] FUNCTION <FunName> ... DLLs run-time linking and use .
SAMPLES--------------------------------------------------------------------------------DllCall.prg Dynamic linking at runtime sample .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Defining a external DLL DLL [STATIC] FUNCTION <FunName>( ;function to be called [ <Param1> AS <Type> ] ;at RunTime [ <ParamN> AS <Type> ] ) ;
AS <return> [PASCAL] LIB <DllName>
FiveWin lets you declare an external DLL function to be called at RunTimeby its own name! See DllCall.prg example.
<FuncName> The name of the DLL function. Remember Clipper only uses10 characters maximum length.
<Param1> Name of a parameter.
Length in bytes<Type>, BYTE, CHAR 1<return> WORD, BOOL, HANDLE, HWND, HDC 2
LONG, STRING, LPSTR, PTR 4DOUBLE 8
<DllName> Name of the DLL.
We recommend to develop a C language based connection functions when youare going to develop an intensively work with some DLLs. See "usingWindows API". Examples:
Calling SndPlaySound() at RunTime:
#include "FiveWin.ch"
function Main()
SndPlaySound( "tada.wav", 0 )
return
DLL FUNCTION SndPlaySound( cFile AS LPSTR, nType AS WORD ) AS BOOL ;PASCAL LIB "MMSYSTEM.DLL"
Designing the same DLL connection using C language:
//----------------------------------------------------------------------------//// This sample shows how to make a Dynamic Linking at RunTime!// Using Borland BWCC.DLL DLLs
DDEML Classes--------------------------------------------------------------------------------TDDEMLServer DDE Server Class .TDDEMLClient DDE Client Class .
SAMPLES--------------------------------------------------------------------------------DDEMLSVR.prg DDEML Server sample .DDEMLCLI.prg DDEML Client sample .What is DDE ?--------------------------------------------------------------------------------
Dynamic data exchange (DDE) is a form of interprocess communication thatuses shared memory to exchange data between applications. Applications canuse DDE for one-time data transfers and for ongoing exchanges in which theapplications send updates to one another as new data becomes available.
Dynamic data exchange differs from the clipboard data-transfer mechanismthat is also part of the Windows operating system. One difference is thatthe clipboard is almost always used as a one-time response to a specificaction by the user--such as choosing the Paste command from a menu. AlthoughDDE may also be initiated by a user, it typically continues without theuser's further involvement.
FiveWin implements two Classes TDDEMLServer and TDDEMLClient to easilymanage a DDE Client-Server session.DDE Commands Dynamic Data Exchange xBase management--------------------------------------------------------------------------------
Defining a new DDE DEFINE [ DDE | LINK ] <oDde> ;connection [ SERVICE <cService> ] ;
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Class TDde--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------nService The service on which to establish the connection.nTopic The topic on which to establish the connection.nItem The item on which to establish the connection.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
bAction Action to be performedbEnd Action to perform when ending the DDE link (VALID)oWndServer Container TWindow object of the TDDE object.lActive If the DDE connection is still active
METHODS--------------------------------------------------------------------------------New Constructor from source codeActivate To initiate a conversation with server applications
responding to the specified application and topic names.Execute To send a string to the server to be processed as a
series of commands.End Ends the DDE connection
Class TDDEMLServer DDEML Server Object management--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------hInst A handle of the DDEML instance sessionhConv A handle of the DDEML conversationcService The name of the servicehService The handle of the servicelConnecting If the server is in the process of connecting with a ClienthSz2 Some processes require to hold a hSZ2 handle stored hereaClients An array with all the attended ClientsbOnConnect The action to perform when connecting to a clientbOnRequest The action to perform on a client requestbOnDisconnect The action to perform when a client disconnectsbOnExecute The action to perform on a Client Execute command
METHODs--------------------------------------------------------------------------------New Constructor METHODConnect Automatically called when a Client wants to connectConnectConfirm Automatically called when a Client has finally connectedDisconnect Automatically called when a Client has disconnectedExecute Automatically called when a Client has sent a commandRequest Automatically called when a Client has done a requestReturn Use this method to return data to a Client Request
Class TDDEMLClient DDEML Client Object management--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------hInst A handle of the DDEML instance sessionhConv A handle of the DDEML conversationcService The name of the servicehService The handle of the servicecTopic The name of the topic to keep the conversation abouthTopic The handle of the topicnTimeOut The timeout to wait for an answer. Default 1000. Use -1 forASync.
METHODs--------------------------------------------------------------------------------New Constructor METHODConnect To connect to a ServerDisconnect To disconnect from the Server
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
for n = 1 to 20oWnd:Say( n, 2, oClient:Request( "CUSTOMER->Last" ) )oClient:Request( "CUSTOMER->( DbSkip() )" )
nextSysRefresh()
return nil
//----------------------------------------------------------------------------//8.1 Managing MAPI - Mail Services--------------------------------------------------------------------------------What is MAPI ? .
MAPI management xBase commands--------------------------------------------------------------------------------DEFINE MAIL ... Creating a Mail object .ACTIVATE MAIL ... Sending the Mail .
SAMPLES--------------------------------------------------------------------------------TestMail.prg Sending and receiving mail .What is MAPI ?--------------------------------------------------------------------------------
MAPI is the brief name for Mail Application Programming Interface.MAPI is a Windows group of services specifically designed for exchangingmail.
// FiveWin - Windows MAPI (mail services) support demonstration// This is only for Windows for WorkGroups, Windows NT and Windows 95 !!!
DEFINE MAIL oMail ;SUBJECT "FiveWin Mail-control power" ;TEXT "This is real xBase power at your fingertips!" ;TO "LOLO", "Lolo Linares"
ACTIVATE MAIL oMail
MsgInfo( oMail:nRetCode )
return nil
8.4 ODBC - Open DataBase connectivity and SQL--------------------------------------------------------------------------------What is ODBC ? .When and why of ODBC ? .What is SQL ? .How do I use ODBC ? .
Working samples--------------------------------------------------------------------------------TestOdbc.prg A sample showing how to manage a DataBase using ODBC .
What is ODBC ?--------------------------------------------------------------------------------
ODBC is the standard proposed by Microsoft Windows for using DataBasesfrom any Windows application. You may think about ODBC as we think aboutthe Clipper RDD system.
Clipper RDD system -replaceable Data drivers- is an open architectureto be used in Clipper applications. Just for Clipper.
Windows ODBC system -Open DataBase connectivity- is an open architectureto be used in ALL Windows applications.
As Clipper has an internal engine to support all RDD connections, likewiseODBC has a common engine (in ODBC.DLL) which lets all ODBC drivers connecteasily, using the same way.
ODBC is supported through a little DLL -about 40 Ks- that serves as aninterface between Windows applications and any kind of ODBC driver:
+----------------+ +------------+ +-----------+ +------------+| Your Windows | | Windows | | Your ODBC | | Your || application |-->| ODBC.DLL |-->| Driver |-->| DataBase |+----------------+ +------------+ +-----------+ +------------+
The ODBC driver has to follow the ODBC.DLL rules, so we don't have toworry about it as we know that it will always be used in the sameway. ODBC lets Windows applications use any kind of DataBases in thesame way!
FiveWin encapsulates this process and offers you a powerful xBaseand OOPS management:
+--------------+ +-----------------+ +------------+| Your | | ODBC Objects | | Windows || FiveWin |----->| easily managed |----->| ODBC.DLL || application | | through xBase | | |+--------------+ +-----------------+ +------------+
ODBC.DLL offers a lot of functions to manage different ODBC services.FiveWin manages them all with the standard Clipper DBFs management methods.
We are building a Clipper RDD to manage ODBC, so in future versions ofFiveWin, managing ODBC will be as easy as:
USE "MyDataBase" VIA "ODBC"
Right now we offer a powerful ODBC class to easily manage ODBC. When ourODBC RDD is ready, then we will manage FiveWin ODBC objects through theClipper RDD driver.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
+--------------+ +----------+ +-----------------+ +------------+| Your | | standard | | ODBC Objects | | Windows || FiveWin |--->| Clipper |-->| easily managed |---->| ODBC.DLL || application | | DBF use | | through xBase | | |+--------------+ +----------+ +-----------------+ +------------+
When and why of ODBC ?--------------------------------------------------------------------------------
Though ODBC is a very nice concept and, of course, some ODBC drivers workquite well, we believe from our experience and conversations with FiveWinusers that ODBC it is not at all as easy and fast as CA-Clipper standardDataBase management power (especially if you use the SixDriver or Comix!).
We recommend that you keep using your CA-Clipper DBFs designs and yourexisting routines and applications.
There are some circumstances where using ODBC may be extremely useful.We think FiveWin ODBC capabilities are really useful by offeringdownsizing to companies. Imagine a company which uses DataBases thatcan be accessed through ODBC. You can take your CA-Clipper andFiveWin and convert those DataBases into standard CA-Clipper DBFs andindexes (managed with your RDDs). This is a good opportunity for you togain business. Many companies are willing to downsize to PC platforms.CA-Clipper and FiveWin-ODBC may be the key!
Of course you may use ODBC if you want to or if you need to. In thesecircumstances remember not all ODBC drivers are as powerful asClipper, and you will discover, possibly a big surprise, that sometimesyour 'normal' Clipper processes can not be performed in ODBC!
We have not covered all the possibilities and situations in FiveWin ODBCthat you may face when trying to manage ODBC drivers. However we have offeredan open architecture which you may use and extend to suit your particularneeds.
What is SQL ?--------------------------------------------------------------------------------
Microsoft Windows has chosen SQL as the standard method to manage ODBCdrivers. SQL is the programming system to manage ODBC architecture.
SQL means Structured Query Language, and in some aspects it is verysimilar to what we are used to with Clipper and xBase dialects.
There are different levels of SQL, according to SQL historic evolution.Right now we may find:
SQL - core levelSQL - Level 1SQL - Level 2
The core level is the most basic and standard system. All ODBC driversaccept most of SQL core level rules. Level1 and Level2 offer morepowerful capabilities. The first thing you need to identify when usingan ODBC driver is exactly at which level it operates. ODBC drivermanufacturers may provide an extensive documentation and samples.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Some drivers DON'T accept all ODBC capabilities. Carefully review yourODBC driver documentation to learn its capabilities.
SQL is managed using functions and SQL commands.
SQL functions are managed in the same way as we manage Clipper functions.They are just functions.
SQL commands are strings which contains a SQL statement to be executed:
Sample:
"SELECT * FROM Dialog"
To execute this statement, we use it as an argument to a function call:
SQLExecDirect( ..., "SELECT * FROM ..." )
FiveWin offers an ODBC Class that automatically does all these in avery easy way.
How do I use ODBC ?--------------------------------------------------------------------------------
First, the most important thing you have to do is to properly configureODBC used in Windows.
ODBC drivers and Windows MUST be properly configured at the USER levelto function correctly. You can not develop an ODBC application thatwill work unless everybody has ODBC properly installed in their computers.ODBC is not 'self-contained' like the CA-Clipper DBFs management(where you can generate your DBFs and indexes on the fly!).
ODBC requires some specific installation. Basically, Windows needs toknow exactly, in advance, which DataBases are going to be used throughODBC, where they are and what drivers will they use.
There is a ODBC xBase driver, provided by Microsoft but it is notAT ALL as powerful as CA-Clipper RDDs. Keep this in mind.
--------------------------------------------------------------------------------hStmt The handle of the SQL statement to process.oOdbc A reference to the related TOdbc session objectaFields Array containing all the DataBase fields descriptionnRetCode Returned code from the latest operationcLastComm The latest executed SQL command
METHODs--------------------------------------------------------------------------------New Constructor from source codeEnd Ends control and make it disappearCancel Cancels the current in process SQL statementExecute Execute an SQL statementGetCurName Gets the current assigned cursor nameGetOptionsInitFields Loads all DataBase fields descriptions into ::aFieldsLastCommand Last executed commandLastError Retrieves the last errorFieldGet Retrieves the contents of a fieldFieldGetBlob Retrieves the contents of a BLOB field into a disk fileFieldName Retrieves the name of a fieldFieldType Retrieves the type of a fieldFieldLen Retrieves the len of a fieldFieldDec Retrieves the number of decimals of a fieldParamDataPrepare Prepares a SQL command so next time won't be parsed againPutData Changes the current cursor pointed table valuesRowCount Retrieves the number of fields of the DataBaseSetCurName Sets a name for the cursor in useSetOptions Set several SQL optionsSetParam Sets a param description for next SQL statementSkip Skip to the next record
DEFINE DIALOG oDlg FROM 2, 2 TO 14, 60 TITLE "ODBC Management"
@ 2, 2 SAY oDbc:FieldName( 1 ) OF oDlg@ 2, 6 GET oName VAR cName OF oDlg COLOR "W+/RB"
@ 5, 10 BUTTON "&Next" OF oDlg ;ACTION ( oDbc:Skip(),;
cName := oDbc:FieldGet( 1 ),;oName:Refresh() )
ACTIVATE DIALOG oDlg
oDbc:End()
return nil
//----------------------------------------------------------------------------//8.6 Event-Driven programming--------------------------------------------------------------------------------What are event-driven applications ? .How may I control events ? .Do I need to care about events ? .
Events management xBase commands--------------------------------------------------------------------------------... ON <EventName> <uAction> ... .
Events management Object Oriented management--------------------------------------------------------------------------------Following are some of the most used events related codeblocks.You may review a certain class documentation to find therelated event codeblock you are looking for.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
TWindow ClassbInit Code Block to execute on initializationbMoved Code Block to execute after moving the windowbLClicked Code Block to execute when left clicking the mousebKeyDown Code Block to execute when pressing a keybPainted Code Block to execute when painting the WindowbRClicked Code Block to execute when right clicking the mousebResized Code Block to execute after resizing a WindowbLDblClick Code Block to execute when left double clicking the mousebWhen Code Block for WHEN clausebValid Code Block for VALID clausebKeyChar Code Block to execute when pressing a no-control keybMMoved Code Block to execute when moving the mousebGotFocus Code Block to execute when receiving the focusbLostFocus Code Block to execute when losing the focus
TWBrowse ClassbSkip Like Clipper TBrowse:skipBlock. We provide a default fast
DataBase skipper.bGoTop Like Clipper TBrowse:goTopBlock. We provide a default
DataBase bGoTop.bGoBottom Like Clipper TBrowse:goBottomBlock. We provide a default
DataBase bGoBottom.bChange CodeBlock to perform when moving from row to row
TReport ClassbInit A codeblock which holds the ON INIT clause.bEnd A codeblock which holds the ON END clause.bStartLine A codeblock which holds the ON NEWLINE clause.bEndLine A codeblock which holds the ON ENDLINE clause.bStartPage A codeblock which holds the ON NEWPAGE clause.bEndPage A codeblock which holds the ON ENDPAGE clause.bStartGroup A codeblock which holds the ON NEWGROUP clause.bEndGroup A codeblock which holds the ON ENDGROUP clause.bSkip A codeblock which holds how to skip to the next report line.bChange A codeblock which holds the ON CHANGE clause
follow the following recommendations:
FiveWin 1.9.2 upgrade has a set of new funtions to analize theDGroup of your application. A new ErrorSysW.prg uses thesefunctions to analize your DG memory and help you in properly finetune it.
Basically there are two main rules:
1. Reduce the amount of static variables used in your app. Thisis very easy just using a static array instead of severalvariables:
static onestatic twostatic three
change them into
static aVars := {,,}
where
#define ONE aVars[ 1 ]
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
This does not have sense with few statics, but it do has sensewhen you are managing a large amount of statics (I know ofcustomers that use over 1000 statics). FW 192 has a new functionthat counts the number of statics variables your app has.
2. There is a powerfull utility named DGPIG (it can be foundon the CA-Clipper forum) produced by Michael Devore (CauseWay)that analizes LIBs and OBJs and reports about DG consume. ClipperOBJs consume 8 bytes which it is normal and can not be fixed. Butthe problem normally comes from C language modules. There are manyways why a C module can consume DG space. Normally for declaringa literal inside the C code or cause declaring a static array.This both problems can be fixed using the C clause 'far' thatforces them into a different data segment:
The less initial DGroup your app consumes (FW 192 reports youthis initial size), and the less Clipper static variables youmanage, the larger Clipper stack you may have:
Clipper will use the remaining DG space for its stack.
From FiveWin 1.9.2 we are allocating dynamic heap when building GETs andMultiGets from source code ( @ ..., ... GET ... ), so we have been ableto successfully reduce the LNK (or DEF) file HeapSize value down to1024 bytes and the applications are working successfully. This was notpossible before as Gets and MultiGets used that area for internal working.Doing this HeapSize reduction you will get an extra 7,5 Ks for yourClipper stack!
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
9. Object Oriented Programming in FiveWinFiveWin Architecture-------------------------------------------------------------------------------
If you have some experience with Object Oriented Programming (OOPS), or ifyou just are starting out, we are sure you will be delighted to know aboutthe OOPS structure that FiveWin implements.
FiveWin's OOPS implementation is done on four basic levels:
1.- xBase Commands2.- Classes and Objects3.- Functions and Data Structures4.- The Windows API
xBase commands are the highest level of abstraction, that is, it is thelevel at which you don't care about how things work and you only care aboutfunctionality, that is "to make it work".
xBase commands originally came from dBase, and they have been evolvingtowards a standard named "xBase". These commands are built over Objects.These Objects, and their classes are the second level of abstraction.
To use Classes and Objects it is necessary that you have some OOPSskills. FiveWin uses our library Objects to use the OOPS capabilityof CA-Clipper. You can contact us to get the latest commercial releaseof Objects, at a very low price, which includes all the documentation,examples and source code so you will be able to utilize the incredibleworld of OOPS technology.
Objects are also based on functions (methods) and data. This is the nextlevel of abstraction. You may realize as we progress through this documentthat the complexity grows and there are more details to understand.
Finally most of the functions we use are based on the Windows API.
Maximum productivity is reached quickly at the xBase command level. As youmove down towards Windows API your power and possibilities are greater butobviously your productivity decreases. As application programers you shouldtry to be at a intermediate level: a balance between productivity andpower.
In spite of the low popularity achieved by dBase IV, that version did a bigadvance to consolidate the commands for creating and managing Objectsalthough it did not offer OOPS.
So in xBase the standard is established that for creating anObject we to use the command:
Note that if we use that command for create any Object, in some waywe are using a generic building 'message'. This is why we recommendimplementing that syntax for creating new Objects.
To activate any Object, we use:
ACTIVATE <ObjectClass> <ObjectName>
Finally, although this is not always necessary in Clipper, to destroy
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
These commands get processed in their correspondents messages sentto the Object we are managing. So:
DEFINE WINDOW oWnd ==> Get transformed in ==> oWnd := TWindow():New( ... )
The use of these commands let us use a unique and common syntax for allthe Objects. You may think that this is one of the targets of OOPS:We must concentrate in our goal and not in a particular implementation,that means, we should use a unique interface.
As FiveWin includes the latest version of Objects, you may use it tobuild new classes from the Classes that FiveWin offers you. Review theFiveWin Classes hierarchy and inspect the design and the code of itsclasses to understand how you should use the power of OOPS inheritance.
In FiveWin we have implemented for the first time a mixed system fordeveloping Object Oriented environments. The system we have developed letsyou use the power of OOPS and also the extensibility offered by 'pointers',in Clipper named 'CodeBlocks'.
There is certain international discussions between these two approaches.There is no an agreement about what is the optimum system. This is whywe have decided to build a mixed system which uses both technologies.
When in a program we need to modify a behavior temporarily, as a example,defining a behavior for an event, we use the system based on pointers,that is, based on CodeBlocks. The reason for this is that we may supposethat behavior will not be necessary again in the future, so there isno need for building a new Class.
When we do:
ACTIVATE WINDOW oWnd ;ON PAINT ...
We are modifying the behavior for that window when it receives thePAINT event. This system is based on CodeBlocks. It is logical becausethat behavior will not be reused in the future.
But, if we were building a system that it is going to be reused in thefuture, then it has all sense to build a new class: this is thetraditional OOPS way.
So, at FiveWin's TMsgBar Class, which is a class that will be usedfrequently in other programs, we inherit a new Class form TWindowand we redefine the method PAINT.
We are convinced that a good OOPS architecture should use this twobuilding models. As you get more OOPS experience you will understandour point of view.
OOPS is marvelous, but still there are some aspects that should evolve.The construction of this mixed model may be a good way for discoveringnew possibilities.
Starting with OOPS--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
What is an Object ? Definition of an Object .What is a Class ? Definition of a Class .
Three main rules of an OOPS system .--------------------------------------------------------------------------------Encapsulation Data and Methods are an inseparable unit .Polimorphism The same message applied to different Objects .Inheritance Creating new Classes from existing ones .
What is an Object--------------------------------------------------------------------------------
From the moment a human is born, they start recognizing and classifying theworld around. Our brain has the automatic mechanisms to organize our worldinto Classes.
An Object is a collection of Data that has some typical behaviors whichdifferentiate it from other kinds of Objects.
Object : Data + Behaviors --> Data + Methods
Data: What the Object HAS.Behaviors: What the Object DOES.
Example: What is a chair ? Even a child will tell us:
A chair has (DATA) :
* four legs* a certain color* some dimensions* some weight* a surface to sit on* etc...
A chair's Behaviors (METHODS) :
* Can be built* Can be moved from one place to another* Supports someone if he/she sits on it* Can be destroyed* etc...
In these behaviors we see what the chair DOES and what canbe DONE TO the chair:
The chair does: * Supports someone if he/she sits on it
Someone may destroy the chair --> Something is done to thechair.
The actions that get DONE TO an Object are EVENTS.
Data: What the Object HAS.Behaviors: What the Object DOES.Events: What is DONE to the Object.
Now lets see how we take those concepts into programming languages:
What is a Window ?
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
A Window is an Object that HAS:* Coordinates on the screen.* A caption* Some controls on its surface* A color* etc...
A Window DOES:* Resize* Iconize* Change its position* etc...
Some EVENTS may happen to a Window:* The mouse Clicks on it* The user presses a key* The Window gets resized* etc...
How can we get a certain action from an Object ?
Send it a Message!
oWindow:Message( params,... )
A message usually has the same name of the Method:
oWindow:Refresh() ---> Will execute ---> METHOD Refresh() CLASS TWindow
What is a Class--------------------------------------------------------------------------------
A Class is a group of rules which controls how the Object gets createdand what the behaviors of those Objects are.
A Class is something abstract: A collection of immaterial rules.
An Object is something real: It is a collection of Data. An Object issomething material.
I have a chair. I can touch it. I can use it. The chair exists!
I speak about 'chairs' with someone. I don't mind what chairs. It isa concept that exists in everybodys mind. It is an abstraction of thematerial world!
In computing, a Class is a bunch of code, rules for creating andmanaging Objects.
In computing, an Object is a bunch of Data, real information beingmanaged according to its Class rules!
How do we create a Class with Clipper ?
CLASS TWindow
DATA nTop, nLeft, nBottom, nRight
METHOD New() CONSTRUCTORMETHOD Display()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Inheritance Creating new Classes from existing ones--------------------------------------------------------------------------------
We may create new Classes from the ones we already have! We say we 'inherit'new Classes from the previous ones.
In those Classes we use what we already have, but we may:
* Modify some behaviors!
* Add some new Data!
Using Inheriting Classes we build a Class Hierarchy!
In Clipper we do:
CLASS TDialog FROM TWindow
...
ENDCLASS
TDialog Objects have all the functionality of a TWindow Object butwe add some new Data and we modify some behaviors!
FiveWin and Windows API relationship .--------------------------------------------------------------------------------Object Oriented messages structure .Windows API messages structure .
Windows API / FiveWin OOPS elements & messages equivalence:--------------------------------------------------------------------------------
Oriented language, C language. C was used instead of C++ because at thattime it was not available.
You may read in many places that Windows is Object Oriented. This is nottrue. In order to be Object Oriented is should offer the three main rulesof an Object Oriented environment: Encapsulation, Polymorphism andInheritance.
Windows should be Object Oriented and this would greatly help programmersto write Windows applications. This is why Borland, Microsoft, CA and othermanufacturers have developed C++ classes libraries to convert Windows intoa true Object Oriented environment.
The problem with this latest approach is that there is still no standard.If you review Microsoft, Borland and CA Class hierarchies you will findmany differences. These hierarchies are extremely large and most ofthe time all of their features are not required in standard Windowsbusiness applications.
Windows provides a very primitive way of simulating OOPS, it is called'SubClassing', not in the Object Oriented sense, but in a simple wayof changing a windows procedure by another.
In order to make Windows a OOPS environment, it is required that allcreated windows and controls are automatically 'SubClassed', that is,we change the standard Windows API behavior mechanisms for the OOPSmechanisms provided by an OOP language, like C++, Clipper 5 or any otherlanguage with real OOPS capabilities.
Microsoft MFC, Borland OWL, CA CommonView and Clipper-FiveWin have beenbuilt using the same construction rules. The same construction processesare in all those products. FiveWin offers the simplest and fastestClass hierarchy structure. We have developed it in that way to getthe best performance and size results. When you are in the OOPS arenayou run the risk of starting to create Classes without a strong reason andyou then run into the danger of huge performance decrease.
The process of converting Windows into a real OOPS environment has to betaken in two steps:
* Automatically SubClassing all windows and controls assoon as they are created. That allows us to change standardWindows behaviors.
* Designing a base general events processing mechanism toconvert Windows messages into OOPS-language messages inorder to take advantage of polymorphism and code reusability.
Thanks to OOPS inheritance it is possible to create a base TWindow Classwhich knows how to process most of all Windows API messages, and thenwe may inherit new Classes from it which redefine Methods and easily letus change the desired behaviors.
In FiveWin, the 'SubClassing' is done automatically through the TWindowMethods :Link() -to perform the SubClass process- and :UnLink() torestore the original procedures before the window gets destroyed. Thoseprocesses are quite sophisticated. Don't modify them.
FiveWin changes all the standard windows procedures to a single onewhich just gets the Clipper Object from the window handle and thenautomatically calls :HandleEvent() method. So :HandleEvent() receives all
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Windows API messages, and automatically calls the appropriate Object Method.
Windows API messages structure--------------------------------------------------------------------------------
If you review the examples provided in the Petzold book, you will realizeall Windows applications have the same structure:
* Creating the application main window* Start running the main get-message loop* Taking decisions based on received messages
Almost all that we see in a Windows environment is a window. The PushButtons,the Scrollbars, the CheckBoxes, the Dialogs, etc... are all windows.
Windows sends messages to all windows informing them about what ishappening and about what every window has to do. That is why WindowsAPI requires the programmer to provide a window procedure for everywindow which will be called by Windows in order to give us the messages.
In all Windows applications there must be a typical defined windowfunction:
long WINAPI WndProc( HWND hWnd, WORD wMessage, WORD wParam, LONG lParam )
That is the function Windows API uses to sends messages to our definedwindow. Let's review those parameters:
* hWnd The Window API handle of our window. Windowsidentifies every window using a 'handle': a numericvalue Windows API internally generates. This valuemust NOT be manipulated, it is a 'read-only' value.
* wMessage A numeric value that identifies any of theWindows API different messages. All these differentmessages values are provided in a header fileprovided by Microsoft called Windows.h. FiveWin hasits own WinApi.ch which includes the most used messagesidentifiers values. If you need to know about them,please review Windows.h supplied by Microsoft orBorland or any other Windows tools manufacturer.
* wParam A numeric value, a 'WORD' is a number of twobytes so it is in the range 0-216 which is usedto provide the window function with some parametervalue. This parameter may be many different thingsaccording to the sent message.
* lParam A numeric value, a 'LONG' is a number of fourbytes so it is in the range 0-232 which is usedto provide the window function with some extra parametervalue. This parameter may be many different thingsaccording to the sent message.
The window function typically performs a C switch statement, a ClipperDO CASE... ENDCASE statement and performs different actions accordingto the message received and its parameters, provided by Windows API.
In all Petzold examples we will find C code like this:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Windows provides a mechanism for processing unattended messages, thatis default behaviors to be performed in case we don't care aboutall sent messages. That is why all window functions have a default callat the bottom of them to the Windows API function DefWindowProc( ... )Default window procedure provided by Windows API.
Our window tells Windows API what to do according to the different valuesthe window function returns. Typically there are these possibilities:
* return 0 Means we have performed an actionand we don't want Windows to do anything.
* return non-zero In some cases Windows API requires somevalues.
* If we want We call DefWindowProc( ... ) and returnsstandard behavior its value to Windows API.
This process is the main conversation system between Windows API andour defined windows. In this process we have to connect to the ClipperObject Oriented kernel in order to convert it into an Object Orientedprocess.
9.4 Developing business OOPS-based applications--------------------------------------------------------------------------------
Based on the fact that FiveWin integrates its own Object Oriented Engine,it gives you the freedom to create all the new classes you may need so youhave the real capability to create truly OOP based applications.
The main advantadge of coding using OOP is that our applications increase verymuch in modularity, so they are better structured and you will be able to codemuch more keeping a much better and simpler organization.
How can you properly code in OOP ? The key for it is to be able to recognize'objects' in your code. And only through practise you will be able toeasily recognize those objects. Once you start recognizing those objects,your code will be turning more and more OOP.
How can you recognize an Object ? Look at the variables you are using.If some variables are clearly related to different aspects of the 'same',there is a high probability that there is an object there:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
11. InterNet developmentIntraNet/InterNet applications development using Clipper & FiveWin--------------------------------------------------------------------------------
FiveWin powerfull Class TSocket implementation lets you build robust andpowerfull IntraNet/InterNet databased applications.
FiveWin Class TSocket offers an easy and object oriented WinSock.dll TCP/IPmanagement. Review SAMPLES\\TestSock.prg to see the foundation of a WEBself contained DataBased WEB pages server.
No extra software is required (as WebSite, Windows NT IIS, Personal WEBserver or similar), so FiveWin turns itself into one of the most powerfulltools to develop IntraNet/InterNet databased applications.
Class TSocket - InterNet TCP/IP object oriented implementationSAMPLES\\TestSock.prg - Self contained IntraNet/InterNet databased WEB server
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
API support--------------------------------------------------------------------------------WINAPI\WinSock.cWINAPI\WinINet.prg
Classes--------------------------------------------------------------------------------Class TSocket InterNet TCP/IP object oriented implementation .Class TWebServer WEB pages and Proxy server with dynamic HTML support .Class TInternet Microsoft WinINet.dll object oriented management .Class TFTP WinINet.dll FTP object oriented management .Class TFTPFile WinINet.dll FTP files object oriented management .
Samples--------------------------------------------------------------------------------SAMPLES\\SockCli Sockets client client/server sampleSAMPLES\\SockServ Sockets server client/server sampleSAMPLES\\FiveGen A databased-dictionary application with automatic WEBmgementSAMPLES\\GALLERY\ICopyFiles FTP sending and receiving files sample
--------------------------------------------------------------------------------Class TSocket InterNet TCP/IP sockets support--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------nPort socket port numbercIPAddr socket IP addressnTimeOut connection timeout valuenBackLog listen backlog valuenSocket socket handlehFile handle of a file transmited in chunksbAccept codeblock to evaluate on accept event.bRead codeblock to evaluate on read event.bWrite codeblock to evaluate on write event.bClose codeblock to evaluate on close event.bConnect codeblock to evaluate on connect event.
METHODS--------------------------------------------------------------------------------New( nPort ) Constructor. nPort = port to use for the socket.Accept( nSocket ) Constructor. Builds a new socket to accept a incommingconnectionEnd() Generic destructor.HandleEvent() manages asyncronous connections events.GetData() Retrieves incomming data.SendBin() sends binary data.SendChunk() sends chunks of a file (::hFile ).SendData() sends data.Listen() Sets the socket in listening state.Close() Closes the socket.Connect( cIPAddr ) Connects to a specified IP address.Refresh() Determines the status of the socket.OnAccept() Accept incomming event method.OnRead() Read incomming event method.OnWrite() Write incomming event method.OnClose() Close event action.OnConnect() On connect event method.
Class TWebServer InterNet WEB pages and Proxy server--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------nPort socket port numbercIPAddress socket IP addressnTimeOut connection timeout valuenBackLog listen backlog valuenSocket socket handle
METHODS--------------------------------------------------------------------------------New Constructor from source code.ReDefine Constructor for resources.cGetPRG Generates the source code of the button.New( nPort ) Constructor. nPort specifies the port to useAccept Constructor. Creates a clone from the listening host socketEnd Closes the connectionGetText Retrives the data that arrives to the socketSenData Sends data throught the socketListen Turns the socket into a listening host socket
Class TInternet Microsoft 32 bits WinINet.dll object oriented support--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------hWinINet handle to opened WinINet.dllhSession handle of current sessionaFTPs Array of all TFTP objects in use
METHODS--------------------------------------------------------------------------------New ConstructorEnd Generic destructorFTP( cFTPSite ) Generates a new TFTP object and connects to it
Class TFTP Microsoft WinINet.dll FTP object oriented management--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------oInternet TInternet container objectcSite URL addresshFTP handle of the FTP connectioncUserName user name to logincPassword password to login
METHODS--------------------------------------------------------------------------------New( cFTPSite, oInternet ) Constructor. cFTPSite = URL to connect to.
oInternet = previous created TInternet objectEnd() generic destructorDeleteFile( cFileName ) deletes a remote FTP fileDirectory( cMask ) as Clipper Directory() but on a FTP site!
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------Class TFTPFile Microsoft WinINet.dll FTP files object oriented management--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------oFTP TFTP container objectcFileName name of the filehFile Internet handle of the filelBinary binary management vs. ascii management
METHODs--------------------------------------------------------------------------------New( cFileName, oFTP ) Constructor. cFileName = name of the file to manage.
oFTP = a previous built TFTP object.End() generic destructorOpenRead() opens the file for readingOpenWrite() opens the file for writtingWrite( cData ) write data to the fileRead( nBytes ) read n bytes from the fileSeek( nBytes, nFrom ) skips + / - bytes file pointer
--------------------------------------------------------------------------------FiveWin Internet software layers--------------------------------------------------------------------------------
The following picture illustrates the FiveWin Internet foundation layers:
FiveWin ClassesTInternet, TFTP, TFTPFile | FiveWin Class TWebServer-----------------------------------------------------
Microsoft WinINet.dll | FiveWin Class TSocket-----------------------------------------------------
Berkeley University WinSock.dll-----------------------------------------------------
The bottom software layer is WinSock.dll, a DLL that comes with Microsoftthat originally was developed by Berkeley University (the famous sockets!).FiveWin implements a direct connection to this DLL (WINAPI\WinSock.c), soyou may directly use all its functions.
On top this DLL Microsoft builds the 32 bits WinINet.dll, a high levelInternet layer wich is very usefull to manage FTP services. FiveWin ismanaging this 32 bits DLL thanks to our own 16-32 bits automatic thunksystem, used everytime you manage FiveWin DLL32 commands (DLL.CH). Infact all the WinINet.dll support has been built using FiveWin high levelDLL32 commands (SOURCE\WINAPI\WinINet.prg).
On top of the WinINet.dll layer, FiveWin implements three classes thatlet you easily manage WinINet.dll in an object oriented way: ClassTInternet, TFTP and TFTPFile. These classes simplify so much theWinINet.dll management. Class TFTPFile lets you use remote FTP filesas if they were files on your own computer ( FOpen(), FWrite(), etc...).There is a nice sample SAMPLES\GALLERY\ICOPYFIL that shows how to sendand receive FTP files directly from your FiveWin app without usingany Internet extra software.
On top of the WinSock.dll, FiveWin implements a powerfull object oriented
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Class TSocket, which makes so easy to have full control of WinSock powersockets. With this Class you may solve whatever Internet need you may have.
Using Class TSocket we have implemented Class TWebServer, a completeWEB pages server totally built-in inside your FiveWin application. Yourapplications may transmit WEB pages that are visible all over Internet.
The real power of this design is based on the FiveWin dynamic HTML ownfoundation. Before an object TWebServer sends WEB pages on the Internet,FiveWin mixes standard HTML codes with your own Clipper code requires.Simply place any Clipper expression between << >> and those expressionswill be expanded in your HTML files. This means live access to yourdatabases and remote management of your application. Microsoft is tryingto implement now a solid dynamic HTML standard. You already have allthis power.
FiveWin Class TWebServer transparently manages HTTP cookies, queries,mimes extensions and so on. Finally, Class TWebServer recognizes Proxyrequires, so not only sends HTML files through the Internet but youmay use it to let all Intranet users access the Internet world throughit. Companies are very aware of Internet security risks so they don'twant to let all employees to directly access the Internet, this is whythey implement 'firewalls'. The 'firewall' concept requires a Proxy serverthat really access the Internet. FiveWin Class TWebServer offers afully configurable Proxy server, and all this built in in your ownFiveWin application.
--------------------------------------------------------------------------------FiveWin dynamic HTML own implementation--------------------------------------------------------------------------------
To get the best results from FiveWin Class TWebServer and dynamicHTML generation a mixure of JavaScript (or VBScript), standard HTMLand Clipper code is required.
JavaScript is a very easy to learn language. It behaves like a mixurebetween C and Clipper. Normally you may not need more than two daysto really master it. (I learned it myself on a weekend! <g>)
Get yourself familiar with HTML code. HTML is such an easy languagethat you will be surprised how fast you may get it. basically thereare two main operations you will be dealing with: GET and POST.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
GET means the client is requiring some page. POST means the userfilled some controls info (GETs, radios, etc...) and he is sendingit to you. Have a look at SAMPLES\FIVEGEN to see how far we can gojust easily mixing these concepts.
FiveWin Class TWebServer automatically define some private variablesthat will be in scope for you to solve some information comming fromthe Internet HTTP protocol:
* When a page is requested as follows:
<filename.html>?<parameters>
FiveWin declares a 'parameters' variable that holds the <parameter>expression. Sometimes, scripting languages use Escape() functionto turns high character codes into lower ones. FiveWin implementsUnEscape() function to change back the effect of Escape().
* When a cookie has been defined on the client (see SAMPLES\FIVEGENto see how to manipulate cookies with JavaScript), FiveWin definesa 'Cookie' variable that holds the cookie value. A cookie is justa string variables that hold some client defines values.
* When the user has completed some controls requested info and hassubmited it to you, FiveWin declares a 'Query' variable that holdsthe original user query values.
You will become familiar to these concepts once you start managing themjust a little. You will be surprised how far you can get using yourloved Clipper and developing Internet applications using FiveWin.
Defining a DEFINE BUTTON [<oBtn>] ;button of the [ OF | BUTTONBAR <oBar> ] ;buttonbar [ NAME | RESNAME | RESOURCE <cResName1>;
[,<cResName2>] ] ;[ FILE | FILENAME | DISK <cBmpFile1>;[,<cBmpFile2>] ] ;[ ACTION | EXEC <uAction> ] ;[ GROUP ] ;[ MESSAGE <cMsg> ] ;[ ADJUST ] ;[ WHEN <uWhen> ] ;[ TOOLTIP <cToolTip> ][ ON DROP <bDrop>]
To redefine a button REDEFINE BUTTON [<oBtn>] ;placed on a dialogbox [ ID <nId> ] ;in a resource. [ OF | BUTTONBAR <oBar> ] ;(just a button, not a [ NAME | RESNAME | RESOURCE <cResName1>[,<cResName2>] ] ;buttonbar) [ FILE | FILENAME | DISK <cBmpFile1> [,<cBmpFile2>]
] ;[ ACTION | EXEC <uAction> ] ;
This lets you have buttons [ MESSAGE <cMsg> ] ;with bitmaps inside [ ADJUST ] ;DialogBoxes without [ WHEN <uWhen> ] ;having to use Borland's [ UPDATE <lUpdate> ] ;BWCC.DLL [ TOOLTIP <cToolTip> ] ;
To create a bitmap @ <nRow>, <nCol> BUTTON [<oBtn>] ;button from source code, [ NAME | RESNAME | RESOURCE <cResName1>[,<cResName2>] ] ;and place it at any [ FILE | FILENAME | DISK <cBmpFile1> [,<cBmpFile2>]] ;container window [ SIZE <nWidth>, <nHeight> ] ;
<cBmpFile1> The name of the Bitmap to display. Optionally<cBmpFile2> you may specify a second bitmap for animation.
This is used for accessing bitmaps stored on thehard disk (my.bmp)
<cResName1> The resource name of the Bitmap to display. Optionally<cResName2> you may specify a second bitmap for animation.
This is used for accessing bitmaps stored in aResource file (and .rc file or a .dll file)
<uAction> The action to be performed when clicking the Button.
<cMsg> The message to display on the message bar of thecontainer Window of the Bar Object which containsthe BitmapButton.
<uWhen> An expression that indicates if the button ofthe buttonbar is enabled or not.
<nId> The identifier for the button placed at a DialogBox.
<cToolTip> The text to show on a associated floating tooltip.
<bDrop> The action to be performed when
CLAUSES
3D To display the buttonbar with a gray 3D look.3DLOOK
TOP The position of the buttonbar respect its windowLEFT container. Right clicking on the buttonbar also popupsRIGHT a menu to select dinamically a new position.DOWN
FLOAT Places the buttonbar on a floating window.
For the buttons on the buttonbar
ADJUST To automatically adjust the bitmap to the size ofbutton.
GROUP Starts a new "group" of buttons in the ButtonBar.You may have as many groups as you need.
UPDATE For bitmap buttons placed on a DialogBox (withouta buttonbar). The button will update its imageautomatically when doing a oDlg:Update().
<oBrw> A reference to the TWBrowse Object.<nRow> Position on container window. We simulate text<nCol> coordinates.
<cFields> A list of text expressions to display as columns.If an expression is of numeric type, TWbrowsewill manage it as the handle of a bitmap to bedisplayed.
<aColSizes> A list of sizes for each column in pixels.<aHeaders> A list of text expressions for headers.<nId> Is the numeric identifier of the TWBrowse control.
<nWidth> The desired size of the TWbrowse control in pixels.<nHeigth>
<uChange> An action to be performed when selecting a new row.
<uRClick> An action to be performed when right clicking
<uLClick> An action to be performed when left clicking
<uLDblClick> An action to be performed when Double Left clicking
<oFont> A reference to the Font Object to be used with the LISTBOX.
<ValidFunc> An expression or function to be validated when theListBox loses its focus.
<nClrFore> Foreground color as a RGB number, or as a xBase string
<nClrBack> Background color as a RGB number
<uAction,...>
<cField> Must be the Field key of the current INDEX !!!
<oDlg> The object that contain the TWbrowse control.
CLAUSES
DESIGN Allows the user to move and resize with the mouse
PIXEL To use pixel coordinates instead of Text coordinates.
Making the DialogBox work ACTIVATE DIALOG <oDlg> ;[ CENTER | CENTERED ] ;[ NOWAIT | NOMODAL ] ;[ WHEN <uWhen> ] ;[ VALID <uValid> ] ;[ ON [ LEFT ] CLICK <uClick> ] ;[ ON INIT <uInit> ] ;[ ON MOVE <uMoved> ] ;[ ON PAINT <uPaint> ] ;[ ON RIGHT CLICK <uRClicked> ]
<oDlg> The variable that is going to hold theDialogBox object. It is a 'reference' to theDialogBox object.
<cResName> The name of the DialogBox inside resource.The resource may be stored in a .RC file or ina .DLL file. Normally you use the 'Rename' option froma resource editor to give a name to the resourceelement.
<cTitle> The title of the DialogBox. You may also change thetitle of a resource DialogBox. This means that youmay use the same DialogBox for different purposes byjust changing its title.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nTop>, <nLeft> The coordinates of the DialogBox when creating the<nBottom>, <nRight> DialogBox from source code.
<hResources> An optional handle to a resource DLL. This is usefulwhen using several DLLs at the same time that holddifferent resources. By default this handle isthe application handle (when using .RC) or the handleof the DLL when using SET RESOURCES TO...
<nStyle> An optional DialogBox style. There are several samplesin the SAMPLES\ subdirectory showing you how tomanipulate this value. If you are using a DialogBoxfrom a resource then you have to select the style frominside the resource editor.
<nClrText>, The fore and back colors of the DialogBox.<nClrBack>
<oBrush> An optional brush to use to fill the surface of theDialogBox.
<oWnd> An optional container object of the DialogBox. Bydefault we use the window that is currently active.If you want to show DialogBoxes control messageson the bottom line of the screen you have to specifyits container.
<oIco> An optional ICON to show when the DialogBox has beenminimized.
<oFont> An optional Font to use for all the DialogBoxes.
<uWhen> WHEN clause that permits the DialogBox to startexecuting.
<uValid> VALID clause to control the ending of the DialogBox.
<nHelpId> The Help topic identifier of the dialog.
<uClick> Optional action to perform when the left mousebutton is clicked over the DialogBox surface.Three parameters: nRow, nCol, nFlags are automaticallysupplied:
nRow The row position (in pixels) where themouse was when it was clicked.
nCol The col position (in pixels) where themouse was when it was clicked.
nFlags A numeric flag which contains informationabout special keys being pressed at thesame time: (values are 'ORed')
Value Description
MK_CONTROL Set if CTRL key is down.MK_MBUTTON Set if middle button is down.MK_RBUTTON Set if right button is down.MK_SHIFT Set if SHIFT key is down.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
You may inspect them using FiveWin lAnd()function:
if lAnd( nFlags, MK_CONTROL )...
if lAnd( nFlags, MK_SHIFT, MK_CONTROL )...
<uInit> An optional action to perform when the DialogBox iscreated but not shown on the screen. In this situationthe DialogBox behaves like a Window, and we may do allkind of operations as we do with a window, (like placinga ButtonBar on it!)
<uMoved> An optional action to be performed when the DialogBoxis moved.
<uPaint> An optional action to be performed when the DialogBoxhas just been painted.
<uRClicked> An optional action to be performed when the right mousebutton has been clicked on the DialogBox surface. Youcan use the same three parameters as in <uClick>.
CLAUSES
VBX You may specify this when using a VBX control in theDialogBox.
PIXEL When you want the DialogBox coordinates (creatingthe DialogBox from source code) to be in pixels.
CENTER If you want the DialogBox to appear centeredCENTERED on the screen.
NOWAIT If the DialogBox has to behave NonModal. NonModalNOMODAL means that other DialogBoxes may be working at the
same time! NonModal programming requires some specialcare:
* Take care of local variables: If you are using somelocals then remember you will go out of the scopeof the function where the DialogBox nonmodal hasbeen created and this may cause problems (only ifyou don't remember it). Clipper works perfectly inthese circumstances as it keeps 'live references'of the local variables inside the codeblocks. Butonly these will be 'alive' out of the function.
* The same DialogBox may be executed several times.Be aware of your DBF management. In these circums-tances your computer is like a NetWork! becausea DBF may be opened several times. It is a goodidea to start learning NetWork programming
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
* Normally we recommend that you not develop NonModalapplications for novice Windows-users. As soonas your clients get more and more used to Windows,NonModal programming is highly recommended. SeeMDI programming (in this documentation) fora very elegant and powerful NonModal programmingstyle.
Defining a external DLL DLL [STATIC] FUNCTION <FunName>( ;function to be called [ <Param1> AS <Type> ] ;at RunTime [ <ParamN> AS <Type> ] ) ;
AS <return> [PASCAL] LIB <DllName>
FiveWin lets you declare an external DLL function to be called at RunTimeby its own name! See DllCall.prg example.
<FuncName> The name of the DLL function. Remember Clipper only uses10 characters maximum length.
<Param1> Name of a parameter.
Length in bytes<Type>, BYTE, CHAR 1<return> WORD, BOOL, HANDLE, HWND, HDC 2
LONG, STRING, LPSTR, PTR 4DOUBLE 8
<DllName> Name of the DLL.
We recommend to develop a C language based connection functions when youare going to develop an intensively work with some DLLs. See "usingWindows API". Examples:
Calling SndPlaySound() at RunTime:
#include "FiveWin.ch"
function Main()
SndPlaySound( "tada.wav", 0 )
return
DLL FUNCTION SndPlaySound( cFile AS LPSTR, nType AS WORD ) AS BOOL ;PASCAL LIB "MMSYSTEM.DLL"
Designing the same DLL connection using C language:
<cName> The name of the font. Example: Arial, Roman, etc...
<nWidth>, Dimensions of the font.<nHeight>
<oWnd> A reference to the Window container.
<oDevice> The device owner of the font.
<nWeight> The weight of the font.
<nEscapement> The escapement of the font.
CLAUSES
FROM USER Displays the Font selection Dialog Box.
BOLD To create the font with bold feature.
ITALIC To create the font with italic feature.
UNDERLINE To create the font with underline feature.
GET Commands--------------------------------------------------------------------------------Creating a GET from @ <nRow>, <nCol> GET [ <oGet> VAR ] <uVar> ;source code [ OF | WINDOW | DIALOG <oWnd> ] ;
[ PICTURE <cPict> ] ;[ VALID <ValidFunc> ] ;[ WHEN <WhenFunc> ] ;[ COLOR | COLORS <nClrFore>;[,<nClrBack>] ] ;[ SIZE <nWidth>, <nHeight> ];[ FONT <oFont> ] ;[ HSCROLL ] ;[ CURSOR <oCursor> ] ;[ PIXEL ] ;[ MESSAGE <cMsg> ] ;[ UPDATE ] ;[ WHEN <WhenFunc> ] ;[ CENTER | CENTERED> ] ;[ RIGHT ] ;[ READONLY | NO MODIFY ] ;[ DESIGN ] ;[ ON CHANGE <uChange> ] ;[ PASSWORD ] ;
@ <nRow>, <nCol> GET [ <oGet> VAR <uVar> ] ;For editing Memos [ OF | WINDOW | DIALOG <oWnd> ] ;
<oFont> A reference to the Font Object to be used with the GET.
<oCursor> A reference to the Cursor Object to dispay over this control.
<cMsg> The associated message of this control.
<nId> The numeric resource identifier of the Control.
<nHelpId> Help topic identifier for GETs from resources.
<nClrFore> Foreground color as a RGB number, or as a xBase string<nClrBack> Background color as a RGB number
<uChange> An action to be performed when the Get changes.
CLAUSES
MULTILINE To use a multiple lines GET control to allow memoMEMO editing.TEXT
UPDATE This control may be updated from TDialog:Update() METHOD
CENTER If the GET containts has to appear centered
RIGHT If the GET containts has to appear right justified.Important: In order to right justify a GET from a DialogBox,it has to be defined at the resource as MultiLine andright and has to use the default font!
PIXEL To use pixel coordinates instead of Text coordinates.
PASSWORD Enter as Password.
DESIGN Allows the user to move and resize with the mouse
HSCROLL Horizontal Scroll
READ ONLY Disables editing in this control.NO MODIFY
Managing HLP files from your applications--------------------------------------------------------------------------------
SET HELP TO <cHLPFile> Sets the default HELP file of the application--------------------------------------------------------------------------------
Help management Functions--------------------------------------------------------------------------------WinHelp() Activates Windows WinHelp program .GetHelpFile() Retrieves the default help file selected .GetHelpTopic() Retrieves the default help Topic .HelpIndex() Shows the default help file index .HelpSearch() Search DialogBox in the default Help file .HelpSetPos() Changes the position of the WinHelp Window .HelpSetTopic() Selects a help default topic .HelpTopic() Reviews a Topic .SetHelpFile() Selects the default Help File .
Icons Commands
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
UPDATE Indicates if this control has to be updated when doinga <oDlg>:Update() of its container.
BORDER Create a border arround the control.
INI Commands--------------------------------------------------------------------------------
Managing an INI file INI <oIni> ;[ FILE | FILENAME | DISK <cIniFile> ]
GET <uVar> ;[ SECTION <cSection> ] ;[ ENTRY <cEntry> ] ;[ DEFAULT <uDefault> ] ;[ OF | INI <oIni> ]
SET ;[ SECTION <cSection> ] ;[ ENTRY <cEntry> ] ;[ TO <uVal> ] ;[ OF | INI <oIni> ]
ENDINI
<oIni> A reference to the INI Object.
<cIniFile> The name of the INI file.
<uVar> A variable with the value loaded from the INI file.This value gets automatically converted to the typeof the variable. So it is important to properlyinitialize the variable before loading its value.
<uDefault> A default value to use when that Entry is not found.
<uVal> The new value to set.
Class TIni INI files management as objects--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------cIniFile INI physical filename
METHODs--------------------------------------------------------------------------------New Constructor from source codeGet Retrieves data from the INI file.Set Writes data into the INI file.DelEntry Deletes an INI section entry.DelSection Deletes an entire INI section.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
ACTIVATE WINDOW <oWnd> ;[ ICONIZED | NORMAL | MAXIMIZED> ] ;[ ON [ LEFT ] CLICK <uLClick> ] ;[ ON RIGHT CLICK <uRClick> ] ;[ ON MOVE <uMove> ] ;[ ON RESIZE <uResize> ] ;[ ON PAINT <uPaint> ] ;[ ON KEYDOWN <uKeyDown> ] ;[ ON INIT <uInit> ] ;[ ON UP <uUp> ] ;[ ON DOWN <uDown> ] ;[ ON PAGEUP <uPgUp> ] ;[ ON PAGEDOWN <uPgDn> ] ;[ ON LEFT <uLeft> ] ;[ ON RIGHT <uRight> ] ;[ ON PAGELEFT <uPgLeft> ] ;[ ON PAGERIGHT <uPgRight> ] ;[ VALID <uValid> ] ;
<oWnd> Window Object container of the window
<uLClick> An action to be performed when the left button of the mouseis clicked over the Window.
<uRClick> An action to be performed when the right button of the mouseis clicked over the Window.
<uMove> An action to be performed every time the Window is moved.
<uResize> An action to be performed every the Window is resized.
<uPaint> An action, generally drawing action, to be performedevery the Window is painted.
<uKeyDown> An action to be performed every a key is pressedbeing the Window focused.
<uInit> An action to be performed, generally some initialization,when the Window is being initialized.
<uUp> An action to be performed when the vertical scrollbaris upwards pressed.
<uDown> An action to be performed when the vertical scrollbaris downards pressed.
<uPgUp> An action to be performed when the vertical scrollbarhas been pagedown clicked.
<uPgDn> An action to be performed when the vertical scrollbarhas been pageup clicked.
<uLeft> An action to be performed when the horizontal scrollbarhas been leftwards clicked.
<uRight> An action to be performed when the horizontal scrollbarhas been righwards clicked.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<uPgLeft> An action to be performed when the horizontal scrollbarhas been pageleft clicked.
<uPgRight> An action to be performed when the horizontal scrollbarhas been pageright clicked.
<uValid> An action to validate to let the window be closed.
<nTop> Window coordinates on screen. We simulate text coordinates.<nLeft><nBottom><nRight>
<nStyle> Determines the characteristics of the window. Thesecharacteristics are define by the following constants(defined in WINAPI.CH):
Constant Purpose
WS_BORDER Window has a border.
WS_CAPTION Window has a title bar (implies theWS_BORDER style). This style cannot beused with the WS_DLGFRAME style.
WS_CHILD A child window. Cannot be used withthe WS_POPUP style.
WS_CHILDWINDOW Same as the WS_CHILD style.
WS_CLIPCHILDREN Excludes the area occupied by childwindows when drawing within the parentwindow. Used when creating the parentwindow.
WS_CLIPSIBLINGS Clips child windows relative to each other;that is, when a particular child windowreceives a paint message, theWS_CLIPSIBLINGS style clips all otheroverlapped child windows out of theregion of the child window to beupdated. (If WS_CLIPSIBLINGS is notspecified and child windows overlap, itis possible, when drawing within theclient area of a child window, to drawwithin the client area of a neighboringchild window.) For use with theWS_CHILD style only.
WS_DISABLED Window will be initially disabled.
WS_DLGFRAME Defines a window with a double borderbut no title.
WS_GROUP Specifies the first control of a group ofcontrols in which the user can move fromone control to the next by using the arrowkeys. All controls defined with theWS_GROUP style after the first controlbelong to the same group. The next control
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
with the WS_GROUP style ends the stylegroup and starts the next group (that is,one group ends where the next begins).Only dialog boxes use this style.
WS_HSCROLL Window has a horizontal scroll bar.
WS_MAXIMIZE Window should be of maximum size.
WS_MAXIMIZEBOX Creates a window that has a Maximize button.
WS_MINIMIZE Define window that is initiallyminimized. For use with theWS_OVERLAPPED style only.
WS_MINIMIZEBOX Creates a window that has a Minimize button.
WS_OVERLAPPED Defines an overlapped window. Anoverlapped window has a title and aborder.
WS_OVERLAPPEDWINDOW Creates an overlapped window having theWS_OVERLAPPED, WS_CAPTION, WS_SYSMENU,WS_THICKFRAME, WS_MINIMIZEBOX, andWS_MAXIMIZEBOX styles.
WS_POPUP Creates a pop-up window. Cannot be usedwith the WS_CHILD style.
WS_POPUPWINDOW Creates a pop-up window that has theWS_BORDER, WS_POPUP, and WS_SYSMENUstyles. The WS_CAPTION style must becombined with the WS_POPUPWINDOW styleto make the System menu visible.
WS_SYSMENU Creates a window that has a System-menubox in its title bar. Used only forwindows with title bars.
WS_TABSTOP Specifies one of any number of controlsthrough which the user can move byusing the TAB key. The TAB key movesthe user to the next control specifiedby the WS_TABSTOP style. Only dialogboxes use this style.
WS_THICKFRAME Creates a window with a thick framethat can be used to size the window.
WS_VISIBLE Creates a window that is initiallyvisible. This applies to overlapped,child, and pop-up windows. Foroverlapped windows, the y parameter isused as a ShowWindow functionparameter.
WS_VSCROLL Creates a window that has a verticalscroll bar.
Note: If this parameter is used it will override thevalues of the following parameters:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
As soon as you start getting comfortable with Windows you will face oneof the more powerful features of it: Multiple Document Interface Windowing.
Most of the Windows commercial applications we use (the Windows ProgramManager is written using MDI) take advantage of the possibilities of MDI.
Basically MDI environment is a main Window which has several child Windowsinside which can be resized, tiled, cascaded, maximized, created and destroyedvery easily. In fact, a MDI environment is like a whole Window environmentall by itself.
These features, which may seem very common to you, won't work if youtry to get create them using standard Windows. Well, you could do it, but itwould mean a lot of code to be written.
Windows, instead, offers the MDI system to create these systems.
Why MDI ?
To make things easier! We automatically get a lot of nice and powerfulfeatures without the need to code them. Windows takes control of everything!
The elements of a MDI environment
There is just one big difference to understand about MDI programming:
Windows keeps an 'invisible' Window which extends the entire the client areaof the 'frame' Window:
+---------------------------------------+MDI Frame --------->|+-------------------------------------+|(is the external || +---------------+ ||and main Window) || | | ||
|| | <-------------- Child Windows|| | | || | (In fact they
MDI Client ----------------> | +----------------+ || | are children of(you don't realize || +-----| | || the MDI clientit is there and || | <--------------| Window)extends the entire || | | ||internal area of |+-------------------------------------+|the MDI frame) +---------------------------------------+
The real 'trick' of the MDI programming is the MDI Client Window which Windowshas implemented.
Developing a MDI environment in C language is a very complicated task. Infact, it is one of the most difficult tasks for beginners. But you are luckybecause doing it with CA-Clipper and FiveWin it is a very, very easy task!
How to do MDI with FiveWin
To create the main MDI frame Window we use the standard FiveWin Windowscreation commands. The only difference is that you must specify theMDI clause. See above.
Now, you start creating the child Windows with the same easy commands.You don't have to worry about the 'ghost' MDI Client Window.
FiveWin automatically manages and talks to the MDI Client Window.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
To create a MDI Child Window you again use the standard Window creationcommands, but you must specify the clause MDICHILD.
All that you already know about FiveWin is still the same! You only haveto remember a few items:
A MDI Frame Window Object has 'DATA' named oWndClient, which is anotherWindows Object -the 'ghost' MDI Client!-.
In fact, the surface you see inside the MDI frame is the MDI Client!!!Don't forget that. So, if -for example- you plan to place a bitmap onthe surface of the MDI frame Window, you really have to place it on theMDI Client. So do this:
@ 2, 2 BITMAP ... OF oWnd:oWndClient
if you forget that, and you just do OF oWnd, you will be placing the bitmap_behind_ the MDI Client, so you will not see the bitmap!!! Remember that!That is the omly 'trick' about MDI programming.
MDI Object Oriented Implementation
If you go deeper in FiveWin architecture, you will discover there are somevery powerful Classes supporting all the Windows MDI implementation.
We have developed three main Classes which inherit from base Window Class:
Class TWindow||-- Class TMdiFrame|-- Class TMdiClient+-- Class TMdiChild
All of them implement new methods to encapsulate all the power Windowsoffers to MDI programming.
Remember this:
TMdiFrame is the main Window. It has data named oWndClient which isa TMdiClient Window.
oWndClient has a Clipper array with all the Child Windows you create.The name of that data is aWnd. It is a normal Clipper array. You may useas you wish.
New MDI directions in FiveWin
In previous releases of FiveWin, we planned to develop some new Classesinheriting from TMdiChild to suit some of the 'normal' business applicationssituations you will face. But now, we have found an easier approach:
Most of the MDI Child Windows you will use will be very similar to each other-once again we stress about business applications development not just'fancy' programming-. They will have a ButtonBar attached and a main controlwhich automatically resizes to extend the whole visible area of theChild Window.
So, we are giving you a really powerful way of developing MDI environmentswhich is quick and clean:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
The way we suggest that you manage MDI child Windows is as follows:
* First, you create the MDI frame. See above syntax.
* Next you start creating -when you need them- the child Windows:Using the above syntax:
DEFINE WINDOW [<oWnd>] ;[ MDICHILD ] ;[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;[ TITLE <cTitle> ] ;[ MENU <oMenu> ] ;[ ICON <oIco> ] ;[ OF <oParent> ]
* Now you create a ButtonBar for this Child Window. Use the standardsyntax:
DEFINE BUTTONBAR oBar OF <oWndChild> // The name of your MDI Child
Attach the buttons in a normal way. Every button will have the actionsyou define:
DEFINE BUTTON OF oBar ACTION ...
DEFINE BUTTON OF oBar ACTION ...
...
Using this approach easily enhances the functionality of the MDIChild Window without the need to develop a new Class -you are free todo it, but only when really necessary!-
* The last step is to create a Control -whatever Class of control you need-and attach it to the Child Window:
@ 0, 0 GET <oControl>... MEMO OF <oWndChild>
@ 0, 0 LISTBOX <oControl> BROWSE ... OF <oWndChild>
etc... -any Class of Control-
And now, we tell the MDI Child to use that control as its main Control:
<oWndChild>:SetControl( <oControl> )
To start using it, you ACTIVATE the Window in the normal way:
ACTIVATE WINDOW <oWndChild> ...
And that is all!
Doing it this way you will be mastering MDI programming in a few minuteswithout the need to create new Classes or learning very difficult MDIprogramming rules.
Let CA-Clipper and FiveWin do the hard work for you. This is the powerof OOPS and xBase!
See the new version of \IDE\IDE.prg for a real full example on MDI
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<oMenuItem> A reference to one of the menuitems of the menu. Eachmenuitem of a menu object is also an object. SEPARATORclause also may specify an optional menuitem variable tostore its related value.
<cMsg> The associated message of this control.
<cBmpFile> The name of a BMP file to be used as the label for amenuitem of the menu.
<cResName> The resource name of the menu.
<uAction> The action to be performed for a specific menuitem.
<bAction> The same action as above expressed as a codeblock.
<nRow>, <nCol> The coordinates where to place the Popup Menu.
<oWnd> The container window of the Menu.
<nState> The state of they accelerator key (see VKEY.CH)
<nVirtKey> ASCII value of the accelerator key.
<nHelpId> The help topic identifier of a specific menuitem.
<uWhen> An expression to be bloquified and evaluated to checkif a menuitem should be enabled or disabled.
<nId> The numeric resource identifier of the menuitem.
<cPrompt> The label of the menuitem.
<bAction> The action to be performed when the Button is pressed.
<oMru> A reference to a new MRU object created
<cIniFile> The name of the related INI file to use with a MRU object.
<cSection> The section inside the INI file where to store the MRU items.
<nItems> The number of items to be managed by the MRU object.
<uAction> The action to perform when selecting a MRU item.
CLAUSES
CHECK If the menuitem has to appear initially as checked.CHECKEDMARK
ENABLED If the menuitem has to appear initially as enabled.by default it is enabled.
DISABLED If the menuitem has to appear initiall as disabled.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<oPag> A reference to the TPages object just created.
<nId> The numeric resource identifier of the control.
<oWnd> The container object of the TPages control.
<DlgName,...> A list with the resources names of the DialogBoxesto manage. Important: These DialogBoxes must havethe style STYLE WS_CHILD | WS_VISIBLE at the RCor DLL file.
<nOption> An optional initial option to use different from 1.
<cDocument> The name of the document to be generated. It is the namethat appears at the Spooler.
<nRow>, The starting coordinates of the print measured in<nCol> printer resolution units. This means that different
printers will generate different looking reports.
In order to avoid this (you want the same looking printoutwith different printers!) you need first to calculate theresolution of the printer, and then, divide those dimensionsby the number of rows and columns that you want:
See SAMPLES\TestPrn2.prg
<cText> The value to print. It may be of any type. FiveWinwill automatically convert it into a string expression.
<oFont> A font object to use when printing the <cText>value. See the FONT xBase commands to properly build a font.It is an optional parameter.
Important: If you want a specific dimension for thatfont independently from the printer used, you must specifythe OF ... clause when creating the font, and after theprinter object has been created:
local oPrn, oFont
PRINT oPrnDEFINE FONT oFont NAME "Arial" SIZE 0, -8 OF oPrnPAGE
...ENDPAGE
ENDPRINT
oFont:End()
Important: You have to :End() the font object once youhave finished and completed your printout work.
<nWidth> A specific printer units width to use whenprinting the <cText> value. It is an optional parameter.
<nClrText> An optional color to use when printing the<cText> value. It is an optional parameter.
CLAUSES
PAGE Starts a new page
ENDPAGE Ends the current printed page
ENDPRINT Ends printing
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
FROM USER Lets the user interactively select the printer to use.If you don't specify this clause, FiveWin will use thedefault printer installed in your system.
PREVIEW Invokes the FiveWin preview system, which lets the userinteractively preview the printout before sending it tothe printer.
ACTIVATE REPORT <oReport> ;[ FOR <for> ] ;[ WHILE <while> ] ;[ ON INIT <uInit> ] ;[ ON END <uEnd> ] ;[ ON STARTPAGE <uStartPage> ] ;[ ON ENDPAGE <uEndPage> ] ;[ ON STARTGROUP <uStartGroup> ] ;[ ON ENDGROUP <uEndGroup> ] ;[ ON STARTLINE <uStartLine> ] ;[ ON ENDLINE <uEndLine> ] ;[ ON CHANGE <bChange> ]
Using Resources--------------------------------------------------------------------------------
You may store your application's resources in a DLL, or embed theminside your EXE file use the Microsoft RC.EXE resource compiler.
To use resources from inside a DLL:
Using DLLs as resources SET RESOURCES TO <cDllName> [,<cDllName>... ]
Selecting one of the SET RESOURCES TO <cDllName>opened resources
Ending the use of the SET RESOURCES TOresource
<cDllName> Is the name of a DLL where resources have beenplaced. It is possible to specify multiple DLLs for resources.
After opening several DLLs as resources it is necessaryto select the one we are going to use. To do so wemust again issue the command:
SET RESOURCES TO <TheSameResourceName>
It is similar to selecting a certain Work Area.
To use resources from inside your EXE:
No special command is required. Just call:
RC.EXE -K MyApp.rc MyApp.exe
After linking your EXE, provide an RC file with all the resourcedefinitions for your application. The SAMPLES\Build.bat we provideautomatically calls RC.EXE if a RC is defined with the same name asthe .prg you are building with build.bat. Applications requiringmultiple .prgs, must have their own .rmk file or batch file to buildthem. Use the above mentioned RC.EXE syntax to embed your resourcesinto your final .exe
RC.EXE is the Windows resource compiler and it is a utility you may
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
[ UP | ON UP | ON LEFT <uUpAction> ] ;[ DOWN | ON DOWN | ON RIGHT <uDownAction> ] ;[ PAGEUP | ON PAGEUP <uPgUpAction> ] ;[ PAGEDOWN | ON PAGEDOWN <uPgDownAction> ] ;[ ON THUMBPOS <uPos> ] ;[ COLOR | COLORS <nClrFore>;[,<nClrBack>] ] ;[ OF | WINDOW | DIALOG <oDlg> ][ MESSAGE <cMsg> ] ;[ UPDATE ] ;[ WHEN <WhenFunc> ] ;[ VALID <ValidFunc> ] ;
For 'non-true ScrollBars'(when using WS_VSCROLL or WS_HSCROLL styles )
DEFINE SCROLLBAR [ <oSbr> ] ;[ HORIZONTAL | VERTICAL ] ;[ RANGE <nMin>, <nMax> ] ;[ PAGESTEP <nPgStep> ] ;[ UP | ON UP <uUpAction> ] ;[ DOWN | ON DOWN <uDownAction> ] ;[ PAGEUP | ON PAGEUP <uPgUpAction> ] ;[ PAGEDOWN | ON PAGEDOWN <uPgDownAction> ] ;[ ON THUMBPOS <uPos> ] ;[ COLOR | COLORS <nClrFore>;[,<nClrBack>] ] ;[ MESSAGE <cMsg> ] ;[ WHEN <WhenFunc> ] ;[ VALID <ValidFunc> ] ;[ OF | WINDOW | DIALOG <oDlg> ]
<nRow>, <nCol> The coordinates of the ScrollBar.We simulate Text coordinates.
<oSbr> A reference to the ScrollBar Object.
<oDlg> The container window of the ScrollBar.
<nMin>, <nMax> The range of values to be represented by the scrollbar.
<nPgStep> The increment of value when PageUp or PageDown isselected on the Scrollbar. That is, when clickingbetween the thumb and the top arrow or when clickingbetween the thumb and the bottom arrow.
<nWidth> The dimensions in pixels of the ScrollBar.<nHeight>
<uUpAction> An action to be performed when going up is selected onthe scrollbar. That is, when clicking on the top arrow orwhen pressing the key K_UP.
<uDownAction> An action to be performed when going down is selected onthe scrollbar. That is, when clicking on the bottom arrow orwhen pressing the key K_DOWN.
<uPgUpAction> An action to be performed when page up is selected onthe scrollbar. That is, when clicking between the thumb
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<uPgDownAction> An action to be performed when page down is selected onthe scrollbar. That is, when clicking between the thumband the bottom arrow.
<uPos> An action to be performed when the thumb is moved by theuser and left on a different position. The new positionis automatically provided as nPos value.
<nId> The numeric resource identifier of the Control.
<nClrFore> Foreground color as a RGB number, or as a xBase string
<nClrBack> Background color as a RGB number
<ValidFunc> An expression to validate when the control is going tolose the focus.
<cMsg> The associated message of this control
<WhenFunc> It is an expression to evaluate indicating if the control isor not enable.
CLAUSES
HORIZONTAL To use a horizontal or vertical scrollbar. Only usefulVERTICAL when creating from source code.
PIXEL To use pixel coordinates instead of Text coordinates.
DESIGN Allows the user to move and resize with the mouse
UPDATE This control may be updated from TDialog:Update() METHOD
<nClrFore> The colors to use for the windows. They may be<nClrBack> numeric RGB colors or xBase string colors.
Activating a Window ACTIVATE WINDOW <oWnd> ;[ ICONIZED | NORMAL | MAXIMIZED ] ;[ ON LEFT CLICK <uLClick> ] ;[ ON RIGHT CLICK <uRClick> ] ;[ ON MOVE <uMove> ] ;[ ON RESIZE <uResize> ] ;[ ON PAINT <uPaint> ] ;[ ON KEYDOWN <uKeyDown> ] ;[ ON INIT <uInit> ]
<oWnd> A reference to the Window Object.
<uLClick> An action to be performed when the left button of the mouseis clicked over the Window.
<uRClick> An action to be performed when the right button of the mouseis clicked over the Window.
<uMove> An action to be performed every time the Window is moved.
<uResize> An action to be performed every the Window is resized.
<uPaint> An action, generally drawing action, to be performedevery the Window is painted.
<uKeyDown> An action to be performed every a key is pressedbeing the Window focused.
<uInit> An action to be performed, generally some initialization,when the Window is being initialized.
FiveWin Header Files--------------------------------------------------------------------------------Colors.ch Color constants definitionsConstant.ch Text to Graphics constants definitionsDDE.ch Commands for Dynamic Data ExchangeDialog.ch Dialog BoxesDLL.ch Dynamic Linking Libraries calling at RunTimeFiveWin.ch FiveWin main header fileFolder.ch Folders and Tabs managementFont.ch Fonts managementIni.ch INI FilesMail.ch Windows MAPI email supportMenu.ch Managing MenusObjects.ch Object Oriented Engine of FiveWinODBC.ch Open DataBase connectivity supportPrint.ch Using the PrinterReport.ch Report engineSQL.ch ODBC headerTcBrowse.ch Column based new BrowseTree.ch Trees supportVideo.ch Video media AVI SupportVKey.ch Windows keys valuesWinApi.ch Windows API definitionsClipApi.h Clipper internal management declarations
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
WinTen.h To avoid conflicts with Windows API Pascal namesxBase common elements--------------------------------------------------------------------------------
We have paid particular attention into the syntax of FiveWin such as usingthe same clause to do the same thing in similar circumstances. This meansthat as soon as you learn these few rules, you may control a lot ofdifferent FiveWin features.
We will keep extending this basic concept to manage all the different partsof the Windows API. Having just a unique xBase interface to manage theWindows API will let you concentrate in the goal of your application andnot in the details.
We use the OOPS message instead of a xBase command,because we may issue it from many different places,where it is not possible to use an xBase command:
REDEFINE BUTTON ID ID_END OF oDlg ;ACTION oDlg:End()
OF Every time we need to specify the owner orcontainer of an Object, we use OF:
REDEFINE BUTTON ID ID_OK OF oDlg
The clause OF means: "belongs to", "it is containedin", "its owner is".
For example, to specify the owner of a DialogBox:
DEFINE DIALOG oDlg RESOURCE "Test" OF oWnd
For a child window: DEFINE WINDOW oWnd2 TITLE "Test" ;OF oWnd1
For a control: REDEFINE GET cName ID ID_NAME OF oDlgFor a font: DEFINE FONT oFont NAME "Arial" ;
SIZE 0, -20 OF oPrn
RESOURCE You may use any of these clauses to specifyRESNAME that an Object has to be built from resources.NAME
DEFINE ... RESOURCE <cResourceName>
For example, to create an icon from resources, we do:
DEFINE ICON oIco RESOURCE "MyIcon"
To create a Dialog Box:
DEFINE DIALOG oDlg RESOURCE "Clients"
To create a cursor:
DEFINE CURSOR oCrs RESOURCE "Eye"
Remember: Always use RESOURCE clause to createan Object from resources stored inside the sameEXE (rc resources) or stored inside a DLL.
FILENAME You may use any of these clauses to specifyFILE than an Object has to be loaded from a file in disk.DISK
DEFINE ... FILENAME <cFileName>
For example to use a button bitmap which pictureis inside a BMP file we do:
DEFINE BUTTON OF oBar FILENAME "Exit.bmp"
To create a bitmap control from disk we do:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
TWindow Window base Class .||--- TDialog Dialog Boxes .||--- TBar Button bar .||--- TMdiFrame MDI support .|--- TMdiClient MDI support .|--- TMdiChild MDI support .||--- TMsgBar Messages bar .|+--- TControl Base Class for controls .
||--- TBitmap Pictures in Bitmaps .|--- TButton PushButtons .|--- TCheckBox Logical checkboxes .|--- TComboBox Get + ListBox functionality .|--- TFolder FiveWin Folders .|--- TGet Typical Clipper GET .|--- TIcon Icons as controls .|--- TListBox ListBox selection list .|--- TMeter Meter controls .|--- TMultiGet Gets for Memo editing .|--- TPages Multiple DialogBox pages management .|--- TRadio Radio controls .|--- TScrollBar ScrollBars controls .|--- TTabs FiveWin Tabs .|--- TVbX Visual Basic controls .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
+--- TWBrowse Browse controls .|+--- TCBrowse Browse with column objects
TLinkList Linked-Lists data structures (Trees) .TTreeItem TreeItems Class (used by trees) .
TMenu Menu Class .TMenuItem Menu MenuItems .
TBlock FiveWin disk-storable codeblocks .
TMCI Media Control interface .+--- TVideo AVI Video controls .
TRadMenu Radio Controls Menu .
TOdbc ODBC Sessions management .TDbOdbc ODBC each DataBase managed .
TPen Pen Class .
TPrinter Printer Class .
TReport Report engine .TrColumn Report columns .TrGroup Report Groups .TrLine Report single line ..
TTime Time Class .TTimer Timer Class .
TDataBase DataBase Class .
2. Classes and Objects
Class TBar Inherits from TControl--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------aButtons Array of TBtnBmp objectsnGroups Number of groupsnMode The position of the BtnBar on the windownBtnWidth The height and width of its buttons. By default is 28x28nBtnHeight The height of the Bar is automatically adjusted to the
height of the buttons.l3D If the BtnBar has to be shown 3DLook
METHODS--------------------------------------------------------------------------------New Constructor from source code.NewAt Constructor from source code at a certain location.Add Add a BtnBmp to the bar.AddGroup Adds a new logical group to the bar.Adjust Adjust the Button bar to the dimensions of its containerwindow.AdjMode Changes the BtnBar position to floating
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Del Deletes a button from the bar.DelGroup Deletes a logical group from the bar.Display Displays the button barcGenPRG Returns a string with the source code of the button barFloat Turns the buttonbar into floating mode.FloatClick Processes MouseClicks on the float mode buttonbar.GetBtnTop Returns the appropriate nTop when adding a new buttonGetBtnLeft Returns the appropriate nLeft when adding a new buttonGoDown Turns the buttonbar into down mode.GoLeft Turns the buttonbar into left mode.GoRight Turns the buttonbar into right mode.GoTop Turns the buttonbar into top mode.LeftMode Changes the BtnBar position to the left of the windowMouseMove Activates the default message on window owner MsgBarPaint Displays the ButtonBar. Use :Refresh() instead this.RButtonDown Processes mouse right clicks on the buttonbar.RightMode Changes the BtnBar position to the Right the windowTopMode Changes the BtnBar position to the Top of the windowClick Mouse left button event handlerSaveIni Saves the bar to an INI fileSetMsg Set the text of the message bar of its container windowGetBtnCol Computes the column of the new Button
Class TBitmap Bitmaps controls--------------------------------------------------------------------------------
Inherits from TControl
DATA--------------------------------------------------------------------------------nX Relative origin coordinates of the picture.nY Relative origin coordinates of the picture.hBmpPal Handle and palette of the BitmapcBmpFile Name of the BMP file to displaycResName Name of the BMP resource to displaylStretch True if image has to be adjusted to all visible arealScroll True if image may be scrolled into its own visible areaaHotAreas An array with some hot-areas on the bitmapnVStep Units to scroll on vertical scrollnHStep Units to scroll on horizontal scrollnZoom Units to zoom the picture.
METHODS--------------------------------------------------------------------------------New Constructor from source codeDefine Constructor for resourcesReDefine Constructor for resourcesEnd Ends control and make it disappearCommand Processes WM_COMMAND WinApi messagesDefault Default initialization of the BitmapDestroy Destroy the bitmap object.Display Displays the bitmap. Use :Refresh() instead to force it.GotFocus Action to be performed when getting the focusHScroll Horizontal ScrollBar messages dispatcherInit Generic Control initialization methodInspect Interactive load of Bitmap.LButtonDown Action to be performed when clicking the mouse.Load Load the bitmap from resourcesLoadBmp Load bitmap from disk.nHeight Retrieves height of the image.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
nWidth Retrieves width of the image.nXExtra Retrieves the size of image which it is not visiblenYExtra The same for the other axisPaint Draws the bitmapReload Load again a bitmapResize Changes the dimension of the bitmapScrollAdjust Updates the values on the scrollbarsScrollDown Scrolls the bitmap DOWN if lScroll is .t.ScrollLeft Scrolls the bitmap LEFT if lScroll is .t.ScrollRight Scrolls the bitmap RIGHT if lScroll is .t.ScrollUp Scrolls the bitmap UP if lScroll is .t.SetBmp Load bitmap from resource.SetFore Set this bitmap palette as the main active paletteVScroll Vertical ScrollBar messages dispatcherZoom Zoom the picture.
Note: The ScrollXXX Methods assume that lScroll is TRUE AND thatthe BitMap is larger than the visible area
Class TBlock--------------------------------------------------------------------------------DATAcExpression A string with the block expressionbBlock the expression codeblock--------------------------------------------------------------------------------METHODSNew Creates a new codeblockEval / Exec Executes the codeblock
Class TBtnBmp Inherits from TControl--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------bAction CodeBlock for the click event.cMsg Message bar Text.lPressed Is button is pressed.lCaptured Is mouse is captured by the button.lAdjust If the bitmap has to be resized to cover all its surfacehBmpPal1 The main image of button.hBmpPal2 The image of button pressed for animated button.
METHODS--------------------------------------------------------------------------------New Constructor from source codeNewBar Constructor from source code for Button BarReDefine Creates a BtnBmp from resourcesClick Mouse left button event handlerFreeBitMaps Releases all the bitmaps associated with this controlcGenPRG Generates the source code of this controlHandleEvent Generic events handlerLButtonDown Behavior when pressing the mouseLButtonUp Behavior when releasing the mouse clickLoadBitmaps Load the bitmap/s from resourcesPaint Draws the ButtonMouseMove Behavior when moving the mouse over itRelease Destroy the Button imageSetFile Changes to a different BMP file
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Class TBrush--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------hBrush Handle of the brush.hBitmap Handle of Bitmap if the brush is an image.
New Constructor from source code.cGenPRG Returns a string with the source code of the Brush.End/Realise Destroy the Brush image.
Class TButton Inherits from TControl--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------bAction CodeBlock for the click event.lDefault The button has default style.
METHODS--------------------------------------------------------------------------------New Constructor from source code.ReDefine Constructor for resources.cGetPRG Generates the source code of the button.Click Mouse left button event handler.Colors Overrides control Color() management.cToChar Generates a data template to build a Dialog.GotFocus Action to be performed when getting the focus.Init Action to be performed on init.KeyDown Action to be performed when a key is pressed down.LostFocus Action to be performed when losing the focus.MouseMove Action to be performed when moving the mouse over.
CLASS TCBrowse FROM TWBrowse Column based browse .--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------lRegistered Internal. Used to register a new class.aColumns An array holding all the column objectsaArray Holds the array, when browsing an arraylNoHScroll Don't display the vertical scrollbarlNoLiteBar Don't use a different color to hilite barlNoGrayBar Don't use a different color to lostfocus barlLogicDrop Use a combobox when editing a logical valuenAdjColumn Column index to expand to flush table windowlRepaint Bypass paint if falsenFreeze Freeze nFreeze left most columnsoDbf Holds DataBase object when usedoCtx Holds context object when usedlColDrag Allows column exchange by dragginglLineDrag Allows column width resize with the mousenDragCol Column being mouse dragged
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
lAutoCtx True when managing a context objecthBmpCursor Bitmap handle to display on first columnbSeekChange Expression to eval when record changescSeek Last expression to seek on incremental searchnColOrder Column which index is the active onenOClrForeHeadnOClrBackHeadcOrderType
METHODS--------------------------------------------------------------------------------New Constructor. Creates a new browse from source code .ReDefine Constructor from resources .Destroy Specific destroy for these objects. Internally called. .GotFocus Method to execute on receiving focus event. Internal. .LostFocus Method to execute on losing focus event. Internal .BeginPaint Method to execute on beginpaint event. Internal .Paint Method to execute on paint event. Internal. .EndPaint Method to execute on Endpaint event. Internal .Default Performs default initialization of the browse. Internal. .DrawLine Draws a specific line of the browse. Internally used .DrawSelect Draws the line that is currently selected. Internal .DrawHeaders Draws the headers of all visible columns. Internal .ResetSeek Resets the seek expression on incremental search .SetOrder Selects a column index tag .GoDown Select next browse row .GoUp Select the previous browse row .Seek Performs an incremental search based on nKey value .PageUp Goes up one page .PageDown Goes down one page .KeyChar Method to handle WM_CHAR events. .LButtonDown Left mouse click events manager .LButtonUp Left mouse releasing events manager .LDblClick Left double click events management .lEditCol Edits a cell of the browse .nAtCol Returns the column placed at a specific pixel position .MouseMove Mouse Movements events manager .Report Automatically generates a Report from the browse .Reset Resets all browse navigation associated data .ResetBarPos Set the scrollBar thumb according to the default tag .SetArray Browses an array .SetoDBF Browses a DataBase object .SetContext Sets a context object to be used .VertLine Controls the column width mouse resizing .AddColumn Adds a new column to the browse .SwitchCols Exchanges two columns without displaying them again .Exchange Exchange two columns and displays them .
TcColumnDATA--------------------------------------------------------------------------------cHeading Optional Header textbData Mandatory Code block to return column datacPicture Optional picture clausebClrFore Optional Foreground Color blockbClrBack Optional Background Color blocknAlign Optional Alignment DT_LEFT or so onnWidth Optional WidthlBitMap Optional Bitmap FlaglEdit True if editing is allowablelNoLite True to skip cell during SelectlLine()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
METHODS--------------------------------------------------------------------------------New Constructor from source code.ReDefine Constructor for resources.Click Mouse left button event handler.Default Default initialization.cToChar Generates a data template to build a Dialog.Init Generic initialization.MouseMove Action to be performed when moving the mouse over.Refresh Repaints the control.cGenPRG Generates the source code of the control.
Class TClipBoard--------------------------------------------------------------------------------
The clipboard provides a mechanism that makes it possible for applicationsto pass data handles to other applications. Clipboard functions carry outdata interchange between Windows applications.
DATAs--------------------------------------------------------------------------------nFormat Type of data placed in ClipboardoWnd Container object
METHODs--------------------------------------------------------------------------------New Constructor from source codeClear Open, clear Clipboard contents and close itClose Close the Clipboard to end using itEmpty Clear Clipboard contents if it's openEnd Open, clear Clipboard contents and close itGetData Get the content of ClipboardGetText Get the text placed in the ClipboardOpen Open the Clipboard to start using itSetData Set the content of ClipboardSetText Places text in the Clipboard
Class TComponent FROM TControl Visual management of Non-Visual objects--------------------------------------------------------------------------------
aProperties Array of editable Properties.aEvents Array of editable events.hBmp handle of a related bitmap to represent the non-visual object.bInspect CodeBlock to inspect the contained non-visual object.
METHODS--------------------------------------------------------------------------------New Constructor from source codeDestroy Destroy the object.Display Displays the control. Use :Refresh() to force repaintLDblClick Action to be performed on left double click. Invokes bInspectPaint Draws the control. This process occurs inside Display.
Class TComboBox Inherits from TControl--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------aItems Array of Items of the ComboBoxnAt Index of the current select itemaBitmaps Array of Bitmaps of the ComboBox if ownerdraw style usedlOwnerDraw If it is an ownerdraw style ComboBoxnBmpHeight Height to use for painting the ownerdraw bitmapsnBmpWidth Width to use for painting the ownerdraw bitmapsbDrawItem CodeBlock to evaluate to select a ownerdraw bitmap to paintcError Error description when using a ComboBox for browse cell editingoGet Contained GET for DropDown ComboBoxes if STYLE CBS_DROPDOWNspecifiednStyle internally used when specifying a STYLE CBS_DROPDOWN ComboBox
METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesAdd Add an item to the combobox items listcToChar Generates a data template to build a DialogBoxChange Changed event responseDefault Default initializationDefControl Register the control as a contained child of a container objectDel Deletes an itemDestroy Destroys the controlDrawItem OwnerDraw items paintingFillMeasure Calculates the dimension of an ownerdraw itemFind Checks if a specific string is contained at its items listFindString Returns the specific index position of an item in its listInit Generic initialization on DialogBoxesInsert Insert an itemLostFocus Action to be performed when loosing the focuslValid ComboBox validation when loosing the focusModify Modify the text of an itemMouseMove Action to be performed when moving the mouse over itOpen Opens the ComboBox related listRefresh Forces the control to be repaintedReset Empty all contents of the ComboBox and the array aItemsSelect To select a string in the list box of a combo box by indexSet To select a string in the list box of a combo box by textSetBitmaps To set the bitmaps to be used by the ownerdrawSetItems Changes the items shown in the comboboxShowTooltip Shows its tooltipVarGet Retrieves the associated Clipper variable value
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
New Constructor from source codeBreak Blocks the communication port.Close Closes the communication port.Error Shows the errors messages.Escape Sends the escape sequence.Flush Leaves empty the communication buffer.SetUp Setups the communication port.UnBreak Unlock the communication port.Write Send a string to the communication port.
Class TControl Inherits from TWindow-------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------bSetGet Code Block to manage the variable associated to the controlbChange Action to be performed when there is a major changecCaption Text caption of the ControllCaptured If the control has the mouse capturedlDrag If the control should be moved aroundlMouseDown Is the mouse button down on the controllUpdate If the control has to be updated when updating the DialognLastRow The last screen row where the mouse was positioned.nLastCol The last screen column where the mouse was positioned
METHODS------------------------------------------------------------------------------Change Virtual Method to execute when generic changing of the control.Click Virtual Method to execute when generic clicking of the control.cToChar Control Data to template convertor for creating Dialog Boxes.Init Generic Control initialization method .Default Default initialization .EraseBkGnd Erase Background of control .FWLostFocus Handle losing focus by control .GetDlgCode Handle changing of controls .GetNewId Generates an unique control ID .GotFocus Action to be performed when getting the focus .LostFocus Action to be performed when losing the focus .End Ends control and make it disappear .HandleEvent Generic control Handle Event method .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
KeyDown Action to be performed when pressing a control key .SetFocus Set keyboard focus to control .Colors Returns the colors of the control .DrawItem Generic base DrawItem procedure .FillMeasure Generic Fill Measure method .Set3DLook Enables the 3D look .VarPut Modify the value of the associated variable through bSetGet .VarGet Load again the variable value associated .LButtonDown Action to be performed when clicking the mouse .LButtonUp Action to be performed when releasing the mouse .MouseMove Action to be performed when moving the mouse over .KeyChar Action to be performed when pressing a key .ForWhen WHEN clauses control .Display Displays the control. Use :Refresh() to force repaint .Paint Draws the control. This process occurs inside Display. .SysCommand Handle system commands sent to the control .
Class TCursor Mouse cursors managed as objects--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------hCursor Handle of the cursor.lPredef If it is a Windows system predefined cursor.
METHODs--------------------------------------------------------------------------------New Constructor from source code .End Destroys the cursor object
CLASS TDataBase DataBases management as objects--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------cAlias The workarea alias where the DataBase object has been createdcFile The name of the DBF file associatedcDriver The name of the driver associatedlShared If the workarea is sharedlReadOnly If the workarea is readonlybBoF CodeBlock to execute when BoF()bEoF CodeBlock to execute when EoF()nArea The workarea order used (i.e.: 1,2,3, ... )lBuffer To use or not a buffer. It is a must for NetWorking!aBuffer An editing buffer holding fields temporary data .
METHODs--------------------------------------------------------------------------------New ConstructorSkip Skips like DbSkip()Activate Select its workarea as the one currently activeAddIndex Adds a new indexAppend Adds a new recordBlank Empties the editing bufferBof Checks if beginning of fileClose Closes the workareaCloseIndex Closes an indexCommit Flushes pending file buffersCreate Creates a new DataBaseCreateIndex Creates a new IndexClearRelation Clear active relationsDeActivate Closes the database. It acts like DbCloseArea()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
DbCreate Creates the DBF file from its structure in a arrayDelete Mark a record for deletionDeleted Return the deleted status of the current recordDeleteIndex Remove a specified order from an order bagEof Determine when End of file is encounteredEval Evaluates a codeblock for records matching a scope/conditionFCount Return the number of fields in the current DBF fileFieldGet Retrieve the value of a field variableFieldPut Set the value of a field variableFound Determine if the previous search operation succeededGoTo Move to the record having the specified record numberGoTop Move to the first logical recordGoBottom Move to the last logical recordIndexKey Return the key expression of a specified indexIndexName Return the name of an order in the Order listIndexBagName Return the Order bag name of a specified OrderIndexOrder Return the position of an Order in the current Order ListLastRec Determine the number of records in the current DBF fileLoad Loads the record contents into the editing bufferLock Lock an open and shared database filePack Removes all record marked for deletionReCall Restore records marked for deletionRecCount Determine the number of records in the current DBF fileRecLock Lock the current recordRecNo Return the current record numberSave Saves the editing buffer contents into the DBF fileSetBuffer Activates/Deactivates the editing buffer .Seek Move to the record having the specified key valueSetOrder Set focus to an order in an Order listSetRelation Relate two work areasSkip Move relative to the current recordSkipper Try to skip a certain amount of recordsUnLock Release all locks for the current work areaUse Use a database file in a work areaUsed Determine whether a database file is in USEZap Remove all records from the current database file
Class TDbOdbc ODBC DataBase management--------------------------------------------------------------------------------
FiveWin implements the Class TDbOdbc to simulate the xBase managementstyle on any ODBC used table.
DATAs--------------------------------------------------------------------------------hStmt The handle of the SQL statement to process.oOdbc A reference to the related TOdbc session objectaFields Array containing all the DataBase fields descriptionnRetCode Returned code from the latest operationcLastComm The latest executed SQL command
METHODs--------------------------------------------------------------------------------New Constructor from source codeEnd Ends control and make it disappearCancel Cancels the current in process SQL statementExecute Execute an SQL statementGetCurName Gets the current assigned cursor nameGetOptionsInitFields Loads all DataBase fields descriptions into ::aFieldsLastCommand Last executed command
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
LastError Retrieves the last errorFieldGet Retrieves the contents of a fieldFieldGetBlob Retrieves the contents of a BLOB field into a disk fileFieldName Retrieves the name of a fieldFieldType Retrieves the type of a fieldFieldLen Retrieves the len of a fieldFieldDec Retrieves the number of decimals of a fieldParamDataPrepare Prepares a SQL command so next time won't be parsed againPutData Changes the current cursor pointed table valuesRowCount Retrieves the number of fields of the DataBaseSetCurName Sets a name for the cursor in useSetOptions Set several SQL optionsSetParam Sets a param description for next SQL statementSkip Skip to the next record
Class TDbm Class DataBase Manager--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------aFields Array of fields objectsaIndexes Array of index objectsoDict related dictionary (Class TDict) object
METHODS--------------------------------------------------------------------------------New ConstructorRedefine Constructor from the dictionary (considered as a resource)AddField Adds a new field descriptionAddIndex Adds a new index descriptionReadFields Load the fields descriptions from the dictionary objectReadIndexes Load the indexes descriptions from the dictionary objectWriteFields Save the fields descriptions from the dictionary objectWriteIndexes Save the indexes descriptions from the dictionary objectCreate Creates the DataBase file DBF from the aFields description
Class TDde--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------nService The service on which to establish the connection.nTopic The topic on which to establish the connection.nItem The item on which to establish the connection.bAction Action to be performedbEnd Action to perform when ending the DDE link (VALID)oWndServer Container TWindow object of the TDDE object.lActive If the DDE connection is still active
METHODS--------------------------------------------------------------------------------New Constructor from source codeActivate To initiate a conversation with server applications
responding to the specified application and topic names.Execute To send a string to the server to be processed as a
series of commands.End Ends the DDE connection
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Class TDDEMLServer DDEML Server Object management--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------hInst A handle of the DDEML instance sessionhConv A handle of the DDEML conversationcService The name of the servicehService The handle of the servicelConnecting If the server is in the process of connecting with a ClienthSz2 Some processes require to hold a hSZ2 handle stored hereaClients An array with all the attended ClientsbOnConnect The action to perform when connecting to a clientbOnRequest The action to perform on a client requestbOnDisconnect The action to perform when a client disconnectsbOnExecute The action to perform on a Client Execute command
METHODs--------------------------------------------------------------------------------New Constructor METHODConnect Automatically called when a Client wants to connectConnectConfirm Automatically called when a Client has finally connectedDisconnect Automatically called when a Client has disconnectedExecute Automatically called when a Client has sent a commandRequest Automatically called when a Client has done a requestReturn Use this method to return data to a Client Request
Class TDDEMLClient DDEML Client Object management--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------hInst A handle of the DDEML instance sessionhConv A handle of the DDEML conversationcService The name of the servicehService The handle of the servicecTopic The name of the topic to keep the conversation abouthTopic The handle of the topicnTimeOut The timeout to wait for an answer. Default 1000. Use -1 forASync.
METHODs--------------------------------------------------------------------------------New Constructor METHODConnect To connect to a ServerDisconnect To disconnect from the ServerEnd Disconnects from the Server. Same as aboveExecute Sends a command to the Server.Request Request data from the Server.
Class TDialog Inherits from Class TWindow--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------cResName Resource Name of the DialoghResources Handle of the Resource where to find the DialoglCentered Logical value if centering the Dialog when paintinglModal Logical value if the Dialog Box is modal
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
lModify Logical value to allow using the Controls -notimplemented-bStart Action to be performed automatically just once at start
METHODS--------------------------------------------------------------------------------New Generic constructor method .Define Alternative constructor .Activate Starts interaction with the Dialog Box .Close() Close dialog box .Command Handle commands sent to dialog box .cToChar Translate handle to structure item .DefControl Connect control to dialog box .Destroy Destroy dialog box .Display Dialog box .End End dialog box .EraseBkGnd Erase background of dialog box .FocusNext Give focus to next control in dialog box .GetItem Get the handle of a certain control .GotFocus Called when dialog receives focus .HandleEvent Event handler for dialog boxes .Init() Handle initialization of dialog box .LostFocus Handles losing focus by dialog box .QueryEndSession Check if application can be closed .VbxFireEvent Handling of VBX events by dialog box .
Class TDict FiveWin DataDictionary--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------aDbfs Array of Dbfs.aFlds Array of fields.aIndexes Array of index.aViews Array of views.aBrws Array of Browses.cPath Full path of the data base file.
METHODs--------------------------------------------------------------------------------New Constructor from source codeCreate Build all dictionary related filesImport Imports files from another data base.Load Uses a data base file from disk.
Class TField--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------cName Name of the field.cType Type of the field.nLen Length in numeric fields.nDec Number of decimals in numeric fields.
METHODS--------------------------------------------------------------------------------New Constructor from source code.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Class TFile Low level files management as Objects--------------------------------------------------------------------------------
Class TFile is the base class for binary files manipulationFrom this class we inherit all file manager sub classes.
DATA--------------------------------------------------------------------------------cName File name.hFile Handle of the filenLen Length of the filenBufferLen Buffer length.nMode Opening Mode.
METHODS--------------------------------------------------------------------------------New Constructor from source codeCreate Creates the file.End Ends control and make it disappear.AppByte Adds a Byte to the end of the file.AppStr Adds a String to the end of the file.AppWord Adds a word to the end of the file.cGetStr Retrieves a String from the file.Close Closes the file.Count Number of times that a string appears in the file. CRLF asdefault.DelBytes Deletes a specified number of bytes from the current position.GoBottom Go to the bottom of the file.GoTo Go to a specified file offset.GoTop Go to the top of the file.InsBytes Inserts a specified numbers of bytes always from current position.lBoF True if at the begining of the file.lEoF True if at the end of the file.nGetByte Get a byte from the actual file offset.nGetWord Get a word (two bytes) from the actual file offset.nRecNo Actual offset position inside the file.Open Open the file.PutByte Write a byte at the current file offset.PutStr Write a String at the current file offset.PutWord Write a Word (two bytes) at the current file offset.Seek Search for determinate String. Starts from the current position.Skip Skips a determinate number of bytes.
Class TFolder FROM TControl--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------aPrompts Array of PromptsaDialogs Array of NonModal DialogBox objectsnOption Current selected pagenTabSize Size of the tabsoFont2 Bold Font typeaEnable Array of enabled pages
METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from Resource
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
AddItem Adds an Item to the Folder.Default Default control initializationDelItem Deletes an Item from the Folder.Destroy Destroy the Folder object.Display Displays the control. Use :Refresh() to force repaintGetHotPos Returns the page index of a specified hotkeyGotFocus Event response code when receiving focusInit Generic Control initialization methodLButtonDown Action to be performed when clicking the mousePaint Draws the control. This process occurs internally from Display.Refresh Repaints the folder on the screenReSize Event response code when resizing the folderSetOption Changes the current active folder pageUpdate Sends an Update message to all the contained Dialog objects.
Class TFont--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------cFaceName Typeface name used (i.e.: "Arial" )hFont The WinApi handle of the fonthFontOld The handle of the font that was selected previouslylBold If it is boldlItalic If it is italiclUnderline If it is underlinelStrikeOut If it is strikeoutnHeight The height of the fontnWidth The width of the fontnEscapement The escapement of the fontnOrientation The orientation of the fontnWeight The weight of the fontnCharSet The charset of the fontnOutPrecision The outprecision of the fontnClipPrecision The clipprecision of the fontnQuality The quality of the fontnPitchFamily The pitch family of the font
METHODS--------------------------------------------------------------------------------New Constructor method. Builds a new fontChoose Builds a new font interactivelyEnd Finish the use of a font and release itActivate Set a font as defined for a specific device contextDeActivate Deselects the current font from the device context
Class TGet Inherits from TControl--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------oGet Standard MsDos Get related object to use its buffer contentsnClrFocusText Color for the get text when receiving focusnClrFocusPane Color for the get back when receiving focusnPos Position of the cursor (caret)
METHODs--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesAssign Assigns the buffer value to the GET related variable
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
cGenPrg Generates the xBase source code of this controlCopy Copy the contents of the buffer in the ClipboardCreate Creates a GET control. Internally usedcText Get/Set the text of the TGet Object.cToChar Generates a data template to build a DialogCut Cut selected text and copies it at the clipboard.Default Default control initializationDispText Displays the buffer contentsEditUpdate Updates the variable and the displayGetDelSel Returns the text selected and deletedGetSel Retrieves the selected text from the TGet editing buffer.GetSelPos Returns the selected text positionsGotFocus Action to be performed when receiving the focusHandleEvent Generic events handlerInit Generic control initializationKeyChar Action to be performed when pressing a keyKeyDown Action to be performed when pressing a control key.KeyUp Action to be performed when releasing a keystroke.LButtonDown Action to be performed when clicking the mouse.LButtonUp Action to be performed when releasing the mouseLostFocus Action to be performed when losing the focuslValid Validates the getMouseMove Action to be performed when moving the mouse overMove Action to be performed when moving the mouse over the controlPaste Paste the Clipboard contents into the editing bufferRButtonDown Action to be performed when clicking the right button of mouse.Refresh Repaints the controlSave Updates the variable value from the bufferSelectAll Selects all the text.SetPos Changes the cursor (caret) position.SetSel Set a certain text as selected.UnDo Undoes the last modification.
Class TGroup Inherits from TControl--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------No data is added.
METHODS--------------------------------------------------------------------------------New Constructor from source code.ReDefine Constructor from resource.cToChar Control Data to template convertor for creating DialogBoxes.HandleEvent Generic control Handle Event method.Init Generic Control initialization method.
Class TIcon Inherits from TControl--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------cIcoFile *.ICO filename if load it from disk.cResName Resource name if load it from a resource ( DLL, RES, RC )hIcon Windows handle of the icon.
New Constructor from source code.ReDefine Constructor from resource.Destroy Destroy the object.Display Displays the control. Use :Refresh() to force repaint.End Ends control and make it disappear.Init Generic Control initialization method.Paint Draws the control. This process occurs inside Display.SetFile Name of the icon file.SetName Set a new name for the icon.
Class TIndex--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------cDbfName DBF name.cName Key name.cTag Tag name.cExpression Expression to evaluate for Index creation.lUnique Logical UniquelDdescending Ascending(default)/DescendingcComments Additional CommentscType
METHODS--------------------------------------------------------------------------------New Constructor from source code.Create Create a physical index file.
Class TIni INI files management as objects--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------cIniFile INI physical filename
METHODs--------------------------------------------------------------------------------New Constructor from source codeGet Retrieves data from the INI file.Set Writes data into the INI file.DelEntry Deletes an INI section entry.DelSection Deletes an entire INI section.
Class TLex FROM TFile--------------------------------------------------------------------------------
FiveWin - Lexical analizerIt returns the different tokens found inside a file.
DATA--------------------------------------------------------------------------------aTokens Array of string tokens to identifyaIds Array of numeric identifiers for each found tokenlSkipBlank To automatic skip spaceslSkipCRLF To automatic skip carriage-return and line-feedcToken Last read token string valuecSeparators A string with all separators
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
cText To analyze text from memorynTxtPos Text index position when using cTextnTokNum Token identifier for numbers
METHODS--------------------------------------------------------------------------------New Constructor from source codelEoF Retrieves the total number of lines.nGetByte Get a byte from the file.nGetToken Get a token from the file.SetText //
Class TLibFile FROM TFile--------------------------------------------------------------------------------
Class TLibFile inherits from TFile and providesmanipulation for LIB files. See SAMPLES\TestLib.prg and TestLib2.prg
METHODS--------------------------------------------------------------------------------nSignature() Signature of a LIB filenPageSize() Number of pages inside LIBnDirPages() Number of pages of LIB diraModules() Array with all module names
Class TLibFile FROM TFile--------------------------------------------------------------------------------
Class TLibFile inherits from TFile and providesmanipulation for LIB files. See SAMPLES\TestLib.prg and TestLib2.prg
METHODS--------------------------------------------------------------------------------nSignature() Signature of a LIB filenPageSize() Number of pages inside LIBnDirPages() Number of pages of LIB diraModules() Array with all module names
Class TLinkList Managing Linked-Lists data structures--------------------------------------------------------------------------------
FiveWin implements a Class TLinkList to manage 'trees'. Trees are avisual representation of Linked-Lists data structures. Using a TWBrowseobject we can visually represent the Link-List structure as a treewhere each leave is a TTreeItem object.
Windows 95 implements its own 'Tree' control, but thanks to Class TLinkListand Class TTreeItem (and using a TWBrowse object) we may use trees underWindows 3.1 and NT 3.51.
See xBase TREE ... ENDTREE explanation to understand how to create atree object. Once the tree is created, you may visualize it using theTWBrowse Method SetTree( oTree ):
oFirst First item referenced by the LinkListoLast Last item referenced by the LinkList
METHODs--------------------------------------------------------------------------------Add Adds an item to the LinkListDraw Recalculates all drawing lines of the entire treeEnd Destroyes the LinkList objectGetLast Returns the last item of the LinkList (including subtrees)nCount Total Number of itemsOpenAll Open all subtreesEval Evals a codeblock for each TreeItem of the LinkList.
Class TListBox Inherits from TControl--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------aItems Array of Items of the ListBoxaBitmaps Array of related bitmaps handles for ownerdraw ListBox.lOwnerDraw If it is a ownerdraw ListBox.nBmpHeigth Height of bitmaps if ListBox is OwnerDrawnBmpWidth Width of Bitmaps if Listbox is OwnerDrawcFileSpec FileSpec to display a fields directory items.bDrawItem Optional codeblock to select what bitmap to draw on a ownerdraw
METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesAdd Add an Item to the list.aSelections Array with selected items on a MultiSelect ListBox.cGenPrn Generates the xBase source code of the controlChange Changed event handler.cToChar Generates a data template to build a DialogBoxDefault Default Listbox initializationDel Deletes an Item.Destroy Destroys the control. Automatically called.DrawItem DrawItem event handler.FillMeasure FillMeasure event handler.GetItem Retrieves the text of any item.GetPos Retrieves the index of the currently selected item.GetSel Index number of the selected item. Zero if no item selectedGetSelCount Retrieves the number of selected items on a multiselect ListBoxGetSelItem Retrieves the current select item as textGoBottom Go to the last item in the listboxGoTop Go to the first item in the listboxInit Generic control initializationInsert Insert an Item.IsMultipleSel Check if the ListBox is multiple selection styleLen Retrieves the length of the list.LostFocus Behavior when losing the focusModify Modify the text of an Item.MouseMove Behavior when moving the mouse over the controlReset Empties the list.Select Select an item by its orderSet Select an item by its textSetBitmaps Sets the ownerdraw related bitmapsSetItems Changes the items of the listboxSetSel Selects a different item
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
SetSelItems Select a group of items on a multiselection ListBoxSwapDown Toggles an item with its following oneSwapUp Toggles an item with its preceding oneVScroll Vertical scroll events handler
Class TMail Windows MAPI management as objects--------------------------------------------------------------------------------
FiveWin - Windows MAIL services Object Oriented implementation
DATAs--------------------------------------------------------------------------------cSubject Mail subject descriptioncNoteText Text of the mailcMsgTypecConversationIDdDate Date of the mailcTime Time of the maillReceipt Has received the maillFromUser Interactively select the mail subject, target, etcaOrigin An array with all origin sendersaRecipients An array with all recipients receiversaFiles An array with all related files to send attached
METHODs--------------------------------------------------------------------------------New Constructor from source codeActivate Start the mail.End End the mail.
Class TMci Media Control Interface object oriented management--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------nError Last MCI errornId MCI device identifiercType Type of DevicecFileName Name of the file associated with the MCIoWnd Reference of the container window of the MCI Object
METHODS--------------------------------------------------------------------------------New Constructor from source codelOpen Opens the Mci file.Play Start the reproduction of the file.cGetError Retrieves any errors.SetWindow Set the windows for the Mci object.SendStr Send a Mci string command to the Mci object.
Class TMDIChild Inherits from Class TWindow--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------oWndClient Client TWindow Object of the MDI structureoControl TControl object that is showed in child window
New Generic constructor methodMaximize Method to maximize the child window.Restore Method to restore the child window.Activate Make this window the active child window.End Ends the MdiChild and close it if VALID is .t.GotFocus Behavior when receiving the focusNext Selects the next MdiChildPrev Selects the prev MdiChildReSize Behavior when resizing the MdiChildKeyDown Behavior when pressing a keySetControl Selects which control of the MdiChild has to be resizedautomatically
Class TMDIClient Inherits from Class TWindow--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------aWnd Array of TMDIChild objects
METHODS--------------------------------------------------------------------------------New Generic constructor methodTile Tile Child windowsCascade Cascade child windowsArrangeIcons Arrange all minimized document child windows. It does
not affect child windows that are not minimized.NextWindow Activate the child window immediately behind the
currently active child window and place the currentlyactive child window behind all other child windows.
GetActive Retrieves the TMDIChild window that is active.Add Add an TMDIChild object to ::aWnd instance array.ChildNew Creates an New TMDIChild object an add it to ::aWndChildActivate Activate a different TMDICchild window.ChildMaximize Maximize a TMDICchild window.ChildRestore Restore a TMDICchild window.ChildClose Close a MdiChild windowChildNext Selects the next MdiChildResize Resizes the MdiClientlCloseAll Closes all the MdiChild ChildrenIconizeAll Iconizes all the Mdichild windowsKeyDown Behavior when pressing a keyMouseMove Behavior when moving the mouse over
--------------------------------------------------------------------------------Class TMDIFrame Inherits from Class TWindow--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------oWndClient The TMDIFrame's client window, an instance of TMDIClient.oWndActive The TMDIFrame's active MDI child window.
METHODS--------------------------------------------------------------------------------New Generic constructor methodTile Tile Child windowsCascade Cascade child windowsCloseAll Close all the MdiChild windowsIconizeAll Iconizes all the MdiChild windowsArrangeIcons Arrange all minimized document child windows. It does
not affect child windows that are not minimized.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
NextWindow Activate the child window immediately behind thecurrently active child window and place the currentlyactive child window behind all other child windows.
Resize Behavior when resizing the MdiFrameCommand Controls the WM_COMMAND messagesEnd Ends the window execution if VALID is .t.GotFocus Behavior when getting the focusSelect Select a MdiChild windowChildNew Creates an New TMDIChild.Release Destroy a TMDIFrame window and all his child objects
DATA--------------------------------------------------------------------------------hMenu The Windows handle of the MenuaItems An array of MenuItemsoWnd A reference to the container Window of the MenulSysMenu If it is a System menulPopup If it is a popup menunHelpId The help topic identifier of this MenucVarName A variable name to identifier this object (visual editor)
METHODS--------------------------------------------------------------------------------New Creating a new MenuRedefine Creates a menu from resourceNewSys Redefining a SysMenuActivate PopMenu activating methodAdd Adding a new menuitem to the MenuAddEdit Adds standard editing menu optionsAddHelp Adds standard help menu optionsAddMdi Adds standard MDI menu optionsCommand Processes the user selection commandDelItems Invoked when destroying the menu. Destroys each menuitemDestroy Destroys the menuDisable Disables the entire menuEnd Ends the menuGetMenuItem Retrieves a reference to a MenuItem Object given its IdGetPopup Retrieves a reference to a contained Popup given its positionHelpTopic Invoked when pressing enter over this menuHilite Hilites a specific menuitemInit Called everytime the menu is going to be shownInsert Inserts a new menuitem at a specified positionLastItem A reference to last processed MenuItem ObjectLoad Changes some menu properties based on a binary infoRefresh Repaints the menuRelease Destroy the Menu ObjectReset Reset to the original System Menu of a WindowSave Generates a binary representation of the menuUnHilite DeHelites a specific menuitem
--------------------------------------------------------------------------------Class TMenuItem--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------cPrompt The label of the MenuItem
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
cMsg The text to be shown on the MsgBar of the main WindownId A numeric identifier for this menuitemnHelpId A numeric help topic identifier used to select invoked helpbAction The action to be performed when selecting the MenuItembWhen A codeblock to be avaluated to enable/disable the menuitemlChecked Logical value if the menuitem is checkedlActive Logical value if the menuitem is enabledlHelp If this is a menuitem help type (right placed)oMenu A reference of its container Menu objecthBitmap A handle to a Bitmap if defined
METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from resourceDestroy Called when the menuitem is destroyed.Disable Disable the item.Enable Enable the item.End Ends control and make it disappear.EveCount Number of total events for this class (used by the ObjectInspector).Event Retrieve the event from the event array.Load Set the properties of the menuitem based on a supplied binaryinformation.PropCount Number of total property.Property Retrieves the property from the property array.Save Generates a binary representation of this object.SetCheck Enables / Disables check.SetPrompt Changes the associated menuitem prompt.__HelpTopic Method invoked when pressing F1 when this menuitem is selected.
Creating a pulldown menu DEFINE MENU <oMenu> ;from resources [ RESOURCE | NAME | RESNAME <cResName> ];
[ POPUP ] ;
REDEFINE MENUITEM [ <oMenuItem> ;PROMPT <cPrompt> ] ;[ ID <nId> OF | MENU <oMenu> ] ;[ ACTION <uAction> ] ;[ BLOCK <bAction> ] ;[ MESSAGE <cMsg> ] ;[ CHECK | CHECKED | MARK ] ;[ ENABLED | DISABLED ] ;[ FILE | FILENAME | DISK <cBmpFile> ];[ RESOURCE | RESNAME | NAME <cResName> ] ;[ ACCELERATOR <nState>, <nVirtKey> ] ;[ WHEN <uWhen> ]
Activating a Popup Menu ACTIVATE POPUP <oMenu> ;[ AT <nRow>, <nCol> ] ;[ OF | WINDOW | DIALOG <oWnd> ]
Redefining the System REDEFINE SYSMENU <oMenu> ;Menu of a Window [ OF | WINDOW | DIALOG <oWnd> ]
-MenuItems same as above...-
ENDSYSMENU
<oMenu> A reference to the Menu Object.
<oMenuItem> A reference to one of the menuitems of the menu. Eachmenuitem of a menu object is also an object. SEPARATORclause also may specify an optional menuitem variable tostore its related value.
<cMsg> The associated message of this control.
<cBmpFile> The name of a BMP file to be used as the label for amenuitem of the menu.
<cResName> The resource name of the menu.
<uAction> The action to be performed for a specific menuitem.
<bAction> The same action as above expressed as a codeblock.
<nRow>, <nCol> The coordinates where to place the Popup Menu.
<oWnd> The container window of the Menu.
<nState> The state of they accelerator key (see VKEY.CH)
<nVirtKey> ASCII value of the accelerator key.
<nHelpId> The help topic identifier of a specific menuitem.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<uWhen> An expression to be bloquified and evaluated to checkif a menuitem should be enabled or disabled.
<nId> The numeric resource identifier of the menuitem.
<cPrompt> The label of the menuitem.
<bAction> The action to be performed when the Button is pressed.
<oMru> A reference to a new MRU object created
<cIniFile> The name of the related INI file to use with a MRU object.
<cSection> The section inside the INI file where to store the MRU items.
<nItems> The number of items to be managed by the MRU object.
<uAction> The action to perform when selecting a MRU item.
CLAUSES
CHECK If the menuitem has to appear initially as checked.CHECKEDMARK
ENABLED If the menuitem has to appear initially as enabled.by default it is enabled.
DISABLED If the menuitem has to appear initiall as disabled.
HELP If the menuitem has to appear by the op right of thepulldown menu.
POPUP To create a popup menu instead of a pulldown menu.
--------------------------------------------------------------------------------Class TMetaFile FROM TControl Windows WMF files management--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------hMeta Handle of the MetaFile.oPen Reference to a pen object.nWidth DimensionsnHeight DimensionsnXorig Origin in X axis.nYorig Origin in Y axis.lZoom if Zoom is enabled.lShadow If Shadow
METHODs--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from resourceDisplay Displays the control. Use :Refresh() to force repaintEnd Ends control and make it disappearHide Hides the control.Paint Draws the control. This process occurs inside Display.SetCoorsSetFile Name of the metafile.SetOrg Set the X and Y origin.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Shadow Activate / Deactivate Shadows.ZoomIn Zoom in the image.ZoomOut Zoom out the image.
--------------------------------------------------------------------------------Class TMeter Inherits TControl--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------nTotal Total amount to be represented by the MeternClrBar RGB color to use for the filled background of the meternClrBText RGB color to use for the filled text of the metercText The text to show on the meterlPercentage If the % sign is to be painted
New Constructor from source code.ReDefine Constructor from resources.Default Default meter initialization.HandleEvent Events dispatcher manager.Init Control initialization.Paint Paints the Meter.Set Changes the value represented and
the value of the variable.SetTotal
Meter Commands--------------------------------------------------------------------------------
Creating a Meter @ <nRow>, <nCol> METER [ <oMeter> VAR ] <nActual> ;from source code [ TOTAL <nTotal> ] ;
<nTotal> The total amount represented by the Meter.
<nWidth>, The dimensions of the Meter in pixels.<nHeight>
<oWnd> A reference to the container Window Object of the Meter.
<nId> A numerical value identifying the Meter from resources.
<oFont> The font to use to display the percentadge of the meter.
<cPrompt> To display an optional text inside the meter.
<nClrPane> The colors of the unfilled parts of the meter<nClrText><nClrBar> The colors of the filled parts of the meter.<nClrBText>
CLAUSES
UPDATE If this control has to be updated everytime its containeris updated <oDlg>:Update().
PIXEL If the coordinates of the meter are pixel based.
NOPERCENTAGE To avoid showing the '%' sign.
DESIGN Allows the user to move and resize with the mouse
--------------------------------------------------------------------------------Class TMultiGet Inherits from TControl--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------lReadOny If the text does not allows editingnPos The cursor position inside the control
METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesAdjClient Adjust its dimensions to its container objectCopy Copy the selected text into the clipboardCreate Specific interface to WinApi CreateWindowcToChar Generates a data template to build a DialogCut Deletes the selected text and copies it into ClipboardDefault Default object initializationDelLine Deletes the specified line number. Default current oneFind Standard search text DialogBoxGetLine Retrieves the specified line number. Default current oneGetLineCount Retrieves the number of text linesGetCol Retrieves the current cursor colGetRow Retrieves the current cursor rowGotFocus Action to perform when getting the focusInit Generic initializationLostFocus Action to perform when losing the focusMouseMove Action to perform when moving the mouse over itRefresh Updates the text shown and forces repaintingSave Save the text into the associated variable
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
VScroll Vertical scrollbar events dispatcherKeyChar Process the keyboard inputSetPos Changes the cursor positionPaint Draws the textcText Get / Set the text of de TMultiGet Object.GetSel Retrieves the selection from the TMultiGet editing buffer.
GET Commands--------------------------------------------------------------------------------Creating a GET from @ <nRow>, <nCol> GET [ <oGet> VAR ] <uVar> ;source code [ OF | WINDOW | DIALOG <oWnd> ] ;
[ PICTURE <cPict> ] ;[ VALID <ValidFunc> ] ;[ WHEN <WhenFunc> ] ;[ COLOR | COLORS <nClrFore>;[,<nClrBack>] ] ;[ SIZE <nWidth>, <nHeight> ];[ FONT <oFont> ] ;[ HSCROLL ] ;[ CURSOR <oCursor> ] ;[ PIXEL ] ;[ MESSAGE <cMsg> ] ;[ UPDATE ] ;[ WHEN <WhenFunc> ] ;[ CENTER | CENTERED> ] ;[ RIGHT ] ;[ READONLY | NO MODIFY ] ;[ DESIGN ] ;[ ON CHANGE <uChange> ] ;[ PASSWORD ] ;
@ <nRow>, <nCol> GET [ <oGet> VAR <uVar> ] ;For editing Memos [ OF | WINDOW | DIALOG <oWnd> ] ;
[ MULTILINE | MEMO | TEXT ] ;[ COLOR | COLORS <nClrFore>;[,<nClrBack>] ] ;[ SIZE <nWidth>, <nHeight> ] ;[ FONT <oFont> ] ;[ DESIGN ] ;[ CURSOR <oCursor> ] ;[ PIXEL ] ;[ MESSAGE <cMsg> ] ;[ UPDATE ] ;[ WHEN <WhenFunc> ] ;[ CENTER | CENTERED ] ;[ RIGHT ] ;[ ON CHANGE <uChange> ] ;[ HSCROLL ] ;[ READONLY | NO MODIFY ] ;[ VALID <ValidFunc> ] ;
Using a GET from a REDEFINE GET [ <oGet> VAR ] <uVar> ;resource Dialog Box [ ID <nId> ] ;
[ OF | WINDOW | DIALOG <oWnd> ] ;[ HELPID | HELP ID <nHelpId> ] ;[ VALID <ValidFunc> ] ;[ PICTURE <cPict> ] ;[ COLOR | COLORS <nClrFore>;
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
MULTILINE To use a multiple lines GET control to allow memoMEMO editing.TEXT
UPDATE This control may be updated from TDialog:Update() METHOD
CENTER If the GET containts has to appear centered
RIGHT If the GET containts has to appear right justified.Important: In order to right justify a GET from a DialogBox,it has to be defined at the resource as MultiLine andright and has to use the default font!
PIXEL To use pixel coordinates instead of Text coordinates.
PASSWORD Enter as Password.
DESIGN Allows the user to move and resize with the mouse
HSCROLL Horizontal Scroll
READ ONLY Disables editing in this control.NO MODIFY
--------------------------------------------------------------------------------Class TMru--------------------------------------------------------------------------------MRU means: "Most Recent Used" and let you automatically manageMRU lists on your menus !!! See SAMPLES\TestMru.prg for a test!
DATA--------------------------------------------------------------------------------aItems Array of MenuItemsnMaxItems Max Number of Items in the list.cIniFile Name of the associated ini file.cSection Section in the ini filecMsg Message for all MRU MenuItemsoMenu oMenu container of the MRU listoSeparator A reference of the SEPARATOR menuitem created above the MrunMenuPos oMenu container position of the MRU listbAction Action to perform when selecting any of the MRU MenuItems
METHODS--------------------------------------------------------------------------------New Constructor from source code.Save Add a new element to the MRU list.Clear Clear all Mru items and also release the INI related section
--------------------------------------------------------------------------------Class TMsgBar FROM TWindow--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------cMsgDef The default message to showlCentered If the message should look centered at screenlInset If the message bar should look insetlActive Activate the MsgbarlDate If the message bar should look DatelClock If the message bar should look ClocklKbd If the message bar should look Keyboard status
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
oDate Related MsgItem object if DATE clause usedoTime Related MsgItem object if TIME clause usedoKbd Related MsgItem object if KEYBOARD clause usedoFontClock Font object for the Clock MsgItemoFontDate Font object for the Date MsgItemoFontKeyb Font object for the Keyboard MsgItemaItemnClrFore Foreground color as a RGB numbernClrBack Background color as a Rgb NumbernSizeItem
METHODs--------------------------------------------------------------------------------New Constructor from source codeAddItem Adds n Item to the MsgBar.Adjust Adjust the MsgBar dimensions to its container windowClockOff Turn off the clock.ClockOn Turn on the clock.DateOff Turn off the date.DateOn Turn on the date.Default Default initializationDelItem Deletes an Item from the MsgBar.Destroy Destroys the MsgBar. Automatically called.GetItem Retrieves the number of items of the MsgBar.Height Retrieves the MsgBar Height.KeybOff Turn the keyboard off.KeybOn Turn the Keyboard on.LButtonDown Action to be performed when clicking the mousePaint Draws the control. This process occurs inside Display.Refresh Repaints the controlSetMsg Set the text of the MsgBarShowMsgBar
DATAs--------------------------------------------------------------------------------oMsgBar Reference to its MsgBar container object.cMsg shown text.nSize width of the MsgItem.nClrFore Foreground color as a RGB number.nClrBack Background color as a RGB number.nId Id number for the MsgItem.bMsg Optional codeblock to evaluate to generate the cMsg text.bAction Action to be preformed when clicking on it.oFont Font object used.
METHODs--------------------------------------------------------------------------------New Constructor from source codeClick Action to be performed when clicking the mouse.Refresh Repaints the itemSetFont Set the font for the MsgItem.SetText Set the message for the MsgItem.Show Makes the item visible
--------------------------------------------------------------------------------Class TObjFile FROM TFile--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Class TObjFile inherits from TFile and providesmanipulation for OBJ files. See SAMPLES\TestObj.prg
OBJ files generated by any compiler are a database of variable lengthrecords. TObjFile Class lets you read and write OBJ files, thusgiving you a chance to get a better understanding in compilers development.
DATA--------------------------------------------------------------------------------nRecId Record Identifier.nRecLen Record Length.
METHODS--------------------------------------------------------------------------------New Constructor from source code.Compiler Writes the compiler name into the OBJExtDef Writes a External definition record inside the OBJGrpDef Writes a Group definition record inside the OBJLeData Writes a Data block record inside the OBJLNames Writes the list of the local names of the OBJModEnd Writes the end of file record of the OBJPubDef Writes a Public definition record inside the OBJSegDef Writes a segment definition record inside the OBJSkipRec Go to next record inside the OBJTHeadr Writes the header record of the OBJ
--------------------------------------------------------------------------------Class TOdbc ODBC session management--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------hEnv The handle of the environment used by the ODBC.hDbc The handle of the DataBase connection used by the ODBC.cConnect An optional connect string description provided.cDSN The Data Server Name or the DataBases directory pathcUser An optional user name provided.cPassword An optional password provided.
METHODs--------------------------------------------------------------------------------New Creates a new ODBC object
nOption Current selected pageaDialogs Array of NonModal DialogBox objects
METHODs--------------------------------------------------------------------------------New Method Constructor from source codeRedefine Method Constructor from resourcesInit Generic control initializationDefault Control default initialization. Called from InitDestroy Generic destructor methodSetOption Sets a different selected pageGoPrev Selects the previous page to the current one selectedGoNext Selects the next page to the current one selected
--------------------------------------------------------------------------------Class TPanel FROM TControl--------------------------------------------------------------------------------
TPanel Class. Mainly used for Automatic Alignment techniques
DATA--------------------------------------------------------------------------------aRules Array of Rules.
METHODs--------------------------------------------------------------------------------New Constructor from source code.Add Adds a new rule to the aRules.
--------------------------------------------------------------------------------CLASS TPen Pen management as objects--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------hPen The handle of the pennStyle The Pen style
nStyle The Pen style--------------------------------------------------------------------------------
It can be one of the following values:
PS_SOLID Creates a solid pen.PS_DASH Creates a dashed pen. (Valid only when the pen width is 1.)PS_DOT Creates a dotted pen. (Valid only when the pen width is 1.)PS_DASHDOT Creates a pen with alternating dashes and dots. (Valid only
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
when the pen width is 1.)PS_DASHDOTDOT Creates a pen with alternating dashes and double dots.
(Valid only when the pen width is 1.)PS_NULL Creates a null pen.PS_INSIDEFRAME Creates a pen that draws a line inside the frame of
closed shapes produced by graphics device interface (GDI)output functions that specify a bounding rectangle (forexample, the Ellipse, Rectangle, RoundRect, Pie, and Chordfunctions). When this style is used with GDI outputfunctions that do not specify a bounding rectangle (forexample, the LineTo function), the drawing area of the penis not limited by a frame.
PS_SOLID Creates a solid pen.PS_DASH Creates a dashed pen. (Valid only when the pen width is 1.)PS_DOT Creates a dotted pen. (Valid only when the pen width is 1.)PS_DASHDOT Creates a pen with alternating dashes and dots. (Valid only
when the pen width is 1.)PS_DASHDOTDOT Creates a pen with alternating dashes and double dots.
(Valid only when the pen width is 1.)PS_NULL Creates a null pen.PS_INSIDEFRAME Creates a pen that draws a line inside the frame of
closed shapes produced by graphics device interface (GDI)output functions that specify a bounding rectangle (forexample, the Ellipse, Rectangle, RoundRect, Pie, and Chordfunctions). When this style is used with GDI outputfunctions that do not specify a bounding rectangle (forexample, the LineTo function), the drawing area of the penis not limited by a frame.
Values
#define PS_SOLID 0
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nWidth> The width of the Pen expressed in logical units.
<nColor> An RGB color. By default the device selected color will beused.
<oDevice> An optional device object to use its width as the widthunit reference.
Release Destroy MethodEnd Destroy Method. Use this method to destroy a Pen.
--------------------------------------------------------------------------------Class TPrinter--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------hDC Handle of the Device Context of the PrinterhDCOut Handle of the current metafile in use if file output specifiedaMeta Arrays of metafiles names generated in diskcDevice The name of the output devicecDocument The name of the spooler documentcDriver The name of the printer driver in usecModel Alternative printer to usecPort The name of the port usedcDir The path for the metafiles storage. By default TEMPnPage The page currently printednXOffset Coordinates of the virtual page originnYOffset Coordinates of the virtual page originlMeta If the output has to go to metafiles in disklModified If the printer device handle should be initialized againlStarted If the printing already startedoFont Default font to use for printing
METHODS--------------------------------------------------------------------------------New Constructor from source code .End Destroys the current printer object .EndPage Ends the actual printed page. .FillRect Fills a rectangle with a specified brush object. .Box Draws a box. .Cmtr2Pix Converts a centimeters coordinates into pixels coordinates .DraftMode Select the draft mode for speed up the printing .GetOrientation Retrieves the printer orientation. .GetPhySize Retrieves the paper physical dimensions .GetTextHeight Retrieves text Height for a specific font object .GetTextWidth Retrieves text Width for a specific font object .ImportWMF Imports a Windows metafile to be used as template .Inch2Pix Converts a inches coordinates into pixels coordinates .Line Draws a line. .nHorzRes Retrieves the horizontal resolution. .nHorzSize Retrieves the width of the physical dimensions .nLogPixelX Retrieves the number of pixels per logical inch .nLogPixelY Retrieves the number of pixels per logical inch .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
nVertRes Retrieves the height of the printer page in raster lines .nVertSize Retrieves the vertical dimensions in millimeters .Pix2Inch Converts pixels coordinates into inches coordinates .Pix2Mmtr Change from pixels to millimeters coordinates .Preview Make a preview of the print work .Rebuild Rebuilds all the associated handles and files of the printerResetDC Updates the associated device handle of the printer object .Say Prints a text at a certain coordinates. .SayBitmap Prints a Bitmap. .SetAnisotropicMode Set the anisotropic mode. .SetCopies Set the number of copies to print. .SetHiInchMode Set the high inch mode. .SetHiMetricMode Set the high metric mode. .SetIsotropicMode Set the Isotropic mode. .SetLandscape Set the printer orientation to Landscape .SetLoInchMode Set the low inch mode. .SetLoMetricMode Set the low Metric mode. .SetPage Specifies the size of the paper to print on. .SetPixelMode Set the Pixel mode. .SetPortrait Set the printer orientation to Portrait .SetPos Set a new position on the page for next printing .SetSize Selects a different page dimensions .SetTwipsMode Each logical unit is converted to 1/20 of a point .SetFont Sets and retrieves the default printer font object .Setup Standard Setup DialogBox for printing .SetViewPortExt Sets the X and Y dimensions of the viewport .SetWindowExt Sets the X and Y extents of the printer device .StartPage Begins a new page .
--------------------------------------------------------------------------------Class TRadio Inherits from TControl--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------lChecked If the radio control is currently selectedoRadMenu Its related container TRadMenu ObjectnPos Relative position within respect to the other Menu Radiosbuttons
METHODS--------------------------------------------------------------------------------New Constructor from source code.ReDefine Constructor from resource.Click Mouse left button event handler.cToChar Generates a data template to build a DialogDefault Default control initialization.Init Generic control initialization.KeyDown Action to be performed when pressing a key.lIsChecked Retrieves its current logical valueMouseMove Behavior when moving the mouse over it.Refresh Repaints the controlSetCheck Changes its select/deselected state.
--------------------------------------------------------------------------------Class TRadMenu Manages a group of TRadio controls--------------------------------------------------------------------------------
aItems An array with all the Radio control itemsbSetGet A codeblock to control the related numeric variablebChange Action to perform when changing the radio selectedcMsg MsgBar text for its container windowlUpdate If the radio menu has to be updated from a TDialog:Update()
METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from resourcesnOption SETGET Method which simulates the nOption DATARefresh Forces the whole control to be repaintedSet3DLook Activates the 3D look if its container is a windowEnd End all the radio elementsDisable Disables all the radio elementsEnable Enables all the radio elementsSetOption Changes the current selected radio optionSelect Select a different radio elementGoPrev Skips to previous radio elementGoNext Skips to next radio element
DATAoReport Its TReport object container.aData An array with all data codeblocks.aTitle An array with all titles codeblocks.aPicture An array with all pictures.bDataFont A codeblock that returns the font to use for the data.bTitleFont A codeblock that returns the font to use for the title.bTotalFont A codeblock that returns the font to use for the total.bTotalExpr A codeblock to return when a total must be calculated.cTotalPict A string holding the PICTURE to use for the data.nWidth The width of the column in pixels.nDataHeight The height of the column data.nTitleHeight The height of the column title.nTotal The accumulated total already calculated for the column.nCol The column position if defined.nSize The width in characters in pixels if defined by the user.nPad The relative position inside the column: LEFT, CENTER, RIGHTnPen The Report pen elements to uselTotal If the column has totallShadow If the column has to be filled with a shadow backgroundlGrid If the column has to be bordered with lines-------------------------------------------------------------------------------
METHODSNew Method constructor: creates a new column.Stabilize Stabilizes the column. It is called by the report stabilize.SayTitle Prints its title.SayData Prints its data.SayTotal Prints its total.
-------------------------------------------------------------------------------Class TRect--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------nTop Coordinates of the rect
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
New Constructor for the rect--------------------------------------------------------------------------------Class TReport-------------------------------------------------------------------------------
DATAs-------------------------------------------------------------------------------oDevice The target device where to printoTitle A TRLine object which contains the report titleoHeader A TRLine object which contains the report headeroFooter A TRLine object which contains the report footeroRptWnd The related report windowoBrush An optional brush to use at the reportaGroups An array with all the report TRGroups objects definedaColumns An array with all the report TRColumns objects definedaFont An array with all the report TFont objects definedaCols Internally used while printing. Don't use them!aText Internally used while printing. Don't use them!aData Internally used while printing. Don't use them!aPen An arrays of pens to use with the reportbFor A codeblock which holds the FOR clause. By default: {|| .t. }bWhile A codeblock which holds the WHILE clause. By default: {|| .not.EOF() }bInit A codeblock which holds the ON INIT clause.bEnd A codeblock which holds the ON END clause.bStartLine A codeblock which holds the ON NEWLINE clause.bEndLine A codeblock which holds the ON ENDLINE clause.bStartPage A codeblock which holds the ON NEWPAGE clause.bEndPage A codeblock which holds the ON ENDPAGE clause.bStartGroup A codeblock which holds the ON NEWGROUP clause.bEndGroup A codeblock which holds the ON ENDGROUP clause.bSkip A codeblock which holds how to skip to the next report line.bStdFont A codeblock which returns the default report font order to use.bPreview An optional codeblock to evaluate on the preview of the reportbChange A codeblock which holds the ON CHANGE clausecRptFile -not available yet- The Data-driven file which holds the report.cResName -not available yet- The resource name which holds the report.cTotalChr The character to use for drawing the report total lines. Default:"="cGroupChr The character to use for drawing the report group totals. Default:"-"cTitleUpChr The character to use for drawing the report column title up line.Default: "="cTitleDnChr The character to use for drawing the report column title down line.Default: "="cFile -not available yet- The name of the target file to produce.cName The name of the document to generate.cPageTotalcGrandTotalnWidth The width of the target device. Pixels per inch.nHeight The height of the target device. Pixels per inch.nMargin The report left margin after stabilizing the report.nRow The current report row being printed.nPage The current report page being printer.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
nMaxTitle The largest number of title lines used on all column titles.nMaxData The largest number of data lines used on all columns body.nSeparator The spaces width between columns.nLeftMargin The left margin of the page. Default: 0,2 inches.nRightMargin The right margin of the page. Default: 0,2 inches.nTopMargin The top margin of the page. Default: 0,2 inches.nDnMargin The down margin of the page. Default: 0,2 inches.nTitleRow Row where to start printing the report title.nBottomRow Last row available to the report body. (without the footer).nStdLineHeight The default report line height.nRptWidth The width of the report. Automatic updated when Stabilizing.nLogPixXnLogPixYnFirstdrownLastdrownTitleHeightnCounterlSummary Not detailed report body information, only report groups.lTotal If there is any column with total to be calculated.lFinish .t. when the report is finishing. Internally used.lStable .t. after the report has been stabilized.lGroup If there is any report group defined.lPrinter If the target device is the printer.lScreen -Not available yet- If the target device is the screen.lFirstRow .t. only when processing the first body line in each page.Internally used.lCreated If the report has been completely createdlPreview If a report preview is requiredlBreaklSpanish If Spanish language is usedlShadow If a shadow is going to be displayedlGrid If a Grid is going to be displayedCargo Generic cargo slot
METHODs-------------------------------------------------------------------------------New Method constructor: creates a new report. .
New Method constructor: creates a new report.-------------------------------------------------------------------------------
aTitle An array of codeblocks with all lines of the report title.aHead An array of codeblocks with all lines of the report header.aFoot An array of codeblocks with all lines of the report footer.aFont An array of TFonts objects to be used in all the report.lSummary If the report body should be printed or not. This is only
meaningful if some report have been defined.cRptFile -not available yet- Report data-driven file name.cResName -not available yet- Report resource definition.lPrinter If printer is the target device.lScreen If the screen is the target device.cFile -not available yet- the name of the target output file.oDevice The optional target device. By default: the printer.cName The name of the document.cTFmt The pad style for the title: "LEFT", "CENTER-ED", "RIGHT"
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
By default: "CENTERED".cHFmt The pad style for the header: "LEFT", "CENTER-ED", "RIGHT"
By default: "LEFT".cFFmt The pad style for the footer: "LEFT", "CENTER-ED", "RIGHT"
By default: "LEFT".
AddColumn Add a TRColumn object to the report. .AddColumn Add a TRColumn object to the report.-------------------------------------------------------------------------------
TReport::AddColumn( oColumn ) --> nil
Add a TRColumn object to the report. Automatically used by the xBasecommands.
DelColumn Del a TRColumn object from the report. .DelColumn Del a TRColumn object from the report.-------------------------------------------------------------------------------
TReport::DelColumn( nColumn ) --> nil
Del a TRColumn object from the report.
InsColumn Insert a TRColumn object to the report. .InsColumn Insert a TRColumn object to the report.-------------------------------------------------------------------------------
TReport::InsColumn( oColumn, nColPos ) --> nil
Insert a TRColumn object to the report, at the specified columnposition.
AddGroup Add a new TRGroup object to the report. .AddGroup Add a new TRGroup object to the report.-------------------------------------------------------------------------------
TReport::AddGroup( oGroup ) --> nil
Add a new TRGroup object to the report.
DelGroup Del a TRGroup from the report. .DelGroup Del a TRGroup from the report.-------------------------------------------------------------------------------
TReport::DelGroup() --> nil
Del a TRGroup from the report.
Stabilize Stabilizes the report before starting printing (activate). .Stabilize Stabilizes the report before starting printing (activate).-------------------------------------------------------------------------------
TReport::Stabilize() --> nil
Stabilizes the report before starting printing. It is automatically calledwhen activating ( TReport::Activate() ) the report.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Skip Skip to next record on the current workarea -or equivalent-. .Skip Skip to next record on the current workarea -or equivalent-.-------------------------------------------------------------------------------
TReport::Skip() --> nSkipped
Skip to next record on the current workarea -or equivalent-.
By default returns 1 (one record).
Init Evaluate the ::bInit codeblock if defined. .Init Evaluate the ::bInit codeblock if defined.-------------------------------------------------------------------------------
TReport::Init() --> nil
End Forces the termination of the report. .End Forces the termination of the report.-------------------------------------------------------------------------------
TReport::End() --> nil
Forces the termination of the report.
According to FiveWin programming style, all objects activation statemust be finish using ::End(). A report object will finish whenreceiving this message.
StartLine Executes the codeblock defined on the start of a line. .StartLine Executes the codeblock defined on the start of a line.-------------------------------------------------------------------------------
TReport::StartLine( nHeight ) --> nil
Executes the codeblock defined on the start of a line.
EndLine Ends printing the current line. .EndLine Ends printing the current line.-------------------------------------------------------------------------------
TReport::EndLine( nHeight ) --> nil
Ends printing the current line.
StartGroup Executes the codeblock defined on the start of a group. .StartGroup Executes the codeblock defined on the start of a group.-------------------------------------------------------------------------------
TReport::StartGroup( nGroup ) --> nil
Executes the codeblock defined on the start of a group. Automaticallycalled by the TReport::Activate() method.
EndGroup Executes the codeblock defined on the end of a group. .EndGroup Executes the codeblock defined on the end of a group.-------------------------------------------------------------------------------
TReport::EndGroup( nGroup ) --> nil
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Executes the codeblock defined on the end of a group. Automaticallycalled by the TReport::Activate() method.
StartPage Executes the codeblock defined on the start of a page. .StartPage Executes the codeblock defined on the start of a page.-------------------------------------------------------------------------------
TReport::StartPage() --> nil
Executes the codeblock defined on the start of a page. Automaticallycalled by the TReport::Activate method.
EndPage Executes the codeblock defined on the end of a page. .EndPage Executes the codeblock defined on the end of a page.-------------------------------------------------------------------------------
TReport::EndPage() --> nil
Executes the codeblock defined on the end of a page. Automaticallycalled by the TReport::Activate method.
NeedNewPage Returns .t. if a new page is needed. -internal used- .NeedNewPage Returns .t. if a new page is needed. -internal used--------------------------------------------------------------------------------
TReport::NeedNewPage() --> lYesNo
Returns .t. if a new page is needed. -internal used-
NewLine Start a new line, and executes the startline codeblock. .NewLine Start a new line, and executes the startline codeblock.-------------------------------------------------------------------------------
TReport::NewLine() --> nil
Start a new line, and executes the startline codeblock.
ColTitle Prints all report columns titles. .ColTitle Prints all report columns titles.-------------------------------------------------------------------------------
TReport::ColTitle() --> nil
Prints all report columns titles.
TotalLine Prints every report columns Separator lines. .TotalLine Prints every report columns Separator lines.-------------------------------------------------------------------------------
TReport::TotalLine( cChar ) --> nil
Prints every report columns separator lines.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
cChar is the character to use for printing those lines.
PageTotal Prints all report column page & grand totals. .PageTotal Prints all report column page & grand totals.-------------------------------------------------------------------------------
TReport::PageTotal() --> nil
Prints all report column page & grand totals.
Activate Starts executing the report. .Activate Starts executing the report.-------------------------------------------------------------------------------
TReport::Activate( For, bWhile, bInit, bEnd, bStartPage,;bEndPage, bStartGroup, bEndGroup, ;
bStartLine, bEndLine ) --> nil
Starts executing the report.
Parameters: All the codeblocks involved in the activation and executionprocess.
Play .Play-------------------------------------------------------------------------------
TReport:Play() --> nil
Margin Modify any of the top, left, bottom & right report margins. .Margin Modify any of the top, left, bottom & right report margins.-------------------------------------------------------------------------------
TReport::Margin( nValue, nType, nScale ) --> nil
Modify any of the top, left, bottom & right report margins.
nValue The value of the new margin to be used.
nType The type of margin to be changed:
LEFT 1TOP 4RIGHT 2BOTTOM 5
nScale Inches or centimeters to be used:
INCHES 1CENTIMETERS 2
Say Draws a text .Say Draws a text-------------------------------------------------------------------------------
TReport::Say( nCol, xText, nFont, nPad, nRow )
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
DATAoReport Its TReport object container.aData An array with all data codeblocks.aTitle An array with all titles codeblocks.aPicture An array with all pictures.bDataFont A codeblock that returns the font to use for the data.bTitleFont A codeblock that returns the font to use for the title.bTotalFont A codeblock that returns the font to use for the total.bTotalExpr A codeblock to return when a total must be calculated.cTotalPict A string holding the PICTURE to use for the data.nWidth The width of the column in pixels.nDataHeight The height of the column data.nTitleHeight The height of the column title.nTotal The accumulated total already calculated for the column.nCol The column position if defined.nSize The width in characters in pixels if defined by the user.nPad The relative position inside the column: LEFT, CENTER, RIGHTnPen The Report pen elements to uselTotal If the column has totallShadow If the column has to be filled with a shadow backgroundlGrid If the column has to be bordered with lines-------------------------------------------------------------------------------
METHODSNew Method constructor: creates a new column.Stabilize Stabilizes the column. It is called by the report stabilize.SayTitle Prints its title.SayData Prints its data.SayTotal Prints its total.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
-------------------------------------------------------------------------------Class TTreeItem Trees TreeItems in FiveWin.--------------------------------------------------------------------------------
See Class TLinkList and xBase TREE ... ENDTREE commandfor an explanation of Trees under FiveWin.
DATAs--------------------------------------------------------------------------------cDraw Contains the draw characters for this item.cPrompt Contains the associated text label of the item.oPrev Reference to previous TreeItem object.oNext Reference to next TreeItem object.oTree Reference to a contained tree object.lOpened If the contained tree object is opened or not.nLevel Ident level of the item.hBmpOpen Handle of the bitmap for opened state.hBmpClose Handle of the bitmap for closed state.
METHODs--------------------------------------------------------------------------------New Constructor from source codeEnd Ends control and make it disappearAdd Adds a new following item.Close Closes the the treeitem.ColSizes Returns an array with colsizes to use for painting the browserow.Delete Deletes treeitem.Draw Draws the item.GetLabel Retrieves the treeitem label.GetNext Retrieves the next treeitem.GetPrev Retrieves the previus treeitem.GetText Retrieves the treeitem prompt.Open Opens the optional tree contained by the TreeItem.SetNext Set a new value for the next treeitem.SetText Set a new prompt for the current treeitem.Skip Goes to the next treeitem.Toggle Change the treeitem status if it's open closes it, else opensit.
-------------------------------------------------------------------------------Class TRGroup FiveWin Report Engine Group objects-------------------------------------------------------------------------------
DATAs-------------------------------------------------------------------------------oReport Its TReport object container.aTotal An array of numeric totals, one for each report column.bGroup A codeblock which holds the group expression.bHeader A codeblock that returns the header of the group.bFooter A codeblock that returns the footer of the group.bHeadFont A TFont object to use to print the group header.bFootFont A TFont object to use to print the group footer.cValue It keeps the latest group evaluated expression.nCounterlEject If eject is to be performed on each group change.
METHODs-------------------------------------------------------------------------------New Method constructor: creates a new TRGroup object. .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Reset Resets the accumulated total value of all aTotal to 0. .Header Prints the header of the group. .Footer Prints the footer of the group. .Total Prints the totals of the group. .HeaderHeight Returns the height of the group header. .FooterHeight Returns the height of the group footer. .Evaluate Calculates the group expression .Check Checks if the group condition has changed .-------------------------------------------------------------------------------Class TRLine FiveWin Report Engine Line objects .-------------------------------------------------------------------------------
DATAs-------------------------------------------------------------------------------oReport Its TReport object container.aLine An array of codeblocks with all the line data elements.aFont An array of codeblocks with all the fonts to be used. .aRow Internally used during printing.aWidth An array with each line element width.aPad An array with each line element pad type: LEFT, CENTER, RIGHTnCol Internally used to print the line.nHeight The height of the line.nWidth The largest width defined of its elements.
METHODs-------------------------------------------------------------------------------New Method constructor: creates a new TRLine object. .Stabilize Stabilizes the line. Called by the report stabilize method. .Say Prints the line. .
-------------------------------------------------------------------------------Class TSay Inherits from TControl--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------l3D If the say has to be painted with 3D effectscPicture The PICTURE to use when showing the SAYbGet A codeblock which returns the text to draw
METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor for resourcesDefault Default initialization processcGenPrg Generates a string with the source code of the SAYHandleEvent Specific SAY HandleEvent methodcToChar Generates a data template to build a DialogInit Generic initializationRefresh Forces the SAY to be repaintedSetText Changes the text of the SAY
Class TScrollBar Inherits from TControl--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------lVertical If it is a vertical ScrollBar.lReDraw If the scrollbar must update automatically its positionlIsChild If belongs to a Window with ScrollBars stylenMin, nMax The numeric range to be represented by the Scrollbar
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
nPgStep The increment of value when PgUp or PgDn on the ScrollBarbGoUp A codeblock to eval when going upbGoDown A codeblock to eval when going downbGoTop A codeblock to eval when top is selectedbGoBottom A codeblock to eval when bottom is selectedbPageUp A codeblock to eval when PageUp is selectedbPageDown A codeblock to eval when PageDown is selectedbPos A codeblock to eval when the Thumb is moved to a new positionbTrack
New Constructor from source code.ReDefine Constructor from resource.WinNew Constructor for non-true scrollbar.cToChar Generates a data template to build a Dialog.GetPos Retrieves the current value represented by the Scrollbar.GetRange Returns an array of two elements with the Min and the Max
valuesGoBottom Evaluates the bGoBottom block and updates thumb positionGoDown Evaluates the bGoDown block and updates thumb positionGoTop Evaluates the bGoTop block and updates thumb positionGoUp Evaluates the bGoUp block and updates thumb positionHandleEvent Redefined events managerInit Generic initializationMouseMove Specific MouseMove behaviorPageDown Evaluates the bPageDown block and updates thumb positPageUp Evaluates the bPageUp block and updates thumb positSetPos Changes the position of the thumbSetRange Changes the represented range of the ScrollBarThumbPos Changes the position of the ThumbThumbTrack
Class TSocket InterNet TCP/IP sockets support--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------nPort socket port numbercIPAddr socket IP addressnTimeOut connection timeout valuenBackLog listen backlog valuenSocket socket handlehFile handle of a file transmited in chunksbAccept codeblock to evaluate on accept event.bRead codeblock to evaluate on read event.bWrite codeblock to evaluate on write event.bClose codeblock to evaluate on close event.bConnect codeblock to evaluate on connect event.
METHODS--------------------------------------------------------------------------------New( nPort ) Constructor. nPort = port to use for the socket.Accept( nSocket ) Constructor. Builds a new socket to accept a incommingconnectionEnd() Generic destructor.HandleEvent() manages asyncronous connections events.GetData() Retrieves incomming data.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
SendBin() sends binary data.SendChunk() sends chunks of a file (::hFile ).SendData() sends data.Listen() Sets the socket in listening state.Close() Closes the socket.Connect( cIPAddr ) Connects to a specified IP address.Refresh() Determines the status of the socket.OnAccept() Accept incomming event method.OnRead() Read incomming event method.OnWrite() Write incomming event method.OnClose() Close event action.OnConnect() On connect event method.
Class TStruct C language low level structs object oriented management--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------cBuffer buffer to hold the struct containtsaMembers array with struct members description
METHODs--------------------------------------------------------------------------------New() CONSTRUCTORAddMember( cName, nType, nLen ) Adds a new struct memberSetMember( nMember, uData ) Changes a struct member valueGetMember( nMember ) Retrieves a struct member valueSizeOf() INLINE Len( ::cBuffer ) Retrieves the struct total lengthOnError( cMsg, nError ) ERROR HANDLER
--------------------------------------------------------------------------------Class TTabs FROM TControl--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------aPrompts Label of tab.aSizes Size of tab.nOption Number of tab.bAction CodeBlock.
METHODS--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from resourcesAddItem Add an item to the folder.Default Default initializationDelItem Delete an item from the folder.Display Displays the control. Use :Refresh() to force repaintGetHotPos Returns the tabs option that matches a specified HotKey charInit Generic Control initialization methodLButtonDown Action to be performed when clicking the mousePaint Draws the control. Internally used by Display methodSetOption Select the active tab option.SetTabs Set the array of tabs and option. Default "One", "Two" and"Three".SysCommand Behavior when pressing Alt+... combinations
Class TTime Time objects management--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------nTime time value as a numeric long
METHODs--------------------------------------------------------------------------------New Constructor from source codeSystem Constructor from computer system timeAddHours Adds a specified number of hours.AddMinutes Adds a specified number of Minutes.AddSeconds Adds a specified number of Seconds.cAdd Adds another time and returns the result as a stringcGetTime Retrieves current time as a string.cSub Returns the difference, as a string, from another timeSysChange Change system time.
--------------------------------------------------------------------------------Class TTimer--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------bAction The action to be performed on each intervallActive If the timer is currently activenId The API identifier of the timernInterval The interval of each action in 1/1000 secshWndOwner The handle of the window container of the timer
Activate Activates the timerTTimer:Activate() --> nil
DeActivate Deactivates the timerTTimer:DeActivate() --> nil
Release Destroys the timerTTimer:Release() --> nil
--------------------------------------------------------------------------------Class TTxtEdit Ascii files visual editing. Inherits from TControl--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------aLines An array holding all the text linesaDelLines An array to store the deleted linesaRDelLines An array where to store the undo actionsnDelLines Max. number of deleted lines to storenVisLines Number of lines that fit in screennLineTop First line visible on screenlInsert Logical cursor insert modelChanged Text has changedcFileName Name of the related physical filenamecOperators A string with all the operators (i.e.: "+-*/:.,;" )cSeparators A string with all the separators (i.e.: " " + Chr( 9 ) )
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
nRow Caret physical pixel row position inside the control surfacenCol Caret physical pixel col position inside the control surfacenLineRow Caret logical row position inside the control surfacenLineCol Caret logical col position inside the control surfacecTokens1 A string with the first group of tokens delimited with spacescTokens2 A string with the second group of tokens delimited with spacescTokens3 A string with the third group of tokens delimited with spacescBegWith A string with the group of begin-with tokens delimited withspacesnClrTok1 The first group of tokens colornClrTok2 The second group of tokens colornClrTok3 The third group of tokens colornClrBegin The begin-with group of tokens colornClrNumber The numbers tokens colornClrString The strings tokens colornClrOperator The operators tokens colornClrBBlock BackColor of a marked blocknClrFBlock ForeColor of a marked blocknBlkStaynBlkPosnBlkStart First logical line of the marked blocknBlkEnd Last logical line of the marked blocknTabLen Number of spaces to display for a TAB characternLeftMargin Left marginlVScroll Shows the vertical scrollbarlBackUp Makes a backup BAK file when start saving the file to disklUndo Allows undo operationsnOldLine Last selected text linelRegistered ClassData to store the WinApi registered state of the Class
METHODS--------------------------------------------------------------------------------New Constructor methodChange Always executed when there is a change in the textDelBlock Deletes the current marked blockDelCurLine Deletes the current selected lineDelete Response to Del KeyDelLine Deletes any lineDrawLine Draws any lineDrawCurLine Draws the current selected lineDisplay Shows all the text linesGoUp Try to go to the previous text lineGoDown Try to go to the next text lineInsLine Insert a text lineLoad Loads the text file from disknGetTokenColor Retrieves the defined color for a specified tokennLine Index line inside aLines arrayPaint Automatically called from inside Display methodSelFile Interactively select a new file to editGotFocus Action performed when getting the focusLostFocus Action performed when losing the focusKeyChar Action performed when generating a keystrokeKeyDown Action performed when pressing a keyLButtonDown Action performed when left clicking the mouseGoPrevLine Go to the previous text lineGoNextLine Go to the next text lineGoPrevChar Go to the previous characterGoNextChar Go to the next characterGoBeginLine Go to the beginning of the text lineGoEndLine Go to the end of the text lineGoPrevWord Go to the previous word
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
GoNextWord Go to the next wordToggleInsert Toggles the current insert modeReSize Action performed when resizing the controlSetFont Sets the font to use for displaying the text linesSetText Sets the text to edit from a stringVScrAdjust Vertical ScrollBar Range AdjustGoBottom Go to the last text lineGoTop Go to the first text lineGotoLine Interactively request the line to go toGoLine Go to a certain text linePageUp Go to the previous page of text linesPageDown Go to the next page of text linesDupLine Duplicates the current selected lineCopy Copies the current marked block into the ClipboardPaste Copies the clipboard contents into the current caret positionCut Deletes the current marked block and copies into the ClipboardJoinLine Joins the current line with the next text lineSplitLine Breaks the current line into two from the current caretpositionSave Save the text to a disk fileAddUndo Adds a new action to the array of 'UnDoable' actionsUndo Undoes the last performed operationRedo Redoes the last performed operationMouseMove Action to perform when moving the mouse over the controlPaintBlkDown Extends downwards the marked block and paints itPaintBlkUp Extends upwards the marked block and paints it
--------------------------------------------------------------------------------Class TTxtFile Ascii files management as objects--------------------------------------------------------------------------------
See Also Class TTxtEdit for editing text files.
DATAs--------------------------------------------------------------------------------cLine The latest ascii line read from the filenTLines The number of lines contained inside the ascii filenLine Current ascii line numbernMaxLineLength The maximum ascii line size permitted to be read. Default 1024nOffset The binary position inside the ascii file
METHODs--------------------------------------------------------------------------------New Constructor methodAdd Adds a new line to the ascii fileAppendLn Adds a new line to the ascii fileAdvance Skips to the next ascii lineDelLine Deletes an ascii lineGetValue Retrieves an ascii INI file section and key valueGoTo Jumps to a specific ascii line numberGoTop Jumps to the beginning of the ascii fileGoBottom Jumps to the end of the ascii fileInsLine Insert an ascii line in the current line positionLastRec Returns number of ascii text linesnRecno Returns the current ascii line numberReadLine Returns the current ascii line textReadLn Returns the current ascii line textRecCount Returns the number of ascii text linesRecNo Returns the current ascii line numberRepLine Duplicates the current ascii text lineRewind Skips to a previous line position
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
CLASS TVbControl FROM TControl--------------------------------------------------------------------------------CLASSDATA aEventNames // Just one array to all object instances--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------hCtl The handle of the VBX control (internal API value)aEvents An array with all the defined events and its
related actions.METHODS--------------------------------------------------------------------------------New Creates a new VBX control from source codeReDefine Redefine a VBX to be used from resourcesInit Generic initialization of a VBXGetPropName Retrieves the name of a VBX property by its orderaGetProps Returns an array with all the properties namesDefault Default values for the initialization of the VBXSetProp Changes a VBX property by its orderGetName Retrieves the class name of the VBX control (API value)nGetProps Retrieves the number of properties of the VBXnGetEvents Retrieves the number of events of the VBXGetEvent Retrieves the name of a VBX event by its nameGetEnums Retrieves an array with a VBX enum all possible valuesGet Retrieves the value of a property by its nameSet Changes a VBX property the value of a property by its nameGetProp Retrieves the value of a property by its orderGetPropType Retrieves the type of a VBX propertyHandleEvent VBX specifically HandleEvent (inherits from TControl)VbxEvent Internal VBX events management function supportMouseMove Virtual MouseMove method (to request default behavior)VbxInherit Internal automatic inherit process for 5W VBX system
Class TVideo Inherits from TMCI--------------------------------------------------------------------------------
DATAs--------------------------------------------------------------------------------oMci A reference to a contained MCI ObjectcAviFile The name of the associated AVI file.
METHODs--------------------------------------------------------------------------------New Constructor from source codeReDefine Constructor from resourcesInit Generic Control initialization methodPlay Start playing the AVI file.
--------------------------------------------------------------------------------Class TWBrowse Inherits from TControl--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------aActions An array of codeblocks actions for clicking header .lRegistered A CLASSDATA value. See TWindow:lRegistered.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
cAlias The workarea alias where the browse was created .cField SELECT clause expression in SELECT ... FOR ... TO ... .uValue1 FOR clause expression in SELECT ... FOR ... TO ... .uValue2 TO clause expression in SELECT ... FOR ... TO ... .bLine Retrieves an array of expressions for each column. .bSkip Like Clipper TBrowse:skipBlock. We provide a default one .bGoTop Like Clipper TBrowse:goTopBlock. We provide a default one .bGoBottom Like Clipper TBrowse:goBottomBlock. We provide a default one.bLogicLen CodeBlock that retrieves de length of the Data. We supply onebChange CodeBlock to perform when moving from row to row .bAdd The codeblock to execute for adding a new record .nRowPos The row which has the focus. .nColPos The left column visible on screen. .nLen The number of elements. By default is Eval( ::bLogicLen ) .nAt The array element currently selected when browsing arrays .lHitTop Like Clipper TBrowse:hitTop. .lHitBottom Like Clipper TBrowse:hitBottom. .lCaptured If the mouse is being captured (resizing columns) .lMChange If it is allowed to resize columns .aHeaders Array of cText for the Header of each column. .aColSizes Array of nSize for each column. .nClrBackHead Header background color .nClrForeHead Header foreground color .nClrBackFocus Focused line background color .nClrForeFocus Focused line foreground color .aJustify An array of logical elements, one per column, for right justify
METHODS--------------------------------------------------------------------------------New Constructor from source code .ReDefine Constructor from resources .SetArray Automatically sets an array to be browsed .SetTree Automatically sets a tree to be browsed .lCloseArea Closes the associated area of the browse .LDblClick Left double click events management .Default Default initialization .VertLine Vertical resizing of the columns .BugUp Corrects the painting when very few records are browsed .lEditCol Edits a cell of the browse .GetDlgCode Returns the GetDlgCode associated .GoUp Goes up one line .GoDown Goes down one line .GoLeft Goes left one column .GoRight Goes right one column .GoTop Goes to the first element browsed .GoBottom Goes to the last element browsed .HandleEvent Specific browses HandleEvent METHOD .HScroll Horizontal scrollbars events manager .Init Initialization process .PageUp Goes up one page .PageDown Goes down one page .KeyDown Method to handle WM_KEYDOWN events. .KeyChar Method to handle WM_CHAR events. .LButtonDown Left mouse click events manager .LButtonUp Left mouse releasing events manager .MouseMove Mouse Movements events manager .Paint Painting method .VScroll Vertical scrollbar events manager .Skip Moves the cursor up or down. .DrawLine Redraws a specific row without input focus look .DrawSelect Redraws cursor row with input focus look .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
RecAdd Adds a new record evaluating the bRecAdd codeblock .SetFilter Changes the currently values assigned for indexed filters .GotFocus Got focus processes .UpStable Forces to stabilize properly when a very records are browsed.nRowCount Returns the number of visible rows on the browse .GetColSizes Returns an array with all the sizes of the columns .LostFocus Losing focus processes .nAtCol Returns the column placed at a specific pixel position .Report Automatically generates a Report from the browse .
--------------------------------------------------------------------------------Class TWebServer InterNet WEB pages and Proxy server--------------------------------------------------------------------------------
DATA--------------------------------------------------------------------------------nPort socket port numbercIPAddress socket IP addressnTimeOut connection timeout valuenBackLog listen backlog valuenSocket socket handle
METHODS--------------------------------------------------------------------------------New Constructor from source code.ReDefine Constructor for resources.cGetPRG Generates the source code of the button.New( nPort ) Constructor. nPort specifies the port to useAccept Constructor. Creates a clone from the listening host socketEnd Closes the connectionGetText Retrives the data that arrives to the socketSenData Sends data throught the socketListen Turns the socket into a listening host socket--------------------------------------------------------------------------------Class TWindow Main base Class--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------hWnd window handle hWndnOldProc Old window procedure when SubClassingbInit Code Block to execute on initializationbMoved Code Block to execute after moving the windowbLClicked Code Block to execute when left clicking with the mousebKeyDown Code Block to execute when pressing a keybPainted Code Block to execute when painting the WindowbRClicked Code Block to execute when right clicking with the mousebResized Code Block to execute after resizing a WindowbLDblClick Code Block to execute when left double clicking the mousebWhen Code Block for WHEN clausebValid Code Block for VALID clausebKeyChar Code Block to execute when pressing a no-control keybMMoved Code Block to execute when moving the mousebGotFocus Code Block to execute when receiving the focusbLostFocus Code Block to execute when losing the focuscCaption The caption of the WindowcPS Paint structure meanwhile paintingnPaintCount N. of times painting procedure has been invokedcMsg The text for the default message on the MsgBarCargo Standard Clipper general purpose user defined DATAhDC window Device Context handle while paintingnId Numeric identifier of the Window
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
lActive If the window is activelVisible If the window is visiblelFocused If the window has the focusnStyle Numeric windows style valuenChrHeight Standard height for characters of the windownChrWidth Standard width for characters of the windownLastKey Last key pressed on the windownTop window coordinatesnLeft window coordinatesnBottom window coordinatesnRight window coordinatesnClrPane Color of the background of the windownClrText Color of the foreground of the windownResult Numerical value after last activationlValidating If the window is in a process of validating a controlnHelpId The help topic identifier for this windowhCtlFocus Handle of the child control which has the focusaControls An array holding all the controls of the windowoBar Bar Object attached to the windowoBrush Brush Object attached to the windowoCursor Cursor Object attached to the windowoFont Font Object attached to the windowoIcon Icon Object attached to the windowoMenu Menu Object attached to the windowoSysMenu SysMenu Object attached to the windowoPopup Temporary popup menu acting over the windowoMsgBar MsgBar Object attached to the windowoWnd Window Object container of the windowoVScroll Vertical scrollbar Object attached to the windowoHScroll Horizontal scrollbar Object attached to the window
METHODS--------------------------------------------------------------------------------New Constructor of window class .Activate Activates a Window .AddControl Adds a new child control .BeginPaint It is automatically called before painting .Box Draws a Box on the Window.Capture Capture all the Mouse activity for the Window .Center Centers the window on the screen .Command Process a generic command .Circle Draws a circle .CoorsUpdate Updates the coordinates of the window .Copy Places a copy of the window image at the clipboard .Create Generic new Window Class creation .CtlColor Set color of control. .cTitle The caption of the Window .DdeInitiate Initiate DDE session from the window .DdeAck Acknowledge DDE. .DdeExecute Execute DDE command .DdeTerminate Terminate DDE session .Destroy() Destroy a window .Disable Disables the Window .DrawItem Draw item .DropFiles Handle files dropped on this window .Enable Enable Window activity .End End Activity .EndPaint Automatically called when ending painting .EraseBkGnd Erase background of window .FloodFill Fill area from startpoint with color .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
FocusNext Changes the child focus to the next or to the previous .cGenPrg Generates the source code of the window .nGetChrHeight Updates the nChrHeight DATA of the window .GetCliRect Returns the client window area .GetFont Get font from window .GetRect Returns the whole area .GetDC Returns the current device context. .GetDlgCode Return the kind of Dialog information a window requests .GetWidth Get width of string written with certain font .GoNextCtrl Goto next control in window .GoPrevCtrl Goto previous control in window .GotFocus Called when window got focus .GoTop Bring window to top .HandleEvent Generic handle event management .HardCopy() Makes a printout of the Window. .Hide Hide window .HScroll Horizontal scroll method dispatcher .Iconize() Iconize window .KeyDown Key holding down method dispatcher .KeyChar Key pressed method dispatcher .KillFocus Called when window loses focus .LButtonDown Left Mouse button down dispatcher .LDblClick Called when left double click occurs .Line Draws a line .Link Window to OOPS conversion initialization .LostFocus Called when window loses focus .lWhen Evaluate when condition .Maximize Maximize window .MenuSelect Called when menuitem is selected .MeasureItem Measure size of control .Minimize Minimizes the Window .MouseMove Called when mouse moves over window .Move Moves the Window .NcActivate .Normal Give window normal size .Paint Generic painting method .PaletteChanged .PostMsg Post a Windows message .Print Prints the Window at the Printer .QueryDragIcon Icon for dragging .QueryEndSession End of query .QueryNewPalette .RButtonDown Right mouse button down dispatcher .ReleaseDC Release the previous device context requested .Refresh Forces a Window to be repainted .Register Register a new Window Class .ReSize Changes the size of a Window .Say Writes text on a Window .SayRect Writes text with a box around .SendMsg Send a Windows message .SelColor Choose foreground or background color for window .SetBrush Changes the brush of a Window .SetCoors Changes the coordinates of the Window .SetColor Set foreground/background color and brush .SetFocus Gives the focus to a Window .SelFont Select font for window .SetFont Changes the font of a Window .SetMenu Changes the Menu of a Window .SetMsg Changes the message of the bottom of the Window .SetPixel Draws a pixel on the Window .SetText Changes the caption of the Window .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Show Show window .SysCommand System Menu commands dispatcher .Timer Called when timer event occurs for window .UnLink Disables Window-OOPS connection .Update Update controls on window .lValid Check valid condition .VScroll generic vertical scroll dispatcher .nVertRes() Vertical resolution of window in pixels .nHorzRes Horizontal resolution of window in pixels .AEvalWhen() Evaluate when clauses for controls when starting window .VbxFireEvent A VBX event was triggered .
--------------------------------------------------------------------------------Class TYacc FiveWin YACC Machine--------------------------------------------------------------------------------DATA--------------------------------------------------------------------------------oLex AS OBJECT TLex objectlDebug AS LOGICAL Debug modenErrors AS NUMERICnErrFlag AS NUMERICnToken AS NUMERIC Last tokennTheState AS NUMERIC Actual statenState AS NUMERIC INIT 1 Index into aStatesnValue AS NUMERIC INIT 1 Index into aValuesaStates AS ARRAY INIT {}aLen AS ARRAY N. of rules of each stateaValues AS ARRAY INIT {}aDefRed AS ARRAY INIT {}aShift AS ARRAYaReduce AS ARRAYaSIndex AS ARRAY Array of shift indexesaRIndex AS ARRAY Array of reduce indexesaGIndex AS ARRAY Array of goto indexesaDGoto AS ARRAYaTable AS ARRAYaLHS AS ARRAY Left hand sideaCheck AS ARRAYaRules AS ARRAYuLValue Last left valueuValue Last right valuebShift AS BLOCKbReduce AS BLOCK
METHODS--------------------------------------------------------------------------------New Constructor from source codeParse Starts processing an input stream (file or string)Shift Shifts to a new stateReduce Reduces from a state and executes the production rule ifdefinedError Error manager.ProdValue Returns the value of a production member.Accept General acceptacion process when parsing is completed.
CONSTRUCTOR When we are going to initialize an Object and we want toautomatically return a reference to self.It is a good practice to first specify the methodsthat allows you to build an object (constructors).
SETGET They are for calculated Data. This means we will manipulatethis name of a method like a Data.
VIRTUAL Methods that do nothing. Very useful for inheritances andwhen you are starting creating and testing a Class.
BLOCK Extremely fast and easy to code, use this clause when youwant to declare 'inline' methods just from the definitionof the Class. We use a lot of them in FiveWin Classes. Youhave to specify as first parameter 'Self'.
All methods automatically require a first parameterwhich it is the 'Self'. Objects.ch automaticallyprovides 'Self' in standard METHODs, but in BLOCK
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
The advantadge of BLOCK methods over standardMETHODs is that they don't require to write therelated code, as it is included in the same declaration.So it reduces the number of required Clipper symbols,but it has the disadvantadge that always a codeblockmust be evaluated. On a standard METHOD a codeblockevaluation is not necessary, so we avoid one executionstep.
INLINE The same functionality than the BLOCK clause, but it ismuch more easy to use as it is not necessary to build thecodeblock -it is automatically built- It is better xBase!We plan in next versions of FiveWin to convert all ourBLOCK methods into INLINE clauses.
INLINE Methods get automatically converted into BLOCKmethods definition. It is just an easier and faster wayto code a BLOCK method. We recommend you to use INLINEmethods instead of BLOCK methods.
As INLINE methods get automatically preprocessed intoBLOCK methods, the 'self' is automatically provided soit is not needed to specify it.
<cFontFile> The name of an external file where we have storedsome fonts we want to use in our application.
<hFontResource> The handle of a module (DLL) where we have storedsome fonts we want to use in our application.
Returns:
<nFontsAdded> The number of fonts the system successfully added.
Sample: AddFontResource( "MyApp.dll" )
Source code: SOURCE\\WINAPI\\FontCrea.c
--------------------------------------------------------------------------------aGetWorkAreas() Returns an array with all available work areas--------------------------------------------------------------------------------
Syntax: aGetWorkAreas() --> <aWorkAreas>
Parameters: None.
Returns:
<aWorkAreas> An array with the name of all workareas in use.
AnsiToOem() Translates a Window string into the OEM MsDos--------------------------------------------------------------------------------
Syntax: AnsiToOem( <cWindowText> ) --> <cOemText>
Parameters:
<cWindowText> The Window string to convert into OEM format.
Returns:
<cOemText> The equivalent OEM string.
Observations Normally all the data that you capture from MsDosinto a DBF is stored as OEM text. In this situationyou may call OemToAnsi() to properly review it frominside Windows.
Text that is captured from Windows is in Ansiformat. To use it from MsDos later, store it asthe result of AnsiToOem().
Source code: SOURCE\\WINAPI\\OemAnsi.c
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------aOData() Returns an array with all an Object Class DATA names--------------------------------------------------------------------------------
Syntax: aOData( <oObject> ) --> <aClassDataNames>
Parameters:
<oObject> This is an Object.
Returns:
<aData> This function returns an array with the Namesof all the Object Class Data.
Observations: None.
Sample: local aObjClsNames := aOData( oObject )
Source code: SOURCE\\FUNCTION\\aOData.prg
See also: aOData.eho:"source code"
--------------------------------------------------------------------------------Arc() Draws an elliptical arc--------------------------------------------------------------------------------
<hDC> Identifies the device context where the arc is drawn
<nLeftRect> The dimensions of the rect where the arc is placed<nTopRect><nRightRect><nBottomRect>
<nXStartArc> The coordinates of starting point of the arc.<nYStartArc><nXEndArc> The coordinates of ending point of the arc.<nYEndArc>
Returns:
<lSuccess> A logical value indicating that the operationwas performed successfully.
Source code: SOURCE\\WINAPI\\Drawing.c
--------------------------------------------------------------------------------ASend() Send an OOP message to an array of Objects--------------------------------------------------------------------------------
<cMsg> A literal describing the OOP message to send to theobject. It is the same as doing the following code,but in a much more efficient way, and without havingto know in advance which OOP message will be sent tothe array of objects:
local n
for n = 1 to Len( <aArray> )<aArray>[ n ]:<cMsg>( <uParam1>, ..., <uParamN> )
next
<uParam1> A list of optional parameters to be supplied as<uParamN> parameters to the method.
Returns: nil
Source code: C language. Not provided.
See also: OSend()
--------------------------------------------------------------------------------aTreeBmps() Returns an array with the default tree bitmaps--------------------------------------------------------------------------------
Syntax: aTreeBmps() --> <aBmpHandles>
Parameters: None
Returns:
<aBmpHandles> An array with the handles of the bitmaps usedto display the FiveWin trees.
Observations Used internally by FiveWin trees.
Source code:
See also:
--------------------------------------------------------------------------------BarAdjust() Adjust the bar to the new dimension of its container--------------------------------------------------------------------------------
Observations: Used internally by Fivewin. You don't need to useit directly.
Source code: SOURCE\\FUNCTION\\Bartools.c
See also:
--------------------------------------------------------------------------------BeginPaint() Prepares a window for start painting--------------------------------------------------------------------------------
Syntax: BeginPaint( <hWnd>, @<cPS> ) --> <hDC>
Parameters:
<hWnd> Identifies the window to be repainted.
<cPS> A variable that will receive aWinApi PAINTSTRUCT as a string. This variablehas to be supplied by reference.
Returns:
<hDC> The device context for the given window.
Comments: The BeginPaint function automatically sets theclipping region of the device context to excludeany area outside the update region. The updateregion is set by the InvalidateRect orInvalidateRgn function and by the system aftersizing, moving, creating, scrolling, or any otheroperation that affects the client area. If theupdate region is marked for erasing, BeginPaint sendsa WM_ERASEBKGND message to the window.
An application should not call BeginPaint exceptin response to a WM_PAINT message. Each callto the BeginPaint function must have acorresponding call to the EndPaint function.
If the caret is in the area to be painted,BeginPaint automatically hides the caret toprevent it from being erased.
If the window's class has a background brush,BeginPaint will use that brush to erase thebackground of the update region before returning.
Sample: SOURCE\\CLASSES\\Window.prg
Source code: SOURCE\\WINAPI\\Paint.c
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------B2Bin() Converts a byte into a string 1 byte len--------------------------------------------------------------------------------
Syntax: B2Bin( <nValue> ) --> <cValue>
Parameters:
< nValue > This is a number which is converted to a BYTE string
Returns:
<cValue> The equivalent <nValue> as a string.
Sample: local cVar := B2Bin( 1 )
Source code: SOURCE\\WINAPI\\b2bin.c
--------------------------------------------------------------------------------Browse() Automatic full featured FiveWin browse--------------------------------------------------------------------------------
<cTitle> The principal title for the Fivewin browse.<cListName> This is the name of the data to see in browse.<bNnew> This CodeBlock is used to add a New Record.
<bModify> This CodeBlock is used to Modify the record.<bDelete> This CodeBlock is used to delete the record.
<bSearch> This CodeBlock is used to search for data.<bList> This CodeBlock is used to list to the printer.
Observations: This is a self contained Clipper-Fivewin traditionaldBase-III-Plus like Browse, very useful for prototypingapplications.
Sample:
static function Main()
local cTitle := "This is a FiveWin Browse Sample."local cListName := "NAME, ADDRESS, TELEPHONE"local bNew := { || MsgInfo( "Add a New Record" ) }local bModify := { || MsgInfo( "Modify an existing record" ) }local bDelete := { || MsgInfo( "Delete a record" ) }local bSearch := { || MsgYesNo( "Do you want to search some thing? " )
}local bList := { || MsgYesNo( "Do you want a report list?" ) }
--------------------------------------------------------------------------------BtnPaint() Paints the contents of a bitmapbutton--------------------------------------------------------------------------------
Parameters:<hWnd> The handle of the window which is painting<hBmpPal1> Special FiveWin handle ( bitmap + palette together )
of the normal bitmap.<hBmpPal2> Special FiveWin handle ( bitmap + palette together )
of the pressed bitmap.<lPressed> If the button is being pressed.<lAdjust> If the bitmap has to be adjusted on the surface.
Returns: Nothing.
Observations: This is a FiveWin function used internally to paintthe buttonbar buttons.
Source code: No provided.
--------------------------------------------------------------------------------BuildCommDCB() Translates a device string into a control block--------------------------------------------------------------------------------
The BuildCommDCB function translates a device-definition string intoappropriate serial Device Control Block (DCB) codes.
Parameters:
<cInfoDef> A string that specifies device-control information.The string has the same form as the parameters used inthe MsDos mode command.
<cDevBlock> A string passed by reference that will receive thetranslated string. Its structure defines the controlsettings for the serial-communications device.
Returns: .t. if everything was ok.
Observations: This is a WinApi communication function.
Sample: See SAMPLES\\TestComm.prg
Source code: SOURCE\\WINAPI\\comm.c
See also:
--------------------------------------------------------------------------------CallDll() Calls a function placed into a DLL
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cFunctionDef> A special string which holds all the necessaryinformation to execute a certain action. This stringis automatically produced by the functionGetProcAddress().
<uParam1,...> Are the parameters supplied to the called function.This depends on the DLL function we are going to call.
Returns: The returned value from the DLL function.
Observations: See INCLUDE\\DLL.CH for the xBase way of doing thisDLLs functions calls.
Sample: See SAMPLES\\DllCall.prg
Source code: SOURCE\\WINAPI\\CallDll.c
See also: GetProcAddress()
--------------------------------------------------------------------------------CallWindowProc() Passes messages information to a specific procedure--------------------------------------------------------------------------------
The CallWindowProc function passes message information to the specifiedwindow procedure.
Parameters:
<nWndProc> Specifies the procedure-instance address of the previouswindow procedure.
<hWnd> Identifies the window that will receive the message.
<nMsg> Specifies the message.
<nWParam> Specifies 16 bits of additional message-dependentinformation.
<nLParam> Specifies 32 bits of additional message-dependentinformation.
Returns: The return value specifies the result of the messageprocessing and depends on the message sent.
Observations: The CallWindowProc function is used for windowsubclassing. Normally, all windows with the same classshare the same window procedure. A subclass is a window
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
or set of windows belonging to the same window classwhose messages are intercepted and processed by anotherwindow procedure (or procedures) before being passedto the window procedure of that class.
The SetWindowLong function creates the subclass bychanging the window procedure associated with aparticular window, causing Windows to call the newwindow procedure instead of the previous one. Anymessages not processed by the new window procedure mustbe passed to the previous window procedure by callingCallWindowProc. This allows you to create a chain ofwindow procedures.
Source code: SOURCE\\WINAPI\\CallWnd.c
See also: SetWindowLong()
--------------------------------------------------------------------------------cArgV() Retrieves a certain command line parameter--------------------------------------------------------------------------------
Syntax: cArgV( <nOrder> ) --> <cCommandLineParam>
Retrieves a command line parameter supplied tothe application (like in C argv).
Parameters:
<nOrder> The parameter order supplied to the application.
Returns:
<cCommandLineParam> A string with the specified command line param.
Sample: See SAMPLES\\TestArgs.prg
Source code: SOURCE\\FUNCTION\\Arg.c
See also: nArgC()
--------------------------------------------------------------------------------cCtrl2Chr() Generates a string with the control structure--------------------------------------------------------------------------------
Returns: A string with binary information that describesthose values.
Observations: It is used internally by FiveWin when creatingDialogBoxes in runtime.
Source code: SOURCE\\WINAPI\\Ctl2Chr.c
See also: See TControl:cToChar() METHOD.
--------------------------------------------------------------------------------cGetExpression() General build expression DialogBox--------------------------------------------------------------------------------
<cInitialExpression> The default expression that appears wheninvoking the cGetExpression() DialogBox.
<cTitle> The title for the DialogBox. By default itshows "Expression builder".
Returns:
<cExpression> The expression built by the user.
Observations: This function is now only available from theIDE. If you want to use it in your applicationyou have to copy the RC for the DialogBox fromIDE.DLL to your application.
Sample: ? cGetExpression( "Customer->Name",;"Select a expression to search for" )
Source code: SOURCE\\FUNCTION\\MsgExpr.prg
See also: The Index builder in the IDE
--------------------------------------------------------------------------------cGetFile() File selection standard DialogBox--------------------------------------------------------------------------------
<cTitle> The title of the DialogBox. By default"Select a file" is shown.
<nDefaultMask> An optional numeric value in case thatyou want to start the DialogBox with a certainfile type selected (if you are using the multiplefile types format).
To request lately what was the file type selected,you may use the function nGetFileFilter().
<cInitialDirectory> The initial directory where to startlooking for files. By default it uses ".\\"
Returns: A string with the name of the filename selected.
Sample: See IDE\\SOURCE for a lot of different samples.
Source code: SOURCE\\WINAPI\\GetFile.c
See also: nGetFileFilter()
--------------------------------------------------------------------------------CloseZipFile() Closes the ZIP file--------------------------------------------------------------------------------
Syntax CloseZipFile() --> nil
Parameters None
Returns Nothing.
Closes the ZIP file previously in use callingGetFirstInZip() and GetNextInZip() functions.
Sample: SAMPLES\\TestZip.prg
Source code: SOURCE\\FUNCTION\\UnZip.c
--------------------------------------------------------------------------------CurDrive() Retrieves the default drive selected letter
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cCurDrive> The letter of the currently selecteddrive: "C", "D", "E", ...
Example
MsgInfo( CurDrive() )
--------------------------------------------------------------------------------GetHelpFile() Retrieves the default help file selected--------------------------------------------------------------------------------
Syntax
GetHelpFile() --> cHelpFile
Parameters
None
Returns
cHelpFile The name of the help file previously selected.
Description
We have implemented this function to easy the help functionsmanagement, letting the user select a default HLP file which willbe accessed automatically, requesting different kind of services.The function may be called at the beginning of the execution of ourapplication so it will remain active during our application execution.
Example
MsgInfo( GetHelpFile() ) // Shows cHelpFile
Source: HELP.C
--------------------------------------------------------------------------------GetHelpTopic() Retrieves the default help Topic--------------------------------------------------------------------------------
Syntax
GetHelpTopic( [ ncTopic ] )
Parameters
ncTopic Is an optional parameter and let us specify the topicabout we want help. It can be a number or a string.If it is not specified, the default topic selectedwith HelpSetTopic() will be shown.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
The topics identifiers are established by the helpfile author.
Returns
Nothing
Description
We may select a default topic to be called every time werequest help.
Example
GetHelpTopic( "Use_of_help" )
Source: HELP.C
--------------------------------------------------------------------------------C2Hex() Converts a byte into a hex string (2 chars) .--------------------------------------------------------------------------------
Syntax: C2Hex( <cChar> ) --> <cHex>
Parameters:
<cChar> A one character string.
Returns:
<cHex> A two character hex string.
Sample: MsgInfo( C2Bin( "X" ) ) // returns a "58" hex
Source code: SOURCE\\FUNCTION\\B2Bin.c
See also: I2Hex()
--------------------------------------------------------------------------------nFileCrc() Returns a CRC checksum for an entire file contents--------------------------------------------------------------------------------
Syntax: nFileCrc( <cFileName> ) --> nCRCValue
Parameters:
<cFileName> The name of the file to calculate a checksum on itscontaints.
Returns:
<nCRCValue> A numeric value with the checksum CRC.
Sample: MsgInfo( nFileCrc( "c:\command.com" )
Source code: Not provided.
See also: nStrCrc()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------cFileDisk() Retrieves the drive from a filename with path--------------------------------------------------------------------------------
Syntax: cFileDisk( <cFileName> ) --> <cDrive>
Parameters:
<cFileName> The filename whose drive to retrieve, if thedrive has been specified inside its filename.
Returns:
<cDrive> A two characters string with the format: A:, B:,C:, etc...
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFileExt() Retrieves the extension from a filename--------------------------------------------------------------------------------
Syntax: cFileExt( <cFileName> ) --> <cExtName>
Parameters:
<cFileName> The filename whose extension to retrieve, if theextension has been specified inside its filename.
Returns:
<cExtName> A three characters string with the extensionname.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFileMask() Retrieves the mask from a filename if specified--------------------------------------------------------------------------------
Syntax: cFileMask( <cFileName> ) --> <cMask>
Parameters:
<cFileName> The filename whose mask to retrieve, if amask has been specified inside its filename. A maskis a group of wildcards ( "*.*", "?...", etc...).
Returns:
<cMask> The mask if specified.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFileName() Retrieves the filename without its path--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cFullFileName> The full filename including path and optionalextension.
Returns:
<cFileName> Just the filename specified inside the full filename.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFileNoExt() Retrieves the filename without path and extension--------------------------------------------------------------------------------
Syntax: cFileNoExt( <cFileName> ) --> <cFileName>
Parameters:
<cFileName> The full filename including path and optionalextension.
Returns:
<cFileName> Just the filename specified inside the full filename,without path and extension.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFileNoPath() Retrieves the filename without path (as cFileName()) .--------------------------------------------------------------------------------
<cFullFileName> The full filename including path and optionalextension.
Returns:
<cFileName> Just the filename specified inside the full filename.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFilePath() Retrieves the path from a filename with path--------------------------------------------------------------------------------
Syntax: cFilePath( <cFileName> ) --> <cPath>
Parameters:
<cFileName> The full filename including path and optionalextension.
Returns:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cPath> Just the path name specified inside the full filename.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFileSubDir() Retrieves the subdir name from a filename--------------------------------------------------------------------------------
Syntax: cFileSubDir( <cFileName> ) --> <cDirName>
Parameters:
<cFileName> The full filename including path and optionalextension.
Returns:
<cDirName> Just the path name specified inside the full filename,excluding the drive name.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cNewFileName() Retrieves a new filename using a rootname--------------------------------------------------------------------------------
<cRootName> A root name to use to build a new filename thatdoes not exists.
<cExt> The extension to use to build the new filename.
Returns:
<cNewFileName> It is a new non-existing filename, with the format:<cRootName>XXX.<cExt>
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFileNoExt() Retrieves the filename without path and extension--------------------------------------------------------------------------------
Syntax: cFileNoExt( <cFileName> ) --> <cFileName>
Parameters:
<cFileName> The full filename including path and optionalextension.
Returns:
<cFileName> Just the filename specified inside the full filename,without path and extension.
Source code: SOURCE\\FUNCTION\\FileName.prg
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------cFileNoPath() Retrieves the filename without path (as cFileName()) .--------------------------------------------------------------------------------
<cFullFileName> The full filename including path and optionalextension.
Returns:
<cFileName> Just the filename specified inside the full filename.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFilePath() Retrieves the path from a filename with path--------------------------------------------------------------------------------
Syntax: cFilePath( <cFileName> ) --> <cPath>
Parameters:
<cFileName> The full filename including path and optionalextension.
Returns:
<cPath> Just the path name specified inside the full filename.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cFileSubDir() Retrieves the subdir name from a filename--------------------------------------------------------------------------------
Syntax: cFileSubDir( <cFileName> ) --> <cDirName>
Parameters:
<cFileName> The full filename including path and optionalextension.
Returns:
<cDirName> Just the path name specified inside the full filename,excluding the drive name.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cNewFileName() Retrieves a new filename using a rootname--------------------------------------------------------------------------------
<cRootName> A root name to use to build a new filename thatdoes not exists.
<cExt> The extension to use to build the new filename.
Returns:
<cNewFileName> It is a new non-existing filename, with the format:<cRootName>XXX.<cExt>
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------cTempFile() Retrieves a temporary new filename--------------------------------------------------------------------------------
Syntax: cTempFile() --> <cNewFileName>
Parameters: None.
Returns:
<cNewFileName> It is a new non-existing filename, with the format:XXXXXX.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------FSize() Retrieves the size of a filename without opening it--------------------------------------------------------------------------------
Syntax: FSize( <cFileName> ) --> <nFileSize>
Parameters:
<cFileName> The name of the file whose size to retrieve.
Returns:
<nFileSize> A number specifying the size of the file.
Source code: SOURCE\\FUNCTION\\FileName.prg
--------------------------------------------------------------------------------ChangeProc() Changes the procedure of a Window--------------------------------------------------------------------------------
Syntax: ChangeProc( <hWnd> ) --> <nOldProc>
This function replaces the procedure that controlsthe behavior of a function, for a FiveWin special one.
RestProc() replaces again this new procedure forthe old one.
Parameters:
<hWnd> The handle of the window to change its proc.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nOldProc> A number ( long pointer ) of the old procedure.
Observations: This function is used internally by FiveWin toautomatically subclass windows and controls and tomake them compatible with the OOPS architecture ofFiveWin.
Source code: SOURCE\\WINAPI\\ChangePr.c
--------------------------------------------------------------------------------Chord() Draws a chord .--------------------------------------------------------------------------------
<hDC> Identifies the device context where to paint
<nLeftRect> The rect of the bounding rectangle where to<nTopRect> place the chord.<nRightRect><nBottomRect>
<nXStartLine> The origin and end of the line that intersects<nYStartLine> with the ellipse forming the chord.<nXEndLine><nYEndLine>
Returns:
<lSuccess> A logical value indicating if the operation wasperformed successfully.
Source code: SOURCE\\WINAPI\\Drawing.c
--------------------------------------------------------------------------------ChooseColor() Color selection standard DialogBox--------------------------------------------------------------------------------
Disables the possibility of defining user definedcolors. FiveWin by default allows user definedcolors.
Returns:
<nRGBColor> The RGB value of the color selected. If noselection is done, nRGBDefaultColor is returned.
Sample: ? ChooseColor( CLR_CYAN )
Source code: SOURCE\\WINAPI\\ClrChoos.c
--------------------------------------------------------------------------------ChooseFont() Font selection standard DialogBox--------------------------------------------------------------------------------
See also: TFont():Choose() and TWindow():SelFont()
--------------------------------------------------------------------------------ClientToScreen() Converts client coordinates into screen coordinates--------------------------------------------------------------------------------
Syntax: ClientToScreen( <hWnd>, <aPoint>) --> nil
This function converts the client coordinates of agiven point on the screen to screen coordinates.
Parameters:
<hWnd> The handle of the window whose client area isused for the conversion.
<aPoint> An array of two elements that holds thecoordinates of the point. The two elements of thisarray are transformed accordingly with the newcalculated values.
Returns: Nothing. The result is placed inside the same array.
Sample: local aPoint := { 100, 120 }
ClientToScreen( oWnd:hWnd, aPoint )
? aPoint[ 1 ]? aPoint[ 2 ]
Source code: SOURCE\\WINAPI\\Clt2Scr.c
See also: ScreenToClient()
--------------------------------------------------------------------------------CloseClipboard() Closes the clipboard--------------------------------------------------------------------------------
Syntax: CloseClipboard() --> <lSuccess>
This function closes the ClipBoard.
Parameters: None.
Returns:
<lSuccess> A logical value that represents if the operationwas completed successfully.
Observations: A window must close the clipboard after using it inorder to let other windows use it.
Source code: SOURCE\\WINAPI\\ClpBrd.c
See also: OpenClipboard() SetClipboard() EmptyClipboard()GetClpData()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------CloseComm() Closes the communication device and frees memory--------------------------------------------------------------------------------
Syntax: CloseComm( <nDeviceId> ) --> <lSuccess>
The CloseComm function closes the specifiedcommunications device and frees any memory allocatedfor the device's transmission and receiving queues.All characters in the output queue are sent beforethe communications device is closed.
Parameters:
<nDeviceId> Specifies the device to be closed. The OpenCommfunction returns this value.
Returns:
<lSuccess> A logical value indicating if the operation wassuccessful.
Sample: See SAMPLES\\TestComm.prg
Source code: SOURCE\\WINAPI\\Comm.c
See also: OpenComm() WriteComm() ReadComm() BuildCommDcb()SetCommStat() FlushComm() GetCommError()
--------------------------------------------------------------------------------cNtxKey() Returns the index expression of a NTX index file--------------------------------------------------------------------------------
Syntax: cNtxKey( <cNtxFileName> ) --> <cIndexKey>
This function opens a NTX file and retrieves theascii description of the index key used.
Parameters:
<cNtxFileName> The name of the NTX file.
Returns:
<cIndexKey> A string with the key description.
Source code: SOURCE\\FUNCTION\\NtxTools.c
--------------------------------------------------------------------------------CreateDC() Creates a device context for the given device--------------------------------------------------------------------------------
<cDevice> Name of the specific device to be supported( i.e. "Epson FX-80" )
<cOutPut> MsDos filename or device name of the physicaloutput medium (file or output port)
<cInitData> Additional information specific of that device.
Returns:
<hDC> The handle of the device context just created.
Observations: hDCs created with CreateDC() must be released withDeleteDC(), and hDCs created with GetDC() must bereleased with ReleaseDC().
Source code: SOURCE\\WINAPI\\DC.c
See also: DeleteDC()
--------------------------------------------------------------------------------CreateDlg() Creates a modeless DialogBox from resources--------------------------------------------------------------------------------
This function creates a Modeless DialogBox fromresources, giving the name of the resource.
All these functions are used automatically fromthe FiveWin classes. Use the TDialog Class as itis much more powerful and easy to use.
Parameters:
<hInstance> Identifies an instance of the module whose executablefile contains the dialog box template. FiveWin suppliesa GetResources() function that returns the Instanceof the EXE or the handle of the resources DLL in use.
<cTemplateName> The name given to the DialogBox template in theresources.
<hWndOwner> The handle of the window which is the owner of theDialogBox. By default it is GetActiveWindow().
Returns:
<hDlg> The handle ( like hWnd ) of the Dialog Box.
Source code: Not provided. See SOURCE\\WINAPI\\DlogBox.c
See also: CreateDlgIndirect() DialogBox() DialogBoxIndirect()
--------------------------------------------------------------------------------CreateDlgIndirect() Creates a modeless DialogBox from memory resources--------------------------------------------------------------------------------
This function creates a modeless dialog box froma dialog box template in memory.
This function is used when a modeless dialog box iscreated from source code.
Use FiveWin classes instead of managing these functionsdirectly. Classes give you much more power and theyare much easier to use.
Parameters:
<hInstance> Identifies an instance of the module that willcreate the Dialog Box.
<cMemTemplate> A string that contains the binary descriptionof the Dialog Box template.
<hWndOwner> The handle of the window which is the owner of theDialogBox. By default it is GetActiveWindow().
Returns:
<hDlg> The handle ( like hWnd ) of the Dialog Box.
Source code: Not provided. See SOURCE\\WINAPI\\DlogBox.c
See also: CreateDlg() DialogBox() DialogBoxIndirect()
--------------------------------------------------------------------------------CreateFont() Creates a logical font with specific characteristics--------------------------------------------------------------------------------
<hFont> The handle of the new created font. 0 if itas not possible to create it.
Source code: SOURCE\\WINAPI\\FontCrea.c
See also: ChooseFont()
--------------------------------------------------------------------------------CreateHatch() Creates a brush with the specified hatched pattern--------------------------------------------------------------------------------
This function creates a brush that has the specifiedhatched pattern and color. The brush can be subsequentlybe selected as the current brush for any device.
Parameters:
<nStyle> nStyle specifies the hatch style of the brush. Thisparameter can be one of the following values:
Value Meaning
HS_BDIAGONAL 45-degree upward hatch (left to right)HS_CROSS Horizontal and vertical crosshatchHS_DIAGCROSS 45-degree crosshatchHS_FDIAGONAL 45-degree downward hatch (left to right)HS_HORIZONTAL Horizontal hatchHS_VERTICAL Vertical hatch
<nRGBColor> specifies the foreground color of the brush (the colorof the hatches).
Returns:
<hBrush> The return value is the handle of the brush if thefunction is successful. Otherwise, it is NULL.
Observations: When an application has finished using the brushcreated by the CreateHatchBrush function, it shouldselect the brush out of the device context and thendelete it by using the DeleteObject function.
Source code: Not provided.
See also: CreatePatternBrush()
--------------------------------------------------------------------------------CreatePattern() Creates a brush with the specified pattern bitmap--------------------------------------------------------------------------------
Syntax: CreatePattern( <hBitmap> ) --> <hBrush>
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
This function creates a brush whose pattern isspecified by a bitmap. The brush can be subsequentlybe selected for any device that support rasteroperations.
Parameters:
<hBitmap> Identifies the bitmap.
Returns:
<hBrush> The handle of the brush. It returns 0 if it wasnot possible to create it.
Source code: SOURCE\\WINAPI\\CreatePa.c
See also: CreateHatchBrush()
--------------------------------------------------------------------------------CreatePen() Creates a pen with the specified style, width & color--------------------------------------------------------------------------------
This function creates a pen having the specifiedstyle, width and color. The pen can be subsequentlybe selected as the current pen for any device.
Parameters:
<nStyle> Specifies the pen style. This parameter can be oneof the following values:
PS_SOLID Creates a solid pen.PS_DASH Creates a dashed pen. (Valid only when the
pen width is 1.)PS_DOT Creates a dotted pen. (Valid only when the
pen width is 1.)PS_DASHDOT Creates a pen with alternating dashes and
dots. (Valid only when the pen width is 1.)PS_DASHDOTDOT Creates a pen with alternating dashes
and double dots. (Valid only when the penwidth is 1.)
PS_NULL Creates a null pen.PS_INSIDEFRAME Creates a pen that draws a line inside
the frame of closed shapes produced bygraphics device interface (GDI) outputfunctions that specify a bounding rectangle(for example, the Ellipse, Rectangle,RoundRect, Pie, and Chord functions). Whenthis style is used with GDI output functionsthat do not specify a bounding rectangle(for example, the LineTo function), thedrawing area of the pen is not limited by aframe.
<nWidth> Specifies the width, in logical units, of the pen. Ifthis value is zero, the width in device units isalways one pixel, regardless of the mapping mode.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<hPen> The handle of the brush or 0 if it was not possibleto create it.
Sample: SAMPLES\\TestRpt5.prg
Source code: SOURCE\\WINAPI\\CreatePe.c
See also: See TPen Class and Pen xBase commands.
--------------------------------------------------------------------------------CreateSolidBrush() Creates a brush that has a specified solid color--------------------------------------------------------------------------------
This function creates a brush that has the specifiedcolor in nRGBColor. The brush can be subsequently beselected as the current brush for any device.
This functions are automatically called from FiveWinTBrush class. Use the class as it is much moreeasy to use.
Parameters:
<nRGBColor> Specifies a RGB color.
Returns:
<hBrush> The handle of the brush or 0 if it not was possibleto create it.
Source code: SOURCE\\WINAPI\\CreateSo.c
See also: Class TBrush and Brushes xBase commands.
--------------------------------------------------------------------------------CreateWindow() Creates an overlapped, pop-up or child window--------------------------------------------------------------------------------
<nStyle> Specifies the style of the window being created.
<nLeft>, <nTop> The coordinates and dimensions of the window.<nWidth>, <nHeight>
<hWndOwner> The handle of the window owner (if any) of the newwindow.
<hMenu> The handle of its PullDown menu.
<cExtraData> Some extra data sometimes required.
Returns:
<hWnd> The handle of the just created window.
Sample: See SOURCE\\CLASSES\\Window.prg for a sample ofhow FiveWin uses this function.
Source code: SOURCE\\WINAPI\\CreateWn.c
See also: TWindow Class and Window creation xBase commands
--------------------------------------------------------------------------------CursorArrow() Select the Windows default arrow cursor--------------------------------------------------------------------------------
Syntax: CursorArrow() --> nil
This function changes the mouse cursor to thetraditional arrow in window.
Parameters: None.
Returns: Nothing.
Sample: SAMPLES\\TestCurs.prg
Source code: SOURCE\\WINAPI\\Cursors.c
See also: CursorWait() CursorHand() CursorCatch() CursorWE()CursorIbeam() CursorSize()
--------------------------------------------------------------------------------CursorCatch() Selects the FiveWin hand catching cursor--------------------------------------------------------------------------------
Syntax: CursorCatch() --> nil
This function changes the mouse cursor into ahand in a catching position.
Parameters: None.
Returns: Nothing.
Observations: These functions let us change the mouse cursor just
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
temporarily while we are doing other tasks. Assoon as the API takes the control it will restorethe mouse cursor to the one associated to the windowwhich is below the cursor.
Sample: SAMPLES\\TestCurs.prg
Source code: SOURCE\\WINAPI\\Cursors.c
See also: CursorWait() CursorHand() CursorArrow() CursorWE()CursorIbeam() CursorSize()
--------------------------------------------------------------------------------CursorHand() Selects the FiveWin hand cursor--------------------------------------------------------------------------------
Syntax: CursorHand() --> nil
This function changes the mouse cursor into ahand in a pointing position.
Parameters: None.
Returns: Nothing.
Observations: These functions let us change the mouse cursor justtemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich is below the cursor.
Sample: SAMPLES\\TestCurs.prg
Source code: SOURCE\\WINAPI\\Cursors.c
See also: CursorWait() CursorCatch() CursorArrow() CursorWE()CursorIbeam() CursorSize()
--------------------------------------------------------------------------------CursorIbeam() Selects the Windows default IBeam cursor--------------------------------------------------------------------------------
Syntax: CursorIbeam() --> nil
This function changes the mouse cursor into ahand in an 'ibeam' shape. (the one that we seewhen the mouse goes over a GET).
Parameters: None.
Returns: Nothing.
Observations: These functions let us change the mouse cursortemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich is below the cursor.
Sample: SAMPLES\\TestCurs.prg
Source code: SOURCE\\WINAPI\\Cursors.c
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
See also: CursorWait() CursorCatch() CursorArrow() CursorWE()CursorHand() CursorSize()
--------------------------------------------------------------------------------CursorSize() Selects the Windows default Size cursor--------------------------------------------------------------------------------
Syntax: CursorSize() --> nil
This function changes the mouse cursor into ahand in a 'resize' shape. (the one that we seewhen the mouse resizes a window).
Parameters: None.
Returns: Nothing.
Observations: These functions let us change the mouse cursortemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich is below the cursor.
Sample: SAMPLES\\TestCurs.prg
Source code: SOURCE\\WINAPI\\Cursors.c
See also: CursorWait() CursorCatch() CursorArrow() CursorWE()CursorHand() CursorIbeam()
--------------------------------------------------------------------------------CursorWait() Selects the Windows default wait cursor--------------------------------------------------------------------------------
Syntax: CursorWait() --> nil
This function changes the mouse cursor into awaiting sand-clock (the one that we seewhen windows is processing).
Parameters: None.
Returns: Nothing.
Observations: These functions let us change the mouse cursortemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich is below the cursor.
Sample: SAMPLES\\TestCurs.prg
Source code: SOURCE\\WINAPI\\Cursors.c
See also: CursorSize() CursorCatch() CursorArrow() CursorWE()CursorHand() CursorIbeam()
CursorWE() Selects the Windows default WE cursor--------------------------------------------------------------------------------
Syntax: CursorWE() --> nil
This function changes the mouse cursor into ahorizontal arrow (the one that we seewhen windows is resizing horizontally).
Parameters: None.
Returns: Nothing.
Observations: These functions let us change the mouse cursortemporarily while we are doing other tasks. Assoon as the API takes control it will restorethe mouse cursor to the one associated with the windowwhich is below the cursor.
Sample: SAMPLES\\TestCurs.prg
Source code: SOURCE\\WINAPI\\Cursors.c
See also: CursorSize() CursorCatch() CursorArrow() CursorWait()CursorHand() CursorIbeam()
--------------------------------------------------------------------------------cValToChar() Converts any value into a string--------------------------------------------------------------------------------
Syntax: cValToChar( <uValue> ) --> <cValue>
This function converts a value of any type intoits equivalent character expression.
This function is coded in C language and it isextremely fast.
Parameters:
<uValue> It may be any value except an array or an Object.
Returns:
<cValue> A string with the character expression of<uValue>
See also: DDeCommand() DdeGetCommand() DdeTerminate()
--------------------------------------------------------------------------------Decrypt() Decrypts a string with an optional key--------------------------------------------------------------------------------
--------------------------------------------------------------------------------DelDbfMdx() Resets the MDX file existence at a DBFMDX Dbf file--------------------------------------------------------------------------------
<cDbfFileName> The name of the DBF file to reset its MDX flag.
Returns:
<lSuccess> A logical value indicating if the operationwas successful.
Observations: This function has been created to be able toreindex from scratch a MDX file (as a MDX indexwould never be reindexed as it gets corrupted!).
The steps to follow are:
1. Close the DBF file.2. Erase the MDX file.3. Call DelDbfMdx( <cDbfFileName> )4. Open the DBF file in anormal way.5. Index it.
Source code: SOURCE\\FUNCTION\\NtxTools.c
See also: cNtxPos() cNtxKey()
--------------------------------------------------------------------------------DeleteDC() Deletes the given device context--------------------------------------------------------------------------------
Syntax: DeleteDC( <hDC> ) --> <lSuccess>
This function destroys the given device context.
Parameters:
<hDC> The handle of the device context
Returns:
<lSuccess> A logical value indicating if the operationwas successful.
Observations: This function must only be used to destroy devicecontexts created with CreateDC() and never withGetDC().
Source code: SOURCE\\WINAPI\\dc.c
See also: CreateDC() GetDC() ReleaseDC()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------DeleteObject() Deletes an object from memory freeing all resources--------------------------------------------------------------------------------
This function deletes a GDI object from memory,freeing all system storage associated (objectsinclude pens, brushes, fonts, bitmaps, regions,and palettes).
Parameters:
<hGDIObject> The handle of the GDI object, obtained withits corresponding creating function.
Returns:
<lSuccess> A logical value indicating if the operation wassuccessful.
Observations: FiveWin internally implements a resources controlsystem in order to avoid and control the problemsrelated with system resources losing.
Source code: SOURCE\\WINAPI\\delobjec.c
See also: SelectObject()
--------------------------------------------------------------------------------DestroyCursor() Destroys a cursor created with Create... or Load...--------------------------------------------------------------------------------
Syntax: DestroyCursor( <hCursor> ) --> <lSuccess>
This function destroys a cursor that was previouslycreated by the CreateCursor() or LoadCursor() functionand frees any memory that the cursor occupied.
Parameters:
<hCursor> Identifies the cursor to be destroyed. The cursormust not be in current use.
Returns:
<lSuccess> A logical value indicating if the operation wassuccessful.
Source code: SOURCE\\WINAPI\\Cursors.c
See also: CreateCursor() LoadCursor()
--------------------------------------------------------------------------------DestroyWindow() Destroys the specified window--------------------------------------------------------------------------------
Syntax: DestroyWindow( <hWnd> ) --> <lSuccess>
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
The DestroyWindow function destroys the specifiedwindow. The function sends appropriate messages to thewindow to deactivate it and remove the input focus. Italso destroys the window's menu, flushes theapplication queue, destroys outstanding timers,removes clipboard ownership, and breaks theclipboard-viewer chain (if the window is at the top ofthe viewer chain).
It sends WM_DESTROY and WM_NCDESTROY messages to thewindow. If the given window is the parent of anywindows, DestroyWindow automatically destroys thesechild windows when it destroys the parent window. Thefunction destroys child windows first, and then thewindow itself.
The DestroyWindow function also destroys modelessdialog boxes created by the CreateDialog function.
FiveWin manages all these functions through Classes.Use FiveWin Classes as they are much easier to use andmore powerful.
Parameters:
<hWnd> The handle of the window to be destroyed.
Returns:
<lSuccess> A logical value indicating if the operation wassuccessful.
Source code: SOURCE\\WINAPI\\WndDestr.c
See also: CreateWindow()
--------------------------------------------------------------------------------DialogBox() Creates a modal dialog box from resources--------------------------------------------------------------------------------
This function creates and executes a Modal DialogBoxfrom a Dialog Box template resource.
Parameters:
<hInstance> Identifies an instance of the module whose executablefile contains the dialog box template. FiveWin suppliesa GetResources() function that returns the Instanceof the EXE or the handle of the resources DLL in use.
<cTemplateName> The name given to the DialogBox template in theresources.
<hWndOwner> The handle of the window which is the owner of theDialogBox. By default it is GetActiveWindow().
Returns:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nResult> The parameter supplied to the functionEndDialog() used to terminate the execution of theDialog Box.
Observations: Use FiveWin Classes and xBase commands. They aremuch more powerful and easy to manage.
Source code: Not provided. See SOURCE\\WINAPI\\Dlogbox.c
See also: EndDialog() CreateDlg() CreateDlgI()DialogBoxIndirect()
--------------------------------------------------------------------------------DialogBoxIndirect() Creates a modal dialog box from memory resources--------------------------------------------------------------------------------
This function creates and executes a Modal DialogBoxfrom a Dialog Box template resource.
Parameters:
<hInstance> Identifies an instance of the module whose executablefile contains the dialog box template. FiveWin suppliesa GetResources() function that returns the Instanceof the EXE or the handle of the resources DLL in use.
<cMemTemplate> A string that contains the binary descriptionof the Dialog Box template.
<hWndOwner> The handle of the window which is the owner of theDialogBox. By default it is GetActiveWindow().
Returns:
<nResult> The parameter supplied to the functionEndDialog() used to terminate the execution of theDialog Box.
Observations: Use FiveWin Classes and xBase commands. They aremuch more powerful and easy to manage.
Source code: Not provided. See SOURCE\\WINAPI\\Dlogbox.c
See also: EndDialog() CreateDlg() CreateDlgI()DialogBox()
<hPalette> The handle of the palette associated to theDIB.
<nRow>, <nCol> The coordinates in pixels where start drawing.
<nWidth>, <nHeight> The dimensions for drawing the DIB.
Returns:
<lSuccess> A logical value indicating if the operation wassuccessful.
Observations: When we started building FiveWin we first startedworking with bitmaps. Later we discovered that thegeneral recommendation was to work with DIBs. Sowe developed all the necessary functions to workwith DIBs. As our own experience increased, we believethat there is a better way (a mixture of both) that wasmuch faster and easier.
We did a lot of different tests, and our systemwas by far the fastest. It was a reason based onspeed and ease of use, because we wanted FiveWin tobe extremely fast! <g>
This later system is the one we currently use inFiveWin, though we do give support for both Bitmapsand DIBs.
You don't have to worry at all, just use FiveWinTBitmap Class and place yourself at thexBase & OOP level to get the maximum productivity.
Concentrate on your application, don't lose yourselfin details!
Source code: SOURCE\\WINAPI\\Dib.c
See also: DibRead() DibPalette() DibWidth() DibHeight()DibWrite()
--------------------------------------------------------------------------------DibFromBitmap() Creates a DIB from a bitmap--------------------------------------------------------------------------------
<hPalette> The handle of the palette associated tothe bitmap.
Returns:
<hDIB> The handle of the new DIB. (DIB = Deviceindependent bitmap).
Observations: We strongly recommend you to use TBitmap Classfor managing bitmaps. FiveWin process all thatyou need automatically.
Source code: Not provided. See SOURCE\\WINAPI\\Dib.c
See also: DibRead() DibPalette() DibWidth() DibHeight()DibWrite()
--------------------------------------------------------------------------------DibHeight() Returns the height of a DIB--------------------------------------------------------------------------------
Syntax: DibHeight( <hDib> ) --> <nHeight>
This function returns the height in pixels of aDIB.
Parameters:
<hDIB> The handle of the new DIB. (DIB = Deviceindependent bitmap).
Returns:
<nHeight> The height of the DIB expressed in pixels.
Observations: We strongly recommend you to use TBitmap Classfor managing bitmaps. FiveWin process all thatyou need automatically.
Source code: SOURCE\\WINAPI\\Dib.c
See also: DibRead() DibPalette() DibWidth() DibHeight()DibWrite()
--------------------------------------------------------------------------------DibPalette() Returns the palette handle of a DIB--------------------------------------------------------------------------------
Syntax: DibPalette( <hDIB> ) --> <hPalette>
This function retrieves the handle of the paletteassociated to the DIB.
Parameters:
<hDIB> The handle of the new DIB. (DIB = Deviceindependent bitmap).
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<hPalette> The handle of the palette associated withthe bitmap.
Observations: We strongly recommend you to use TBitmap Classfor managing bitmaps. FiveWin process all thatyou need automatically.
Source code: SOURCE\\WINAPI\\Dib.c
See also: DibRead() DibPalette() DibWidth() DibHeight()DibWrite()
--------------------------------------------------------------------------------DibRead() Reads a DIB from disk--------------------------------------------------------------------------------
Syntax: DibRead( <cBitmapFile> ) --> <hDIB>
This function generates a DIB in memory readingit from a file .BMP in disk.
Parameters:
<cBitmapFile> The filename of the BMP file in disk.
Returns:
<hDIB> The handle of the new DIB. (DIB = Deviceindependent bitmap).
Observations: We strongly recommend you to use TBitmap Classfor managing bitmaps. FiveWin process all thatyou need automatically.
Source code: SOURCE\\WINAPI\\Dib.c
See also: DibRead() DibPalette() DibWidth() DibHeight()DibWrite()
--------------------------------------------------------------------------------DibWidth() Returns the width of a DIB--------------------------------------------------------------------------------
Syntax: DibWidth( <hDib> ) --> <nWidth>
This function returns the width in pixels of a DIB.
Parameters:
<hDIB> The handle of the new DIB. (DIB = Deviceindependent bitmap).
Returns:
<nWidth> The width of the DIB expressed in pixels.
Observations: We strongly recommend you to use TBitmap Class
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
for managing bitmaps. FiveWin process all thatyou need automatically.
Source code: SOURCE\\WINAPI\\Dib.c
See also: DibRead() DibPalette() DibWidth() DibHeight()DibWrite()
--------------------------------------------------------------------------------DibWrite() Saves a DIB to disk--------------------------------------------------------------------------------
This function draws a bitmap (16 colors or 256colors without palette control) onto the specifieddevice context.
Parameters:
<hDC> The handle of the device context.
<hBitmap> The handle of the bitmap.
<nRow>, <nCol> The coordinates where to draw.<nWidth>, <nHeight> The dimensions to adjust the bitmap.
<nRaster> A raster operation style, as follows:
BLACKNESS Turns all output black.DSTINVERT Inverts the destination bitmap.MERGECOPY Combines the pattern and the source
bitmap by using the Boolean ANDoperator.
MERGEPAINT Combines the inverted source bitmapwith the destination bitmap by usingthe Boolean OR operator.
NOTSRCCOPY Copies the inverted source bitmap tothe destination.
NOTSRCERASE Inverts the result of combining thedestination and source bitmaps byusing the Boolean OR operator.
PATCOPY Copies the pattern to the destinationbitmap.
PATINVERT Combines the destination bitmap withthe pattern by using the Boolean XORoperator.
PATPAINT Combines the inverted source bitmapwith the pattern by using the BooleanOR operator. Combines the result ofthis operation with the destinationbitmap by using the Boolean OR operator.
SRCAND Combines pixels of the destination andsource bitmaps by using the BooleanAND operator.
SRCCOPY Copies the source bitmap to thedestination bitmap.
SRCERASE Inverts the destination bitmap andcombines the result with the sourcebitmap by using the Boolean ANDoperator.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
SRCINVERT Combines pixels of the destination andsource bitmaps by using the BooleanXOR operator.
SRCPAINT Combines pixels of the destination andsource bitmaps by using the Boolean ORoperator.
WHITENESS Turns all output white.
Returns: Nothing
Observations: We strongly recommend use of the FiveWin TBitmap Class,as it is much easier to use and more powerful.
Sample: SAMPLES\\Install.prg
Source code: SOURCE\\WINAPI\\BmpDraw.c
See also:
--------------------------------------------------------------------------------DrawIcon() Draws an Icon--------------------------------------------------------------------------------
This function draws an icon at the specified devicecontext.
Parameters:
<hDC> The handle of the device context where to draw.
<nRow>, <nCol> The coordinates where to paint.
<hIcon> The handle of the icon.
Returns:
<lSuccess> A logical value that it is true if the operationwas successful.
Observations: The handle of the icon must be loaded with LoadIcon()
We strongly recommend use of FiveWin TIcon Classas it is much more powerful and easy to use.
Source code: SOURCE\\WINAPI\\Icons.c
See also: LoadIcon() ExtractIcon() nIcons()
--------------------------------------------------------------------------------DrawText() Draws formatted text into a given rectangle--------------------------------------------------------------------------------
rectangle. It formats text by expanding tabs intoappropriate spaces, aligning text to the left, right,or center of the rectangle, and breaking text intolines that fit within the rectangle.
The DrawText function uses the device context'sselected font, text color, and background color to drawthe text. Unless the DT_NOCLIP format is specified,DrawText clips the text so that the text does notappear outside the given rectangle. All formatting isassumed to have multiple lines unless theDT_SINGLELINE format is specified.
Parameters:
<hDC> The handle of the device context whereto paint.
<cText> The string to draw.
<aRect> A Clipper array of four elements:
{ nTop, nLeft, nBottom, nRight }
<nStyle> The style to use for drawing the text:
DT_BOTTOM Specifies bottom-aligned text. Thisvalue must be combined with DT_SINGLELINE.
DT_CALCRECT Determines the width and height of therectangle. If there are multiple lines oftext, DrawText will use the width of therectangle pointed by aRect and extend thebase of the rectangle to bound the lastline of text. If there is only one line oftext, DrawText will modify the right sideof the rectangle so that it bounds thelast character in the line. In either case,DrawText returns the height of theformatted text but does not draw the text.
DT_CENTER Centers text horizontally.DT_EXPANDTABS Expands tab characters. The default
number of characters per tab is eight.
DT_EXTERNALLEADING Includes the font external leadingin line height. Normally, external leadingis not included in the height of a line oftext.
DT_LEFT Left-aligns text.DT_NOCLIP Draws without clipping. DrawText is
somewhat faster when DT_NOCLIP is used.DT_NOPREFIX Turns off processing of prefix characters.
Normally, DrawText interprets the mnemonic& as a directive to underscore thecharacter that follows, and the mnemonic&& as a directive to print a single &. Byspecifying DT_NOPREFIX, this processing isturned off.
DT_RIGHT Right-aligns text.DT_SINGLELINE Specifies single line only. Carriage
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
DT_TABSTOP Sets tab stops. The high-order byte ofthe fuFormat parameter is the number ofcharacters for each tab. The default numberof characters per tab is eight.
DT_TOP Specifies top-aligned text (single lineonly).
DT_VCENTER Specifies vertically centered text (singleline only).
DT_WORDBREAK Specifies word breaking. Lines areautomatically broken between words if aword would extend past the edge of therectangle specified by aRect parameter.A carriage return/line-feed sequence willalso break the line.
Note that the DT_CALCRECT, DT_EXTERNALLEADING,DT_INTERNAL, DT_NOCLIP, and DT_NOPREFIXvalues cannot be used with the DT_TABSTOPvalue.
<nTextHeight> Specifies the height of the text if the functionis successful.
Source code: SOURCE\\WINAPI\\Text.c
See also: TextOut() ExtTextOut()
--------------------------------------------------------------------------------Ellipse() Draws an ellipse--------------------------------------------------------------------------------
This function draws an ellipse inside the specifiedrectangle coordinates. It uses the currently selectedpen and brush in the device context of the paint area.
Parameters:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nLeft>, <nTop> Are the coordinates of the bounding rectangle of the<nRight>, <nBottom> ellipse.
Returns:
<lSuccess> A logical value true if the operation was successful.
Source code: SOURCE\\WINAPI\\Ellipse.c
See also: Chord() DrawFocusRect() Pie() Polygon() PolyPoligon()Rectangle() RoundRect()
--------------------------------------------------------------------------------EmptyClipboard() Empties the clipboard--------------------------------------------------------------------------------
Syntax: EmptyClipboard() --> <lSuccess>
This function empties the clipboard and freesdata handles in the clipboard. It then assignsownership of the clipboard to the window thatcurrently has the clipboard open.
Parameters: None.
Returns:
<lSuccess> A logical value true if the operation wassuccessful.
Observations: The clipboard must be open when this functionis called.
Source code: SOURCE\\WINAPI\\ClpBrd.c
See also: OpenClipboard() SetClipboard() EmptyClipboard()GetClpData()
--------------------------------------------------------------------------------EnableWindow() Enables or disables mouse and keyboard activity--------------------------------------------------------------------------------
This function enables or disables mouse andkeyboard input to the given function or control.When input is disabled, the window ignores inputsuch as mouse clicks and key presses. When inputis enabled, the window processes all input.
Parameters:
<hWnd> The handle of the window or control.In FiveWin: oWnd:hWnd.
<lEnable> A logical value indicating if perform an enable ordisable operation.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<lSuccess> A logical value true if the operation wassuccessful.
Source code:
See also: TWindow:Enable() TWindow:Disable() IsWindowEnabled()
--------------------------------------------------------------------------------Encrypt() Encrypts a string with an optional key--------------------------------------------------------------------------------
<cKey> It is an optional text key to use itto generate a personalized encrypted text.
Returns:
<cEncryptedText> The resulted encrypted text.
Source code: Not provided.
See also: Decrypt()
--------------------------------------------------------------------------------EndDialog() Finish a modal DialogBox--------------------------------------------------------------------------------
Syntax: EndDialog( <hWndDlg>, <nResult> ) --> nil
This function hides a modal DialogBox and causesthe DialogBox function to return.
Parameters:
<hWndDlg> The handle of the DialogBox to end.
<nResult> nResult is a numeric value that will be returnedby DialogBox() or DialogBoxIndirect() functions.
Returns: Nothing.
Source code: Not provided. See SOURCE\\WINAPI\\DlogBox.c
See also: DialogBox() DialogBoxIndirect()
--------------------------------------------------------------------------------EndPage() Ends printing a page--------------------------------------------------------------------------------
Syntax: EndPage( <hDC> ) --> <nReturnCode>
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
This function signals the device context that theapplication has finished writing to a page. Normallywe use this function to start working on a new page.
Parameters:
<hDC> The handle of the device context.
Returns:
<nReturnCode> The result of the operation.
SP_ERROR General error.SP_APPABORT Job was terminated because the
SP_USERABORT User terminated the job by usingWindows Print Manager (PRINTMAN.EXE).
SP_OUTOFDISK Not enough disk space is currentlyavailable for spooling, and no morespace will become available.
SP_OUTOFMEMORY Not enough memory is available forspooling.
Source code: SOURCE\\WINAPI\\PrintDc.c
See also: StartPage()
--------------------------------------------------------------------------------EndPaint() Ends painting a window--------------------------------------------------------------------------------
Syntax: EndPaint( <hWnd>, <cPS> ) --> nil
This function marks the end of painting for thegiven window. This function is required foreach BeginPaint() but only after painting iscomplete.
Parameters:
<hWnd> The handle of the window that is beingcurrently painted.
<cPS> A string that hold relevant informationabout the painting process. (it holds aPAINTSTRUCT structure).
Returns: Nothing.
Source code: SOURCE\\WINAPI\\Paint.c
See also: BeginPaint()
--------------------------------------------------------------------------------ExitWindowsExec() Exit Windows, runs a MsDos program, and restart windows--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cExeName> Identifies the MsDos EXE to execute. For batchfiles, it is the path of the command.com.
<cParams> Identifies the parameters to supply to theMsDos app. For a batch file you have toinclude '/c':
"/c batfile.bat"Returns:
<lSuccess> A logical value indicating that the operationwas completed successfully.
Source code: SOURCE\\WINAPI\\WinExec.c
--------------------------------------------------------------------------------ExtractIcon() Retrieves an icon handle from EXE, DLL or ICO--------------------------------------------------------------------------------
This function retrieves the handle of an icon froma specified executable file, dynamic-link library(DLL) or icon file.
Parameters:
<cExeName> The name of the EXE, DLL or ICO file.
<nIndex> Specifies the index of the icon to be retrieved,from the total number of icons inside the module.If 0 is specified the first icon is returned.If -1 is specified the total number of icons isreturned.
Returns:
<hIcon> The handle of the icon. It is 0 if theoperation was not successful.
Sample: See IDE\\SOURCE\\Icons.prg
Source code: SOURCE\\WINAPI\\Icons.c
See also: LoadIcon() DrawIcon() nIcons()
--------------------------------------------------------------------------------ExtTextOut() Writes a character string into a rectangular region--------------------------------------------------------------------------------
rectangular region, using the currently selectedfont.
Parameters:
<hDC> The handle of the device context.
<nRow>, <nCol> The coordinates where to paint inside the rectspecified in aRect.
<aRect> A 4 elements Clipper array, representing a rect:
nTop, nLeft, nBottom, nRight
<cText> The text to draw.
Returns:
<lSuccess> A logical value indicating if the operation wassuccessful.
Source code: SOURCE\\WINAPI\\Text.c
See also: TextOut() DrawText()
--------------------------------------------------------------------------------FillRect() Fills a given rectangle with a specified brush--------------------------------------------------------------------------------
This function fills a rect with the specified brush.
Parameters:
<hDC> The handle of the device context.
<aRect> A 4 element Clipper array, representing a rect:
nTop, nLeft, nBottom, nRight
<hBrush> The handle of a brush.
Returns: Nothing.
Source code: SOURCE\\WINAPI\\Rects.c
See also: GetClientRect() GetWndRect() InvertRect()
--------------------------------------------------------------------------------FloodFill() Fills an area of the screen--------------------------------------------------------------------------------
<lSuccess> A logical value indicating if the operationwas performed successfully.
Source code: SOURCE\\WINAPI\\Drawing.c
--------------------------------------------------------------------------------FlushComm() Flushes all characters from transmision or receiving--------------------------------------------------------------------------------
This function flushes all characters from thetransmision or receiving queue of the specifiedcommunications device.
Parameters:
<nIdComDev> Identifies the communication device to be flushed.The OpenComm function returns this value.
<nQueue> Specifies the queue to be flushed. If this parameteris zero, the transmision queue is flushed. If theparameter is 1, the receiving queue is flushed.
Returns:
<nReturn> The return value is zero if the function is sucessfull.It is less than zero if nIdComDev is not a validdevice or if nQueue is not a valid device. Thereturn value is positive if there is an error for thespecified device. For a list of the possible errorvalues, see the GetCommError function.
Sample: SAMPLES\\TestComm.prg
Source code: SOURCE\\WINAPI\\Comm.c
See also: GetCommError() OpenComm()
--------------------------------------------------------------------------------FreeLibrary() Free a DLL library in use or decrements its counter use--------------------------------------------------------------------------------
Syntax: FreeLibrary( <hInstance> ) --> nil
This function decreases by one the reference countof the loaded library module. When the reference countreaches zero, the memory occupied by the module isfreed.
Parameters:
<hInstance> The handle of the DLL. It is the valuereturned by LoadLibrary().
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------FWBitmap() Creates the FiveWin own icon-alike bitmap--------------------------------------------------------------------------------
Syntax: FWBitmap( <hDC> ) --> <hBitmap>
This an internal function of FiveWin that returnsa handle of a FiveWin logo built from memory. Itis used in the FiveWin error Dialog Box.
Parameters:
<hDC> The handle of the device context.
Returns:
<hBitmap> The handle of the just created bitmap.
Observations: This handle is automatically destroyed by FiveWin.
Source code: Not provided.
--------------------------------------------------------------------------------FWBrushes() Creates any of the predefined FiveWin bitmaps--------------------------------------------------------------------------------
Syntax: FWBrushes( <nBrushId> ) --> <hBitmap>
This is a FiveWin internal function that createsa bitmap to build the FiveWin extended style brushes.
Parameters:
<nBrushId> A numeric identifier to select the predefinedtype of brush.
Returns:
<hBitmap> The handle of the just created bitmap. FiveWinuses it to build the brush. The destruction of thisbitmap is done automatically.
Source code: Not provided.
See also: FWBitmap()
--------------------------------------------------------------------------------__GenGPF() Generates a GPF for testing purpouses--------------------------------------------------------------------------------
Syntax: __GenGPF() --> nil
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Comments: This function generates a GPF and breaksthe application. Don't use it! It is only providedin order to try the new FiveWin user definedGPFs controller.
Sample: SAMPLES\\TestTool.prg
Source code: SOURCE\\WINAPI\\ToolHelp.c
See also: InterruptRegister() InterruptUnRegister()
--------------------------------------------------------------------------------GetActiveWindow() Retrieves the window handle of the active window--------------------------------------------------------------------------------
Syntax: GetActiveWindow() --> <hWnd>
This function retrieves the window handle of theactive window.
Parameters: None
Returns:
<hWnd> The handle of the window, or null if there isno any windows active at that moment.
Source code: SOURCE\\WINAPI\\ActWnd.c
--------------------------------------------------------------------------------GetASyncKey() Determines whether a key is up or down--------------------------------------------------------------------------------
Syntax: GetASyncKey( <nKey> ) --> <lDown>
This function returns if a key is down or up.
Parameters:
<nKey> The code of one of the 256 vkeys. See VKey.ch.
Returns:
<lDown> True if the key is pressed.
Source code: SOURCE\\WINAPI\\KeyBrd.c
See also: GetKeyState()
--------------------------------------------------------------------------------GetCapture() Retrieves the window handle that has the mouse captured--------------------------------------------------------------------------------
Syntax: GetCapture() --> <hWnd>
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
This function returns the handle of the windowthat has captured the mouse.
Parameters: None.
Returns:
<hWnd> The handle of the window. In FiveWin: oWnd:hWnd.It is 0 if no window has the mouse captured.
Source code: SOURCE\\WINAPI\\WMouse.c
See also: SetCapture() ReleaseCapture()
--------------------------------------------------------------------------------GetCaretPos() Retrieves the current position of the caret--------------------------------------------------------------------------------
Syntax: GetCaretPos() --> <aPoint>
This function returns the position of the caret.
Parameters: None.
Returns:
<aPoint> A Clipper array with two numeric valuesrepresenting a POINT structure:
{ nRow, nCol }
Source code: SOURCE\\WINAPI\\GetCaret.c
See also: CreateCaret() DestroyCaret() ShowCaret()
--------------------------------------------------------------------------------GetClassName() Retrieves the class name of a window--------------------------------------------------------------------------------
Syntax: GetClassName( <hWnd> ) --> <cClassName>
This function retrieves the class name of a window.
Parameters:
<hWnd> The handle of the window whose classname( API classname not Clipper!) we want to know.
Returns:
<cClassName> The API classname registered for that kindof windows.
Source code: SOURCE\\WINAPI\\WndUpdat.c
See also: CreateWindow()
--------------------------------------------------------------------------------GetClientRect() Retrieves the client coordinates of a window--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
This function retrieves the dimensions of thewindow client area.
Parameters:
<hWnd> The handle of the window.
Returns:
<aRect> A Clipper array of 4 elements:
{ nTop, nLeft, nBottom, nRight }
Source code: SOURCE\\WINAPI\\Rects.c
See also: GetWndRect() FillRect() InvertRect() GetCoors()
--------------------------------------------------------------------------------GetClpData() Retrieves the handle of the current clipboard data--------------------------------------------------------------------------------
Syntax: GetClpData( <nFormat> ) --> <cData>
This function retrieves the containts of theClipBoard. FiveWin, right now, only supportstext manipulation through the Clipboard (thoughit is not a FiveWin limitation, just because wedid not have the time yet! <g>)
Parameters:
<nFormat> The type of data to be retrieved:
CF_BITMAP The data is a bitmap.CF_DIB The data is a memory object containing a
BITMAPINFO structure followed by thebitmap data.
CF_DIF The data is in Data Interchange Format(DIF).
CF_DSPBITMAP The data is a bitmap representation of aprivate format. This data is displayed inbitmap format in lieu of the privatelyformatted data.
CF_DSPMETAFILEPICT The data is a metafile representationof a private data format. This data isdisplayed in metafile-picture format inlieu of the privately formatted data.
CF_DSPTEXT The data is a textual representation of aprivate data format. This data is displayedin text format in lieu of the privatelyformatted data.
CF_METAFILEPICT The data is a metafile (see thedescription of the METAFILEPICT structure.
CF_OEMTEXT The data is an array of text charactersin the OEM character set. Each line endswith a carriage returnlinefeed (CR-LF)combination. A null character signals theend of the data.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
CF_OWNERDISPLAY The data is in a private format thatthe clipboard owner must display.
CF_PALETTE The data is a color palette.CF_PENDATA The data is for the pen extensions to the
Windows operating system.CF_RIFF The data is in Resource Interchange File
Format (RIFF).CF_SYLK The data is in Symbolic Link (SYLK) format.CF_TEXT The data is an array of text characters.
Eachline ends with a carriage returnlinefeed(CR-LF) combination. A null charactersignals the end of the data.
CF_TIFF The data is in Tag Image File Format (TIFF).
CF_WAVE The data describes a sound wave. This is asubset of the CF_RIFF data format; it canbe used only for RIFF WAVE files.
Returns:
<cData> The text placed at the clipboard.( it is pending to support the other formats,or private new formats ).
Source code: SOURCE\\WINAPI\\ClpBrd.c
See also: OpenClipboard() SetClpData() CloseClipboard()
--------------------------------------------------------------------------------GetCommError() Retrieves the most recent comm error value--------------------------------------------------------------------------------
This function retrieves the most recent error valueand current status for the specified device.
Parameters:
<nIdComDev> The communications device identifier createdwith the OpenComm() function.
<cComStat> A string that will receive the informationfor the comm status.
Returns:
<nRetCode> Indicates the last error value.
Sample: SAMPLES\\TestComm.prg
Source code: SOURCE\\WINAPI\\Comm.c
See also: OpenComm() BuildCommDev() CloseComm()
--------------------------------------------------------------------------------GetCoors() Returns an array with four coordinates values--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
This is a FiveWin function that retrieves theabsolute coordinates of a window or a control.
Parameters:
<hWnd> The handle of the window.
Returns:
<aCoors> A Clipper array of 4 elements:
{ nTop, nLeft, nBottom, nRight }
Sample: See IDE\\SOURCE for some working samples.
Source code: SOURCE\\WINAPI\\Rects.c
See also: GetClientRect() GetWndRect()
--------------------------------------------------------------------------------GetDC() Retrieves the handle of a device context--------------------------------------------------------------------------------
Syntax: GetDC( <hWnd> ) --> <hDC>
This function retrieves the handle of the devicecontext of the client area in the given window.
Parameters:
<hWnd> The handle of the window.
Returns:
<hDC> The handle of the device context.
Observations: You may think about a device context as a virtualscreen. Something similar when in MsDos we didDispBegin() and DispEnd() with Clipper.
GetDC() it is like DispBegin(). Starts workingwith a virtual screen. ReleaseDC() it is likeDispEnd(), and updates all painting to thevisible screen.
If you don't ReleaseDC() after you do a GetDC(),you are unbalancing windows, and the systemfinally crash!
Source code: SOURCE\\WINAPI\\DC.c
See also: ReleaseDC() CreateDC() DeleteDC()
--------------------------------------------------------------------------------GetDesktopWindow() Retrieves the handle of the desktop window--------------------------------------------------------------------------------
Syntax: GetDesktopWindow() --> <hWndDesktop>
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
HORZSIZE Width of the physical display, in millimeters.VERTSIZE Height of the physical display, in millimeters.HORZRES Width of the display, in pixels.VERTRES Height of the display, in raster lines.LOGPIXELSX Number of pixels per logical inch along the display width.LOGPIXELSY Number of pixels per logical inch along the display height.BITSPIXEL Number of adjacent color bits for each pixel.PLANES Number of color planes.NUMBRUSHES Number of device-specific brushes.NUMPENS Number of device-specific pens.NUMMARKERS Number of device-specific markers.
NUMFONTS Number of device-specific fonts.NUMCOLORS Number of entries in the device's color table.ASPECTX Relative width of a device pixel used for line drawing.ASPECTY Relative height of a device pixel used for line drawing.ASPECTXY Diagonal width of a device pixel used for line drawing.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
PDEVICESIZE Size of the PDEVICE internal structure, in bytes.CLIPCAPS Clipping capabilities the device supports. It can be one of
the following values:
Value Meaning
CP_NONE Output is not clipped.CP_RECTANGLE Output is clipped to rectangles.CP_REGION Output is clipped to regions.
SIZEPALETTE Number of entries in the system palette. This index is validonly if the device driver sets the RC_PALETTE bit in theRASTERCAPS index; it is available only if the driver iswritten for Windows 3.0 or later.
NUMRESERVED Number of reserved entries in the system palette. Thisindex is valid only if the device driver sets theRC_PALETTE bit in the RASTERCAPS index; it is availableonly if the driver is written for Windows 3.0 or later.
COLORRES Color resolution of the device, in bits per pixel. This indexis
valid only if the device driver sets the RC_PALETTE bit inthe RASTERCAPS index; it is available only if the driver iswritten for Windows 3.0 or later.
RASTERCAPS Raster capabilities the device supports. It can be acombination of the following values:
Value Meaning
RC_BANDING Supports banding.RC_BIGFONT Supports fonts larger than 64K.RC_BITBLT Transfers bitmaps.RC_BITMAP64 Supports bitmaps larger than 64K.RC_DEVBITS Supports device bitmaps.RC_DI_BITMAP Supports the SetDIBits and GetDIBits functions.RC_DIBTODEV Supports the SetDIBitsToDevice function.RC_FLOODFILL Performs flood fills.RC_GDI20_OUTPUT Supports Windows version 2.0 features.RC_GDI20_STATE Includes a state block in the device context.RC_NONE Supports no raster operations.
RC_OP_DX_OUTPUT Supports dev opaque and DX array.RC_PALETTE Specifies a palette-based device.RC_SAVEBITMAP Saves bitmaps locally.RC_SCALING Supports scaling.RC_STRETCHBLT Supports the StretchBlt function.RC_STRETCHDIB Supports the StretchDIBits function.
CURVECAPS Curve capabilities the device supports. It can be acombination of the following values:
POLYGONALCAPS Polygonal capabilities the device supports. It can be acombination of the following values:
Value Meaning
PC_NONE Supports no polygons.PC_POLYGON Supports alternate fill polygons.PC_RECTANGLE Supports rectangles.PC_WINDPOLYGON Supports winding number fill polygons.PC_SCANLINE Supports scan lines.PC_WIDE Supports wide borders.PC_STYLED Supports styled borders.PC_WIDESTYLED Supports wide, styled borders.PC_INTERIORS Supports interiors.
TEXTCAPS Text capabilities the device supports. It can be acombination of the following values:
Value Meaning
TC_OP_CHARACTER Supports character output precision, which indicates thedevice can place device fonts at any pixel location. This isrequired for any device with device fonts.
TC_OP_STROKE Supports stroke output precision, which indicates thedevice can omit any stroke ofa device font.
TC_CP_STROKE Supports stroke clip precision, which indicates the device canclip device fonts to a pixel boundary.
TC_CR_90 Supports 90-degree character rotation, which indicates thedevice can rotate characters only 90 degrees at a time.
TC_CR_ANY Supports character rotation at any degree, which indicatesthe device can rotate device fonts through any angle.
TC_SF_X_YINDEP Supports scaling independent of x and y directions, whichindicates the device can scale device fonts separately in xand y directions.
TC_SA_DOUBLE Supports doubled characters for scaling, which indicates thedevice can double the size of device fonts.
TC_SA_INTEGER Supports integer multiples for scaling, which indicates thedevice can scale the size of device fonts in any integermultiple.
TC_SA_CONTIN Supports any multiples for exact scaling, which indicatesthe device can scale device fonts by any amount but stillpreserve the x and y ratios.
TC_EA_DOUBLE Supports double-weight characters, which indicates thedevice can make device fonts bold. If this bit is not set for
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
printer drivers, graphics device interface (GDI) attempts tocreate bold device fonts by printing them twice.
TC_IA_ABLE Supports italics, which indicates the device can makedevice fonts italic. If this bit is not set, GDI assumesitalics are not available.
TC_UA_ABLE Supports underlining, which indicates the device canunderline device fonts. If this bit is not set, GDI createsunderlines for device fonts.
TC_SO_ABLE Supports strikeouts, which indicates the device canstrikeout device fonts. If this bit is not set, GDI createsstrikeouts for device fonts.
TC_RA_ABLE Supports raster fonts, which indicates that GDI shouldenumerate any raster or TrueType fonts available forthis device in response to a call to the EnumFonts orEnumFontFamilies function. If this bit is not set,GDI-supplied raster or TrueType fonts are not enumerated whenthese functions are called.
TC_VA_ABLE Supports vector fonts, which indicates that GDI shouldenumerate any vector fonts available for this device inresponse to a call to the EnumFonts or EnumFontFamiliesfunction. This is significant for vector devices only (thatis, for plotters). Display drivers (which must be able touse raster fonts) and raster printer drivers always enumeratevector fonts, because GDI rasterizes vector fonts beforesending them to the driver.
GetDialogBaseUnits() Returns the DialogBox base units used to create it--------------------------------------------------------------------------------
Syntax: GetDialogBaseUnits() --> <nBaseUnits>
This function returns the DialogBox base unitsused by Windows when creating DialogBoxes. Anapplication should use these values to calculatethe average width of characters in the system font.
Parameters: None
Returns:
<nBaseUnits> A long value ( 4 bytes ) containing the widthand the height in pixels used by Windows in theconversion of units for the DialogBoxes coordinates:( in Windows, DialogBoxes use logical units )
--------------------------------------------------------------------------------GetDlgItem() Retrieves the handle of a control--------------------------------------------------------------------------------
This function retrieves the handle of a controlfrom its DialogBox handle and its identifier.
Parameters:
<hDlg> The handle of the Dialogbox container of the control
<nCtlId> The control identifier
Returns:
<hControl> The window handle of the control
Observations: Controls are also windows
Source code:
See also: DialogBox() EndDialog() GetDlgCtrlId()
--------------------------------------------------------------------------------GetFTime() Retrieves the time and date of a file--------------------------------------------------------------------------------
Syntax: GetFDate( <hFile> ) --> <aDateTime>
Parameters:
<hFile> Identifies the handle of an opened file.Use FOpen() to get this handle.
<cTime> Specifies a different time to be set tothe file. Use the format: "HH:MM:SS".
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cdDate> Specifies a different date to be set tothe file. Use the format: "DD:MM:YYYY". Youcan use both a date or a string type.
Returns:
<aDateTime> An array of two elements with the time anddate of the file. The time has the format "HH:MM:SS",and the date is a Clipper date.
Source code: SOURCE\\FUNCTION\\Files.c
See also: SetFTime()
--------------------------------------------------------------------------------GetFocus() Retrieves the handle of the window that has focus--------------------------------------------------------------------------------
Syntax: GetFocus() --> <hWnd>
Parameters: None
Returns:
<hWnd> The handle of the window that has the focus.
Sample: local hWnd := GetFocus()
Source code: SOURCE\\WINAPI\\SetFocus.c
--------------------------------------------------------------------------------GetFontInfo() Retrieves font height, width and bold--------------------------------------------------------------------------------
Syntax: GetFontInfo( <hFont> ) --> <aFontInfo>
This is a FiveWin function to obtain somespecific font info used from some classes.
Parameters:
<hFont> The handle of the font.
Returns:
<aFontInfo> A Clipper array of three elements:
{ nHeight, nWidth, lBold }
Source code: SOURCE\\WINAPI\\FontCrea.c
See also: CreateFont() ChooseFont()
--------------------------------------------------------------------------------GetFreeSpace() Scans the global heap for memory size available--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
This function scans the global heap and returnsthe number of bytes of memory currently available.
Parameters: None
Returns:
<nSize> The total amount of memory.
Observations: This size of memory not always is continuous.GlobalCompact() returns the maximum continuoussize.
Source code: SOURCE\\WINAPI\\Mem.c
--------------------------------------------------------------------------------GetInstance() Returns the application handle instance value--------------------------------------------------------------------------------
Syntax: GetInstance() --> <hInstance>
This function returns the instance of our application.
Parameters: None.
Returns:
<hInstance> An application identifier that Windowsassigns when executing our application.
Source code: Not available.
--------------------------------------------------------------------------------GetKeyStat() Retrieves the state of the specified virtual key--------------------------------------------------------------------------------
Syntax: GetKeyStat( <nKey> ) --> <lPressed>
This function retrieves if a key is beeingpressed.
Parameters:
<nKey> The code of the key that we want tocheck (normal or virtual)
Returns:
<lPressed> If it is pressed or not
Source code: See SOURCE\\CLASSES\\TGet.prg
See also: GetAsynKey()
--------------------------------------------------------------------------------GetLocal() Retrieves any local variable from the stack--------------------------------------------------------------------------------
Syntax: GetLocal( <nStackLevel>, <nIndex> ) -->
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nStackLevel> The depth of the activation level to query.(Similar to Clipper ProcName(...) parameters). A 0value means the current one. 1 means the previous,2 the previous of that one, etc... By default it is0.
<nIndex> The order in which the local variableswere declared at that stack level function.
Returns:
<uLocal> The value of the local variable requested.
Source code: Not provided.
Sample: See SOURCE\\FUNCTION\\ErrorSysW.prg
See also: GetParam()
--------------------------------------------------------------------------------GetMapMode() Retrieves the current mapping mode--------------------------------------------------------------------------------
Syntax: GetMapMode( <hDC> ) --> <nMapMode>
The function retrieves the current mapping modefor a given device context.
Parameters:
<hDC> The handle of the device context.
Returns:
<nMapMode> A numeric value of the followings:
MM_ANISOTROPIC Logical units are converted toarbitrary units with arbitrarilyscaled axes.Setting the mapping mode toMM_ANISOTROPIC does not change thecurrent window or viewport settings.To change the units, orientation, andscaling, an application should use theSetWindowExt and SetViewportExtfunctions.
MM_HIENGLISH Each logical unit is converted to0.001 inch. Positive x is to theright; positive y is up.
MM_HIMETRIC Each logical unit is converted to 0.01millimeter. Positive x is to the right;positive y is up.
MM_ISOTROPIC Logical units are converted toarbitrary units with equally scaledaxes; that is, one unit along thex-axis is equal to one unit along the
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
functions must be used to specifythe desired units and the orientationof the axes. GDI makes adjustments asnecessary to ensure that the x and yunits remain the same size.
MM_LOENGLISH Each logical unit is converted to 0.01inch. Positive x is to the right;positive y is up.
MM_LOMETRIC Each logical unit is converted to 0.1millimeter. Positive x is to theright; positive y is up.
MM_TEXT Each logical unit is converted to onedevice pixel. Positive x is to theright; positive y is down.
MM_TWIPS Each logical unit is converted to 1/20of a point. (Because a point is 1/72inch, a twip is 1/1440 inch). Positivex is to the right; positive y is up.
Source code: SOURCE\\WINAPI\\SetMapMo.c
See also: SetMapMode() SetWindowExt() SetWindowOrg()
--------------------------------------------------------------------------------GetNextInZip() Retrieves info for the next file in the ZIP file--------------------------------------------------------------------------------
Syntax: GetNextInZip() --> <aFileInfo>
Parameters: None
Returns:
<aFileInfo> An array of 9 items containing the followingnext file in ZIP information. GetFirstInZip() mustbe called prior to use GetNextInZip():
<nStackLevel> The depth of the activation level to query.(Similar to Clipper ProcName(...) parameters). A 0value means the current one. 1 means the previous,2 the previous of that one, etc... By default it is0.
<nIndex> The order in which the parameter valueswere provided to that stack level function.
Returns:
<uParameter> The value of the parameter requested.
Source code: Not provided.
Sample: See SOURCE\\FUNCTION\\ErrorSysW.prg
See also: GetLocal()
--------------------------------------------------------------------------------GetParent() Retrieves the window handle of a window parent--------------------------------------------------------------------------------
Syntax: GetParent( <hWnd> ) --> <hWndParent>
This function returns the handle of the containerwindow (if any) of a given window.
Parameters:
<hWnd> The handle of the window.
Returns:
<hWndParent> The handle of the container window of<hWnd>
Source code: SOURCE\\WINAPI\\GetParen.c
See also: SetParent()
--------------------------------------------------------------------------------GetPixel() Retrieves the RGB color of a pixel--------------------------------------------------------------------------------
<nRGBColor> The RGB (numeric long) color of that pixel.
Source code: SOURCE\\WINAPI\\SetPixel.c
See also: SetPixel()
--------------------------------------------------------------------------------GetPrintDC() DialogBox to retrieves the printer device context--------------------------------------------------------------------------------
Syntax: GetPrintDC( <hWndOwner> ) --> <hDC>
This function retrieves the standard WindowsDialogBox to select printing conditions andreturns the associated device context createdfor the printer.
Parameters:
<hWndOwner> The handle of the window that may containsthe DialogBox. By default it is GetActiveWindow().
Returns:
<hDC> The handle of the device context for theprinter.
Observations: FiveWin offers a powerfull TPrint Class and a ReportEngine that automatizes all printing processes makingthem much easier to use.
Sample: See SAMPLES\\REPORT\\*.*
Source code: SOURCE\\WINAPI\\PrintDc.c
See also: PrinterSetup()
--------------------------------------------------------------------------------GetPrinter() Retrieves the printer device context without DlgBox--------------------------------------------------------------------------------
Syntax: GetPrinter() --> <hDC>
Parameters: None
Returns:
<hDC> The handle of the device context for thesystem printer. This system printer is the printerthat is installed in Windows as the default priner.
Observations: This function is automatically called from theTPrinter class to create a printer object withoutprompting with the standard printing selectionDialogBox.
Source code: SOURCE\\WINAPI\\PrintDc.c
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------GetProcAddress() Retrieves the address of the given module function--------------------------------------------------------------------------------
<hInst> Identifies the module that contains the function.Normally The handle of a DLL, that previouslywe have loaded with LoadLibrary().
<cProcName> The name of the function, or its order numberinside the DLL.
<lPascalType> True is the function to be used is PASCAL type.Normally most of Windows API functions are PASCALtype.
<nReturnType> A numeric value that indicates the type of valuereturned by the function to be called.
The nReturnType possible values are inside FiveWinDLL.ch:
#define VOID 0#define BYTE 1#define CHAR 2#define WORD 3#define _INT 4 // conflicts with Clipper
Int()#define BOOL 5#define HDC 6#define LONG 7#define STRING 8#define LPSTR 9#define PTR 10#define _DOUBLE 11 // conflicts with BORDER
DOUBLE
<nParam1Type> Are the different types of parameters that will be<nParamNType> supplied as parameters when calling to the DLL
function. They are numeric values as the above<nReturnType> values.
Returns:
<cProcData> A string which contains a binary representation ofthe DLL function to be called plus necessary informationabout the type, parameters and return type.
The information here contained is vital to properlybuild a C-language alike stack and its manipulation.
Observations: This function is automatically used from the FiveWinDLL management xBase commands. We strongly recommendto use the xBase commands to use this function, as
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------GetProfInt() Retrieves the value of a integer Win.ini file entry--------------------------------------------------------------------------------
<cSection> Specifies the section containing the entry.
<cEntry> The entry whose value is to be retrieved.
<nDefault> Specifies the default numeric value to return ifthe entry cannot be found.
Returns:
<nValue> The numeric value in the INI file that followsthe specified entry.
Observations: This function retrieves a value from the WIN.INIfile.
Sample: SAMPLES\\TestIni.prg
Source code: SOURCE\\WINAPI\\Profile.c
See also: GetProfStr(), GetPvpProfile(), GetPvpProfString()
--------------------------------------------------------------------------------GetProfStr() Retrieves the value of a string Win.ini file entry--------------------------------------------------------------------------------
See also: GetProfInt(), GetPvpProfile(), GetPvpProfString()
--------------------------------------------------------------------------------GetProp() Retrieves a data handle from the Windows property list--------------------------------------------------------------------------------
<hWnd> Identifies the window whose property list is tobe searched.
<cPropIdentifier> A string identifies the data to be retrieved.
Returns:
<hData> The data handle of the associated propertyof the window.
Observations: FiveWin uses this API function for storing someextra values related to the windows, dialogs andcontrols.
Basicly these functions let you assciate extravalues to the windows, and later you can retrievethem. You can use this way, or you can use the:Cargo data of all windows.
Source code: SOURCE\\WINAPI\\Prop.c
See also: SetProp() RemoveProp() EnumProps()
--------------------------------------------------------------------------------GetPvpProfile() Retrieves the value of a integer private INI file entry--------------------------------------------------------------------------------
Observations: This function retrieves a value from a user definedINI file.
Sample: SAMPLES\\TestIni.prg
Source code: SOURCE\\WINAPI\\Profile.c
See also: GetProfStr(), GetPvpProfile(), GetPvpProfString()
--------------------------------------------------------------------------------GetPvpProfString() Retrieves the value of a string private INI file--------------------------------------------------------------------------------
<cSection> Specifies the section containing the entry.
<cEntry> The entry whose value is to be retrieved.
<cDefault> Specifies the default string value to return ifthe entry cannot be found.
<cIniFile> Is is the name of the private INI file to use.
Returns:
<cValue> The string value in the INI file that followsthe specified entry.
Observations: This function retrieves a value from a user definedINI file.
Sample: SAMPLES\\TestIni.prg
Source code: SOURCE\\WINAPI\\Profile.c
See also: GetProfInt(), GetPvpProfile(), GetPvpProfString()
--------------------------------------------------------------------------------GetStockObject() Retrieves the handle of a predefined stock pens--------------------------------------------------------------------------------
BLACK_BRUSH Black brush.DKGRAY_BRUSH Dark-gray brush.GRAY_BRUSH Gray brush.HOLLOW_BRUSH Hollow brush.LTGRAY_BRUSH Light-gray brush.NULL_BRUSH Null brush.WHITE_BRUSH White brush.BLACK_PEN Black pen.NULL_PEN Null pen.WHITE_PEN White pen.ANSI_FIXED_FONT Windows fixed-pitch system font.ANSI_VAR_FONT Windows variable-pitch system font.DEVICE_DEFAULT_FONT Device-dependent font.
OEM_FIXED_FONT OEM-dependent fixed font.SYSTEM_FONT System font. By default, Windows uses
the system font to draw menus, dialogbox controls, and other text. In Windowsversions 3.0 and later, the systemfont is a variable-pitch font width;earlier versions of Windows use afixed-pitch system font.
SYSTEM_FIXED_FONT Fixed-pitch system font used inWindows versions Earlier than 3.0.This object is available forcompatibility with earlier versions ofWindows.
DEFAULT_PALETTE Default color palette. This paletteconsists of the static colors in thesystem palette.
Returns:
<hGDIObject> The return value is the handle of the specifiedobject if the function is successful. Otherwise,it is NULL.
Source code: SOURCE\\WINAPI\\GetStkOb.c
See also: GetObject()
--------------------------------------------------------------------------------GetSysDir() Retrieves the Windows system directory path--------------------------------------------------------------------------------
Syntax: GetSysDir() --> <cWinSystemPath>
Parameters: None
Returns:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cWinSystemPath> The path of the Windows system directory.
Source code: SOURCE\\WINAPI\\WinExec.c
See also: GetWinDir()
--------------------------------------------------------------------------------GetTextHeight() Retrieves the height of a selected font--------------------------------------------------------------------------------
Syntax: GetTextHeight( <hWnd> ) --> <nFontHeight>
Parameters:
<hWnd> Is is the handle of the window whose font heightis to be retrieved.
Returns:
<nFontHeight> The height of the currently selected fontfor that window.
Source code: SOURCE\\WINAPI\\GetTextW.c
See also: GetTextWidth()
--------------------------------------------------------------------------------GetTextWidth() Retrieves the width of a selected font--------------------------------------------------------------------------------
Syntax: GetTextWidth( <hWnd> ) --> <nFontWidth>
Parameters:
<hWnd> Is is the handle of the window whose font heightis to be retrieved.
Returns:
<nFontWidth> The width of the currently selected font forthat window.
Source code: SOURCE\\WINAPI\\GetTextW.c
See also: GetTextHeight()
--------------------------------------------------------------------------------GetVersion() Retrieves the Windows and MsDos versions numbers--------------------------------------------------------------------------------
Syntax: GetVersion() --> <anVersions>
Parameters: None
Returns:
<anVersions> An array of numbers, with the Windowsand MsDos versions:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------GetWinDir() Retrieves the Windows directory path--------------------------------------------------------------------------------
Syntax: GetWinDir() --> <cWinPath>
Parameters: None
Returns:
<cWinPath> The path of the Windows directory.
Source code: SOURCE\\WINAPI\\WinExec.c
See also: GetSysDir()
--------------------------------------------------------------------------------GetWindow() Retrieves the handle of a window--------------------------------------------------------------------------------
--------------------------------------------------------------------------------GetWindowText() Retrieves the window associated text--------------------------------------------------------------------------------
Syntax: GetWindowText( <hWnd> ) --> <cText>
Parameters:
<hWnd> The handle whose associated text is to beretrieved.
Returns:
<cText> The text associated with that window.
Observations: In a standard window you get the window caption.
Source code: SOURCE\\WINAPI\\GetText.c
See also: SetWindowText()
--------------------------------------------------------------------------------GetWindowWord() Retrieves a word value at the specified offset--------------------------------------------------------------------------------
GWW_HINSTANCE Specifies the instance handle of themodule that owns the window.
GWW_HWNDPARENT Specifies the handle of the parentwindow, if any. The SetParent functionchanges the parent window of a childwindow. An application should not callthe SetWindowWord function to changethe parent of a child window.
GWW_ID Specifies the identifier of the childwindow.
Returns:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nValue> The returned value specifies information about thegiven value.
Source code: SOURCE\\WINAPI\\GetWnd.c
See also: SetWindowWord() GetWindowLong() SetWindowLong()
--------------------------------------------------------------------------------GetWndApp() Returns the FiveWin main application window object--------------------------------------------------------------------------------
Syntax: GetWndApp() --> <hWnd>
Parameters: None
Returns:
<hWnd> The handle of the window of the mainapplication window.
Source code: Not provided.
--------------------------------------------------------------------------------GetWndFrame() Returns the FiveWin main frame application window--------------------------------------------------------------------------------
Syntax: GetWndFrame() --> <oWndFrame>
Parameters: None
Returns:
<oWndFrame> Returns the Clipper object of the main MDI framewindow.
Source code: SOURCE\\CLASSES\\MdiFrame.prg
--------------------------------------------------------------------------------GetWndRect() Retrieves the window all area coordinates--------------------------------------------------------------------------------
Syntax: GetWndRect( <hWnd> ) --> <aRect>
Parameters:
<hWnd> The handle of the window whose rect area isto be retrieved.
Returns:
<aRect> An array with the{ nTop, nLeft, nBottom, nRight }
Source code: SOURCE\\WINAPI\\Rects.c
See also: GetClientRect() GetCoors()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------GetWndTask() Retrieves the window associated task handle--------------------------------------------------------------------------------
Syntax: GetWndTask( <hWnd> ) --> <hTask>
Parameters:
<hWnd> The handle of the window whose task isto be retrieved.
Returns:
<hTask> The handle of the task in which thatparticular window has been created.
Source code: SOURCE\\WINAPI\\GetWnd.c
See also: GetTasks()
--------------------------------------------------------------------------------GlobalAddAtom() Adds a string to the Windows atom table system--------------------------------------------------------------------------------
Syntax: GlobalAddAtom( <cString> ) --> <nAtom>
Parameters:
<cString> A string to be added to the system atomtable to return a unique value for it.
Returns:
<nAtom> A numeric value (nAtom) unique for thatstring.
Observations: This function is case sensitive.
Sample: MsgInfo( GlobalAddAtom( "Hello" ) )
Source code: SOURCE\\WINAPI\\Atom.c
See also: GlobalGetAtomName() GlobalDeleteAtom()
--------------------------------------------------------------------------------GlobalFree() Frees the given global memory object--------------------------------------------------------------------------------
Observations: This functions are only recommend for very advancedwindows API programmers.
Source code: SOURCE\\WINAPI\\Mem.c
See also: GlobalAlloc() GlobalLock() GlobalUnlock()
--------------------------------------------------------------------------------HelpIndex() Shows the default help file index--------------------------------------------------------------------------------
Syntax
HelpIndex()
Parameters
None
Returns
Nothing
Description
HelpIndex() Shows the main index of the default selected Help file.
Source: SOURCE\\WINAPI\\HELP.C
--------------------------------------------------------------------------------HelpPopup() Shows the context popup help--------------------------------------------------------------------------------
Syntax
HelpPopup()
Parameters
None
Returns
Nothing
Description
HelpPopup() Shows the help context popup of the selected help file.
Source: SOURCE\\WINAPI\\HELP.C
--------------------------------------------------------------------------------HelpSearch() Search DialogBox in the default Help file--------------------------------------------------------------------------------
Syntax
HelpSearch( [ cString ] )
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
cString Is an optional parameter to specify the string we want tosearch.
Returns
Nothing
Description
HelpSearch() calls the WinHelp search Dialog. If we have specifieda string to search then, automatically, the result of the searchis shown, if not, we have to dynamically type the expression.
Example
HelpSearch( "Hello" )
Source: HELP.C
--------------------------------------------------------------------------------HelpSetPos() Changes the position of the WinHelp Window--------------------------------------------------------------------------------
Syntax
HelpSetPos( nRow, nColumn )
Parameters
nRow, nColumn are two numeric values which specify thecoordinates where WinHelp appears. Windowsassigns logical dimensions of 1024 x 1024dots to screen surface.
Returns
Nothing.
Description
We can select the position where WinHelp will appears.
Example
HelpSetPos( 200, 200 )
Source: HELP.C
--------------------------------------------------------------------------------HelpSetTopic() Selects a help default topic--------------------------------------------------------------------------------
Syntax
HelpSetTopic( cTopic )
Parameters
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
cTopic is a string that let us specify the default topicwhere automatically show help.
Returns
Nothing
Description
It lets us select a help default topic. We may change this topicfrom inside different parts of our program.
Example
HelpSetTopic( "Use_of_help" )
Source: HELP.C
--------------------------------------------------------------------------------HelpTopic() Reviews a Topic--------------------------------------------------------------------------------
Syntax
HelpTopic( [ ncTopic ] )
Parameters
ncTopic is a numeric or string parameter that selects the Topic toreview. If we specify strings we have to use '_' insteadof spaces between words.
Returns
None.
Description
HelpSetTopic() y GetHelpTopic() complements this function.
Example
HelpTopic( "Use_of_help" )
Source: HELP.C
--------------------------------------------------------------------------------I2Hex() Converts a word (2 bytes) into a hex string (4 chars)--------------------------------------------------------------------------------
Syntax: I2Hex( <nWord> ) --> <cHex>
Parameters:
<nWord> A number in the range 0-65535.
Returns:
<cHex> A four characters hex string.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------InportByte() Reads a byte from a hardware port--------------------------------------------------------------------------------
Syntax: InportByte( <nPort> ) --> <nByte>
Parameters:
<nPort> The hardware port number (one word: two bytes)to read a byte from.
Returns:
<nByte> A numeric value corresponding to theread byte.
Comments: Use these functions only to accesshardware ports. Communication ports must beaccessed using special API comm functions.
Source code: SOURCE\\WINAPI\\InOut.c
--------------------------------------------------------------------------------InportWord() Reads a word (2 bytes) from a hardware port--------------------------------------------------------------------------------
Syntax: InportWord( <nPort> ) --> <nWord>
Parameters:
<nPort> The hardware port number (one word: two bytes)to read a word from.
Returns:
<nWord> A numeric value corresponding to theread word.
Comments: Use these functions only to accesshardware ports. Communication ports must beaccessed using special API comm functions.
Source code: SOURCE\\WINAPI\\InOut.c
--------------------------------------------------------------------------------InterruptRegister() Installs a user defined GPFs controller--------------------------------------------------------------------------------
<lSuccess> A logical value indicating if the GPF controllerwas properly installed.
Comments: Though FiveWin has been extensively testedagainst GPFs, we wanted to offer control overa possible GPF offering so an opportunity to takecontrol to close all files and generating anerror.log file with info to detect the cause.
Sample: SAMPLES\\TestTool.prg
Source code: SOURCE\\WINAPI\\ToolHelp.c
--------------------------------------------------------------------------------InterruptUnRegister() Uninstalls a user defined GPFs controller--------------------------------------------------------------------------------
Syntax: InterruptUnRegister() --> <lSuccess>
Parameters: None.
Returns:
<lSuccess> A logical value indicating if the GPF controllerwas properly uninstalled.
Comments: Though FiveWin has been extensively testedagainst GPFs, we wanted to offer control overa possible GPF offering so an opportunity to takecontrol to close all files and generating anerror.log file with info to detect the cause.
Sample: SAMPLES\\TestTool.prg
Source code: SOURCE\\WINAPI\\ToolHelp.c
--------------------------------------------------------------------------------InvalidateRect() Forces a rectangle to be repainted--------------------------------------------------------------------------------
This function supports two different formats asabove.
Parameters:
<hWnd> The handle of the window whose update regionget invalid and should be painted.
<aRect> Specifies the dimensions of the rectangle thatneeds to be updated: { nTop, nLeft, nBottom, nRight }.If not supplied means the whole window area.
<lRepaint> Specifies if the window must be painted.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Observations: This function forces a window region or its wholearea to be repainted. Basically it generates aWM_PAINT message.
Source code: SOURCE\\WINAPI\\InvalRec.c
--------------------------------------------------------------------------------InvertRect() Inverts the colors of a window rectangle--------------------------------------------------------------------------------
Syntax: InvertRect( <hDC>, <aRect> ) --> nil
Parameters:
<hDC> Identifies the window device context.
<aRect> Identifies the rectangle to be inverted:{ nTop, nLeft, nBottom, nRight }
Returns: nil.
Observations: This function inverts the colors of a windowrectangle. Basically if performs an xOR operationover the colors. Thus, inverting twice a regionwill restore the original region colors.
Source code: SOURCE\\WINAPI\\Rects.c
See also: FillRect()
--------------------------------------------------------------------------------IsCdRom() Checks if a drive is a CdRom--------------------------------------------------------------------------------
Syntax: IsCdRom( [ <cDrive> ] ) --> <lSuccess>
Parameters:
<cDrive> The letter of the drive to check.i.e.: "c". Lowercase and Uppercase is permitted.By default, it uses "C".
Returns:
<lSuccess> A logical value indicating if the specifieddrive is a CdRom drive.
Sample: MsgInfo( IsCdRom( "C" ) )
See SAMPLES\\TestDrvs.prg
Source code: SOURCE\\FUNCTION\\Drives.c
--------------------------------------------------------------------------------IsDiskette() Checks if a drive is a floppy disk--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cDrive> The letter of the drive to check.i.e.: "c". Lowercase and Uppercase is permitted.By default, it uses "A".
Returns:
<lSuccess> A logical value indicating if the specifieddrive is a floppy drive.
Sample: MsgInfo( IsDiskette( "C" ) )
See SAMPLES\\TestDrvs.prg
Source code: SOURCE\\FUNCTION\\Drives.c
--------------------------------------------------------------------------------IsIconic() Checks if a window is iconized--------------------------------------------------------------------------------
Syntax: IsIconic( <hWnd> ) --> <lIconic>
Parameters:
<hWnd> The handle of the window to check if itis iconized.
Returns:
<lIconic> A logical value indicating if the window isiconized.
Source code: SOURCE\\WINAPI\\WndIs.c
--------------------------------------------------------------------------------IsZip() Checks a valid ZIP file--------------------------------------------------------------------------------
Syntax: IsZip( <cZipFileName> ) --> <lYesNo>
Parameters:
<cZipFileName> The name of the ZIP file to check.
Returns:
<lYesNo> A logical value indicating if the file is avalid ZIP file.
Sample: SAMPLES\\TestZip.prg
Source code: SOURCE\\FUNCTION\\UnZip.c
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------IsZoomed() Checks if a window is maximized--------------------------------------------------------------------------------
Syntax: IsZoomed( <hWnd> ) --> <lMaximized>
Parameters:
<hWnd> The handle of the window to check if itis maximized.
Returns:
<lMaximized> A logical value indicating if the window ismaximized.
Source code: SOURCE\\WINAPI\\WndIs.c
--------------------------------------------------------------------------------IsWindow() Checks if a window handle is valid--------------------------------------------------------------------------------
Syntax: IsWindow( <hWnd> ) --> <lIsWindow>
Parameters:
<hWnd> The handle of the window to check if itis a valid handle.
Returns:
<lIsWindow> A logical value indicating if the window handleis valid.
Source code: SOURCE\\WINAPI\\WndIs.c
--------------------------------------------------------------------------------IsWindowVisible() Checks if a window is visible--------------------------------------------------------------------------------
Syntax: IsWindowVisible( <hWnd> ) --> <lVisible>
Parameters:
<hWnd> The handle of the window to check if itis visible.
Returns:
<lVisible> A logical value indicating if the window isvisible.
Source code: SOURCE\\WINAPI\\WndIs.c
--------------------------------------------------------------------------------KillTimer() Removes the specified timer--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<hWnd> The handle of the window associated withthe timer to be removed. This must be the samevalue passed as the hWnd parameter of the SetTimerfunction that created the timer.
<nIdTimer> Identifies the timer to be removed. It is thevalue returned by SetTimer() function.
Returns:
<lSuccess> A logical value indicating the result of theKillTimer() operation.
Sample: SAMPLES\\TestTime.prg
Source code: SOURCE\\WINAPI\\Timers.c
See also: Class TTimer
--------------------------------------------------------------------------------L2Hex() Converts a long (4 bytes) into a hex string (8 chars)--------------------------------------------------------------------------------
Syntax: L2Hex( <nLong> ) --> <cHex>
Parameters:
<nLong> A number in the range 0 - 2147483647 (+ or -)
Returns:
<cHex> A eight characters hex string.
Sample: MsgInfo( L2Bin( 123456789 ) )// returns a "075BCD15" hex
Source code: SOURCE\\FUNCTION\\Or.c
See also: C2Hex() I2Hex()
--------------------------------------------------------------------------------lAnd() Retrieves the logical AND of some numeric values--------------------------------------------------------------------------------
<lResult> A logical value with the result of the bit-andoperation.
Observations: This function basically checks if a certain bitflag is active in a numeric value.
Sample: SOURCE\\Classes\\TGet:Init() METHOD.
Source code: SOURCE\\FUNCTION\\Or.c
See also: nAnd() nOr() lOr()
--------------------------------------------------------------------------------LbxGetItem() Retrieves an item of a listbox--------------------------------------------------------------------------------
Syntax: LbxGetItem( <hWnd>, <nItem> ) --> <cText>
Parameters:
<hWnd> Identifies the handle of the listbox controlwhose nItem text is to be retrieved.
<nItem> Identifies the 1 based index of the item whosetext is to be retrieved.
Returns:
<cText> The text associated with that ListBox item.
Observations: This function is used by FiveWin in the TListBoxclass. Use the TListBox class methods insteadof manipulating directly these functions.
Source code: SOURCE\\WINAPI\\Lbx.c
See also: Class TListBox
--------------------------------------------------------------------------------lChDir() Changes from one directory to another--------------------------------------------------------------------------------
Syntax: lChDir( <cNewDir> ) --> <lSuccess>
Parameters:
<cNewDir> The path of the new dir to change to.
Returns:
<lSuccess> If that directory exists and lChDir() couldchange into it.
Sample: lChDir( "c:\\" )
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------lIsDir() Checks the existence of a directory--------------------------------------------------------------------------------
Syntax: lIsDir( <cDir> ) --> <lSuccess>
Parameters:
<cNewDir> The path of the directory to checkif exists.
Returns:
<lSuccess> If the directory <cDir> exist.
Sample: MsgInfo( lIsDir( "c:\\win" ) )
Source code: SOURCE\\FUNCTION\\FileName.prg
See also: lChDir() lRmDir() lMkDir() CurDrive()
--------------------------------------------------------------------------------lMkDir() Creates a new directory--------------------------------------------------------------------------------
Syntax: lMkDir( <cNewDir> ) --> <lSuccess>
Parameters:
<cNewDir> The path of the new dir to create.
Returns:
<lSuccess> If the directory was created successfully.
Sample: lMkDir( "c:\\Customer" )
Source code: SOURCE\\FUNCTION\\MkDir.c
See also: lChDir() lRmDir()
--------------------------------------------------------------------------------LineTo() Draws a line from the current position up to another--------------------------------------------------------------------------------
<hDC> Identifies the device context where to paint the line.In FiveWin: <oWnd>:GetDC() and later: <oWnd>:hDC.
<nRow>, <nCol> The coordinates of the line End-point.
Returns:
<lSuccess> If successfully completed.
Observations: This function draws a line from the current paintingposition up to the end of the line. Use MoveTo()to select the start painting position.
Sample: SAMPLES\\Lineas.prg SAMPLES\\TestGraf.prg
Source code: SOURCE\\WINAPI\\LineTo.c
See also: MoveTo() CreatePen()
--------------------------------------------------------------------------------LoadBitmap() Load the specified resource bitmap--------------------------------------------------------------------------------
<cnCursor> The name or the numeric identifier ofthe cursor to be loaded.
Returns:
<hCursor> The handle of the loaded cursor. 0 ifnot successful.
Source code: SOURCE\\WINAPI\\Cursors.c
See also: SetCursor() DestroyCursor() CursorWait() Cursor...
--------------------------------------------------------------------------------LoadIcon() Load the specified resource icon--------------------------------------------------------------------------------
Syntax: LoadIcon( <hInst>, <cnIcon> ) --> <hIcon>
Parameters:
<hInst> Identifies the handle of the module thatcontains the icon to be loaded.
<cnIcon> The name or the numeric identifier ofthe icon to be loaded.
Returns:
<hIcon> The handle of the loaded icon, or 0if not successful.
Sample: SAMPLES\\Install.prg
Source code: SOURCE\\WINAPI\\Icons.c
See also: ExtractIcon() nIcons() DrawIcon()
--------------------------------------------------------------------------------LoadLibrary() Load a Dynamic link library to use it--------------------------------------------------------------------------------
containing WIN.COM); the GetWinDir()function retrieves the path of this directory.
3 The Windows system directory (the directorycontaining such system files as GDI.EXE);the GetSysDir() function retrieves the path ofthis directory.
4 The directory containing the executable filefor the current task; the GetModuleFileNamefunction retrieves the path of this directory.
5 The directories listed in the PATH environmentvariable.
6 The list of directories mapped in a network.
The return value is the instance handle of the loaded library module if thefunction is successful. Otherwise, it is an error value less thanHINSTANCE_ERROR.
Errors
If the function fails, it returns one of the following error values:
Value Meaning
0 System was out of memory, executable file was corrupt, or relocationswere invalid.
2 File was not found.3 Path was not found.5 Attempt was made to dynamically link to a task, or there was a sharing
or network-protection error.6 Library required separate data segments for each task.8 There was insufficient memory to start the application.10 Windows version was incorrect.11 Executable file was invalid. Either it was not a Windows application
or there was an error in the .EXE image.12 Application was designed for a different operating system.13 Application was designed for MS-DOS 4.0.14 Type of executable file was unknown.15 Attempt was made to load a real-mode application (developed for an
earlier version of Windows).16 Attempt was made to load a second instance of an executable file
containing multiple data segments that were not marked read-only.19 Attempt was made to load a compressed executable file. The file must
be decompressed before it can be loaded.20 Dynamic-link library (DLL) file was invalid. One of the DLLs required
to run this application was corrupt.21 Application requires 32-bit extensions.
Comments
If the module has been loaded, LoadLibrary increments (increases by one)the module's reference count. If the module has not been loaded, the functionloads it from the specified file.
LoadLibrary increments the reference count for a library module each timean application calls the function. When it has finished using the module, theapplication should use the FreeLibrary function to decrement (decrease by one)the reference count.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<hInst> The handle of the module that containsthe string to be loaded.
<nResId> The numeric identifier of the stringresource to be loaded.
Returns:
<cString> The string just loaded or "".
Source code: SOURCE\\WINAPI\\String.c
--------------------------------------------------------------------------------LPToDP() Converts logical coordinates into device coordinates--------------------------------------------------------------------------------
Syntax: LPToDP( <hDC>, <aPoint> ) --> <lSuccess>
Parameters:
<hDC> Identifies the device context.
<aPoint> Contains a { nRow, nCol } point description tobe mapped into device coordinates.
Returns:
<lSuccess> If the operation was completed successfully.
Observations: This function store the new values inside thesame aPoint supplied array.
Source code: SOURCE\\WINAPI\\Point.c
See also: DPToLP()
--------------------------------------------------------------------------------lSaveObject() Saves an object/array to disk--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cFile> Is the name of the file where the Array/Object willbe saved to.
<nOpenMode> Is the DOS File mode in which the file shall be opened.The default value is FO_WRITE and FO_COMPAT
This Function lets you save any object or Array toa File. Please note, that you can not save a codeblockto disc; if an Array element contains such acodeblock, it will be NIL after retrieval.
If you need to work with a codeblock in a class, thenhardcode the block as a setget method instead ofstoring it in a instvar slot.
--------------------------------------------------------------------------------lWRunning() Checks if the main FiveWin events-looping is working--------------------------------------------------------------------------------
Syntax: lWRunning() --> <lRunning>
Parameters: None
Returns:
<lRunning> True if FiveWin main loop event-processing isalready working.
Observations: This function is used by FiveWin to check thatthe app is already processing and dispatchingevents.
Source code: Not supplied.
--------------------------------------------------------------------------------LZCopyFile() Copy and expands a Windows compressed file--------------------------------------------------------------------------------
using them automatically to perform thedesired operation.
Sample: SAMPLES\\Install.prg
Source code: SOURCE\\WINAPI\\LzExpand.c
--------------------------------------------------------------------------------MapDialogRect() Converts dialogbox units into screen units (pixels)--------------------------------------------------------------------------------
Syntax: MapDialogRect( <hDlg>, <aRect> ) --> nil
Parameters:
<hDlg> The handle of the window of the dialogbox.<oDlg>:hWnd.
<aRect> An array holding the rect values:{ nTop, nLeft, nBottom, nRight }
Returns: The pixel values are stored again inside theaRect array.
Source code: SOURCE\\WINAPI\\Rects.c
--------------------------------------------------------------------------------MakeIntResource() Converts an integer resource ID in a Windows format--------------------------------------------------------------------------------
Syntax: MakeIntResource( <nValue> ) --> <nLValue>
Parameters:
<nValue> A numeric value to be transformed intoa long numeric value.
Returns:
<nLValue> The same numeric value but in long format.
Observations: <nValue> is normally a WORD ( two bytes ) value.<nLValue> is a LONG ( four bytes ) value.
Source code: SOURCE\\FUNCTION\\MakeIntR.c
--------------------------------------------------------------------------------MeasureItem() FiveWin function to dispatch WM_MEASUREITEM msgs--------------------------------------------------------------------------------
<lSuccess> If the operation has been performedsuccessfully.
Observations: This function is managed automatically byFiveWin to determinate the dimensions of a'ownerdraw' WinApi control.
Source code: SOURCE\\WINAPI\\MeasureI.c
See also: TWindow:MeasureItem()
--------------------------------------------------------------------------------MemStat() Returns a Dialog with all memory values--------------------------------------------------------------------------------
Syntax: MemStat() --> nil
Parameters: None
Returns: nil
Observations: This function checks all Clipper memory values.
Sample: SAMPLES\\Memory.prg
Source code: SOURCE\\FUNCTION\\MemStat.prg
See also: GlobalFreeSpace()
--------------------------------------------------------------------------------MenuAddItem() Adds a menuitem to a menu. Internally used.--------------------------------------------------------------------------------
<bBlock> The action to be performed by this menuitem suppliedas a codeblock
<nVKState> The accelerator info for this menuitem
<nVirtKey> Extra accelerator info for this menuitem
<lHelp> If it is a right-position typical help menuitem
Returns: The menuitem object properly built and initialized
Observations: FiveWin manages this function automatically frominside the xBase commands.
Sample: SAMPLES\\TestMenu.prg
Source code: SOURCE\\CLASSES\\PdMenu.prg
See also: Class TMenuItem Class TMenu
--------------------------------------------------------------------------------MenuBegin() Begins a new menu definition. Internally used.--------------------------------------------------------------------------------
<oMenu> The menu object already built and initialized
Observations: This function is used automatically by FiveWinfrom the xBase commands.
Sample: SAMPLES\\TestMenu.prg
Source code: SOURCE\\CLASSES\\PdMenu.prg
See also: Class TMenu Class TMenuItem
--------------------------------------------------------------------------------MenuEnd() Ends a menu definition. Internally used.--------------------------------------------------------------------------------
Syntax: MenuEnd() --> <oMenu>
Parameters: None
Returns:
<oMenu> The menu object already initialized and with allits submenus built and initialized.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Observations: This function is used automatically by FiveWinfrom the xBase commands.
Sample: SAMPLES\\TestMenu.prg
Source code: SOURCE\\CLASSES\\PdMenu.prg
See also: Class TMenu Class TMenuItem
--------------------------------------------------------------------------------MessageBeep() Plays a system alert level waveform sound or a tone--------------------------------------------------------------------------------
Syntax: MessageBeep( <nBeepType> ) --> nil
Parameters:
<nBeepType> The type of sound to produce:
-1 Produces a standard beep sound byusing the computer speaker.
MB_ICONASTERISK Plays the sound identified by theSystemAsterisk entry in the [sounds]section of WIN.INI.
MB_ICONEXCLAMATION Plays the sound identified by theSystemExclamation entry in the[sounds] section of WIN.INI.
MB_ICONHAND Plays the sound identified by theSystemHand entry in the [sounds]section of WIN.INI.
MB_ICONQUESTION Plays the sound identified by theSystemQuestion entry in the [sounds]section of WIN.INI.
MB_OK Plays the sound identified by theSystemDefault entry in the [sounds]section of WIN.INI.
Returns: nil
Source code: SOURCE\\WINAPI\\MsgBeep.c
--------------------------------------------------------------------------------MessageBox() Creates, displays and operates a MessageBox window--------------------------------------------------------------------------------
This parameter can be a combination of the followingvalues:
Value Meaning
MB_ABORTRETRYIGNORE The message box contains threepush buttons: Abort, Retry, andIgnore.
MB_APPLMODAL The user must respond to themessage box before continuingwork in the window identified bythe hwndParent parameter. However,the user can move to the windowsof other applications and work inthose windows. MB_APPLMODAL is thedefault if neither MB_SYSTEMMODALnor MB_TASKMODAL is specified.
MB_DEFBUTTON1 The first button is the default.Note that the first button isalways the default unlessMB_DEFBUTTON2 or MB_DEFBUTTON3 isspecified.
MB_DEFBUTTON2 The second button is the default.MB_DEFBUTTON3 The third button is the default.MB_ICONASTERISK Same as MB_ICONINFORMATION.MB_ICONEXCLAMATION An exclamation-point icon appears
in the message box.MB_ICONHAND Same as MB_ICONSTOP.MB_ICONINFORMATION An icon consisting of a lowercase
letter "I" in a circle appears inthe message box.
MB_ICONQUESTION A question-mark icon appears inthe message box.
MB_ICONSTOP A stop-sign icon appears in themessage box.
MB_OK The message box contains one pushbutton: OK.
MB_OKCANCEL The message box contains two pushbuttons: OK and Cancel.
MB_RETRYCANCEL The message box contains two pushbuttons: Retry and Cancel.
MB_SYSTEMMODAL All applications are suspendeduntil the user responds to themessage box. Unless the applicationspecifies MB_ICONHAND, the messagebox does not become modal untilafter it is created; consequently,the parent window and other windowscontinue to receive messagesresulting from its activation.System-modal message boxes areused to notify the user of serious,potentially damaging errors thatrequire immediate attention (forexample, running out of memory).
MB_TASKMODAL Same as MB_APPLMODAL except thatall the top-level windowsbelonging to the current taskare disabled if the hwndParentparameter is NULL. This flag
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
should be used when the callingapplication or library does nothave a window handle availablebut still needs to prevent inputto other windows in the currentapplication without suspendingother applications.
MB_YESNO The message box contains two pushbuttons: Yes and No.
MB_YESNOCANCEL The message box contains threepush buttons: Yes, No, and Cancel.
Returns: The return value is 0 if there is no enoughmemory to create the message box. Otherwise,it is one of the following menu-item valuesreturned by the dialogbox:
Value Meaning
IDABORT Abort button was selected.IDCANCEL Cancel button was selected.IDIGNORE Ignore button was selected.IDNO No button was selected.IDOK OK button was selected.IDRETRY Retry button was selected.IDYES Yes button was selected.
value will be returned if either the ESC key ispressed or the Cancel button is selected. If themessage box has no Cancel button, pressing ESC hasno effect.
Observations: FiveWin supplies as built-in function the mostcommon used messagebox styles. See Msg...() functions.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\WINAPI\\MsgBox.c
See also: MsgInfo() MsgAlert() MsgYesNo()MsgStop()
MsgRetryCancel() MsgAbout() MsgBeep() MsgMeter()
--------------------------------------------------------------------------------MeterPaint() Paints the FiveWin meter--------------------------------------------------------------------------------
--------------------------------------------------------------------------------MoveTo() Changes the painting coordinates--------------------------------------------------------------------------------
<hDC> The handle of the device context wherewhere are going to paint.
<nCol>, <nRow> The coordinates where to start painting.
Returns:
<nLOldPos> A numeric LONG ( four bytes ) value thatstores the old position. The LOWORD( <nLOldValue> )contains the old nCol and the HIWORD( <nLOldValue> )contains the old nRow.
Observations: Some API GDI painting functions requires topreviously determinate the position where to startpainting. MoveTo() lets do that.
Sample: SAMPLES\\Lines.prg
Source code: SOURCE\\WINAPI\\MoveTo.c
See also: LineTo()
--------------------------------------------------------------------------------MoveWindow() Changes the position /and dimensions of a window--------------------------------------------------------------------------------
<hWnd> The handle of the window to move / and resize.
<nLeft>, <nTop> The new origin position coordinates
<nWidth>, <nHeight> The new dimensions (if specified)
<lRepaint> If the window has to be repainted after thisoperation
Returns:
<lSuccess> If the operation was successfully completed.
Source code: SOURCE\\WINAPI\\WndMove.c
See also: TWindow:Move()
--------------------------------------------------------------------------------MsgAbout() MessageBox about style--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cMsg> The message to display on the about dialogbox.
<cTitle> The title of the dialogbox. By default is "About"
Returns: nil
Observations: This function automatically calls the undocumentedWinApi function ShellAbout(), which it is the oneused by Windows in all standard applications whenyou select about.
The standard dialogbox shows an icon, by defaultit is a windows logo. To provide your icon toMsgAbout() you should define an icon with thenumber 1 as identifier:
MyApp.rc
1 ICON "MyApp.ico"
and then:
rc -K MyApp.rc MyApp.exe
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\WINAPI\\MsgBox.c
See also: MsgInfo() MsgAlert() MsgStop() MsgBeep()MsgYesNo() MsgRetryCancel() MsgMeter() MsgGet()
<cTitle> The title of the dialogbox. By default "Alert"
Returns: nil
Observations: This function simplifies the management of thestandard WinApi function MessageBox() with theproper style to show the standard Alert icon.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\WINAPI\\MsgBox.c
See also: MsgInfo() MsgStop() MsgAbout() MsgYesNo()MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Observations: This function simplifies the use of the WinApifunction MessageBeep( 0 ), and follows theFiveWin guides of Msg...() functions.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\WINAPI\\MsgBeep.c
See also: MessageBeep() MsgAlert() MsgInfo() MsgStop()MsgYesNo() MsgRetryCancel() MsgGet()
--------------------------------------------------------------------------------MsgGet() General one-line input message--------------------------------------------------------------------------------
<cBmpFile> The name of a BMP file to display besidesthe GET.
Returns:
<lOk> A logical value indicating if the user selectedOk (.t.) or Cancel (.f.).The modified value is stored in the same <uVar>provided by reference.
Observations: This is a very useful function to quickly displaya DialogBox with a GET to accept some user infoinput.Using MsgGet() you avoid designing a DialogBox,defining it and activating it just for this samepurpose. MsgGet() speed up some basic user input.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\FUNCTION\\MsgGet.prg
See also: MsgAlert() MsgInfo() MsgStop() MsgYesNo()MsgBeep() MsgRetryCancel() MsgAbout() MsgBeep()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------MsgInfo() MessageBox information style--------------------------------------------------------------------------------
Syntax: MsgInfo( <cMsg> [,<cTitle>] ) --> nil
Parameters:
<cMsg> The message to display
<cTitle> The title of the dialogbox.By default "Information"
Returns: nil
Observations: This function simplifies the management of thestandard WinApi function MessageBox() with theproper style to show the standard Info icon.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\WINAPI\\MsgBox.c
See also: MsgAlert() MsgStop() MsgAbout() MsgYesNo()MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()
--------------------------------------------------------------------------------MsgLogo() Shows a floating logo, typically used at start--------------------------------------------------------------------------------
<cLogoFile> The name of a .BMP bitmap file or the nameof a bitmap stored in resources.
FiveWin will check for the existence of the <cLogoFile>as a .BMP file, and if it does not exist then it willlook for it inside the resources.
<nSeconds> An optional numeric value, indicating how manyseconds the logo has to be shown. By default it waitsfor four seconds.
Returns: nil
Observations: This function let you show an initial applicationlogo as many Microsoft and Borland products do.
Sample: IDE\\Ide.exe
Source code: SOURCE\\FUNCTION\\MsgLogo.prg
See also: Msg...() functions
--------------------------------------------------------------------------------MsgMeter() General meter progress dialog--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<oMeter> Is a reference to the oMeter (TMeter) objectthat your user defined function(YourAction()) will receive.
<oText> Is a reference to the oText (TSay) objectthat your user defined function(YourAction()) will receive.You can <oText>:SetText(<cNewText>) tochange its contains while themeter evolves.
<oDlg> Is a reference to the oDlg (TDialog)that your user defined function(YourAction()) will receive.
<lEnd> A logical value supplied byreference. If you set it to .t., thenall the process will end.
<cMsg> The text of the SAY object placed at theMsgMeter dialogBox. By default it is"Processing..."
<cTitle> The title of the DialogBox. By default itis "Please, wait"
Returns: nil
Observations: This function simplifies the process ofcreating and displaying a DialogBox where aprogress meter is displayed.This is very typically an operation to perform whenyou are reindexing, or doing some operation thatrequires some user waiting and processinginvolved.This function, though it may seem a little confusingto use, will let you manage Meters very easily.
Sample: SAMPLES\\TestMMt.prg
Source code: SOURCE\\FUNCTION\\MsgMeter.prg
See also: MsgAlert() MsgStop() MsgAbout() MsgYesNo()MsgRetryCancel() MsgBeep() MsgGet()
<hWnd> The handle of the window of the MsgBarcontrol that is been painted
<cMsg> The message to display
<cMsgDef> The alternative default message to be displayedif cMsg is not supplied
<lErase> If the whole MessageBar has to be repainted
<lCentered> If the message has to be painted centered
Returns: nil
Observations: This function is automatically used from theclass TMsgBar. INTERNAL !!!
Sample: Most of the FiveWin samples manages bottommessage bars.
Source code: SOURCE\\FUNCTION\\MsgTools.c
See also: Class TMsgBar
--------------------------------------------------------------------------------MsgRun() Shows a DialogBox with a msg and executes an action--------------------------------------------------------------------------------
<cTitle> The title of the dialogbox.By default "Please, wait..."
<bAction> The codeblock to execute. By default itjust waits 1 second and finish. MsgRun() will endautomatically the modal DialogBox once the codeblockaction is performed.
Returns: nil
Observations: This function simplifies the process of showinga brief message to the user and issuing an action,without having to design and manage a non-modalDialogBox. This function uses a Modal DialogBox whichguaranties that the application execution will waituntil the codeblock action is performed.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\FUNCTION\\MsgRun.prg
See also: All Msg...() functions. They greatly simplify
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cTitle> The title of the dialogbox.By default "Stop"
Returns: nil
Observations: This function simplifies the management of thestandard WinApi function MessageBox() with theproper style to show the standard Stop icon.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\WINAPI\\MsgBox.c
See also: MsgAlert() MsgInfo() MsgAbout() MsgYesNo()MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()
--------------------------------------------------------------------------------MsgToolBar() General Tool-bar style Dialog--------------------------------------------------------------------------------
<oWndParent> The reference of the container windowobject of the toolbar to be created.
<cTitle> The title of the dialogbox to create
<aActions> An array containing several actions in codeblocks,one for each button on the ToolBar.
<aBmps1> An array with the names of the BMP files orthe BMP resources to use to display the up stateof each toolbar button.
<aBmps2> An array with the names of the BMP files orthe BMP resources to use to display the down stateof each toolbar button.
Returns: nil
Observations: This function lets simplifies the design andactivation of a floating toolbar.Its main goal is to increase productivity witha minimum effort.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
See also: MsgAlert() MsgInfo() MsgAbout() MsgYesNo()MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()
--------------------------------------------------------------------------------MsgWait() Shows a DialogBox with a msg and waits some time--------------------------------------------------------------------------------
<cTitle> The title of the dialogbox.By default "Please, wait..."
<nSeconds> The time in seconds to wait. By defaultjust waits 4 seconds. MsgWait() will automaticallyend the DialogBox that appears.
Returns: nil
Observations: This function simplifies the process of showinga brief message to the user and waiting a little.This function uses a Modal DialogBox which guarantiesthat the application execution will wait until theDialogBox is removed.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\FUNCTION\\MsgRun.prg
See also: All Msg...() functions. They greatly simplifyyour work!
--------------------------------------------------------------------------------MsgNoYes() MessageBox YesNo style with default No .--------------------------------------------------------------------------------
Syntax: MsgNoYes( <cMsg>, <cTitle> ) --> <lYesNo>
Parameters:
<cMsg> The message to display
<cTitle> The title of the dialogbox.By default "Please, select"
Returns:
<lYesNo> A logical value .t. if the user choosed "Yes".
Observations: This function simplifies the management of thestandard WinApi function MessageBox() with theproper style to show the question icon and
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cTitle> The title of the dialogbox.By default "Please, select"
Returns:
<lYesNo> A logical value .t. if the user choosed "Yes".
Observations: This function simplifies the management of thestandard WinApi function MessageBox() with theproper style to show the question icon andthe YesNo style.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\WINAPI\\MsgBox.c
See also: MsgAlert() MsgInfo() MsgAbout() MsgStop()MsgRetryCancel() MsgBeep() MsgMeter() MsgGet()
--------------------------------------------------------------------------------nAnd() Generates a numeric AND value from some numbers--------------------------------------------------------------------------------
--------------------------------------------------------------------------------nArgC() Returns the number of the command line parameters--------------------------------------------------------------------------------
Syntax: nArgC() --> <nInitParams>
Parameters: None
Returns:
<nInitParams> The number of parameters + 1 supplied to theapplication, thus is like calling PCount() + 1 juststarting the app, though nArgC() may be calledfrom anywhere in the app.
Sample: SAMPLES\\TestArgs.prg
Source code: SOURCE\\FUNCTION\\Args.c
See also: cArgV() PCount() Param()
--------------------------------------------------------------------------------nColorToN() Returns the numeric color equivalent of an xBase color--------------------------------------------------------------------------------
Syntax: nColorToN( <cColor> ) --> <nColor>
Parameters:
<cColor> A color in an xBase string format
Returns:
<nColor> The numeric ( byte ) representation ofthat xBase color
Observations: This <nColor> it is not the RGB representation.
Source code: SOURCE\\FUNCTION\\ColorToN.c
See also: nRGB() nGetForeRGB() nGetBackRGB()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cDlgName> The name of the resource of a dialogboxto quickly execute and test.
Returns:
<nResult> The value supplied to EndDlg() to end thedialog.
Observations: This function was developed with the intentionof quickly test dialog boxes, in a prototypestage.
Sample: nDlgBox( "Customers" )
Source code: SOURCE\\WINAPI\\dlogbox.c
See also: Dialog xBase commands - Class TDialog
--------------------------------------------------------------------------------nGetFileFilter() Returns the FileSelect DialogBox selected type--------------------------------------------------------------------------------
Syntax: nGetFileFilter() --> <nType>
Parameters:
<nType> A numeric value indicating the typeof files that was selected from inside thestandard DialogBox WinApi cGetFile() function.
Returns:
<nType> A numeric value with the order of thetype of files selected from cGetFile()
Observations: This value only has meaning when several typesof files has been specified when calling cGetFile()
Sample: IDE\\Ide.prg
Source code: SOURCE\\WINAPI\\GetFile.c
See also: cGetFile()
--------------------------------------------------------------------------------nGetBackRgb() Returns the numeric value of an xBase back color--------------------------------------------------------------------------------
Syntax: nGetBackRgb( <cColor> ) --> <nBackRGB>
Parameters:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nBackRGB> A numeric RGB value corresponding tothe background component of the <cColor>color expression.
Source code: SOURCE\\FUNCTION\\ColorToN.c
See also: nGetForeRGB() nRGB() nColorToN()
--------------------------------------------------------------------------------nGetForeRGB() Returns the numeric value of an xBase fore color--------------------------------------------------------------------------------
Syntax: nGetForeRgb( <cColor> ) --> <nForeRGB>
Parameters:
<cColor> An xBase string color representation.
Returns:
<nForeRGB> A numeric RGB value corresponding tothe foreground component of the <cColor>color expression.
Source code: SOURCE\\FUNCTION\\ColorToN.c
See also: nGetBackRGB() nRGB() nColorToN()
--------------------------------------------------------------------------------nIcons() Returns the number of icons--------------------------------------------------------------------------------
Syntax: nIcons( <cFileName> ) --> <nIcons>
Parameters:
<cFileName> The name of a file that may containssome icons (EXE, DLL, ICO, etc...)
Returns:
<nIcons> The number of icons contained insidethat file
Observations: These icons may be extracted with ExtractIcon()
Sample: IDE\\SOURCE\\Icons.prg
Source code: SOURCE\\WINAPI\\Icons.c
See also: ExtractIcon() LoadIcon() DrawIcon()
--------------------------------------------------------------------------------nOr() Generates a numeric OR value from some numbers--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------nRandom() Generates a random number--------------------------------------------------------------------------------
Syntax: nRandom( [<nRange>] ) --> <nRandom>
Parameters:
<nRange> An optional numeric value to set the range fromwhere we want to generate a random number. By defaulta 65535 numeric range is used.
Returns:
<nRandom> A random number in the range 0 - <nRange>.
Sample: MsgInfo( nRandom( 100 ) ) // returns any number// in the range 0 - 100
Source code: SOURCE\\FUNCTION\\Random.prg
See also: Numeric manipulation functions
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nGreen> The numeric value of the green component.
<nBlue> The numeric value of the blue component.
Returns:
<nRGB> A numeric (RGB) value corresponding tothe red, green and blue values specified.
Observations: Though FiveWin supplies a preprocessor RGB()function, also this function is supplied tolet use this function inside CodeBlocks, macros,etc...
Source code: SOURCE\\WINAPI\\Rgb.c
See also: Colors.ch: RGB() nGetBackRGB() nGetForeRgb()
--------------------------------------------------------------------------------nStrHash() Returns a unique hash value for a string--------------------------------------------------------------------------------
<cString> Is the string to calculate a numeric hash value.
<nHashRange> Is the numeric range for the hash value.
Returns:
<nHashValue> A numeric value corresponding to a unique hashvalue for that specific string.
Observations: Hash techniques is a powerfull way to increasespeed doing a search. Given a string we calculateits hash value, and using that hashvalue we knowexactly where a certain string will be located ina given array.
// we don't need to search "Test", we simply// locate it based on its hash value!// We can do the same with other strings values
Source code: SOURCE\\FUNCTION\\Hash.c
--------------------------------------------------------------------------------nWRow() Returns a certain row number of a window--------------------------------------------------------------------------------
--------------------------------------------------------------------------------NextDlgTabItem() Retrieves the handle of the next WS_TABSTOP control--------------------------------------------------------------------------------
--------------------------------------------------------------------------------nHiByte() Returns the High Byte of a word (two bytes)--------------------------------------------------------------------------------
Syntax: nHiByte( <nWord> ) --> <nHiByte>
Parameters:
<nWord> A numeric (2 bytes) value
Returns:
<nHiByte> A numeric (1 byte) value
Observations: A word is made of:
WORD = LOW_BYTE + HIGH_BYTE
Source code: SOURCE\\FUNCTION\\HiLoWord.c
See also: nLoByte() nHiWord() nLoWord()
--------------------------------------------------------------------------------nHiWord() Returns the HiWord of a long (four bytes)--------------------------------------------------------------------------------
Syntax: nHiWord( <nLong> ) --> <nHiWord>
Parameters:
<nLong> A numeric (4 bytes) value
Returns:
<nHiWord> A numeric (2 byte) value
Observations: A long is made of:
LONG = LOW_WORD + HIGH_WORD
Source code: SOURCE\\FUNCTION\\HiLoWord.c
See also: nLoByte() nHiByte() nLoWord()
--------------------------------------------------------------------------------nLoByte() Returns the Low byte of a word (two bytes)--------------------------------------------------------------------------------
Syntax: nLoByte( <nWord> ) --> <nLoByte>
Parameters:
<nWord> A numeric (2 bytes) value
Returns:
<nLoByte> A numeric (1 byte) value
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------nLoWord() Returns the Low word of a long (four bytes)--------------------------------------------------------------------------------
Syntax: nLoWord( <nLong> ) --> <nLoWord>
Parameters:
<nLong> A numeric (4 bytes) value
Returns:
<nLoWord> A numeric (2 byte) value
Observations: A long is made of:
LONG = LOW_WORD + HIGH_WORD
Source code: SOURCE\\FUNCTION\\HiLoWord.c
See also: nLoByte() nHiByte() nLoWord()
--------------------------------------------------------------------------------nMakeLong() Generates a long (4bytes) from two words (2bytes)--------------------------------------------------------------------------------
<cTitle> The title to display. By default, "Alert"
<nStyle> The style of the MessageBox. See MessageBox()for the possible values
Returns:
<nResult> The numeric result value. See MessageBoxfor all the possible values
Observations: This function just simplifies the use of thestandard MessageBox function, though FiveWinoffers all the Msg...() functions that simplifiesmuch more its management.
Sample: SAMPLES\\TestMsg.prg
Source code: SOURCE\\WINAPI\\MsgBox.c
See also: MsgInfo() MsgAlert() MsgStop() MsgBeep()MsgYesNo() MsgRetryCancel() MsgMeter() MsgGet()
--------------------------------------------------------------------------------NtxPos() Retrieves the relative index position of a record--------------------------------------------------------------------------------
<nRecNo> It is the recno to get its relative NTX indexposition.
Returns:
<nRelativeRecNoPos> It is a numeric value with the resulting relativerecord position.
Source code: SOURCE\\Function\\NtxPos.c
Comments FiveWin provides this function to query a NTXfile for a record relative position. It is neededfor properly update a browse scrollbar afterperforming a seek:
SEEK <Expression>
if Found()<oBrowse>:oVScroll:SetPos( ;
NtxPos( IndexOrd(), RecNo() ) )endif
See also: Class TScrollBar METHOD SetPos()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------OClone() Retrieves a duplicated Clipper object--------------------------------------------------------------------------------
Syntax: OClone( <oObject> ) --> <oClonedObject>
Parameters:
<oObject> The object that we want to duplicate
Returns:
<oClonedObject> The resulting duplicated object
Source code: Not supplied
See also: OSend() aOData()
--------------------------------------------------------------------------------OemToAnsi() Translates a OEM MsDos string into a Windows string--------------------------------------------------------------------------------
Syntax: OemToAnsi( <cOemText> ) --> <cWindowText>
Parameters:
<cOemText> A OEM MsDOs string to be converted into aWindows string.
Returns:
<cWindowText> The result Windows string.
Obervations Normally all the data that you capture from MsDosinto a DBF is stored as OEM text. In this situationyou may call OemToAnsi() to properly review it frominside Windows.
Text that is captured from Windows is in Ansiformat. To use it from MsDos later, store it asthe result of AnsiToOem().
Source code: SOURCE\\WINAPI\\OemAnsi.c
--------------------------------------------------------------------------------OpenClipboard() Open the Windows clipboard to start using it--------------------------------------------------------------------------------
Syntax: OpenClipboard( <hWnd> ) --> <lSuccess>
Parameters:
<hWnd> The handle of the window to be associatedwith the open clipboard
Returns:
<lSuccess> .t. is was possible to open it, .f. if anotherapplication was alread using it
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Observations: FiveWin automatically manages all thesefunctions from inside the TClipBoard class.
Sample: SAMPLES\\TestClip.prg
Source code: SOURCE\\WINAPI\\ClpBrd.c
See also: CloseClipboard() SetClpData()
--------------------------------------------------------------------------------OpenComm() Open the communication port to start using it--------------------------------------------------------------------------------
<cCommName> The name of the comm device to open ina format like "COM" + N or "LPT" + N
<nSizeIn> The size in bytes of the receiving queue.This parameter is ignored for "LPT" devices.By default FiveWin assigns 1024.
<nSizeOut> The size in bytes of the transmission queue.This parameter is ignored for "LPT" devices.By default FiveWin assigns 128.
Returns:
<nIdComm> A numeric identifier for that opened device.0 if there was an error.
If the function fails, it may return one of thefollowing error values:
Value Meaning
IE_BADID The device identifier is invalid orunsupported.
IE_BAUDRATE The device's baud rate is unsupported.IE_BYTESIZE The specified byte size is invalid.IE_DEFAULT The default parameters are in error.IE_HARDWARE The hardware is not available (is
locked by another device).IE_MEMORY The function cannot allocate the queues.IE_NOPEN The device is not open.IE_OPEN The device is already open.
If this function is called with both queue sizes setto zero, the return value is IE_OPEN if the device isalready open or IE_MEMORY if the device is not open.
Windows allows COM ports 1 through 9 and LPT ports 1through 3. If the device driver does not supporta communications port number, the OpenComm functionwill fail.
The communications device is initialized to a defaultconfiguration. The SetCommState function should be used
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
to initialize the device to alternate values.The receiving and transmission queues are used byinterrupt-driven device drivers. LPT ports are notinterrupt driven--for these ports, the cbInQueue andcbOutQueue parameters are ignored and the queue sizeis set to zero.
Sample: SAMPLES\\TestComm.prg
Source code: SOURCE\\WINAPI\\Comm.c
See also: CloseComm() WriteComm() ReadComm() BuildCommDcb()SetCommState() FlushComm() GetCommError()
--------------------------------------------------------------------------------OutportByte() Sends a byte to a hardware port--------------------------------------------------------------------------------
Syntax: OutportByte( <nPort>, <nByte> ) --> nil
Parameters:
<nPort> The hardware port number (one word: two bytes)to read a byte from.
<nByte> A numeric value corresponding to theread byte.
Returns: nil
Comments: Use these functions only to accesshardware ports. Communication ports must beaccessed using special API comm functions.
Source code: SOURCE\\WINAPI\\InOut.c
--------------------------------------------------------------------------------OutportWord() Sends a word (2 bytes) to a hardware port--------------------------------------------------------------------------------
Syntax: OutportWord( <nPort>, <nWord> ) --> nil
Parameters:
<nPort> The hardware port number (one word: two bytes)to read a word from.
<nWord> A numeric value corresponding to theread word.
Returns: nil.
Comments: Use these functions only to accesshardware ports. Communication ports must beaccessed using special API comm functions.
Source code: SOURCE\\WINAPI\\InOut.c
--------------------------------------------------------------------------------OutputDebugString() Displays a debugging msg at Microsoft dbwin.exe--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cText> A text to display of the Microsoft dbwin.exedebugging monitor utility. Microsoft provides thissmall dbwin.exe utility to help tracing severalWindows API operations.
Returns: nil.
Comments: Some Windows API can not be interrupted, thisis why dbwin.exe is extremelly usefull to tracesome sections of the activity of our application.
DbWin.exe must be loaded before we can useOutputDebugInfo().
FiveWin also supplies this function from low levelC source code, so we can use it from our own Croutines.
Sample: // Load Microsoft DbWin.exe first!OutputDebugInfo( "Hello world!" )
<oObject> The object which we want to send it amessage
<cMsg> A string with the message name
<uParam1> They are optional parameters if needed<uParamN>
Returns:
<uReturnedValue> The value returned cause that message,if there is a returned value defined.
Observations: OSend( <oObj>, "XXX" ) is the same as:
<oObj>:XXX
DATA and METHODs messages in Clipper aremanaged in the same way, except that toretrieve a value you have to place anunderscore before the DATA message name:
MsgInfo( OSend( oWnd, "_hWnd" ) )
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------Paint3D() Displays text with 3D look--------------------------------------------------------------------------------
Syntax: Paint3D( <hWnd> ) --> nil
Parameters:
<hWnd> The handle of the control we want to look3D.
Returns: nil
Observations: This is an old function we used to have 3D lookbefore using SET 3DLOOK ON (using Ctl3d.dll).We have left it just a sample.
Source code: SOURCE\\WINAPI\\Paint3d.c
See also: SET 3DLOOK ON, TControl:Set3DLook()
--------------------------------------------------------------------------------PalBmpDraw() Displays a FiveWin combined bitmap and palette handle--------------------------------------------------------------------------------
<nWidth> The target dimensions for the dipplayed bitmap.<nHeight> By tdefault the own bitmap dimensions are used.
<nRaster> A numeric value that specifies the rasteroperation to be performed. Raster operation codesdefine how the graphics device interface (GDI)combines colors in output operations that involvea current brush, a possible source bitmap, and adestination bitmap. This parameter can be one ofthe following:
Code Description
BLACKNESS Turns all output black.DSTINVERT Inverts the destination bitmap.MERGECOPY Combines the pattern and the source
bitmap by using the Boolean ANDoperator.
MERGEPAINT Combines the inverted source bitmapwith the destination bitmap byusing the Boolean OR operator.
NOTSRCCOPY Copies the inverted source bitmapto the destination.
NOTSRCERASE Inverts the result of combiningthe destination and source bitmapsby using the Boolean OR operator.
PATCOPY Copies the pattern to the destinationbitmap.
PATINVERT Combines the destination bitmapwith the pattern by using theBoolean XOR operator.
PATPAINT Combines the inverted source bitmapwith the pattern by using the BooleanOR operator. Combines the result ofthis operation with the destinationbitmap by using the Boolean ORoperator.
SRCAND Combines pixels of the destinationand source bitmaps by using theBoolean AND operator.
SRCCOPY Copies the source bitmap to thedestination bitmap.
SRCERASE Inverts the destination bitmap andcombines the result with the sourcebitmap by using the Boolean ANDoperator.
SRCINVERT Combines pixels of the destinationand source bitmaps by using theBoolean XOR operator.
SRCPAINT Combines pixels of the destinationand source bitmaps by using theBoolean OR operator.
--------------------------------------------------------------------------------ParamCount() Returns the number of parameters of a process--------------------------------------------------------------------------------
Syntax: ParamCount( nProcDeep ) --> nParams
Parameters:
<nProcDeep> Is the number of a certain stack process ( aprocess that called the one which is executing ).
Returns:
<nParms> Is the number of parameters that process received.
Test( nOne, cTwo, dThree )
Suppouse Test is the 5 level called on the stack:
? ParamCount( 5 ) --> 3 (parameters suplied)
Sample: See SOURCE\\FUNCTION\\ErrSysW.prg.
Source code: Not available.
--------------------------------------------------------------------------------PeekMessage() Extract a message from the message queue--------------------------------------------------------------------------------
<nFilterFirst> Specifies the first and last values in the range<nFilterLast> of messages to be examined
<nRemove> Specifies how messages are handled
Returns:
<lSuccess> A logical value indicating if the operationwas successfully.
The result is stored by reference inside <cMsg>
Observations: This functions are automatically managed byFiveWin. We just document them here with thewish of a better understanding, but we stresson the idea that you should let FiveWin manageall these complexity.
Source code: SOURCE\\WINAPI\\PeekMsg.c
--------------------------------------------------------------------------------Pie() Draws a graphic pie--------------------------------------------------------------------------------
center of the bounding rectangle specified by thenLeftRect, nTopRect, nRightRect, and nBottomRectparameters. The starting and ending points of the arcare specified by the nxStartArc, nyStartArc, nxEndArc,and nyEndArc parameters. The function draws the arc byusing the selected pen, moving in a counterclockwisedirection. It then draws two additional lines fromeach endpoint to the arc's center. Finally, it fillsthe pie-shaped area by using the current brush.
If nxStartArc equals nxEndArc and nyStartArc equalsnyEndArc, the result is an ellipse with a single linefrom the center of the ellipse to the point(nxStartArc,nyStartArc) or (nxEndArc,nyEndArc).
The figure drawn by this function extends up to butdoes not include the right and bottom coordinates.This means that the height of the figure isnBottomRect - nTopRect and the width of the figureis nRightRect - nLeftRect.
Both the width and the height of a rectangle must begreater than 2 units and less than 32,767 units.
Sample: SAMPLES\\TestPie.prg
--------------------------------------------------------------------------------PolyPolygon() Draws several polygons--------------------------------------------------------------------------------
<lSuccess> A logical value indicating that the operationwas performed successfully.
Source code: SOURCE\\WINAPI\\Drawing.c
--------------------------------------------------------------------------------PostMessage() Places a message at the end of the queue--------------------------------------------------------------------------------
<hWnd> Identifies the window to which the messagewill be posted. If this parameter isHWND_BROADCAST (-1), the message will be postedto all top level windows, including disabledor invisible unowned windows.
<nMsg> Specifies the message to be posted.
<nWParam> Specifies 16 bits of aditional information.
<nLParam> Specifies 32 bits of aditional information.
Returns:
<lSuccess> A logical value indicating if the operationwas successfull.
Observations This function is automatically managed by FiveWinclasses. We recommend you using :End().
Source code: SOURCE\\WINAPI\\PostQuit.c
See also: TWindow:End()
--------------------------------------------------------------------------------ReadBitmap() Reads a bitmap from disk--------------------------------------------------------------------------------
bitmaps from disk. It lets the user of our applicationsupply new BMPs with photos, drawings, etc...
Sample: SAMPLES\\FwBrow.prg
Source code: SOURCE\\WINAPI\\BmpRead.c
See also: LoadBitmap() PalBmpDraw()
--------------------------------------------------------------------------------ReadComm() Read the contents of the communication port--------------------------------------------------------------------------------
<nIdComm> A numeric identifier for that opened device.0 if there was an error.
<cBuffer> A string variable supplied by referencewhere ReadComm() will place the read bytes.
The length of the initial supplied valuespecifies the wished number of bytes to be read.
You may use, i.e., Space( ... ) to initializethis buffer.
Returns:
<nBytesRead> The number of bytes read. 0 if there wasan error. Use GetCommError() to determine thecause of the error.
Sample: SAMPLES\\TestComm.prg
Source code: SOURCE\\WINAPI\\Comm.c
See also: OpenComm() WriteComm() CloseComm()
--------------------------------------------------------------------------------Rectangle() Draws a graphic rectangle--------------------------------------------------------------------------------
--------------------------------------------------------------------------------RegisterClass() Register a new Windows class--------------------------------------------------------------------------------
<nStyle> Specifies the class style. These styles can becombined by using the bitwise OR operator. This canbe any combination of the following values:
Value Meaning
CS_BYTEALIGNCLIENT Aligns the client area of a windowon the byte boundary (in thex-direction).
CS_BYTEALIGNWINDOW Aligns a window on the byteboundary (in the x-direction).This flag should be set byapplications that perform bitmapoperations in windows by using theBitBlt function.
CS_CLASSDC Gives the window class its owndisplay context (shared byinstances).
CS_DBLCLKS Sends double-click messages to awindow.
CS_GLOBALCLASS Specifies that the window class isan application global class. Anapplication global class is createdby an application or library and isavailable to all applications. Theclass is destroyed when theapplication or library that createdthe class exits; it is essential,therefore, that all windows createdwith the application global classbe closed before this occurs.
CS_HREDRAW Redraws the entire window if thehorizontal size changes.
CS_NOCLOSE Inhibits the close option on theSystem menu.
CS_OWNDC Gives each window instance its owndisplay context. Note thatalthough the CS_OWNDC style isconvenient, it must be used withdiscretion because each displaycontext occupies approximately 800bytes of memory.
CS_PARENTDC Gives the display context of the
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
parent window to the window class.CS_SAVEBITS Specifies that the system should
try to save the screen imagebehind a window created from thiswindow class as a bitmap. Later,when the window is removed, thesystem uses the bitmap to quicklyrestore the screen image.This style is useful for smallwindows that are displayed brieflyand then removed before much otherscreen activity takes place (forexample, menus or dialog boxes).This style increases the timerequired to display the windowsince the system must firstallocate memory to store the bitmap.
CS_VREDRAW Redraws the entire window if thevertical size changes.
<nClsExtra> Specifies the number of bytes to allocate followingthe window class structure. These bytes areinitialized to 0.
<nWndExtra> Specifies the number of bytes to allocate followingthe window instance. Those bytes are initializedto 0.
<hCursor> Identifies the class cursor.
<hBrush> Identifies the class background brush. By defaultFiveWin assigns drak gray color brush.
<cMenuName> Identifies the name of a resource menu.
<nWndProc> A pointer to the window procedure. Bydefault FiveWin uses DefWindowProc().
Returns:
<lSuccess> If the class is registered successfully.
Observations: FiveWin manages all these functions automatically.We just provide here its description with theintention that you get a better understanding,but we insist on the idea that you let FiveWinmanage all these.
Sample: SOURCE\\CLASSES\\Window METHOD Register()
Source code: SOURCE\\WINAPI\\RegClass.c
See also: Class TWindow METHOD Register
--------------------------------------------------------------------------------ReleaseCapture() Let the other applications use the mouse--------------------------------------------------------------------------------
Syntax: ReleaseCapture() --> nil
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Observations: This function releases the mouse capture andrestores normal input processing.
Sample: SAMPLES\\NewHelp.prg
Source code: SOURCE\\WINAPI\\WMouse.c
See also: SetCapture() GetCapture()
--------------------------------------------------------------------------------ReleaseDC() Finish using a device context--------------------------------------------------------------------------------
Syntax: ReleaseDC( <hWnd>, <hDC> ) --> <lSuccess>
Parameters:
<hWnd> Identifies the handle of the window whose DC isto be released.
<hDC> Identifies the device context to be released.
Returns:
<lSuccess> A logical value indicating if the operation wascompleted sucessfully.
Observations: An application must call ReleaseDC() for eachGetDC() function call.
FiveWin manages all these functions automaticallythrough the TWindow class.
Source code: SOURCE\\WINAPI\\Dc.c
See also: GetDC() BeginPaint() EndPaint()
--------------------------------------------------------------------------------RemoveFont() Removes a font from the available fonts list--------------------------------------------------------------------------------
Syntax: RemoveFont( <cFontName> ) --> <lSuccess>
Parameters:
<cFontName> Identifies the name of the font resource file orthe handle of a module loaded that supplied that font.
Returns:
<lSuccess> If the operation was sucessfull.
Observations: Any application that adds or removes fonts from theWindows font table should send a WM_FONTCHANGE messageto all top-level windows in the system by using the
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
SendMessage function with the hwnd parameter set to-1 (HWND_BROADCAST).
In some cases, the RemoveFont function may not removethe font resource immediately. If there are outstandingreferences to the resource, it remains loaded untilthe last logical font using it has been removed(deleted) by using the DeleteObject function.
Source code: SOURCE\\WINAPI\\FontCrea.c
See also: AddFontResource()
--------------------------------------------------------------------------------RemoveProp() Removes a previous stored window prop--------------------------------------------------------------------------------
--------------------------------------------------------------------------------Say3D() Displays a 3D look text--------------------------------------------------------------------------------
This function converts the screen coordinates of agiven point on the screen to client coordinates.
Parameters:
<hWnd> Is the handle of the window whose client area isused for the conversion.
<aPoint> An array of two elements that holds thecoordinates of the point. The two elements of thisarray are transformed acordingly with the newcalculated values.
Returns: Nothing. The result is placed inside the same array.
Sample: local aPoint := { 100, 120 }
ScreenToClient( oWnd:hWnd, aPoint )
? aPoint[ 1 ]? aPoint[ 2 ]
Source code: SOURCE\\WINAPI\\Clt2Scr.c
See also: ClientToScreen()
--------------------------------------------------------------------------------ScrollWindow() Scroll a region of a window--------------------------------------------------------------------------------
--------------------------------------------------------------------------------SelectObject() Select a GDI object to be used in a device context--------------------------------------------------------------------------------
<hGDIObject> Identifies the handle of the GDI object to be selected
Returns:
<hPrevGDIObject> Returns the handle of the previous GDI object selected.
Observations: Many GDI objects, before to be used, have to beselected using this function.
Sample: SAMPLES\\Lines.prg
Source code: SOURCE\\WINAPI\\SelObjec.c
See also: DeleteObject()
--------------------------------------------------------------------------------SendMessage() Sends a Windows message to a window--------------------------------------------------------------------------------
<hWnd> Identifies the handle of the window to which themessage will be sent. If this parameter isHWND_BROADCAST (-1) then it is sent to all windows.
<nMsg> Specifies the message to be sent
<nWParam> A numeric value specifying 16 bits of additionalmessage dependant information.
<nLParam> A numeric value specifying 32 bits of additionalmessage dependant information.
Returns:
<nLResult> The result of the message processing and dependson the message sent.
Sample: SAMPLES\\EndApp.prg
Source code: SOURCE\\WINAPI\\SendMsg.c
See also: PostMessage() PeekMessage() CLASS TWindow:SendMsg()
--------------------------------------------------------------------------------SetActiveWindow() Changes the current active window--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<hWnd> Identifies the top level window to be activated
Returns:
<hPrevWnd> The handle of the previous active window.
Source code: SOURCE\\WINAPI\\WndCente.c
See also: GetActiveWindow()
--------------------------------------------------------------------------------SetBlackPen() Selects the black pen for painting--------------------------------------------------------------------------------
Syntax: SetBlackPen( <hDC> ) --> <hPrevPen>
Parameters:
<hDC> Identifies the handle of the device context whereselect a black pen.
Returns:
<hPrevPen> Identifies the handle of the previous selected pen.
Source code: SOURCE\\WINAPI\\GetStokB.c
See also: SetWhitePen() GetStockObject()
--------------------------------------------------------------------------------SetClipboardData() Places some data at the clipboard--------------------------------------------------------------------------------
CF_BITMAP The data is a bitmap.CF_DIB The data is a memory object containing a
BITMAPINFO structure followed by the bitmapdata.
CF_DIF The data is in Data Interchange Format (DIF).CF_DSPBITMAP The data is a bitmap representation of a
private format. This data is displayed inbitmap format in lieu of the privatelyformatted data.
CF_DSPMETAFILEPICT The data is a metafile representationof a private data format. This data isdisplayed in metafile-picture format inlieu of the privately formatted data.
CF_DSPTEXT The data is a textual representation of aprivate data format. This data is displayedin text format in lieu of the privately
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
formatted data.CF_METAFILEPICT The data is a metafile (see the
description of the METAFILEPICT structure.
CF_OEMTEXT The data is an array of text characters inthe OEM character set. Each line ends witha carriage returnlinefeed (CR-LF)
combination.A null character signals the end of the data.
CF_OWNERDISPLAY The data is in a private format thatthe clipboard owner must display.
CF_PALETTE The data is a color palette.CF_PENDATA The data is for the pen extensions to the
Windows operating system.CF_RIFF The data is in Resource Interchange File
Format (RIFF).CF_SYLK The data is in Symbolic Link (SYLK) format.CF_TEXT The data is an array of text characters.
Each line ends with a carriage returnlinefeed (CR-LF) combination. A nullcharacter signals the end of the data.
CF_TIFF The data is in Tag Image File Format (TIFF).
CF_WAVE The data describes a sound wave. This is asubset of the CF_RIFF data format; it canbe used only for RIFF WAVE files.
<cText> The text to be placed at the clipboard. Right now,FiveWin only supports text manipulation.
Returns:
<nHandle> The handle of the data placed at theclipboard if successfull or 0 if there is aproblem.
Sample: SAMPLES\\TestClip.prg
Source code: SOURCE\\WINAPI\\ClpBrd.c
See also: OpenClipboard() CloseClipboard() EmptyClipboard()
--------------------------------------------------------------------------------SetIdleAction() Set/removes the FiveWin background process--------------------------------------------------------------------------------
Syntax: SetIdleAction( [ bIdleAction ] ) --> nil
Parameters:
<bIdleAction> Is the codeblock to execute during idle periods.If no codeblock is provided, SetIdleAction() resetsthe current bIdleAction, so it stops the previousdefined idle codeblock.
Returns: nil
Observations: It is very important that you don't process largeroutines here or you will freeze the whole system.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Don't confuse idle periods with timers. Idle periodsare those during there are no pending messages toprocess. As soon as the application starts processingmessages, all idle actions get stopped.
Sample: See TestIdle.prg.
Source code: Not available.
--------------------------------------------------------------------------------SetWhitePen() Selects the white pen for painting--------------------------------------------------------------------------------
Syntax: SetWhitePen( <hDC> ) --> <hPrevPen>
Parameters:
<hDC> Identifies the handle of the device context whereselect a white pen.
Returns:
<hPrevPen> Identifies the handle of the previous selected pen.
Source code: SOURCE\\WINAPI\\GetStokB.c
See also: SetBlackPen() GetStockObject()
--------------------------------------------------------------------------------SetCapture() Captures all the mouse activity for a window--------------------------------------------------------------------------------
Syntax: SetCapture( <hWnd> ) --> <hWndPrev>
Parameters:
<hWnd> Identifies the handle of the window toreceive all mouse messages.
Returns:
<hWndPrev> The handle of the previous window thatwas receiving all mouse messages, if defined.It not, it returns 0.
Observations: When the window no longer requires all mouseinput, the application it should call ReleaseCapture().
Sample: SAMPLES\\NewHelp.prg
Source code: SOURCE\\WINAPI\\WMouse.c
See also: GetCapture() ReleaseCapture()
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------SetClassWord() Changes a window word value--------------------------------------------------------------------------------
<nIndex> Specifies the zero-based byte offset of the word valueto change.
Valid values are in the range zero through the numberof bytes of class memory, minus two (for example, if10 or more bytes of extra class memory were specified,a value of 8 would be an index to the fifth integer),or one of the following values:
Value Meaning
GCW_HBRBACKGROUND Sets a new handle of a backgroundbrush.
GCW_HCURSOR Sets a new handle of a cursor.GCW_HICON Sets a new handle of an icon.GCW_STYLE Sets a new style bit for the
<nOldValue> The return value is the previous value of thespecified word, if the function is successful.Otherwise, it is zero.
Observations: The SetClassWord function sets a word value at thespecified offset into the extra class memory for thewindow class to which the given window belongs. Extraclass memory is reserved by specifying a nonzero valuein the cbClsExtra member of the WNDCLASSstructure used with the RegisterClass function.
Source code: SOURCE\\WINAPI\\RegClass.c
See also: SetClassLong() SetWindowWord() SetWindowLong()
--------------------------------------------------------------------------------SetClpData() Changes the contents of the clipboard--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nFormat> Specifies the format of the data. It can be any oneof the system-defined formats or a format registeredby the RegisterClipboardFormat function.
CF_BITMAP The data is a bitmap.
CF_DIB The data is a memory object containinga BITMAPINFO structure followed by thebitmap data.
CF_DIF The data is in Data Interchange Format(DIF).
CF_DSPBITMAP The data is a bitmap representation ofa private format. This data is displayedin bitmap format in lieu of the privatelyformatted data.
CF_DSPMETAFILEPICT The data is a metafilerepresentation of a private data format.This data is displayed inmetafile-picture format in lieu of theprivately formatted data.
CF_DSPTEXT The data is a textual representation ofa private data format. This data isdisplayed in text format in lieu of theprivately data.
CF_METAFILEPICT The data is a metafile (see thedescription of the METAFILEPICT structure.
CF_OEMTEXT The data is an array of text charactersin the OEM character set. Each line endswith a carriage returnlinefeed (CR-LF)combination. A null character signalsthe end of the data.
CF_OWNERDISPLAY The data is in a private format thatthe clipboard owner must display.
CF_PALETTE The data is a color palette.
CF_PENDATA The data is for the pen extensions tothe Windows operating system.
CF_RIFF The data is in Resource Interchange FileFormat (RIFF).
CF_SYLK The data is in Symbolic Link (SYLK)format.
CF_TEXT The data is an array of text characters.Each line ends with a carriagereturnlinefeed (CR-LF) combination. Anull character signals the end of thedata.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
CF_TIFF The data is in Tag Image File Format(TIFF).
CF_WAVE The data describes a sound wave. This isa subset of the CF_RIFF data format; itcan be used only for RIFF WAVE files.
Private data formats in the range CF_PRIVATEFIRSTthrough CF_PRIVATELAST are not automatically freedwhen the data is removed from the clipboard. Datahandles associated with these formats should be freedupon receiving a WM_DESTROYCLIPBOARD message.
Private data formats in the range CF_GDIOBJFIRSTthrough
CF_GDIOBJLAST will be automatically removed by a callto the DeleteObject function when the data is removedfrom the clipboard. If Windows Clipboard is running, itwill not update its window to show the data placed inthe clipboard by the SetClipboardData until after theCloseClipboard function is called.
<uData> The handle of the data to place at theClipboard. Right now FiveWin only supports text,due not to a FiveWin limitation since that allformats have not yet been implemented.
Sample: SAMPLES\\TestClip.prg
Source code: SOURCE\\WINAPI\\ClpBrd.c
See also: OpenClipboard() CloseClipboard() GetClpData()
--------------------------------------------------------------------------------SetCommState() Selects the state of the communication port--------------------------------------------------------------------------------
Syntax: SetCommState( <cDCB> ) --> <lSuccess>
Parameters:
<cDCB> A string containing a DCB structurevalues. The DCB structure is automatically buildby BuildCommDcb() function.
Returns:
<lSuccess> If the operation is performed successfully.
Sample: SAMPLES\\TestComm.prg
Source code: SOURCE\\WINAPI\\Comm.c
See also: OpenComm() CloseComm() ReadComm() WriteComm()BuildCommDcb()
--------------------------------------------------------------------------------SetCursor() Changes the Windows active cursor--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<hOldCursor> The handle of the previous in use cursor.
Sample: SAMPLES\\TestCurs.prg
Source code: SOURCE\\WINAPI\\Cursors.c
See also: Cursor...() functions LoadCursor() DestroyCursor()
--------------------------------------------------------------------------------SetDate() Changes the date of the system--------------------------------------------------------------------------------
<lSuccess> A logical value meaning that the supplieddate is valid and could be settled as the new date.
Sample: SAMPLES\\TestDate.prg
Source code: SOURCE\\FUNCTION\\DateTime.c
See also: SysTime()
--------------------------------------------------------------------------------SetDeskWallPaper() Changes the desktop bitmap--------------------------------------------------------------------------------
<cBmpFile> The name of the BMP file to be shown asthe desktop bitmap.
Returns:
<lSuccess> If the operation was successful.
Observations: This is an undocumented WinApi function. Don'texpect that is available in next Windows versions.Also, this function does not store the value
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
for the next Windows startup. You have to modifyWIN.INI file in order to asure that it willbe the desktop BMP next time.
Sample: SAMPLES\\FwBrow.prg
See SAMPLES\\Install.prg for a better way ofchanging the whole desktop look.
Source code: SOURCE\\WINAPI\\Desktop.c
--------------------------------------------------------------------------------SetFDate() Set a different time and date for a file--------------------------------------------------------------------------------
<hFile> Identifies the handle of an opened file.Use FOpen() to get this handle.
<cTime> Specifies a different time to be set tothe file. Use the format: "HH:MM:SS".
<cdDate> Specifies a different date to be set tothe file. Use the format: "DD:MM:YYYY". Youcan use both a date or a string type.
Returns:
<lSuccess> If the operation was performed successfully.
Source code: SOURCE\\FUNCTION\\Files.c
See also: GetFTime()
--------------------------------------------------------------------------------SetFocus() Selects a window as focused--------------------------------------------------------------------------------
Syntax: SetFocus( <hWnd> ) --> <hWndPrev>
Parameters:
<hWnd> Identifies the window to receive the keyboardinput. If this parameter is 0, keystrokes areignored.
Returns:
<hWndPrev> Identifies the window that previously hadthe focus.
Observations: This function sends a WM_KILLFOCUS to thewindow that previously had the focus, anda WM_SETFOCUS to the window that recievesthe focus.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------SetHandleCount() Changes the maximum number of available files--------------------------------------------------------------------------------
<nHandles> Specifies the number of a file handles theapplication requires. This count can not be greaterthan 255.
Returns:
<nHandlesAvailables> Is the number of handles availables to theapplication.
Observations: By default, the number of available handles is20.
Sample: SAMPLES\\AutoLay.prg
Source code: SOURCE\\WINAPI\\SetHandl.c
--------------------------------------------------------------------------------SetHelpFile() Selects the default Help File--------------------------------------------------------------------------------
Sintax
SetHelpFile( cHelpFile )
Parameters
cHelpFile is the name of the HLP file to be used by defaultfrom our program.
Returns
Nothing
Description
SetHelpFile() Selects the default HLP file to be called when requestinghelp. GetHelpFile() will return the Help file name weselect here.
Example
SetHelpFile( "FiveWin.hlp" )
Source: HELP.C
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------SetMapMode() Selects a drawing mode--------------------------------------------------------------------------------
This parameter can be any one of the followingvalues:
Value Meaning
MM_ANISOTROPIC Logical units are converted toarbitrary units with arbitrarily scaled axes.Setting the mapping mode to MM_ANISOTROPICdoes not change the current window or viewportsettings. To change the units, orientation,and scaling, an application should use theSetWindowExt and SetViewportExt functions.
MM_HIENGLISH Each logical unit is converted to 0.001inch. Positive x is to the right; positive y isup.
MM_HIMETRIC Each logical unit is converted to 0.01millimeter. Positive x is to the right; positivey is up.
MM_ISOTROPIC Logical units are converted to arbitraryunits with equally scaled axes; that is, oneunit along the x-axis is equal to one unitalong the y-axis. The SetWindowExt andSetViewportExt functions must be used tospecify the desired units and the orientationof the axes. GDI makes adjustments asnecessary to ensure that the x and y unitsremain the same size.
MM_LOENGLISH Each logical unit is converted to 0.01inch. Positive x is to the right; positive y isup.
MM_LOMETRIC Each logical unit is converted to 0.1millimeter. Positive x is to the right;positive y is up.
MM_TEXT Each logical unit is converted to one devicepixel. Positive x is to the right; positive yis down.
MM_TWIPS Each logical unit is converted to 1/20 of apoint. (Because a point is 1/72 inch, a twipis 1/1440 inch). Positive x is to theright; positive y is up.
Returns:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nOldMode> The previous mapping mode if the functionis successful.
Observations: The MM_TEXT mode allows applications to work in devicepixels, where one unit is equal to one pixel. Thephysical size of a pixel varies from device to device.
The MM_HIENGLISH, MM_HIMETRIC, MM_LOENGLISH,MM_LOMETRIC, and MM_TWIPS modes are useful forapplications that must draw in physically meaningfulunits (such as inches or millimeters).
The MM_ISOTROPIC mode ensures a 1:1 aspect ratio,which is useful when it is important to preservethe exact shape of an image.
The MM_ANISOTROPIC mode allows the x- andy-coordinates to be adjusted independently.
Source code: SOURCE\\WINAPI\\SetMapMo.c
See also: GetMapMode() SetViewPortExt() SetWndExt()
--------------------------------------------------------------------------------SetParent() Changes the parent of a window--------------------------------------------------------------------------------
<hWndOldParent> The handle of the old parent window.
Observations: If the child window is visible it getsproperly painted.
Sample: SAMPLES\\TestFold.prg
Source code: SOURCE\\WINAPI\\Getparen.c
See also: GetParent() IsChild()
--------------------------------------------------------------------------------SetPixel() Draws a pixel--------------------------------------------------------------------------------
<nCol>, <nRow> The coordinates of the point where to set thepixel.
<nRGBColor> The color to use for that pixel.
Returns:
<nRGBColor> The color used if the operation wassuccessful. This color may vary from theoriginal supplied color.
Source code: SOURCE\\WINAPI\\SetPixel.c
See also: GetPixel()
--------------------------------------------------------------------------------SetProp() Store a window property in the Windows prop list--------------------------------------------------------------------------------
<hWnd> The handle of the window whose propertylist receives the new entry.
<cProp> Identifies the prop name.
<nData> Identifies the data to be copied to the propertylist
Returns:
<lSuccess> If the operation was successfully.
Sample: SOURCE\\CLASSES\\Window.prg METHOD Link()
Source code: SOURCE\\WINAPI\\Prop.c
See also: GetProp() RemoveProp()
--------------------------------------------------------------------------------SetTextAlign() Selects the kind of text aligment--------------------------------------------------------------------------------
<nAlignMode> A numeric value specifying the align mode:
The flags specify the relationship between a pointand a rectangle that bounds the text. The point can beeither the current position or coordinates specifiedby a text-output function (such as the ExtTextOutfunction). The rectangle that bounds the text is
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
defined by the adjacent character cells in the textstring.
The <nAlignMode> parameter can be one or more flagsfrom the following three categories.
Choose only one flag from each category.The first category affects text alignment in thex-direction:
Value Meaning
TA_CENTER Aligns the point with the horizontalcenter of the bounding rectangle.
TA_LEFT Aligns the point with the left side ofthe bounding rectangle. This is thedefault setting.
TA_RIGHT Aligns the point with the right side ofthe bounding rectangle.
The second category affects text alignment in they-direction:
Value Meaning
TA_BASELINE Aligns the point with the base line ofthe chosen font.
TA_BOTTOM Aligns the point with the bottom of thebounding rectangle.
TA_TOP Aligns the point with the top of thebounding rectangle. This is the defaultsetting.
The third category determines whether the currentposition is updated when text is written:
Value Meaning
TA_NOUPDATECP Does not update the current positionafter each call to a text-output function.
This is the default setting.
TA_UPDATECP Updates the current x-position after eachcall to a text-output function. The newposition is at the right side of thebounding rectangle for the text. Whenthis flag is set, the coordinatesspecified in calls to the TextOutfunction are ignored.
Returns:
<nOldAlign> The previous text-alignment settings, ifthe function is successful.
Observations: This align flags are used by the TextOut() andExtTextOut() functions.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------SetTime() Changes the time of the system--------------------------------------------------------------------------------
<nMillSecs> The time milliseconds. Zero by default.
Returns:
<lSuccess> A logical value meaning that the suppliedtime is valid and could be settled as the new time.
Sample: SAMPLES\\TestDate.prg
Source code: SOURCE\\FUNCTION\\DateTime.c
See also: SetDate()
--------------------------------------------------------------------------------SetTimer() Installs a system timer--------------------------------------------------------------------------------
--------------------------------------------------------------------------------SetViewPortExt() Selects the viewport of a given device context--------------------------------------------------------------------------------
When the mapping mode is MM_ISOTROPIC, an applicationmust call the SetWindowExt function before callingSetViewportExt.
The x- and y-extents of the viewport define how muchthe graphics device interface (GDI) must stretchor compress units in the logical coordinate system tofit units in the device coordinate system. Forexample, if the x-extent of the window is 2 and thex-extent of the viewport is 4, GDI converts twological units (measured from the x-axis) into fourdevice units. Similarly, if the y-extent of the windowis 2 and the y-extent of the viewport is -1, GDIconverts two logical units (measured from the y-axis)into one device unit.
The extents also define the relative orientation ofthe x- and y-axes in both coordinate systems. Ifthe signs of matching window and viewport extents arethe same, the axes have the same orientation. If thesigns are different, the orientation is reversed. Forexample, if the y-extent of the window is 2 and they-extent of the viewport is -1, GDI converts thepositive y-axis in the logical coordinate system tothe negative y-axis in the device coordinate system.If the x-extents are 2 and 4, GDI converts thepositive x-axis in the logical coordinate system tothe positive x-axis in the device coordinate system.
Source code: SOURCE\\WINAPI\\Dc.c
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------SetWindowExt() Sets the X and Y extents of a device context--------------------------------------------------------------------------------
<nWidth>, <nHeight> Specifies the y-extent and x-extent, in logicalunits, of the window.
Returns:
<aPrevDimensions> An array that holds the previous dimensions:{ nWidth, nHeight }
Observations: See SetViewPortExt() explanations.
Source code: SOURCE\\WINAPI\\Dc.c
See also: SetMapMode() SetViewPortExt()
--------------------------------------------------------------------------------SetWindowOrigin() Changes the window origin of the DC of a window-------------------------------------------------------------------------------
<nCol>, <nRow> Identifies the coordinates of the top-leftposition of the window.
Returns:
<aPrevOrigin> An array with the previous origin values:{ nCol, nRow }
Observations: The window origin is the origin of the logicalcoordinate system for a window. By changing thewindow origin, an application can change the way thegraphics device interface (GDI) converts logicalcoordinates to device coordinates (the viewport). GDIconverts logical coordinates to the devicecoordinates of the viewport in the same way as itconverts the origin.
To convert points to the right, an application canspecify a negative value for the nCol parameter.
Similarly, to convert points down (in the MM_TEXTmapping mode), the nRow parameter can be negative.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------SetWindowPos() Changes the position of a Window--------------------------------------------------------------------------------
<hWndAfter> Identifies the window to precede the positionedwindow in the Z-order. This parameter must be awindow handle or one of the following values:
Value Meaning
HWND_BOTTOM Places the window at the bottom ofthe Z-order. If hwnd identifies atopmost window, the window loses itstopmost status; the system places thewindow at the bottom of all otherwindows.
HWND_TOP Places the window at the top of theZ-order.
HWND_TOPMOST Places the window above all non-topmostwindows. The window maintains itstopmost position even when it isdeactivated.
HWND_NOTOPMOST Repositions the window to the top ofall non-topmost windows (that is, behindall topmost windows). This flag has noeffect if the window is already anon-topmost window.
<nCol>, <nRow> The new window coordinates.
<nWidth>, <nHeight> The new dimensions of the window.
<nFlags> Specifies the window sizing and positioning options.This parameter can be a combination of the followingvalues:
Value Meaning
SWP_DRAWFRAME Draws a frame (defined in the window'sclass description) around the window.
SWP_HIDEWINDOW Hides the window.
SWP_NOACTIVATE Does not activate the window. If thisflag is not set, the window isactivated and moved to the top ofeither the topmost or non-topmost
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
group (depending on the setting of thehwndInsertAfter parameter).
SWP_NOMOVE Retains the current position (ignoresthe x and y parameters).
SWP_NOSIZE Retains the current size (ignores thecx and cy parameters).
SWP_NOREDRAW Does not redraw changes. If this flagis set, no repainting of any kindoccurs. This applies to the clientarea, the non-client area (includingthe title and scroll bars), and anypart of the parent window uncoveredas a result of the moved window.When this flag is set, the applicationmust explicitly invalidate or redrawany parts of the window and parentwindow that must be redrawn.
SWP_NOZORDER Retains the current ordering (ignoresthe hwndInsertAfter parameter).
SWP_SHOWWINDOW Displays the window.
Returns:
<lSuccess> A logical value indicating if theoperation was performed successfully.
Observations: If the SWP_SHOWWINDOW or the SWP_HIDEWINDOW flags areset, the window cannot be moved or sized.
All coordinates for child windows are clientcoordinates (relative to the upper-left corner of theparent window's client area).
A window can be made a topmost window either bysetting the hwndAfter parameter to HWND_TOPMOSTand ensuring that the SWP_NOZORDER flag is not set,or by setting a window's Z-order so that it is aboveany existing topmost windows. When a non-topmostwindow is made topmost, its owned windows are alsomade topmost. Its owners are not changed.
If neither SWP_NOACTIVATE nor SWP_NOZORDER isspecified (that is, when the application requeststhat a window be simultaneously activated and placedin the specified Z-order), the value specified inhwndAfter is used only in the following circumstances:
Neither HWND_TOPMOST or HWND_NOTOPMOST is specifiedin the hwndAfter parameter.
The window specified in the hwnd parameter is not theactive window.
An application cannot activate an inactive windowwithout also bringing it to the top of the Z-order.Applications can change the Z-order of an activated
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
window without restrictions or activate a window andthen move it to the top of the topmost or non-topmostwindows. A topmost window is no longer topmost if itis repositioned to the bottom (HWND_BOTTOM) of theZ-order or after any non-topmost window. When atopmost window is made non-topmost, all of its ownersand its owned windows are also made non-topmost windows.
A non-topmost window may own a topmost window, but notvice versa. Any window (for example, a dialog box)owned by a topmost window is itself made a topmostwindow, to ensure that all owned windows stay abovetheir owner.
Sample: SAMPLES\\TestTop.prg
Source code: SOURCE\\WINAPI\\WndPos.c
See also: MoveWindow()
--------------------------------------------------------------------------------SetWindowText() Changes the caption of a Window--------------------------------------------------------------------------------
Syntax: SetWindowText( <hWnd>, <cText> ) --> nil
Parameters:
<hWnd> Identifies the window or the control whosetext is to be set.
<cText> The text to be set as new window text.
Returns: nil
Observations: This function causes a WM_SETTEXT message to besent to the given window or control.
If the window specified by the hwnd parameter is acontrol, the text within the control is set. If thespecified window is a list-box control created withWS_CAPTION style, however, SetWindowText will setthe caption for the control, not for the list-boxentries.
Sample: Class TWindow METHOD SetText()
Source code: SOURCE\\WINAPI\\SetText.c
See also: GetWindowText()
--------------------------------------------------------------------------------ShellAbout() Displays the typical Windows about DialogBox--------------------------------------------------------------------------------
<cTitle> The title of the about dialogbox. By defaultit shows "About".
<hIcon> The handle of the icon to show. By defaultit uses the first icon included inside the EXE asresource. It shows the typical Windows icon ifno icon is found.
Returns: nil
Observations: This function is also included now inside FiveWinas MsgAbout. We plan to remove this in nextversions and just keep MsgAbout for compatibilitywith FiveOS2 and fiveDos.
It is very usefull as it also shows the amountof memory and resources available.
Sample: SAMPLES\\Install.prg
Source code: SOURCE\\WINAPI\\About.c
See also: MsgAbout()
--------------------------------------------------------------------------------ShowWindow() Make the window show on the screen--------------------------------------------------------------------------------
<nMode> Specifies how the window is to be shown. Thisparameter can be one of the following values:
Value Meaning
SW_HIDE Hides the window and passes activation toanother window.
SW_MINIMIZE Minimizes the specified window andactivates the top-level window in thesystem's list.
SW_RESTORE Activates and displays a window. If thewindow is minimized or maximized, Windowsrestores it to its original size andposition (same as SW_SHOWNORMAL).
SW_SHOW Activates a window and displays it in itscurrent size and position.
SW_SHOWMAXIMIZED Activates a window and displays itas a maximized window.
SW_SHOWMINIMIZED Activates a window and displays itas an icon.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
SW_SHOWMINNOACTIVE Displays a window as an icon. Thewindow that is currently active remainsactive.
SW_SHOWNA Displays a window in its current state. Thewindow that is currently active remainsactive.
SW_SHOWNOACTIVATE Displays a window in its mostrecent size and position. The window that iscurrently active remains active.
SW_SHOWNORMAL Activates and displays a window. If thewindow is minimized or maximized, Windowsrestores it to its original size andposition (same as SW_RESTORE).
<lSuccess> A logical value indicating if the operationwas performed successfully.
Sample: Class TWindow METHOD Show()
Source code: SOURCE\\WINAPI\\WndShow.c
See also: IsWindowVisible()
--------------------------------------------------------------------------------SndPlaySound() Plays a WAV sound file from resources--------------------------------------------------------------------------------
<cSndName> Specifies the name of the sound stored atresources to play. It may be a string or a numericidentifier. To include a WAV file into an RC, youmust specify a new user defined resource type named"WAVE":
MyApp.rc
OKSOUND WAVE "OkSound.wav"
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<nMode> Specifies options for playing the sound using one ormore of the following flags:
SND_SYNC The sound is played synchronously and thefunction does not return until the soundends.
SND_ASYNC The sound is played asynchronously and thefunction returns immediately after beginningthe sound. To terminate anasynchronously-played sound, callsndPlaySound with cSndName set to 0.
SND_NODEFAULT If the sound can't be found, thefunction returns silently without playingthe default sound.
SND_MEMORY The parameter specified by cSndName to anin-memory image of a waveform sound.
SND_LOOP The sound will continue to play repeatedlyuntil sndPlaySound is called again with thecSndName parameter set to 0. You must alsospecify the SND_ASYNC flag to loop sounds.
SND_NOSTOP If a sound is currently playing, thefunction will immediately return FALSEwithout playing the requested sound.
<lSuccess> A logical value indicating if the operationwas performed successfully.
Sample: SAMPLES\\Lolo.prg
Source code: SOURCE\\WINAPI\\Sound.c
See also: SndPlaySound() MsgSound() MsgBeep() MessageBeep()
--------------------------------------------------------------------------------SndPlaySound() Plays a WAV sound file--------------------------------------------------------------------------------
<cSndName> Specifies the name of the sound to play. The functionsearches the [sounds] section of WIN.INI for an entrywith this name and plays the associated waveform file.If no entry by this name exists, then it assumes thename is the name of a waveform file. If thisparameter is 0, any currently playing sound isstopped.
<nMode> Specifies options for playing the sound using one ormore of the following flags:
SND_SYNC The sound is played synchronously and thefunction does not return until the soundends.
SND_ASYNC The sound is played asynchronously and thefunction returns immediately after beginningthe sound. To terminate anasynchronously-played sound, callsndPlaySound with cSndName set to 0.
SND_NODEFAULT If the sound can't be found, thefunction returns silently without playingthe default sound.
SND_MEMORY The parameter specified by cSndName to anin-memory image of a waveform sound.
SND_LOOP The sound will continue to play repeatedlyuntil sndPlaySound is called again with thecSndName parameter set to 0. You must alsospecify the SND_ASYNC flag to loop sounds.
SND_NOSTOP If a sound is currently playing, thefunction will immediately return FALSEwithout playing the requested sound.
<lSuccess> A logical value indicating if the operationwas performed successfully.
Sample: SAMPLES\\TestBmp2.prg
Source code: SOURCE\\WINAPI\\Sound.c
See also: MsgBeep() MessageBeep()
--------------------------------------------------------------------------------StartDoc() Start generating a new printing document--------------------------------------------------------------------------------
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<hDC> Identifies the device context for the print job.
Returns:
<nRetCode> The return value is positive if the function issuccessful. Otherwise it is SP_ERROR.
#define SP_ERROR (-1)
Source code: SOURCE\\WINAPI\\PrintDC.c
See also: Class TPrinter
--------------------------------------------------------------------------------StartPage() Start prinitng a new page--------------------------------------------------------------------------------
Syntax: StartPage( <hDC> ) --> <nRetCode>
Parameters:
<hDC> Identifies the device context for the print job.
Returns:
<nRetCode> The return value is positive if the function issuccessful.
Source code: SOURCE\\WINAPI\\PrintDC.c
See also: EndPage() StartDoc()
--------------------------------------------------------------------------------nStrCrc() Returns a CRC checksum for a text--------------------------------------------------------------------------------
Syntax: nStrCrc( <cText> ) --> nCRCValue
Parameters:
<cText> The text from where we want to generate a 32bits CRC checksum value.
Returns:
<nCRCValue> A numeric value with the checksum CRC.
Sample: MsgInfo( nStrCrc( "Hello world!" )
Source code: Not provided.
See also: nFileCrc()
--------------------------------------------------------------------------------StrToken() Returns a token from a string
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
<cText> The text from where we want to extract atoken.
<nOcurrence> The numeric ocurrence of the token inside<cText>.
<cSepChar> The character that separates the tokens.By default it is a space (" ").
Returns:
<cToken> The token we want to retrieve.
Sample: SAMPLES\\DbfBuild.prg
Source code: SOURCE\\FUNCTION\\StrToken.c
--------------------------------------------------------------------------------SysRefresh() Lets Windows process all pending messages--------------------------------------------------------------------------------
Syntax: SysRefresh() --> <lQuit>
Parameters: None.
Returns:
<lQuit> A logical value indicating if a WM_QUITmessage was issued, so the app should befinished.
Observations: This FiveWin function is extremelly important andhas no counterpart in standard Windows API.
SysRefresh() processes all pending messages,letting Windows keep controlling all itspending activities.
We must use SysRefresh() from inside thoseprocesses that may be time consuming.
The big benefit and advantadge of SysRefresh()is that it lets us keep doing 'standard' linearprogramming without having to send ourselvesmessages to keep processing a long task.
Use it in loops, seeks, and any time consumingprocesses to avoid Windows from losingprocessing control.
Sample: SAMPLES\\TestMMT.prg
Source code: Not provided.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------SysTime() Changes the time of the system--------------------------------------------------------------------------------
Syntax: SysTime( <nNewTime> ) --> nil
Parameters:
<nNewTime> The new time we want to set the systemtime to. It has to be provided in a 'long'( 4 bytes ) format.
Returns: nil
Source code: SOURCE\\FUNCTION\\SetDate.c
See also: SetDate()
--------------------------------------------------------------------------------TextOut() Draws text to a specified location--------------------------------------------------------------------------------
<lSuccess> A logical value indicating that the operationwas completed successfully.
Sample: CLASS TPrinter METHOD Say
Source code: SOURCE\\WINAPI\\Text.c
See also: ExtTextOut() WSay()
--------------------------------------------------------------------------------TimerCount() Returns the ellapsed time since the app started--------------------------------------------------------------------------------
Syntax: TimerCount() --> <aTimerInfo>
Parameters: None
Returns:
<aTimerInfo> An array that contains two numericvalues: { nMsSinceStart, nMsThisVM }
nMsSinceStart: It is the milliseconds sincethe app started.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
nMsThisVM: It is the milliseconds since theWindows virtual machine started (virtualmachine refers to Windows internal info andit is not at all something related to FiveWin).
Samples: SAMPLES\\TestTool.prg
Source code: SOURCE\\WINAPI\\ToolHelp.c
--------------------------------------------------------------------------------TreeBegin() FiveWin trees function support--------------------------------------------------------------------------------
<cBmpOpen> The name of the resourced bitmap to useas the open tree bitmap.
<cBmpClose> The name of the resourced bitmap to useas the close tree bitmap.
Returns:
<oTree> The just new created tree reference.
Observations: These functions are automatically managed byFiveWin trees creation xBase commands.
Sample: IDE\\SOURCE\\Menu.prg
Source code: SOURCE\\CLASSES\\Trees.prg
See also: Class TTreeItem Class TLinkList
--------------------------------------------------------------------------------_TreeItem() FiveWin trees function support--------------------------------------------------------------------------------
<lOpened> A logical value indicating if the treeitemoriginally is opened.
Returns:
<oTreeItem> A reference to the just new created treeitem.
Observations: These functions are automatically managed byFiveWin trees creation xBase commands.
Sample: IDE\\SOURCE\\Menu.prg
Source code: SOURCE\\CLASSES\\Trees.prg
See also: TreeBegin() TreeEnd()
--------------------------------------------------------------------------------TreeEnd() FiveWin trees function support-------------------------------------------------------------------------------
Syntax: TreeEnd() --> nil
Parameters: None
Returns: nil
Observations: These functions are automatically managed byFiveWin trees creation xBase commands.
Sample: IDE\\SOURCE\\Menu.prg
Source code: SOURCE\\CLASSES\\Trees.prg
See also: TreeBegin() TreeEnd()
--------------------------------------------------------------------------------uCharToVal() Converts any value into a character string--------------------------------------------------------------------------------
--------------------------------------------------------------------------------uLoadStruct() Restore an array or an object from disk--------------------------------------------------------------------------------
Syntax: uLoadStruct( <cObjFile> ) --> <oObject>
Parameters:
<cObjFile> The name of a file on disk which containsan array or an object previously saved withlSaveStruct().
Returns:
<oObject> A reference of the array or the objectjust beeing created.
Observations: In order to let Clipper properly rebuild aspecific class object, an external referenceto that class must be specified.
// Place this at the beginning of your app// change TWindow for the name of the class// of that object
extern TWindow
Source code: Not provided.
See also: lSaveStruct()
--------------------------------------------------------------------------------UnZipFile() UnZips a file from the ZIP file--------------------------------------------------------------------------------
<cZipFileName> The name of the ZIP file from where to extract<cFileName>.
<cFileName> The name of the file to extract from the ZIPfile.
<nFileOffset> The offset inside the ZIP file where thisfile to extract is located. It is the seventhitem of the array returned by GetFirstInZip() andGetNextInZip() functions.
<hWnd> The handle of the window or Dialog whereInfo-Unz.dll will report the unzip progress. Thiswindow will automatically evaluate its DATA bUnZipcodeblock:
<oWnd>:bUnZip = { | nPercent | ... }
From that codeblock you may update a Meter control,
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------UpdateWindow() Updates the client area of a window--------------------------------------------------------------------------------
Syntax: UpdateWindow( <hWnd> ) --> nil
Parameters:
<hWnd> Identifies the window to be updated.
Returns: nil
Observations: This function sends a WM_PAINT to thewindow forcing it to be repainted.
Sample: SOURCE\\CLASSES\\Window.prg
Source code: SOURCE\\WINAPI\\WndUpdat.c
See also: CLASS TWindo METHOD Refresh()
--------------------------------------------------------------------------------uValBlank() Returns the correspondent blank value of any variable--------------------------------------------------------------------------------
Syntax: uValBlank( <uValue> ) --> <uBlankValue>
Parameters:
<uValue> A variable whose value is to be blanked.
Returns:
<uBlankValue> The same value but blanked.
Source code: SOURCE\\FUNCTION\\ValBlank.prg
See also: cValToChar() uCharToVal()
--------------------------------------------------------------------------------WaitRun() Executes another Windows application and waits--------------------------------------------------------------------------------
<nCmdLine> A string that contains the command lineto execute. If it does not contains a path,then Windows searches in this order:
1 The current directory.
2 The Windows directory (the directorycontaining WIN.COM); the GetWinDir()function retrieves the path of this directory.
3 The Windows system directory (the directorycontaining such system files as GDI.EXE); theGetSysDir() function retrieves the path ofthis directory.
4 The directory containing the executable filefor the current task; the GetModuleFileNamefunction retrieves the path of this directory.
5 The directories listed in the PATH environmentvariable.
6 The directories mapped in a network.
<nCmdShow> Specifies how the windows application has to beshown. See ShowWindow() for a description of allpossible values.
Returns:
<hInstance> The return value identifies the instance of theloaded module, if the function is successful.Otherwise, the return value is an error value lessthan 32:
0 System was out of memory, executable file wascorrupt, or relocations were invalid.
2 File was not found.
3 Path was not found.
5 Attempt was made to dynamically link to atask, or there was a sharing ornetwork-protection error.
6 Library required separate data segments foreach task.
8 There was insufficient memory to start theapplication.
10 Windows version was incorrect.
11 Executable file was invalid. Either it wasnot a Windows application or there was anerror in the .EXE image.
12 Application was designed for a different
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
15 Attempt was made to load a real-modeapplication (developed for an earlier versionof Windows).
16 Attempt was made to load a second instanceof an executable file containing multipledata segments that were not marked read-only.
19 Attempt was made to load a compressedexecutable file. The file must be decompressedbefore it can be loaded.
20 Dynamic-link library (DLL) file was invalid.One of the DLLs required to run thisapplication was corrupt.
21 Application requires 32-bit extensions.
Observations: This function works exactly as WinExec() withthe difference that it waits for the new task issuedto finish.
Sample: SAMPLES\\FwBrow.prg
Source code: SOURCE\\WINAPI\\WinExec.c
See also: ShowWindow() WinExec()
--------------------------------------------------------------------------------WBrwScroll() Scroll some text lines in a window--------------------------------------------------------------------------------
--------------------------------------------------------------------------------WindowFromPoint() Retrieves the window which is at certain position--------------------------------------------------------------------------------
<hWnd> The handle of the window where the point is.
Observations: The WindowFromPoint function does not retrievethe handle of a hidden, disabled, or transparentwindow, even if the point is within the window. Anapplication should use the ChildWindowFromPointfunction for a nonrestrictive search.
Sample: SAMPLES\\NewHelp.prg
Source code: SOURCE\\WINAPI\\WndPt.c
See also: ChildWindowFromPoint()
--------------------------------------------------------------------------------WinExec() Executes another Windows application--------------------------------------------------------------------------------
<nCmdShow> Specifies how the windows application has to beshown. See ShowWindow() for a description of allpossible values.
Returns:
<hInstance> The return value identifies the instance of theloaded module, if the function is successful.Otherwise, the return value is an error value lessthan 32:
0 System was out of memory, executable file wascorrupt, or relocations were invalid.
2 File was not found.
3 Path was not found.
5 Attempt was made to dynamically link to atask, or there was a sharing ornetwork-protection error.
6 Library required separate data segments foreach task.
8 There was insufficient memory to start theapplication.
10 Windows version was incorrect.
11 Executable file was invalid. Either it wasnot a Windows application or there was anerror in the .EXE image.
12 Application was designed for a differentoperating system.
13 Application was designed for MS-DOS 4.0.
14 Type of executable file was unknown.
15 Attempt was made to load a real-modeapplication (developed for an earlier versionof Windows).
16 Attempt was made to load a second instanceof an executable file containing multipledata segments that were not marked read-only.
19 Attempt was made to load a compressedexecutable file. The file must be decompressedbefore it can be loaded.
20 Dynamic-link library (DLL) file was invalid.One of the DLLs required to run thisapplication was corrupt.
21 Application requires 32-bit extensions.
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Observations: The LoadModule() function provides an alternativemethod for running an application.
Sample: SAMPLES\\FwBrow.prg
Source code: SOURCE\\WINAPI\\WinExec.c
See also: ShowWindow() LoadModule()
--------------------------------------------------------------------------------WinHelp() Activates Windows WinHelp program--------------------------------------------------------------------------------
cHelpFile Name of the help file to use. Those files haveHLP extension and use a Windows own format.
nHelpType Selects the kind of service to execute. Windowsoffers multiple services through this functionso it may be quite confusing to obtain all itsposibilities. This is the reason why we havecreated Help...() functions, which are specialfunctions based on WinHelp().
ncAditionalData Certain parameters acording to the requestedWinHelp() service.
Descrption
Windows implements all its help system through WinHelp() function.This function calls WINHELP.EXE which is who manipulate HLP files.
Code: SOURCE\\WINAPI\\Help.c
--------------------------------------------------------------------------------WndBox() Draws a box around--------------------------------------------------------------------------------
--------------------------------------------------------------------------------WndBoxIn() Draws a inset 3D box--------------------------------------------------------------------------------
<hDC> Identifies the handle of the device context.
<nTop>, The coordinates of the box to draw.<nLeft>,<nBottom>,<nRight>
Returns: Nil
Sample: SAMPLES\\ToolTip.prg
Source code: SOURCE\\FUNCTION\\WndBoxes.c
See also: WndBoxIn() WndBoxRaised()
--------------------------------------------------------------------------------WndBoxRaised() Draws a box raised--------------------------------------------------------------------------------
<hDC> Identifies the handle of the device context.
<nTop>, The coordinates of the box to draw.<nLeft>,<nBottom>,<nRight>
Returns: Nil
Sample: SAMPLES\\ToolTip.prg
Source code: SOURCE\\FUNCTION\\WndBoxes.c
See also: WndBoxIn() WndBoxRaised()
--------------------------------------------------------------------------------WndCenter() Centers a window on the screen--------------------------------------------------------------------------------
--------------------------------------------------------------------------------WndCopy() Copy a window image to the clipboard--------------------------------------------------------------------------------
Syntax: WndCopy( <hWnd> [,<lAll>] ) --> nil
Parameters:
<hWnd> Identifies the handle of the window whoseimage is going to be placed at the clipboard.
<lAll> An optional logical value indicating if allthe window area is to be copied or just thewindow client area. By default only the clientarea gets copied.
Returns: nil
Source code: SOURCE\\WINAPI\\WndMove.c
See also: Class TClipBoard WndPrint()
--------------------------------------------------------------------------------WndPrint() Prints the image of a window--------------------------------------------------------------------------------
--------------------------------------------------------------------------------WndRaised() Makes the border of a window look raised--------------------------------------------------------------------------------
Syntax: WndRaised( <hWnd>, <hDC> ) --> nil
Parameters:
<hWnd> Identifies the window to make it look raised.
<hDC> The device context of the window.
Returns: nil
Sample: CLASS TBar METHOD Paint()
Source code: SOURCE\\FUNCTION\\WndBoxes.c
See also: WndBox() WndBoxIn()
--------------------------------------------------------------------------------WNetBrowse() Shows a DialogBox to browse resources in a Net--------------------------------------------------------------------------------
See also: WNetGetUser() WNetError() WNetGetErrorText()
--------------------------------------------------------------------------------WNetError() Retrieves the latest Net error--------------------------------------------------------------------------------
Syntax: WNetError() --> <nErrorCode>
Parameters: None.
Returns:
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
See also: WNetGetUser() WNetError() WNetGetErrorText()
--------------------------------------------------------------------------------WNetGetUser() Retrieves the actual local Net user--------------------------------------------------------------------------------
Syntax: WNetGetUser() --> <cUserName>
Parameters: None
Returns:
<cUserName> The name of the current station user.
Sample: SAMPLES\\TestNet.prg
Source code: SOURCE\\WINAPI\\Net.c
See also: WNetGetUser() WNetError() WNetGetErrorText()
--------------------------------------------------------------------------------WritePProString() Writes an entry in a private INI file--------------------------------------------------------------------------------
<cSection> Specifies the section containing the entry.
<cEntry> The entry whose value is to written.
<cString> The text value to set into the INI.
<cFileName> The name of the private INI file.
Returns:
<lSuccess> A logical value indicating if the operationwas performed successfully.
Sample: SAMPLES\\TestIni.prg
Source code: SOURCE\\WINAPI\\Profile.c
See also: WriteProfString()
--------------------------------------------------------------------------------WriteProfString() Writes an entry in WIN.INI public file--------------------------------------------------------------------------------
<aParams> An array containing all the values tobe displayed on the screen.
Returns: nil
Sample: SAMPLES\\TestBVbx.prg
Source code: SOURCE\\FUNCTION\\WQOut.prg
See also: Msg...() functions
--------------------------------------------------------------------------------WriteComm() Writes to the communication port--------------------------------------------------------------------------------
--------------------------------------------------------------------------------WScroll() Scrolls some text rows of a window--------------------------------------------------------------------------------
<hWnd> Identifies the window whose area is to be scrolled.
<nRows> Specifies the number of text rows to scroll.
<hFont> The handle of the font to calculatethe text height.
Returns: nil
Sample: SOURCE\\CLASSES\\WBrowse.prg
Source code: SOURCE\\WINAPI\\WndScrol.c
See also: WBrwLine() WBrwRows()
--------------------------------------------------------------------------------xPadL() Left fills a string up to a certain pixel dimension--------------------------------------------------------------------------------
<cText> The text whose character length is to beadjusted.
<nPixels> The total length in pixels.
<cChar> An optional character to use to fillby the left side the <cText> string.
Returns:
<cNewText> A new string whose left side has beenadded with extra <cChar> characters to reachthe <nPixels> size.
Sample: SOURCE\\CLASSES\\WBrowse.prg
Source code: SOURCE\\FUNCTION\\xPad.prg
See also: xPadC() xPadR()
--------------------------------------------------------------------------------xPadC() Center fills a string up to a certain pixel--------------------------------------------------------------------------------
<cChar> An optional character to use to fillby both sides the <cText> string.
Returns:
<cNewText> A new string whose extremes side has beenadded with extra <cChar> characters to reachthe <nPixels> size.
Sample: SOURCE\\CLASSES\\WBrowse.prg
Source code: SOURCE\\FUNCTION\\xPad.prg
See also: xPadL() xPadR()
--------------------------------------------------------------------------------xPadR() Right fills a string up to a certain pixel dimension--------------------------------------------------------------------------------
<cText> The text whose character length is to beadjusted.
<nPixels> The total length in pixels.
<cChar> An optional character to use to fillby right side the <cText> string.
Returns:
<cNewText> A new string whose right side has beenadded with extra <cChar> characters to reachthe <nPixels> size.
Sample: SOURCE\\CLASSES\\WBrowse.prg
Source code: SOURCE\\FUNCTION\\xPad.prg
See also: xPadC() xPadL()
--------------------------------------------------------------------------------FiveWin Functions - classified by cathegory--------------------------------------------------------------------------------ClipboardOpenClipboard() Open the Windows clipboard before use .CloseClipboard() Closes the clipboard .SetClpData() Places data at the clipboard .GetClpData() Retrieves the handle of the current clipboard data .EmptyClipboard() Empties the clipboard .
ColorChooseColor() Color selection standard DialogBox .nColorToN() Convert color string to DOS color number .nRGB() Generates a RGB value .nGetForeRGB() Returns the RGB Fore value of a color string .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
nGetBackRGB() Returns the RGB Back value of a color string .GetPixel() Returns the RGB color of a pixel .SetTextColor() Set the specified text color .SetBkColor() Set the specified background color .SetBkMode() Set the specified background mode .GetTextColor() Returns the current text color .GetBkColor() Returns the current background color .GetSysColor() Retrieves the system color element specified .
CommunicationsOpenComm() Open the communication port before use .CloseComm() Closes the communication device and frees memory .ReadComm() Read the contents of the communication port .FlushComm() Flushes all characters from transmision or receiving .GetCommError() Retrieves the most recent comm error value .BuildCommDCB() Translates a device string into a control block .WriteComm() Writes to the communication port .EnableCommNotification() Enables the automatic notification of msgs .
Date / TimeSetDate() Changes the date of the system .SetTime() Changes the time of the system .
Debugging facilitiesLogFile() Saves information to a log file .OutputDebugString() Displays a debugging msg at Microsoft dbwin.exe .WinInspect() Sets a codeblock to eval on each Windows API msg .
DialogBoxesCreateDlg() Creates a modeless DialogBox from resources .CreateDlgIndirect() Creates a modeless DialogBox from memory resources .DialogBox() Creates a modal dialog box from resources .DialogBoxIndirect() Creates a modal dialog box from memory resources .EndDialog() Closes a modal DialogBox and frees resources .GetDialogBaseUnits() Returns the DialogBox base units used to create it .GetDlgItem() Retrieves the handle of a control .MapDialogRect() Converts dialogbox units into screen units (pixels) .nDlgBox() Automatic DialogBox testing function. .
Directories maintenanceCurDrive() Returns the current selected drive as a letter A,B,C..aDrives() Returns an array with all the valid drives ids .IsCdRom() Checks if a drive is a CdRom .IsDiskette() Checks if a drive is a floppy disk .lChDir() Changes from one directory to another .lIsDir() Checks the existence of a directory .lMkDir() Creates a new directory .lRmDir() Removes a directory .GetWinDir() Retrieves the Windows directory path .GetSysDir() Retrieves the Windows system directory path .
DLLsLoadLibrary() Load a Dynamic link library to use it .FreeLibrary() Free a DLL library in use or decrements its counter useGetProcAddress() Retrieves the address of the given module function .CallDll() Calls a function placed into a DLL .
DrawingArc() Draws an elliptical arc .Chord() Draws a chord .Ellipse() Draws an ellipse .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
FloodFill() Fills an area of the screen .LineTo() Draws a line from the current position up to another .MoveTo() Changes the origin point to start drawing a line .Pie() Draws a pie-shaped wedge drawing an elliptical arc .PolyPolygon() Draws several polygons .Rectangle() Draws a graphic rectangle .Say3D() Draws a 3D look text .WndBoxIn() Draws an inset 3D rectangle .WndBoxRaised() Draws a raised 3D rectangle .WndRaised() Makes a control look raised .
Executing other appsWaitRun() Executes another windows application (waits) .WinExec() Executes another windows application (no waits) .ExitWindowsExec() Exit windows, exec a Dos app, returns Windows ( " ) .
Files managementcFileDisk() Retrieves the drive from a filename with path .cFileExt() Retrieves the extension from a filename .cFileMask() Retrieves the mask from a filename if specified .cFileName() Retrieves the filename without its path .cFileNoExt() Retrieves the filename without path and extension .cFileNoPath() Retrieves the filename without path (as cFileName()) .cFilePath() Retrieves the path from a filename with path .cFileSubDir() Retrieves the subdir name from a filename .cNewFileName() Retrieves a new filename using a rootname .cTempFile() Retrieves a temporary new filename .FSize() Retrieves the size of a filename without opening it .LzCopyFile() Copies and expands a Windows compressed file .GetFTime() Retrieves the time and date of a file .SetFTime() Set a different time and date for a file .SetHandleCount() Increases the max number of files to open .
Help Files ManagementGetHelpFile() Retrieves the default help file selected .GetHelpTopic() Retrieves the default help Topic .HelpIndex() Shows the default help file index .HelpPopup() Shows the context popup help .HelpSearch() Search DialogBox in the default Help file .HelpSetPos() Changes the position of the WinHelp Window .HelpSetTopic() Selects a help defaut topic .HelpTopic() Reviews a Topic .SetHelpFile() Selects the default Help File .WinHelp() Activates Windows WinHelp program .
IconsnIcons() Returns the number of icons .LoadIcon() Load the specified resource icon .ExtractIcon() Retrieves an icon handle from EXE, DLL or ICO .DrawIcon() Draws an Icon .
INI FilesGetProfInt() Retrieves the value of a integer Win.ini file entry .GetProfStr() Retrieves the value of a string Win.ini file entry .GetPvpProfile() Retrieves the value of a integer private INI file entryGetPvpProfString() Retrieves the value of a string private INI file .WriteProfS() Writes an entry in WIN.INI public file .WritePProString() Writes an entry in a private INI file .
KeyboardGetASyncKeyState() Returns whether a key is up or down .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
GetKeyState() Retrieves the state of the specified virtual key .GetKeyToggle() Returns the state of a toggled key .KeyToggle() Toggles the specified key .
Memory/Variables useMemMax() Returns the highest dynamic memory consumed .MemUsed() Returns the actual dynamic memory consumed .nStatics() Returns the total number of statics variables .Static() Returns any static variable of the application .GetLocal() Retrieves any local variable from the stack .GetParam() Retrieves any parameter value from the stack .nFreeStack() Returns the remaining Clipper stack available .
MouseSetCapture() Captures all the mouse activity for a window .ReleaseCapture() Let the other applications use the mouse .GetCapture() Retrieves the window handle that has the mouse captured
NTX/MDX files managementDelDbfMdx() Resets the MDX file existence at a DBFMDX Dbf file .cNtxKey() Return the key description of a NTX index file .NtxPos() Returns the relative position of a recno .
Numeric manipulationB2Bin() Converts a byte into a string 1 byte len .C2Hex() Converts a byte into a hex string (2 chars) .D2Bin() Converts a float into a string 8 bytes len .I2Hex() Converts a word (2 bytes) into a hex string (4 chars).L2Hex() Converts a long (4 bytes) into a hex string (8 chars).lAnd() Retrieves the logical AND of some numeric values .nAnd() Generates a numeric AND value from some numbers .nOr() Generates a numeric OR value from some numbers .nHiByte() Returns the High Byte of a word (two bytes) .nLoByte() Returns the Low byte of a word (two bytes) .nHiWord() Returns the HiWord of a long (four bytes) .nLoWord() Returns the Low word of a long (four bytes) .nMakeLong() Generates a long (4bytes) from two words (2bytes) .MakeIntResource() Converts an integer resource ID in a Windows format .nStrHash() Returns a hasing algorithm on a string .nRandom() Generates a random number .
OemAnsiAnsiToOem() Windows string to OEM conversion .IsAnsi() Is it an ansi string .IsOem() Is it an oem string .OemToAnsi() OEM string to Windows string .
OOPSaOData() Returns an array with all an Object Class DATA names .OClone() Retrieves a duplicated Clipper object .OSend() Generic messages Object sending function .ASend() Generic messages array of Objects sending function .lSaveObject() Saves an object to disk .uLoadObject() Restores an object from disk .lSaveVar() Saves an array to disk .uLoadVar() Restores an array from disk .
Security/Copy ProtectionnStrCRC() Returns the checksum of a text .nFileCRC() Returns the checksum of a file .Encrypt() Encrypts a text with an optional key .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
Decrypt() Decrypts a text with an optional key .nSerialHD() Returns the hardDisk serial number .
SoundMessageBeep() Plays a system alert level waveform sound or a tone .MsgBeep() MessageBeep beep tone .SndPlaySound() Plays a WAV sound file .SndPlayRes() Plays a WAV sound file from resources .
StringscValToChar() Converts any value into a string .OemToAnsi() Translates a OEM MsDos string into a Windows string .AnsiToOem() Translates a Window string into the OEM MsDos .xPadL() Left fills a string up to a certain pixel dimension .xPadC() Center fills a string up to a certain pixel " .xPadR() Right fills a string up to a certain pixel dimension .B2Bin() Converts a byte into a string 1 byte len .StrCapFirst() Uppercase first char and lowercase the rest .StrChar() Extract a single char from a string .StrToken() Extract a token from inside a string .
SystemInportByte() Reads a byte from a hardware port .InportWord() Reads a word from a hardware port .nPeekByte() Reads a memory byte .nPeekWord() Reads a memory word .nPokeByte() Writes a memory byte .nPokeWord() Writes a memory word .OutportByte() Sends a byte to a hardware port .OutportWord() Sends a word to a hardware port .SysRefresh() Let Windows system process pending messsages .GetTasks() Returns an array with all active tasks names .IsWinNT() Checks for Windows NT .
TimersSetTimer() Installs a system timer .KillTimer() Removes the specified timer .
User Quick DialogBoxesMsgAbout() MessageBox about style .MsgAlert() MessageBox alert style .MsgBeep() MessageBeep beep tone .MsgGet() General one-line input message .MsgInfo() MessageBox information style .MsgLogo() Displays an initial floating bitmap .MsgMeter() General meter progress dialog .MsgStop() MessageBox stop style .MsgRetryCancel() MessageBox RetryCancel style .MsgRun() Shows a DialogBox with a msg and executes an action .MsgToolBar() General Tool-bar style Dialog .MsgWait() Shows a DialogBox with a msg and waits some time .MsgNoYes() MessageBox YesNo style with default No .MsgYesNo() MessageBox YesNo style .
ZIP files management (only UnZip capabilities)IsZip() Checks a valid ZIP file .GetFirstInZip() Retrieves info for the first file in the ZIP file .GetNextInZip() Retrieves info for the next file in the ZIP file .CloseZipFile() Closes the ZIP file .UnZipFile() UnZips a file from the ZIP file .
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
--------------------------------------------------------------------------------FiveWin Header Files--------------------------------------------------------------------------------Colors.ch Color constants definitionsConstant.ch Text to Graphics constants definitionsDDE.ch Commands for Dynamic Data ExchangeDialog.ch Dialog BoxesDLL.ch Dynamic Linking Libraries calling at RunTimeFiveWin.ch FiveWin main header fileFolder.ch Folders and Tabs managementFont.ch Fonts managementIni.ch INI FilesMail.ch Windows MAPI email supportMenu.ch Managing MenusObjects.ch Object Oriented Engine of FiveWinODBC.ch Open DataBase connectivity supportPrint.ch Using the PrinterReport.ch Report engineSQL.ch ODBC headerTcBrowse.ch Column based new BrowseTree.ch Trees supportVideo.ch Video media AVI SupportVKey.ch Windows keys valuesWinApi.ch Windows API definitionsClipApi.h Clipper internal management declarationsWinTen.h To avoid conflicts with Windows API Pascal names
--------------------------------------------------------------------------------Colors.ch Color constants definitions--------------------------------------------------------------------------------// FiveWin Graphical Enviroments RGB colors management
//----------------------------------------------------------------------------//// High Intensity Colors//----------------------------------------------------------------------------//
#endif--------------------------------------------------------------------------------Constant.ch Text to Graphics constants definitions--------------------------------------------------------------------------------#ifndef _CONSTANT_CH#define _CONSTANT_CH
--------------------------------------------------------------------------------DDE.ch Commands for Dynamic Data Exchange--------------------------------------------------------------------------------#ifndef _DDE_CH#define _DDE_CH
--------------------------------------------------------------------------------Ini.ch INI Files--------------------------------------------------------------------------------#ifndef _INI_CH#define _INI_CH
--------------------------------------------------------------------------------Mail.ch Windows MAPI email support--------------------------------------------------------------------------------// FiveWin - Windows MAPI - mail services - xBase Commands
--------------------------------------------------------------------------------Objects.ch Object Oriented Engine of FiveWin--------------------------------------------------------------------------------/*+---------------------------------------------------------------+| Objects.ch || || Clipper 5.x header file for Objects.lib V 4.0 || Fecha: Junio 1995 || || (c) 1993-4-5 Francisco Pulp.n y Antonio Linares |+---------------------------------------------------------------+
. Dios libre al Sr. Usuario de cambiar una sola linea deeste fichero sin haber hecho antes una copia de seguridad !
. Please, don't touch even a single line of the following <g> !*/
// El servidor particular de errores de una clase.
// Funcion Clipper. recibe: ( cMethodName, nError ) y Objeto en SELF// puede devolver cualquier cosa.// para que se genere error debe llamar antes de salir a// _ClsSetErr( oError ) y si no se debe generar error debe hacerlo as.// _ClsSetErr( )
// Declaraciones para el c.digo ( funci.n . procedimiento ) de los m.todos.// ==========================================================================
// Redefine el comando METHOD para la declaraci.nes de m.todos// en el bloque de clase.// Fue redefinido por el .ltimo "endclass" para declarar c.digo de m.todos.
--------------------------------------------------------------------------------Print.ch Using the Printer--------------------------------------------------------------------------------#ifndef _PRINT_CH#define _PRINT_CH
#xcommand ACTIVATE REPORT <oReport> ;[ FOR <for> ] ;[ WHILE <while> ] ;[ ON INIT <uInit> ] ;[ ON END <uEnd> ] ;[ ON POSTEND <uPostEnd> ] ;[ ON STARTPAGE <uStartPage> ] ;[ ON ENDPAGE <uEndPage> ] ;[ ON POSTPAGE <uPostPage> ] ;[ ON STARTGROUP <uStartGroup> ] ;[ ON ENDGROUP <uEndGroup> ] ;[ ON POSTGROUP <uPostGroup> ] ;[ ON STARTLINE <uStartLine> ] ;[ ON ENDLINE <uEndLine> ] ;[ ON CHANGE <bChange> ] ;
//campos en el array de definicion de los campos de una consulta#define SQLNAME 1#define SQLCTYPE 2#define SQLLEN 3#define SQLDEC 4#define SQLNULL 5#define SQLNTYPE 6
#define SQL_BIND_BY_COLUMN 0 /* Suboption for SQL_BIND_TYPE */
--------------------------------------------------------------------------------TcBrowse.ch Column based new Browse--------------------------------------------------------------------------------** Last revision: May 29, 1995 at 10:03
--------------------------------------------------------------------------------Tree.ch Trees support--------------------------------------------------------------------------------// Trees for FiveWin !!! Incredible powerfull !!!
#ifndef _TREE_CH#define _TREE_CH
#xcommand TREE [<oTree>] ;[ BITMAPS <cBmpOpen>, <cBmpClose> ] ;
--------------------------------------------------------------------------------Video.ch Video media AVI Support--------------------------------------------------------------------------------#ifndef _VIDEO_CH#define _VIDEO_CH
--------------------------------------------------------------------------------WinApi.ch Windows API definitions--------------------------------------------------------------------------------#ifndef _WINAPI_CH#define _WINAPI_CH
#include "FwMsgs.h" // User defined FiveWin new Windows messages
typedef BYTE far * LPBYTE;typedef char far * LPSTR;typedef WORD * PWORD;typedef WORD far * LPWORD;typedef LONG * PLONG;typedef LONG far * LPLONG;typedef DWORD* PDWORD;typedef DWORD far * LPDWORD;
WORD _gtBox( WORD, WORD, WORD, WORD, LPSTR );WORD _gtColorSelect( WORD wColor ); // __color() in 5.01WORD _gtMaxRow( void );WORD _gtMaxCol( void );WORD _gtSetColor( CLIPCOLOR * pColors );WORD _gtGetColor( CLIPCOLOR * pColors );WORD _gtSetPos( WORD wRow, WORD wCol );WORD _gtGetPos( WORD * pwRow, WORD * pwCol );WORD _gtScroll( WORD, WORD, WORD, WORD, int );WORD _gtWriteAt( WORD wRow, WORD wCol, LPSTR szText, WORD wLen );WORD _gtWrite( LPSTR szText, WORD wLen );WORD _gtWriteCon( LPSTR szText, WORD wLen );WORD _gtSave( WORD wTop, WORD wLeft, WORD wBottom, WORD wRight, LPBYTE pBuffer);WORD _gtScrDim( LPWORD pwRows, LPWORD pwCols );WORD _gtRest( WORD wTop, WORD wLeft, WORD wBottom, WORD wRight, LPBYTE pBuffer);WORD _gtRectSize( WORD wTop, WORD wLeft, WORD wBottom, WORD wRight, LPWORDwResult );WORD _gtRepChar( WORD wRow, WORD wCol, WORD wChar, WORD wTimes );
// Undocumented Windowing System !!!
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
// Selects a color - Clipper calling conventionsextern void _color( void );
// extended GT - RUNsoftvoid _gtShadow( WORD wTop, WORD wLeft, WORD wBottom, WORD wRight );void _gtClrReverse( WORD wColor );void _gtSayHot( WORD wRow, WORD wCol, LPSTR szText, WORD wClrNormal, WORDwClrHot );WORD _gtClrGet( WORD wColor );
extern WORD _tcreat( LPSTR szFileName, WORD wMode );extern BOOL _tclose( WORD wHandle );extern WORD _topen( LPSTR szFileName, WORD wMode );extern LONG _tlseek( WORD wHandle, LONG lRecNo, WORD wPosition );extern WORD _tread( WORD wHandle, LPBYTE cBuffer, WORD wBytes );extern WORD _twrite( WORD wHandle, LPBYTE cBuffer, WORD wBytes );
////////////////////////////////////////////////////////////////////////////// STACK and OM Module - Clipper internal stack and ClipVars management //////////////////////////////////////////////////////////////////////////////
// it stores the return value of a function // return ...extern PCLIPVAR _eval;
// _lbase + 1 --> Self from within Methods ! Reach it with _par...( 0, ... ) !// _lbase + 2 --> First parameter// _lbase + 3 --> Second parameter// ...extern PCLIPVAR _lbase; // LOCAL BASE
// staticsextern PCLIPVAR _sbase; // STATIC BASE
// Clipper Stack tos = TO S tackextern PCLIPVAR _tos;
// They automatically update _tos.extern void _PutC( LPSTR szText );extern void _PutCL( LPSTR szText, WORD wLen );extern void _PutQ( WORD wNumber );extern void _PutLN( LONG lNumber );extern void _PutL( BOOL );
// Places any CLIPVAR at Clipper Stack. Pass ClipVars by value.// Automatically updates _tosextern void _xPushM( LPCLIPVAR );
// calling Clipper from Cextern void _PutSym( PCLIPSYMBOL );// ( ++_tos )->wType = NIL; <-- We place nil at Self !!!
PDF Creator - PDF4Free v2.0 http://www.pdf4free.com
// we place other params with _Put...extern void _xDo( WORD wParams );
// executing CodeBlocks
// _PutSym( _symEVAL );extern void _xEval( WORD wNumberOfParameters );
// eval a codeblock with no paramsextern void _cEval0( PCLIPVAR CodeBlock ); // evalua codeblock sin parametros.extern void _cEval1( PCLIPVAR CodeBlock, PCLIPVAR Param1 ); // idem con unpar.metro.
// same but with one param
extern PCLIPVAR _GetGrip( PCLIPVAR ); // allocates new clipvar in high stackpos.extern void _DropGrip( PCLIPVAR ); // free it.
// Returns pointer to _lbase of calls stack, 0->this, 1->previous, ...extern PCLIPVAR _ActInfo( WORD wIndex );
extern WORD _sptoq( PCLIPVAR ); // Returns the value of a number placed at_tos
// By value or by ref as WORDextern LONG _sptol( PCLIPVAR ); // IDEM as LONG
// Copy wBytes from Source to Destinationextern void _bcopy( LPBYTE pDest, LPBYTE pSource, WORD wBytes );
// Inicializes wLen Bytes with the value wValueextern void _bset( LPBYTE pStart, WORD wValue, WORD wLen );
// Retrieves an element of an arrayextern void _cAt( PCLIPVAR vArray, WORD wIndex, WORD wFlag, PCLIPVAR vDest );
// Changes an element of an arrayextern void _cAtPut( PCLIPVAR vArray, WORD wIndex, PCLIPVAR vSource );
// Stores a String into an array elementextern void _cAtPutStr( PCLIPVAR vArray, WORD wIndex, LPSTR szString,
WORD wStrLen );
// Strings// Creates a new String. Stores a CLIPVAR at _evalextern void pascal _BYTESNEW( WORD wLenBytes );
// Locks a CLIPVAR String to access its bytes// if need unlock returns TRUEextern BOOL pascal _VSTRLOCK( PCLIPVAR vString );
// Gets the LPSTR of the String. It must be locked before with _VSTRLOCKextern LPSTR pascal _VSTR( PCLIPVAR vString );
// UnLocks the Stringextern void pascal _VSTRUNLOCK( PCLIPVAR vString );
// Creates a new ClassLONG _mdCreate( WORD wMethods, PCLIPSYMBOL pClassName );
// Adds a new Method to a ClassHextern _mdAdd( LONG lClassHandle, PCLIPSYMBOL pMethodName, PCLIPFUNC pMethod );
// Gets the function address of a method// Message info must be placed at ( _lbase + 0 )->pMsg// Self must be placed at _lbase + 1extern PCLIPFUNC _isendp( void );
// Retrieves the ClassH of an Objectextern LONG _VDict( PCLIPVAR );
// Changes the ClassH of an Object or Arrayextern void _VSetDict( PCLIPVAR, LONG lClassHandle );
void _xSend( WORD wNumberOfParameters ); // The missing xSend function
//////////////////////////////////////////////// EVENT Module - Clipper internally is event-driven !!!//////////////////////////////////////////////
typedef struct{
WORD wDymmy;WORD wMessage;
} EVENT;
typedef EVENT * PEVENT;
typedef WORD ( far * EVENTFUNCP ) ( PEVENT pEvent );
// Register a new Event Handlerextern WORD _evRegReceiverFunc( EVENTFUNCP pFunc, WORD wType );
extern void _evDeRegReceiver( WORD wHandlerOrder );
extern void _evSendId( WORD wMessage, WORD wHandlerOrder ); // 0xFFFF a Todosextern WORD _evRegType( DWORD, DWORD, WORD );extern void _evPostId( WORD evId, WORD wReceiverHandle );
WORD GetWndApp( void ); // Devuelve Handle Objeto ventana principal// retrieves Main Object Window handle
--------------------------------------------------------------------------------WinTen.h To avoid conflicts with Windows API Pascal names--------------------------------------------------------------------------------#ifndef _WINTEN_H#define _WINTEN_H
#ifndef __FLAT__
// WinTen.h - Is to avoid conflicts between Clipper and Windows API// functions with names of 10 characters or less.
// If you are going to develop some new C function to conect the API,// check that it is here, if length 10 characters or less, and include// it here if not