Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline 333OnlyHalfEvil  
#1 Posted : 26 May 2022 04:56:35(UTC)
333OnlyHalfEvil

Rank: Newbie

Groups: Registered
Joined: 26/05/2022(UTC)
Posts: 2

Hello everyone:

I don’t see something like this on here so I thought I’d start a thread on here trying to get it going. I think it would be a great plugin because it seems like it would be easy to implement and it would give us access to all of the features contained within LibreOffice Calc.

I know how to program but I’m not too good at it though so it’ll take me awhile to figure out how to do it myself. I think it’s simple enough that someone who knows how to do it could probably do it fairly quickly. I’ll try to start working on it myself in the future assuming someone doesn’t beat me to it.

If you don’t know what it is, look up Mathcad excel component for additional information.

Basically, you would be able to insert a component that is subdivided vertically into three sections. The top section is an input section, the middle section is a view of whatever portion of the LibreOffice Calc file you want to show, and the bottom portion is the output section. The input section takes a predefined variable and sticks it into a specific cell within the LibreOffice Calc file contained within the component and it can be made larger or smaller (to add as many inputs as you need) be clicking inside of it and hitting either enter or backspace respectively. The output section takes the contents of a LibreOffice Calc cell and stored it within a variable. If you double click the center area it will automatically open up your LibreOffice Calc file (stored within the component) and allow you to edit it.

What do you think?
Offline alyles  
#2 Posted : 26 May 2022 15:49:44(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 238
United States

Was thanked: 76 time(s) in 47 post(s)
I could get behind a libre office plugin. That would be great.
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline 333OnlyHalfEvil  
#3 Posted : 27 May 2022 03:56:34(UTC)
333OnlyHalfEvil

Rank: Newbie

Groups: Registered
Joined: 26/05/2022(UTC)
Posts: 2

Cool. Do you know how to make it?

In my head (and there are probably some issues with this so don’t take my word as gold), pseudo code (in xml style formatting) for the plugin would be something like this:

Import statements

<GenericPluginWrapper>
<EquationBorder border=“visible” resize_handles=“true”>
<EquationBorder border=“hidden” resize_handles=“false” text=“Input”>
<SMathBackground vertical_resize=“true”>
<for each_equation>
<insert into_LibreOfficeCalc />
</for>
</SMathBackground>
</EquationBorder>
<LibreOfficeCalcView vertical_resise=“auto”>
<if LibreOfficeCalcInstalled == true>
<display_FirstWorksheet />
<onEvent double_click=“true”>
<RunLibreOfficeCalc />
<listen_for_LibreOfficeCalc_close>
<save LibreOfficeCalc_into_plugin />
</onEvent>
</if>
<else>
<error_catch message=“LibreOffice Calc Not Installed” />
</else>
</LibreOfficeCalcView>
<EquationBorder border=“hidden” resize_handles=“false”>
</EquationBorder>
<EquationBorder border=“hidden” resize_handles=“false” text=“Output”>
<SMathBackground vertical_resize=“true”>
<for each_equation>
<export from_LibreOfficeCalc />
</for>
</SMathBackground>
</EquationBorder>
</EquationBorder>
</GenericPluginWrapper>

In English, the description of the pseudo code is as follows.

The GenericPluginWrapper tags enclosing all of the pseudo code is basically your generic plugin code that every SMath plugin has, only with the appropriate edits, such as the name being changed to: Libre Office Calc Component Plugin.

You know how, when you’re working in SMath and editing an equation, the equation has a border around it while you’re editing it? Well, the EquationBorder tags are the same thing, only instead of the equation border being around an equation, the pseudo code is using it like a container to contain what we need for the plugin instead of an equation. There’s one big EquationBorder encompassing the entire component (instead of encompassing a standard equation, like normal) only the border is always showing (which is why it says border=“visible within the tag). The main border also needs resize handles (when the libre office Calc component is selected) so the user can resize the component to whatever size he/she needs it to be.

Within the all-encompassing EquationBorder tag are three other EquationBorder tags which are basically dividing vertically the main one into three sub-sections.

The first sub-section EquationBorder tag is intended to be the input section of the component. It doesn’t need its border to be showing so the property is set to “hidden”. It doesn’t need resize handles because it gets its size from its position within the all-encompassing one. And it has some test that says “Input” so the user and/or printout viewer knows that section of the component is the input section.

Within the first sub-section is an SMathBackground tag which is basically the same thing as the standard background grid within SMath that you can use to input equations. You can make it vertically larger or smaller by clicking within it and hitting enter or backspace, respectively. You use the input section to type in equations in a certain way to tell the plugin how you want your SMath stored variables to be inserted into LibreOffice Calc. Your variables within the input section would need to be named something along the lines of: Calc_subscript_Worksheet1!A4=SMathVariable, which would take the appropriate SMath variable and insert its data within cell A4 of Worksheet1.

Then the for tag is a loop that loops through all of the different input variables the user entered into the input section of the component and inserts them into the appropriate cells within LibreOffice Calc.

The third sub-section of the component is similar to the first only it is an output section. The formulas the user places within this section tell the component to take data out of a LibreOffice Calc cell and store it within an SMath variable. So, your variable names within the output section would need to be something like: x=Calc_subscript_Worksheet2!A5, which would take whatever is in cell A5 of Worksheet2 and store it within the SMath variable x.

The second sub-section is the LibreOffice Calc subsection. Basically it fills up the remainder of the component that isn’t being taken up by the input and output sections and it displays the first worksheet (starting at cell A1) within the LibreOffice Calc file contained within the component. It will probably need to access functions within LibreOffice Calc in order to display the worksheet contents appropriately. It should have some functionality that senses whether the user has LibreOffice Calc installed or not. If you double-click on the middle section, it opens up the LibreOffice Calc file stored within the component using whatever version of LibreOffice Calc the user has installed on their computer. It should be always listening/checking for changes to the stored file in order to display the appropriate content.

So, yeah, I think that’s it. I hope this helps out in the future.

Edit: so, the pseudo code is a little messed up and I posted this on my phone and can’t seem to edit it properly. I indented everything within the posting textbox but it doesn’t display indented. I’ll edit it a bit next time I’m on my main computer.

Edited by user 27 May 2022 04:06:47(UTC)  | Reason: Not specified

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.