Add UsingEscapeCodes to Menu and MenuConfig
This commit is contained in:
parent
e07cdfdfde
commit
c84bed67cf
|
@ -31,14 +31,16 @@ func (c *Command) Print() {
|
||||||
}
|
}
|
||||||
|
|
||||||
type MenuConfig struct {
|
type MenuConfig struct {
|
||||||
Title string
|
Title string
|
||||||
BackKey string
|
BackKey string
|
||||||
|
UsingEscapeCodes bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDefConfig() *MenuConfig {
|
func getDefConfig() *MenuConfig {
|
||||||
return &MenuConfig{
|
return &MenuConfig{
|
||||||
Title: "Default Menu Title",
|
Title: "Default Menu Title",
|
||||||
BackKey: "<",
|
BackKey: "<",
|
||||||
|
UsingEscapeCodes: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,6 +86,10 @@ func createCommandTree() *commandTree {
|
||||||
type Menu struct {
|
type Menu struct {
|
||||||
Title string
|
Title string
|
||||||
BackKey string
|
BackKey string
|
||||||
|
// Escape Code part
|
||||||
|
//
|
||||||
|
usingEscapeCodes bool
|
||||||
|
lineCounter uint
|
||||||
//
|
//
|
||||||
counterForIDs uint
|
counterForIDs uint
|
||||||
cmdTree *commandTree
|
cmdTree *commandTree
|
||||||
|
@ -97,10 +103,12 @@ func CreateMenu(options ...SimpleMenuOption) *Menu {
|
||||||
}
|
}
|
||||||
|
|
||||||
return &Menu{
|
return &Menu{
|
||||||
Title: conf.Title,
|
Title: conf.Title,
|
||||||
BackKey: conf.BackKey,
|
BackKey: conf.BackKey,
|
||||||
counterForIDs: 1,
|
usingEscapeCodes: conf.UsingEscapeCodes,
|
||||||
cmdTree: createCommandTree(),
|
lineCounter: 0,
|
||||||
|
counterForIDs: 1,
|
||||||
|
cmdTree: createCommandTree(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user