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: Color in DXL attribute with DOORS 7.x
Topic Summary:
Created On: 26-Jul-2004 16:52
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 Antonio Norkus, on Tuesday, August 3, 2004 9:11 AM

Answer:
Hi Asaf,

I know that it would be really useful, but unfortunately DOORS just won't display coloured text.

The text in the attribute can be marked up with colour, but when you display the attribute in a column, DOORS just ignores it and displays all the text in black. It's a shame...I would have really liked that feature too!

It almost looked like it could be done in DOORS 7, when I found the definition of the "diff" function in the DXL manual, which describes marking up text with colour. Here is what it said:


string diff(Buffer result, source, target, string removeMarkup, insertMarkup)
string diff(Buffer result, source, target)

Operation
Computes the annotated difference, or "redlined difference" between source and target.

The result is valid only when a non-null string is returned.

Removals and insertions are annotated by removeMarkup and insertMarkup -- this must be well-formed RTF strings onto which subsequent text may be concatenated. The standard values for these are "\cf1\strike "and "\cf2\ul " (notice the spaces). See diff/3 for a perm which uses these defaults.

Three colours are defined and may be used within these commands: RED, GREEN and BLUE:

\cf1 - RED

\cf2 - GREEN

\cf3 - BLUE

Example
diff(result, source, target, "\cf1\strike ", "\cf3\ul ")


However after contacting DOORS support when it didn't work when I used layout or attribute DXL to display the coloured text, they told me that it was a documentation error that is "fixed" in DOORS 7.1...coloured text can only be shown in a dialog box once it has been enabled. Following is the email I got from support regarding this. Sorry I'm not the bringer of better news...

Cheers,
Antonio.


Dear Mr Norkus,

This function has not been correctly documented in the DXL Reference Manual
for DOORS 7.0 SP1. This documentation defect has been rectified in the
latest version of DOORS (DOORS 7.1).
This function is currently only available for text boxes, not layout DXL and
text, and
it has to be switched on. You will have to define a text box on a dialog
box, and then call
useRTFColour(textbox, true). Also this has to be done after the textbox is
realized.
Here is a sample script (as per the DOORS 7.1 DXL Reference Manual) to
demonstrate the functionality:

DB db = create "Show diff"
DBE textbox = richText(db, "stuff", "", 200, 200, true)
Buffer buff1 = create()
Buffer buff2 = create()
Buffer resBuf = create()

buff1 = "Old Text"
buff2 = "New Text"
diff(resBuf, buff1, buff2, "\\cf1\\strike ", "\\cf3\\ul ")
realize db
useRTFColour(textbox, true)
set(textbox, tempStringOf resBuf)
show db

delete resBuf
delete buff1
delete buff2

Regards,

Laurent Ducaroir

 26-Jul-2004 16:52
User is offline View Users Profile Print this message


Asaf Kivity

Posts: 54
Joined: 25-Mar-2003

Does anybody knows how to set colors on string inside a DOORS DXL attribute. there was a tip here of how to do that with DXL column but nothing about DXL attribute. We mostly use DXL attribute because of performance issues.
Will be happy to get your responses.
Thank you,
Asaf.

asafk@manageware.co.il
Report this to a Moderator Report this to a Moderator
 28-Jul-2004 16:03
User is offline View Users Profile Print this message


Antonio Norkus

Posts: 109
Joined: 28-Jun-2003

I don't believe there is a way of colouring text for display in a DOORS module.

The only way of colouring a column, is to set the column to be coloured based on the value of an attribute. Coloured text in an attribute will not be displayed in a column.

If you do try to use rich text markup to change the colour of text in an attribute, this information is ignored when the viewing the attribute in a column...I tried this for the output of the diff function, introduced in DOORS 7 (in the manual, this function shows an example of rich text colour markup)

According to Telelogic support, rich text colour markup only applies to displaying text in a dialog box, in which case the function useRTFColour needs to be used.
Report this to a Moderator Report this to a Moderator
 1-Aug-2004 07:51
User is offline View Users Profile Print this message


Asaf Kivity

Posts: 54
Joined: 25-Mar-2003

I thought that if it is possible to do with a DXL column, it would be possible to do with a DXL attribute. i was not successful with that till now.
If anyone can assist, it would be appreciated.
Asaf.
Report this to a Moderator Report this to a Moderator
 2-Aug-2004 14:58
User is offline View Users Profile Print this message


Antonio Norkus

Posts: 109
Joined: 28-Jun-2003

The DXL attribute cannot itself be coloured, though the column that displays the DXL attribute may be coloured in the same way that any other type of column may be coloured; by specifying an enumerated attribute in the column definition.

The attached module shows:
- an enumerated attribute, with colour definitions
- a simple DXL attribute, that contains the object id and object text for an object
- the DXL attribute displayed in a column, using the enumerated attribute to colour it.

In DXL, to specify the attribute that will colour a column, use following function:
void color(Column c, string attrName)

Report this to a Moderator Report this to a Moderator
 2-Aug-2004 15:28
User is offline View Users Profile Print this message


Asaf Kivity

