Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Control Attribute Text Color
Topic Summary:
Created On: 12-May-2006 18:40
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Louie Landale, on Friday, May 12, 2006 8:35 PM

Answer:
You cannot do it directly. You could probably do it as follows: Create an Enumerated attribute "Warning" with Enumerations "FarTooHigh", "TooHigh", "Acceptable". Assign colors Red, Yellow, Green. Create your layout DXL that calculates the value, then sets 'obj."Warning" = "FarTooHigh"' if its too big. Insert this column into the view, then adjust its properties to use "Color by Attribute, and pick "Warning".

Notice you are not displaying the Warning attribute. Notice that the layout must know the threshold

- Louie
 12-May-2006 18:40
User is offline View Users Profile Print this message


James Walker

Posts: 8
Joined: 15-Jun-2005

I'm working on a DXL column that displays the result of a calculation. Management wants the result to display in red if the result is over a particular threshold. Is this possible?
Report this to a Moderator Report this to a Moderator
 12-May-2006 20:01
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Answer Answer
You cannot do it directly. You could probably do it as follows: Create an Enumerated attribute "Warning" with Enumerations "FarTooHigh", "TooHigh", "Acceptable". Assign colors Red, Yellow, Green. Create your layout DXL that calculates the value, then sets 'obj."Warning" = "FarTooHigh"' if its too big. Insert this column into the view, then adjust its properties to use "Color by Attribute, and pick "Warning".

Notice you are not displaying the Warning attribute. Notice that the layout must know the threshold

- Louie
Report this to a Moderator Report this to a Moderator
 12-May-2006 20:38
User is offline View Users Profile Print this message


James Walker

Posts: 8
Joined: 15-Jun-2005

Very good Louie! Works exactly as advertised. I will now go home, have a few beers on my new deck and relax until Monday. Thanks mate!
Report this to a Moderator Report this to a Moderator
 15-May-2006 17:02
User is offline View Users Profile Print this message


Hazel Woodcock

Posts: 78
Joined: 6-May-2005

I am a little reluctant to get involved in the whole dxl thing as I am really not a software engineer but...

I was playing with things I don't really understand some while ago and I wanted redline markup, or green text if there were no changes to the particular attribute since the last baseline.

It is probably a bit of a cludge, but I have displayed a particular colour without having to use an attribute.

I won't try to explain what I have done (because I have forgotten my reasoning), the layout dxl should be attached.

I wait to be severely reprimanded for bad coding :-)

Hazel
Report this to a Moderator Report this to a Moderator
 15-May-2006 20:56
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

OK. Displaying the difference in colors works. So it appears the RTF tag "\\cf1 " means "red", the RTF tag "\\cf3 " means "green", and I presume the tag "\\cf2 " means blue.

Walker could do the following: practice with your code playing with different values of "x" in the "\\cfx " lines; in order to get a mapping of x to colors. Write his Layout with code that looks like this:


string RtfRediculousPreAmble = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0 \\fswiss\\fcharset0 Arial;}}{\\colortbl ;\\red255\\green0\\blue0;\\red0\\green128\\blue0;\\red0\\green0\\blue128;}"

string RftRediculousPostAmble = " }"

string Value = Value I want to display
string Tag

if (Value is in the high range) Tag = "\\cf1 "
elseif(Value is in the above average range) Tag = "\\cf2 "
elseif(Value is in the below average range) Tag = "\\cf3 "
else Tag = "\\cf4 ".

string DisplayString = RtfRediculousPreAmble Tag Value RtfRediculousPostAmble
displayRichWithColour DisplayString

If this works its better than my extra-enumerate-attribute solution.

- Louie
Report this to a Moderator Report this to a Moderator
 17-May-2006 09:50
User is offline View Users Profile Print this message


Paul Worrall

Posts: 87
Joined: 30-Sep-2003

There is another way.... (look up canvases in the DXL manual, this technique also gives you some control over the font)
Report this to a Moderator Report this to a Moderator
 30-May-2006 13:45
User is offline View Users Profile Print this message


James Walker

Posts: 8
Joined: 15-Jun-2005

Rich text display is the better solution. Using a 'hidden' variable to base the color on meant the object was changed every time the module was opened. Now the user can open the module to look at it and close it without being prompted to save. Thanks Hazel and Louie for your help on this one. Jim
Report this to a Moderator Report this to a Moderator
 12-Jul-2007 14:00
User is offline View Users Profile Print this message


amjad moghul

Posts: 2
Joined: 12-Jul-2007

Thanks - this is exactly what I wanted!

Shame I can't find the same command in the Help file even I know it works
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.