Page 10 of 12
Re: HMG 3.2 (Stable)
Posted: Fri Apr 18, 2014 7:34 am
by PeteWG
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
HMG 3.2 (Stable)
Posted: Fri Apr 18, 2014 1:44 pm
by Pablo César
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.
Re: HMG 3.2 (Stable)
Posted: Sat Apr 19, 2014 7:03 pm
by mol
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.
Re: HMG 3.2 (Stable)
Posted: Sat Apr 19, 2014 7:29 pm
by Javier Tovar
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
HMG 3.2 (Stable)
Posted: Sat Apr 19, 2014 8:26 pm
by Pablo César
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.
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.
Re: HMG 3.2 (Stable)
Posted: Sat Apr 19, 2014 8:33 pm
by Javier Tovar
Gracias Pablo César por la explicación!
Saludos
Re: HMG 3.2 (Stable)
Posted: Sat Apr 19, 2014 9:55 pm
by mol
So, if print preview disables all modal windows, it will be enough to do reverse action after closing preview
HMG 3.2 (Stable)
Posted: Sat Apr 19, 2014 9:58 pm
by Pablo César
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.
HMG 3.2 (Stable)
Posted: Sat Apr 19, 2014 10:14 pm
by Pablo César
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...
But thank you Marek to report this bug.
Re: HMG 3.2 (Stable)
Posted: Sat Apr 19, 2014 10:28 pm
by srvet_claudio
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!