Tuesday, June 19, 2007

Join to the xHarbour users list

Today I found an interesting new link in xHarbour.org Open Source official web page: the brand new xHarbour Users list.

If you wish to join, leave your data in:

xHarbour.org users list

Only basic data is taken, and it's not shown in the panel list, so you can be confident about the spam stuff.

Wednesday, June 13, 2007

Changing the resource compiler.

This article has been modified from its original spanish version. All references to other programming tools different of Xailer have been removed.

When working with Xailer, you probably have used the resource manager included in the IDE to handle the ImageList, Bitmaps, Icons, Cursors, etc.

Talking about resources, means that many of our visual appearance will be stored inside the own EXE file, this is a right and professional way to work because in other programming tools, all the visual interface came stored into a DLL.

In Xailer, all the resources are stored into a .RC file, which is created using the resource manager included in the IDE, this resource manager only handle the names of the resources, but doesn't let you "edit" them, (you will need an external tool), and then, during the application building process these resources are "compiled" and then linked into the final EXE file.

.RC files are like source code, in fact a .RC files is a text file, and, just the way we do with other source code, these .RC file must be compiled, the result of the compilation of a .RC file is a .RES file, equivalent to a .OBJ file in other programming languages, this .RES file will be linked into the .EXE as any other .OBJ file so the linker does this final step.

Since Xailer uses the Borland C++ 5.5, it comes with a "resource compiler" included, the name of the file is BRC32.EXE, in the \bin directory of the Borland C++ installation, the Xailer's building process uses this compiler to become the .RC files into .RES files, to let the ILINK32.EXE (also a Borland C++ component) do the rest of the job generating the final EXE.

The problem here is that BRC32.EXE in not a good choice when having huge resource files, or such .RC files are using big image files or have bitmaps with millions of colours, when this happens, the BRC32.EXE simply cannot compile the .RC file.

How to solve this problem ?

Easy, just change the resource compiler, obvious, but....

What resource compiler should I use ?

During my last trip to Spain in May 2007, I was talking with Bingen about this and he suggested me to use the Pelles C resource compiler, this is a free C compiler and its resource compiler works great with huge .RC files and with complex bitmaps that cannot be handled by the Borland C++ resource compiler.

The name of the resource compiler of Pelles C is PORC.EXE, it comes along with a PORC.DLL needed in order to compile our resurces, it works exactly the same way of the BRC32.EXE, so you don't need to change anything in the way you currently work, but the name of the compiler, instead of using the BRC32.EXE you will use the PORC.EXE and you are done, since the PORC uses the same compilation switches you don't need to change anything else.

Where to get it ?, dowload it from Pelles C download center, I do suggest to download the ZIP file, go to the second section of the page, where says Executables and Help. The zip is the suggested format because we don't need the full Pelles Installation, just the resource compiler. Using WinZip, WinRar search into the ZIP file and look for these two files :PORC.EXE & PORC.DLL, extract them in any directory in your hard drive.

To use them with Xailer, the fastest and easy way:

1) Copy the PORC.EXE and PORC.DLL into the \Xailer\bin directory
2) Open the Xailer's IDE, select Tools / Options... and you will see this form, select into the tree structure Resource Compiler into Directories section:



Select Use this compiler, set the path where PORC.EXE is (in my case \Xailer\bin) and that's all, it's no needed to touch the compilation flags, since they are the same for PORC and for BRC32.

4) From the Xailer's IDE open your project, and now BUILD (Alt+F9) the project, in order to recompile the resource file, is everything is ok, you will get a new EXE file without any problem.

During my test with Xailer, I faced a little problem, PORC was not generating the .RES file (the error the IDE will show is "cannot open FILE.RES", but the error will be shown until linking time), what was the cause ?, well, I have been working with Xailer since early versions, and in those early versions, the resource manager used to add a comment header at the top of the .RC file, this comment header had ";" as the comment indicator, which is not recognized by PORC as a valid comment operator, so, when it tried to compile, a syntax error occured, unfortunately, this error is not shown in the Xailer's compiling window, so you cannot trap it at the first time, after a little research the simply solution was to edit the old .RC file, change the ";" by the typical /*...*/ and all solved all my resources were compiled as expected.

