NSTextView with custom space width - cocoa

I need to implement custom space separator with custom width between two part of paragraph in text view:
AAAA AA A -------- BBB BBBBB B
This is separator must be included as non-editable character. So user can't delete it or modify.
I understand, that i must overload standard behavior of textview in some points (for example, when user press "delete" right after separator nothing will be deleted)
I have several ideas how accomplish this task:
Use elastic glyph attribute (there are mentions in documentation about it). But I can't find any documentation about how to use it.
Use tab symbol and NSTextTab for each paragraph, and in any modification to the paragraph recalculate position of tab.
I will be very grateful for any right direction.

I had a similar problem and wound up inserting blank images of the desired width into the textview. The code for implementing this is here:
Changing the width of the space character in NSTextView

Related

How do you make a bullet point with a double bullet character in InDesign?

I have a bulleted list in InDesign but I want the bullet character to be shown twice.
I'm using the / character, so I want it to appear like // like a comment. I can't figure it out. I have the bullet a different colour/style as the text following it, so I don't want to "hard-code" it in either.
Sorry for the trolls fellow. Your question isn't a programming question, which is why you got a downvote.
However, to help you out, try using a font for your bullet point that has a glyph that you like - you can use any character for the bullets, you know.
Or, if you create a new paragraph style, you can go into the Paragraph Style Options under Bullets and Numbering. Now, where it says Text After you can enter another bullet character there. But you'll have to also create a character style to set it to the right font to show your bullet character.

MigraDoc PDFSharp Table overflow text

I am creating a big table with MigraDoc.
I have two issues I don't know how to solve exactly:
If the content (Paragraph) of a cell is too long it breaks and I got 2 lines in my cell. I don't want this behavior. I want that the text which does not fit in the first line of the cell is hidden.
If a word is too long I want also that the characters which are outside of the cell are hidden. Now they are displayed in the next cell :/ and are overlapping with the content of the next cell...
Do you know how to fix this issues?
This behavior is by design.
Use MeasureString to measure your text before you add it and truncate at the correct place (maybe adding "..." if you want).
See also:
http://forum.pdfsharp.net/viewtopic.php?p=6158#p6158

Disable wrapping for some lines but not others

I have a NSTextView subclass. It displays normal text (which should wrap, ideally around the 80-char line) and ascii style tables (which should not be wrapped).
Mockup:
As you see the text on top is wrapped, while the table extends.
I have code that figures out if a line is a table, but I need some ideas on how to go with the selective (non)wrapping.
Use multiple text containers with your layout manager.
"This one is the width of the text view (it wraps); the next one is as wide as it needs to be (doesn't wrap); etc."

NSTextView paragraph style of newline

I've been playing around with NSTextView and have applied some paragraph styles to certain lines. However, when I type enter and get a new line, the attributes that I applied to one line are bleeding into the next.
I want to be able to apply a paragraph style to one line and have the next line be formatted in the default way. You can see what I mean from the screenshots.
When I add some spacing between paragraphs via NSParagraphStyle, the same spacing applies to the newline, which makes the whole thing look pretty shotty. Basically, I am looking for a way to reset the paragraph style for an empty line.
I have tried [MyTextView resetTypingAttributes:theAttributes] to no avail, since you first have to start typing for the new attributes to apply. Just to be clear, the line below the text in the screenshot is the cursor, which is really far down there as a result of the paragraph spacing.
Screenshot:
It seems that you have to use setTypingAttributes on the textview.

nstableview + cannot show partial file names

I am using Table View Control. In the control, I show File/Folders details, if I reduce the size of file/folder name column, it does not show partial file/folder name (whatever characters can be shown in the Column).
If a file name has multiple words in it, if enough space is not there to show a word then that word does not get shown at all, instead of showing some characters in that word (Either a word gets shown completely, or not at all)
I want to know how to resolve this issue.
Thanks so much.
Set the line break mode of the column's text cell, using either the Attributes inspector in IB or a setLineBreakMode: message to the cell.

Resources