![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Control Attribute Text Color Topic Summary: Created On: 12-May-2006 18:40 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() 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 | |
![]() |
|
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?
|
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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!
|
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
There is another way.... (look up canvases in the DXL manual, this technique also gives you some control over the font)
|
|
![]() |
|
![]() |
|
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
|
|
![]() |
|
![]() |
|
Thanks - this is exactly what I wanted!
Shame I can't find the same command in the Help file even I know it works |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Control Attribute Text Color
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.