Frederick Posted July 16, 2019 Share Posted July 16, 2019 I have the following OnKeyDown procedure for TUniDBEdit controls to move to the next control when the Return key is pressed. This procedure simulates pressing the Tab key. procedure TForm.edtCodeKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key=VK_RETURN then SelectNext(Sender as TUniControl,True); end; There is a discernible delay of between 0.5 to 1.0 second after the Return key is pressed before the next control is focused compared with pressing the Tab key. How do I speed up the process? -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1504) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 16, 2019 Share Posted July 16, 2019 1 hour ago, Frederick said: How do I speed up the process? Hi, Please see this demo: \FMSoft\Framework\uniGUI\Demos\Desktop\FormNavigate UniForm2.NavigateKeys.Enabled... UniForm2.NavigateKeys.Next.Key ... Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted July 16, 2019 Share Posted July 16, 2019 @ Frederick Use instead AJAX Event. This is Client Side Technic, very Fast See attachment ClientSide_Focus.zip 1 Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 16, 2019 Author Share Posted July 16, 2019 6 hours ago, Sherzod said: Hi, Please see this demo: \FMSoft\Framework\uniGUI\Demos\Desktop\FormNavigate UniForm2.NavigateKeys.Enabled... UniForm2.NavigateKeys.Next.Key ... Thanks. These settings allowed the Return key as Tab to match the speed of the Tab key. Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 16, 2019 Author Share Posted July 16, 2019 4 hours ago, Abaksoft said: @ Frederick Use instead AJAX Event. This is Client Side Technic, very Fast See attachment ClientSide_Focus.zip Thanks for the code. The Ajax code for the three TUniEdit controls on the left explicitly focuses the next edit control. How will the Ajax code be if it is to be based on the tab order? Quote Link to comment Share on other sites More sharing options...
bahry Posted July 17, 2019 Share Posted July 17, 2019 Hi, I use the following and very satisfied, in the MainForm properties KeyPreview := True NavigateKeys.Cycle := True; NavigateKeys.Enabled := True; NavigateKeys..Next.key := 13; NavigateKeys.Prior.Key :=13; NavigateKeys.Prior.ShiftState := [ussShift]; Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 17, 2019 Author Share Posted July 17, 2019 Thanks for the settings. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted July 18, 2019 Share Posted July 18, 2019 On 7/16/2019 at 4:03 PM, Frederick said: > How will the Ajax code be if it is to be based on the tab order? There is no thing to do with TAB key. TAB order is seting by default when you put your components on Design time. Ofcourse as you know it, you can change components order by opening sub menu "Create Order", on Right Click, on the form (designTime). Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 18, 2019 Author Share Posted July 18, 2019 4 hours ago, Abaksoft said: There is no thing to do with TAB key. TAB order is seting by default when you put your components on Design time. Ofcourse as you know it, you can change components order by opening sub menu "Create Order", on Right Click, on the form (designTime). In UniEdit1's OnAjaxEvent, you have the following code:- if EventName='CarriageReturn' then UniEdit2.JSInterface.JSCall('focus',[]); UniEdit2 is explicitly specified as the next edit control to focus to when the ENTER key is pressed in UniEdit1. This is repeated for UniEdit2 where the focus goes to UniEdit3 and then in UniEdit3, where the focus goes back to UniEdit1. UniEdit1 --> UniEdit2 --> UniEdit3 --> UniEdit1 This is fine if my tab order is UniEdit1 to UniEdit2 to UniEdit3. What if I change my tab order to UniEdit1 to UniEdit3 to UniEdit2? Do I have to change the event code to reflect the new tab order? Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted July 18, 2019 Share Posted July 18, 2019 We can not have the sun and the moon together You have to choose the correct behavior on design step. Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 18, 2019 Author Share Posted July 18, 2019 Thank you for your suggestion. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.