TARGET=nviewer
CXXFLAGS=-Wall -g -I../src
-OBJECTS=main.o window.o w_node_header.o w_btree.o
+OBJECTS=main.o window.o w_node_header.o w_btree.o w_ask.o
all: $(TARGET)
--- /dev/null
+
+#include "w_ask.h"
+
+wAsk::wAsk (Window *p, const std::string &s) : Window (p, s, p->Width ()-2, 3, 1, p->Height()-4)
+{
+}
+
+#define MAX_ 50
+
+uint wAsk::Node ()
+{
+ uint pos = 0;
+ char arr[MAX_];
+ int c;
+
+ c = GetChar ();
+ while (c != 13) {
+ switch (c) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '-':
+ arr[pos++] = c;
+ break;
+ case 9:
+ case 8:
+ pos--;
+ if (pos > 0) pos = 0;
+ }
+ SetText (1, 1, " ");
+
+ mvwaddnstr (win, 1, 1, arr, pos);
+ Show ();
+ c = GetChar ();
+ }
+
+ arr[pos] = '\0';
+ return atoi (arr);
+}
+