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: Add text to an object
Topic Summary:
Created On: 1-Dec-2006 02:50
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.
 1-Dec-2006 02:50
User is offline View Users Profile Print this message


Chris Jones

Posts: 177
Joined: 1-Jul-2005

We've replaced the standard "Insert OLE..." dialog with a customized one--mostly to simplify the interface, but we'd also like to insert the file name as text, either before or after the newly inserted OLE object.

The problem is that if we insert the object and then just do

    o.OTEXT = o.OTEXT "\n" get_plainname(filename) ""


the new object gets erased. On closer inspection, all rich text and OLEs get taken out, because the statement just treats everything as plain text.

So I'm wondering if there's a simple way to add a little bit of text onto a rich text string without manually fiddling with the RTF that's already there. (The first solution that came to mind was to strip out the last '}', add a formatted RT string, and then put the '}' back on....that seems a little klugy though.)

Any thoughts?

Thanks,
Chris
Report this to a Moderator Report this to a Moderator
 1-Dec-2006 06:40
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

Wouldn't the function richTextWithOle help?

o.OTEXT = richTextWithOle(o.OTEXT) "\n" get_plainname(filename) ""

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/
Report this to a Moderator Report this to a Moderator
 1-Dec-2006 18:19
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

[1] "string Text = o.OTEXT" retrieves only raw text. To retrieve rich text with the OLEs use "richTextWithOle(o, OTEXT)".

[2] "o.OTEXT = Text" sets the attribute with raw text from variable Text. To set Rich text (including OLEs) use "o.OTEXT = richText(Text)".

Thus, your statement becomes:
"o.OTEXT = richText(richTextWithOle(o, OTEXT) "\n" get_plainname(fileName) "")

- Louie

PS. See als command "richTextNoOle" that gets Rich Text but excludes OLE info.
The "richText(o, OTEXT)" command is legacy, but works like the "richTextWithOle" command. EDIT CORRECTION: Works like the 'richtTextNoOle'command.

Edited: 7-Dec-2006 at 01:32 by Louie Landale
Report this to a Moderator Report this to a Moderator
 6-Dec-2006 00:00
User is offline View Users Profile Print this message


Chris Jones

Posts: 177
Joined: 1-Jul-2005

I like this idea.

I had figured that just concatenating a newline onto a properly-formatted RTF string would mangle things and be ugly, so I hadn't tried it. But, I did after you guys posted and it turns out that DOORS doesn't really care. It seems to re-form the RTF after you set the object text.

Thanks!
Chris
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.