Using formfeed as ContentDivider

SyntaxEditor for Windows Forms Forum

Posted 20 years ago by MagnumOpus - Birmingham, AL
Avatar
I am attempting to implement the SyntaxEditor in an application that displays pre-formatted files. These files begin with a formfeed character(0x0C) at position 0 and at regular intervals throughout the file. The formfeed characters will always appear after a newline character and will be followed by some header information terminated with another newline character.

I created my own language definition file in which I defined a RegexPatternGroup named "FormFeedContentDivider" with a PatternValue of "\f" and the "IsContentDivider" flag set to "true". I loaded the language definition using LoadLanguageFromXML and then set the "ContentDividersVisible" property to true and opened the file.

The ContentDivider is visible, but it appears below the header information and the position of the formfeed character is a whitespace. I need the content divider line to appear at the spot of the form feed character and to replace it so that the first character of the header is in column 1 of the document.

Is this possible with the current control?

Thanks,
Mark Calvert

Comments (9)

Posted 20 years ago by MagnumOpus - Birmingham, AL
Avatar
Addendum:

Another option would be preventing the formfeed character from displaying at all.

Thanks,
Mark Calvert
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Could you email your language definition to us so that we can load it in our sample application and see what you're describing? Thanks!


Actipro Software Support

Posted 20 years ago by MagnumOpus - Birmingham, AL
Avatar
YGM.

Thanks,
Mark Calvert
Posted 20 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Was there a solution to this? If so, could you post the solution so others can learn from it? Thanks!
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Can you describe what the formfeed character is used for? Like is it just intended to be invisible whitespace?

And if so, are you basically asking that the formfeed character take up no width?


Actipro Software Support

Posted 20 years ago by MagnumOpus - Birmingham, AL
Avatar
The formfeed character is inserted by a prior process when the original data is formatted. It is used as the page separator and is only included in the displayed text in the case of a user printing a subset of the report from the text editor.

It isn't a part of the data in the report and we would like to have it not presented as a character since it isn't really a part of the original data.

Thanks,
Mark Calvert
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Could you just remove it from the text before adding the text to the editor?

I could set the width of that character to 0 however I'm scared that there would be all kinds of odd selection side effects if I did that.


Actipro Software Support

Posted 20 years ago by MagnumOpus - Birmingham, AL
Avatar
We're actually mulling another solution.

We've been using a \n\f as a page break, which has been causing problems since the formfeed character is at the beginning of a line and shifts every character on that line one position to the right.

I believe that we'll just reverse the order of the characters so that our formfeed is the last character on a page. Then we'll define it as whitespace so that it is invisible.

If the user decides to print a selection, we'll just replace all "\f\n" with "\n\f" prior to sending it to the printer. There should never be an instance of a formfeed character that isn't suffixed by a newline.

I'm still baffled, however, by the fact that the content divider shows up after a following newline character instead of at the position of the formfeed character.

Thanks,
Mark Calvert
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Back on the original question, could you post the document text I'd need to duplicate the problem with your language def? For instance:

1
2
\f
3
4


Actipro Software Support

The latest build of this product (v24.1.1) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.