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:
Robin Dunn
2005-05-19 00:21:49 +00:00
parent 4809f5df5d
commit 6f1a3f9c1a
19 changed files with 1791 additions and 1064 deletions

View File

@@ -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)