[lazarus] Recreating ListBox/ComboBox handle in win32

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Aug 27 04:04:07 EDT 2003


On Tue, 26 Aug 2003 18:23:29 -0300
Karl Brandt <pascalive at bol.com.br> wrote:

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

It can/should be:

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


Mattias

 
> 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?
> 
> karl
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives


-- 






More information about the Lazarus mailing list