[lazarus] Recreating ListBox/ComboBox handle in win32

Karl Brandt pascalive at bol.com.br
Tue Aug 26 17:23:52 EDT 2003

Mattias Gaertner wrote:

>>2) The properties could be set in LM_CREATE handling, so 
>>TWincontrol.RecreateWnd could be called. Now the cited properties are 
>>set after LM_CREATE, with LM_SETSORTED and LM_SETSELMODE which causes a 
>>endless loop calling RecreateWindow.
> Endless loop?
> Is the win32 intf checking, if MultiSelect and Sort are already set? A
> RecreateWnd should not result in an endless loop. It is an allowed
> operation. Especially as the VCL uses it a lot.

The problem is that UpdateSelection and updateSorted are called inside 
CreateHandle so this is the sequence:

LM_SETSORTED -> call RecreateWnd -> call CreateHandle - Send 
LM_SETSORTED -> call RecreateWnd -> call CreateHandle ...

This was my first try when i try to get selection yo work

>>This has a good side effect: now the handle are created three times for 
>>each ListBox(LM_CREATE,LM_SETSORTED,LM_SETSELMODE) and twice for each
>>combo. The problem is that should be defined at LCL that these features
>>should be checked/set at create handling.
>>This is the most viable
>>3) Doesn't allow to change these properties at runtime under win32 ????
>>4) Fix the problem in RecreateListControl. Volunteers, please.
> Why not fix LM_CREATE in the win32 intf to create a Handle with the correct
> flags and add some code to LM_SETxxx to check if RecreateWnd is needed?

But if is needed to recreate the above problems will happen

>>PS: not recreating the handles, makes the listboxes to be drawn (but 
>>works fine)incorrectly (Looks the same problem as TMemo), but it's not a 
>>new bug. It's a previous hidden bug. In the other side, allows the user 
>>to use the combobox at ObjectInspector :-)
> :{
> a phyrus victory
sorry but what's phyrus?


More information about the Lazarus mailing list