Setting colours in shape script using a tagged val

92 views
Skip to first unread message

Jayson

unread,
Aug 27, 2014, 9:36:27 PM8/27/14
to sparx-enterprise-archite...@googlegroups.com
Ok,

So I am trying to set the colour of some elements in a shape script using a tagged value set up as a "colour picker".

I am pretty sure I have exhausted all possible avenues, but just thought I would throw this on the forum in case someone else can think of a way.

I have created a tag value type called "Fill Colour" that has detail as follows:

Type=Color;

I then create a tagged value called "Fill Colour" whose type is also "Fill Colour".

What I have then done is included the following line in my script:

SetFillColor("#TAG:Fill Colour#);

I did this based on the misbegotten hope that it will evaluate the #TAG expression as a string and then feed that into the SetFillColor method.

However, when I run this it tells me that "#Tag:..." is not valid, which indicates to me that the script treats the #Tag expression as a a literal.

Does anyone out there in Sparx land have any idea if what I am trying to do is possible?

Cheers

Jays  :)

[original message]

M@localhost Simon M

unread,
Aug 28, 2014, 1:55:39 AM8/28/14
to sparx-enterprise-archite...@googlegroups.com
I don't think that SetFillColor accepts substitutions.

The closest you can do is something like:

if(HasTag("Fill Colour", "Red"))
  SetFillColor(255,0,0);
else if(HasTag("Fill Colour", "Green"))
  SetFillColor(0,255,0);
...

[original message]

Jayson

unread,
Aug 28, 2014, 2:06:38 AM8/28/14
to sparx-enterprise-archite...@googlegroups.com
Hi Simon

I suspect you are correct.
I am using the suggested technique in other areas, but what I am trying to achieve with this script really needs to allow the user to select from a full pallette of colours.

Thanks for the reply.
At very least it will stop me driving myself nuts trying to find out how to do it.

It would be nice however if you could suggest the next major release actually turned the shape scripting language into something a LOT more powerful because it is super frustrating.

Cheers  :)

[original message]

M@localhost Simon M

unread,
Aug 28, 2014, 2:26:21 AM8/28/14
to sparx-enterprise-archite...@googlegroups.com
In terms of giving them the full range of colour, my best thought is to re-use on of the colours that are available. (eg. Always draw the line colour in black and use it to set whatever portion you want filled in a different colour)

I agree it would be nice for the shape script language to be more complete. Unfortunately, I don't see that the demand (from people defining languages) justifies the time required to do it.

As has been said many times on this forum, there are so many things that people would like to see. We can't get to all of them.

PS. The fact that you said colour as opposed to color wins you points as far as I'm concerned.

[original message]

qwerty

unread,
Aug 28, 2014, 7:26:06 AM8/28/14
to sparx-enterprise-archite...@googlegroups.com

6872767475761B0 wrote:
PS. The fact that you said colour as opposed to color wins you points as far as I'm concerned.

Sparx would win points removing the Generealiz/sation dichotomy.

q.

[original message]

Jayson

unread,
Aug 28, 2014, 2:25:15 PM8/28/14
to sparx-enterprise-archite...@googlegroups.com
Hmmm, I don't understand why an Australian company can't spell using Australian english.

I know the yanks can't spell properly so we have to put up with their products being "defective", but what the hell is up with Sparx?
Catering for the yankee market?  >:(

[original message]

qwerty

unread,
Aug 28, 2014, 2:55:48 PM8/28/14
to sparx-enterprise-archite...@googlegroups.com
That was a former statement from one of the Sparxians. From a marketing view quite understandable. I guess most of their licenses are sold in US (maybe followed by Germany and the UK market). Funny enough it looks like USers are  more picky about their language than UKers  ::) We Germans don't care anyway. Except it comes to Generaliz/sation >:(

q.

[original message]
Reply all
Reply to author
Forward
0 new messages