Page 1 of 1

Items and Sub Items in RichView!

Posted: Wed Oct 25, 2006 5:10 pm
by mamouri
Hi
I have a questions about items in richview. Assume following scenario:

1. User paste following text in richviewEDIT
Borland Developer Studio is an integrated development environment (IDE) for building Delphi, Delphi for .NET, C#, and C++ applications. The Borland Developer Studio IDE provides a comprehensive set of tools that streamline and simplify the development life cycle.
2. Then he select "The Borland Developer Studio IDE" and Change the style using ApplyTextStyles.

3. Then he select Borland and change the style again using ApplyTextStyle (to anothor style)

4. Now there are 5 items in RichView:
A. Borland Developer Studio is an integrated development environment (IDE) for building Delphi, Delphi for .NET, C#, and C++ applications. -> Style: Normal Text
B. The -> Style #1
C. Borland -> Style #2
D. Developer Studio IDE -> Style #1
E. provides a comprehensive set of tools that streamline and simplify the development life cycle. -> Style: Normal Text


I want to change this behavior in RichView. I need get following Items:
A. Borland Developer Studio is an integrated development environment (IDE) for building Delphi, Delphi for .NET, C#, and C++ applications. -> Style: Normal Text
B. The Borland Developer Studio IDE -> Style #1
C. Borland -> Style #2
E. provides a comprehensive set of tools that streamline and simplify the development life cycle. -> Style: Normal Text

Is it possible?

Sorry for my bad english

Posted: Wed Oct 25, 2006 5:16 pm
by mamouri
In fact I want implement a special kind of formatting.
User should able to select part of text and make it poem, quotation, keyword, etc.
It's possible that user select a sentence and make it poem and then select a word in the poem and make it keyword.
Finally I want get all items texts and insert them in my "Format" table so then I can show a list of formats to the user and he can choose every format and view it's associated story.

I hop it clear what I want to do.
Thank you

Posted: Thu Oct 26, 2006 6:08 am
by Sergey Tkachenko
Sorry, items are sequential and cannot be nested.
Use another way for grouping items (style names, tag, or checkpoints)

Can you please explain more?

Posted: Thu Oct 26, 2006 4:00 pm
by mamouri
Hi
Can you please explain more? How checkpoints used for this purpose?
Only brief description would be enough and appropriated.

Regards

Posted: Fri Oct 27, 2006 2:17 pm
by Sergey Tkachenko
Well, I think that using tags is more appropriate here than using checkpoints.

I'm still confused!

Posted: Thu Nov 02, 2006 1:43 pm
by mamouri
Hi!

I'm still confused with your solution. Let's assume I set tag of every format to an equivalent number so I can later gather items and read their number and write them to the storage.

here is an Example
The Borland Developer Studio IDE provides
@---|-------|-----------------------------------@
Phrases between @ has tag 1 and phrase | has tag 2. Now still the main problem remains. When I loop to get items to find each item tags I still faced with 3 items. "The", "Borland" and "Developer Studio IDE providers".

I need a way to get "The Borland Developer Studio IDE providers" phrase with tag 1 and "Borland" phrase with tag 2.

In fact USING TAG mean splitting a phrase to MULTIPLE ITEMS. When a phrase converted to multiple items i could not get the main and sub formats.

Can you please explain your solution more to fit this situation.

Thanx

Posted: Fri Nov 03, 2006 12:17 pm
by adwilson
Insert "The Borland Developer Studio IDE provides" with tag=1 when user do something with the text that splits it in two,
RichView automatically copys the original tag to the new items.
So in the end, doesn't matter in how many items your original item was divided because all of them will heve tag=1

Posted: Fri Nov 03, 2006 1:43 pm
by Sergey Tkachenko
You can use string tags and mark phrases using unuqie id (user-defined or auto-generated).
For example,
text: 'The ', tag 'BDS',
text 'Borland', tag 'BDS|Borland',
' Developer Studio IDE provides', tag 'BDS'.
Then, analysing tags of adjacent items, you can restore the hierarchy.