boot loader: MenuItem: Add SetLabel()
This commit is contained in:
@@ -57,6 +57,7 @@ public:
|
|||||||
char Shortcut() const { return fShortcut; }
|
char Shortcut() const { return fShortcut; }
|
||||||
|
|
||||||
const char* Label() const { return fLabel; }
|
const char* Label() const { return fLabel; }
|
||||||
|
void SetLabel(const char* label);
|
||||||
|
|
||||||
Menu* Submenu() const { return fSubMenu; }
|
Menu* Submenu() const { return fSubMenu; }
|
||||||
void SetSubmenu(Menu* subMenu);
|
void SetSubmenu(Menu* subMenu);
|
||||||
|
|||||||
@@ -180,6 +180,16 @@ MenuItem::SetShortcut(char key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MenuItem::SetLabel(const char* label)
|
||||||
|
{
|
||||||
|
if (char* newLabel = strdup(label)) {
|
||||||
|
free(const_cast<char*>(fLabel));
|
||||||
|
fLabel = newLabel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MenuItem::SetSubmenu(Menu* subMenu)
|
MenuItem::SetSubmenu(Menu* subMenu)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user