Page 1 of 1

MsgInfo stop next control event to run ?

Posted: Tue Sep 02, 2014 7:53 am
by hmgchang
Dear Masters,

I tried to use OnLostFocus on controls, but it stop the next Action to run ...
here is the ssw,;

Code: Select all

#include "hmg.ch"

Function Main()

    DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 550 ;
      HEIGHT 350 ;
      MAIN ;
      TITLE "MsgInfo function .... stop next event..." 
      
      DEFINE EDITBOX Edit_1
          ROW    30
          COL    30
          WIDTH  210
          HEIGHT 170
          VALUE "This Editbox control has no MsgInfo for OnLostFocus."
      END EDITBOX    
      
      DEFINE EDITBOX Edit_2
        ROW    30
        COL    280
        WIDTH  210
        HEIGHT 160
        VALUE "This control has MsgInfo for the OnLostFocus."
        ONLOSTFOCUS MsgInfo( "Leaving Editbox !")
      END EDITBOX  
      
      DEFINE BUTTON Button_1
        ROW    210
        COL    40
        WIDTH  100
        HEIGHT 28
        ACTION MsgInfo( "Button_1 Action")
        CAPTION "Button_1"
      END BUTTON
      
      DEFINE BUTTON Button_2
        ROW    210
        COL    290
        WIDTH  100
        HEIGHT 28
        ACTION Nil
        CAPTION "Button_2"
        ONLOSTFOCUS MsgInfo( "Button_2 LostFocus")
      END BUTTON
      
      DEFINE LABEL Label_1
        ROW    260
        COL    20
        WIDTH  480
        HEIGHT 20
        VALUE "The Edit_2 OnLostFocus event prevent the next control event to occure..."
      END LABEL
    
    END WINDOW
    
    CENTER WINDOW Form_1
    ACTIVATE WINDOW Form_1
    
Return NIL


Re: MsgInfo stop next control event to run ?

Posted: Tue Sep 02, 2014 7:54 am
by hmgchang
Where do I do wrong ? pls advise...


TIA

rgds,
Chang

Re: MsgInfo stop next control event to run ?

Posted: Tue Sep 02, 2014 8:11 am
by Agil Abdullah
Hi Chang,

Apa kabar? Salam kenal.

I am a new comer... following while learning.

-Agil
Kemang, Jakarta Selatan, Indonesia

Re: MsgInfo stop next control event to run ?

Posted: Tue Sep 02, 2014 5:07 pm
by Javier Tovar
Hola HMGChang,

A mi si me muestra bien los MsgInfo de EditBox2 y del Boton2 de tu muestra!

Te envio imagen de que si fuciona bien!, yo tuve ese error y no me quedo más que reinstalar HMG!, Sin antes de buscar virus!

Saludos
///////////////////////////////////////////////////////////////////////////////////
Hello HMGChang,

My well if you show me MsgInfo EditBox2 and Key2 of your shows!

I send you picture if I had fuciona well !, that mistake and do not stay more than reinstall HMG before seeking !, No virus!

greetings
no error.jpg
no error.jpg (45.2 KiB) Viewed 3728 times

Re: MsgInfo stop next control event to run ?

Posted: Tue Sep 02, 2014 8:34 pm
by srvet_claudio
hmgchang wrote:Dear Masters,

I tried to use OnLostFocus on controls, but it stop the next Action to run ...
here is the ssw,;

Code: Select all

#include "hmg.ch"

Function Main()

    DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 550 ;
      HEIGHT 350 ;
      MAIN ;
      TITLE "MsgInfo function .... stop next event..." 
      
      DEFINE EDITBOX Edit_1
          ROW    30
          COL    30
          WIDTH  210
          HEIGHT 170
          VALUE "This Editbox control has no MsgInfo for OnLostFocus."
      END EDITBOX    
      
      DEFINE EDITBOX Edit_2
        ROW    30
        COL    280
        WIDTH  210
        HEIGHT 160
        VALUE "This control has MsgInfo for the OnLostFocus."
        ONLOSTFOCUS MsgInfo( "Leaving Editbox !")
      END EDITBOX  
      
      DEFINE BUTTON Button_1
        ROW    210
        COL    40
        WIDTH  100
        HEIGHT 28
        ACTION MsgInfo( "Button_1 Action")
        CAPTION "Button_1"
      END BUTTON
      
      DEFINE BUTTON Button_2
        ROW    210
        COL    290
        WIDTH  100
        HEIGHT 28
        ACTION Nil
        CAPTION "Button_2"
        ONLOSTFOCUS MsgInfo( "Button_2 LostFocus")
      END BUTTON
      
      DEFINE LABEL Label_1
        ROW    260
        COL    20
        WIDTH  480
        HEIGHT 20
        VALUE "The Edit_2 OnLostFocus event prevent the next control event to occure..."
      END LABEL
    
    END WINDOW
    
    CENTER WINDOW Form_1
    ACTIVATE WINDOW Form_1
    
Return NIL

The problem is not your code, the problem is in the behavior of the dialog box that in HMG returns the focus to the control that triggered.