[Lazarus] The drop-down menu not list data table

peng pengtu321 at gmail.com
Mon Jul 14 20:20:09 CEST 2008

On Thu, 10 Jul 2008 00:13:59 -0300
Luiz Americo Pereira Camara <luizmed at oi.com.br> wrote:

> Luiz Americo Pereira Camara wrote:
> > Mattias Gärtner wrote:
> >   
> >> 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.
> >>
> >>     
> Gtk1 still sends LM_SELCHANGE (that is mapped to OnChange at LCL
> level). Currently it does not send LM_CHANGED by a patch done by you
> (rev 10767). Maybe this code does not work for gtk2 (or the message
> is coming for elsewhere). Not sure since i'm on a win32 machine now.
> Some info on what all of this is about here: 
> http://lazarusroad.blogspot.com/2006/12/eliminating-duplicate-events-of.html
> > The call to OnChange if Select is nil is Delphi compatible.
> > Currently LCL win32 is fully compatible with Delphi regarding this
> > issue.
> >
> > There's a lengthy bug report about this 
> > (http://bugs.freepascal.org/view.php?id=1495). See comment 0002113
> > to the Delphi behavior i described.
> >
> > This bug was fixed some time ago so its a regression. Revising the 
> > changes done at that time can lead to the fix (i also provided a
> > patch but Matias used another approach).
> >   
> Two changes related are at revision 10767 (see above) and 10993 
> (unlikely to be the cause)
> I can take a look at this issue but only in the next Sunday.

I read the thread again and will try to summarize it. Please confirm or
correct me:

When the user selects an item via the popup list, then an LM_SELCHANGE
event should be fired. OTOH the text changes too, so the LM_CHANGE
event makes sense too. But according to Luis the winapi does not send
the LM_CHANGE. The VCL follows the winapi and triggers only an OnSelect,
but not an OnChange.
I agree with Luis the winapi (and VCL) is somewhat inconsistent here,
because you can not use OnChange to follow every change.
Luis was fearless enough to write some gtk signal stops to mimic the
winapi behavior. I think this sounds too much like emulating the
winapi, which is not the goal of the LCL.

My question is:
What about the other widgetsets?
Can they easily distinguish between a popup selection change and
other changes?
If not, then we should redefine the LM_CHANGE, LM_SELCHANGE events for
the combobox. The TComboBox should be Delphi compatible, the
messages don't need to be. 
For example: It is quite simple to add a LM_CHANGE in the win32 intf. 
TComboBox could check before triggering an OnChange if something has
changed, which should be quite Delphi compatible.


More information about the Lazarus mailing list