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,8 +1784,12 @@ 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;
@ -1794,13 +1798,16 @@ 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^));
Result:= g_list_index(PGtkList(GetWidgetInfo(Pointer(Handle),
True)^.ImplementationWidget)^.selection, ListItem);
end end
else if (Sender as TControl).fCompStyle = csCListBox then else if (Sender as TControl).fCompStyle = csCListBox then
begin begin
{ Get the selections } { Get the selections }
GList:= PGtkCList(GetWidgetInfo(Pointer(Handle), True)^.ImplementationWidget)^.selection; GList:= PGtkCList(GetWidgetInfo(Pointer(Handle),
True)^.ImplementationWidget)^.selection;
Result := -1; { assume: nothing found } Result := -1; { assume: nothing found }
while Assigned(GList) do begin while Assigned(GList) do begin
if integer(GList^.data) = integer(Data^) then begin if integer(GList^.data) = integer(Data^) then begin
@ -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