[lazarus] Recreating ListBox/ComboBox handle in win32

Karl Brandt pascalive at bol.com.br
Wed Aug 27 23:46:14 EDT 2003

Mattias Gaertner wrote:
> On Tue, 26 Aug 2003 18:23:29 -0300
> Karl Brandt <pascalive at bol.com.br> wrote:
>>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 ...
> It can/should be:
>  -> call RecreateWnd
>    -> call CreateHandle
>      -> LM_CREATE
>        -> create sorted like Delphi
>        <-
>      -> LM_SETSORTED
>        <- already set
> Probably we can remove the LM_SETSORTED call in the LCL on initialize wnd.

We can check the current state of these properties and call recreate 
only if they are different(LCL and Win32).
  But in most cases the check will be useless:
Just after creating the control the Recreate will never be called.
Afer runtime change, will always be recreated because LCL already check 
if the value is different

I prefer setting the Sort/SelMode at create handling and removing 
UpdateSorted and UpdateSetSelMode from CreateHandle(TCustomListBox)
and UpdateSorted from CreateWnd(TCustomComboBox)
This will avoid the cited redndant check.

The only drawback is that gtk intf must be updated (set the Sort/SelMode 
at create handling)

I'm sending a patch that works changing the LCL as said above. Tested.
To work without changing LCL is necessary to do the second check, which 
i can do if you prefer.

It also fixes the order of the items in assign and size issues with 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip00035.zip
Type: application/octet-stream
Size: 2992 bytes
Desc: "recreatelist.zip"
Url : http://localhost/pipermail/lazarus/attachments/20030827/4c7b9acf/zip00035.obj

More information about the Lazarus mailing list