Page 1 of 1

Add a function to Scrollbar?

Posted: Sat Oct 17, 2009 03:35
by lcy03406
The problem is, I want the thumb fix to the end, even when the ducument size grows. In fact, I'm making a floating-up textbox, adding a blank line every seconds.
I wrote this in updateSelf of my textbox class:
bar->setDocumentSize( docSize );
bar->setScrollPosition( docSize - bar->getPageSize() );
The thumb button will 'move' twice, calculate the area twice, and invalidate itself, but actually it does not move at all.
I think it is better adding a function to Scrollbar changing the document size and scroll position at the same time, and calculate the area only once.
Or add a 'FixToBottom' property. :D

LCY.

Re: Add a function to Scrollbar?

Posted: Sat Oct 17, 2009 09:04
by CrazyEddie
I think it is better adding a function to Scrollbar changing the document size and scroll position at the same time, and calculate the area only once.

TBH, I thought we already had this. Which means either that I thought about this a long time ago and never implemented it, or that my mind is gone :mrgreen:

lcy03406 wrote:Or add a 'FixToBottom' property. :D

I'll consider this. My first though was that this is a good idea and my second thought contained lots of reasons not to do it - so I'll take some time to ponder on it some more...

CE.

Re: Add a function to Scrollbar?

Posted: Sun Feb 21, 2010 19:31
by CrazyEddie
Both the single update function:

Code: Select all

    void setConfig(const float* const document_size,
                   const float* const page_size,
                   const float* const step_size,
                   const float* const overlap_size,
                   const float* const position);


And a new 'end lock' mode:

Code: Select all

functions:
    void Scrollbar::setEndLockEnabled(const float enabled);
    bool Scrollbar::isEndLockEnabled() const;

Boolean Property:
    "EndLockEnabled"


Have been added to Scrollbar in branches/v0-7.

CE.