Be more productive with GdiPlusX

As I've read in one of Doug Hennig's great whitepapers, "IntelliSense, added in version 7, was likely the biggest productivity improvement ever added to VFP. It almost entirely eliminates the need to bring up the VFP help, even for little used commands and functions, because of how it provides tips on clauses and parameters in a context-sensitive manner".

When working with an extense library such as GdiPlus-X, Intellisense becomes really very important, because using it we can see easilly all the properties and methods for the current object. At this moment, there's no custom script for GdiPlus-X. However, we still can take huge benefits from that.

To see it working follow these steps:

1 - In the Command Window, or when initializing VFP, execute the code below and add it also to your source code:

DO LOCFILE("System.App")

If the GdiPlus-X library is not in your PATH, VFP will open a search window for you to point to the file "System.vcx"

2 - In the command window, type:


3 - In the VFP Editor type the following:

LOCAL loBmp AS xfcBitmap
loBmp = _Screen.System.Drawing.Bitmap.FromFile(GETPICT())

Very easy, isn't it ?

Basically, you have always to define your objects to have intellisense working for them, and to have the property / object "System" added to your VFP _Screen object.

You can still make things easier, creating your own Intellisense script, or just typing the following in the command window:

SET FUNCTION 5 TO "_Screen.System.Drawing"

and Voilá !

Every time that you type F5, automagically you'll be acessing all the "System.Drawing" namespace functions !

You can obtain more information about the library at this link: http://www.codeplex.com/VFPX/Wiki/View.aspx?title=GDIPlusX

If you want to participate in the project, coding, testing or reporting errors, feel free to use the Codeplex message boards and contact the GdiPlus-X team. Every help is very welcome.

Enjoy !

No comments:

Post a Comment