//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //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); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //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); }