Posts: 54
Joined: 25-Mar-2003

Hi Antonio,
Thank you for your help.
Do you know of any way to paint specific words (not the whole object column) in this DXL attribute. this is actually what i am looking for.

Thanks,
Asaf.
Report this to a Moderator Report this to a Moderator
 2-Aug-2004 16:28
User is offline View Users Profile Print this message


Antonio Norkus

Posts: 109
Joined: 28-Jun-2003

Answer Answer
Hi Asaf,

I know that it would be really useful, but unfortunately DOORS just won't display coloured text.

The text in the attribute can be marked up with colour, but when you display the attribute in a column, DOORS just ignores it and displays all the text in black. It's a shame...I would have really liked that feature too!

It almost looked like it could be done in DOORS 7, when I found the definition of the "diff" function in the DXL manual, which describes marking up text with colour. Here is what it said:


string diff(Buffer result, source, target, string removeMarkup, insertMarkup)
string diff(Buffer result, source, target)

Operation
Computes the annotated difference, or "redlined difference" between source and target.

The result is valid only when a non-null string is returned.

Removals and insertions are annotated by removeMarkup and insertMarkup -- this must be well-formed RTF strings onto which subsequent text may be concatenated. The standard values for these are "\cf1\strike "and "\cf2\ul " (notice the spaces). See diff/3 for a perm which uses these defaults.

Three colours are defined and may be used within these commands: RED, GREEN and BLUE:

\cf1 - RED

\cf2 - GREEN

\cf3 - BLUE

Example
diff(result, source, target, "\cf1\strike ", "\cf3\ul ")


However after contacting DOORS support when it didn't work when I used layout or attribute DXL to display the coloured text, they told me that it was a documentation error that is "fixed" in DOORS 7.1...coloured text can only be shown in a dialog box once it has been enabled. Following is the email I got from support regarding this. Sorry I'm not the bringer of better news...

Cheers,
Antonio.


Dear Mr Norkus,

This function has not been correctly documented in the DXL Reference Manual
for DOORS 7.0 SP1. This documentation defect has been rectified in the
latest version of DOORS (DOORS 7.1).
This function is currently only available for text boxes, not layout DXL and
text, and
it has to be switched on. You will have to define a text box on a dialog
box, and then call
useRTFColour(textbox, true). Also this has to be done after the textbox is
realized.
Here is a sample script (as per the DOORS 7.1 DXL Reference Manual) to
demonstrate the functionality:

DB db = create "Show diff"
DBE textbox = richText(db, "stuff", "", 200, 200, true)
Buffer buff1 = create()
Buffer buff2 = create()
Buffer resBuf = create()

buff1 = "Old Text"
buff2 = "New Text"
diff(resBuf, buff1, buff2, "\\cf1\\strike ", "\\cf3\\ul ")
realize db
useRTFColour(textbox, true)
set(textbox, tempStringOf resBuf)
show db

delete resBuf
delete buff1
delete buff2

Regards,

Laurent Ducaroir

Report this to a Moderator Report this to a Moderator
 2-Sep-2004 07:13
User is offline View Users Profile Print this message


Dave Robbins

Posts: 36
Joined: 9-Dec-2003

Simple colours can be used in Layout DXL by the use of:
displayRichWithColor( string )

A sample layout DXL is attached which shows the functionality. I only discovered this since moving to 7.1

In the code example, add new attributes to compare to the array 'attributeToGetHistoryFrom[] '

HTH,

-------------------------
Dave
+44 (0)23 9270 5711
david.robbins@astrium.eads.net
~~~~~~~~~~~~~~~~~~~~
EADS Astrium, Anchorage Road
Portsmouth. Hampshire. UK PO3 5PU
Report this to a Moderator Report this to a Moderator
 2-Sep-2004 09:01
User is offline View Users Profile Print this message


Asaf Kivity

Posts: 54
Joined: 25-Mar-2003

Hello Dave,
Thank you for your answer.
We were looking for a colored DXL Attribute (as opposed to DXL Layout). In the thread it states a response from DOORS support that it cannot be done, and till now we were unable to find a way of doing that.
By the way, in one of the threads here, there is another solution for displaying color in DXL layout.
If you have anything with DXL attribute coloring, I will be happy to read it.

Thanks!
Asaf.
Report this to a Moderator Report this to a Moderator
 14-Sep-2004 14:32
User is offline View Users Profile Print this message


Asaf Kivity

Posts: 54
Joined: 25-Mar-2003

Yes, but this will get us to the beginning where the module will be to heavy to load .....
Report this to a Moderator Report this to a Moderator
 22-Jul-2005 09:17
User is offline View Users Profile Print this message


Peter Hahlganss

Posts: 13
Joined: 17-Jun-2005

Hello, I think that there is a way to show colored text in a dxl column. When you select Tools - Compare Modules... a Module Compare Wizard appears. This wizard is able to create a colored dxl column using the "compare" function which is in the dxl libary but the code is encrypted. However, it should be possible to create such a column using a dxl script, but I have no idea how to do this. Regards Peter

-------------------------
Peter
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.