 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Roland Seidel Guest
|
Posted: Mon Apr 09, 2007 4:44 am Post subject: How to prevent TreeView scrolling left? |
|
|
Hi everyone,
I've made a custom TreeView and recently put in autoscrolling so when
the user drags a node up the display scrolls down if necessary. I did
this by setting TopItem.
int x = TopItem->AbsoluteIndex;
if(x>0) TopItem = Items->Item[x-1];
That works fine except that if it encounters a node with long text the
display scrolls to the left hiding the +. How do I prevent this happening?
I'm guessing setting TopItem is calling some form of EnsureVisible that
pushes the + out of the way so you can see more text but I don't know
how to influence that either.
thanks in advance
Roland |
|
| Back to top |
|
 |
JD Guest
|
Posted: Thu Apr 12, 2007 8:11 am Post subject: Re: How to prevent TreeView scrolling left? |
|
|
Roland Seidel <roland (AT) redcentresoftware (DOT) com> wrote:
| Quote: |
[...] That works fine except that if it encounters a node
with long text the display scrolls to the left hiding the +.
How do I prevent this happening?
|
Try:
if( TopItem->AbsoluteIndex > 0 )
{
Perform( WM_SETREDRAW, FALSE, 0 );
TopItem = Items->Item[ TopItem->AbsoluteIndex - 1 ];
Perform( WM_HSCROLL, SB_LEFT, 0 );
Perform( WM_HSCROLL, SB_ENDSCROLL, 0 );
Perform( WM_SETREDRAW, TRUE, 0 );
Invalidate();
}
~ JD |
|
| Back to top |
|
 |
Roland Seidel Guest
|
Posted: Fri Apr 13, 2007 4:25 am Post subject: Re: How to prevent TreeView scrolling left? |
|
|
That did the trick - thanks very much.
Roland
JD wrote:
| Quote: | Roland Seidel <roland (AT) redcentresoftware (DOT) com> wrote:
[...] That works fine except that if it encounters a node
with long text the display scrolls to the left hiding the +.
How do I prevent this happening?
Try:
if( TopItem->AbsoluteIndex > 0 )
{
Perform( WM_SETREDRAW, FALSE, 0 );
TopItem = Items->Item[ TopItem->AbsoluteIndex - 1 ];
Perform( WM_HSCROLL, SB_LEFT, 0 );
Perform( WM_HSCROLL, SB_ENDSCROLL, 0 );
Perform( WM_SETREDRAW, TRUE, 0 );
Invalidate();
}
~ JD
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|