[Lazarus] TCombobox major failure :(

Michael Van Canneyt michael at freepascal.org
Wed Jul 9 17:24:24 CEST 2008



On Wed, 9 Jul 2008, Mattias Gärtner wrote:

> Zitat von Michael Van Canneyt <michael at freepascal.org>:
> 
> > On Wed, 9 Jul 2008, Mattias Gärtner wrote:
> >
> > > Zitat von Michael Van Canneyt <michael at freepascal.org>:
> > >
> > > > Hi,
> > > >
> > > > In GTK 1, the TCombobox somehow looses the 'OnChange' event after it was
> > > > fired
> > > > once, but only when the items list is sorted.
> > > >
> > > > Steps to reproduce:
> > > > - Drop TCombobox on a new form
> > > > - Set items (one two three four five)
> > > > - Set Sorted=True  - this is required !!
> > > > - Set Style=csDropDownlist (don't know if this is required)
> > > > - In OnChange event handler show a message or something like it.
> > > > - Run project.
> > > > - Select item. Message appears.
> > > > - Select another item. Message does not appear.
> > > >
> > > > The event handler is still <> Nil (I added code to check this),
> > > > but is simply never called any more when something is selected.
> > > >
> > > > And in GTK 2 the event handler is always called twice !!
> > >
> > > The GTK2 sends an LMCHANGED for the change of the edit and an LMSELCHANGE
> > for
> > > the change of the ItemIndex.
> > > The LCL sends the second OnChange if OnSelect is nil. I don't know why.
> > > Maybe the LCL should be extended to not send the change two times?
> >
> > Yes, because this is not consistent with the other widgetsets, and not
> > consistent with Delphi ?
> 
> I don't know if the OnChange is wrong or the OnSelect<>nil test is wrong.
> gtk1 does not send LMSELCHANGE events, so there the case does not happen.

Hm. In each case, It should never fire an event twice.
 
> 
> > > > Is this a known issue ? I'm using Lazarus revision 15540.
> > > > Should I add it to the bug tracker ?
> > > > Because this is IMHO a major regression...
> > >
> > > I will take a look at gtk1.
> >
> > Thanks. That would be great.
> 
> Please try 15725.

Works like a charm, thanks for the fix ! 
Now the Data Desktop works again as designed :-)

Michael.


More information about the Lazarus mailing list