Adding a Page in Settings Panel

Developer tutorials for Prototype 8.0

Adding a Page in Settings Panel

Postby Leslie » Thu Oct 02, 2014 6:19 pm

A Settings page is nothing but a User Control added with some information to the Settings Panel.

You will need to add a User Control to your Class Library ( Plugin ) to do that select Project and click on Add New Item.

Image

The next step is to select UserControl 

Image

Now just add a button to this User Control.

Image

Next we are going to add an Image which will used as a Thumbnail image for the settings page in the settings panel.

Image

Browse and select the Image file ( I recommend using a 64 x 64 PNG Image )

Image

CSharp Code

using Syn.Engine;
namespace MyPlugin
{
public class MyPlugin : SynPlugin
{
public override void Initialize()
{
SynIcon pageIcon = new SynIcon();
pageIcon.Title = "My Plugin";
pageIcon.Description = "My Plugin Page Description";
pageIcon.Page = new Page();
pageIcon.Plugin = this;
pageIcon.DisplayImage = Properties.Resources.page_image;

Engine.SettingsPanel.AddIcon(pageIcon);
}
}
}


Visual Basic Code

Imports Syn.Engine
Public Class MyPlugin
Inherits SynPlugin

Public Overrides Sub Initialize()
Dim pageIcon As New SynIcon
pageIcon.Plugin = Me
pageIcon.Page = New Page
pageIcon.Title = "My Plugin"
pageIcon.Description = "My Plugin Page Description"
pageIcon.DisplayImage = My.Resources.page_image

Engine.SettingsPanel.AddIcon(pageIcon)
End Sub

End Class


 

And Voila! your Page Icon should appear in the Settings Panel of the Engine and when the user clicks on this Icon your Settings Page for the Plugin will be displayed.
User avatar
Leslie
Lead Software Architect
 
Posts: 287
Joined: Fri Sep 14, 2012 12:20 pm

Return to Developer Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests
cron