wxTreeCtrl scroll

Hi all!
I want to scroll tree while drag operation, if tree not completly shown. Can anybody suggest how I can do it?

Thanks!

···

--
With best regards,
Alexander I. Evseev

Alexander I. Evseev wrote:

Hi all!
I want to scroll tree while drag operation, if tree not completly shown. Can anybody suggest how I can do it?

There was some C++ code posted several months ago in one of the wx- lists that did this. You might be able to find it by searching the archives or asking about it on wx-users. When you get it then it shouldn't be too hard to port the code to wxPython.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Alexander I. Evseev wrote:

Hi all!
I want to scroll tree while drag operation, if tree not completly shown.
Can anybody suggest how I can do it?

There was some C++ code posted several months ago in one of the wx-
lists that did this. You might be able to find it by searching the
archives or asking about it on wx-users. When you get it then it
shouldn't be too hard to port the code to wxPython.

I found discussion here:
http://groups.google.com.ru/groups?hl=ru&lr=&ie=UTF-8&oe=UTF-8&threadm=200311200559.23001.markg%40rgv.rr.com&rnum=1&prev=/groups%3Fq%3Dwxtreectrl%2Bdrag%2Bscroll%26hl%3Dru%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D200311200559.23001.markg%2540rgv.rr.com%26rnum%3D1
But C++ examples uses Scroll method, but this method undefined. How to update wsTreeCtrl after changing position in ScrollBar?

e-AI wrote:

Alexander I. Evseev wrote:

Hi all!
I want to scroll tree while drag operation, if tree not completly shown. Can anybody suggest how I can do it?

There was some C++ code posted several months ago in one of the wx- lists that did this. You might be able to find it by searching the archives or asking about it on wx-users. When you get it then it shouldn't be too hard to port the code to wxPython.

I found discussion here:
http://groups.google.com.ru/groups?hl=ru&lr=&ie=UTF-8&oe=UTF-8&threadm=200311200559.23001.markg%40rgv.rr.com&rnum=1&prev=/groups%3Fq%3Dwxtreectrl%2Bdrag%2Bscroll%26hl%3Dru%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D200311200559.23001.markg%2540rgv.rr.com%26rnum%3D1
But C++ examples uses Scroll method, but this method undefined. How to update wsTreeCtrl after changing position in ScrollBar?

Did you read the rest of the thread?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

But C++ examples uses Scroll method, but this method undefined. How to update wsTreeCtrl after changing position in ScrollBar?

Did you read the rest of the thread?

Yes. Last part code from tread:

#ifdef __WXMSW__
         int ThumbVert = GetScrollThumb (wxVERTICAL);
         int PosVert = GetScrollPos (wxVERTICAL);
         int RangeVert = GetScrollRange (wxVERTICAL);

         printf ("_OnTimer\n");

         if (Down && ((PosVert + ThumbVert) < RangeVert)) {
                 printf ("scrolling 2\n");
                 int NewPosVert = PosVert+1;
                 ScrollLines (1);
         }
         if (Up && (PosVert > 0)) {
                 printf ("scrolling -2\n");
                 int NewPosVert = PosVert-1;
                 ScrollLines (-1);
         }
#else
         int ThumbVert = GetScrollThumb (wxVERTICAL);
         int PosVert = GetScrollPos (wxVERTICAL);
         int RangeVert = GetScrollRange (wxVERTICAL);

         if (Down && ((PosVert + ThumbVert) < RangeVert)) {
                 int NewPosVert = PosVert+1;
                 SetScrollbar (wxVERTICAL, NewPosVert, ThumbVert, RangeVert);
                 Scroll (-1, NewPosVert);
         }
         if (Up && (PosVert > 0)) {
                 int NewPosVert = PosVert-1;
                 SetScrollbar (wxVERTICAL, NewPosVert, ThumbVert, RangeVert);
                 Scroll (-1, NewPosVert);
         }
#endif

But under GTK Scroll method not defined too. :frowning:

···

--
With best regards,
Alexander I. Evseev

Alexander I. Evseev wrote:

But C++ examples uses Scroll method, but this method undefined. How to update wsTreeCtrl after changing position in ScrollBar?

Did you read the rest of the thread?

Yes. Last part code from tread:

[...]

But under GTK Scroll method not defined too. :frowning:

Oh. Right. The treectrl on wxGTK actually derives from wxScrolledWindow, but that isn't reflected in the class heriarchy in Python since it is supposed to just be an "implementation detail," but the code you looked at took advantage of that detail. I don't think there is an easy way to work around this, but I'll keep thinking about it.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!