Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Alex M.  
#1 Posted : 15 February 2016 00:54:52(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
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 (9kb) downloaded 13 time(s).

Thank you!

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline mkraska  
#2 Posted : 15 February 2016 10:53:59(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 2,026
Germany

Was thanked: 1153 time(s) in 739 post(s)
Originally Posted by: Alex.M Go to Quoted Post
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://smath.com/wiki/SMath_with_Plugins.ashx
Offline Alex M.  
#3 Posted : 23 February 2016 08:10:59(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
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

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


this is my last hurdle. For now.

Edited by user 23 February 2016 10:14:07(UTC)  | Reason: Not specified

Offline Davide Carpi  
#4 Posted : 23 February 2016 12:32:17(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,703
Man
Italy
Location: Italy

Was thanked: 1376 time(s) in 901 post(s)
Hello Alex,

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

C# source:
Code:
MenuButton button= new MenuButton("OxyPlot", this.AddRegion);

Code:
        private void AddRegion(MenuButtonArgs args)
        {
            args.CurrentRegion = new OxyPlotRegion();
        }


VB.NET translation:
Code:
Dim button As New MenuButton("OxyPlot", AddressOf Me.AddRegion)

Code:
		Private Sub AddRegion(ByVal args As MenuButtonArgs)
			args.CurrentRegion = New OxyPlotRegion()
		End Sub
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 23/02/2016(UTC)
Offline Alex M.  
#5 Posted : 23 February 2016 16:09:58(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
Hello Alex,

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

C# source:
Code:
MenuButton button= new MenuButton("OxyPlot", this.AddRegion);

Code:
        private void AddRegion(MenuButtonArgs args)
        {
            args.CurrentRegion = new OxyPlotRegion();
        }


VB.NET translation:
Code:
Dim button As New MenuButton("OxyPlot", AddressOf Me.AddRegion)

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

Edited by user 23 February 2016 16:16:28(UTC)  | Reason: Not specified

Offline Davide Carpi  
#6 Posted : 23 February 2016 17:51:07(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,703
Man
Italy
Location: Italy

Was thanked: 1376 time(s) in 901 post(s)
Good 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.

Edited by user 23 February 2016 17:55:27(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 23/02/2016(UTC)
Online uni  
#7 Posted : 10 October 2024 06:34:20(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,576
Man
Russian Federation

Was thanked: 1325 time(s) in 776 post(s)
Am I missing something? Do we have one more component for drawing graphs (OxyPlotRegion)?
Russia ☭ forever
Viacheslav N. Mezentsev
Offline Davide Carpi  
#8 Posted : 10 October 2024 08:09:58(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,703
Man
Italy
Location: Italy

Was thanked: 1376 time(s) in 901 post(s)
I don't know, I don't see the plugin within the online list, nor in the Extensions Manager.

Edited by user 11 October 2024 01:56:54(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.