+//
+// -------------------------------------------------------------------------
+//
+class PadAction : public NCursesMenuItem
+{
+public:
+ PadAction(const char* s) : NCursesMenuItem(s) {
+ }
+
+ bool action() {
+ const int GRIDSIZE = 3;
+ const int PADSIZE = 200;
+ unsigned gridcount = 0;
+
+ NCursesPanel std;
+ NCursesPanel P(std.lines()-2,std.cols()-2,1,1);
+ NCursesFramedPad FP(P,PADSIZE,PADSIZE);
+
+ for (int i=0; i < PADSIZE; i++) {
+ for (int j=0; j < PADSIZE; j++) {
+ if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) {
+ if (i==0 || j==0)
+ FP.addch('+');
+ else
+ FP.addch((chtype)('A' + (gridcount++ % 26)));
+ }
+ else if (i % GRIDSIZE == 0)
+ FP.addch('-');
+ else if (j % GRIDSIZE == 0)
+ FP.addch('|');
+ else
+ FP.addch(' ');
+ }
+ }
+
+ P.label("Pad Demo",NULL);
+ FP();
+ P.clear();
+ return FALSE;
+ }
+};
+