Dear Community,
I swore to come back with a stupid question....
... And I'm back.
Little Problem with Draw Events.
What is to do to have a Drawing on a Panel permanent.
What I have is, a Algorithm with PaintDC to paint simple my Picture.
But what I want is:
It so that even I rescale the main Window or I drawn a MessageBox above this,
it should not been removed.
So the simplest Solution is needed.
In thanks of coming Help.
Mungo1981
Little Help with PaintDC needed
Re: Little Help with PaintDC needed
You need to catch and handle the wxEVT_PAINT event of the window.
https://wiki.wxwidgets.org/Drawing_on_a_panel_with_a_DC
(Ignore the Render() and PaintNow() methods, put everything in the paint event handler BasicDrawPane::paintEvent())
https://wiki.wxwidgets.org/Drawing_on_a_panel_with_a_DC
(Ignore the Render() and PaintNow() methods, put everything in the paint event handler BasicDrawPane::paintEvent())
Use the source, Luke!
Re: Little Help with PaintDC needed
Thanks,
I will try it tomorrow,
Just it is 22:52 in Germany, So I have to sleep a little bit.
I will try it tomorrow,
Just it is 22:52 in Germany, So I have to sleep a little bit.
Re: Little Help with PaintDC needed
Ok, I try to do it now.
But a set of stupid Questions:
1.) must I build a new Class for every as Custom-Widget used Panel.
1a.) Or can I realise the Function to paint this Panel in a superset Panel which holds this Panel as Member in his Class.
Ok. Ok, News:
I Get the Error that above should not run.
So it's the only Solution to make a special Class to the Panels on which I will draw
or there easier Solutions.
But a set of stupid Questions:
1.) must I build a new Class for every as Custom-Widget used Panel.
1a.) Or can I realise the Function to paint this Panel in a superset Panel which holds this Panel as Member in his Class.
Ok. Ok, News:
I Get the Error that above should not run.
So it's the only Solution to make a special Class to the Panels on which I will draw
or there easier Solutions.
Re: Little Help with PaintDC needed
It's possible with Bind() to connect the event of one object to an event handler in a different class. It's just a little tricky, because you need to the the "EventHandler *handler" parameter correctly. But the compiler will throw an error if you did it wrong
However, i would do this only for a quick-and-dirty test. In order to keep your code clean, i would suggest to subclass wxWindow/wxPanel.
Use the source, Luke!
Re: Little Help with PaintDC needed
Thank you,
then I would take the way you suggest
A happy,
Mungo1981
then I would take the way you suggest
A happy,
Mungo1981