wxRichTextCtrl does not support horizontal scrolling without line wrapping?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
bsenftner
Experienced Solver
Experienced Solver
Posts: 85
Joined: Thu May 26, 2016 9:19 pm

wxRichTextCtrl does not support horizontal scrolling without line wrapping?

Post by bsenftner »

I am working with a wxRichTextCtrl, trying to create a Rich Text, read only visual log that does not wrap lines. I am creating it like this:

Code: Select all

	mp_logCtrl = new wxRichTextCtrl(this,
			 	wxID_ANY,
				wxEmptyString,
			 	wxDefaultPosition, 
				wxDLG_UNIT(this, wxSize(width / 2, height*0.75f)), 
		    wxTE_READONLY | wxTE_RICH2 | wxTE_MULTILINE | wxFULL_REPAINT_ON_RESIZE | wxALWAYS_SHOW_SB | wxVSCROLL | wxHSCROLL );
Researching how to make this work, I am seeing forum posts covering years of people pointing out that wxRichTextCtrl does respect the presence of horizontal scroll bars and always wraps the lines.

I am trying to use a wxRichTextCtrl for a "visual log" from a video analysis process, so I have on-the-fly tables and graphics being written to this wxRichTextCtrl, along with use of multiple fonts, font sizes and styles. The "solved" forum posts seem to recommend using wxTextCtrl or simply point out that not wrapping of lines is not supported.

Is this really still the case? I have been trying to fiture this out for over a day now...
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxRichTextCtrl does not support horizontal scrolling without line wrapping?

Post by doublemax »

I don't think wxRTC has seen much (if any) development over the last few years. I believe i have 3 or 4 open tickets regarding it. Unfortunately it's one of the most complex controls in wxWidgets and hard to make any non-trivial changes to it yourself.

Assuming that there is no way to prevent word wrapping, i would try to make the control very wide and then put it into another wxScrolledWindow. Handling the vertical scrolling could be tricky though.

And i'm also not sure what impact this has on performance, especially if you use it for logging. As soon as you have multiple pages of text, i suspect the text formatting to become noticeably slow.
Use the source, Luke!
Post Reply