2024-04-24 17:11:33 +03:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
2024-05-06 20:43:35 +03:00
|
|
|
"mvvasilev/last_light/engine"
|
2024-04-24 17:11:33 +03:00
|
|
|
"mvvasilev/last_light/util"
|
|
|
|
|
|
|
|
"github.com/gdamore/tcell/v2"
|
|
|
|
"github.com/gdamore/tcell/v2/views"
|
|
|
|
"github.com/google/uuid"
|
|
|
|
)
|
|
|
|
|
|
|
|
type UIBorderedButton struct {
|
|
|
|
id uuid.UUID
|
|
|
|
|
2024-05-06 20:43:35 +03:00
|
|
|
text engine.Text
|
|
|
|
border engine.Rectangle
|
2024-04-24 17:11:33 +03:00
|
|
|
|
|
|
|
isSelected bool
|
|
|
|
|
|
|
|
unselectedStyle tcell.Style
|
|
|
|
selectedStyle tcell.Style
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *UIBorderedButton) IsSelected() bool {
|
|
|
|
return b.isSelected
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *UIBorderedButton) Select() {
|
|
|
|
b.isSelected = true
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *UIBorderedButton) Deselect() {
|
|
|
|
b.isSelected = false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *UIBorderedButton) SetSelected(selected bool) {
|
|
|
|
b.isSelected = selected
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *UIBorderedButton) UniqueId() uuid.UUID {
|
|
|
|
return b.id
|
|
|
|
}
|
|
|
|
|
2024-04-27 22:32:05 +03:00
|
|
|
func (b *UIBorderedButton) MoveTo(x int, y int) {
|
2024-04-24 17:11:33 +03:00
|
|
|
panic("not implemented") // TODO: Implement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *UIBorderedButton) Position() util.Position {
|
|
|
|
panic("not implemented") // TODO: Implement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *UIBorderedButton) Size() util.Size {
|
|
|
|
panic("not implemented") // TODO: Implement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *UIBorderedButton) Draw(v views.View) {
|
|
|
|
panic("not implemented") // TODO: Implement
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *UIBorderedButton) Input(e *tcell.EventKey) {
|
|
|
|
panic("not implemented") // TODO: Implement
|
|
|
|
}
|