|
|
@ -96,8 +96,8 @@ func (screen *Screen) IncreaseOffset(n int) { |
|
|
|
if screen.offset+n <= screen.max { |
|
|
|
if screen.offset+n <= screen.max { |
|
|
|
screen.offset += n |
|
|
|
screen.offset += n |
|
|
|
} else if screen.max > screen.height { |
|
|
|
} else if screen.max > screen.height { |
|
|
|
screen.offset = screen.max |
|
|
|
screen.offset = screen.max |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Decrease the offset for scrolling feature by n
|
|
|
|
// Decrease the offset for scrolling feature by n
|
|
|
@ -114,9 +114,9 @@ func (screen *Screen) ScrollTop() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (screen *Screen) ScrollBottom() { |
|
|
|
func (screen *Screen) ScrollBottom() { |
|
|
|
if screen.max > screen.height { |
|
|
|
if screen.max > screen.height { |
|
|
|
screen.offset = screen.max |
|
|
|
screen.offset = screen.max |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (screen *Screen) DrawOldQuotes(quotes *Quotes) { |
|
|
|
func (screen *Screen) DrawOldQuotes(quotes *Quotes) { |
|
|
@ -124,6 +124,11 @@ func (screen *Screen) DrawOldQuotes(quotes *Quotes) { |
|
|
|
termbox.Flush() |
|
|
|
termbox.Flush() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (screen *Screen) DrawOldMarket(market *Market) { |
|
|
|
|
|
|
|
screen.draw(screen.layout.Market(market), false) |
|
|
|
|
|
|
|
termbox.Flush() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Draw accepts variable number of arguments and knows how to display the
|
|
|
|
// Draw accepts variable number of arguments and knows how to display the
|
|
|
|
// market data, stock quotes, current time, and an arbitrary string.
|
|
|
|
// market data, stock quotes, current time, and an arbitrary string.
|
|
|
|
func (screen *Screen) Draw(objects ...interface{}) *Screen { |
|
|
|
func (screen *Screen) Draw(objects ...interface{}) *Screen { |
|
|
|