change prototype of Window::Recreate() and throw away almost-duplicated code
This commit is contained in:
@@ -83,7 +83,7 @@ void Scrollpad::Flush()
|
||||
space_pos = 0;
|
||||
}
|
||||
}
|
||||
Recreate();
|
||||
Recreate(itsWidth, std::max(itsHeight, itsRealHeight));
|
||||
itsBuffer.SetTemp(&s);
|
||||
static_cast<Window &>(*this) << itsBuffer;
|
||||
itsBuffer.SetTemp(0);
|
||||
@@ -118,15 +118,6 @@ void Scrollpad::RemoveFormatting()
|
||||
itsBuffer.RemoveFormatting(itsFoundValueBegin, itsFoundPattern, itsFoundValueEnd, itsFoundForEach);
|
||||
}
|
||||
|
||||
void Scrollpad::Recreate()
|
||||
{
|
||||
delwin(itsWindow);
|
||||
itsWindow = newpad(std::max(itsHeight, itsRealHeight), itsWidth);
|
||||
SetTimeout(itsWindowTimeout);
|
||||
SetColor(itsBaseColor, itsBgColor);
|
||||
keypad(itsWindow, 1);
|
||||
}
|
||||
|
||||
void Scrollpad::Refresh()
|
||||
{
|
||||
prefresh(itsWindow, itsBeginning, 0, itsStartY, itsStartX, itsStartY+itsHeight-1, itsStartX+itsWidth-1);
|
||||
|
||||
Reference in New Issue
Block a user