implemented locating objects in gridbag sizer,
expanding tree to show selected object git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		| @@ -679,7 +679,7 @@ class Frame(wxFrame): | |||||||
|         # We simply perform depth-first traversal, sinse it's too much |         # We simply perform depth-first traversal, sinse it's too much | ||||||
|         # hassle to deal with all sizer/window combinations |         # hassle to deal with all sizer/window combinations | ||||||
|         w = tree.FindNodeObject(item) |         w = tree.FindNodeObject(item) | ||||||
|         if w == obj: |         if w == obj or isinstance(w, wxGBSizerItem) and w.GetWindow() == obj: | ||||||
|             return item |             return item | ||||||
|         if tree.ItemHasChildren(item): |         if tree.ItemHasChildren(item): | ||||||
|             child = tree.GetFirstChild(item)[0] |             child = tree.GetFirstChild(item)[0] | ||||||
| @@ -695,6 +695,7 @@ class Frame(wxFrame): | |||||||
|         g.testWin.Disconnect(wxID_ANY, wxID_ANY, wxEVT_LEFT_DOWN) |         g.testWin.Disconnect(wxID_ANY, wxID_ANY, wxEVT_LEFT_DOWN) | ||||||
|         item = self.FindObject(g.testWin.item, evt.GetEventObject()) |         item = self.FindObject(g.testWin.item, evt.GetEventObject()) | ||||||
|         if item: |         if item: | ||||||
|  |             tree.EnsureVisible(item) | ||||||
|             tree.SelectItem(item) |             tree.SelectItem(item) | ||||||
|         self.tb.ToggleTool(self.ID_TOOL_LOCATE, False) |         self.tb.ToggleTool(self.ID_TOOL_LOCATE, False) | ||||||
|         if item: |         if item: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user