[lazarus] Patch for win32

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Jan 1 06:07:54 EST 2003


On Tue, 31 Dec 2002 18:15:22 -0200
Karl Brandt <pascalive at bol.com.br> wrote:

> Attached is a patch that improves TListBox/TComboBox in win32
> It implements the properties Sorted, MultiSelect, ExtendedSelect and fix 
> other issues.
> It also cleans the recreatewnd interface code.

Thx. Applied.


> Togheter is a demo program i used to test the changes
> 
> Saying of TComboBox, the LCL doesn't notify to interface the 
> CustomComboBox.Sorted state in CreateHandle. I propose to add in 
> CreateHandle, after the creation of the interface StringList, a LM_SORT 
> message to interface,maybe creating a UpdateSorted method, like in 
> ListBox , so the interface can know/modify the design time Sorted state.

Done.


> ------
> See TCustomListBox.GetSelected(Index : integer) : boolean;
> begin
>   if (Index < 0) or (Index >= Items.Count) then
>     raise Exception.Create('TCustomListBox.GetSelected: index 
> '+IntToStr(Index)
>       +' out of bound. Count='+IntToStr(Items.Count));
>   if HandleAllocated then
>    >> Result:= (CNSendMessage(LM_GETSEL, Self, @Index) >= 0) -> allways
>    >true
>   else
>     Result:=clbiSelected in GetListBoxItemRecord(FItems,Index)^.Flags;
> end;
> I don't know about the Gtk part but in win32 when a item is not selected 
> it returns 0 otherwise >0.
> So in win32 Result is allways True
> It would not Result:= (CNSendMessage(LM_GETSEL, Self, @Index) > 0) the 
> correct ?
> Or we must check this in interface?

Fixed for gtk. I hope it also work for win32.


> -----
> BTW:
> Sometimes the main window(of a lcl app) stops to respond ,being 
> necessary to switch to another window and get back to respond again.
> Is someone getting the same problem?

Not yet. Is this an old problem or a new problem?


Mattias






More information about the Lazarus mailing list