Skip to content

Commit

Permalink
IScroller findHorizontalScrollbar / findVerticalScrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed May 28, 2024
1 parent f490552 commit 8172a24
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions haxe/ui/containers/ScrollView.hx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class ScrollView extends InteractiveComponent implements IScroller {
@:clonable @:behaviour(EmptyContentsText) public var emptyContentsText:String;

@:call(EnsureVisible) public function ensureVisible(component:Component):Void;
@:call(FindHorizontalScrollbar) public function findHorizontalScrollbar():Component;
@:call(FindVerticalScrollbar) public function findVerticalScrollbar():Component;

@:event(ScrollEvent.SCROLL) public var onScroll:ScrollEvent->Void;

Expand Down Expand Up @@ -196,6 +198,24 @@ private class EnsureVisible extends DefaultBehaviour {
}
}

@:dox(hide) @:noCompletion
@:access(haxe.ui.core.Component)
private class FindHorizontalScrollbar extends DefaultBehaviour {
public override function call(param:Any = null):Variant {
var scrollview:ScrollView = cast(_component, ScrollView);
return scrollview.findComponent(HorizontalScroll, false);
}
}

@:dox(hide) @:noCompletion
@:access(haxe.ui.core.Component)
private class FindVerticalScrollbar extends DefaultBehaviour {
public override function call(param:Any = null):Variant {
var scrollview:ScrollView = cast(_component, ScrollView);
return scrollview.findComponent(VerticalScroll, false);
}
}

@:dox(hide) @:noCompletion
@:access(haxe.ui.core.Component)
private class Virtual extends DefaultBehaviour {
Expand Down
2 changes: 2 additions & 0 deletions haxe/ui/core/IScroller.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package haxe.ui.core;

interface IScroller {
public function ensureVisible(component:Component):Void;
public function findHorizontalScrollbar():Component;
public function findVerticalScrollbar():Component;
public var isScrollableHorizontally(get, null):Bool;
public var isScrollableVertically(get, null):Bool;
public var isScrollable(get, null):Bool;
Expand Down

0 comments on commit 8172a24

Please sign in to comment.