This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
But still it does not work and it does not add new lines. Moreover I can not see what I am selecting. I mean it is not highlighted when I select something, hence I am not able to see if I selected anything at all, even though it DOES select.
Is there some event I can catch in the event table so that I can highlight the selected text? Thanks for any help answering these two questions!
I am sorry for double posting but I still have not figured out how to "catch" the ENTER key being pressed in a RichTextCtrl. So I am not able to add new lines to my text. Is there really no way to do it? I mean ... it can't be. Any help?
Documentation suggests that I have to add the wxTE_PROCCESS_ENTER flag to the constructor and then just do it as if it is a wxTextCtrl but that does not work.
Yeah ofcourse I am sure. Also I tried catching the return event too, and the result is the same. Nothing. Quoting the documentation:
wxRichTextCtrl sends notification events: see wxRichTextEvent. It also sends the standard wxTextCtrl events wxEVT_COMMAND_TEXT_ENTER and wxEVT_COMMAND_TEXT_UPDATED, and wxTextUrlEvent when URL content is clicked.
You need to use wxWANTS_CHARS flag for your wxRichTextCtrl - you'll find it's description among wxWindow's styles.
Lefteris wrote:Yeah ofcourse I am sure. Also I tried catching the return event too, and the result is the same. Nothing. Quoting the documentation:
wxRichTextCtrl sends notification events: see wxRichTextEvent. It also sends the standard wxTextCtrl events wxEVT_COMMAND_TEXT_ENTER and wxEVT_COMMAND_TEXT_UPDATED, and wxTextUrlEvent when URL content is clicked.
Thank you , sabir. I owe you a debt of gratitude. I could not find the solution to this and just skipped it and proceeded with the rest of the development of the program.
Your solution works! I now understand that wxRichTextCtrl does not generate events for enter key presses or tab key presses UNLESS you include the wxWANT_CHARS flags into the contructor.