Page 2 of 3
Re: Skin a control with SVG Widget in Datagrid
Posted: Wed Sep 23, 2020 9:09 am
by richmond62
My example above is extremely inefficient as the 2 iconPaths
should be stored as custom properties inwith the SVG widget itself,
as should the "1 or 2" state indicator.
Re: Skin a control with SVG Widget in Datagrid
Posted: Thu Sep 24, 2020 2:48 am
by bwmilby
Here is a tiny LCB library that will allow you to easily convert icons to drawings. It adds several handlers:
- generateXmlForSvgPath - same code as posted earlier with a different name
- drawingSvgCompilePath - takes a path and generates the drawing
- drawingSvgCompileIcon - takes an icon name (from the SVG Icon Library) and generates the drawing
To install, download/unzip the lce file and open the Extension Manager (Tools menu). Click on the "+" icon and choose the lce file.
After install, use is as simple as:
Code: Select all
set the text of image 1 to drawingSvgCompileIcon("thumbs up")
Re: Skin a control with SVG Widget in Datagrid
Posted: Thu Sep 24, 2020 8:59 am
by bn
Thank you Brian,
a very useful and instructive file
Kind regards
Bernd
Re: Skin a control with SVG Widget in Datagrid
Posted: Thu Sep 24, 2020 9:15 am
by Klaus
Thank you very much, Brian, waaaay cool!

Re: Skin a control with SVG Widget in Datagrid
Posted: Thu Sep 24, 2020 11:23 am
by richmond62
Undoubtedly Brian's code to convert SVG objects into images is very clever,
but I fail to see any advantage over a simple screenshot of the object.
This is NOT intended to denigrate Brian's work at all.
Re: Skin a control with SVG Widget in Datagrid
Posted: Thu Sep 24, 2020 11:29 am
by Klaus
Well, enlarge a screenshot and a converted SVG image and spot the difference!
Re: Skin a control with SVG Widget in Datagrid
Posted: Thu Sep 24, 2020 1:19 pm
by richmond62
Klaus wrote: Thu Sep 24, 2020 11:29 am
Well, enlarge a screenshot and a converted SVG image and spot the difference!
Got it: no "jaggies" . . . BUT, who is going to enlarge one of those images?
Does this mean that Brian's things are converting the SVGs to internal graphic objects rather than images-qua-images?
-

- DA.jpg (11.12 KiB) Viewed 9122 times
Re: Skin a control with SVG Widget in Datagrid
Posted: Thu Sep 24, 2020 1:48 pm
by Klaus
richmond62 wrote: Thu Sep 24, 2020 1:19 pmKlaus wrote: Thu Sep 24, 2020 11:29 amWell, enlarge a screenshot and a converted SVG image and spot the difference!
Got it: no "jaggies"
Bravo!
richmond62 wrote: Thu Sep 24, 2020 1:19 pmDoes this mean that Brian's things are converting the SVGs to internal graphic objects rather than images-qua-images?
Brians and LCs "drawcompile..." stuff actually creates a resolution independant
image object, no graphic!
Its magic, ladies and gentlemen!

Re: Skin a control with SVG Widget in Datagrid
Posted: Fri Sep 25, 2020 10:53 am
by richmond62
Here's some rubbishy work that may have potential . . .
-
Re: Skin a control with SVG Widget in Datagrid
Posted: Mon Sep 28, 2020 1:36 pm
by richmond62
The problem with my stack is that each "interpretation" of an SVG widget uses a single
polygonal graphic.
Re: Skin a control with SVG Widget in Datagrid
Posted: Tue Sep 29, 2020 5:09 pm
by marksmithhfx
Hi all, turns out you don't need to skin a button, you can just use the SVG Icon in its place and script it to function like a control. Will post example tomorrow as the rest of my day is shot.
Thank you so much for all of your input. I am going to work through it as time permits because I am sure there are some great examples I can learn from.
Mark
Re: Skin a control with SVG Widget in Datagrid
Posted: Tue Sep 29, 2020 8:37 pm
by richmond62
Just take a screenshot of the SVG widget and use that image as your icon.
Re: Skin a control with SVG Widget in Datagrid
Posted: Tue Sep 29, 2020 8:57 pm
by bwmilby
bansalrehana wrote: Tue Sep 29, 2020 8:28 pm
I don't suppose there is a way one can use an SVG widget as an icon for a button is there?
See the icondrawing library that I posted above. That will allow you to convert an SVG icon into the drawing format that can be set on an image.
Re: Skin a control with SVG Widget in Datagrid
Posted: Wed Sep 30, 2020 1:29 pm
by marksmithhfx
Here's an example of using an SVG Icon as a checkbox in a datagrid. If you open the contents pane and lock it you can watch the values update in realtime. All the code for the check box is in the column behaviour script.
Re: Skin a control with SVG Widget in Datagrid
Posted: Wed Sep 30, 2020 1:53 pm
by marksmithhfx
bwmilby wrote: Thu Sep 24, 2020 2:48 am
Here is a tiny LCB library that will allow you to easily convert icons to drawings. It adds several handlers:
Hi Brian, how do you scale images or shrink them once you've read them? I tried your code example using a check mark and it took up the whole screen
Mark