Beispiel #1
0
void gdPlugin::__cb_shiftUp() {

	/*nothing to do if there's only one plugin */

	if (G_PluginHost.countPlugins(pParent->stackType, pParent->ch) == 1)
		return;

	int pluginIndex = G_PluginHost.getPluginIndex(pPlugin->getId(), pParent->stackType, pParent->ch);

	if (pluginIndex == 0)  // first of the stack, do nothing
		return;

	G_PluginHost.swapPlugin(pluginIndex, pluginIndex-1, pParent->stackType, pParent->ch);
	pParent->refreshList();
}
Beispiel #2
0
void gdPlugin::__cb_shiftDown() {

	/*nothing to do if there's only one plugin */

	if (G_PluginHost.countPlugins(pParent->stackType, pParent->ch) == 1)
		return;

	unsigned pluginIndex = G_PluginHost.getPluginIndex(pPlugin->getId(), pParent->stackType, pParent->ch);
	unsigned stackSize   = (G_PluginHost.getStack(pParent->stackType, pParent->ch))->size();

	if (pluginIndex == stackSize-1)  // last one in the stack, do nothing
		return;

	G_PluginHost.swapPlugin(pluginIndex, pluginIndex+1, pParent->stackType, pParent->ch);
	pParent->refreshList();
}