More updates to the docview library modules and sample apps from the
ActiveGrid folks. Their sample IDE is now able to integrate with Subversion. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34158 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -66,13 +66,18 @@ class CanvasView(wx.lib.docview.View):
|
||||
if activate and self._canvas:
|
||||
# In MDI mode just calling set focus doesn't work and in SDI mode using CallAfter causes an endless loop
|
||||
if self.GetDocumentManager().GetFlags() & wx.lib.docview.DOC_SDI:
|
||||
self._canvas.SetFocus()
|
||||
self.SetFocus()
|
||||
else:
|
||||
wx.CallAfter(self._canvas.SetFocus)
|
||||
wx.CallAfter(self.SetFocus)
|
||||
|
||||
|
||||
def SetFocus(self):
|
||||
if self._canvas:
|
||||
self._canvas.SetFocus()
|
||||
|
||||
|
||||
def OnFocus(self, event):
|
||||
self._canvas.SetFocus()
|
||||
self.SetFocus()
|
||||
self.FocusColorPropertyShape(True)
|
||||
event.Skip()
|
||||
|
||||
@@ -82,6 +87,17 @@ class CanvasView(wx.lib.docview.View):
|
||||
event.Skip()
|
||||
|
||||
|
||||
def HasFocus(self):
|
||||
winWithFocus = wx.Window.FindFocus()
|
||||
if not winWithFocus:
|
||||
return False
|
||||
while winWithFocus:
|
||||
if winWithFocus == self._canvas:
|
||||
return True
|
||||
winWithFocus = winWithFocus.GetParent()
|
||||
return False
|
||||
|
||||
|
||||
def OnClose(self, deleteWindow = True):
|
||||
statusC = wx.GetApp().CloseChildDocuments(self.GetDocument())
|
||||
statusP = wx.lib.docview.View.OnClose(self, deleteWindow = deleteWindow)
|
||||
@@ -528,7 +544,10 @@ class CanvasView(wx.lib.docview.View):
|
||||
|
||||
# draw new selection
|
||||
if self._propShape and self._propShape in self._diagram.GetShapeList():
|
||||
self._propShape.SetBrush(SELECT_BRUSH)
|
||||
if self.HasFocus():
|
||||
self._propShape.SetBrush(SELECT_BRUSH)
|
||||
else:
|
||||
self._propShape.SetBrush(INACTIVE_SELECT_BRUSH)
|
||||
if (self._propShape._textColourName in ["BLACK", "WHITE"]): # Would use GetTextColour() but it is broken
|
||||
self._propShape.SetTextColour("WHITE", 0)
|
||||
self._propShape.Draw(dc)
|
||||
|
Reference in New Issue
Block a user