Page 11 of 12

HMG 3.2 (Stable)

Posted: Sat Apr 19, 2014 11:43 pm
by Pablo César
srvet_claudio wrote:I fixed!
I guess not yet my friend... please read my PM, seems there still details about MODAL windows and others windows at running preview... :(

Re: HMG 3.2 (Stable)

Posted: Sun Apr 20, 2014 3:06 pm
by srvet_claudio
srvet_claudio wrote:
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!
In the end of the function _HMG_PRINTER_SHOWPREVIEW() (aprox. line 4672 of file h_controlmisc.prg) insert the following code between EnableWindow(ModalHandle) and SetFocus(ModalHandle):

Code: Select all

   FOR i := 1 To HMG_LEN ( _HMG_SYSDATA [ 67 ] )
      IF _HMG_SYSDATA [ 65 ] [i] == .F.
         IF _HMG_SYSDATA [ 69 ] [i] == 'P' .AND. _HMG_SYSDATA [ 70 ] [i] == ModalHandle   // Panel window into Modal window
            EnableWindow ( _HMG_SYSDATA [ 67 ] [i])   // Enable Panel window
         ENDIF
      ENDIF
   NEXT

HMG 3.2 (Stable)

Posted: Sun Apr 20, 2014 4:29 pm
by Pablo César
Hola Claudio,

Me voy hacer entender atravéz del video:
[youtube]sBZUmqWWbP0[/youtube]
Como no pude editar el video para agregar la descripcion en palabras, lo haré de forma narrativa.

1. Desde el comienzo del video ( 00:00 x 00:07 ).Verás que no es posible clicar y hacer foco en la ventana "win_main" despues de haber abierto la ventana "win_modal". Ok. Este comportamiento es normal.

2. ( 00:07 x 00:15 ) Despues de haber llamado el preview y bajar la ventana, se puede ver que no hacen focos las ventanas anteriores. Eso porque es de acuerdo con lo ultimo que enviaste. Ok (no habilita todas las ventanas). Este comportamiento tambien es normal.

3. ( 00:15 x 00:29 ) Pero al salir del preview, se puede notar que la ventana "win_modal" permite que se haga foco en la ventana "win_main". Lo que se deduce que la ventana "win_modal" dejó de tener alguna propiedad de MODAL al desabilitarla/habilitarla. Lo que no es normal. :(

Es a este comportamiento al que me referia. Anexo el ejecutable, de acuerdo tu ultima orientación. Espero que de esta vez me haya podido hacer entender...

Re: HMG 3.2 (Stable)

Posted: Sun Apr 20, 2014 6:50 pm
by srvet_claudio
Pablo César wrote:3. ( 00:15 x 00:29 ) Pero al salir del preview, se puede notar que la ventana "win_modal" permite que se haga foco en la ventana "win_main". Lo que se deduce que la ventana "win_modal" dejó de tener alguna propiedad de MODAL al desabilitarla/habilitarla. Lo que no es normal.
Pablo,
you must be an error in your source code, works for me perfect.

Probably you have left in your source code this change:
Pablo César wrote: 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 ] )


See the executable file.

HMG 3.2 (Stable)

Posted: Sun Apr 20, 2014 7:23 pm
by Pablo César
srvet_claudio wrote:Pablo,
you must be an error in your source code, works for me perfect.

See the executable file.
Conferi, y puse entre las lineas que indicas en tu mensaje anterior ( entre EnableWindow(ModalHandle) y SetFocus(ModalHandle) ). Tambien lo puse antes como estaba originalmente y no me dió... :(
Screen.PNG
Screen.PNG (52.66 KiB) Viewed 12202 times
srvet_claudio wrote:In the end of the function _HMG_PRINTER_SHOWPREVIEW() (aprox. line 4672 of file h_controlmisc.prg) insert the following code between EnableWindow(ModalHandle) and SetFocus(ModalHandle):

Code: Select all

   FOR i := 1 To HMG_LEN ( _HMG_SYSDATA [ 67 ] )
      IF _HMG_SYSDATA [ 65 ] [i] == .F.
         IF _HMG_SYSDATA [ 69 ] [i] == 'P' .AND. _HMG_SYSDATA [ 70 ] [i] == ModalHandle   // Panel window into Modal window
            EnableWindow ( _HMG_SYSDATA [ 67 ] [i])   // Enable Panel window
         ENDIF
      ENDIF
   NEXT
Tambien removi:

If _HMG_SYSDATA [ 69 ] != 'X'

No sé más que es lo que puede ser. Disculpame... :(

Re: HMG 3.2 (Stable)

Posted: Sun Apr 20, 2014 8:16 pm
by srvet_claudio
Pablo César wrote:
srvet_claudio wrote:Pablo,
you must be an error in your source code, works for me perfect.

See the executable file.
Conferi, y puse entre las lineas que indicas en tu mensaje anterior ( entre EnableWindow(ModalHandle) y SetFocus(ModalHandle) ). Tambien lo puse antes como estaba originalmente y no me dió... :(
Screen.PNG
srvet_claudio wrote:In the end of the function _HMG_PRINTER_SHOWPREVIEW() (aprox. line 4672 of file h_controlmisc.prg) insert the following code between EnableWindow(ModalHandle) and SetFocus(ModalHandle):

Code: Select all

   FOR i := 1 To HMG_LEN ( _HMG_SYSDATA [ 67 ] )
      IF _HMG_SYSDATA [ 65 ] [i] == .F.
         IF _HMG_SYSDATA [ 69 ] [i] == 'P' .AND. _HMG_SYSDATA [ 70 ] [i] == ModalHandle   // Panel window into Modal window
            EnableWindow ( _HMG_SYSDATA [ 67 ] [i])   // Enable Panel window
         ENDIF
      ENDIF
   NEXT
Tambien removi:

If _HMG_SYSDATA [ 69 ] != 'X'

No sé más que es lo que puede ser. Disculpame... :(

Anexo mi h_controlmisc.prg por si quieres conferir...


En la linea 4309 de tu imagen debe decir originalmente: DisableWindow (_HMG_SYSDATA [ 67 ] ), en tu imagen dice EnableWindow (la cambiaste y no corregiste).

Re: HMG 3.2 (Stable)

Posted: Sun Apr 20, 2014 8:58 pm
by mol
Please write jn English. I'm very often using tablet an smartphone for reading this forum (tablet now) and it is really hard to use google translator....
Besides, I think google translator is very poor while translating from spanish to english.

Ps. Many thanks for your discussion, I'll try this patch tomorrow.
Regards, Marek

Re: HMG 3.2 (Stable)

Posted: Mon Apr 21, 2014 2:39 pm
by mol
I've tested with hmg 3.1.5 and it works fine for me.
Thank you, Claudio for your qiuck response!
Regards, Marek

Re: HMG 3.2 (Stable)

Posted: Mon Apr 21, 2014 3:12 pm
by mol
Another problem I found, becomes when you define panel window on modal window. Modal window has declared virtual width and height.
When you scrolling modal window, panel window stays still in the same place on screen.
Panel window coordinates (row,col) are independend from its parent window. In my opinion, it's wrong.
See attached sample

Re: HMG 3.2 (Stable)

Posted: Mon Apr 21, 2014 11:43 pm
by srvet_claudio
mol wrote:Another problem I found, becomes when you define panel window on modal window. Modal window has declared virtual width and height.
When you scrolling modal window, panel window stays still in the same place on screen.
Panel window coordinates (row,col) are independend from its parent window. In my opinion, it's wrong.
See attached sample
Yes, you're right, also occurs with other types of windows besides the modal.
I will try to fix it.