ctrl4 () { win0 (); if (getchoice (1, " АР ", "Пустить процессор ?", NULL, " Да ", " Нет ", NULL) == 0) { run (); halting = 0; win0 (); } curwin = 0; prmenu (); }
ctrl3 () { win0 (); if (getchoice (1, " ОР ", "Остановить процессор ?", NULL, " Да ", " Нет ", NULL) == 0) { stop (); halting = 1; win0 (); } curwin = 0; prmenu (); }
ctrl2 () { win0 (); if (getchoice (1, " У0 ", "Обнулить процессор ?", NULL, " Да ", " Нет ", NULL) == 0) { zero (); halting = 1; win0 (); } curwin = 0; prmenu (); }
ctrl5 () { win0 (); if (getchoice (1, " ПктАр ", "Пустить процессор с команды на РКП ?", NULL, " Да ", " Нет ", NULL) == 0) { setcrp (); run (); halting = 0; win0 (); } curwin = 0; prmenu (); }
ctrl1 () { win0 (); if (getchoice (1, " У0ио ", "Обнулить процессор и игнорировать остановы ?", NULL, " Да ", " Нет ", NULL) == 0) { send (0, 0363); zero (); halting = 1; win0 (); } curwin = 0; prmenu (); }
int cglc_main() { cglc::screen scr; scr.renderer.back = "47"; scr.clean(); window win0(20, 10); window win1(20, 10); window win2(20, 10); win0.x = win0.y = 3; win1.x = win1.y = 6; win2.x = win2.y = 9; win0.renderer.back = "42"; win1.renderer.back = "43"; win2.renderer.back = "44"; win0.clean(); win1.clean(); win2.clean(); win2.title = "About Windows"; scr << win0; scr << win1; scr << win2; std::string startmenu(scr.width(), ' '); static_text sm(startmenu); sm.y = scr.high() - 1; sm.nib.back = "44"; scr << sm; static_text hl("#START"); hl.nib.back = "42"; hl.y = scr.high() - 1; scr << hl; static_text hw("\"Windows\" XP 2.0"); hw.nib.back = "44"; win2 << hw; scr << win2; scr.updscr(); }
notyet () { win0 (); Jmove (22, 30); Jrbold (0x4e); Jprintf ("Еще не реализовано"); Jnorm (0x1b); }
int main() try { const int xmax = 600; // window size const int ymax = 400; const int x_orig = xmax/2; // position of (0,0) is center of window const int y_orig = ymax/2; const Point orig(x_orig,y_orig); const int r_min = -10; // range [-10:11) const int r_max = 11; const int n_points = 400; // number of points used in range const int x_scale = 30; // scaling factors const int y_scale = 30; Simple_window win0(Point(100,100),xmax,ymax,"Function graphing"); Function s1(one, r_min,r_max,orig,n_points,x_scale,y_scale); Function s2(slope, r_min,r_max,orig,n_points,x_scale,y_scale); Function s3(square,r_min,r_max,orig,n_points,x_scale,y_scale); win0.attach(s1); win0.attach(s2); win0.attach(s3); Text ts(Point(100,y_orig-40),"one"); Text ts2(Point(100,y_orig+y_orig/2-20),"x/2"); Text ts3(Point(x_orig-100,20),"x*x"); win0.attach(ts); win0.attach(ts2); win0.attach(ts3); win0.set_label("Function graphing: label functions"); const int xlength = xmax-40; // make the axis a bit smaller than the window const int ylength = ymax-40; Axis x(Axis::x,Point(20,y_orig), xlength, xlength/x_scale, "one notch == 1"); Axis y(Axis::y,Point(x_orig, ylength+20), ylength, ylength/y_scale, "one notch == 1"); win0.attach(x); win0.attach(y); win0.wait_for_button(); } catch(exception& e) { // some error reporting return 1; } catch(...) { // some more error reporting return 2; }
ctrl6 () { register char *p; char a [40+1]; static long crp; sprintf (a, "%08lx", crp); p = getstring (8, a, " Пкт ", "Введите шестнадцатеричную команду"); if (p) { sscanf (p, "%lx", &crp); ptsendl (crp, 0371); win0 (); } curwin = 0; prmenu (); }