Conditionally Formatted Labels

Conditionally Formatted Labels - Add Conditionally Formatted Labels in SMath Studio worksheets - Сообщения

#1 Опубликовано: 30.09.2013 10:46:40
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

SMath Studio compatibility SMath Viewer compatibility mono compatibility

extension page Sources MIT license


Hi all,

Here there is a plugin to add labels customizable by canvas inputs.

Plugin languages: English Italiano

  • requirements: SMath Studio 0.96.5146 Nigthly build or later, .Net Framework 2.0;
  • installation: SMath Studio: Tools > Plugins... > Online Gallery;
  • documentation: download and unzip the attached archive;
  • languages: if you want to have a new UI language look into the documentation's Language folder


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




Control Regions: CheckBoxList | ComboBoxList | ConditionallyFormattedLabelNumericUpDown | PathPicker | RadioButtonList | Slider
CFLabelRegion_docs.7z (83 КиБ) скачан 863 раз(а).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
7 пользователям понравился этот пост
studoc 16.12.2015 04:31:00, Вячеслав Мезенцев 30.09.2013 12:10:00, sergio 30.09.2013 13:21:00, Martin Kraska 30.09.2013 14:13:00, ioan92 01.10.2013 03:45:00, Andrey Ivashov 26.10.2013 08:10:00, Radovan Omorjan 30.09.2013 11:24:00
#2 Опубликовано: 30.09.2013 11:28:24
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

This is nice Davide, thank you

By the way, we can suppress viewing the if statement (only the formated label) by right click and unchecking "Display input data"

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Опубликовано: 30.09.2013 12:30:11
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

You're right Radovan, and you can also nest many if/else to have multiple outputs
2013-09-30 18_36_36-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
#4 Опубликовано: 30.09.2013 13:28:28
sergio

sergio

115 сообщений из 329 понравились пользователям.

Группа: User

thanks Davide,
but I can't resize the label despite the presence of grip
sergio

Win64
Portable Version Smath 0.96 (build 4909)
#5 Опубликовано: 30.09.2013 14:12:09
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

thanks Davide,
but I can't resize the label despite the presence of grip
sergio

Win64
Portable Version Smath 0.96 (build 4909)


The size is exclusively driven by the contents (string length). Might be a good idea to hide the grips.

Please find attached a brick for bar charts. Please note that I was forced to fill the right of the bar by visible symbols as spaces obviously are disregarded for computing the region size.

Example cfregion barchart.sm (4 КиБ) скачан 278 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Radovan Omorjan 30.09.2013 14:51:00
#6 Опубликовано: 30.09.2013 14:39:22
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

Wrote

The size is exclusively driven by the contents (string length).

Correct, this is by design - like for hyperlink regions

Wrote

Might be a good idea to hide the grips.


I know, but is not yet possible; Andrey know this issue, the behavior will change in future

Wrote

Please note that I was forced to fill the right of the bar by visible symbols as spaces obviously are disregarded for computing the region size.


I can force the plugin to measure also the trailing spaces, if could be useful, just let me know it


best regards,

