Feature Requests item #3093531, was opened at 2010-10-23 05:33 Message generated for change (Tracker Item Submitted) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=462819&aid=3093531&group_id=51305
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: wxTreeList Hit test is not working proper Initial Comment: hi, Thanks for bug solving first , I have done same thing in my code and got the scroll event but i got another problem. When we i first used the code i found that HitTest was not working fine and did not return anything. 1. First i change the code in treeListctrl.cpp file at this place wxTreeItemId wxTreeListCtrl::HitTest(const wxPoint& pos, int& flags, int& column) { wxPoint p = (pos); return m_main_win->HitTest (p, flags, column); } It works for me and give me the correct result and i have coding that when i clicked on button it collapse/or expand the button and select the clicked item. 2. Second changes i have done that i implement void wxTreeListMainWindow::OnScroll (wxScrollWinEvent& event) { // FIXME #if defined(__WXGTK__) && !defined(__WXUNIVERSAL__) wxScrolledWindow::OnScroll(event); #else HandleOnScroll( event ); #endif if (m_owner->GetEventHandler()->ProcessEvent(event)) return; // handled (and not skipped) in user code m_owner->GetHeaderWindow()->Refresh(); m_owner->GetHeaderWindow()->Update(); } To get the scroll event 3. I have implement the functions to syncronized the scroll position of first window to second window void wxTreeListMainWindow::SetVScrollPosition(int pos, int orientation) { if(orientation == wxVERTICAL) { Scroll(0, pos); } else { Scroll(pos, 0); } } void wxTreeListCtrl::SetVScrollPosition(int pos, int orientation) { m_main_win->SetVScrollPosition(pos, orientation); } Problem : Current working: I am using two treelistctrl to compare directory. I have maintain a map of treeItemId to make synchronization of scrolling and collapsing and expanding item, When i clicked(on mouse click) on first frame it return me treeItemId and on the basis of ItemId , second treelistCtrl correspondence treeItem id get selected , collapsed or expand with help of that map. Problem: HitTest do not retun me the exact TreeItem Id in first frame and after collapsed item it retun me the wrong tree item Id and make selection of different item other then i clicked. For example i filled 20 item in treelist and last item has 4 child and currently in expanded state, i clicked on button to collapse them , it collapse and select the item one/two upper the item i got selected. I am selecting Item on mouse up event as : void CUCTreeCtrlEx:: OnLeftMouseUP(wxMouseEvent &event) { int flag; wxTreeItemId id = HitTest(event.GetPosition(), flag); SelectItem(id); } CUCTreeCtrlEx is derived with treelistctrl. Second time its working fine but when i scroll the window and try again to click on button it again return me wrong item id. I think there is some refreshing problem, please find the attachment as screen Shot. My treeList is single seleted and os is Linux Ubunto-9.0 Yogesh ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=462819&aid=3093531&group_id=51305 ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ wxCode-users mailing list wxCode-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxcode-users