Page 1 of 6

Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 10:24 am
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.

Re: Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 10:57 am
by Rathinagiri
F(u)(a)ntastic Grigory! Really a milestone.

Congrats and thanks.

Re: Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 12:58 pm
by JALMAG
Thank Ffilatov! :P

Re: Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 1:38 pm
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).

Re: Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 1:58 pm
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.

Re: Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 2:18 pm
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:

Re: Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 3:56 pm
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

Re: Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 4:41 pm
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.

Re: Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 4:55 pm
by Roberto Lopez
Grigory,

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

Thanks in advance.

Re: Adaptation of FiveWin class TsBrowse to HMG

Posted: Thu Jun 03, 2010 5:57 pm
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!