Putting caret position at end of the text in Tiny MCE Editor on keyPress event - tinymce-4

I have a requirement on entering space after a text is entered spell check service is called and the caret/cursor is positioned at start of the text. I want caret to be positioned at the end of the text and not start of the text in Tiny MCE Editor. Tried some suggestions but of no help.

Related

QML TextArea colored text with selection

i am trying to accomplish the following behavior with a QML TextArea:
I want single Words in the Text to be colored differently
I want the "select"-functions to be working for automated scrolling (user interaction is disabled)
There is a stream of text in the TextArea where one Word needs to be selected(highlighted). The user is requested to input some text elsewhere and press enter to proceed (not part of the question). After that the selection jumps to the next word and the last selected word is either colored green or red. There is only a small portion of the text visible (a few lines, managed by the TextArea height – not part of the question) and i need the text to scroll if the next word is out of that visible range .. therefore the selection is quite helpful because all interaction from the user – to scroll or select or whatever – is disabled (disabling is not part of the question)
my main problem is: if i use textFormat: TextEdit.RichText i can easily color the text how i like it to be (<font color=\"green\">{}</font>) but i cannot use the "select"-functions anymore because – as i would guess – the selection works on the "plaintext" and cannot correspond to the "richtext"-selection? Anyway selectWord() etc. does not work QTextCursor::setPosition: Position '-1' out of range is the result. But if i disable the RichText i don't know how to color the text. Maybe i could live without the selection if i could detect the current word – which would be colored blue etc. – and scroll if its out of the visible area to "fake" the selection behavior, but that's just a third option.
I would really either know how to color non-Rich Text or how to select Rich Text in a TextArea.
You can use QSyntaxHighlighter to highlight the words independent of the selection. See QQuickTextDocument and How to implement rich text logic on QML TextEdit with QSyntaxHighlighter class in Qt for more details.

In Qt - How to see start of text in a narrow combo box?

I have a QComboBox which I have populated with addItem() repeatedly, and then selected an item with setCurrentIndex(). The trouble is that some of the text is wider than the width of the box and it shows the text moved to the left so the right-hand-side is visible. I want the text in the edit box to be positioned the same as the text in the drop-down box (so the start of text is visible on the left-hand-side, and any oversized text unseen on the right).
Some suggested reasoning: I think it may be trying to ensure the cursor is visible, after leaving the cursor at the end. But I have tried using setCursorPosition(1) but there is no such function in QComboBox.

The page scrolls up instead of the caret moving down

I use wysihtml5 editor. I can type a text normally only till it fits the textarea window. After that a scroll bar appears (which is fine) but let's say I want to type new line on the very top of the text area and when I press enter the line which was just typed moves up outside of the top border of text area and cursos stays on the same first line. So in order to see the first line in the document I just typed I need to scroll one line up. All that instead of the text line stays in place and cursor moves one line down.
That is not usual text editing beheavor. Why is that? Is that an CSS issue?
I guess this has to be an attribute of the text area itself.. but I have no idea how.. I'm myself a beginner in this..
try to search for extra attribute of text-area like:
<textarea rows="2" cols="20" wrap="hard">
....
</textarea>
good luck..

text display starting from bottom up qt

How would I display text in something like QTextEdit starting from bottom up? QTextEdit starts writing at the top filling down to bottom. I want to start from the bottom and then pushing the previous text up as more text is added. I figure I could hack it and simply fill the field with nextlines to reach the bottom then reprinting whatever was written before again when text is to be added, but I wouldn't want to do that unless there isn't any other way.
insertPlainText inserts text at the current text position. You could move the cursor to the start of the docuement using the moveCursor function.
Every time you want to add some text do the following:
textEdit->moveCursor(QTextCursor::Start);
textEdit->insertPlainText(textToBeAdded);

move image in text area in flex

alt text http://img31.imageshack.us/img31/1183/tedit.jpg
Hi Guys,
I am trying to make a text editor in Flex.
i can move image on mouse click.
Problem is it moves with the key up or down handler. But it moves out of text area after the last line in textarea. And it also doesn't move with scroll.
Pls give suggestions for these problems.
Thanks.
Regards,
Shivang
You may want to increase the white space of your 'text editor'. Just have numbers up till person entered text. That way when you move to the bottom you are not moving outside of the textArea.
would need more example of what is going wrong with the key up or down handler. What events are you trying to capture? How are you dragging the image?
good luck.

Resources