HMG 3.3.1 (Stable)

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

User avatar
mol
Posts: 3789
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG 3.3.1 (Stable)

Post by mol »

I've found problem with pictures on buttons (I'm using .bmp files).
In previous version e.g. hmg 3.1.5 everything was OK, but, in current version transparency of bitmap is ignored:

[img]www://molsystemy.pl/hmg/hmg331_picturebutton.jpg[/img]
User avatar
mol
Posts: 3789
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG 3.3.1 (Stable)

Post by mol »

Hi Claudio!
Thanks for this patch, but, could you place this solution with set base filename for saving printout to file?:
viewtopic.php?f=43&t=3827&p=36042#p36042" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;

and solution with PDF creation, too.

Best regards, Marek
User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG 3.3.1 (Stable)

Post by srvet_claudio »

mol wrote:I've found problem with pictures on buttons (I'm using .bmp files).
In previous version e.g. hmg 3.1.5 everything was OK, but, in current version transparency of bitmap is ignored:

[img]www://molsystemy.pl/hmg/hmg331_picturebutton.jpg[/img]
Hi Marek,
You could upload some BMP pictures that cause transparency problem.
mol wrote:Hi Claudio!
Thanks for this patch, but, could you place this solution with set base filename for saving printout to file?:
viewtopic.php?f=43&t=3827&p=36042#p36042" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;

and solution with PDF creation, too.

Best regards, Marek
OK.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG 3.3.1 (Stable)

Post by srvet_claudio »

Rathinagiri wrote:
Pablo César wrote:
mol wrote:I found a difference in h_HMG_HPDF.PRG source file.
In _HMG_HPDF_PRINT function definition, some piece of code from line 283 looks like that:

Code: Select all

 If HMG_UPPER( HB_USUBSTR( cFontName, HMG_LEN( cFontName ) - 3 ) ) == '.TTF' // load ttf font
In _HMG_HPDF_MULTILINE_PRINT function definition, adequate line (no. 372) differents from above:

Code: Select all

If HMG_UPPER( HB_USUBSTR( cFontName, HMG_LEN( cFontName ) - 4 ) ) == '.TTF' // load ttf font
Difference is in recognizing .TTF extension. First line is good, second is bad.
I've changed 4 to 3 in line 372, recompiled library, and it's work OK to me.
I'm testing forward.

It's a bug to correct in the next version of HMG, I think.

Regards, Marek
Yes Marek, you are right !

I have published this solution at viewtopic.php?p=35144#p35144 because EduardoLuis has appointed this same fail.
Screen_01.PNG
Even with solution in our hands, nothing happen at new releases.
Only strong discusions about this... :(
Pablo, this we will do in the next release. Thanks a lot.
Done !
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
srvet_claudio
Posts: 2223
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG 3.3.1 (Stable)

Post by srvet_claudio »

mol wrote:Hi Claudio!
Thanks for this patch, but, could you place this solution with set base filename for saving printout to file?:
viewtopic.php?f=43&t=3827&p=36042#p36042" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;

and solution with PDF creation, too.

Best regards, Marek
Done!
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
mol
Posts: 3789
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG 3.3.1 (Stable)

Post by mol »

srvet_claudio wrote: Hi Marek,
You could upload some BMP pictures that cause transparency problem.
You can download sample images:
http://www.molsystemy.pl/hmg/szukaj.bmp" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false; Image
http://www.molsystemy.pl/hmg/cert.bmp" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false; Image
http://www.molsystemy.pl/hmg/drukuj16.bmp" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false; Image
User avatar
mol
Posts: 3789
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG 3.3.1 (Stable)

Post by mol »

srvet_claudio wrote:
mol wrote:Hi Claudio!
Thanks for this patch, but, could you place this solution with set base filename for saving printout to file?:
viewtopic.php?f=43&t=3827&p=36042#p36042" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;

and solution with PDF creation, too.

Best regards, Marek
Done!
WOW!
You're really Speedy Gonzales! :lol:
User avatar
mol
Posts: 3789
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG 3.3.1 (Stable)

Post by mol »

I've applied patch2 and I can't compile my project
I'm getting error:

Code: Select all


C:\hmg\include\i_tree.ch(233) Error E0003  Duplicate variable declaration '_HMG_THIS_TREEITEM_VALUE'

User avatar
mol
Posts: 3789
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG 3.3.1 (Stable)

Post by mol »

My colleague posted to me in the matter of memory leaking while intense use of LABEL Control.
After few thousand of changing label value, usage of memory increases to really big value - eg. from 1548KB to 24652KB ater 100.000 changes.
Here is a little sample:

Code: Select all

/*
 * HMG - Harbour Win32 GUI library Demo
 *
 * Copyright 2002 Roberto Lopez <mail.box.hmg@gmail.com>
 * http://www.hmgforum.com//
*/

#include "hmg.ch"

Function Main

	DEFINE WINDOW Form_Main ;
		AT 0,0 ;
		WIDTH 640 HEIGHT 480 ;
		TITLE 'Main Window' ;
		MAIN 

		@ 200,250 LABEL Label_1 ;
		WIDTH 150 HEIGHT 40 ;
		VALUE 'Click Me !' ;
		ACTION test();
		FONT 'Arial' SIZE 24  CENTERALIGN

		@ 10,10 LABEL Label_2 ;
		AUTOSIZE ;
		VALUE '...' ;
		ACTION msginfo('test')

	END WINDOW

	Form_Main.Label_2.Value := 'Hello All, This Is An AutoSIzable Label!!!'

	CENTER WINDOW Form_Main

	ACTIVATE WINDOW Form_Main

Return 

procedure test
local i
for i:=1 to 100000
   form_main.label_1.value:=str(i)
next
form_main.label_1.value:='Click Me !' 
MsgInfo('Label Clicked!!!') 
return
Normally, this label is used to observe changes on COM Port and should be observed continously.
PeteWG
Posts: 176
Joined: Sun Mar 21, 2010 5:45 pm

Re: HMG 3.3.1 (Stable)

Post by PeteWG »

mol wrote:My colleague posted to me in the matter of memory leaking while intense use of LABEL Control.
After few thousand of changing label value, usage of memory increases to really big value - eg. from 1548KB to 24652KB ater 100.000 changes.
...
Normally, this label is used to observe changes on COM Port and should be observed continously.
Hi!

Indeed running your sample (compiled with hmg 3.3.1) memory usage increases to almost ~25 GBytes.

Interestingly, hmg extended does not suffer from such a mem 'leakage'.

A partial workaround could be to replace the label control with a textbox, which eliminates by a half or so, the problem (memory usage ~ 10 GB).

Also a <do events> statement exactly after <form_main.label_1.value:=str(i)> line
could help to reduce cpu overhead (at least in your given example -don't know how it is the real code implemented but even there you should consider to add this line)

(hint: instead of str() you may want to use hb_ntos() which i think is faster).

Conclusively, the problem you describe is present in hmg official.
Probably an in depth study of hmg extended implementation could help maintainers to fix this.

HTH,

---
Pete
Post Reply