]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/samples/ide/activegrid/tool/IDE.py
Applied patch [ 1212020 ] MediaCtrl DirectShow drawing and sample
[wxWidgets.git] / wxPython / samples / ide / activegrid / tool / IDE.py
index ea5853685360e7e06938fbf96aa86b4e589b414d..7767890fcca56647db4dcf2c7080c98f855e1c81 100644 (file)
@@ -15,6 +15,9 @@ import wx.lib.docview
 import wx.lib.pydocview
 import sys
 import wx.grid
+import os.path
+import activegrid.util
+
 _ = wx.GetTranslation
 ACTIVEGRID_BASE_IDE = False
 
@@ -76,7 +79,11 @@ class IDEApplication(wx.lib.pydocview.DocApp):
         import PHPEditor
         import wx.lib.ogl as ogl
         import DebuggerService
+        import atexit
+        atexit.register(DebuggerService.DebuggerService.KillAllRunningProcesses)
         import AboutDialog
+        import SVNService
+                    
         if not ACTIVEGRID_BASE_IDE:
             import DataModelEditor
             import ProcessModelEditor
@@ -86,7 +93,7 @@ class IDEApplication(wx.lib.pydocview.DocApp):
             import WelcomeService
             import ViewEditor
             import PropertyService
-            
+                        
 
         # This creates some pens and brushes that the OGL library uses.
         # It should be called after the app object has been created, but
@@ -286,8 +293,9 @@ class IDEApplication(wx.lib.pydocview.DocApp):
             deploymentService   = self.InstallService(DeploymentService.DeploymentService())
             dataModelService    = self.InstallService(DataModelEditor.DataModelService())
             welcomeService      = self.InstallService(WelcomeService.WelcomeService())
-        optionsService          = self.InstallService(wx.lib.pydocview.DocOptionsService(allowModeChanges=False))
+        optionsService          = self.InstallService(wx.lib.pydocview.DocOptionsService(supportedModes=wx.lib.docview.DOC_MDI))
         aboutService            = self.InstallService(wx.lib.pydocview.AboutService(AboutDialog.AboutDialog))
+        svnService              = self.InstallService(SVNService.SVNService())
 
         if not ACTIVEGRID_BASE_IDE:
             projectService.AddRunHandler(processModelService)
@@ -306,6 +314,7 @@ class IDEApplication(wx.lib.pydocview.DocApp):
         optionsService.AddOptionsPanel(PHPEditor.PHPOptionsPanel)
         optionsService.AddOptionsPanel(STCTextEditor.TextOptionsPanel)
         optionsService.AddOptionsPanel(HtmlEditor.HtmlOptionsPanel)
+        optionsService.AddOptionsPanel(SVNService.SVNOptionsPanel)
 
         filePropertiesService.AddCustomEventHandler(projectService)
 
@@ -318,10 +327,13 @@ class IDEApplication(wx.lib.pydocview.DocApp):
         outlineService.StartBackgroundTimer()
         
         if not ACTIVEGRID_BASE_IDE:
+            propertyService.AddTemplateForBackgroundHandler(dataModelTemplate)
+            propertyService.AddTemplateForBackgroundHandler(processModelTemplate)
+            propertyService.AddTemplateForBackgroundHandler(viewTemplate)
+            propertyService.AddTemplateForBackgroundHandler(dataModelChildTemplate)
             propertyService.StartBackgroundTimer()
 
         self.SetDefaultIcon(getActiveGridIcon())
-        self.SetUseTabbedMDI(True)
         if not ACTIVEGRID_BASE_IDE:
             embeddedWindows = wx.lib.pydocview.EMBEDDED_WINDOW_TOPLEFT | wx.lib.pydocview.EMBEDDED_WINDOW_BOTTOMLEFT |wx.lib.pydocview.EMBEDDED_WINDOW_BOTTOM | wx.lib.pydocview.EMBEDDED_WINDOW_RIGHT
         else:
@@ -338,11 +350,21 @@ class IDEApplication(wx.lib.pydocview.DocApp):
 
         if not projectService.OpenSavedProjects() and not docManager.GetDocuments() and self.IsSDI():  # Have to open something if it's SDI and there are no projects...
             projectTemplate.CreateDocument('', wx.lib.docview.DOC_NEW).OnNewDocument()
