Error implementing ToolboxGroup for the maxima plugin

Error implementing ToolboxGroup for the maxima plugin - "ButtonsMetaData.ButtonsMetaData()" is inaccessible due to its protection level - Messages

#1 Posted: 7/31/2023 2:09:47 PM
muiz

muiz

15 likes in 22 posts.

Group: User

Hello everyone,

I've been trying to implement the toolbox feature for the maxima plugin that I am currently working on. The example that I am following is from Davide Carpi

https://smath.info:8443/!/#public/view/head/plugins/CustomFunctions/Toolbox.cs

When implementing ButtonsMetaData[] part, it shows me an error "ButtonsMetaData.ButtonsMetaData()" is inaccessible due to its protection level. Any idea on what did I do wrong or way to fix this?

Screenshot_509.png

Screenshot_508.png

Regards,

Muiz

1 users liked this post
sergio 8/1/2023 6:08:00 AM
#2 Posted: 8/1/2023 2:42:18 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

I'm not sure that the Toolbox code in Custom Functions is updated to the latest API changes, since that feature is not activated there;

please check one of the following:



You might find the latter more interesting since implements also the SVG rendering.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
muiz 8/1/2023 4:11:00 AM, sergio 8/1/2023 6:08:00 AM
#3 Posted: 8/3/2023 7:06:42 PM
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 likes in 164 posts.

Group: User

Greetings,

I vaguely remember having a similar issue. I program in VB.NET, so part of my issue was converting code from C# to VB.NET, but I'll rattle off some items:

  • Make sure you set up your class correctly; 「Implements」 IPluginToolboxGroups instead of 「Inherits」 or 「Delegate」 or 「Shared」

  • Subs/Functions/Variables must use appropriate permissions; I think I had some as 「Private」 or 「Protected」, but had to use 「Public」 ¿Maybe?

  • I broke up my ButtonsMetaData declarations; instead of having an inline statement like you, I created an object and then modified the properties; I remember having some trouble getting an inline statement to work...
    
          Dim btnButtonA2 As ButtonsMetaData = New ButtonsMetaData(" Δ°F "
          btnButtonA2.Action = "'Δ°F"
          btnButtonA2.Description = "Degrees Fahrenheit, Difference of"
    
          Dim toolGrp_A As ToolboxGroup = New ToolboxGroup()
          toolGrp_A.Title = "Engineering Toolbar"
          toolGrp_A.Buttons = {btnButtonA1, btnButtonA2, btnButtonA3}
    
          Return (New ToolboxGroup() {toolGrp_A})



As a final note (for what its worth): this is the class I am using:
SMath.Manager.ButtonsMetaData

Your problem may be the "ButtonsMetaData.ButtonsMetaData()".

I'm using v0.99 so that may also be an item to note between us.


May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
2 users liked this post
muiz 8/4/2023 4:56:00 AM, sergio 8/4/2023 5:04:00 AM
  • New Posts New Posts
  • No New Posts No New Posts