[Qt] ComboBox OnChange and OnSelect

Marcin Dębicki alterfenix at gmail.com
Tue Dec 22 19:51:11 CET 2009


1. on CBN_EDITCHANGE message
2. procedure TCustomCombo.Select;
begin
  if Assigned(FOnSelect) then
    FOnSelect(Self)
  else
    Change;
end;
3. VK_BACK key press
4. function TCustomComboBox.SelectItem(const AnItem: string): Boolean;
var
  Idx: Integer;
  ValueChange: Boolean;
begin
  if Length(AnItem) = 0 then
  begin
    Result := False;
    ItemIndex := -1;
    Change;
    exit;
  end;

Best regards
Marcin Dębicki

2009/12/22 zeljko <zeljko at holobit.net>:
> On Tuesday 22 December 2009 16:59, Juha Manninen wrote:
>> On tiistai, 22. joulukuuta 2009 16:59:46 zeljko wrote:
>> > It's easy to get delphi behaviour with qt, just write here what is the
>> >  right behaviour.
>>
>> Well, I don't remember it and I can't test it now because I don't have
>> Delphi or even Windows in my machine currently.
>>
>> I was working with Delphi for many years. This autumn things changed as I
>> started studying again (as a middle aged man).
>>
>> Anyway, I think OnChange and OnSelect should behave differently from each
>> other.
>
> I must know what's correct way in case of Items.Add(), Items.Clear() etc.
> Someone got Delphi here ?
> Does OnChange() triggers when adding or clearing items ?
>
> _______________________________________________
> Qt mailing list
> Qt at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/qt
>




More information about the Qt mailing list