MJW Posted February 10, 2021 Share Posted February 10, 2021 I'd like to add an Overwrite option to a Blend Mode menu, and I'm not sure the best way to do it. I want a menu like the Paint Bucket and other such tools use, where the final option is Overwrite. I must admit I don't really understand all that's going on with the code that creates and configures the menu, some of which looks like this: // setup for a user selected blend mode IEnumLocalizerFactory factory = Services.GetService<IEnumLocalizerFactory>(); IEnumLocalizer blendModeLocalizer = factory.Create(typeof(LayerBlendMode)); IList<ILocalizedEnumValue> blendModes = blendModeLocalizer.GetLocalizedEnumValues(); object blendModesArray = blendModes.Select(lev => lev.EnumValue).ToArrayEx(); int defaultBlendModeIndex = blendModesArray.IndexOf(LayerBlendMode.Normal); I do know, though, that it uses enumerations and such that don't include Overwrite. I'm hoping there's some reasonably simpe way to add the option to a menu while still being compatible with the standard method of creating the Blend Mode drop-down-list control. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.