-
+            
+        TIPS_FILE_PARTS = ("activegrid", "tool", "data", "tips.txt")
+        tips_path = activegrid.util.mainModuleDir
+        for segment in TIPS_FILE_PARTS:
+            tips_path = os.path.join(tips_path, segment)                
         if not ACTIVEGRID_BASE_IDE:
             if not welcomeService.RunWelcomeIfFirstTime():
-                wx.CallAfter(self.ShowTip, docManager.FindSuitableParent(), wx.CreateFileTipProvider("activegrid/tool/data/tips.txt", 0))
+                if os.path.exists(tips_path):
+                    wx.CallAfter(self.ShowTip, docManager.FindSuitableParent(), wx.CreateFileTipProvider(tips_path, 0))
+        else:
+            if os.path.exists(tips_path):
+                wx.CallAfter(self.ShowTip, docManager.FindSuitableParent(), wx.CreateFileTipProvider(tips_path, 0))
 
+        wx.UpdateUIEvent.SetUpdateInterval(200)  # Overhead of updating menus was too much.  Change to update every 200 milliseconds.
+        
         return True
 
 
@@ -368,7 +390,6 @@ class IDEMDIParentFrame(wx.lib.pydocview.DocMDIParentFrame):
 # Icon Bitmaps - generated by encode_bitmaps.py
 #----------------------------------------------------------------------------
 from wx import ImageFromStream, BitmapFromImage
-from wx import EmptyIcon
 import cStringIO
 
 def getSplashData():
@@ -1963,63 +1984,28 @@ def getSplashImage():
 #----------------------------------------------------------------------
 def getActiveGridData():
     return \
