MsgInfo stop next control event to run ?

Moderator: Rathinagiri

Post Reply
User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia

MsgInfo stop next control event to run ?

Post 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

Attachments
aftermsginfo.JPG
aftermsginfo.JPG (31.55 KiB) Viewed 3734 times
Just Hmg It !
User avatar
hmgchang
Posts: 273
Joined: Tue Aug 13, 2013 4:46 am
Location: Indonesia

Re: MsgInfo stop next control event to run ?

Post by hmgchang »

Where do I do wrong ? pls advise...


TIA

rgds,
Chang
Just Hmg It !
User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: MsgInfo stop next control event to run ?

Post by Agil Abdullah »

Hi Chang,

Apa kabar? Salam kenal.

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

-Agil
Kemang, Jakarta Selatan, Indonesia
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: MsgInfo stop next control event to run ?

Post 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 3686 times
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: MsgInfo stop next control event to run ?

Post 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.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply