Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Combo text triggering
Tue, Oct 3 2017 11:48 AMPermanent Link

Matthew Jones

The Button Combo Box can take text input. There is the KeyPressInterval property which allows us to control when the reset of the built up text search is reset.

Is it possible to delay the trigger of the OnChange until that time occurs?

I ask because I am doing a lookup on the OnChange, and the combo gets closed - not sure if that is me or it, perhaps losing focus. But it means that the user cannot continue to use the drop down to mouse up and down. Hmm, maybe I'm not being clear. I need to see exactly what is happening when. In the meantime, if delaying the OnChange is possible, let me know!

--

Matthew Jones
Tue, Oct 3 2017 2:10 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< The Button Combo Box can take text input. There is the KeyPressInterval property which allows us to control when the reset of the built up text search is reset.

Is it possible to delay the trigger of the OnChange until that time occurs? >>

That's exactly what it does.  If the KeyPressInterval hasn't been met or exceeded yet, then the control keeps the item index for the drop-down list as-is.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Oct 4 2017 4:08 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> Is it possible to delay the trigger of the OnChange until that time occurs? >>
>
> That's exactly what it does.

It is, and it isn't. 8-)

Create a simple form, buttoncombo, label. Set keypress time to 2000 to ensure test is good. Add OnChange event as below. Add list items:

one
two
three
four
threesome
five
1234567890
six
threemore

Now watch as you type "four". Or threemore (or threesome). What happens is that the OnChange is triggered whenever the selection "jumps" to a new match. Which means that it is pretty much guaranteed to jump the first time, and then again for each change.
I just have to work out how I'm stealing focus that the creation of new windows is causing the combo to close.


--

Matthew Jones


  TForm1 = class(TForm)
     ButtonComboBox1: TButtonComboBox;
     Label1: TLabel;
     procedure ButtonComboBox1Change(Sender: TObject);
  private
     { Private declarations }
m_nCount : Integer;
  public
     { Public declarations }
  end;

var
  Form1: TForm1;

implementation

procedure TForm1.ButtonComboBox1Change(Sender: TObject);
begin                                  
   Inc(m_nCount);
   Label1.Caption := IntToStr(m_nCount);
end;
Wed, Oct 4 2017 12:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Now watch as you type "four". Or threemore (or threesome). What happens is that the OnChange is triggered whenever the selection "jumps" to a new match. Which means that it is pretty much guaranteed to jump the first time, and then again for each change. >>

So, what you're saying is that you want the *first* keystroke to observe the keypress interval also ?  Apart from that behavior, I'm not seeing any other change events within the keypress interval timeframe, which is exactly how it should behave.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Oct 4 2017 12:13 PMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> So, what you're saying is that you want the first keystroke to observe the keypress interval also ?

Yes, nothing until the time ticks away. That said, right now people can choose how to handle it - tick away or immediate, so perhaps leaving as-is is the best option anyway. If you take it away, it removes the choice.

--

Matthew Jones
Wed, Oct 4 2017 1:46 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Yes, nothing until the time ticks away. That said, right now people can choose how to handle it - tick away or immediate, so perhaps leaving as-is is the best option anyway. If you take it away, it removes the choice. >>

Actually, it's better to use a timer, so I changed it to do so.  There's all sorts of weirdness with the way that it's being done now, and with a timer it's very consistent from front to back.

Tim Young
Elevate Software
www.elevatesoft.com
Image