mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 14:38:01 +02:00
Gtk3: implemented TGtk3ListView.ShowRow(), partially implemented TGtk3WSComCtrls.ItemShow
This commit is contained in:
parent
26a8fe1765
commit
cd67b9603c
@ -654,7 +654,7 @@ type
|
||||
const AIsSet: Boolean);
|
||||
function ItemGetState(const AIndex: Integer; const {%H-}AItem: TListItem; const AState: TListItemState;
|
||||
out AIsSet: Boolean): Boolean;
|
||||
|
||||
procedure ScrollToRow(const ARow: integer);
|
||||
procedure UpdateImageCellsSize;
|
||||
|
||||
property Images: TFPList read FImages write FImages;
|
||||
@ -7585,6 +7585,18 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGtk3ListView.ScrollToRow(const ARow: integer);
|
||||
var
|
||||
ATreePath: PGtkTreePath;
|
||||
begin
|
||||
ATreePath := gtk_tree_path_new_from_indices(ARow, [-1]);
|
||||
if IsTreeView then
|
||||
gtk_tree_view_scroll_to_cell(PGtkTreeView(getContainerWidget), ATreePath, nil, False, 0.0, 0.0)
|
||||
else
|
||||
gtk_icon_view_scroll_to_path(PGtkIconView(getContainerWidget), ATreePath, False, 0.0, 0.0);
|
||||
gtk_tree_path_free(ATreePath);
|
||||
end;
|
||||
|
||||
procedure TGtk3ListView.UpdateImageCellsSize;
|
||||
begin
|
||||
// must get renderer via property
|
||||
|
@ -732,6 +732,12 @@ class procedure TGtk3WSCustomListView.ItemShow(const ALV: TCustomListView;
|
||||
begin
|
||||
DebugLn('TGtk3WSCustomListView.ItemShow ');
|
||||
// inherited ItemShow(ALV, AIndex, AItem, PartialOK);
|
||||
if ALV.HandleAllocated then
|
||||
begin
|
||||
//TODO: Hide/Show items
|
||||
if not PartialOk then
|
||||
TGtk3ListView(ALV.Handle).ScrollToRow(AIndex);
|
||||
end;
|
||||
end;
|
||||
|
||||
class function TGtk3WSCustomListView.ItemGetPosition(
|
||||
@ -767,6 +773,8 @@ class function TGtk3WSCustomListView.GetBoundingRect(const ALV: TCustomListView
|
||||
begin
|
||||
DebugLn('TGtk3WSCustomListView.GetBoundingRect ');
|
||||
Result := Rect(0, 0, 0, 0);
|
||||
if ALV.HandleAllocated then
|
||||
Result := TGtk3ListView(ALV.handle).getClientBounds;
|
||||
end;
|
||||
|
||||
class function TGtk3WSCustomListView.GetDropTarget(const ALV: TCustomListView
|
||||
|
Loading…
Reference in New Issue
Block a user