[Scilab-users] Matrix of strings and grid

classic Classic list List threaded Threaded
11 messages Options
ludovic.wagner67@gmail.com ludovic.wagner67@gmail.com
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Matrix of strings and grid

Hello,

I'm looking for a way to display spreadsheets on a graphic window (the idea
is to embed some features of spreadsheet programs). I need  to superpose
matrix of strings over grids using xrects(rects, fill).

PS I have several thousands rows to display, so I can't loop through and
draw all elements individually. Of course, I will add a slider to scroll the
spreadsheet, but that's not an issue..

Is it possible to adjust and constraint the height of each row when drawing
matrix of strings?

Many thanks,



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

Hi,

Have you looked at the table example in "uicontrol" help file?
It displays a nice Excel-style table inside a graphic window, with scroll bars.

Regards,
Rafael

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
ludovic.wagner67@gmail.com ludovic.wagner67@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

Thanks for your reply. No I didn't really try, but I don't think that
editable table can have advanced formatting option (background colour, etc.)

It seems that above 100 rows approximately, xstringl lacks of precision. It
also seems that above 2000 rows it displays nothing..

I think I will limit the display to a hundred rows and update data (values,
background colours, etc.) instead of scrolling the entire spreadsheet.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

In reply to this post by ludovic.wagner67@gmail.com
Hello Ludovic,

Le 14/07/2018 à 09:38, [hidden email] a écrit :
Hello,

I'm looking for a way to display spreadsheets on a graphic window (the idea
is to embed some features of spreadsheet programs). I need  to superpose
matrix of strings over grids using xrects(rects, fill).

PS I have several thousands rows to display, so I can't loop through and
draw all elements individually. Of course, I will add a slider to scroll the
spreadsheet, but that's not an issue..

Is it possible to adjust and constraint the height of each row when drawing
matrix of strings?

A uicontrol - listbox component may be used to get a scrollable stylable area.
Styling is done by using some (implicit or explicit) HTML tags. HTML 4.0 is supported.

Please see for instance:
--> demo_gui() // => GUI => Listboxes and Popupmenus
--> edit SCI/modules/gui/demos/uicontrol_listbox_popupmenu.dem.sce
https://help.scilab.org/docs/6.0.1/en_US/uicontrol_properties.html => String => listbox

--> edit("SCI/modules/atoms/macros/atoms_internals/atomsSetInstalledList.sci",64)


To cancel elements interactivity, just keep their .callback field empty.

HTH
Samuel


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

Hi Samuel,

 

Thanks for this key example, which greatly improves the readability of long output lists.

If Scilab provided the same background color functionality for the uicontrol in Table mode (rows, columns or cells), it would be awesome.

 

Regards,

Rafael

 

 

From: users [mailto:[hidden email]] On Behalf Of Samuel Gougeon
Sent: Saturday, July 14, 2018 3:20 PM
To: Users mailing list for Scilab <[hidden email]>
Subject: Re: [Scilab-users] Matrix of strings and grid

 

Hello Ludovic,

Le 14/07/2018 à 09:38, [hidden email] a écrit :

Hello,
 
I'm looking for a way to display spreadsheets on a graphic window (the idea
is to embed some features of spreadsheet programs). I need  to superpose
matrix of strings over grids using xrects(rects, fill).
 
PS I have several thousands rows to display, so I can't loop through and
draw all elements individually. Of course, I will add a slider to scroll the
spreadsheet, but that's not an issue..
 
Is it possible to adjust and constraint the height of each row when drawing
matrix of strings?


A uicontrol - listbox component may be used to get a scrollable stylable area.
Styling is done by using some (implicit or explicit) HTML tags. HTML 4.0 is supported.

Please see for instance:
--> demo_gui() // => GUI => Listboxes and Popupmenus
--> edit SCI/modules/gui/demos/uicontrol_listbox_popupmenu.dem.sce

https://help.scilab.org/docs/6.0.1/en_US/uicontrol_properties.html => String => listbox

--> edit("SCI/modules/atoms/macros/atoms_internals/atomsSetInstalledList.sci",64)


