Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-01

Patch for win32

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Smat
to Karl Brandt: Attached is a patch that improves TListBox/TComboBox in win32 It implements the…
Karl Brandt wrote 16 lines
> >> ----- >> 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? > > > In really i don't use lcl apps very often, i noticed this (under win32) while testing the changes i made three days ago ,so i can't assure it's a new problem or not :-(

I found on my computer a version from 17.12.2002 and there is the problem too.

Martin Smat.

Reply by email

Karl Brandt

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

Happy New Year :-)

Karl Brandt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip00008.zip
Type: application/octet-stream
Size: 6129 bytes
Desc: "win32list.zip"
Url : http://localhost/pipermail/lazarus/attachments/20021231/ef749109/zip00008.obj

Reply by email

Karl Brandt
to Karl Brandt
Mattias Gaertner wrote 30 lines
On Tue, 31 Dec 2002 18:15:22 -0200 Karl Brandt 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.

Thanks

Show quoted text 28 lines
>------ >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.

Yes

Show quoted text 14 lines
>----- >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?

In really i don't use lcl apps very often, i noticed this (under win32) while testing the changes i made three days ago ,so i can't assure it's a new problem or not :-(

Karl Brandt

Reply by email

Mattias Gaertner
to Karl Brandt: Attached is a patch that improves TListBox/TComboBox in win32 It implements the…
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.

Show quoted text 7 lines
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.

Show quoted text 19 lines
------ 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.

Show quoted text 5 lines
----- 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

Reply by email