(svn r25771) -Fix (r25344): If story book content changed height due a string parameter changing length, the scrollbar was not updated

This commit is contained in:
zuu 2013-09-14 12:18:36 +00:00
parent 7adc453473
commit f8f9e30f80
1 changed files with 15 additions and 0 deletions

View File

@ -479,6 +479,21 @@ public:
}
}
virtual void OnPaint()
{
/* Detect if content has changed height. This can happen if a
* multi-line text contains eg. {COMPANY} and that company is
* renamed.
*/
if (this->vscroll->GetCount() != this->GetContentHeight()) {
this->vscroll->SetCount(this->GetContentHeight());
this->SetWidgetDirty(WID_SB_SCROLLBAR);
this->SetWidgetDirty(WID_SB_PAGE_PANEL);
}
this->DrawWidgets();
}
virtual void DrawWidget(const Rect &r, int widget) const
{
if (widget != WID_SB_PAGE_PANEL) return;