mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 15:49:32 +01:00 
			
		
		
		
	Gtk2: fixed TListBox with ItemIndex = -1 in lfm. issue #27276
git-svn-id: trunk@47330 -
This commit is contained in:
		
							parent
							
								
									60baaafb4a
								
							
						
					
					
						commit
						5b71531582
					
				@ -175,6 +175,7 @@ type
 | 
			
		||||
    class procedure SetSorted(const {%H-}ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); override;
 | 
			
		||||
    class procedure SetTopIndex(const ACustomListBox: TCustomListBox; const NewTopIndex: integer); override;
 | 
			
		||||
    class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override;
 | 
			
		||||
    class procedure ShowHide(const AWinControl: TWinControl); override;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
  { TGtk2WSListBox }
 | 
			
		||||
@ -683,6 +684,15 @@ begin
 | 
			
		||||
  Gtk2WidgetSet.SetWidgetFont(Widget, AFont);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
class procedure TGtk2WSCustomListBox.ShowHide(const AWinControl: TWinControl);
 | 
			
		||||
begin
 | 
			
		||||
  // issue #27276
 | 
			
		||||
  if AWinControl.HandleAllocated and AWinControl.HandleObjectShouldBeVisible and
 | 
			
		||||
    (TCustomListBox(AWinControl).ItemIndex = -1) then
 | 
			
		||||
    SetItemIndex(TCustomListBox(AWinControl), TCustomListBox(AWinControl).ItemIndex);
 | 
			
		||||
  inherited ShowHide(AWinControl);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function gtk2ListBoxSelectionChangedAfter({%H-}Widget: PGtkWidget;
 | 
			
		||||
  WidgetInfo: PWidgetInfo): gboolean; cdecl;
 | 
			
		||||
var
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user