X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bbf7159c8211a398e573122c66b93722f5125c60..77380b5cbae9f748f53a05a2733c8f624e2ad40c:/wxPython/samples/ide/activegrid/tool/IDE.py diff --git a/wxPython/samples/ide/activegrid/tool/IDE.py b/wxPython/samples/ide/activegrid/tool/IDE.py index 947a2da16a..4a9a5a45c8 100644 --- a/wxPython/samples/ide/activegrid/tool/IDE.py +++ b/wxPython/samples/ide/activegrid/tool/IDE.py @@ -16,6 +16,8 @@ import wx.lib.pydocview import sys import wx.grid import os.path +import activegrid.util + _ = wx.GetTranslation ACTIVEGRID_BASE_IDE = False @@ -78,6 +80,9 @@ class IDEApplication(wx.lib.pydocview.DocApp): import wx.lib.ogl as ogl import DebuggerService import AboutDialog + import SVNService + import ExtensionService + if not ACTIVEGRID_BASE_IDE: import DataModelEditor import ProcessModelEditor @@ -87,7 +92,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 @@ -103,6 +108,19 @@ class IDEApplication(wx.lib.pydocview.DocApp): docManager = wx.lib.docview.DocManager(flags = self.GetDefaultDocManagerFlags()) self.SetDocumentManager(docManager) + defaultTemplate = wx.lib.docview.DocTemplate(docManager, + _("Any"), + "*.*", + _("Any"), + _(".txt"), + _("Text Document"), + _("Text View"), + STCTextEditor.TextDocument, + STCTextEditor.TextView, + wx.lib.docview.TEMPLATE_INVISIBLE, + icon = STCTextEditor.getTextIcon()) + docManager.AssociateTemplate(defaultTemplate) + if not ACTIVEGRID_BASE_IDE: dplTemplate = DeploymentService.DeploymentTemplate(docManager, _("Deployment"), @@ -287,8 +305,10 @@ 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)) + extensionService = self.InstallService(ExtensionService.ExtensionService()) + 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) @@ -307,6 +327,8 @@ class IDEApplication(wx.lib.pydocview.DocApp): optionsService.AddOptionsPanel(PHPEditor.PHPOptionsPanel) optionsService.AddOptionsPanel(STCTextEditor.TextOptionsPanel) optionsService.AddOptionsPanel(HtmlEditor.HtmlOptionsPanel) + optionsService.AddOptionsPanel(SVNService.SVNOptionsPanel) + optionsService.AddOptionsPanel(ExtensionService.ExtensionOptionsPanel) filePropertiesService.AddCustomEventHandler(projectService) @@ -326,7 +348,6 @@ class IDEApplication(wx.lib.pydocview.DocApp): 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: @@ -343,12 +364,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(): - if os.path.exists("activegrid/tool/data/tips.txt"): - 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(400) # Overhead of updating menus was too much. Change to update every 400 milliseconds. + return True