Page 1 of 1

Images

Posted: Tue Aug 17, 2021 5:49 pm
by fabiopf
Guys,

In our classic problem type we have images to illustrate the meaning of the variables, as you can see in the image below.
classic.PNG
classic.PNG (126.22 KiB) Viewed 4453 times
I am now rewriting our problem type using the new system (based in the CustomLIB library). I suppose it is not possible to add images to the tree, so what do you suggest? What is the best way to convert this old dialgo to the new problem type system?
new.PNG
new.PNG (92.4 KiB) Viewed 4453 times
As far as I know using the tree is not possible to add images.

Re: Images

Posted: Thu Aug 19, 2021 10:40 am
by fjgarate
Hi Fabio,

You are right, you can not add images in that window.
The nearest you can approach, if you think that the image is relevant, is to create some kind of window, like the one we show in this cmas2d_wizard example.

https://github.com/GiDHome/cmas2d_customlib_wizard

As you can see in the readme.md , this repository extends a customLib problemtype, with the tree, and adds a window to assign properties to the tree. In your case, you could create a window to assign the material properties. Check the step 2 and see how we take the values from the window to place them into the tree
https://github.com/GiDHome/cmas2d_custo ... definition

If you are interested, I could explain you how to create a toolbar and add a button, so you could launch your own windows that interact with the tree

Javi G

Re: Images

Posted: Thu Aug 26, 2021 4:33 pm
by fabiopf
Hi Javi,

Many thanks for your reply. I will have a look at the repository. Yes, I would appreciate if you could explain me how to launch my own windows that interact with the tree. This method seems to be a good alternative to implement the material database, in opposition to implement it as nodes of the tree.

Best,
Fabio

Re: Images

Posted: Wed Sep 01, 2021 2:06 pm
by escolano
There is a more simple option,
copy the image to a folder named images inside the problemtype
and add to the .spd the attribute
help_image="your_filename"
e.g.
help="hello world" help_image= "laminates.png

then the image will appear below the contextual help text, like this
help_image.png
help_image.png (95.15 KiB) Viewed 4356 times

Re: Images

Posted: Mon Sep 06, 2021 11:05 am
by fabiopf
Thanks guys, I will try this.