TSBrowse with native THeaders

TSBrowse with native THeaders

Postby Carlos Mora » Tue Jul 29, 2008 10:08 pm

In
http://forums.fivetechsoft.com/viewtopic.php?t=12101

there are some changes to use Native Headers Controls with TBrowse. Beyond the obvious result of the code, there is an interesting technique for changing classes with minimun effort, and keep those changes between different versions.
The technique is based on a GRASP pattern, 'protected variations'.

best regards,

Carlos.
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Postby Carlos Mora » Wed Jul 30, 2008 7:30 pm

Here there is a complete example, exe included:

http://www.box.net/shared/57zns2uwwk

It's almost eveything, to rebuild the project the makefile must be adjusted to your FiveWin, Harbour y BCC55 paths, and add from the Fivewin's source directory the THeader.prg file and apply on it the following add. I have not included this file in the zip to avoid breaking any intellectual property of Fivetech code.

The following line with the #translate should be inserted into the THeader.prg, just before The class definition


In code

.... THeader.prg ....

#translate CLASS THeader => CLASS __THeader // Añadir esta línea

CLASS THeader FROM TControl

DATA aPrompts, aSizes

.... más código


There is a dbf table included so it can be tested inmediately. Try to doubleclick on columns headers and look how it reacts. Then try tiping a character when the table is sorted by code, or type a number when it's sorted by name.

Best regards,

Carlos.
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 108 guests