show selection of whole wxRichTextCtrl

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
Peri
Experienced Solver
Experienced Solver
Posts: 91
Joined: Wed Nov 09, 2011 10:06 pm
Location: Seattle, USA

show selection of whole wxRichTextCtrl

Post by Peri »

I would like a way to show when a wxRichTextCtrl is selected. This would be the wxRichTextCtrl that has focus, or last had focus until my code chooses to deselect it. Since the text in the control can be selected, I need a different look to show when the control as a whole is selected.

I've considered a few possiblities, but none seem obviously right so I'd like some other opinions before digging in too deep.

One possibility is to draw a border around the control. I tried setting the wxSIMPLE_BORDER flag, but that crashes in MSWGetStyle. I'd persue this, but I don't think it's the right solution anyway mainly because I don't have control over what a simple border looks like and because it would cause the control to resize resulting in a jiggly screen.

Another possibility would be to draw a line in the space around the control. Probalby not too hard, assuming there's space. Trouble could arise in making sure the lines are erased properly when controls move around within the parent window (they do in my app).

A third possibility would be to draw the line within the wxRichTextCtrl space. I haven't looked at how this control paints its space, so I'm not sure how tricky this would be. Otherwise I think it would be a good solution.

Any other ideas?

Thanks.
Post Reply