6 This program will load and run one of the individual demos in this 7 directory within its own frame window. Just specify the module name 13 import wx.lib.mixins.inspection
17 from libCatKernel
import *
24 overviewText =
"CAT Configuration Window" 26 wx.Frame.__init__(self, parent, wx.NewId(), title)
29 self.
path=os.path.join(os.environ.get(
"CATPATH"),
"CatPython",
"python")
31 res=xrc.XmlResource(os.path.join(self.
path,
"xrc/ConfPanel.xrc"))
32 self.
panel=res.LoadPanel(self,
"ConfPanel")
41 self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.
onChange)
44 '''Retrieves the given control (within a dialog) by its xmlid''' 45 control = panel.FindWindowById(xrc.XRCID(xmlid))
46 assert control !=
None,
'Programming error: a control with xml id ' + xmlid +
' was not found.' 52 TB_CLOSEALL=wx.NewId()
55 self.
toolBar = self.CreateToolBar(wx.TB_DOCKABLE)
56 self.
toolBar.AddLabelTool(TB_CLOSEALL,
'', wx.Bitmap(os.path.join(self.
path,
"xrc/icons/closeall.png")))
57 self.
toolBar.AddLabelTool(TB_CLOSE ,
'', wx.Bitmap(os.path.join(self.
path,
"xrc/icons/close.png")))
59 self.
toolBar.AddLabelTool(TB_RELOAD,
'', wx.Bitmap(os.path.join(self.
path,
"xrc/icons/reload.png")))
61 self.Bind(wx.EVT_TOOL, self.
onReLoad , id=TB_RELOAD)
62 self.Bind(wx.EVT_TOOL, self.
onCloseAll , id=TB_CLOSEALL)
63 self.Bind(wx.EVT_TOOL, self.
onClose , id=TB_CLOSE)
66 '''Responds to idle time in the system''' 70 self.parent.cfgFrame.Show(
False)
71 self.parent.cfgState=
False 98 for i
in range(len(self.
objs)):
99 if path==self.
paths[i]:
102 self.
notebook.SetSelection(objpanel)
111 self.
objs.append(obj)
112 self.
paths.append(path)
114 self.
wraps.append(wrap)
126 module=wrap.GetActive()
127 panel=module.Edit(self.
app,obj,self.
notebook,wrap.GetFilePath())
129 self.
confs.append(panel)
130 self.
notebook.AddPage(panel.page(),obj.name(),
True)
def onChange(self, event)
def onCloseAll(self, event)
def onReLoad(self, event)
def __init__(self, app, parent, title)
def onIconize(self, event)
def getControl(self, panel, xmlid)
def onEdit(self, obj, path, type)