make EnsureVisible public

This commit is contained in:
Vladimir Markelov 2015-10-17 18:32:40 -07:00
parent d9160a6e02
commit cd05617225
1 changed files with 9 additions and 5 deletions

View File

@ -162,7 +162,7 @@ func (l *ListBox) moveUp() {
}
l.currSelection--
l.ensureVisible()
l.EnsureVisible()
}
func (l *ListBox) moveDown() {
@ -173,10 +173,10 @@ func (l *ListBox) moveDown() {
}
l.currSelection++
l.ensureVisible()
l.EnsureVisible()
}
func (l *ListBox) ensureVisible() {
func (l *ListBox) EnsureVisible() {
length := len(l.items)
if length <= l.height {
@ -265,7 +265,7 @@ func (l *ListBox) recalcPositionByScroll() {
}
l.currSelection = newPos
l.ensureVisible()
l.EnsureVisible()
}
func (l *ListBox) ProcessEvent(event Event) bool {
@ -325,7 +325,7 @@ func (l *ListBox) SelectItem(id int) bool {
}
l.currSelection = id
l.ensureVisible()
l.EnsureVisible()
return true
}
@ -374,3 +374,7 @@ func (l *ListBox) MaxItems() int {
func (l *ListBox) SetMaxItems(max int) {
l.maxItems = max
}
func (l *ListBox) ItemCount() int {
return len(l.items)
}