Text Region Utilities

Text Region Utilities - Helps to set some Text Region properties - Messages

#1 Posted: 3/2/2014 6:11:25 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

This plugin adds a couple of items in the "Insert" > "Text region utilities" menu to add new text regions with custom fonts and/or with links.

A "Toolbox" region is provided to do more actions on the worksheet (edit text/links, add links from paths, convert TextRegions into WriterRegions, search and replace text in the whole worksheet)

  • requirements: to have all the features, SMath Studio 0.97.5737 or later and WriterRegion 0.3.5800 or later;
  • installation: SMath Studio: Tools > Plugins... > Online Gallery (be sure to have "Exclude beta-versions" unchecked);
  • documentation: refer to the interactive handbook of Martin Kraska (Tools > Plugins > Interactive books);
  • sources: the updated sources are available in the SVN repository.


NOTES:
- the font dialog uses only Font-Size, Font-Family, Bold, Italic and Underline attributes;
- the font size is taken from the built-in toolbar, but the choosen font settings are not applied to the standard font;
- to use a link between worksheets, the file in which you add the link must exist (the empty temporary file provided launching SMath must be saved before clicking the link created with this plugin);
- the toolbox region requires a refresh of the worksheet before using it.

>>> PLEASE REPORT IN THIS THREAD ANY ISSUE, MORE DETAILED AS POSSIBLE <<<


OLD VERSIONS:

Show Spoiler


2014-03-04 02_26_22-SMath Studio Desktop - [Page1].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
5 users liked this post
Mikka 3/5/2014 3:15:00 AM, ioan92 3/2/2014 8:13:00 AM, IVR 3/2/2014 10:08:00 AM, Radovan Omorjan 3/2/2014 11:59:00 AM, Martin Kraska 3/2/2014 6:31:00 AM
#2 Posted: 3/2/2014 6:48:31 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Davide, again something very nice from your highly productive plugin forge!

If I understand correctly, the specification of fonts or targets is limited to the very instant of creating the region.

Is there any chance to hook the dialogs to the context menu of existing text regions?

Also, could you allow for typing in the "text" entry of the link dialog without changing the contents of the "link" entry?
It is surely convenient to take the link entry contents as default for the text, but if you can't change the text independently, then there is no need for a second entry in the dialog.

Would be great to have a file selector dialog for the link entry. Then Kay could learn how to do that for selecting the Maxima path in the Maxima Settings window.

Note for users:
  • When following a link by Ctrl-click (be it existing or just created) in a given worksheet, then take care that all changes are saved, because the current document is silently replaced by the contents of the link target.
  • The SMath window title won't update when you follow links, unless the currently open document is saved.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
ioan92 3/2/2014 8:18:00 AM
#3 Posted: 3/2/2014 8:34:05 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Wrote

Davide, again something very nice from your highly productive plugin forge!

If I understand correctly, the specification of fonts or targets is limited to the very instant of creating the region.


Thank you very much Martin
Yes, you are right...

Wrote

Is there any chance to hook the dialogs to the context menu of existing text regions?


Looking the Text Region code, I think that is not possible...

Wrote

Also, could you allow for typing in the "text" entry of the link dialog without changing the contents of the "link" entry?
It is surely convenient to take the link entry contents as default for the text, but if you can't change the text independently, then there is no need for a second entry in the dialog.


This is already possible, doesn't work for you? (screencast)

Wrote

Would be great to have a file selector dialog for the link entry. Then Kay could learn how to do that for selecting the Maxima path in the Maxima Settings window.


I know, but to build a relative path is needed the path of the file, and I've not found a way to access this property...

Wrote

Note for users:

  • When following a link by Ctrl-click (be it existing or just created) in a given worksheet, then take care that all changes are saved, because the current document is silently replaced by the contents of the link target.
  • The SMath window title won't update when you follow links, unless the currently open document is saved.


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
Martin Kraska 3/2/2014 9:09:00 AM, ioan92 3/2/2014 9:49:00 AM
#4 Posted: 3/2/2014 9:08:47 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Wrote

Also, could you allow for typing in the "text" entry of the link dialog without changing the contents of the "link" entry?
It is surely convenient to take the link entry contents as default for the text, but if you can't change the text independently, then there is no need for a second entry in the dialog.


This is already possible, doesn't work for you? (screencast)


It works, I can't reproduce the mentioned problem, sorry for making useless noise.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#5 Posted: 3/2/2014 12:19:22 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello Davide,

Thanks for this one

By the way, when using text region for linking to a worksheet you mentioned in the first post "(the empty temporary file provided launching SMath must be saved before clicking the link created with this plugin)". I just did this (empty new worksheet and the link to nonexisting doc.sm) and SMath reported an Unhandled exception .

Is there any way to edit this link if we made a mistake and a "non existing file" has been reported after CTRL+link.? I suppose that deleting and inserting another one would also not be a big deal.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#6 Posted: 3/2/2014 3:12:55 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hello Radovan

The unhandled exception is generated because SMath can't build a relative url if a "physical" file doesn't exist... because (until now) the only way to add a link in a worksheet is to work with the xml code of an existing file, the exception should be considered a "missing feature" of the Text Region...

