Adaptation of FiveWin class TsBrowse to HMG

Source code related resources

Moderator: Rathinagiri

User avatar
gfilatov
Posts: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Adaptation of FiveWin class TsBrowse to HMG

Post by gfilatov »

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 screenshot
Demo screenshot
demo.jpg (349.83 KiB) Viewed 10853 times
hmg-tbrowse.zip
TBrowse changes in HMG folder
(585.71 KiB) Downloaded 1009 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Adaptation of FiveWin class TsBrowse to HMG

Post by Rathinagiri »

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: 262
Joined: Sun Jan 10, 2010 7:05 pm
DBs Used: DBF, MariaDB
Location: España - Spain

Re: Adaptation of FiveWin class TsBrowse to HMG

Post by JALMAG »

Thank Ffilatov! :P
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Adaptation of FiveWin class TsBrowse to HMG

Post by Roberto Lopez »

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: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Adaptation of FiveWin class TsBrowse to HMG

Post by Roberto Lopez »

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: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Adaptation of FiveWin class TsBrowse to HMG

Post by gfilatov »

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

Re: Adaptation of FiveWin class TsBrowse to HMG

Post by dhaine_adp »

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: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Adaptation of FiveWin class TsBrowse to HMG

Post by Roberto Lopez »

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: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Adaptation of FiveWin class TsBrowse to HMG

Post by Roberto Lopez »

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: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Adaptation of FiveWin class TsBrowse to HMG

Post by gfilatov »

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