How to add a region to existing plugin

How to add a region to existing plugin - Messages

#1 Posted: 2/14/2016 6:54:52 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Hi All,

I figured I might as well cash-in on the knowledge I got while working on Image Region, and to add a region for my excel_IO plugin.

Now how can I do this? Can a plugin have both smath functions (excel_IO()) and a region support?

Please provide as much guidance as you can - I could use all of it and than some!

Currently all I have is this Class1.vb file.

Class1.zip (8 KiB) downloaded 64 time(s).

Thank you!
#2 Posted: 2/15/2016 4:53:59 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Can a plugin have both smath functions (excel_IO()) and a region support?



The Maxima plugin is an example. I don't know the implementation details, but the plugin comes with a set of functions like Maxima(), MaximaLog()... and two interactive plot regions, where you can move, zoom and rotate the diagram with the mouse and with a settings menu opening upon double click.

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 2/23/2016 2:10:59 AM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

My issue is that i have written XLSXupdate in VB.NET and every other region plugin is in c#.

Can you guys help me with a specific error implementing the region in VB.NET?

I am trying to convert this code from C# to VB.NET

var buttonImageRegionHolder = new MenuButton("Image", delegate(MenuButtonArgs args)
            {
                args.CurrentRegion = new ImageRegion();
            }
                );

this is my last hurdle. For now.
#4 Posted: 2/23/2016 6:32:17 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hello Alex,

not sure if this works (is made with a converter)

C# source:
MenuButton button= new MenuButton("OxyPlot", this.AddRegion);
        private void AddRegion(MenuButtonArgs args)
        {
            args.CurrentRegion = new OxyPlotRegion();
        }

VB.NET translation:
Dim button As New MenuButton("OxyPlot", AddressOf Me.AddRegion)
		Private Sub AddRegion(ByVal args As MenuButtonArgs)
			args.CurrentRegion = New OxyPlotRegion()
		End Sub
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Alexander O. Melnik 2/23/2016 10:10:00 AM
#5 Posted: 2/23/2016 10:09:58 AM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote

Hello Alex,

not sure if this works (is made with a converter)

C# source:

MenuButton button= new MenuButton("OxyPlot", this.AddRegion);
        private void AddRegion(MenuButtonArgs args)
        {
            args.CurrentRegion = new OxyPlotRegion();
        }

VB.NET translation:
Dim button As New MenuButton("OxyPlot", AddressOf Me.AddRegion)
		Private Sub AddRegion(ByVal args As MenuButtonArgs)
			args.CurrentRegion = New OxyPlotRegion()
		End Sub



Thank you Davide, it worked (unlike the code from many other converters I tried to use). I also learned something in a process which is good :-)

What is the converter you are using? Would be handy for me to get a hold of it...
#6 Posted: 2/23/2016 11:51:07 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Good

For simple conversion the online Snippet Converter of SharpDevelop is useful

The code above was produced by Instant VB (Free Edition), it converts the whole project (if the project is not too big); the few times I've used it, it worked fine.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Alexander O. Melnik 2/23/2016 11:53:00 AM
#7 Posted: 10/10/2024 12:34:20 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Am I missing something? Do we have one more component for drawing graphs (OxyPlotRegion)?
Russia ☭ forever, Viacheslav N. Mezentsev
#8 Posted: 10/10/2024 2:09:58 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

I don't know, I don't see the plugin within the online list, nor in the Extensions Manager.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • New Posts New Posts
  • No New Posts No New Posts