Using this simply technical trick you will have a free yet powerful resource compiler and you will be able to handle bitmaps of any size or amount of colours.

Monday, February 12, 2007

I love OCX

During these last days I've working with the OCX and ActiveX issue using Xailer, Visual xHarbour (finally I found where de ActiveX support is), FreeWin and FiveWin, because I'm preparing our Xailer's Advanced Course, and we are going to see ActiveX in deep in May.

Sufing the Internet and as mentioned in the FiveWin News Group, I found these nice ActiveX controls by CodeJock Software, I just have a single word to describe them... IMPRESIVE, but not cheap: $ 575.00 USD for the Xtreme ToolKit, which includes 9 fancy controls, with 1 single user license.

Documentation for these product is absolutly commited to be used under Visual Basic, fortunatly the documentation is complete talking about Property, Events, Methods, Enumerations and all other objects contained as control's data, you will also find source code samples and if you are fluent with OOP in xHarbour you will have them working with your favorite GUI in short time.

The controls included in the Xtreme ToolKit are:

Full OutLook Calendar, 100% customizeable, with hundreds of components that let you give your application a complete "day plannig" features for example for agendas, personal timing and planning, etc.



Command Bar, Office Style, you can place anything you want in these toolbars, including menus, so you can move, resize, change position, float them, etc. this control includes also the world famous Office 2007 Ribbon bar:




Docking Pane: These "movable panels" are gorgeous, the suite also includes a "bonus" control, the TAB Control to substitute the typical XP Folders, these folders features multiline tabs, and the tabs can be horizotals or verticals:



PropertyGrid: These is a "property browse" you can set your main Categories and then add sub-categories, and movable sections that open and closes, something similar to the Xailer or Visual xHarbour Object Inspector.



You are going to love the Report control, this is a data browse that supports millons of data lines, the difference with other browses you will find is that not only the columns are cutomizables but THE ROWS also can be !, you can have a several rows for each data register, these row can be "shrinkable" or "expandable" can hold images, actions, etc, etc, etc. This control can also "connect" itself to a SQL Server or MySQL database to retrieve data, ah ! by the way, you can also print the data, that's why is called "Report".



Shortcut Bar: just like the Outlook bar, very easy to customize, and if you place it inside a Xailer panel, looks great ! (download the sample at the end of this article).




Skin: Have you ever wanted to ge the rid off those boring Windows XP themes, and go for something more "cool" for your interface ???, now is your chance, using the "skin" control, which adds independent skins to your Windows or Dialogs, these themed windows are independent of the themes you are using, the skins will also work under Windows 98 or NT so you will have different windows for your application.



Task Panel: For the most of us working with Xailer, this control is native, but if we are working with other GUIs give them a try to include Explorer Bars for a great look.



These controls are compatible with the all the xHarbour compatible GUIs, the easy way to use them is with Xailer or with Visual xHarbour, because both have an "import Activex" tool include in the IDE, and to be honest, with two clicks under Xailer and you will get a .PRG file with a class source code to call the OCX control of your choice, and the header file (.CH) with all the "Enumerations" (predefined constants) needed to use the control.

The classes created, along with che CH file, lets you to instance the control and place it into any Xailer form using the OnInitialize event, this saves you a bunch to coding time.

