|
@@ -44,6 +44,32 @@ func (p *Panel) Range(withBorder bool) (sx, sy, ex, ey int) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// Clear out the panel
|
|
|
+func (p *Panel) Clear() string {
|
|
|
+ var style int = int(p.Style)
|
|
|
+ var output string
|
|
|
+ var row int = p.Y
|
|
|
+ var blank string
|
|
|
+
|
|
|
+ if style > 0 {
|
|
|
+ blank = strings.Repeat(" ", p.Width+2)
|
|
|
+ output += Goto(p.X, row) + blank
|
|
|
+ row++
|
|
|
+ } else {
|
|
|
+ blank = strings.Repeat(" ", p.Width)
|
|
|
+ }
|
|
|
+
|
|
|
+ for _ = range p.Lines {
|
|
|
+ output += Goto(p.X, row) + blank
|
|
|
+ row++
|
|
|
+ }
|
|
|
+
|
|
|
+ if style > 0 {
|
|
|
+ output += Goto(p.X, row) + blank
|
|
|
+ }
|
|
|
+ return output
|
|
|
+}
|
|
|
+
|
|
|
// Output the panel
|
|
|
func (p *Panel) Output() string {
|
|
|
var style int = int(p.Style)
|