summaryrefslogtreecommitdiff
path: root/src/scrollpad.cpp
diff options
context:
space:
mode:
authorunK <electricityispower@gmail.com>2008-10-07 23:04:26 +0200
committerunK <electricityispower@gmail.com>2008-10-07 23:04:26 +0200
commit48ba7cbcf28db5bf8448883a5306493e05729dd1 (patch)
treed88032b30ae345d479cae53584ab31eab265d84d /src/scrollpad.cpp
parentfc00baa300ec1770249d5ea0965abd1143264734 (diff)
another code clean-ups
Diffstat (limited to 'src/scrollpad.cpp')
-rw-r--r--src/scrollpad.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/scrollpad.cpp b/src/scrollpad.cpp
index 58d918e9..67b4b04d 100644
--- a/src/scrollpad.cpp
+++ b/src/scrollpad.cpp
@@ -20,6 +20,18 @@
#include "scrollpad.h"
+Scrollpad::Scrollpad(int startx, int starty, int width, int height, const string &title, Color color, Border border) :
+ Window(startx, starty, width, height, title, color, border),
+ itsBeginning(0),
+ itsRealHeight(1),
+ itsXPos(0)
+{
+ delwin(itsWindow);
+ itsWindow = newpad(itsHeight, itsWidth);
+ SetColor(itsColor);
+ keypad(itsWindow, 1);
+}
+
Scrollpad::Scrollpad(const Scrollpad &s) : Window(s)
{
itsContent = s.itsContent;
@@ -126,12 +138,13 @@ void Scrollpad::Recreate()
itsWindow = newpad(itsRealHeight, itsWidth);
SetTimeout(itsWindowTimeout);
SetColor(itsBaseColor, itsBgColor);
+ keypad(itsWindow, 1);
Write(itsContent.c_str());
}
void Scrollpad::Refresh(bool)
{
- prefresh(itsWindow,itsBeginning,0,itsStartY,itsStartX,itsStartY+itsHeight-1,itsStartX+itsWidth);
+ prefresh(itsWindow, itsBeginning, 0, itsStartY, itsStartX, itsStartY+itsHeight-1, itsStartX+itsWidth);
}
void Scrollpad::Resize(int width, int height)
@@ -140,8 +153,8 @@ void Scrollpad::Resize(int width, int height)
{
delwin(itsWinBorder);
itsWinBorder = newpad(height, width);
- wattron(itsWinBorder,COLOR_PAIR(itsBorder));
- box(itsWinBorder,0,0);
+ wattron(itsWinBorder, COLOR_PAIR(itsBorder));
+ box(itsWinBorder, 0, 0);
width -= 2;
height -= 2;
}
@@ -215,14 +228,15 @@ void Scrollpad::Clear(bool clear_screen)
wclear(itsWindow);
delwin(itsWindow);
itsWindow = newpad(itsHeight, itsWidth);
- SetColor(itsColor, itsBgColor);
SetTimeout(itsWindowTimeout);
+ SetColor(itsColor, itsBgColor);
+ keypad(itsWindow, 1);
if (clear_screen)
Window::Clear();
}
Window * Scrollpad::EmptyClone() const
{
- return new Scrollpad(GetStartX(),GetStartY(),GetWidth(),GetHeight(),itsTitle,itsBaseColor,itsBorder);
+ return new Scrollpad(GetStartX(), GetStartY(), GetWidth(), GetHeight(), itsTitle, itsBaseColor, itsBorder);
}