To cancel elements interactivity, just keep their .callback field empty.

HTH
Samuel


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
ludovic.wagner67@gmail.com ludovic.wagner67@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

Hello,

Thanks for your replies. Sure, listboxes give great results where there is
only one column even if I believe it would be possible to link several
listboxes with callback. Is it possible to colour entire background
(differently for each lines) instead of having the small square?

I've just checked and found out that height of matrix of strings is steadily
decreasing with the function stringl divided by number of strings. Is there
any explanations?

Thanks again!



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

The  demo_gui() > GUI >  Listboxes, show examples with entire lines with grey or black backgrounds.
For other colors just use appropriate html code:
https://htmlcolorcodes.com/

Regards,
Rafael

-----Original Message-----
From: users [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Sunday, July 15, 2018 9:49 AM
To: [hidden email]
Subject: Re: [Scilab-users] Matrix of strings and grid

Hello,

Thanks for your replies. Sure, listboxes give great results where there is only one column even if I believe it would be possible to link several listboxes with callback. Is it possible to colour entire background (differently for each lines) instead of having the small square?

I've just checked and found out that height of matrix of strings is steadily decreasing with the function stringl divided by number of strings. Is there any explanations?

Thanks again!



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

French colors codes (#0050A4, #FFFFFF , #EF4135) at:

https://en.wikipedia.org/wiki/Flag_of_France#Design

 

And Croacia’s ones at:

https://en.wikipedia.org/wiki/Flag_of_Croatia#Colours

 

 

PS : Allez les Bleus!

 

Regards,

Rafael


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

In reply to this post by ludovic.wagner67@gmail.com
Le 15/07/2018 à 09:49, [hidden email] a écrit :
Hello,

Thanks for your replies. Sure, listboxes give great results where there is
only one column even if I believe it would be possible to link several
listboxes with callback. Is it possible to colour entire background
(differently for each lines) instead of having the small square?

Here is an example of scrollable table displayed in a figure:
nl = 500;
t = [(1:nl)' grand(nl,10,"uin", -1e4, 1e4)];
t = strsubst(justify(string(t),"r")," ","&nbsp;");
t = "<td>" + t + "</td>";
t = [emptystr(t(:,1))+"<tr" t emptystr(t(:,1))+"</tr>"];
t(1:2:$,1) = t(1:2:$,1) + " bgcolor=''#FFF6D6''>";
t(2:2:$,1) = t(2:2:$,1) + ">";
t = "<html>" + ..
    "<table style=''font-family:Monospaced'' cellpadding=''1''>" + ..
    strcat(t,"","c") + ..
    "</table>";

clf
p = [10 10 550 300];
Listbox = uicontrol(gcf(), "style","listbox", "string",t, "position",p);




_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
ludovic.wagner67@gmail.com ludovic.wagner67@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

Thanks again Samuel, but I have the following error on my computer (Linux
Mint 18.3):

An error has been detected while loading
/opt/scilab-6.0.1/share/scilab/modules/randlib/.libs/libscirandlib.so:
/opt/scilab-6.0.1/share/scilab/modules/randlib/.libs/libsci randlib.so:
cannot open shared object file: No such file or directory

I finally decided to draw the grid thanks to a mesh and color the interior
of the grids with xrects. I thought about colouring the grid directly from
the mesh function, but I also want to hide the characters of the strings
which exceed the column widths.

It works quite well, but I still need to optimise the code enhance some
features (different window sizes, etc.)



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Matrix of strings and grid

Le 16/07/2018 à 21:37, [hidden email] a écrit :
Thanks again Samuel, but I have the following error on my computer (Linux
Mint 18.3):

An error has been detected while loading
/opt/scilab-6.0.1/share/scilab/modules/randlib/.libs/libscirandlib.so:
/opt/scilab-6.0.1/share/scilab/modules/randlib/.libs/libsci randlib.so:
cannot open shared object file: No such file or directory

It comes from grand(..) that is used in the example just to create some sample data.
You may use
int((rand(nl,10)-0.5)*2e4)
instead, or your own actual data.



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users