Adaptation of FiveWin class TsBrowse to HMG

Source code related resources

Moderator: Rathinagiri

User avatar
gfilatov
Posts: 582
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 17 times
Been thanked: 148 times
Contact:

Adaptation of FiveWin class TsBrowse to HMG

Post by gfilatov » Thu Jun 03, 2010 10:24 am

Hello,

I want to present an adaptation of FiveWin class TsBrowse (original author is Manuel Mercado) to HMG 8-)
It is a dirty and fast adaptation of the current minigui ext. code.
The archive contains the all needed changes in the HMG sources and make batch for compiling tbrowse library for HMG folder structure.

Remark. There is a major limitation for TBrowse font handling in this conversion because HMG don't have a Font control yet :cry:

Warning. This distribution is provided AS IS, without any warranty.
Attachments
demo.jpg
Demo screenshot
demo.jpg (349.83 KiB) Viewed 6009 times
hmg-tbrowse.zip
TBrowse changes in HMG folder
(585.71 KiB) Downloaded 712 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
Rathinagiri
Posts: 5250
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 167 times
Been thanked: 165 times
Contact:

Post by Rathinagiri » Thu Jun 03, 2010 10:57 am

F(u)(a)ntastic Grigory! Really a milestone.

Congrats and thanks.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

JALMAG
Posts: 187
Joined: Sun Jan 10, 2010 7:05 pm
DBs Used: DBF
Location: España - Spain
Has thanked: 1 time
Been thanked: 1 time

Post by JALMAG » Thu Jun 03, 2010 12:58 pm

Thank Ffilatov! :P

User avatar
Roberto Lopez
HMG Founder
Posts: 3919
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Thu Jun 03, 2010 1:38 pm

gfilatov wrote:Hello,

I want to present an adaptation of FiveWin class TsBrowse (original author is Manuel Mercado) to HMG 8-)
It is a dirty and fast adaptation of the current minigui ext. code.
The archive contains the all needed changes in the HMG sources and make batch for compiling tbrowse library for HMG folder structure.

Remark. There is a major limitation for TBrowse font handling in this conversion because HMG don't have a Font control yet :cry:
Many Many Thanks Grigory!

I'm a little busy right now, but I'll test it tonight and I'll let know you about my experience.

Regarding font object, IMHO, it is out of HMG coding style.

The user must be able to assign a font name and style directly to a control (or control components) without caring about the creation a separate font object.

So, HMG must not have an 'user-exposed' font object, but if you need to add one for TSBROWSE use, there is no problem for my part, but it should be handled as in the rest of HMG controls (the required font object is automatically created and hidden to the user).
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3919
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Thu Jun 03, 2010 1:58 pm

Roberto Lopez wrote: So, HMG must not have an 'user-exposed' font object, but if you need to add one for TSBROWSE use, there is no problem for my part, but it should be handled as in the rest of HMG controls (the required font object is automatically created and hidden to the user).
Anyway, since TSBROWSE, will be an optional component (not part of HMG core) there is no need to be so strict regarding control design rules in HMG, so, if you want to port font control to be used with TSBROWSE, there is no problem from my part.

Please remember that if you decide to do it, font control must be conditionally compiled in the same way as the rest of TSBROWSE code.

Thanks in advance.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
gfilatov
Posts: 582
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 17 times
Been thanked: 148 times
Contact:

Post by gfilatov » Thu Jun 03, 2010 2:18 pm

Roberto Lopez wrote:...
if you want to port font control to be used with TSBROWSE, there is no problem from my part.

Please remember that if you decide to do it, font control must be conditionally compiled in the same way as the rest of TSBROWSE code.

Thanks in advance.
Roberto,

It is possible. But it will be require adding the 7th parameter Angle for support vertical fonts to the following core function:

Code: Select all

HFONT PrepareFont( char *Fontname, int FontSize, int Weight, int Italic, int Underline, int StrikeOut, int Angle )
{
   HDC   hDC;
   int   cyp;

   memset( &cyp, 0, sizeof(cyp) );
   memset( &hDC, 0, sizeof(hDC) );

   hDC = GetDC( HWND_DESKTOP );

   cyp = GetDeviceCaps( hDC, LOGPIXELSY );

   ReleaseDC( HWND_DESKTOP, hDC );

   FontSize = ( FontSize * cyp ) / 72;

   return CreateFont
      (
         0 - FontSize,
         0,
         Angle,
         0,
         Weight,
         Italic,
         Underline,
         StrikeOut,
         DEFAULT_CHARSET,
         OUT_TT_PRECIS,
         CLIP_DEFAULT_PRECIS,
         DEFAULT_QUALITY,
         FF_DONTCARE,
         Fontname
      );
}
That's all :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines
Been thanked: 2 times

Post by dhaine_adp » Thu Jun 03, 2010 3:56 pm

Hi Grigory,

Your contribution is truly great. On the otherhand the TsBrowse completes the Clipper function Tbrowse for HMG. It is indeed great! Thank you very much for your unselfish contribution.

To Roberto,

Thank you also for HMG and HMG Objects.

More power!

Regards,

Danny
Regards,

Danny
Manila, Philippines

User avatar
Roberto Lopez
HMG Founder
Posts: 3919
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Thu Jun 03, 2010 4:41 pm

gfilatov wrote: It is possible. But it will be require adding the 7th parameter Angle for support vertical fonts to the following core function:
If the modification does not affect the current functionality, I have no problem about that.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3919
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Thu Jun 03, 2010 4:55 pm

Grigory,

And, for your next code post, please include conditional compilation directives (if required) for h_init.prg.

Thanks in advance.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
gfilatov
Posts: 582
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 17 times
Been thanked: 148 times
Contact:

Post by gfilatov » Thu Jun 03, 2010 5:57 pm

Roberto Lopez wrote:Grigory,

And, for your next code post, please include conditional compilation directives (if required) for h_init.prg.

Thanks in advance.
Yes, of course.

Thanks for your attention!
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

Post Reply