2019-02-11 09:47:10 +01:00
|
|
|
#include "WSMenuItem.h"
|
2019-04-12 02:53:27 +02:00
|
|
|
#include "WSMenu.h"
|
2019-02-11 09:47:10 +01:00
|
|
|
|
2019-04-12 02:53:27 +02:00
|
|
|
WSMenuItem::WSMenuItem(WSMenu& menu, unsigned identifier, const String& text, const String& shortcut_text, bool enabled)
|
|
|
|
: m_menu(menu)
|
|
|
|
, m_type(Text)
|
|
|
|
, m_enabled(enabled)
|
2019-02-11 10:55:02 +01:00
|
|
|
, m_identifier(identifier)
|
2019-02-11 09:47:10 +01:00
|
|
|
, m_text(text)
|
2019-03-02 10:04:49 +01:00
|
|
|
, m_shortcut_text(shortcut_text)
|
2019-02-11 09:47:10 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-04-12 02:53:27 +02:00
|
|
|
WSMenuItem::WSMenuItem(WSMenu& menu, Type type)
|
|
|
|
: m_menu(menu)
|
|
|
|
, m_type(type)
|
2019-02-11 09:47:10 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
WSMenuItem::~WSMenuItem()
|
|
|
|
{
|
|
|
|
}
|
2019-04-12 02:53:27 +02:00
|
|
|
|
|
|
|
void WSMenuItem::set_enabled(bool enabled)
|
|
|
|
{
|
|
|
|
if (m_enabled == enabled)
|
|
|
|
return;
|
|
|
|
m_enabled = enabled;
|
|
|
|
m_menu.redraw();
|
|
|
|
}
|