Page 1 of 1

Combobox in Folder

Posted: Thu Dec 15, 2005 8:41 pm
by Marco Turco
It's the Folder time today ;- )

Well, another problem - simple, I hope.

When I have the focus on a combobox in a dialog
and I press the Enter key then the focus go to the next control (a get for example)

The problem is that it doesn't runs on a folder.
If I have the focus on a combobox in a folder
and I press the Enter key then the focus REMAINS ON THE COMBOBOX instead to go to the next control.

The self-contained at www.softwarexp.co.uk/beta/test.zip
show this problem.

I checked the folder,tcontrol and combobox class looking for a solution but unsuccesfully.

Any solution availables ?

Thanks in advance

Best Regards,

Marco

Posted: Fri Dec 16, 2005 12:25 am
by Antonio Linares
Marco,

Just add this method to Class TComboBox:

Code: Select all

METHOD KeyChar( nKey, nFlags ) CLASS TComboBox

   if nKey == VK_RETURN
      ::oWnd:GoNextCtrl( ::hWnd )
   endif
   
return nil      

Posted: Fri Dec 16, 2005 8:24 am
by Marco Turco
Yes, runs fine.
Thanks for your quick reply.

Best Regards,

Marco

Posted: Fri Dec 16, 2005 8:55 am
by Enrico Maria Giordano
Great!

EMG

Posted: Fri Dec 16, 2005 11:59 pm
by James Bott
Marco,

Keep in mind that using the Enter key to move from field to field is DOS program behavior NOT Windows program behavior. Users expect the Enter key to trigger the default pushbutton (ususally OK). They will surprised and disappointed when it doesn't.

There is good reason to have it trigger the default pushbutton. This makes it easy to edit and save without having to use the mouse. If Enter moves to the next control then they have to go through all the controls to get to the button or use the mouse.

James

Posted: Sat Dec 17, 2005 9:03 am
by Enrico Maria Giordano
I already tried to convice him but there is no hope. :-)

EMG

Posted: Sat Dec 17, 2005 9:05 am
by Marco Turco
James,
you are right.

However about my specific situation my target was a quick migration to my customers from my old Clipper app to the new FWH app to avoid the costs of two platforms updates and I could make it immediatly leaving the same input process in the new Windows app.

Furthermore there still are a lot of customers coming from DOS , Windows "hibrid" and terminal mode apps so provide this input process still have a commercial advantages.

In a data insert dialog like:

>combobox
>combobox
>get
>get

>button (to write data)

the end user only need to press the same Enter key to complete the input sequence and write data on disk - like a DOS app - but can also work with mouse if it prefer.

Best Regards,

Marco

Posted: Sun Dec 18, 2005 8:45 am
by RAMESHBABU
If the application is a orginally developed for the 1st time in Windows
( not migrated from any DOS based application ), Mr.James statement is
correct. But in other case I agree with Mr.Marco.

- Ramesh Babu