Hi everybody,
I have a couple of questions about
wxOGL.
I have used wxOGL for long time starting
with Python 2.0 bis 2.1. Some things that I need were not in wxOGL (e.g.
Zooming, select and move a group of shapes with mouse etc…) and I have implemented them
self.
I have tried to play with the Python
2.2.2 and wxPython 2.3.3.1 My applications crashes
with GPF or raises exceptions. ( but with Python 2.1
and wxPython 2.3.2.1 all work)
Short description and questions
- Crashes
with “unknown software exception” by zoom
changes.
Looks like that there is problem
somewhere by setting user scale on dc (wxWindow problem ?)
dc =wxClientDC(self)
self.PrepareDC(dc)
dc.SetUserScale(self.scale_x, self.scale_y)
wxDiagram.Redraw(self, dc)
BTW (with Python 2.1 and wxPython
2.3.2.1 it works)
- Assert:
c:\projects\wx\src\common\wincmn.cpp(1995): assert
GetCapture() ==this failed:attempt to release
mouse, but this = window hasnot capture it
EndDrag for multiple shapes
def
OnEndDragLeft(self, x, y, keys, attachment=0):
ts =Trace0('ShapeMouseEventHandler::OnEndDragLeft()')
shape =self.GetShape()
canvas =shape.GetCanvas()
for sel_shape in canvas.GetUserShapes():
if sel_shape.Selected() ==true:
if sel_shape != shape:
evhandler = sel_shape.GetEventHandler()
new_x =sel_shape.GetX() + x - shape.GetX()
new_y =sel_shape.GetY() + y - shape.GetY()
new_x, new_y=canvas.Snap(new_x, new_y)
evhandler.base_OnEndDragLeft(new_x, new_y,
keys, attachment)
self.base_OnEndDragLeft(x, y, keys, attachment)
I know that by OnEndDragLeft the mouse
is released. The question is :How can I implement
draging of multiple shapes other way? BTW
(with Python 2.1 and wxPython 2.3.2.1 it works)
- Composite
Shapes:
Can I ‘select’ whole composite shape , not the childs? (see
example in answer to CompositeShape-question)
Regards,
Pavel