+ wxResourceEditorFrame *frame = (wxResourceEditorFrame *)wxWindow::GetParent();
+ wxResourceManager *manager = frame->manager;
+
+ long selParent = wxTreeCtrl::GetParent(sel);
+
+ if (resType != "wxDialog" && resType != "wxDialogBox" && resType != "wxPanel")
+ {
+ wxWindow *win = manager->FindWindowForResource(res);
+
+ // Check to see if the item selected in on the current dialog being
+ // displayed. If not, then we will have to find the items parent dialog
+ if (!win)
+ {
+ // The item is on a dialog other than the one currently being
+ // shown/worked on, so find the parent dialog, switch to use
+ // its resource manager, and then find the window in the dialog
+ wxItemResource* resParent = ((wxResourceTreeData *)GetItemData(selParent))->GetResource();
+ wxResourceManager::GetCurrentResourceManager()->Edit(resParent);
+ win = manager->FindWindowForResource(res);
+ }
+
+// if (win)
+// manager->GetCurrentResourceManager()->EditWindow(win);
+ }
+ else
+ wxResourceManager::GetCurrentResourceManager()->Edit(res);
+
+} // wxResourceEditorProjectTree::OnSelChanged()