how to solve this problem after activating a window

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
jairpinho
Posts: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

how to solve this problem after activating a window

Post by jairpinho »

how to solve this problem after activating a window performs nothing on the line below the activated following example.

#include <hmg.ch>

Function Main

Load Window Main
Main.Center
Main.Activate

msginfo("teste") // not execute message

Return
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

Re: how to solve this problem after activating a window

Post by salamandra »

:) Hi Jair,
AFAIK, Msginfo() can´t be displayed after RELEASE the main window :(
If you need display any notice or warning when release the main window,
you must use Window ONRELEASE event.
Example: ONRELEASE {|| thisWindow.Minimize, Msginfo("Test") }



** Portuguese ***
:) Olá Jair,
Até onde sei, Msginfo() não é exibido após o RELEASE da janela Main :(
Se você precisa exibir algum aviso ou advertência ao fechar a janela Main,
você deve usar o evento ONRELEASE da janela main.
Exemplo : ONRELEASE {|| thisWindow.Minimize, Msginfo("Test") }


[]´s Salamandra
Last edited by salamandra on Sat Mar 24, 2012 8:16 pm, edited 1 time in total.
There is one time in which is crucial awakening. That time is now. ( Buddha )
User avatar
jairpinho
Posts: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

Re: how to solve this problem after activating a window

Post by jairpinho »

ola salamandra então este e meu problema

tenho uma janela que não é main e preciso continuar a executar comandos apos sua ativação

Code: Select all

                    IF AcessoAoSistema()  
                        msginfo("teste1")                    
                            IF lLogin 
                                msginfo("teste2")
                                Center	WINDOW  Form_Main
                                ACTIVATE 	WINDOW 	Form_Main
                            ENDIF
                    ENDIF


*************************************************************************************************************************************
Function AcessoAoSistema()          
*************************************************************************************************************************************
  Local cUsuario           := ""
  Local cSenha             := ""
  
  
	//Conecta_Banco_De_Dados( cDatabase )
	//Cria_Tabela_Acesso()
	
	
	*** Define Janela do Login Principal ao Sistema
	IF !IsWindowDefined(Form_acesso)
      Load Window Form_acesso
      Form_acesso.HostName.Value  := cHostName
      Form_acesso.Label_13.Value  := cHostName
      Form_acesso.Text_1.Value    := cDatabase
      Form_acesso.Text_2.Value    := cUser  
      Form_acesso.Text_3.Value    := cPassWord
      Form_acesso.Text_4.Value    := cServer_Email
      Form_acesso.Text_5.Value    := Email_Automail
      Form_acesso.Text_6.Value    := User_Automail
      Form_acesso.Text_7.Value    := Senha_Automail
      Form_acesso.Title := "Acesso ao Sistema [" + cHostName + "]" + " | " + cDiretorio
		*** Coloca o Cursor no TEXTBOX p_user				
		Form_acesso.Usuario.SetFocus
		*** Centraliza janela
		Form_acesso.Center
		*** Ativa janela de Login 
		Form_acesso.Activate
	ENDIF
Return(.T.)

salamandra wrote::) Hi Jair,
AFAIK, Msginfo() it´s not displayed after the main window was released :(



** Portuguese ***
:) Olá Jair,
Até onde sei, Msginfo() não será exibido após o RELEASE da janela Main :(


[]´s Salamandra
Last edited by jairpinho on Sat Mar 24, 2012 8:16 pm, edited 1 time in total.
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: how to solve this problem after activating a window

Post by esgici »

Hola Jair
jairpinho wrote:how to solve this problem after activating a window performs nothing on the line below the activated following example.
This isn't a problem; it's a normal behaviour.

In your sample MsgInfo() statement will be executed after Main Window released.

For execute it

- before Main Window activated, place it before activate command;
- first action of Main window, place it to ON INIT clause;
- Anytime while Main window active, place it an action ( in a button, main menu item, context menu item, etc. )

And please look at here for some useful infos on this concept.

I hope help you.

Saludos

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply