i 've used this small nice CGUIPanel class in my app for getting to work multiline text scrolling.
Have found annoying thing - after loading the panel in case of new scrollbars appears they stay behind the content.
Fix is easy:
in CGUIPanel.cpp line 278 and 288 adding this->bringToFront(ScrollBar);
so instead of
Code: Select all
// scrollbars
if ( HScrollBarMode != ESBM_ALWAYS_INVISIBLE &&
(totalRect.getWidth() > outerRect.getWidth() || HScrollBarMode == ESBM_ALWAYS_VISIBLE) )
{
HScrollBar->setVisible(true);
HScrollBar->setMax(totalRect.getWidth() - outerRect.getWidth());
}
else
HScrollBar->setVisible(false);
if ( VScrollBarMode != ESBM_ALWAYS_INVISIBLE &&
(totalRect.getHeight() > outerRect.getHeight() || VScrollBarMode == ESBM_ALWAYS_VISIBLE) )
{
VScrollBar->setVisible(true);
VScrollBar->setMax(totalRect.getHeight() - outerRect.getHeight());
}
else
VScrollBar->setVisible(false);
Code: Select all
// scrollbars
if ( HScrollBarMode != ESBM_ALWAYS_INVISIBLE &&
(totalRect.getWidth() > outerRect.getWidth() || HScrollBarMode == ESBM_ALWAYS_VISIBLE) )
{
HScrollBar->setVisible(true);
HScrollBar->setMax(totalRect.getWidth() - outerRect.getWidth());
this->bringToFront(HScrollBar);
}
else
HScrollBar->setVisible(false);
if ( VScrollBarMode != ESBM_ALWAYS_INVISIBLE &&
(totalRect.getHeight() > outerRect.getHeight() || VScrollBarMode == ESBM_ALWAYS_VISIBLE) )
{
VScrollBar->setVisible(true);
VScrollBar->setMax(totalRect.getHeight() - outerRect.getHeight());
this->bringToFront(VScrollBar);
}
else
VScrollBar->setVisible(false);
thank you