-'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\x00\x00 \x08\x06\x00\
-\x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\x05cID\
-ATX\x85\xed\x97\xcbo\x1b\xd7\x15\xc6\x7fw^\x1c\x92C\x8a\xa4DQ\xa2)\xd9\xb2%?\
-\xe0\xa7\x82\xc0\x85\x83"\xa8\x1b\x17AwYtQtU\xb4\x8b\xa2\x7fH\xfe\x8c\xee\
-\x8b\xac\x124\xab\x02E\n\x17h\x01\x17\x86Q7\xaac7~I\xb2hZ\xe2sH\xce\x83s\xef\
-\xedB\xa6dI~))\x90E\xf2\x01\x17\x98\xb9s\xe7\x9c\xef\x9c\xf9\xce\xb9w\x840L\
-\xbeK\x18\xdf\xa9\xf7\x1f\x08\x00\xa2\xd5ji!\x04\xe3\xf1ma\x9a\x02!\x0c\xe0\
-\xa0-\xa55O\xb6\x06t\xfb\x11\xa0\x98\xca\x99\x880\x0c5\xf0R\xe7B\x08\xb4\xde\
-\xbd6\xc4\xd8\xee\x0bk\xb5\xde3\'\x84f\x10J\x06aB4R\xd8\x96\xc1\x97\x8f{\xfc\
-\xfbq\x97-?\xa2\xe49\x9c\x9d\xf38u\xc4\xa3\x945\xb0\xc6\x8e\r!`\x1f\t!\xd8C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b*[\x96\x94r\xe7\xe6\xb0\n\
-\xd6Z\xa3\x94b\xae\x94"\x97\x12<\xde2\x08\xa2\x98 2\xb0\r\xe7\xb5}AJ\xb9]5\
-\xf5z]\x03\xbb\x02\xfa\x06\x10\x80m\x1b\x18\xa6\xc9\xda3\x1f\xd71\xc9\xb9\
-\xf6k\xdf\x91R\x12E\x11\xe2\x87\x7f\xc3\xef=\x81\xff\x01\x1d\xae\x83\xc3q\
-\xb9\xc6\x9f\x00\x00\x00\x00IEND\xaeB`\x82'
+'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\
+\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\
+\x00\x01\xe9IDAT8\x8d\xc5\x93\xbfkSq\x14\xc5?\xf7\xfb}\xf1\xe5%1\xadVm1\xa5Z\
+\x7f\x81%\xa8\x88\xc5\x0e\xba\x89?\xb6n\x82[\x07\'E\x07\xb1\xff\x808(\xe8\
+\xea`\x11ADpPp\x10\xa5(\x08..b\xb0C\xd5\x8a6\xadF\xb4\xe5\xd54\xef%/y\xef}\
+\x1dl,-\xa9\x0e\x1d<\xeb\xbd\xe7\xdc\xc3\xbd\xe7\x8a(\xcdj\xa0V\xc5\x06\xc4\
+\xf7}\xa3\xf5\xbf]X\x96"6B\x14C\xd0\x88\x98\xf8:GWVai\xad\x11\x11\x94j\x9a1\
+\x08B%hPr\x03\x9c\x84\xe2\xc1\xab\x12\x9f\xbey\xf4v\xa5\xf8X\xaa\x90\xb65CGz\
+\xc9$\x05KD(\xfe\xf0\x19\x9b\x9eg|\xb2\xcc\xf1\x03\x9d\x9c\xb9Q\xa0\xf0\xa5B\
+\xe8\x06\\?\xbf\x8f\xab\x0f?\x90\xeb\xb0\xc9o\xc9p\xfa\xe86\xf2=Y\xe2\xd8\
+\xe0y\x1e\x96\xd6\x8a\x9b\xcf\x8a\\\xb9;\x0e\xc0\xcb\t\x97\x83;\xdaI\xa7,f\
+\xe6\xeb\x94\xfd\x90\xdd\xb9\x14\xd7\x86\xf6\x90\xefi\x03 \x8ebXpm\x85a\xc4\
+\xf0\xe0N\xdeM\x97\xd9\xd8f\xd3hD\xec\xda\x9ae\xe4\xe9g6mHQk\x84\xdc:\xd7O\
+\xf7\xfa$\xc647\'\x008\x8e\x83\x12\x112\xb6\xe2\xfe\xc5\x01\x1c[s\xfbq\x91{\
+\xcf\x8b\x8c\\\xd8O\xbd\xd6\xe0\xd8\xdeN6\xb7\'\x89cC+H\xbd^7"\x821\x06\xad5\
+w^L26\xf5\x93\xd7\xef\xe7\x88-x4<@\xca\xb6\x16\xa7/\xc3\x9f\x1c\x88\x08Q\x14\
+q\xeaP7gOl\xa7Z\r\xe9\xcb\xa5y[,\xafH^"\xd0\x14\x11\x11r\xeb\x1cF/\x1fF)\x8b\
+\xd1\xc2\xf7\xdf\xc7m\xa1\x12E\xd1\xcaI\\\xa3\x15\x97N\xf615[er\xb6\xda\xb2\
+\xa7V\xab!A\x10\x98\xc5\x10-\x87\xc1\xf5B\x9e\xbc)1\xd8\x9f#\x99P\xc8\xc2\
+\x05\x00|\xdfG\\\xd7\xfd\x8b\x00\x08\x90\xb0-J3\x1e\x1dk\xed%5\xdf\xf7\x91\
+\xff\xfe\x8d\xbf\x00\xff\xd5\xb5\xd8\x1d!\x93\x80\x00\x00\x00\x00IEND\xaeB`\
+\x82' 
 
 def getActiveGridBitmap():
     return BitmapFromImage(getActiveGridImage())
@@ -2029,9 +2015,7 @@ def getActiveGridImage():
     return ImageFromStream(stream)
 
 def getActiveGridIcon():
-    icon = EmptyIcon()
-    icon.CopyFromBitmap(getActiveGridBitmap())
-    return icon
+    return wx.IconFromBitmap(getActiveGridBitmap())
     
 #----------------------------------------------------------------------
 def getDPLData():
@@ -2051,6 +2035,4 @@ def getDPLImage():
     return ImageFromStream(stream)
 
 def getDPLIcon():
-    icon = EmptyIcon()
-    icon.CopyFromBitmap(getDPLBitmap())
-    return icon
+    return wx.IconFromBitmap(getDPLBitmap())