Example #1
0
//------------------------------------------------------------------------
CCommandMenuItem::CCommandMenuItem (UTF8StringPtr title, CBaseObject* _target, IdStringPtr _commandCategory, IdStringPtr _commandName)
: CMenuItem (title, -1)
, target (0)
, commandCategory (0)
, commandName (0)
{
	setTarget (_target);
	setCommandCategory (_commandCategory);
	setCommandName (_commandName);
}
Example #2
0
//------------------------------------------------------------------------
CCommandMenuItem::CCommandMenuItem (UTF8StringPtr title, COptionMenu* submenu, CBitmap* icon, CBaseObject* _target, IdStringPtr _commandCategory, IdStringPtr _commandName)
: CMenuItem (title, submenu, icon)
, target (0)
, commandCategory (0)
, commandName (0)
{
	setTarget (_target);
	setCommandCategory (_commandCategory);
	setCommandName (_commandName);
}
Example #3
0
//------------------------------------------------------------------------
CCommandMenuItem::CCommandMenuItem (UTF8StringPtr title, UTF8StringPtr keycode, int32_t keyModifiers, CBitmap* icon, int32_t flags, CBaseObject* _target, IdStringPtr _commandCategory, IdStringPtr _commandName)
: CMenuItem (title, keycode, keyModifiers, icon, flags)
, target (0)
, commandCategory (0)
, commandName (0)
{
	setTarget (_target);
	setCommandCategory (_commandCategory);
	setCommandName (_commandName);
}
Example #4
0
//------------------------------------------------------------------------
CCommandMenuItem::CCommandMenuItem (const CCommandMenuItem& item)
: CMenuItem (item)
, target (0)
, commandCategory (0)
, commandName (0)
#if VSTGUI_HAS_FUNCTIONAL
, selectedFunc (item.selectedFunc)
, validateFunc (item.validateFunc)
#endif
{
	setTarget (item.target);
	setCommandCategory (item.commandCategory);
	setCommandName (item.commandName);
}
	int32 Interp::run(char* name, char* param_string, void* context)
	{
		Command* c = NULL;
		int32 ret = 0;

		uint32 out = 0;

		/* reset parameters descriptor */
		reset();

		/* set command name */
		setCommandName(name);

		/* search for the instruction */
		c = (Command *) get(name);
		if (!c)
			return BADCOMMAND;

		/* check if there are parameters */
		if (param_string) {
			/* create parameters */
			ret = c->makeParams(this, param_string);
			if (ret == FAILURE)
				return PARAMPARSINGERROR;
		}

		/* check parameters count */
		if (m_bEnableCheck) {
			if (!c->checkParamsCount(Params::getCount()))
				return WRONGPARAMCOUNT;
		}

		/* execute action */
		if (c->isEnabled())
			out = c->perform(this, context);
		else
			return PERMISSIONDENIED;

		/* return callback output */
		return out;
	}
Example #6
0
//------------------------------------------------------------------------
CCommandMenuItem::~CCommandMenuItem ()
{
	setTarget (0);
	setCommandCategory (0);
	setCommandName (0);
}