MenuBoxItem
extends ListBoxItem
in package
Clickable menu box item
Table of Contents
- $DelimiterBackgroundColor : string
- $DelimiterDisabledBackgroundColor : string
- $DelimiterDisabledForegroundColor : string
- $DelimiterForegroundColor : string
- $DelimiterSelectedBackgroundColor : string
- $DelimiterSelectedDisabledBackgroundColor : string
- $DelimiterSelectedDisabledForegroundColor : string
- $DelimiterSelectedForegroundColor : string
- $Disabled : bool
- $DisabledBackgroundColor : string
- $DisabledForegroundColor : string
- $HeaderBackgroundColor : string
- $HeaderDisabledBackgroundColor : string
- $HeaderDisabledForegroundColor : string
- $HeaderForegroundColor : string
- $HeaderSelectedBackgroundColor : string
- $HeaderSelectedDisabledBackgroundColor : string
- $HeaderSelectedDisabledForegroundColor : string
- $HeaderSelectedForegroundColor : string
- $Hint : string
- $HintBackgroundColor : string
- $HintForegroundColor : string
- $Id : string
- $ItemBackgroundColor : string
- $ItemDisabledBackgroundColor : string
- $ItemDisabledForegroundColor : string
- $ItemForegroundColor : string
- $ItemSelectedBackgroundColor : string
- $ItemSelectedDisabledBackgroundColor : string
- $ItemSelectedDisabledForegroundColor : string
- $ItemSelectedForegroundColor : string
- $Name : string
- $Ordering : int
- $Selectable : bool
- $Visible : bool
- __construct() : mixed
- MenuBoxItem constructor.
- GetMenuBox() : MenuBox|null
- Remove() : void
- Removes element from current MenuBox
- Render() : string
- SetDelimiterStyle() : ListBoxItem
- Set style for delimiter between header and item
- SetHeaderStyle() : ListBoxItem
- Set header style
- SetItemStyle() : ControlItem
- Set style for item
- SetOnSelect() : MenuBoxItem
- Sets callback when item selected
Properties
$DelimiterBackgroundColor
public
string
$DelimiterBackgroundColor
= \Data\String\BackgroundColors::AUTO
$DelimiterDisabledBackgroundColor
public
string
$DelimiterDisabledBackgroundColor
= \Data\String\BackgroundColors::YELLOW
$DelimiterDisabledForegroundColor
public
string
$DelimiterDisabledForegroundColor
= \Data\String\ForegroundColors::GRAY
$DelimiterForegroundColor
public
string
$DelimiterForegroundColor
= \Data\String\ForegroundColors::GRAY
$DelimiterSelectedBackgroundColor
public
string
$DelimiterSelectedBackgroundColor
= \Data\String\BackgroundColors::YELLOW
$DelimiterSelectedDisabledBackgroundColor
public
string
$DelimiterSelectedDisabledBackgroundColor
= \Data\String\BackgroundColors::YELLOW
$DelimiterSelectedDisabledForegroundColor
public
string
$DelimiterSelectedDisabledForegroundColor
= \Data\String\ForegroundColors::GRAY
$DelimiterSelectedForegroundColor
public
string
$DelimiterSelectedForegroundColor
= \Data\String\ForegroundColors::GRAY
$Disabled
public
bool
$Disabled
= false
Is item disabled
$DisabledBackgroundColor
public
string
$DisabledBackgroundColor
= \Data\String\BackgroundColors::AUTO
Text's background color when item disabled
$DisabledForegroundColor
public
string
$DisabledForegroundColor
= \Data\String\ForegroundColors::AUTO
Text's color when item disabled
$HeaderBackgroundColor
public
string
$HeaderBackgroundColor
= \Data\String\BackgroundColors::AUTO
$HeaderDisabledBackgroundColor
public
string
$HeaderDisabledBackgroundColor
= \Data\String\BackgroundColors::YELLOW
$HeaderDisabledForegroundColor
public
string
$HeaderDisabledForegroundColor
= \Data\String\ForegroundColors::GRAY
$HeaderForegroundColor
public
string
$HeaderForegroundColor
= \Data\String\ForegroundColors::GRAY
$HeaderSelectedBackgroundColor
public
string
$HeaderSelectedBackgroundColor
= \Data\String\BackgroundColors::YELLOW
$HeaderSelectedDisabledBackgroundColor
public
string
$HeaderSelectedDisabledBackgroundColor
= \Data\String\BackgroundColors::YELLOW
$HeaderSelectedDisabledForegroundColor
public
string
$HeaderSelectedDisabledForegroundColor
= \Data\String\ForegroundColors::GRAY
$HeaderSelectedForegroundColor
public
string
$HeaderSelectedForegroundColor
= \Data\String\ForegroundColors::GRAY
$Hint
public
string
$Hint
= ""
Item's hint. Display when item is selected
$HintBackgroundColor
public
string
$HintBackgroundColor
= \Data\String\BackgroundColors::AUTO
Hint background color
$HintForegroundColor
public
string
$HintForegroundColor
= \Data\String\ForegroundColors::DARK_RED
Hint foreground color
$Id
public
string
$Id
= ""
Any value here. ID is not using anywhere except your code
$ItemBackgroundColor
public
string
$ItemBackgroundColor
= \Data\String\BackgroundColors::AUTO
Text's background color
$ItemDisabledBackgroundColor
public
string
$ItemDisabledBackgroundColor
= \Data\String\BackgroundColors::YELLOW
$ItemDisabledForegroundColor
public
string
$ItemDisabledForegroundColor
= \Data\String\ForegroundColors::GRAY
$ItemForegroundColor
public
string
$ItemForegroundColor
= \Data\String\ForegroundColors::GRAY
$ItemSelectedBackgroundColor
public
string
$ItemSelectedBackgroundColor
= \Data\String\BackgroundColors::YELLOW
$ItemSelectedDisabledBackgroundColor
public
string
$ItemSelectedDisabledBackgroundColor
= \Data\String\BackgroundColors::YELLOW
$ItemSelectedDisabledForegroundColor
public
string
$ItemSelectedDisabledForegroundColor
= \Data\String\ForegroundColors::GRAY
$ItemSelectedForegroundColor
public
string
$ItemSelectedForegroundColor
= \Data\String\ForegroundColors::GRAY
$Name
public
string
$Name
= ""
Item's title
$Ordering
public
int
$Ordering
= 1
Item's ordering
$Selectable
public
bool
$Selectable
= true
Is item visible and allowed to be selected
$Visible
public
bool
$Visible
= true
Is item visible
Methods
__construct()
MenuBoxItem constructor.
public
__construct(string $name, string $hint[, callable|null $callback = null ]) : mixed
Parameters
- $name : string
-
Displayed item title
- $hint : string
- $callback : callable|null = null
-
Runs when item selected
Return values
mixed —GetMenuBox()
public
GetMenuBox() : MenuBox|null
Return values
MenuBox|null —Returns MenuBox that this item is in
Remove()
Removes element from current MenuBox
public
Remove() : void
Return values
void —Render()
public
Render() : string
Return values
string —Rendered item
SetDelimiterStyle()
Set style for delimiter between header and item
public
SetDelimiterStyle(ForegroundColors $foregroundColor[, BackgroundColors $backgroundColor = BackgroundColors::AUTO ]) : ListBoxItem
Parameters
- $foregroundColor : ForegroundColors
- $backgroundColor : BackgroundColors = BackgroundColors::AUTO
Return values
ListBoxItem —SetHeaderStyle()
Set header style
public
SetHeaderStyle(ForegroundColors $foregroundColor[, BackgroundColors $backgroundColor = BackgroundColors::AUTO ]) : ListBoxItem
Parameters
- $foregroundColor : ForegroundColors
- $backgroundColor : BackgroundColors = BackgroundColors::AUTO
Return values
ListBoxItem —SetItemStyle()
Set style for item
public
SetItemStyle(ForegroundColors $foregroundColor[, BackgroundColors $backgroundColor = BackgroundColors::AUTO ]) : ControlItem
Parameters
- $foregroundColor : ForegroundColors
- $backgroundColor : BackgroundColors = BackgroundColors::AUTO
Return values
ControlItem —SetOnSelect()
Sets callback when item selected
public
SetOnSelect(callable $callback) : MenuBoxItem
Parameters
- $callback : callable