Jump to content

SelectNext() Is Slow


Frederick

Recommended Posts

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)
 

Using Tab To Tab.gif

Using Return To Tab.gif

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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];

 

 

 

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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?
 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...