It enhances the test mode (F5, or View > Test, or double-click an item).
If you are double-clicking a control and seeing "No view for this
item (yet)" this patch will instead open the containing frame or
dialog and display the control in context.
Regards,
Nate
Index: tree.py
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/wxPython/wx/tools/XRCed/
tree.py,v
retrieving revision 1.17
diff -u -r1.17 tree.py
--- tree.py 2005/06/14 22:59:20 1.17
+++ tree.py 2005/06/27 17:43:48
@@ -662,15 +662,16 @@
g.testWin.highLight.item = item
def ShowTestWindow(self, item):
- xxx = self.GetPyData(item)
if g.panel.IsModified():
- self.Apply(xxx, item) # apply changes
- treeObj = xxx.treeObject()
- if treeObj.className not in ['wxFrame', 'wxPanel', 'wxDialog',
- 'wxMenuBar', 'wxToolBar',
'wxWizard',
- 'wxWizardPageSimple']:
- wxLogMessage('No view for this element (yet)')
- return
+ self.Apply(self.GetPyData(item), item) # apply changes
+ availableViews = ['wxFrame', 'wxPanel', 'wxDialog',
'wxMenuBar',
+ 'wxToolBar', 'wxWizard',
'wxWizardPageSimple']
+ while self.GetPyData(item).treeObject().className not in
availableViews:
+ # walk up the tree until we find an item that has a view
+ item = self.GetItemParent(item)
+ if not item or not item.IsOk():
+ wxLogMessage('No view for this element (yet)')
+ return
# Show item in bold
if g.testWin: # Reset old
self.SetItemBold(g.testWin.item, False)