[lazarus] Recreating ListBox/ComboBox handle in win32

Karl Brandt pascalive at bol.com.br
Tue Aug 26 00:35:50 EDT 2003


There's a problem (AKA bug) in RecreateListControl: the windowproc 
address is not being set, which breaks link between listboxes and 
comboboxes and LCL.
I tried to rework the procedure setting the properties at same order of 
LM_CREATE, but i got unusable controls.
The patch comments RecreateListControl calls and rewrite the procedure 
to accomplish the above, although without sucess.
It also cleans SetComboHeight(Sending WM_SIZE message is no more 
necessary) and fix a typo at win32List.Add
Note that MultiSelect, Sorted implementation rellies at recreating the 
handle.

I see four ways to go:

1) Find a way to change MultiSelect, Sorted properties under win32 on 
the fly, without recreating handle. The ideal, although improbable.

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.
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.


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 :-)

karl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip00032.zip
Type: application/octet-stream
Size: 2966 bytes
Desc: "new.zip"
Url : http://localhost/pipermail/lazarus/attachments/20030826/d334fa93/zip00032.obj


More information about the Lazarus mailing list