X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/306b6fe972cccc5022a5ec6096cf94b6b1e0b1cb..b0d8bfa6cd4042d3ea8680ad0145f79e3cb15268:/wxPython/wx/tools/XRCed/tree.py diff --git a/wxPython/wx/tools/XRCed/tree.py b/wxPython/wx/tools/XRCed/tree.py index 597c56a345..0e78ba4844 100644 --- a/wxPython/wx/tools/XRCed/tree.py +++ b/wxPython/wx/tools/XRCed/tree.py @@ -441,7 +441,7 @@ class XML_Tree(wxTreeCtrl): EVT_TREE_ITEM_COLLAPSED(self, self.GetId(), self.OnItemExpandedCollapsed) self.selection = None - self.selectionChanging = False + self.selectionChanging = False self.needUpdate = False self.pendingHighLight = None self.ctrl = self.shift = False @@ -653,9 +653,9 @@ class XML_Tree(wxTreeCtrl): # Top-level sizer? return window's sizer if xxx.isSizer and isinstance(parentWin, wxWindow): return parentWin.GetSizer() - elif isinstance(xxx, xxxStatusBar): return None - elif isinstance(xxx, xxxToolBar): - # If it's the main toolbar, we can't really select it + elif xxx.__class__ in [xxxStatusBar, xxxMenu, xxxMenuItem, xxxSeparator]: return None + elif xxx.__class__ in [xxxToolBar, xxxMenuBar]: + # If it's the main toolbar or menubar, we can't really select it if xxx.parent.__class__ == xxxFrame: return None elif isinstance(xxx.parent, xxxToolBar): # Select complete toolbar @@ -683,10 +683,10 @@ class XML_Tree(wxTreeCtrl): def OnSelChanged(self, evt): if self.selectionChanging: return - self.selectionChanging = True + self.selectionChanging = True self.UnselectAll() self.SelectItem(evt.GetItem()) - self.selectionChanging = False + self.selectionChanging = False def ChangeSelection(self, item): # Apply changes