![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Buttons for text formatting in a dialog box Topic Summary: Created On: 9-Jul-2008 18:59 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi All,
I have created an interface using dialog boxes (scripted in DXL). In one of the dialog boxes, we need buttons for the bold, underline, and strikethrough capabilites for a richText field. Any idea how I might accomplish this? Any input will be highly appreciated. Regards, Pranav |
|
![]() |
|
![]() |
|
You can get the selected text indexes from a text editor element. Apply the appropriate RTF tags to the selected text, then recombine with the rest of the text and put the new rich text back in the rich text box.
int startOfSelection; int endOfSelection; get(DBE yourRichTextDBE, startOfSelection, endOfSelection); ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Thank you for your prompt response to my post.
I have done this but it does not work that well when your DBE that you pass the 'get' function is a richText box. The 'get' function will treat it as a non-richText field (leaves out all of the markup) and return the start and end of selection indices. This is fine except for when you extract the text from the richText box it contains the rich text markup so indices will not take you to the correct place. I am curious what gets called when the 'B' (bold) button gets pressed in the Formal module when you want to bold text in the Object Text. If I could find that or emulate it somehow that would make my life easier. |
|
![]() |
|
![]() |
|
Well for bold and underline, the Windows shortcut keys work in rich text boxes (Ctrl+B and Ctrl+U). That only leaves a strikethrough button being actually necessary.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
I haven't toyed with this yet, but if you want | B | I | U |buttons on a dialog box that you click with the mouse, you would probably have to:
1.) get the selected text 2.) get the entire rich text from the same box 3.) do a fancy regular expression search of the entire rich text to find the bold/italic/underline rich text tags just before and just after your selected text Rich tags off the top of my head: \\b - start bold \\b0 - stop bold \\i - start italics \\i0 - stop italics \\u - start underline \\u0 - stop underline |
|
![]() |
|
![]() |
|
Hi,
I sincerely apologize for not having acknowledged your post earlier. I have attached the snippet of code. This might offer a clearer view of what I am trying to do. Any input would be appreciated. Thank you. Regards, Pranav |
|
![]() |
|
![]() |
|
Well what stands out to me is that the "inplaceTextBoldItem" item does not exist in the list of standard items.
Update: If you read the documentation, it states that you must specify the two boolean arguments of the createButtonBar function when "the toolbar is hosted without a canvas" Specifying these I get the error that the standard item "inplaceTextBoldItem" is " invalid standard item for configuration context". So obviously they restrict their usage to the module window. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com Edited: 17-Jul-2008 at 20:40 by David Pechacek |
|
![]() |
|
![]() |
|
I just scanned the documentation and unable to find a reference to the two boolean arguments. Am I missing something here? Thank you for your help. Pranav |
|
![]() |
|
![]() |
|
void createButtonBar([string name, Sensitivity mappingCallback(), bool newRow,
bool showName]) ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Hi David,
I sincerely apologize for not having acknowledged your response earlier. I was wondering where in the documentation the bit you pasted is outlined in the documentation. Please do let me know. I am wondering if we are referring to same documentation. I am using the standard telelogic dxl reference manual. Thank you. Regards, Pranav |
|
![]() |
|
![]() |
|
So am I. Just type in the index tab "createButtonBar" and go to it. Now I am using 8.3 so if you are not, perhaps the documentation (and the function) has changed.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Buttons for text formatting in a dialog box
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.