Reputation: 7470
How can I draw over child of wxPanel? I'm using the classical way of drawing stuff,
class Foo : public wxPanel {
...
void on_paint(wxEventPaint &) {
wxPaintDC dc(this);
... // stuff with dc
}
...
}
But the effect is that my stuff is painted and THAN the child is drawn over it. How can I do the reverse? Paint over the child?
I'm trying to achieve similar result:
So I have wxPanel with EVT_PAINT handler and wxStaticText as it's child. What I'm getting is
How can I paint after the child is drawn?
Or should I scrap the whole wxStaticText idea and just use DrawText? Are there any disadvantages to that approach? I'm using monospace font if it's relevant.
Upvotes: 0
Views: 275
Reputation: 22678
Painting over native controls (or otherwise interfering with their drawing) is not supported by wxWidgets and never will be. You should draw the text yourself or use a (possibly modified version of) wxGenericStaticText
which is implemented entirely in wxWidgets and so can be customized, unlike the native controls.
Upvotes: 1