change prototype of Window::Recreate() and throw away almost-duplicated code

This commit is contained in:
Andrzej Rybczak
2009-09-17 02:36:40 +00:00
parent 4426442ed0
commit eee80427fe
4 changed files with 10 additions and 21 deletions

View File

@@ -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);