Sorry to mention, no ofence, but you will find hard to use these tools under FiveWin, starting with the OCX support, limited to version 2.6 and greater (don't worry if you have an early version, keep reading).

The main problem with FWH and these OCX is the documentation, in this case, the documentation doesn't have an apendix with the numeric value of the "enumerations" needed to make the control work with FiveWin, you will need an external tool, such as DLL Explorer to get the numeric values, and on the other hand, there are certain events in the controls that FiveWin cannot handle in a proper way, so, my best advice is ......

To use FreeWin !, if you have an earlier version of FiveWin 2.6, you can use these controls in your program, download from the FreeWin's web site the OCX Support (you can use it also with FW 2.6 and upper, replacing the native FiveWin's OCX support), this is the easiest way to squeeze all the power of these OCX because the Oskar Lira OCX support handles in a very easy way, yet elegant all the control's event stuff, is by far superior to FiveWin's.

I have written a tiny Xailer project, so you can look by yourself these controls full in action, to test them you need:

* Xailer 1.2b (obviously)
* xHarbour compatible with Xailer 1.2
* To install the CodeJock OCX that you may download from de www.codejock.com, section Downloads, download the ActiveX version, and forget about .NET.

Due to the lack of time, I couldn't write a sample for every control in the suite, but I think that with these samples you will have a good idea of how easy is to create professional good looking applications using this OCX.

You can download the project clicking here I have included the EXE also just in case you don't have Xailer at hand, but remember, you will need to have the CodeJock OCX installed to see the demo in action.

Thursday, January 11, 2007

Fancy predefined messages in Xailer

(original post in: www.mundoxbase.info)

Bingen Ulgadebere, a fine and skilled Xailer programmer, has developed this nice set of functions for "messaging" under Xailer.

This set of functions contains several "message" functions all commited to display messages using Xailer forms, for example: splash forms to show logos or images, giant tooltips using a form, messages for entering a single value (string, numeric, logical, date), messages to show while you are perfoming a task (something like ... "processing, please wait").

There two nice functions I liked the most: first, the message with a "blinking" header in the form, and second, the "messagin" system that lets you send messages across the network to other users using the same application, pretty nice stuff.

You can download the Xailer project along with source code and EXE sample clicking here

Thursday, November 16, 2006

Xailer goes OCX

This week programming stuff has gone tooooo fast, less than 24 hours ago, I was writting, in other blog, about FreeWin's ActiveX implementation, and some minutes ago I was informed that Xailier had "officially" released the OCX (ActiveX) support, complete, along with event handling.

The sample written by Ignacio and José is quite impressive, just for a "little technical detail", I will write about it later on, but this issue is not Xailer's fault, it's Adobe Reader's.

Just started the sample program and It will keep you mouth open, what about your very own web browser embeded in you application, with tab support, just the way Internet Explorer 7 ? .

(click in the images to enlarge)



Let's go on with the samples, and now we find the RMChart OCX implementation, to build nice bussiness graphics. This OCX is absolutly free and you can download it from www.rmchart.com, the results leave your mouth open:




And finally, just to spread your opened mouth to the floor, what about a nice FLASH animation running in your own Xailer's Window:



So far so good, the only issue I found in the demo is with the PDF sample, it doesn't work and the application crashes with a GPF, it all seems that there's some problem with the configuration of the Adobe Reader 7, that crashes de application, but if you use a lower release, like version 5, the sample will run as expected.

If you want to try it by yourself, you can download it clicking here. You will need to install the RMChart OCX before running the application, if not, the programm will crash, you can download it from www.rmchart.com. The sample includes the Xailer Project along with the compiled EXE in order to rebuild it you will need Xailer 1.1a and the special version of xHarbour for Xailer, both are available in Xailer's web page (www.xailer.com)

And now, let's sit to see what the other guis have to say to impress us.

Thursday, October 12, 2006

Business Graphics in Xailer

[Original post by Freddy in Mundo Xbase]

Today I want to show you the integration between Xailer (using TOleAuto) with the ChartDirector library, this will let us give our applications, in an easy way, real professional business graphics.


Gráfico de tarta

ChartDirector is a commercial library with a relative low price, between $99 for an individual licence to $499 for the free distribution library that will let us to integrate CharDirector in our exe files.