AFAIK there's no way to edit the link, just delete it and create a new one (you can copy and paste the text to save a little bit of work); however, I hope this is better than editing the worksheet code
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#7 Posted: 3/2/2014 7:11:57 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hello Ioan

Wrote

Would it be possible, please, to allow the format data (font size, font name etc.) modification, even after the region definition ?
When using such a text region, usually it's hard to take the right decision (for format data) from the very bigging, without any correction possibility.


I'll try other ways; with this approach seems to me that is not possible... anyway now the problem is "only" the change of the font-family or the target of the link; size/bold/italic/underline are easily driven from the existing toolbar and the keyboard shortcuts.


Best regards,

Davide
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
ioan92 3/3/2014 3:52:00 AM
#8 Posted: 3/3/2014 4:05:08 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

UPDATED

- Added a "toolbox" region; this region requires a refresh of the worksheet before using it. Use the context menu items to set the font properties of existing text regions...

Because this plugin is intended to be a temporary patch to a missing feature, I suggest as "best practice" to delete the region before closing your worksheets; this will ensure you the backward compatibility when this plugin will be removed.


Wrote

Would be great to have a file selector dialog for the link entry. Then Kay could learn how to do that for selecting the Maxima path in the Maxima Settings window.


I've left a The 2nd menu item , that doesn't work (I don't know why) but does your job. The sources are on the repository. Feel free to contact me if there are issues (but the code it's really simple).

Wrote

Of course, the ideal (if there could be one) should be a similarity with a famous text editor as MS Word, where many formats can coexist in a zone and all are permanently editable.


This requires an improvement of the built-in Text Region. Actually the text is formatted in a single "block"; something like a rich text editor requires more job (the code to get/set the styles piece by piece)


Best regards,

Davide
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
ioan92 3/3/2014 4:51:00 PM
#9 Posted: 3/4/2014 6:35:54 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

UPDATED

- toolbox: "edit links..." now works
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
Martin Kraska 3/4/2014 8:45:00 AM
#10 Posted: 3/4/2014 8:26:52 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hi Ioan,

- The toolbox needs a refresh of the page to capture all the text regions;
- Then you can choose a text region and add (or delete) a link to another worksheet;

screencast

If there are problems, let me know...
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
ioan92 3/4/2014 8:30:00 AM
#11 Posted: 3/4/2014 8:51:46 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Editing links has become much more easy and consistent, thanks a lot for that.

I also like the "select all" button.

There are cursor placement issues in texts with non-monospaced fonts. May be that is a reason why font change is not supported natively so far.

BTW Arial 11pt perfectly matches the grid.

I think it is safe to leave the control regions in the document, because so far SMath just silently removes any unknown regions (which is bad if you edit and save a file with some plugin missing in the system).
Arial.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#12 Posted: 3/6/2014 6:14:39 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Just a little cookie...

who want can download and compile an improved version of this plugin, that can change the fonts of the math regions; this is not shared in the EM because the changes are not persistant (you can't save the changes), thus can be used only to make screenshots on the fly and few other things...


Best regards,

Davide
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
ioan92 3/6/2014 7:40:00 AM, IVR 3/6/2014 12:00:00 PM
#13 Posted: 3/10/2014 12:16:18 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Davide, could you please add the link target selector button to the "Worksheet link" dialog just like it already is present in the edit link dialog?

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#14 Posted: 3/10/2014 2:43:52 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Sure... however, as I've written before, only absolute links will be available from that feature.


Best regards,

Davide
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#15 Posted: 3/10/2014 7:11:49 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Sure... however, as I've written before, only absolute links will be available from that feature.


What do you mean? For me, the links picked by the dialog look perfectly relative.

linkpath.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#16 Posted: 3/10/2014 7:48:41 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

From the canvas the toolbox get a FileName property from the Store; this contains the location of the file, thus it is possible to build a relative path.

From the insert menu I've not found a way to have an initialized FileName (as usual any hint is welcome ).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#17 Posted: 3/17/2014 8:00:31 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

UPDATED

(SMath Studio 0.97.5189)

- code updated to fit the new APIs features;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#18 Posted: 8/11/2014 5:00:14 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

UPDATED SMath Studio 0.97.5329

- Plugin recompiled (fix SS-203 on Linux systems)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#19 Posted: 9/4/2014 8:45:34 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

UPDATED SMath Studio 0.97.5346

- Toolbox: new feature "add links (batch)";
- Fixed bug on auto calculation disabled;
- Libraries updated.


add links (batch)

  • This feature explore all folders and sub-folders from the path of the worksheet, looking for *.sm and *.smz files;
  • If the worksheet is new (not saved somewhere) the option is disabled (if the file is saved and the option is still disabled try refreshing the worksheet);
  • You may include or not the files using checkboxes on a tree view;
  • Any link created is relative to the current location of the worksheet;
  • Links are added below the toolbox, regardless what is already on the canvas, using the same horizontal alignment.

2014-09-04 15_06_27-SMath Studio Desktop - [contents.sm_].png
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
Martin Kraska 9/4/2014 8:54:00 AM
#20 Posted: 9/4/2014 8:59:45 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Really nice. I like the batch scanning feature.
How about using the Document title property from the file header as (possibly multilingual) text in the link regions?
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
  • New Posts New Posts
  • No New Posts No New Posts