mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 14:19:17 +02:00
Gtk3: implemented TGtk3ListBox.GetScrollWidth(), TGtk3WSCustomListBox.GetScrollWidth()
This commit is contained in:
parent
b0a562be0d
commit
966b895003
@ -555,6 +555,7 @@ type
|
|||||||
function GetItemRect(const AIndex: integer): TRect;
|
function GetItemRect(const AIndex: integer): TRect;
|
||||||
function GetIndexAtXY(const X, Y: integer): integer;
|
function GetIndexAtXY(const X, Y: integer): integer;
|
||||||
function GetItemSelected(const AIndex: Integer): Boolean;
|
function GetItemSelected(const AIndex: Integer): Boolean;
|
||||||
|
function GetScrollWidth: integer;
|
||||||
procedure SelectItem(const AIndex: Integer; ASelected: Boolean);
|
procedure SelectItem(const AIndex: Integer; ASelected: Boolean);
|
||||||
procedure SetTopIndex(const AIndex: Integer);
|
procedure SetTopIndex(const AIndex: Integer);
|
||||||
property ItemIndex: Integer read GetItemIndex write SetItemIndex;
|
property ItemIndex: Integer read GetItemIndex write SetItemIndex;
|
||||||
@ -5642,7 +5643,6 @@ begin
|
|||||||
AModel := PGtkTreeView(getContainerWidget)^.model;
|
AModel := PGtkTreeView(getContainerWidget)^.model;
|
||||||
if AModel = nil then
|
if AModel = nil then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
if AModel^.iter_nth_child(@Iter, nil, AIndex) then
|
if AModel^.iter_nth_child(@Iter, nil, AIndex) then
|
||||||
begin
|
begin
|
||||||
ACol := gtk_tree_view_get_column(PGtkTreeView(getContainerWidget), 0)^;
|
ACol := gtk_tree_view_get_column(PGtkTreeView(getContainerWidget), 0)^;
|
||||||
@ -5694,6 +5694,11 @@ begin
|
|||||||
Result := ASelection^.iter_is_selected(@Item);
|
Result := ASelection^.iter_is_selected(@Item);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TGtk3ListBox.GetScrollWidth: integer;
|
||||||
|
begin
|
||||||
|
Result := Round(getHorizontalScrollbar^.get_adjustment^.get_upper);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TGtk3ListBox.SelectItem(const AIndex: Integer; ASelected: Boolean);
|
procedure TGtk3ListBox.SelectItem(const AIndex: Integer; ASelected: Boolean);
|
||||||
var
|
var
|
||||||
ASelection: PGtkTreeSelection;
|
ASelection: PGtkTreeSelection;
|
||||||
|
@ -434,6 +434,9 @@ class function TGtk3WSCustomListBox.GetScrollWidth(
|
|||||||
const ACustomListBox: TCustomListBox): Integer;
|
const ACustomListBox: TCustomListBox): Integer;
|
||||||
begin
|
begin
|
||||||
Result := 0;
|
Result := 0;
|
||||||
|
if not WSCheckHandleAllocated(ACustomListBox, 'GetScrollWidth') then
|
||||||
|
Exit;
|
||||||
|
Result := TGtk3ListBox(ACustomListBox.Handle).GetScrollWidth;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TGtk3WSCustomListBox.GetSelCount(const ACustomListBox: TCustomListBox): integer;
|
class function TGtk3WSCustomListBox.GetSelCount(const ACustomListBox: TCustomListBox): integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user