mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 00:38:14 +02:00
fixed deleting selected TListBox item under gtk1 from Collin
git-svn-id: trunk@6946 -
This commit is contained in:
parent
6d17a20f5d
commit
08fd79653c
@ -592,6 +592,8 @@ end;
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TGtkListStringList.Delete(Index: integer);
|
||||
var
|
||||
Next: PGList;
|
||||
begin
|
||||
UpdateItemCache;
|
||||
RemoveItemCallbacks(Index);
|
||||
@ -607,6 +609,16 @@ begin
|
||||
ReAllocMem(FCachedItems,SizeOf(PGtkListItem)*FCachedCapacity);
|
||||
end;
|
||||
// remove item from gtk list
|
||||
{$IFDEF Gtk1}
|
||||
{ Work round gtk bug - crashes if deleting first item in list
|
||||
and item has focus and there are remaining items }
|
||||
if (Index = 0) and (PGTKContainer(FGtkList)^.focus_child <> nil)
|
||||
and (gtk_list_child_position(FGtkList,PGTKContainer(FGtkList)^.focus_child) = 0) then begin
|
||||
Next := FGtkList^.children^.next;
|
||||
if Next <> nil then
|
||||
gtk_widget_grab_focus(Next^.data);
|
||||
end;
|
||||
{$ENDIF}
|
||||
gtk_list_clear_items(FGtkList, Index, Index + 1);
|
||||
{$IFDEF CheckGtkList}
|
||||
ConsistencyCheck;
|
||||
@ -964,6 +976,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.30 2005/03/13 22:35:17 mattias
|
||||
fixed deleting selected TListBox item under gtk1 from Collin
|
||||
|
||||
Revision 1.29 2005/03/07 21:59:45 vincents
|
||||
changed hexstr(cardinal()) for pointers to dbgs() and other 64-bits fixes from Peter Vreman
|
||||
|
||||
|
@ -5029,6 +5029,7 @@ begin
|
||||
GDIObj^.GDIFontObject:= GetDefaultFont(true);
|
||||
{$EndIf}
|
||||
Result := hFont(GDIObj);
|
||||
;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -7918,10 +7919,22 @@ begin
|
||||
ImplWidget:= WinWidgetInfo^.CoreWidget;
|
||||
if ImplWidget <> nil then begin
|
||||
// handle has a ImplementationWidget
|
||||
{$IfDef VerboseFocus}
|
||||
DebugLn(' E taking ImplementationWidget');
|
||||
{$EndIf}
|
||||
NewFocusWidget:=ImplWidget;
|
||||
if GtkWidgetIsA(ImplWidget, gtk_list_get_type) then begin
|
||||
{$IfDef VerboseFocus}
|
||||
DebugLn(' E using list');
|
||||
{$EndIf}
|
||||
if selection_mode(PGtkList(ImplWidget)^) > GTK_SELECTION_BROWSE then
|
||||
NewFocusWidget:=PGtkList(ImplWidget)^.last_focus_child;
|
||||
if (NewFocusWidget = nil) and (PGtkList(ImplWidget)^.selection <> nil) then
|
||||
NewFocusWidget := (PGtkList(ImplWidget)^.selection)^.data;
|
||||
if (NewFocusWidget = nil) and (gtk_container_children(PGtkContainer(ImplWidget)) <> nil) then
|
||||
NewFocusWidget := g_list_first(gtk_container_children(PGtkContainer(ImplWidget)))^.data;
|
||||
end else begin
|
||||
{$IfDef VerboseFocus}
|
||||
DebugLn(' E taking ImplementationWidget');
|
||||
{$EndIf}
|
||||
NewFocusWidget:=ImplWidget;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -8953,6 +8966,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.408 2005/03/13 22:35:17 mattias
|
||||
fixed deleting selected TListBox item under gtk1 from Collin
|
||||
|
||||
Revision 1.407 2005/03/08 00:28:03 mattias
|
||||
implemented gtk2 AppMinimize
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user