Ejemplo n.º 1
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//menu_controloptions
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void menu_controloptions(Menu *m, control *c, int count, agent *agents[], char *actionprefix, char *actions[], const int types[])
{
	//Declare variables
	char completeactionname[1024];

	for (int i = 0; i < count; i++)
	{
		//Make the complete action name
		sprintf(completeactionname, "%s%s", actionprefix, actions[i]);

		//Make the submenu for this action
		Menu *submenu = make_menu(actions[i], c);

		//If there is an agent, add its options menu
		if (agents[i])
		{
			make_menuitem_nop(submenu, agents[i]->agenttypeptr->agenttypenamefriendly);
			Menu *submenu2 = make_menu("Options", c);
			agent_menu_context(submenu2, c, agents[i]);
			make_submenu_item(submenu, "Options", submenu2);
			make_menuitem_nop(submenu, NULL);
			make_menuitem_nop(submenu, NULL);
		}


		//Make the agent selection menus for this action
		agent_menu_set(submenu, c, agents[i], types[i], completeactionname);

		//Add the submenu to the parent menu
		make_submenu_item(m, actions[i], submenu);
	}
}
Ejemplo n.º 2
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//agenttype_bitmap_menu_context
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void agenttype_bitmap_menu_context(std::shared_ptr<bb::MenuConfig> m, agent *a)
{
	//Get the agent details
	agenttype_bitmap_details *details = (agenttype_bitmap_details *) a->agentdetails;	

	//For convenience, change the bitmap source without changing the settings
	make_menuitem_cmd(m, L"Change Source...", config_getfull_control_setagentprop_c(a->controlptr, a->agentaction, L"Source", L"*browse*"));

	if (details->is_icon)
	{
		make_menuitem_int(m, L"Icon Size",
                                          config_getfull_control_setagentprop_s(a->controlptr, a->agentaction, L"Size"),
                                          details->width, 1, 256);
	}
	else if (details->filename)
	{
		make_menuitem_int(m, L"Scale",
                                          config_getfull_control_setagentprop_s(a->controlptr, a->agentaction, L"Scale"),
                                          details->scale, 1, 500);
	}
	std::shared_ptr<bb::MenuConfig> submenu = make_menu(L"Image Alignment", a->controlptr);
	make_menuitem_bol(submenu, L"Left", config_getfull_control_setagentprop_c(a->controlptr, a->agentaction, L"HAlign", L"Left"), details->halign == 1);
	make_menuitem_bol(submenu, L"Center", config_getfull_control_setagentprop_c(a->controlptr, a->agentaction, L"HAlign", L"Center"), details->halign == 0);
	make_menuitem_bol(submenu, L"Right", config_getfull_control_setagentprop_c(a->controlptr, a->agentaction, L"HAlign", L"Right"), details->halign == 2);
	make_menuitem_nop(submenu, L"");
	make_menuitem_bol(submenu, L"Top", config_getfull_control_setagentprop_c(a->controlptr, a->agentaction, L"VAlign", L"Top"), details->valign == 1);
	make_menuitem_bol(submenu, L"Center", config_getfull_control_setagentprop_c(a->controlptr, a->agentaction, L"VAlign", L"Center"), details->valign == 0);
	make_menuitem_bol(submenu, L"Bottom", config_getfull_control_setagentprop_c(a->controlptr, a->agentaction, L"VAlign", L"Bottom"), details->valign == 2);
	make_submenu_item(m, L"Image Alignment", submenu);
}
Ejemplo n.º 3
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//controltype_frame_insertpluginmenu
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void controltype_frame_insertpluginmenu(control *c, Menu *m)
{
	const char menu_title[] = "Plugins";
	Menu *sub = make_menu(menu_title, c);

	controltype_label_details *details = (controltype_label_details *) c->controldetails;
	make_menuitem_cmd(sub, "Load Plugin...", config_getfull_control_plugin_c(c, "Load", "*browse*"));
	static const char *submenu_titles[] = { "Unload Plugin", "Visibility" };
	for (int n = 0; n < 2; n++)
	{
		Menu *sub2 = make_menu(submenu_titles[n], c);
		ModuleInfo *mi = details->module_info;
		if (NULL == mi) make_menuitem_nop(sub2, "No plugins loaded");
		for (;mi; mi=mi->next)
		{
			if (0 == n)
			{
				make_menuitem_bol(sub2, mi->module_name,
								  config_getfull_control_plugin_c(c, "Unload", mi->module_name), false);
			}
			else
				if (1 == n)
				{
					bool temp = !plugin_getset_show_state(details->plugin_info, mi->module_name, 3);
					make_menuitem_bol(sub2, mi->module_name,
									  config_getfull_control_plugin_prop_b(c, mi->module_name, "IsVisible", temp), !temp);
				}
		}
		make_submenu_item(sub, submenu_titles[n], sub2);
	}
	if (details->module_info)
		make_menuitem_cmd(sub, "About Plugins", config_getfull_control_plugin_s(c, "About"));

	make_submenu_item(m, menu_title, sub);
}
//##################################################
//agenttype_mixer_menu_devices
//##################################################
void agenttype_mixer_menu_devices(Menu *menu, control *c, char *action, char *agentname, int format)
{
	//Variables
	MIXERCAPS       mixer_capabilities;
	HMIXER          mixer_handle;

	//Count the devices
	UINT count_devices = mixerGetNumDevs();
	if (count_devices < 1)
	{
		make_menuitem_nop(menu, "No audio devices present.");
		return;
	}

	//For every device...
	for (UINT device = 0; device < count_devices; device++)
	{
		//Open the mixer
		if (MMSYSERR_NOERROR == mixerOpen(  &mixer_handle, device, 0, 0, 0)
			&& MMSYSERR_NOERROR == mixerGetDevCaps(device, &mixer_capabilities, sizeof(MIXERCAPS)))
		{
			//Create a submenu for destination lines
			Menu *submenu;
			submenu = make_menu(mixer_capabilities.szPname, c);
			agenttype_mixer_menu_destlines(submenu, c, action, agentname, format, device, mixer_handle, mixer_capabilities);
			make_submenu_item(menu, mixer_capabilities.szPname, submenu);

			//Close the mixer
			mixerClose(mixer_handle);
		}
	}
	return;
}
//##################################################
//agenttype_mixer_menu_destlines
//##################################################
void agenttype_mixer_menu_destlines(Menu *menu, control *c, char *action, char *agentname, int format, UINT device, HMIXER mixer_handle, MIXERCAPS &mixer_capabilities)
{
	//Variables
	MIXERLINE mixer_line;

	//Count the destination lines
	UINT count_destlines = mixer_capabilities.cDestinations;
	if (count_destlines < 1)
	{
		make_menuitem_nop(menu, "No destination lines available.");
		return;
	}

	//For every destination line
	for (UINT destline = 0; destline < count_destlines; destline++)
	{
		mixer_line.dwDestination = destline;
		mixer_line.cbStruct = sizeof(MIXERLINE);
		mixerGetLineInfo((HMIXEROBJ) mixer_handle, &mixer_line, MIXER_GETLINEINFOF_DESTINATION);

		//Load the device capabilities
		if (MMSYSERR_NOERROR == mixerGetLineInfo((HMIXEROBJ) mixer_handle, &mixer_line, MIXER_GETLINEINFOF_DESTINATION))
		{           
			//Create a submenu for source lines
			Menu *submenu;
			submenu = make_menu(mixer_line.szName, c);

			//Add the controls
			int controlcount = agenttype_mixer_menu_linecontrols(submenu, c, action, agentname, format, device, mixer_handle, mixer_line);

			//Add a spacer
			if (controlcount > 0) make_menuitem_nop(submenu, "");
			
			//Add the source lines
			agenttype_mixer_menu_sourcelines(submenu, c, action, agentname, format, device, mixer_handle, mixer_line);
			make_submenu_item(menu, mixer_line.szName, submenu);
		}
	}

	return;
}
Ejemplo n.º 6
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//controltype_switchbutton_menu_context
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void controltype_switchbutton_menu_context(Menu *m, control *c)
{
	//Get the details
	controltype_button_details *details = (controltype_button_details *) c->controldetails;

	//Show the menu
	menu_controloptions(m, c, CONTROLTYPE_TWOSTATEBUTTON_AGENTCOUNT, details->agents, "", controltype_switchbutton_agentnames, controltype_switchbutton_agenttypes);

	make_menuitem_nop(m, "");
	Menu* submenu = make_menu("Text Settings", c);
	make_menuitem_bol(submenu, "Left", config_getfull_control_setcontrolprop_c(c, "HAlign", "Left"), details->halign == 1);
	make_menuitem_bol(submenu, "Center", config_getfull_control_setcontrolprop_c(c, "HAlign", "Center"), details->halign == 0);
	make_menuitem_bol(submenu, "Right", config_getfull_control_setcontrolprop_c(c, "HAlign", "Right"), details->halign == 2);
	make_menuitem_nop(submenu, "");
	make_menuitem_bol(submenu, "Top, Word Wrapped", config_getfull_control_setcontrolprop_c(c, "VAlign", "TopWrap"), details->valign == 3);
	make_menuitem_bol(submenu, "Top", config_getfull_control_setcontrolprop_c(c, "VAlign", "Top"), details->valign == 1);
	make_menuitem_bol(submenu, "Center", config_getfull_control_setcontrolprop_c(c, "VAlign", "Center"), details->valign == 0);
	make_menuitem_bol(submenu, "Bottom", config_getfull_control_setcontrolprop_c(c, "VAlign", "Bottom"), details->valign == 2);
	make_submenu_item(m, "Text Settings", submenu);

}
Ejemplo n.º 7
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//controltype_label_menu_context
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void controltype_label_menu_context(Menu *m, control *c)
{
	//Variables
	Menu *submenu;

	//Get the details
	controltype_label_details *details = (controltype_label_details *) c->controldetails;

	//Show the menu
	menu_controloptions(m, c, CONTROLTYPE_LABEL_AGENT_COUNT, details->agents, "", controltype_label_agentnames, controltype_label_agenttypes);

	make_menuitem_nop(m, "");

	submenu = make_menu("Text Settings", c);
	make_menuitem_bol(submenu, "Left", config_getfull_control_setcontrolprop_c(c, "HAlign", "Left"), details->halign == 1);
	make_menuitem_bol(submenu, "Center", config_getfull_control_setcontrolprop_c(c, "HAlign", "Center"), details->halign == 0);
	make_menuitem_bol(submenu, "Right", config_getfull_control_setcontrolprop_c(c, "HAlign", "Right"), details->halign == 2);

	make_menuitem_nop(submenu, "");

	make_menuitem_bol(submenu, "Top, Word Wrapped", config_getfull_control_setcontrolprop_c(c, "VAlign", "TopWrap"), details->valign == 3);
	make_menuitem_bol(submenu, "Top", config_getfull_control_setcontrolprop_c(c, "VAlign", "Top"), details->valign == 1);
	make_menuitem_bol(submenu, "Center", config_getfull_control_setcontrolprop_c(c, "VAlign", "Center"), details->valign == 0);
	make_menuitem_bol(submenu, "Bottom", config_getfull_control_setcontrolprop_c(c, "VAlign", "Bottom"), details->valign == 2);

	make_submenu_item(m, "Text Settings", submenu);

	if (details->is_frame)
	{
		bool temp;
		temp = !details->has_titlebar;
		make_menuitem_bol(m, "Has Title Bar", config_getfull_control_setcontrolprop_b(c, "HasTitleBar", &temp), false == temp);
		temp = !details->is_locked;
		make_menuitem_bol(m, "Lock Children", config_getfull_control_setcontrolprop_b(c, "IsLocked", &temp), false == temp);
		make_menuitem_nop(m, NULL);
		controltype_frame_insertpluginmenu(c, m);
	}
}
Ejemplo n.º 8
0
//##################################################
//menu_control_pluginoptions
//##################################################
void menu_control_pluginoptions(Menu *m)
{
	Menu *submenu;
	submenu = make_menu("Configuration");
	make_submenu_item(submenu, "Modules", module_menu_modulelist());
	make_submenu_item(submenu, "Edit Modules", module_menu_editmodules());
	make_submenu_item(submenu, "Set Default Module", module_menu_setactivemodule());
	make_menuitem_nop(submenu, NULL);
	make_menuitem_cmd(submenu, "Load Configuration Script...", config_get_plugin_load_dialog());
	make_menuitem_cmd(submenu, "Edit Configuration Script", config_get_plugin_edit());
	make_menuitem_nop(submenu, NULL);
	make_menuitem_cmd(submenu, "Save Configuration", config_get_plugin_save());
	make_menuitem_cmd(submenu, "Save Configuration As...", config_get_plugin_saveas());
	make_menuitem_nop(submenu, NULL);
	make_menuitem_cmd(submenu, "Reload Configuration", config_get_plugin_revert());
	make_submenu_item(m, "Configuration", submenu);

	submenu = make_menu("Help");
	make_menuitem_cmd(submenu, "Quick Reference...", "@BBInterface Plugin About QuickHelp");
	make_menuitem_cmd(submenu, "About...", "@BBInterface Plugin About");
	make_menuitem_cmd(submenu, "Show Welcome Interface", "@BBInterface Plugin Load WelcomeScript\\welcome.rc");
	make_submenu_item(m, "Help", submenu);
}
//##################################################
//agenttype_mixer_menu_sourcelines
//##################################################
void agenttype_mixer_menu_sourcelines(Menu *menu, control *c, char *action, char *agentname, int format, UINT device, HMIXER mixer_handle, MIXERLINE &mixer_destline)
{
	//Variables
	MIXERLINE mixer_line;

	//Count the devices
	UINT count_sourcelines = mixer_destline.cConnections;
	if (count_sourcelines < 1)
	{
		make_menuitem_nop(menu, "No source lines available.");
		return;
	}

	//For every source line
	for (UINT sourceline = 0; sourceline < count_sourcelines; sourceline++)
	{
		mixer_line.cbStruct = sizeof(MIXERLINE);
		mixer_line.dwDestination = mixer_destline.dwDestination;
		mixer_line.dwSource = sourceline;

		//Load the device capabilities
		if (MMSYSERR_NOERROR == mixerGetLineInfo((HMIXEROBJ) mixer_handle, &mixer_line,  MIXER_GETLINEINFOF_SOURCE))
		{
			//Create a submenu for source lines
			Menu *submenu;
			submenu = make_menu(mixer_line.szName, c);
			int controlcount = agenttype_mixer_menu_linecontrols(submenu, c, action, agentname, format, device, mixer_handle, mixer_line);
			if (controlcount == 0)
			{
				make_menuitem_nop(submenu, "No options available for this item.");
			}
			make_submenu_item(menu, mixer_line.szName, submenu);
		}
	}

	return;
}
Ejemplo n.º 10
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//agenttype_graph_menu_context
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void agenttype_graph_menu_context(Menu *m, agent *a)
{
	agenttype_graph_details *details = (agenttype_graph_details *) a->agentdetails;

	for (int i = 0; i < AGENTTYPE_GRAPH_CHARTTYPECOUNT; i++)
	{
		make_menuitem_bol(m, agenttype_graph_friendlycharttypes[i], config_getfull_control_setagentprop_c(a->controlptr, a->agentaction, "GraphType", agenttype_graph_charttypes[i]), details->charttype == i);
	}
	make_menuitem_nop(m, NULL);

	char namedot[1000];
	sprintf(namedot, "%s%s", a->agentaction, ".");

	menu_controloptions(m, a->controlptr, AGENTTYPE_GRAPH_AGENTCOUNT, details->agents, namedot, agenttype_graph_agentdescriptions, agenttype_graph_agenttypes);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//agenttype_switchedstate_menu_set
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void agenttype_switchedstate_menu_set(Menu *m, control *c, agent *a,  char *action, int controlformat)
{
	char temp[32] = "";
	switch(controlformat)
	{
		case CONTROL_FORMAT_TEXT: strcpy(temp, agenttype_switchedstate_typenames[AGENTTYPE_SWITCHEDSTATE_TYPE_TEXT]); break;
		case CONTROL_FORMAT_IMAGE: strcpy(temp, agenttype_switchedstate_typenames[AGENTTYPE_SWITCHEDSTATE_TYPE_IMAGE]); break;
		case CONTROL_FORMAT_TRIGGER: strcpy(temp, agenttype_switchedstate_typenames[AGENTTYPE_SWITCHEDSTATE_TYPE_TRIGGER]); break;
		default: 
			make_menuitem_nop(m, "Invalid type.");
			break;
	}

	make_menuitem_cmd(m, "Set", config_getfull_control_setagent_c(c, action, "SwitchedState", temp));
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//agenttype_compoundtext_menu_set
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void agenttype_compoundtext_menu_set(Menu *m, control *c, agent *a,  char *action, int controlformat)
{
	const char *text = a
		? ((agenttype_compoundtext_details *) a->agentdetails)->text : "";

	make_menuitem_str(
		m,
		"Entry:",
		config_getfull_control_setagent_s(c, action, "CompoundText"),
		text
		);

	make_menuitem_nop(m, "");
	for (int i = 0; i < agenttype_compoundtext_commoncount; i++)
	{
		make_menuitem_bol(m, agenttype_compoundtext_commons[i], config_getfull_control_setagent_c(c, action, "CompoundText", agenttype_compoundtext_commons[i]), 0 == strcmp(text, agenttype_compoundtext_commons[i]));
	}
}
Ejemplo n.º 13
0
//##################################################
//controltype_button_startup
//##################################################
void menu_control_controloptions(Menu *m, control *c, char *title)
{
	//Variables
	Menu *submenu;

	//Make the operations menu  
	submenu = make_menu(title, c);

	//Make the name option
	make_menuitem_str(
		submenu,
		"Control Name:",
		config_getfull_control_renamecontrol_s(c),
		c->controlname
		);
	make_menuitem_nop(submenu, "");

	control_menu_context(submenu, c);
	make_submenu_item(m, title, submenu);
}
Ejemplo n.º 14
0
void menu_control_interfaceoptions(Menu *m, control *c)
{
	//Variables
	Menu *submenu, *submenu2;
	//Make the operations menu  
	submenu = make_menu("Interface Operations", c);

	//Create new controls
	submenu2 = make_menu("Create New Control", c);
	control_menu_create(submenu2, c, false);
	make_submenu_item(submenu, "Create New Control", submenu2);
	if (c->controltypeptr->can_parent) //If it can be a parent
	{
		submenu2 = make_menu("Create New Child Control", c);
		control_menu_create(submenu2, c, true);
		make_submenu_item(submenu, "Create New Child Control", submenu2);
	}
	make_menuitem_cmd(submenu,"Create New Module",config_get_module_create());
	make_menuitem_nop(submenu, NULL);
	control_menu_settings(submenu, c);
	make_submenu_item(m, "Interface Operations", submenu);
}
Ejemplo n.º 15
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Menu *plugin_menu_settings(void)
{
	Menu *m = make_menu("Global Options");
	bool tmp;
	for (struct plugin_properties *p = plugin_properties; p->key; p++)
		switch (p->type)
		{
			case M_BOL:
				tmp = false == *(bool*)p->data;
				make_menuitem_bol(m, p->menutext, config_get_plugin_setpluginprop_b(p->key, &tmp), !tmp);
				break;
			case M_INT:
				make_menuitem_int(m, p->menutext, config_get_plugin_setpluginprop_s(p->key), *(const int*)p->data, p->minval, p->maxval);
				break;
			case M_STR:
				make_menuitem_str(m, p->menutext, config_get_plugin_setpluginprop_s(p->key), *(const char **)p->data ? *(const char**)p->data : "");
				break;
			default:
				make_menuitem_nop(m, NULL);
				break;
		}
	return m;
}
Ejemplo n.º 16
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//agenttype_winamp_menu_context
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void agenttype_winamp_menu_context(Menu *m, agent *a)
{
	make_menuitem_nop(m, "No options available.");
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//agenttype_mixer_menu_context
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void agenttype_mixer_menu_context_xp (Menu *m, agent *a)
{
	make_menuitem_nop(m, "No options available.");
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//agenttype_systemmonitor_menu_context
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void agenttype_systemmonitor_menu_context(Menu *m, agent *a)
{
	make_menuitem_nop(m, "No options available.");
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//agenttype_systeminfo_menu_context
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void agenttype_systeminfo_menu_context(std::shared_ptr<bb::MenuConfig> m, agent *a)
{
	make_menuitem_nop(m, L"No options available.");
}