You can also get a demo version, limited by a little publicity line at the bottom of the graphic, this version is useful for testing and learning the use of the library.

With CharDirector we can create from simple pie graphics, to very complex Gantt diagrams, radar, financial, meter, dispersion, paretto, polars, combined graphics, etc...

If you want to give it a try, the first step will be download the demo version from: http://www.advsofteng.com/download.html

You have to download the ChartDirector for ASP/COM/VB

Once installed we are ready to use it with Xailer.

Before going on, it's important to make clear what does ChartDirector really do.

ChartDirector simply convert to a graphic image (jpg, gif or png) a code given by us from within our program. This feature, let us handle with Xailer the obtained result, putting it into a form using a TImage control, or printing it in a report, or save a log of the generated graphics, you only have to give a name to every single file.


Gráfico de barras

To integrate the graphic in one of our forms, we only have to pick a TImage control from the IDE toolbar, and drop it into the form, later, in the code, we can associate the control to the graphic file created with ChartDirector, let's check the following sample:

Código

You can download this sample, clicking here

Saturday, August 19, 2006

Programming in Xailer... without any idea at all

Some days ago, I was talking with Ignacio Ortiz de Zuñiga about Xailer development as a product and the comments in the news gorups, and we both noticed one thing: Xailer is being used with pretty much success by programmers that don't have any idea or have very little experience in Xbase programming, most of them with no idea at all of object oriented programming.

I've been in touch with 3 of theses cases, the first is a Spanish friend of mine, good Paco Viruete, he had developed some applications in Xailer for the RENFE (the spanish trains company), with very little or not effort at all. Congrats Paco !

The second case is closer to me, another good friend, and coleague Pepe Lutrillo, we meet each other more than 10 years ago, in those good Clipper for DOS times.

Pepe left the programming stuff for a very long time, he moved into another IT branch, not exactly programming, but he is a very skillful Clipperhead, and some time ago he decided to come back to the programmer's world and created Gal4Win, an accounting program for Art Galleries, fully created with Xailer:

(click over the image to enlarge)



I have already meet the third, and most notorious case, from my point of view. This week I've been working in the city of Satillo, in the mexican state of Coahuila, giving a Database Design Introducction Seminar for the Health and Sanity Departament of the State Goverment , invited by my friend Oscar de la Peña, and by the way, I went to visit my coleagues of APSI (www.apsi.com.mx), they developed the best payroll software for Mexico, and there I meet Margarita.

Margarita es the new programmer in APSI, a great cotratation of Armando Garcia, the owner of the company, who has a very good eye to choose his employees.

These last 5 evenings I've been working with Cinthya and Margarita, who comes from the Visual Basic world, so, she knows the way to the Windows programming, she always had used an IDE, and she had always handled data with SQL and she had never "used" a DBF file, doesn't know a thing of CDX or code blocks, however, she had created a Xailer Program.... in less than 8 weeks !!!!!

The brand new product of the APSI family, created by Cinthya and Margarita is named APSI-Capa, and was developed to manage all the training courses given to the employees of a company, it's fully written in Xailer, using Microsoft SQL Server, and all the reports are developed using Crystal Reports.

Data handling is made with DataSets and DataControls, (in fact, Margarita doesn't know that there's a DBF behind de scene), the user inteface along with the reports are pretty well designed.

Here some images, say more than 1000 worlds.

(click on the image to enlarge)








Belive it or not, this software was created in less than 2 months and it's fully functional, one thing I've noticed, is that people that don't have the influence of other Xbase programming, gets addapted faster to the Xailer's way of work, however, I had also noticed that FiveWin programmers take more time to get adapted to Xailer because the have to change the way of thinking, they try to solve the problems in the old way, without notice that Xailer has a lot of tools to do the same things in an easier way.

Definitly, it looks that Xailer can become in a great programming tool not only for the Clipper or Xbase programmer, but all the others having experience in other IDE based programming tools, without having any idea of Xbase.