+
+ virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1);
+ // Add the window "view" as viewing window to the pad.
+
+ virtual void setSubWindow(NCursesWindow& sub);
+ // Use the subwindow "sub" of the viewport window for the actual viewing.
+ // The full viewport window is usually used to provide some decorations
+ // like frames, titles etc.
+
+ virtual void operator() (void);
+ // Perform Pad's operation
+};
+
+// A FramedPad is constructed always with a viewport window. This viewport
+// will be framed (by a box() command) and the interior of the box is the
+// viewport subwindow. On the frame we display scrollbar sliders.
+class NCursesFramedPad : public NCursesPad {
+protected:
+ virtual void OnOperation(int pad_req);
+
+public:
+ NCursesFramedPad(NCursesWindow& win, int lines, int cols,
+ int v_grid = 1, int h_grid = 1)
+ : NCursesPad(lines,cols) {
+ NCursesPad::setWindow(win,v_grid,h_grid);
+ NCursesPad::setSubWindow(*(new NCursesWindow(win)));
+ }
+ // Construct the FramedPad with the given Window win as viewport.
+
+ virtual ~NCursesFramedPad() {
+ delete getSubWindow();
+ }
+
+ void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) {
+ err_handler("Operation not allowed");
+ }
+ // Disable this call; the viewport is already defined
+
+ void setSubWindow(NCursesWindow& sub) {
+ err_handler("Operation not allowed");
+ }
+ // Disable this call; the viewport subwindow is already defined
+