Advertisement
tattersail

Lines_window.h

Apr 13th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1.  
  2. #include "GUI.h"
  3. namespace Graph_lib {
  4. struct Lines_window : Window {
  5. Lines_window(Point xy, int w, int h, const string& title);
  6. private:
  7. //data:
  8. Open_polyline lines;
  9. //widgets:
  10. Button next_button;
  11. Button quit_button;
  12. In_box next_x;
  13. In_box next_y;
  14. Out_box xy_out;
  15. Menu color_menu;
  16. Button menu_button;
  17.  
  18. void change(Color c) { lines.set_color(c); }
  19. void hide_menu() { color_menu.hide(); menu_button.show(); }
  20.  
  21. //actions invoked bay callbacks:
  22. void red_pressed() { change(Color::red); hide_menu(); }
  23. void blue_pressed() { change(Color::blue); hide_menu(); }
  24. void black_pressed() { change(Color::black); hide_menu(); }
  25. void menu_pressed() { menu_button.hide(); color_menu.show(); }
  26. void next();
  27. void quit() { hide(); }
  28.  
  29. //callback functions:
  30. static void cb_red(Address, Address);
  31. static void cb_blue(Address, Address);
  32. static void cb_black(Address, Address);
  33. static void cb_menu(Address, Address);
  34. static void cb_next(Address, Address);
  35. static void cb_quit(Address, Address);
  36. };
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement