convert LM_SORT message to interface method

git-svn-id: trunk@6012 -
This commit is contained in:
micha 2004-09-16 13:30:48 +00:00
parent f252d6adac
commit 2f36a0ca3c
7 changed files with 42 additions and 49 deletions

View File

@ -163,16 +163,10 @@ end;
procedure TCustomListBox.UpdateSorted;
------------------------------------------------------------------------------}
procedure TCustomListBox.UpdateSorted;
var AMessage : TLMSort;
begin
if not HandleAllocated then exit;
with AMessage do begin
Msg:= LM_SORT;
List:= FItems;
IsSorted:= FSorted;
end;
LockSelectionChange;
CNSendMessage(LM_SORT, Self, @AMessage);
TWSCustomListBoxClass(WidgetSetClass).SetSorted(Self, FItems, FSorted);
UnlockSelectionChange;
end;

View File

@ -3124,26 +3124,6 @@ begin
PLMScreenInit(Data)^.ColorDepth:= gdk_visual_get_system^.depth;
end;
LM_SORT:
begin
if (Sender is TControl) and assigned (data) then
begin
case TControl(Sender).fCompStyle of
csListBox,
csCheckListBox:
TGtkListStringList(TLMSort(Data^).List).Sorted:=
TLMSort(Data^).IsSorted;
{$IfDef GTK1}
csCListBox: TGtkCListStringList(TLMSort(Data^).List).Sorted :=
TLMSort(Data^).IsSorted;
{$Else}
else
DebugLn('TODO: TGtkWidgetSet.IntSendMessage3 LM_SORT');
{$Endif}
end
end
end;
LM_SETSEL:
{$IFdef GTK2}
begin
@ -8010,6 +7990,9 @@ end;
{ =============================================================================
$Log$
Revision 1.574 2004/09/16 13:30:48 micha
convert LM_SORT message to interface method
Revision 1.573 2004/09/15 19:38:55 micha
convert LM_GETSEL message to interface method

View File

@ -102,6 +102,7 @@ type
class function GetStrings(const ACustomListBox: TCustomListBox): TStrings; override;
class function GetItemIndex(const ACustomListBox: TCustomListBox): integer; override;
class procedure SetItemIndex(const ACustomListBox: TCustomListBox; const AIndex: integer); override;
class procedure SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); override;
end;
{ TGtkWSListBox }
@ -426,6 +427,21 @@ begin
end;
end;
procedure TGtkWSCustomListBox.SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean);
begin
case ACustomListBox.fCompStyle of
csListBox,
csCheckListBox:
TGtkListStringList(AList).Sorted := ASorted;
{$IfDef GTK1}
csCListBox: TGtkCListStringList(AList).Sorted := ASorted;
{$Else}
else
DebugLn('TODO: TGtkWidgetSet.IntSendMessage3 LM_SORT');
{$Endif}
end
end;
{ TGtkWSCustomComboBox }
function TGtkWSCustomComboBox.GetSelStart(const ACustomComboBox: TCustomComboBox): integer;

View File

@ -330,20 +330,6 @@ Begin
Else
Assert(False, Format('Trace:I don''t know how to destroy component %S', [Sender.ClassName]));
End;
LM_SORT:
Begin
If (Sender Is TControl) And Assigned(Data) Then
Begin
Case TControl(Sender).FCompStyle Of
csListBox:
TWin32ListStringList(TLMSort(Data^).List).Sorted :=
TLMSort(Data^).IsSorted;
csCListBox:
TWin32CListStringList(TLMSort(Data^).List).Sorted :=
TLMSort(Data^).IsSorted;
End
End
End;
LM_SETSEL:
Begin
If (Sender is TControl) And (TControl(Sender).FCompStyle In [csListBox, csCListBox]) And Assigned(Data) Then
@ -2131,6 +2117,9 @@ End;
{
$Log$
Revision 1.267 2004/09/16 13:30:48 micha
convert LM_SORT message to interface method
Revision 1.266 2004/09/15 19:38:56 micha
convert LM_GETSEL message to interface method

View File

@ -103,6 +103,7 @@ type
class function GetItemIndex(const ACustomListBox: TCustomListBox): integer; override;
class procedure SetItemIndex(const ACustomListBox: TCustomListBox; const AIndex: integer); override;
class procedure SetStyle(const ACustomListBox: TCustomListBox); override;
class procedure SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); override;
end;
{ TWin32WSListBox }
@ -313,6 +314,16 @@ begin
TWin32WidgetSet(InterfaceObject).RecreateWnd(ACustomListBox);
end;
procedure TWin32WSCustomListBox.SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean);
begin
case ACustomListBox.FCompStyle of
csListBox:
TWin32ListStringList(AList).Sorted := ASorted;
csCListBox:
TWin32CListStringList(AList).Sorted := ASorted;
end;
end;
{ TWin32WSCustomComboBox }
function TWin32WSCustomComboBox.GetSelStart(const ACustomComboBox: TCustomComboBox): integer;

View File

@ -72,7 +72,6 @@ const
LM_GETSELTEXT = LM_COMUSER+66;
LM_SETSELTEXT = LM_COMUSER+67;
LM_SORT = LM_COMUSER+74;
LM_SETSEL = LM_COMUSER+77;
LM_SETSELMODE = LM_COMUSER+78;
LM_SETBORDER = LM_COMUSER+79;
@ -579,12 +578,6 @@ type
TLMTimeChange = TLMNoParams;
TLMSort = record
Msg : Cardinal;
List : TObject;
IsSorted : boolean;
end;
//Used to set the statusbar's text
PLMSetControlText = ^TLMSetControlText;
TLMSetControlText = record
@ -834,7 +827,6 @@ begin
LM_GETSELTEXT :Result:='LM_GETSELTEXT';
LM_SETSELTEXT :Result:='LM_SETSELTEXT';
LM_SORT :Result:='LM_SORT';
LM_SETSEL :Result:='LM_SETSEL';
LM_SETSELMODE :Result:='LM_SETSELMODE';
LM_SETBORDER :Result:='LM_SETBORDER';
@ -947,6 +939,9 @@ end.
{
$Log$
Revision 1.106 2004/09/16 13:30:48 micha
convert LM_SORT message to interface method
Revision 1.105 2004/09/15 19:38:55 micha
convert LM_GETSEL message to interface method

View File

@ -98,6 +98,7 @@ type
class function GetItemIndex(const ACustomListBox: TCustomListBox): integer; virtual;
class procedure SetItemIndex(const ACustomListBox: TCustomListBox; const AIndex: integer); virtual;
class procedure SetStyle(const ACustomListBox: TCustomListBox); virtual;
class procedure SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); virtual;
end;
TWSCustomListBoxClass = class of TWSCustomListBox;
@ -216,6 +217,10 @@ procedure TWSCustomListBox.SetStyle(const ACustomListBox: TCustomListBox);
begin
end;
procedure TWSCustomListBox.SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean);
begin
end;
{ TWSCustomComboBox }
function TWSCustomComboBox.GetSelStart(const ACustomComboBox: TCustomComboBox): integer;