MG: added DrawItem to TComboBox/TListBox

git-svn-id: trunk@888 -
This commit is contained in:
lazarus 2002-02-09 01:47:15 +00:00
parent 62571bb2d4
commit f4c44fae10

View File

@ -1784,32 +1784,39 @@ begin
LM_GETSELCOUNT : LM_GETSELCOUNT :
begin begin
case (Sender as TControl).fCompStyle of case (Sender as TControl).fCompStyle of
csListBox : Result:= g_list_length(PGtkList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget)^.selection); csListBox :
csCListBox: Result:= g_list_length(PGtkCList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget)^.selection); Result:=g_list_length(PGtkList(GetWidgetInfo(Pointer(Handle),
True)^.ImplementationWidget)^.selection);
csCListBox:
Result:= g_list_length(PGtkCList(GetWidgetInfo(Pointer(Handle),
True)^.ImplementationWidget)^.selection);
end; end;
end; end;
LM_GETSEL : LM_GETSEL :
begin begin
if (Sender as TWinControl).fCompStyle = csListBox then if (Sender as TWinControl).fCompStyle = csListBox then
begin begin
{ Get the child in question of that index } { Get the child in question of that index }
ListItem:= g_list_nth_data(PGtkList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget)^.children, Integer(Data^)); ListItem:= g_list_nth_data(PGtkList(GetWidgetInfo(Pointer(Handle),
Result:= g_list_index(PGtkList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget)^.selection, ListItem); True)^.ImplementationWidget)^.children, Integer(Data^));
end Result:= g_list_index(PGtkList(GetWidgetInfo(Pointer(Handle),
else if (Sender as TControl).fCompStyle = csCListBox then True)^.ImplementationWidget)^.selection, ListItem);
begin end
{ Get the selections } else if (Sender as TControl).fCompStyle = csCListBox then
GList:= PGtkCList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget)^.selection; begin
Result := -1; { assume: nothing found } { Get the selections }
while Assigned(GList) do begin GList:= PGtkCList(GetWidgetInfo(Pointer(Handle),
if integer(GList^.data) = integer(Data^) then begin True)^.ImplementationWidget)^.selection;
Result:= 0; Result := -1; { assume: nothing found }
Break; while Assigned(GList) do begin
end else if integer(GList^.data) = integer(Data^) then begin
GList := GList^.Next; Result:= 0;
end; Break;
end; end else
GList := GList^.Next;
end;
end;
end; end;
LM_SETLIMITTEXT : LM_SETLIMITTEXT :
@ -5900,6 +5907,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.230 2002/10/04 14:24:15 lazarus
MG: added DrawItem to TComboBox/TListBox
Revision 1.229 2002/10/04 07:28:14 lazarus Revision 1.229 2002/10/04 07:28:14 lazarus
MG: fixed showmodal without Application.MainForm MG: fixed showmodal without Application.MainForm