void PaletteSubDialog::UpdatePopup(Int32 current) { BaseContainer bc; bc.SetString(ACTION_LOAD, "Load palette"); bc.SetString(ACTION_NEW, "New palette"); bc.SetString(ACTION_SAVE, "Save palette"); bc.InsData(0, String("")); if(m_showControls){ bc.SetString(ACTION_LABEL, "Show controls&c&"); }else{ bc.SetString(ACTION_LABEL, "Show controls"); } bc.InsData(0, String("")); GeDynamicArray<Palette> pals; Palette::GetPalettes(pals); for(Int32 i=0;i<pals.GetCount();i++){ String str; if(i==current){ str = "&c&"; } bc.SetString(ACTION_COUNT+i,pals[i].m_name+str); } SetPopup(m_actionPopup,bc); }
/// *************************************************************************** /// *************************************************************************** Bool RegisterContainerObject(Bool menu) { if (menu) { BaseContainer* menu = nullptr; FindMenuResource("M_EDITOR", "IDS_MENU_OBJECT", &menu); if (menu) { menu->InsData(MENURESOURCE_SEPERATOR, true); menu->InsData(MENURESOURCE_COMMAND, "PLUGIN_CMD_" + LongToString(Ocontainer)); } return true; } _orig_GetInfo = C4DOS.Bo->GetInfo; C4DOS.Bo->GetInfo = _hook_GetInfo; AutoAlloc<BaseBitmap> bmp; bmp->Init(GeGetPluginPath() + "res" + "img" + "ocontainer.png"); return RegisterObjectPlugin( Ocontainer, GeLoadString(IDS_OCONTAINER), OBJECT_GENERATOR, ContainerObject::Alloc, "Ocontainer", bmp, CONTAINEROBJECT_DISKLEVEL); }
void EnhanceMainMenu(void) { // do this only if necessary - otherwise the user will end up with dozens of menus! BaseContainer *bc = GetMenuResource(String("M_EDITOR")); if (!bc) return; // search for the most important menu entry. if present, the user has customized the settings // -> don't add menu again if (SearchMenuResource(bc,String("PLUGIN_CMD_1000472"))) return; GeData *last = SearchPluginMenuResource(); BaseContainer sc; sc.InsData(MENURESOURCE_SUBTITLE,String("SDK Test")); sc.InsData(MENURESOURCE_COMMAND,String("IDM_NEU")); // add C4D's new scene command to menu sc.InsData(MENURESOURCE_SEPERATOR,true); sc.InsData(MENURESOURCE_COMMAND,String("PLUGIN_CMD_1000472")); // add ActiveObject dialog to menu if (last) bc->InsDataAfter(MENURESOURCE_STRING,sc,last); else // user killed plugin menu - add as last overall entry bc->InsData(MENURESOURCE_STRING,sc); }