HMG 3.2 (Stable)

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

User avatar
PeteWG
Posts: 99
Joined: Sun Mar 21, 2010 5:45 pm
Has thanked: 3 times
Been thanked: 23 times

Re: HMG 3.2 (Stable)

Post by PeteWG » Fri Apr 18, 2014 7:34 am

Hello South America (Claudio / Javier) :)

Thank you very much for your hints. appreciated!

Just a humble proposition: it wouldn't be better if patches were posted in the same place along with the current release?
Just to not bother the forum with such a rather trivial questions that i asked for.

regards,

---
Pete

User avatar
Pablo César
Posts: 4052
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 175 times

Post by Pablo César » Fri Apr 18, 2014 1:44 pm

PeteWG wrote:Just a humble proposition: it wouldn't be better if patches were posted in the same place along with the current release?
Yeah, this idea was already submitted. Is something about we have to think how to do it at this forum. :roll:
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
mol
Posts: 2742
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 91 times
Been thanked: 32 times
Contact:

Post by mol » Sat Apr 19, 2014 7:03 pm

I've found and error in hmg 3.2 / hmg 3.1.5.

Scenario:
1. Define Main window
2. Define modal window with panel window
3. All controls of panel windows are active
4. Print something from modal window with screen preview
5. Controls in panel window become unusable

What's going on?

Here is some code for testing:

Code: Select all

/*
* HMG Embedded Child Window Demo
* (c) 2002-2010 Roberto Lopez <mail.box.hmg@gmail.com>
*/

#include "hmg.ch"

Function Main

	SET SCROLLSTEP TO 10

	DEFINE WINDOW Win_Main ;
		ROW 0 ;
		COL 0 ;
		WIDTH 600 ;
		HEIGHT 400 ;
		TITLE 'HMG Panel Window Demo' ;
		WINDOWTYPE MAIN
	
			DEFINE BUTTON BUTTON_1
				ROW		40
				COL		20
				Width	300
				CAPTION 'Click me!'
				ACTION		CallModalWindow()
				
			END BUTTON
	END WINDOW
	
	center window Win_Main
	activate window Win_Main
 return

function CallModalWindow

	DEFINE WINDOW Win_Modal ;
		ROW 0 ;
		COL 0 ;
		WIDTH 600 ;
		HEIGHT 600 ;
		TITLE 'HMG Panel Window Demo' ;
		WINDOWTYPE MODAL  


		DEFINE WINDOW PanelWindow ;
			ROW 30 ;
			COL 30 ;
			WIDTH 500 ;
			HEIGHT 300 ;
			WINDOWTYPE PANEL

			DEFINE LABEL LABEL_1
				ROW		10
				COL		20
				VALUE		'Panel windows...'
				WIDTH		300
			END LABEL

			DEFINE BUTTON BUTTON_1
				ROW		40
				COL		20
				Width	300
				CAPTION 'Click me!'
				ACTION		MsgInfo('Button clicked!')
				
			END BUTTON
			
			define textbox text1
				row 70
				col 100
				width 200
				height 20
				value 'this is text control'
			end textbox
			
			define label Label1
				row 100
				col 100
				width 200
				height 100
				BackColor  {0,255,0}
				value "this is test label - CLICK FOR CHANGE COLOUR"
				On Click this.BackColor := {255,0,0}
			end label	
			
			define control ContextMenu Label1
				MenuItem "Click me!" action msginfo("This is Context Menu of Label1")
			end menu
			
		END WINDOW


		DEFINE BUTTON BUTTON_2
			ROW		350
			COL		10
			WIDTH		300
			CAPTION		'Click to print preview'
			ACTION		PrintPreview()
			CAPTION		'Button in basic window'
		END BUTTON


	END WINDOW


	Win_Modal.Center 

	Activate Window Win_Modal

Return

*---------------------------

