Documentation ¶
Index ¶
- func Clear()
- func ClearLine(row int)
- func Flush()
- func MoveCursor(column, row int)
- func Print(content string)
- func PrintAt(content string, column, row int)
- func Println(content string)
- type Page
- func (p *Page) Add(rowContent string, altID string, dateTime string)
- func (p *Page) AddAction(validAction *actn.Action)
- func (p *Page) AddBlankRow()
- func (p *Page) AddBreakRow()
- func (p *Page) AddColumns(columns ...string)
- func (p *Page) AddColumnsTitle(columns ...string)
- func (p *Page) AddFieldValuePair(key any, value string)
- func (p *Page) AddIntAction(num int)
- func (p *Page) AddMenuOption(id int, rowContent string, altID string, dateTime string)
- func (p *Page) AddParagraph(msg []string)
- func (p *Page) AddParagraphString(msg string)
- func (p *Page) Back()
- func (p *Page) BlockAction(action string)
- func (p *Page) BlockIntAction(action int)
- func (p *Page) Body()
- func (p *Page) Break(row int)
- func (p *Page) Clear()
- func (p *Page) ClearContent(row int)
- func (p *Page) Clearline(row int)
- func (p *Page) Display_Actions() (nextAction *actn.Action)
- func (p *Page) Display_Confirmation(msg *lang.Text) (bool, error)
- func (p *Page) Display_Input(minLen, maxLen int) (nextAction string, selected pageRow)
- func (p *Page) Dump(in ...string)
- func (p *Page) Error(err error, msg ...string)
- func (p *Page) Footer()
- func (p *Page) FormatRowOutput(msg string) string
- func (p *Page) Forward()
- func (p *Page) GetActions() []*actn.Action
- func (p *Page) GetBlockedActions() []string
- func (p *Page) GetDebugRow(rowNo int) pageRow
- func (p *Page) GetHelp() []string
- func (p *Page) GetOptions(includeDefaults bool) string
- func (p *Page) GetRows() int
- func (p *Page) Header(msg string)
- func (p *Page) Help()
- func (p *Page) Hint(info *lang.Text, msg ...string)
- func (p *Page) Info(info *lang.Text, msg ...string)
- func (p *Page) Input(msg *lang.Text, options string) string
- func (p *Page) InputHintInfo(msg *lang.Text)
- func (p *Page) IsBlockedAction(action string) bool
- func (p *Page) PagingInfo(page, ofPages int)
- func (p *Page) ResetPrompt()
- func (p *Page) ResetSetHelp()
- func (p *Page) SetHelp(msg []string)
- func (p *Page) SetPrompt(prompt *lang.Text)
- func (p *Page) SetTitle(title *lang.Text)
- func (p *Page) ShowOptions()
- func (p *Page) Success(message *lang.Text, msg ...string)
- func (p *Page) UnblockAction(action string)
- func (p *Page) ViewPort() term.ViewPort
- func (p *Page) Warning(warning lang.Text, msg ...string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MoveCursor ¶
func MoveCursor(column, row int)
Types ¶
type Page ¶
type Page struct { ActivePageIndex int // The index of the active page. // contains filtered or unexported fields }
Page represents a page in a document or a user interface.
func NewPage ¶
The NewPage function creates a new page with a truncated title and initializes other properties.
func (*Page) Add ¶
The `Add` function is used to add a new row of data to a page. It takes four parameters: `pageRowNumber`, `rowContent`, `altID`, and `dateTime`.
func (*Page) AddAction ¶
AddAction takes a validAction string as a parameter. The function adds the validAction to the list of available actions on the page.
func (*Page) AddBreakRow ¶
func (p *Page) AddBreakRow()
func (*Page) AddColumns ¶
func (*Page) AddColumnsTitle ¶
AddColumnsTitle adds a ruler to the page, separating the columns
func (*Page) AddFieldValuePair ¶
AddFieldValuePair adds a field value pair to the page
AddFieldValuePair takes two strings as arguments, where the first string represents the field name and the second string represents the field value. The function adds a row to the page with the field name on the left and the field value on the right, separated by a colon.
Example:
page.AddFieldValuePair("Field Name", "Field Value")
func (*Page) AddIntAction ¶
AddIntAction adds an action to the page with the given integer value
func (*Page) AddMenuOption ¶
The `Add` function is used to add a new row of data to a page. It takes four parameters: `pageRowNumber`, `rowContent`, `altID`, and `dateTime`.
func (*Page) AddParagraph ¶
func (*Page) AddParagraphString ¶
func (*Page) Back ¶
func (p *Page) Back()
Back moves to the previous page. If the current page is the first page, it returns an error.
func (*Page) BlockAction ¶
func (*Page) BlockIntAction ¶
func (*Page) ClearContent ¶
func (*Page) Display_Actions ¶
func (*Page) Display_Confirmation ¶
func (*Page) Display_Input ¶
func (*Page) FormatRowOutput ¶
func (*Page) Forward ¶
func (p *Page) Forward()
Forward moves to the next page. If the current page is the last page, it returns an error.
func (*Page) GetActions ¶
func (*Page) GetBlockedActions ¶
func (*Page) GetDebugRow ¶
GetDebugRow returns the pageRow at the specified index.
This function is used for debugging purposes.
func (*Page) GetOptions ¶
func (*Page) Header ¶
The `Header` function is a method of the `Crt` struct. It is responsible for printing a banner message to the console.
func (*Page) Input ¶
The `Input` function is a method of the `Crt` struct. It is used to display a prompt for the user for input on the terminal.
func (*Page) InputHintInfo ¶
func (*Page) IsBlockedAction ¶
func (*Page) PagingInfo ¶
func (*Page) ResetPrompt ¶
func (p *Page) ResetPrompt()
ResetPrompt resets the prompt to the default value
func (*Page) ResetSetHelp ¶
func (p *Page) ResetSetHelp()
func (*Page) ShowOptions ¶
func (p *Page) ShowOptions()