How to add a region to existing plugin

How to add a region to existing plugin - 消息

#1 已发布: 2016/2/14 18:54:52
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: 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.04 KiB)已下载 566 次。

Thank you!
#2 已发布: 2016/2/15 04:53:59
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: 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.

Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#3 已发布: 2016/2/23 02:10:59
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: 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 已发布: 2016/2/23 06:32:17
Davide Carpi

Davide Carpi

1,443个赞,共2,936个帖子。

组: 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位用户喜欢此帖子
Alexander O. Melnik 2016/2/23 10:10:00
#5 已发布: 2016/2/23 10:09:58
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: 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 已发布: 2016/2/23 11:51:07
Davide Carpi

Davide Carpi

1,443个赞,共2,936个帖子。

组: 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位用户喜欢此帖子
Alexander O. Melnik 2016/2/23 11:53:00
#7 已发布: 2024/10/10 00:34:20
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

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

Davide Carpi

1,443个赞,共2,936个帖子。

组: 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
  • 有新帖
  • 无新帖