Advertisement
melnikovmaxim

BKV_calc

Dec 16th, 2019
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 16.36 KB | None | 0 0
  1. //https://yadi.sk/d/0NrF8GExlTa0XA
  2. #include <FL/Fl.H>
  3. #include <FL/Fl_Window.H>
  4. #include <FL/Fl_Button.H>
  5. #include <FL/Fl_Input.H>
  6. #include <FL/Fl_Output.H>
  7. #include <FL/Fl_Text_Display.H>
  8. #include <math.h>
  9. #include <GL/glut.h>
  10. #include <pthread.h>
  11. #include <iostream>
  12.  
  13. Fl_Output* inp;
  14. Fl_Text_Display* disp;
  15. Fl_Button* but[9][9];
  16. Fl_Button* one, * two, * three, * four, * five, * six, * seven, * eight, * nine, * nol, * plus, * minus, * inc, * del, * refresh, * ravno, * c, * ac, * bleft, * bsin, * bcos, * btg, * bctg, * barcsin, * barccos, * bpow, * bsqrt, * blog, * bln, * be, * bpt, * bfibo, * bfac, * bbes1, * bbes2, * graph;
  17. Fl_Button* extra, * closeextra, * zap, * bsh, * bch;
  18. Fl_Input* extraInp;
  19. Fl_Window* window2, * graphwin;
  20. Fl_Window* window;
  21. int window_1, window_2;
  22. bool b = false;
  23. int K = 0;
  24. int q, w;
  25. int k1 = 1;
  26. int p;
  27. int graphint;
  28. double val[100];
  29. int valInc = 0;
  30. int valInt = 0;
  31. int valI;
  32. int valIntMas[256];
  33. char buffer[0];
  34. char buffer2[256];
  35. int lastf = 0, lastff = 0, trig = 0, valC;
  36. int qqq;
  37. bool rg = false;
  38. double outvalue = 0, ex1 = 0, ex2, ex3;
  39. int result;
  40. int id1, id2;
  41. pthread_t thread1;
  42. int click = 0;
  43. bool first = false;
  44.  
  45. void check() {
  46.     for (int i = buffer[strlen(buffer) - 1]; i > 0; i--)
  47.     {
  48.         if (i > 0 && buffer[i - 1] == '.') {
  49.             break;
  50.         }
  51.         else
  52.             if (buffer[i] == '0')
  53.                 buffer[i] = '\0';
  54.     }
  55. }
  56. void refreshfunc(Fl_Widget* o, void*) {
  57.     if (window_1 != 0) {
  58.         glutHideWindow();
  59.         glutShowWindow();
  60.         glutSetWindow(window_1);
  61.         glutReshapeWindow(450, 450);
  62.         glutPositionWindow(((glutGet(GLUT_SCREEN_WIDTH)) / 2) - 225, ((glutGet(GLUT_SCREEN_HEIGHT)) / 2) - 225);
  63.         graph->label("@<-");
  64.         click = 1;
  65.     }
  66. }
  67.  
  68. void last() {
  69.     if (lastf == 0)
  70.         val[0] += atof(inp->value());
  71.     else if (lastf == 1)
  72.         val[0] += atof(inp->value());
  73.     else if (lastf == 2)
  74.         val[0] -= atof(inp->value());
  75.     else if (lastf == 3)
  76.         val[0] *= atof(inp->value());
  77.     else if (lastf == 4)
  78.         val[0] /= atof(inp->value());
  79. }
  80.  
  81. void call_ac(Fl_Widget* o, void*) {
  82.     val[0] = 0;
  83.     lastf = 0;
  84.     inp->value("");
  85. }
  86. bool tochka = false;
  87. void add_num(Fl_Widget* o, void*) {
  88.  
  89.     Fl_Button* button = (Fl_Button*)o;
  90.     if (button->label() == ".") {
  91.         sprintf(buffer2, "%s", inp->value());
  92.         for (int i = 0; i < strlen(buffer2); i++)
  93.         {
  94.             if (buffer2[i] == '.') {
  95.                 tochka = true;
  96.                 break;
  97.             }
  98.         }
  99.     }
  100.     if (tochka == false or button->label() != ".") {
  101.         if ((inp->value()) == 0 && (button->labelsize() != 16))
  102.             sprintf(buffer2, "%s", button->label());
  103.         else
  104.             sprintf(buffer2, "%s%s", inp->value(), button->label());
  105.  
  106.  
  107.         inp->value(buffer2);
  108.     }
  109.     tochka = false;
  110. }
  111.  
  112. void del_num(Fl_Widget* o, void*) {
  113.     sprintf(buffer2, "%s", inp->value());
  114.  
  115.     buffer2[strlen(buffer2) - 1] = 0;
  116.  
  117.     inp->value(buffer2);
  118.  
  119. }
  120.  
  121. void call_plus(Fl_Widget* o, void*) {
  122.     Fl_Button* button = (Fl_Button*)o;
  123.     if (button->label() == "-" && atof(inp->value()) == 0) {
  124.         sprintf(buffer2, "%s", button->label());
  125.         inp->value(buffer2);
  126.     }
  127.     else {
  128.         if (button->label() != "cos" && button->label() != "sin" && button->label() != "tg" && button->label() != "ctg" && button->label() != "arcsin" && button->label() != "arccos" && button->label() != "Calc pow" && button->label() != "sqrt" && button->label() != "Calc log" && button->label() != "ln" && button->label() != "factorial" && button->label() != "bessel-1" && button->label() != "bessel-2" && button->label() != "exp" && button->label() != "fibonacci" && button->label() != "sh" && button->label() != "ch") {
  129.             last();
  130.             inp->value("");
  131.         }
  132.         if (button->label() == "+")
  133.             lastf = 1;
  134.         else if (button->label() == "-")
  135.             lastf = 2;
  136.         else if (button->label() == "X")
  137.             lastf = 3;
  138.         else if (button->label() == "/")
  139.             lastf = 4;
  140.  
  141.         if (button->label() == "cos") {
  142.             sprintf(buffer, "%f", cos(atof(inp->value())));
  143.             check();
  144.             inp->value(buffer);
  145.             graphint = 2;
  146.  
  147.         }
  148.         else if (button->label() == "sin") {
  149.             sprintf(buffer, "%f", sin(atof(inp->value())));
  150.             check();
  151.             inp->value(buffer);
  152.             graphint = 1;
  153.         }
  154.         else if (button->label() == "tg") {
  155.             sprintf(buffer, "%f", sin(atof(inp->value())) / cos(atof(inp->value())));
  156.             check();
  157.             inp->value(buffer);
  158.             graphint = 3;
  159.         }
  160.         else if (button->label() == "ctg") {
  161.             sprintf(buffer, "%f", cos(atof(inp->value())) / sin(atof(inp->value())));
  162.             check();
  163.             inp->value(buffer);
  164.             graphint = 4;
  165.         }
  166.         else if (button->label() == "arcsin") {
  167.             sprintf(buffer, "%f", asin(atof(inp->value())));
  168.             check();
  169.             inp->value(buffer);
  170.             graphint = 5;
  171.         }
  172.         else if (button->label() == "arccos") {
  173.             sprintf(buffer, "%f", acos(atof(inp->value())));
  174.             check();
  175.             inp->value(buffer);
  176.             graphint = 6;
  177.         }
  178.         else if (button->label() == "Calc pow") {
  179.             sprintf(buffer, "%f", pow(atof(inp->value()), atof(extraInp->value())));
  180.             check();
  181.             inp->value(buffer);
  182.         }
  183.         else if (button->label() == "sqrt") {
  184.             sprintf(buffer, "%f", sqrt(atof(inp->value())));
  185.             check();
  186.             inp->value(buffer);
  187.         }
  188.         else if (button->label() == "Calc log") {
  189.             sprintf(buffer, "%f", (log10(atof(inp->value()))) / (log10(atof(extraInp->value()))));
  190.             check();
  191.             inp->value(buffer);
  192.         }
  193.         else if (button->label() == "ln") {
  194.             sprintf(buffer, "%f", log(atof(inp->value())));
  195.             check();
  196.             inp->value(buffer);
  197.             graphint = 7;
  198.         }
  199.         else if (button->label() == "factorial") {
  200.             ex1 = 1;
  201.             for (ex2 = 1; ex2 < atof(inp->value()) + 1; ex2++)
  202.                 ex1 *= ex2;
  203.             sprintf(buffer, "%f", ex1);
  204.             inp->value(buffer);
  205.         }
  206.         else if (button->label() == "bessel-1") {
  207.             sprintf(buffer, "%f", jn((atoi(extraInp->value())), (atoi(inp->value()))));
  208.             check();
  209.             inp->value(buffer);
  210.             graphint = 9;
  211.         }
  212.         else if (button->label() == "bessel-2") {
  213.             sprintf(buffer, "%f", yn((atoi(extraInp->value())), (atoi(inp->value()))));
  214.             check();
  215.             inp->value(buffer);
  216.  
  217.         }
  218.         else if (button->label() == "exp") {
  219.             sprintf(buffer, "%f", exp((atof(inp->value()))));
  220.             check();
  221.             inp->value(buffer);
  222.         }
  223.         else if (button->label() == "fibonacci") {
  224.             int a = atoi(inp->value());
  225.             int M[a];
  226.             M[0] = 0;
  227.             M[1] = 1;
  228.             for (int i = 2; i <= a; i++)
  229.                 M[i] = M[i - 2] + M[i - 1];
  230.  
  231.             inp->value("");
  232.  
  233.             for (int i = 0; i <= a; i++) {
  234.                 sprintf(buffer, "%s %i", inp->value(), M[i]);
  235.                 check();
  236.                 inp->value(buffer);
  237.             }
  238.  
  239.         }
  240.         else if (button->label() == "sh") {
  241.             sprintf(buffer, "%f", sinh(atoi(inp->value())));
  242.             check();
  243.             inp->value(buffer);
  244.             graphint = 11;
  245.         }
  246.         else if (button->label() == "ch") {
  247.             sprintf(buffer, "%f", cosh(atoi(inp->value())));
  248.             check();
  249.             inp->value(buffer);
  250.             graphint = 12;
  251.         }
  252.  
  253.     }
  254.  
  255. }
  256. float angle = 0.0f;
  257. float x = -320.0, n = 320.0, y;
  258. int count = 0;
  259. float* X;
  260. float* Y;
  261. double fff;
  262. int type = 3;
  263.  
  264. void display()
  265. {
  266.  
  267.     glClear(GL_COLOR_BUFFER_BIT);
  268.  
  269.     glColor3f(0.0, 0.0, 0.0);
  270.     glBegin(GL_LINES);
  271.     glVertex2f(-600, 0);
  272.     glVertex2f(600, 0);
  273.     glEnd();
  274.  
  275.     glBegin(GL_LINES);
  276.     glVertex2f(0, 600);
  277.     glVertex2f(0, -600);
  278.     glEnd();
  279.  
  280.     glBegin(GL_LINES);
  281.  
  282.  
  283.     int k = -1;
  284.     glBegin(GL_LINES);
  285.     for (double i = 0; i < 600; i += 12 - M_PI / 5) {
  286.         k++;
  287.         if (k % 5 == 0) {
  288.             glVertex2f(i, -16);
  289.             glVertex2f(i, 16);
  290.         }
  291.         else {
  292.             glVertex2f(i, -5);
  293.             glVertex2f(i, 5);
  294.         }
  295.  
  296.     }
  297.     glEnd();
  298.     k = -1;
  299.     glBegin(GL_LINES);
  300.  
  301.     for (double i = 0; i > -600; i -= 12 + M_PI / 5) {
  302.         k++;
  303.         if (k % 5 == 0) {
  304.             glVertex2f(i, -16);
  305.             glVertex2f(i, 16);
  306.         }
  307.         else {
  308.             glVertex2f(i, -5);
  309.             glVertex2f(i, 5);
  310.         }
  311.  
  312.     }
  313.     glEnd();
  314.     k = -1;
  315.     glBegin(GL_LINES);
  316.     for (double i = -600; i < 600; i += 24) {
  317.         k++;
  318.         if (k % 5 == 0) {
  319.             glVertex2f(-16, i);
  320.             glVertex2f(16, i);
  321.         }
  322.         else {
  323.             glVertex2f(-5, i);
  324.             glVertex2f(5, i);
  325.         }
  326.  
  327.     }
  328.     glEnd();
  329.  
  330.  
  331.     glBegin(GL_LINE_STRIP);
  332.     glColor3f(1.0, 0.0, 0.0);
  333.  
  334.     if (graphint == 1)
  335.         for (int i = -600; i <= 600; i++) {
  336.             float y = 120 * sin((i * M_PI / 180));
  337.             glVertex2d(i, y);
  338.         }
  339.     else if (graphint == 2)
  340.         for (int i = -600; i <= 600; i++) {
  341.             float y = 120 * cos((i * M_PI / 180));
  342.             glVertex2d(i, y);
  343.         }
  344.     else if (graphint == 3)
  345.         for (int i = -600; i <= 600; i++) {
  346.             float y = 120 * tan((i * M_PI / 180));
  347.             glVertex2d(i, y);
  348.         }
  349.     else if (graphint == 4)
  350.         for (int i = -600; i <= 600; i++) {
  351.             float y = 120 * cos((i * M_PI / 180)) / sin((i * M_PI / 180));
  352.             glVertex2d(i, y);
  353.         }
  354.     else if (graphint == 5)
  355.         for (int i = -600; i <= 600; i++) {
  356.             float y = 120 * asin((i * M_PI / 180));
  357.             glVertex2d(i, y);
  358.         }
  359.     else if (graphint == 6)
  360.         for (int i = -600; i <= 600; i++) {
  361.             float y = 120 * acos((i * M_PI / 180));
  362.             glVertex2d(i, y);
  363.         }
  364.     else if (graphint == 7)
  365.         for (int i = -600; i <= 600; i++) {
  366.             float y = 120 * log((i * M_PI / 180));
  367.             glVertex2d(i, y);
  368.         }
  369.     else if (graphint == 8)
  370.         for (int i = -600; i <= 600; i++) {
  371.             float y = 120 * log10(i * M_PI / 180);
  372.             glVertex2d(i, y);
  373.         }
  374.     else if (graphint == 9)
  375.         for (int i = -600; i <= 600; i++) {
  376.             float y = 120 * j0(i * M_PI / 180);
  377.             glVertex2d(i, y);
  378.         }
  379.     else if (graphint == 10)
  380.         for (int i = -600; i <= 600; i++) {
  381.             float y = 120 * j1(i * M_PI / 180);
  382.             glVertex2d(i, y);
  383.         }
  384.     else if (graphint == 11)
  385.         for (int i = -600; i <= 600; i++) {
  386.             float y = 0.120 * sinh(i * M_PI / 180);
  387.             glVertex2d(i, y);
  388.         }
  389.     else if (graphint == 12)
  390.         for (int i = -600; i <= 600; i++) {
  391.             float y = 0.120 * cosh(i * M_PI / 180);
  392.             glVertex2d(i, y);
  393.         }
  394.     glEnd();
  395.     glFlush();
  396. }
  397. void closewindow(Fl_Widget* o, void*) {
  398.     delete closeextra;
  399.     delete extra;
  400.     delete extraInp;
  401.     window->resize(window->x(), window->y(), 415, 270);
  402.     rg = false;
  403. }
  404. bool b1b2 = false;
  405. void* thread_func(void* arg) {
  406.     //glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION);
  407.     glutMainLoop();
  408. }
  409.  
  410.  
  411.  
  412.  
  413. void addwindow2(Fl_Widget* o, void*) {
  414.     if (first == false)
  415.     {
  416.         glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
  417.         glutInitWindowSize(450, 450);
  418.         glutInitWindowPosition(((glutGet(GLUT_SCREEN_WIDTH)) / 2) - 225, ((glutGet(GLUT_SCREEN_HEIGHT)) / 2) - 225);
  419.         window_1 = glutCreateWindow("Graphic");
  420.         glClearColor(1.0, 1.0, 1.0, 1.0);
  421.         glMatrixMode(GL_PROJECTION);
  422.         glLoadIdentity();
  423.         glOrtho(-600.0, 600.0, -600.0, 600.0, -1.0, 1.0);
  424.         glutDisplayFunc(display);
  425.         result = pthread_create(&thread1, NULL, thread_func, &id1);
  426.         first = true;
  427.         graph->label("@<-");
  428.     }
  429.  
  430.     if (click == 0)
  431.         click = 1;
  432.     else if (click == 1)
  433.     {
  434.         click = 2;
  435.         glutHideWindow();
  436.         graph->label("@->");
  437.  
  438.  
  439.     }
  440.     else if (click == 2)
  441.     {
  442.         glutShowWindow();
  443.         graph->label("@<-");
  444.         click = 1;
  445.     }
  446. }
  447.  
  448. void addwindow(Fl_Widget* o, void*) {
  449.     if (rg == true) {
  450.         delete closeextra;
  451.         delete extra;
  452.         delete extraInp;
  453.     }
  454.     Fl_Button* button = (Fl_Button*)o;
  455.     window->resize(window->x(), window->y(), 415, 370);
  456.     window->begin();
  457.     closeextra = new Fl_Button(10, 327, 395, 36, "@+58");
  458.     extraInp = new Fl_Input(140, 282, 85, 33);
  459.  
  460.  
  461.     if (button->label() == "pow") {
  462.         extraInp->label("power");
  463.         extra = new Fl_Button(240, 282, 90, 33, "Calc pow");
  464.     }
  465.     else if (button->label() == "log") {
  466.         graphint = 8;
  467.         extraInp->label("basis");
  468.         extra = new Fl_Button(240, 282, 90, 33, "Calc log");
  469.     }
  470.     else if (button->label() == "bessel-1") {
  471.         graphint = 9;
  472.         extraInp->label("order");
  473.         extra = new Fl_Button(240, 282, 90, 33, "bessel-1");
  474.     }
  475.     else if (button->label() == "bessel-2") {
  476.         graphint = 10;
  477.         extraInp->label("order");
  478.         extra = new Fl_Button(240, 282, 90, 33, "bessel-2");
  479.     }
  480.     extra->color(43);
  481.     window->end();
  482.  
  483.     window->redraw();
  484.     extra->callback(call_plus);
  485.     closeextra->callback(closewindow);
  486.  
  487.     rg = true;
  488.  
  489.  
  490.  
  491. }
  492.  
  493. void call_ravno(Fl_Widget* o, void*) {
  494.     last();
  495.     sprintf(buffer, "%f", val[0]);
  496.     check();
  497.     inp->value(buffer);
  498.  
  499. }
  500.  
  501.  
  502. int main(int argc, char** argv)
  503. {
  504.     glutInit(&argc, argv);
  505.     window = new Fl_Window(415, 270, "Calculator 3000");
  506.  
  507.  
  508.     window->begin();
  509.     ravno = new Fl_Button(180, 220, 45, 40, "=");
  510.     ravno->color(47);
  511.     nol = new Fl_Button(10, 220, 105, 40, "0");
  512.     nol->color(42);
  513.  
  514.     one = new Fl_Button(10, 175, 50, 40, "1");
  515.     one->color(42);
  516.  
  517.     two = new Fl_Button(65, 175, 50, 40, "2");
  518.     two->color(42);
  519.  
  520.     three = new Fl_Button(120, 175, 50, 40, "3");
  521.     three->color(42);
  522.  
  523.     four = new Fl_Button(10, 130, 50, 40, "4");
  524.     four->color(42);
  525.  
  526.     five = new Fl_Button(65, 130, 50, 40, "5");
  527.     five->color(42);
  528.  
  529.     six = new Fl_Button(120, 130, 50, 40, "6");
  530.     six->color(42);
  531.  
  532.     seven = new Fl_Button(10, 85, 50, 40, "7");
  533.     seven->color(42);
  534.  
  535.     eight = new Fl_Button(65, 85, 50, 40, "8");
  536.     eight->color(42);
  537.  
  538.     nine = new Fl_Button(120, 85, 50, 40, "9");
  539.     nine->color(42);
  540.  
  541.     c = new Fl_Button(65, 55, 50, 25, "c");
  542.     c->color(106);
  543.     c->labelcolor(FL_WHITE);
  544.  
  545.     ac = new Fl_Button(10, 55, 50, 25, "ac");
  546.     ac->color(106);
  547.     ac->labelcolor(FL_WHITE);
  548.  
  549.     bleft = new Fl_Button(120, 55, 50, 25, "@<-");
  550.     bleft->color(106);
  551.     bleft->labelcolor(FL_WHITE);
  552.  
  553.  
  554.  
  555.     refresh = new Fl_Button(330, 80, 45, 30, "R");
  556.     refresh->color(43);
  557.     refresh->labelsize(16);
  558.  
  559.  
  560.  
  561.     plus = new Fl_Button(180, 80, 45, 30, "+");
  562.     plus->color(51);
  563.     plus->labelsize(18);
  564.  
  565.     minus = new Fl_Button(180, 115, 45, 30, "-");
  566.     minus->color(51);
  567.     minus->labelsize(28);
  568.     minus->labelcolor(8);
  569.  
  570.     inc = new Fl_Button(180, 150, 45, 30, "X");
  571.     inc->color(51);
  572.  
  573.     del = new Fl_Button(180, 185, 45, 30, "/");
  574.     del->color(51);
  575.  
  576.     disp = new Fl_Text_Display(259, 75, 65, 10);
  577.     disp->label("TURBO CALC 3000 PRO №1");
  578.     disp->box(FL_NO_BOX);
  579.     disp->labeltype(FL_ENGRAVED_LABEL);
  580.  
  581.     inp = new Fl_Output(10, 11, 396, 41);
  582.     inp->color(51);
  583.     inp->labeltype(FL_EMBOSSED_LABEL);
  584.     inp->align(10);
  585.     inp->textsize(18);
  586.  
  587.     bsin = new Fl_Button(230, 80, 45, 30, "sin");
  588.     bsin->color(44);
  589.  
  590.     bcos = new Fl_Button(230, 115, 45, 30, "cos");
  591.     bcos->color(43);
  592.  
  593.     btg = new Fl_Button(230, 150, 45, 30, "tg");
  594.     btg->color(43);
  595.  
  596.     bctg = new Fl_Button(230, 185, 45, 30, "ctg");
  597.     bctg->color(43);
  598.  
  599.     bfibo = new Fl_Button(230, 220, 70, 18, "fibonacci");
  600.     bfibo->color(54);
  601.     bfibo->labelsize(12);
  602.  
  603.     bfac = new Fl_Button(230, 242, 70, 18, "factorial");
  604.     bfac->color(55);
  605.     bfac->labelsize(12);
  606.  
  607.     bbes1 = new Fl_Button(305, 220, 70, 18, "bessel-1");
  608.     bbes1->color(55);
  609.     bbes1->labelsize(12);
  610.  
  611.     bbes2 = new Fl_Button(305, 242, 70, 18, "bessel-2");
  612.     bbes2->color(55);
  613.     bbes2->labelsize(12);
  614.  
  615.     bsqrt = new Fl_Button(280, 185, 45, 30, "sqrt");
  616.     bsqrt->color(53);
  617.  
  618.     bpow = new Fl_Button(280, 150, 45, 30, "pow");
  619.     bpow->color(53);
  620.  
  621.     barcsin = new Fl_Button(280, 80, 45, 30, "arcsin");
  622.     barcsin->color(43);
  623.     barcsin->labelsize(12);
  624.  
  625.     barccos = new Fl_Button(280, 115, 45, 30, "arccos");
  626.     barccos->color(43);
  627.     barccos->labelsize(12);
  628.  
  629.     blog = new Fl_Button(330, 115, 45, 30, "log");
  630.  
  631.     bln = new Fl_Button(330, 150, 45, 30, "ln");
  632.  
  633.     be = new Fl_Button(330, 185, 45, 30, "exp");
  634.     zap = new Fl_Button(120, 220, 50, 40, ".");
  635.     zap->labelsize(22);
  636.     zap->color(42);
  637.  
  638.     graph = new Fl_Button(383, 80, 23, 100);
  639.     graph->label("@->");
  640.  
  641.     bsh = new Fl_Button(383, 185, 23, 35);
  642.     bsh->label("sh");
  643.     bch = new Fl_Button(383, 225, 23, 35);
  644.     bch->label("ch");
  645.  
  646.     window->end();
  647.     ravno->shortcut('=');
  648.     nol->shortcut('0');
  649.     one->shortcut('1');
  650.     two->shortcut('2');
  651.     three->shortcut('3');
  652.     four->shortcut('4');
  653.     five->shortcut('5');
  654.     six->shortcut('6');
  655.     seven->shortcut('7');
  656.     eight->shortcut('8');
  657.     nine->shortcut('9');
  658.     refresh->shortcut('r');
  659.  
  660.  
  661.     plus->shortcut('+');
  662.     minus->shortcut('-');
  663.     inc->shortcut('*');
  664.     del->shortcut('/');
  665.  
  666.     nol->callback(add_num);
  667.     one->callback(add_num);
  668.     two->callback(add_num);
  669.     three->callback(add_num);
  670.     four->callback(add_num);
  671.     five->callback(add_num);
  672.     six->callback(add_num);
  673.     seven->callback(add_num);
  674.     eight->callback(add_num);
  675.     nine->callback(add_num);
  676.  
  677.     plus->callback(call_plus);
  678.     minus->callback(call_plus);
  679.     inc->callback(call_plus);
  680.     del->callback(call_plus);
  681.     bcos->callback(call_plus);
  682.     bsin->callback(call_plus);
  683.     btg->callback(call_plus);
  684.     bctg->callback(call_plus);
  685.     barcsin->callback(call_plus);
  686.     barccos->callback(call_plus);
  687.     bsqrt->callback(call_plus);
  688.     blog->callback(addwindow);
  689.     bln->callback(call_plus);
  690.     bpow->callback(addwindow);
  691.     ravno->callback(call_ravno);
  692.     ac->callback(call_ac);
  693.     bfac->callback(call_plus);
  694.     bbes1->callback(addwindow);
  695.     bbes2->callback(addwindow);
  696.     be->callback(call_plus);
  697.     bfibo->callback(call_plus);
  698.     bleft->callback(del_num);
  699.     c->callback(del_num);
  700.     refresh->callback(refreshfunc);
  701.     bsh->callback(call_plus);
  702.     bch->callback(call_plus);
  703.     graph->callback(addwindow2);
  704.     zap->callback(add_num);
  705.     window->show();
  706.  
  707.     return Fl::run();
  708. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement