- replace all the wx.ClientDC with wx.MemoryDC and a buffer
- in ShapeCanvas.OnSize the buffer is created based on window size
- a ShapeCanvas.Draw was added which updates the buffer with the current diagram
- in ShapeCanvas.OnPaint a BufferedPaintDC is used to draw the buffer to the screen
Problems I could not solve yet:
- outline when moving doesn't show or I get tons of them if change Shape.OnDrawOutline to draw to ClientDC (I know I shouldn't but ..)
- when moving an object it only moves after another click
Anyone has some hints on where I should look for the above two problems?
Will tomorrow clean up the code changes and do a PR for all this, even if I have not resolved the two problems.
- replace all the wx.ClientDC with wx.MemoryDC and a buffer
- in ShapeCanvas.OnSize the buffer is created based on window size
- a ShapeCanvas.Draw was added which updates the buffer with the current diagram
- in ShapeCanvas.OnPaint a BufferedPaintDC is used to draw the buffer to the screen
Problems I could not solve yet:
- outline when moving doesn't show or I get tons of them if change Shape.OnDrawOutline to draw to ClientDC (I know I shouldn't but ..)
- when moving an object it only moves after another click
I think wx.OverlayDC was the wx.ClientDC replacement for these cases where you truly do want to draw "above" the UI. Not sure if it was ever fully working cross-platform though.
Thanks,
Kevin
···
On Jun 12, 2014, at 9:33 AM, Werner <wernerfbd@gmx.ch> wrote:
Anyone has some hints on where I should look for the above two problems?
Will tomorrow clean up the code changes and do a PR for all this, even if I have not resolved the two problems.
Werner
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> Problems I could not solve yet:
> - outline when moving doesn't show or I get tons of them if change
Shape.OnDrawOutline to draw to ClientDC (I know I shouldn't but ..)
> - when moving an object it only moves after another click
indeed -- in FloatCanvas, and other experiments, I couldn't get the
recommended "draw everything in a paintDC" method to work for really
responsive updating as the mouse moved.
So I still use a ClientDC for that -- though there is a bug on Mac now....
I think wx.OverlayDC was the wx.ClientDC replacement for these cases
where you truly do want to draw "above" the UI. Not sure if it was ever
fully working cross-platform though.
Yup -- I"ve been intending to use that in FC for years.
It doe swork cross-platform, though it works a bit differently on each
platform, and it's uglier than (I think) it should be. You can't just
create one, and draw to it an be done...
But it can work.
There are two Overlay tests/demos here:
Overlaytest.py
Overlaytest2.py
They are a couple years old, and I'm not entirely sure I ever got them
workign really properly, but its a starting place.
-Chris
···
On Thu, Jun 12, 2014 at 10:00 AM, Kevin Ollivier < kevin-lists@theolliviers.com> wrote:
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
On Thu, Jun 12, 2014 at 10:00 AM, Kevin Ollivier > <kevin-lists@theolliviers.com <mailto:kevin-lists@theolliviers.com>> > wrote:
> Problems I could not solve yet:
> - outline when moving doesn't show or I get tons of them if
change Shape.OnDrawOutline to draw to ClientDC (I know I shouldn't
but ..)
> - when moving an object it only moves after another click
indeed -- in FloatCanvas, and other experiments, I couldn't get the recommended "draw everything in a paintDC" method to work for really responsive updating as the mouse moved.
So I still use a ClientDC for that -- though there is a bug on Mac now....
I think wx.OverlayDC was the wx.ClientDC replacement for these
cases where you truly do want to draw "above" the UI. Not sure if
it was ever fully working cross-platform though.
Yup -- I"ve been intending to use that in FC for years.
It doe swork cross-platform, though it works a bit differently on each platform, and it's uglier than (I think) it should be. You can't just create one, and draw to it an be done...
They are a couple years old, and I'm not entirely sure I ever got them workign really properly, but its a starting place.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov <mailto:Chris.Barker@noaa.gov>
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com <mailto:wxPython-dev+unsubscribe@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
I did a PR for my current version, not fully working. After moving more then one object the previously moved objects move to their original position and it needs another mouse click to get the positions all correct again.
- don't clear the DCOverlay as this resets it to its last initialized state which was the cause of the moved shapes showing up in the old position.
Have to take back that the code would work in Classic, things like EmptyBitmap are now just Bitmap in Phoenix.
But using Phoenix to test shouldn't be too difficult, to install just run pip from your Python version (2.7, 3.3 or 3.4), previous to 3.4 you have to install pip yourself:
- move an object, all works fine, click the moved object again to get rid of the handles
- move another object, all works fine, but do not click it again, it still shows the handles
- move a third object, the outline shows, but when one releases the mouse the object shows in the old position, have to click any object again to have it move.
In the old version the handles of the previously selected object cleared when one selected another object, but I just can't figure out why this is not the case now.
I had added a self.Draw in the canvas.OnMouseEvent at the wrong indentation level.
So, on Windows at least I see the same behaviour as in the old version, hopefully it fixes also the issue on outline not showing on mac.
But it will be good if someone who uses it currently does more testing with this.
In the mean time I will work on updating the documentation to the Sphinx format and try to improve it a bit.
Werner
···
On 6/13/2014 11:21, Werner wrote:
Hi,
I am stumped on the following.
- move an object, all works fine, click the moved object again to get rid of the handles
- move another object, all works fine, but do not click it again, it still shows the handles
- move a third object, the outline shows, but when one releases the mouse the object shows in the old position, have to click any object again to have it move.
In the old version the handles of the previously selected object cleared when one selected another object, but I just can't figure out why this is not the case now.