Problema onlostfocus/onenter

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Problema onlostfocus/onenter

Post by luisvasquezcl »

Hola estimados,
Tengo un combobox al cual le asigné la función validar() al evento onLostFocus.
Resulta que al presionar Enter, no ejecuta el evento onLostfocus, ese es el comportamiento correcto?.
Saludos cordiales,
Luis Vasquez
Uso : HMG.3.4.3
SisOp: Windows 10

Hello dears,
I have a combobox which I assigned the function validate () to the onLostFocus event.
It turns out that pressing Enter does not run the onLostfocus event, is that the correct behavior ?.
Best regards,
Luis Vasquez
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Problema onlostfocus/onenter

Post by dragancesu »

Try ON CHANGE
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Problema onlostfocus/onenter

Post by mol »

OnChange is called everytime when you select any option or enter character
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Problema onlostfocus/onenter

Post by Pablo César »

Hi Luis,

ENTER will not cause losting event in the own component but you can use ON ENTER event at ComboBox adding your own procedure to reforces Validar().

Also you can test with SET NAVIGATION EXTENDED in case user love the ENTER key... :)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Problema onlostfocus/onenter

Post by Pablo César »

Sorry, my indication is not appropriated.

Please consider ON CHANGE as correct and been indicated by colleagues.
Last edited by Pablo César on Mon Apr 24, 2017 3:53 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Problema onlostfocus/onenter

Post by Rathinagiri »

Can you please send a small sample?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: Problema onlostfocus/onenter

Post by EduardoLuis »

Hi Luis

Try ON CLOSEUP instead ON LOSTFOCUS, this must work like you want
Cordialmente
Eduardo


Hola Luis

Prueba ON CLOSEUP en lugar de ON LOSTFOCUS, esto tendría que funcionar como deseas.
With regards
Eduardo
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Problema onlostfocus/onenter

Post by luisvasquezcl »

Thanks for your help, I will send a sample today or tomorrow.
best regards,
Luis Vasquez.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Problema onlostfocus/onenter

Post by Rathinagiri »

For me, this sample works fine.

Code: Select all

#include <hmg.ch>

Function Main
   set navigation extended
   define window main at 0, 0 width 400 height 300 main
      define label text1label
         row 10
         col 10
         width 100
         value 'Text1'
      end label
      define textbox t1
         row 10
         col 110
         width 200
         value 'Some text'
      end textbox   
      define label combo1label
         row 40
         col 10
         width 100
         value 'Combo1'
      end label
      define combobox c1
         row 40
         col 110
         width 200
         items { 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' }         
         value 1
         onlostfocus c1focuslost()
      end combobox   
      define label text2label
         row 70
         col 10
         width 100
         value 'Text2'
      end label
      define textbox t2
         row 70
         col 110
         width 200
         value 'Some text'
      end textbox   
   end window
   main.center
   main.activate
Return

function c1focuslost
   msginfo( 'Here' )
return nil   
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Problema onlostfocus/onenter

Post by dragancesu »

Without your sample we need to guess what, maybe this

p.s. not so good example, it's slow but work
Attachments
onchange.zip
(1001.59 KiB) Downloaded 170 times
Post Reply