def OnInit(self): """Called after instantiation Calls the Splash screen and returns true """ ConfigData.__init__(self) #self.doSplash() self.doMainFrame() return True
def __init__(self, parent, safetyMode="viewAccess", *args, **kwargs): wx.Frame.__init__(self, parent, *args, **kwargs) self.safetyMode = safetyMode ConfigData.__init__(self, *args, **kwargs) StatusBar.__init__(self, parent, *args, **kwargs) MenuBar.__init__(self, parent, *args, **kwargs) ToolBar.__init__(self, parent, *args, **kwargs) TreeContextMenu.__init__(self, parent, *args, **kwargs) # Some actions which are not relevant for any specific area Actions.__init__(self, *args, **kwargs) # The functions to enable printing Printing.__init__(self, parent, *args, **kwargs) # The functions to enable the help system Help.__init__(self, *args, **kwargs) # The functions to enable the about dialog About.__init__(self, *args, **kwargs) # The functions to enable the about dialog Settings.__init__(self, *args, **kwargs) #Set main splitter MainSplitter.__init__(self, *args, **kwargs) #Add the xml tree Document.__init__(self, *args, **kwargs) #Fill xml tree GetData.__init__(self, *args, **kwargs) #Add functions to modify the view of the xml tree ViewData.__init__(self, *args, **kwargs) #Add functions to edit the xml tree EditData.__init__(self, *args, **kwargs) #Copy example files: Comment this out if Template-Designer is in productive use. #self.getExamples() #Some kind of self check self.saveConfig() #Set panels #self.propertiesPanel = wx.Panel(self.mainSplitter) self.propertiesPanel = wx.ScrolledWindow(self.mainSplitter) self.templatePanel = wx.Panel(self.mainSplitter) #Buttons on main frame self.applyButton = wx.Button(self.propertiesPanel, wx.ID_APPLY, _(u"Apply changes"), name="applyButton") self.defaultsButton = wx.Button(self.propertiesPanel, wx.ID_RESET, _(u"Restore settings"), name="defaultsButtons") expandAllButtonPath = self.documentTreeGraphics() + "/2downarrow.png" expandAllButtonBmp = wx.Image(expandAllButtonPath, wx.BITMAP_TYPE_PNG).ConvertToBitmap() self.expandAllButton = wx.BitmapButton(self.templatePanel, -1, expandAllButtonBmp, name="expandButton") collapseAllButtonPath = self.documentTreeGraphics() + "/2uparrow.png" collapseAllButtonBmp = wx.Image(collapseAllButtonPath, wx.BITMAP_TYPE_PNG).ConvertToBitmap() self.collapseAllButton = wx.BitmapButton(self.templatePanel, -1, collapseAllButtonBmp, name="collapseButton") addButtonPath = self.documentTreeGraphics() + "/filenew.png" addButtonBmp = wx.Image(addButtonPath, wx.BITMAP_TYPE_PNG).ConvertToBitmap() self.addButton = wx.BitmapButton(self.templatePanel, -1, addButtonBmp, name="addButton") deleteButtonPath = self.documentTreeGraphics() + "/edit_delete.png" deleteButtonBmp = wx.Image(deleteButtonPath, wx.BITMAP_TYPE_PNG).ConvertToBitmap() self.deleteButton = wx.BitmapButton(self.templatePanel, -1, deleteButtonBmp, name="deleteButton") """ Set taskbar icon. If you remove this, do not forget to remove the RemoveIcon() and Destroy() methods in self.onCloseWindow() """ self.taskBarIcon = wx.TaskBarIcon() iconPath = self.skinGraphics() + "/domtreeviewer.png" icon = wx.Icon(iconPath, wx.BITMAP_TYPE_PNG) self.taskBarIcon.SetIcon(icon, _(u"Template-Designer")) #Set titlebar icon self.SetIcon(icon) #Initiate the contents of the property panel self.pp = pp self.__doProperties() self.__doBindings() self.__doLayout() Safety(self)