Window child

Moderator: Rathinagiri

Post Reply
Mario Mansilla
Posts: 269
Joined: Wed Aug 13, 2008 2:35 pm
Location: Córdoba - Argentina

Window child

Post by Mario Mansilla »

Hola :
tengo un problema con ventanas child . El mismo consiste en que puedo identificar cuando la ventana ya minimizada es restaurada ya sea desde el menu o desde el Toolbar que llama al procedimiento , pero cuando restauro desde la ventana minimizada (abajo a la izquierda) no logro detectar esta situacion para ubicar el foco del sistema .
Lo que uso es lo siguiente :

Hi there :
I have a problem with child windows. The same is that I can identify when and minimized window is restored either from the menu or from the Toolbar calling the procedure, but when restored from the minimized window (bottom left) failed to detect this situation to place the focus of the system .
What use is this:

If ! IsWindowDefined(Form_420)
Load Window Form_420
ON KEY ESCAPE OF FORM_420 ACTION THISWINDOW.RELEASE
Center Window Form_420
Activate Window Form_420
Else
If IsWindowActive(Form_420)
Select AbmBan
Form_420.Restore
Form_420.Setfocus
Form_420.Browse_1.Setfocus
Else
Form_420.Restore
Endif
Endif

Uso HMG 3.4.2 y Win7 32

Saludos

Mario Mansilla
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Window child

Post by Pablo César »

Hola Mario,

No sé si ya resolviste esta tu dificultad. Disculpá la demora en responder.

Creo que no te respondieron antes, es porque no pudieron poner en práctica tu ejemplo.
Preparé este ejemplo mas o menos baseado en el tuyo:

Code: Select all

#include <hmg.ch>

Function Main()
DEFINE WINDOW Form_1 AT 310,832 WIDTH 247 HEIGHT 350 TITLE "Main window" MAIN

    DEFINE BUTTON Button_1
        ROW    50
        COL    40
        WIDTH  160
        HEIGHT 30
        ACTION MaximizeForm_2()
        CAPTION "Open child window"
    END BUTTON

END WINDOW
Form_1.Center
Form_1.Activate
Return Nil

Function MaximizeForm_2()
LOCAL lCreate:=file('test.dbf')

If !lCreate
   dbcreate("test", {{'NAME','C',100,0}})
Endif
USE test
If !lCreate
   APPEND BLANK ; test->NAME := "Juan de la esquina"
   APPEND BLANK ; test->NAME := "Maria la bonachona"
   APPEND BLANK ; test->NAME := "Pedrito el niño repartidor"
   GOTO TOP
Endif

If !IsWindowDefined(Form_2)
   DEFINE WINDOW Form_2 AT 470,790 WIDTH 337 HEIGHT 236 TITLE "Child window" CHILD

        ON KEY ESCAPE OF Form_2 ACTION THISWINDOW.RELEASE
		
        DEFINE BROWSE Browse_1
            ROW    20
            COL    20
            WIDTH  290
            HEIGHT 150
            VALUE 1
            WIDTHS {260}
            HEADERS {'Names'}
            WORKAREA Test
            FIELDS {'test->NAME'}
        END BROWSE

   END WINDOW
   Activate Window Form_2
Else
   Form_2.Restore
   Form_2.Browse_1.Setfocus
Endif 
Return Nil
Era esto lo que vos buscabas ? Explicanos cual es tu dificultad.
 
Free translation
Hi Mario,

I do not know if you have solved your difficulty. Sorry about the delay in responding.

I think nobody responded to you before, Ithink it's because they could not put your example into practice.
I prepared this example based on your code:

<see the code above>

Was this what you were looking for ? Explain to us a little bit more what your difficulty is.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply