Combobox in Folder

Post Reply
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Combobox in Folder

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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      
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

Yes, runs fine.
Thanks for your quick reply.

Best Regards,

Marco
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post 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
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post 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
Post Reply