Davide
2013-09-30 20_38_18-SMath Studio Desktop - [Example cfregion barchart.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 пользователям понравился этот пост
Radovan Omorjan 30.09.2013 14:52:00
#7 Опубликовано: 30.09.2013 15:04:25
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

Wrote

I can force the plugin to measure also the trailing spaces, if could be useful, just let me know it



Done, updated
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Martin Kraska 30.09.2013 15:23:00
#8 Опубликовано: 30.09.2013 15:38:42
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Now the complete bar chart.
bar.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 пользователям понравился этот пост
Davide Carpi 30.09.2013 17:17:00, Radovan Omorjan 01.10.2013 04:46:00
#9 Опубликовано: 01.10.2013 10:08:16
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

UPDATED

- works in Smath Viewer;
- default background color (empty string): white;
- default foreground color (empty string): black.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Martin Kraska 02.10.2013 03:56:00
#10 Опубликовано: 02.10.2013 04:22:38
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Thanks for the update.

As you see, the region can display multiline text, thus it would be possible to do stuff like the bar chart in a single region, if there was access to the newline character from the GUI.

I'd propose to accept a single string as argument, now as there are defaults for the colors.
I also propose to left align the text (or to provide optional control)
cfr.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#11 Опубликовано: 02.10.2013 04:43:53
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

Hi Martin,

I see, I'll think about to add more controls... as general idea this region is thinked to be used as a label (a short text) with variable appearance depending on the script events; the table region will be the better solution to have a more customizable (fixed) appearance.

BTW your last example puts me in mind that would be more handy and useful to use the built-in Output window to easily access these infos without calling dedicated functions or looking for log files.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#12 Опубликовано: 02.10.2013 06:05:31
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

as general idea this region is thinked to be used as a label (a short text) with variable appearance depending on the script events; the table region will be the better solution to have a more customizable (fixed) appearance.


Off-spec use of features is part of the fun, isn't it?
Wrote


BTW your last example puts me in mind that would be more handy and useful to use the built-in Output window to easily access these infos without calling dedicated functions or looking for log files.


I suppose your proposal impies that the output window can be fed directly from inside plugins. How would I trigger this from outside? How do I identify the output of a particular math region in the midst of a SMath sheet? I can't stop the re-calculation of a sheet at a particular expression, can I?

The maxima plugin has a two-level log inspection feature:
  1. MaximaLog("all" ) displays the entire Maxima session from the Maxima perspective without translation detail)
  2. MaximaLog(#) displays the detail of the previous Maxima call including maxima command, maxima response and back-translation.
By positioning the MaximaLog(#) at the right place you can clearly tell what Maxima did in the last interaction, regardless if the call was made by a hijacked function like int(), diff(), sum() or lim(), a dedicated function like Solve() or LinSolve() or directly by a Maxima() command.
I found MaximaLog(#) handy to use for documenting bugs in the todo list and it is always close at hand (from the dynamic assistant) in the sheet without the need to open and close the output window.

I must admit that I don't know how to even reach this level of comfort and clearness using the output window. How would you control the output if not by dedicated commands? How would you identify where the output came from? When using trace(), I find myself adding label texts to output commands in order to match the output with the SMath context. But I may just oversee options, thus any ideas are welcome.

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#13 Опубликовано: 02.10.2013 06:35:07
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

Wrote

Off-spec use of features is part of the fun, isn't it?

Not always (for the developpers) :-p
The multiline feature is not easily accessible from the canvas, so the alignment feature would produce confusion (in some way like the resize's grips); BTW if you want a "display region" to send out a well formatted output from the Maxima plugin, you can also make something like the "Maple" region of Viacheslav

Wrote

I suppose your proposal impies that the output window can be fed directly from inside plugins. How would I trigger this from outside? How do I identify the output of a particular math region in the midst of a SMath sheet? I can't stop the re-calculation of a sheet at a particular expression, can I?

The maxima plugin has a two-level log inspection feature:

  1. MaximaLog("all" ) displays the entire Maxima session from the Maxima perspective without translation detail)
  2. MaximaLog(#) displays the detail of the previous Maxima call including maxima command, maxima response and back-translation.
By positioning the MaximaLog(#) at the right place you can clearly tell what Maxima did in the last interaction, regardless if the call was made by a hijacked function like int(), diff(), sum() or lim(), a dedicated function like Solve() or LinSolve() or directly by a Maxima() command.
I found MaximaLog(#) handy to use for documenting bugs in the todo list and it is always close at hand (from the dynamic assistant) in the sheet without the need to open and close the output window.

I must admit that I don't know how to even reach this level of comfort and clearness using the output window. How would you control the output if not by dedicated commands? How would you identify where the output came from? When using trace(), I find myself adding label texts to output commands in order to match the output with the SMath context. But I may just oversee options, thus any ideas are welcome.


Sincerely I don't know, I've threw a stone into the pond
Maybe a special context menu item could be added or a log function with canvas free result that enable the output window output, or something else

BTW looking back my previous post Log files are useful for crashes (deep debugging -> plugin's developpers)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#14 Опубликовано: 04.10.2013 15:16:41
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

UPDATED

- Fixed regional settings issues with Font sizes (comma decimal separator related*)


* Martin's activebook svn file updated
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Martin Kraska 04.10.2013 15:36:00
#15 Опубликовано: 04.10.2013 15:35:37
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

Martin's activebook svn file updated


Great, thanks. I also updated the barchart example.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#16 Опубликовано: 25.10.2013 11:39:06
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

UPDATED

- small fixes
- added styles (optional 4th argument)
2013-10-25 19_47_40-SMath Viewer.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Andrey Ivashov 26.10.2013 08:22:00
#17 Опубликовано: 02.02.2014 19:56:29
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

UPDATED

- SMath Studio 0.96.5146 required


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 пользователям понравился этот пост
ioan92 03.02.2014 15:28:00, Andrey Ivashov 02.02.2014 21:01:00
#18 Опубликовано: 05.02.2014 04:22:07
kaaden

kaaden

0 сообщений из 13 понравились пользователям.

Группа: User

Hello !

Where can I download the Formatting Label for 4909 versión?

with new version I can´t open old snippets

#19 Опубликовано: 05.02.2014 04:46:51
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

Wrote

Hello !

Where can I download the Formatting Label for 4909 versión



You can use the portable version provided by mkraska (here) directly or copying the plugin from that distribution to your %APPDATA% folder
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#20 Опубликовано: 05.02.2014 05:18:01
kaaden

kaaden

0 сообщений из 13 понравились пользователям.

Группа: User

thanks

I download from here

https://smath.com/wiki/SMath%20with%20Plugins.ashx

  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений