Pages: 1
Print
Author Topic: Highlighting Text and Applying User Interface Style Works...Sometimes  (Read 4217 times)
dianamost
Member

Posts: 6


« on: March 24, 2009, 02:49:58 PM »

Wondering if anyone else has this problem.....and has found a solution!

We are using XMetal 5.5 with DITA.  Sometimes when I apply a style to existing text, the results are not what I expect.

With the User Interface Element, I can select existing text and then select Insert > User Interface Element > Uicontrol to apply the <uicontrol> existing text </uicontrol> tags without wiping out the text.  It works most of the time.

However, if I try the same thing with Insert > User Interface Element > Menu Cascade, it erases the existing text and inserts the blank command. 

<menucascade><uicontrol><?xm-replace_text UI Control?></uicontrol><uicontrol><?xm-replace_text UI Control?></uicontrol></menucascade>

This means I am retyping dozens of single menu items that I did not apply the style to when I created them. I didn't know at the time that I had to use the menu cascade because there is no second menu. The Menu Cascade style has to be there to comply with our standards because it has special font formatting.

Does it wipe out my text because of the "?xm-replace_text UI Control?" command in the inserted XML? Is there another way of doing this without losing my text? An easier way to do it? 

Thanks in advance.
             
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: March 24, 2009, 03:15:05 PM »

This is not you, this is a limitation in the software. It always occurs for <menucascade> because we do not have any code that attempts to preserve what is currently selected in this case. I assume we will try to correct this at some point.

There are two workarounds I can think of for the 5.1 and 5.5 releases:

Using the Insert Menu:
Assuming you have something like this:
Code:
<p>text1 text2 text3</p>
1. Select each of text1, text2, text3 in turn and select "User Interface Control" from the Insert menu.
2. Place your insertion point before all of the first <uicontrol> elements you just inserted and select Menu Cascade from the Insert menu. You should now have the following (carriage returns added for clarity here):
Code:
<p>
 <menucascade>
  <uicontrol><?xm-replace_text UI Control?></uicontrol>
  <uicontrol><?xm-replace_text UI Control?></uicontrol>
 </menucascade>
 <uicontrol>text1</uicontrol>
 <uicontrol>text2</uicontrol>
 <uicontrol>text3</uicontrol>
</p>
3. Select all of the <uicontrol> items, press Ctrl+X to cut them.
4. Select all of the <uicontrol> elements inside <menucascade> and press Ctrl+V to paste over them. You will end up with this:
Code:
<p>
 <menucascade>
 <uicontrol>text1</uicontrol>
 <uicontrol>text2</uicontrol>
 <uicontrol>text3</uicontrol>
 </menucascade>
</p>

Using the Element List:
Assuming you have something like this:
Code:
<p>textitem1 textitem2 textitem3</p>

1. Select each of textitem1, textitem2, textitem3 in turn and double click on the <uicontrol> element in the Element List. You will then have this:
Code:
<p>
 <uicontrol>text1</uicontrol>
 <uicontrol>text2</uicontrol>
 <uicontrol>text3</uicontrol>
</p>
2. Select all of the <uicontrol> elements you just inserted and then double click on <menucascade> in the Element List. You will then have this:
Code:
<p>
 <menucascade>
 <uicontrol>text1</uicontrol>
 <uicontrol>text2</uicontrol>
 <uicontrol>text3</uicontrol>
 </menucascade>
</p>
Logged
Pages: 1
Print
Jump to:  

email us