View unanswered posts | View active topics It is currently Sat May 18, 2013 8:30 pm



Reply to topic  [ 5 posts ] 
Combobox lostfocus problem - is this a bug? 
Author Message
User avatar

Joined: Tue Jul 29, 2008 6:30 pm
Posts: 3608
Location: Sivakasi, India
Post Combobox lostfocus problem - is this a bug?
Hi

Please consider this sample.

Code:
#include <hmg.ch>

Function Main
   define window sample at 0, 0 width 300 height 300 main
      define combobox one
         row 10
         col 10
         width 100
         on lostfocus do_one()
      end combobox
      define textbox two
         row 40
         col 10
         width 100
         on lostfocus do_two()
      end textbox
   end window
   sample.one.additem( 'One' )
   sample.one.additem( 'Two' )
   sample.center()
   sample.activate()
   
Return

function do_one
   if sample.one.value == 0
      sample.one.setfocus()
   endif
   return nil
   
function do_two
   if len( alltrim( sample.two.value ) ) == 0
      sample.two.setfocus()
   endif
   return nil


While running, just press <tab> and the focus will move to the second control. But, I think it should be in the first control itself. Is this a bug?

_________________
East or West HMG is the Best.
South or North HMG is worth.


Thu May 10, 2012 7:06 pm
Profile YIM WWW
User avatar

Joined: Wed Sep 08, 2010 1:18 pm
Posts: 544
Location: Paranaguá - Brasil
Post Re: Combobox lostfocus problem - is this a bug?
Hi Mr. Rathinagiri,

It is not a bug. You have commited a little mistake in your function do_two replace this line: sample.two.setfocus() by this sample.one.setfocus(). It was backing at same place, after two would pass to combobox one.

_________________
A hug xBase-d in HMGing
You may share your doubts and solutions with all the colleagues by forum. Please do not send me PMs or eMails for technical proposes.


Thu May 10, 2012 7:37 pm
Profile
User avatar

Joined: Fri Aug 01, 2008 5:42 am
Posts: 362
Location: Ukraine
Post Re: Combobox lostfocus problem - is this a bug?
rathinagiri wrote:
Hi

Please consider this sample.
...
While running, just press <tab> and the focus will move to the second control. But, I think it should be in the first control itself. Is this a bug?

Hi Rathi,

No, it isn't. You should correct your function do_two as showed in the updated sample below:
Code:
#include <hmg.ch>

Function Main
   define window sample at 0, 0 width 300 height 300 main
      define combobox one
         row 10
         col 10
         width 100
         on lostfocus do_one()
      end combobox
      define textbox two
         row 40
         col 10
         width 100
         on lostfocus do_two()
      end textbox
   end window
   sample.one.additem( 'One' )
   sample.one.additem( 'Two' )
   sample.center()
   sample.activate()
   
Return

function do_one
   if sample.one.value == 0
      sample.one.setfocus()
   endif
   return nil
   
function do_two
   if len( alltrim( sample.two.value ) ) == 0 .and. sample.one.value != 0
      sample.two.setfocus()
   endif
   return nil

Hope that helps :idea:

_________________
Kind Regards,
Grigory Filatov


Fri May 11, 2012 7:29 am
Profile WWW
User avatar

Joined: Tue Jul 29, 2008 6:30 pm
Posts: 3608
Location: Sivakasi, India
Post Re: Combobox lostfocus problem - is this a bug?
Control 'one' lostfocus is fired after control 'two' gotfocus.

Am I correct?

_________________
East or West HMG is the Best.
South or North HMG is worth.


Fri May 11, 2012 11:36 am
Profile YIM WWW
User avatar

Joined: Wed Sep 08, 2010 1:18 pm
Posts: 544
Location: Paranaguá - Brasil
Post Re: Combobox lostfocus problem - is this a bug?
I think so. Must be same effect Wrap (navigation thru components)

_________________
A hug xBase-d in HMGing
You may share your doubts and solutions with all the colleagues by forum. Please do not send me PMs or eMails for technical proposes.


Fri May 11, 2012 3:59 pm
Profile
Display posts from previous:  Sort by  
Reply to topic 
 [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.