function PrintPreview

	local cPrinter := GetDefaultPrinter()
	
	SELECT PRINTER cPrinter ;
			ORIENTATION	PRINTER_ORIENT_PORTRAIT ;
			PAPERSIZE	PRINTER_PAPER_A4 ;
			QUALITY		PRINTER_RES_MEDIUM ;
			PREVIEW

	START PRINTDOC name "Print preview"
	START PRINTPAGE
	@ 40, 40 PRINT RECTANGLE TO 60,150;
			COLOR BLACK;
			PENWIDTH 0.2
			
	@ 50, 50 print "Something to print... It doesn't matter what :)";
				FONT "ARIAL CE" ;
				SIZE 12 ;
				UNDERLINE BOLD ;
				COLOR BLACK


	END PRINTPAGE
	END PRINTDOC
	
	PanelWindow.Label1.BackColor := {0,255,0}
	PanelWindow.Label1.BackColor := {0,255,0}
	PanelWindow.Label1.Value := "Now, click on this label and any other control in this panel window will not take any action"
	
return .t.

Javier Tovar
Posts: 1272
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Sat Apr 19, 2014 7:29 pm

mol wrote:I've found and error in hmg 3.2 / hmg 3.1.5.

Scenario:
1. Define Main window
2. Define modal window with panel window
3. All controls of panel windows are active
4. Print something from modal window with screen preview
5. Controls in panel window become unusable

What's going on?
+1

Es cierto Mol, yo tampoco no se que pasa! Esperemos que dicen los de mas experiencia!

Saludos

User avatar
Pablo César
Posts: 4052
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 175 times

Post by Pablo César » Sat Apr 19, 2014 8:26 pm

mol wrote:I've found and error in hmg 3.2 / hmg 3.1.5.

Scenario:
1. Define Main window
2. Define modal window with panel window
3. All controls of panel windows are active
4. Print something from modal window with screen preview
5. Controls in panel window become unusable

What's going on?
What I know, Printer Preview had 4 windows: one for proper Preview, one for Buttons (Next page... Zoom... etc.), one for ThumbNails and one of simulates a WaitWindow.

So the print preview, in order to work MUST disable all previous windows that have been declared as MODAL. Why this ? Because, print view windows couldn't open if a previous modal windows is already open. So, it was implemented a technic to disable these previous windows as modal (see DisableWindow ModalHandle at h_controlmisc.prg). Your example Marek is a tipical case.

So, any way is evident we should correct something, to turn on back modals windows again. I supose this bug is really very old question.

I am speaking all about this, because I had cutted off one of window of print preview (the buttons ones). So from next release will have one window less in print preview.

Image

Read about this message.

I also have implemented languages (according SET LANGUAGE TO..) into preview buttons.

I will try to look up about and see what can be done.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Javier Tovar
Posts: 1272
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Sat Apr 19, 2014 8:33 pm

Gracias Pablo César por la explicación! :D

Saludos

User avatar
mol
Posts: 2742
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 91 times
Been thanked: 32 times
Contact:

Post by mol » Sat Apr 19, 2014 9:55 pm

So, if print preview disables all modal windows, it will be enough to do reverse action after closing preview

User avatar
Pablo César
Posts: 4052
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 175 times

Post by Pablo César » Sat Apr 19, 2014 9:58 pm

Please be advised, this was a very very old problem and upto now nobody appointed as bug. But I found the problem already and fixed.

It was delivered the right functions and will be ok for next release.

For whom wants to know about it. Please see h_controlmisc.prg file at line where is:

DisableWindow (_HMG_SYSDATA [ 67 ] ) // see 2 spaces after 67

Please replace for this:

EnableWindow (_HMG_SYSDATA [ 67 ] )

So, for who wants to repair this bug, after editing h_controlmisc.prg file and saved you will need to re-build the HMG LIB.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Pablo César
Posts: 4052
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 175 times

Post by Pablo César » Sat Apr 19, 2014 10:14 pm

mol wrote:So, if print preview disables all modal windows, it will be enough to do reverse action after closing preview
Sure ! But please note: very very old problem this. Previous than version 3.0.35... :oops:

But thank you Marek to report this bug.

Image
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
srvet_claudio
Posts: 1919
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 25 times
Been thanked: 95 times
Contact:

Post by srvet_claudio » Sat Apr 19, 2014 10:28 pm

mol wrote:I've found and error in hmg 3.2 / hmg 3.1.5.

Scenario:
1. Define Main window
2. Define modal window with panel window
3. All controls of panel windows are active
4. Print something from modal window with screen preview
5. Controls in panel window become unusable

What's going on?
I fixed!
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest