Andrew D Posted October 17, 2007 Share Posted October 17, 2007 First off, how do you de-bug your plug-in in VS Express 2005, because Rick's tutorial on how to do it on the full version dosen't apply to the express version. Secondly, how do you choose what sub-menu you want your plug-in to go into, and thirdly, how do you create hyperlinks, like in pyrochild's plug-in's? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted October 17, 2007 Share Posted October 17, 2007 Um, this quite obviously belongs in General Coding, not General Discussion. Moved Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 Ok, I've found out basically of how I can "de-bug" it, but now I still need to know how to allow hyperlinks and also be able to choose a sub-menu. Quote Link to comment Share on other sites More sharing options...
MadJik Posted October 18, 2007 Share Posted October 18, 2007 1. Edit your title to help the search engine! "debug plugins" please! 2. Some debug instruction (search could help) here: viewtopic.php?f=6&t=4920 3.For myself, I can't find a link to install VS 2005 C++ Express, so I can't go further in debug mode I only use VS 2005 C# Express. So I would appreciate if someone points me to a working link to VS 2005 C++ Express. 4.For the label with a link you could find example here viewtopic.php?f=16&t=2302 or here viewtopic.php?f=16&t=4879 Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 1. Edit your title to help the search engine! "debug plugins" please!2. Some debug instruction (search could help) here: viewtopic.php?f=6&t=4920 3.For myself, I can't find a link to install VS 2005 C++ Express, so I can't go further in debug mode I only use VS 2005 C# Express. So I would appreciate if someone points me to a working link to VS 2005 C++ Express. 4.For the label with a link you could find example here viewtopic.php?f=16&t=2302 or here viewtopic.php?f=16&t=4879 Ok, I've managed a way in effect to de-bug them, I now know (I guess) how to create hyperlinks, now I just need to know how to put it in a sub menu. Quote Link to comment Share on other sites More sharing options...
Bob Posted October 18, 2007 Share Posted October 18, 2007 using System;using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; namespace PaintDotNet.Effects { public sealed class MotionBlurEffect : Effect { public MotionBlurEffect() : base(PdnResources.GetString("MotionBlurEffect.Name"), PdnResources.GetImage("Icons.MotionBlurEffect.png"), SubmenuNames.Blurs, EffectDirectives.None, true) { Quote No. Way. I've just seen Bob. And... *poof!*—just like that—he disappears into the mist again. ~Helio Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 In the CodeLab code I'm using, that isn't in there at all, anywhere where I can define the Sub-Menu. Any idea on how I can? using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Reflection; using System.IO; using Microsoft.CSharp; namespace PaintDotNet.Effects { public class CodeLab : Effect { public static Image StaticImage { get { Assembly ourAssembly = Assembly.GetExecutingAssembly(); Stream imageStream = ourAssembly.GetManifestResourceStream("PaintDotNet.Effects.Icons.CodeLab.png"); Image image = Image.FromStream(imageStream); return image; } } public CodeLab() : base("Code Lab", StaticImage, true) { } public override EffectConfigDialog CreateConfigDialog() { CodeLabConfigDialog secd = new CodeLabConfigDialog(); return secd; } public override void Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, int startIndex, int length) { CodeLabConfigToken sect = (CodeLabConfigToken)parameters; Effect userEffect = sect.UserScriptObject; if (userEffect != null) { userEffect.EnvironmentParameters = this.EnvironmentParameters; try { userEffect.Render(null, dstArgs, srcArgs, rois, startIndex, length); } catch (Exception exc) { sect.LastExceptions.Add(exc); dstArgs.Surface.CopySurface(srcArgs.Surface); sect.UserScriptObject = null; } } { } } } } I believe this is the part of the CodeLab script which needs to contain the sub-menu data. Right? Quote Link to comment Share on other sites More sharing options...
MadJik Posted October 18, 2007 Share Posted October 18, 2007 I don't understand why you want to redo the codelab... This is the beginning of the code for the GridMaker. Look at the lines with //§§§ for the submenu name! using System; using System.Resources; using System.Drawing; using PaintDotNet; using System.Drawing.Imaging; using PaintDotNet.Effects; namespace GridMaker { public class EffectPlugin : PaintDotNet.Effects.Effect { public static string StaticSubMenuName //§§§ { get { return PdnResources.GetString("RenderSubmenu.Name"); } } //§§§ for the submenu Render //§§§ you could also create a new menu or a menu PDN doesn't know if you put a string directly, ex: //§§§ { get { return "My_SubMenu"); } } public static string StaticName { get { return "Grid/CheckerBoard Maker "; } } // This is the text that shows in the menu public static Bitmap StaticIcon { get { return new Bitmap(typeof(EffectPlugin), "EffectPluginIcon.png"); } } // Here is the icon public EffectPlugin() : base(EffectPlugin.StaticName, EffectPlugin.StaticIcon, EffectPlugin.StaticSubMenuName, true) //§§§ { } . . . But next version(s) should provide something different IMO Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 I don't understand why you want to redo the codelab... This is the beginning of the code for the GridMaker. Look at the lines with //§§§ for the submenu name! using System; using System.Resources; using System.Drawing; using PaintDotNet; using System.Drawing.Imaging; using PaintDotNet.Effects; namespace GridMaker { public class EffectPlugin : PaintDotNet.Effects.Effect { public static string StaticSubMenuName //§§§ { get { return PdnResources.GetString("RenderSubmenu.Name"); } } //§§§ for the submenu Render //§§§ you could also create a new menu or a menu PDN doesn't know if you put a string directly, ex: //§§§ { get { return "My_SubMenu"); } } public static string StaticName { get { return "Grid/CheckerBoard Maker "; } } // This is the text that shows in the menu public static Bitmap StaticIcon { get { return new Bitmap(typeof(EffectPlugin), "EffectPluginIcon.png"); } } // Here is the icon public EffectPlugin() : base(EffectPlugin.StaticName, EffectPlugin.StaticIcon, EffectPlugin.StaticSubMenuName, true) //§§§ { } . . . But next version(s) should provide something different IMO I'm not re-doing it really, just skinning it. Quote Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Reflection; using System.IO; using Microsoft.CSharp; namespace PaintDotNet.Effects { public class CodeLab : Effect { public static string StaticSubMenuName //§§§ { get { return PdnResources.GetString("AdvancedSubmenu.Name"); } } //§§§ for the submenu Render //§§§ you could also create a new menu or a menu PDN doesn't know if you put a string directly, ex: //§§§ { get { return "My_SubMenu"); } } public static Image StaticImage { get { Assembly ourAssembly = Assembly.GetExecutingAssembly(); Stream imageStream = ourAssembly.GetManifestResourceStream("PaintDotNet.Effects.Icons.CodeLab.png"); Image image = Image.FromStream(imageStream); return image; } } public CodeLab() : base("Code Lab", StaticImage, true) { } public override EffectConfigDialog CreateConfigDialog() { CodeLabConfigDialog secd = new CodeLabConfigDialog(); return secd; } public override void Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, int startIndex, int length) { CodeLabConfigToken sect = (CodeLabConfigToken)parameters; Effect userEffect = sect.UserScriptObject; if (userEffect != null) { userEffect.EnvironmentParameters = this.EnvironmentParameters; try { userEffect.Render(null, dstArgs, srcArgs, rois, startIndex, length); } catch (Exception exc) { sect.LastExceptions.Add(exc); dstArgs.Surface.CopySurface(srcArgs.Surface); sect.UserScriptObject = null; } } { } } } } Ok, I filtered the code you just posted and set the submenu to Advanced, yet when I built it, it was just where CodeLab usually is. How can I get around this? Quote Link to comment Share on other sites More sharing options...
MadJik Posted October 18, 2007 Share Posted October 18, 2007 So... For example change the line : public CodeLab() : base("Code Lab", StaticImage, true) { } to : public CodeLab() : base("Code Lab", StaticImage, "Advanced", true) { } This will move the codelab to the advanced submenu (with the scriptlab)... Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 So...For example change the line : public CodeLab() : base("Code Lab", StaticImage, true) { } to : public CodeLab() : base("Code Lab", StaticImage, "Advanced", true) { } This will move the codelab to the advanced submenu (with the scriptlab)... Thank you. This can be closed now. Quote Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 Actually, I'll take that back for now at least. When I had the skin done, and I found it worked, I deleted the old CodeLab .dll. But now when I open up the new one, this error message appears saying that it can't find the original CodeLab file, and now it dosen't apply anything to the canvas. How? And if so, how can I stop this from happening? Download VS 2005 Project Here Quote Link to comment Share on other sites More sharing options...
MadJik Posted October 18, 2007 Share Posted October 18, 2007 I just took the CodeLabConfigDialog.cs and CodeLabConfigDialog.resx from your project to the original project and it seems to be Ok. I prefer the original UI, but I move the CodeLab to Advanced submenu... Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 I just took the CodeLabConfigDialog.cs and CodeLabConfigDialog.resx from your project to the original project and it seems to be Ok.I prefer the original UI, but I move the CodeLab to Advanced submenu... The thing is which I don't get is that it needs the original file to act as a metadata file, otherwise it messes up....Strange is a understatement. I'll remove the sub-menu option and then see if it works. EDIT: Nope, still dosen't work without the original. I'm going to have a look and see if I can remove that fault from the error libary....then it might work.... EDIT 2: Which isn't possible....I'm stumped. I need to be able to find a way to either allow the skinned version to work by itself, or make the original CodeLab be hidden and act as a libary for the plug-in...... Huh, if I can't solve it, I may aswell just give up on it...... Quote Link to comment Share on other sites More sharing options...
MadJik Posted October 18, 2007 Share Posted October 18, 2007 So... Change the code again to give it another menu name for example change the line : public CodeLab() : base("Code Lab", StaticImage, "Advanced", true) { } to : public CodeLab() : base("Code Lab AD", StaticImage, "Advanced", true) { } Rename as well the DLL to something else (like CodeLabAD.dll)... Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 So...Change the code again to give it another menu name for example change the line : public CodeLab() : base("Code Lab", StaticImage, "Advanced", true) { } to : public CodeLab() : base("Code Lab AD", StaticImage, "Advanced", true) { } Rename as well the DLL to something else (like CodeLabAD.dll)... I've renamed it so it isn't called CodeLab, but it still says that error message when it can't find the original CodeLab file. Quote Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 Eureka! I got it done, I found that I only needed to call the actual file "CodeLab". Now, this can be locked. :wink: Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted October 18, 2007 Share Posted October 18, 2007 I don't understand why you want to re-skin CodeLab. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Andrew D Posted October 18, 2007 Author Share Posted October 18, 2007 I don't understand why you want to re-skin CodeLab. It was basically just to help myself learning C#, I'm not saying there's anything wrong with the normal CodeLab UI, I mainly done it to help advance my learning, and now I know how to do several other plug-in things which I wouldn't know, and then if I made a plug-in I'd be stumbling around mindlessy like I was today, I guess. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.