You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
4.4KB

  1. // generated by Fast Light User Interface Designer (fluid) version 1.0300
  2. #include "mandelbrot_ui.h"
  3. #include <stdlib.h>
  4. void Drawing_Window::cb_x_input_i(Fl_Float_Input* o, void*) {
  5. d->X = atof(o->value());;
  6. d->new_display();
  7. }
  8. void Drawing_Window::cb_x_input(Fl_Float_Input* o, void* v) {
  9. ((Drawing_Window*)(o->parent()->user_data()))->cb_x_input_i(o,v);
  10. }
  11. void Drawing_Window::cb_y_input_i(Fl_Float_Input* o, void*) {
  12. d->Y = atof(o->value());
  13. d->new_display();
  14. }
  15. void Drawing_Window::cb_y_input(Fl_Float_Input* o, void* v) {
  16. ((Drawing_Window*)(o->parent()->user_data()))->cb_y_input_i(o,v);
  17. }
  18. void Drawing_Window::cb_w_input_i(Fl_Float_Input* o, void*) {
  19. d->scale = atof(o->value());
  20. d->new_display();
  21. }
  22. void Drawing_Window::cb_w_input(Fl_Float_Input* o, void* v) {
  23. ((Drawing_Window*)(o->parent()->user_data()))->cb_w_input_i(o,v);
  24. }
  25. void Drawing_Window::cb_brightness_i(Fl_Slider* o, void*) {
  26. d->brightness = int(o->value());
  27. d->new_display();
  28. }
  29. void Drawing_Window::cb_brightness(Fl_Slider* o, void* v) {
  30. ((Drawing_Window*)(o->parent()->user_data()))->cb_brightness_i(o,v);
  31. }
  32. void Drawing_Window::cb_iterations_i(Fl_Slider* o, void*) {
  33. d->iterations = 1<<int(o->value());
  34. d->new_display();
  35. }
  36. void Drawing_Window::cb_iterations(Fl_Slider* o, void* v) {
  37. ((Drawing_Window*)(o->parent()->user_data()))->cb_iterations_i(o,v);
  38. }
  39. void Drawing_Window::make_window() {
  40. { Fl_Window* o = window = new Fl_Window(450, 520);
  41. window->user_data((void*)(this));
  42. { d = new Drawing_Area(20, 80, 410, 430);
  43. d->box(FL_DOWN_BOX);
  44. d->color(FL_FOREGROUND_COLOR);
  45. d->selection_color(FL_DARK1);
  46. d->labeltype(FL_NORMAL_LABEL);
  47. d->labelfont(0);
  48. d->labelsize(14);
  49. d->labelcolor(FL_FOREGROUND_COLOR);
  50. d->user_data((void*)(this));
  51. d->align(Fl_Align(FL_ALIGN_CENTER));
  52. d->when(FL_WHEN_RELEASE);
  53. Fl_Group::current()->resizable(d);
  54. } // Drawing_Area* d
  55. { Fl_Float_Input* o = x_input = new Fl_Float_Input(30, 15, 125, 30, "x:");
  56. x_input->type(1);
  57. x_input->box(FL_THIN_DOWN_BOX);
  58. x_input->color((Fl_Color)48);
  59. x_input->selection_color(FL_BACKGROUND2_COLOR);
  60. x_input->labelfont(11);
  61. x_input->labelsize(20);
  62. x_input->textfont(11);
  63. x_input->textsize(20);
  64. x_input->callback((Fl_Callback*)cb_x_input);
  65. o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);
  66. } // Fl_Float_Input* x_input
  67. { Fl_Float_Input* o = y_input = new Fl_Float_Input(175, 15, 125, 30, "y:");
  68. y_input->type(1);
  69. y_input->box(FL_THIN_DOWN_BOX);
  70. y_input->color((Fl_Color)48);
  71. y_input->selection_color(FL_BACKGROUND2_COLOR);
  72. y_input->labelfont(11);
  73. y_input->labelsize(20);
  74. y_input->textfont(11);
  75. y_input->textsize(20);
  76. y_input->callback((Fl_Callback*)cb_y_input);
  77. o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);
  78. } // Fl_Float_Input* y_input
  79. { Fl_Float_Input* o = w_input = new Fl_Float_Input(325, 15, 105, 30, "w:");
  80. w_input->type(1);
  81. w_input->box(FL_THIN_DOWN_BOX);
  82. w_input->color((Fl_Color)48);
  83. w_input->selection_color(FL_BACKGROUND2_COLOR);
  84. w_input->labelfont(11);
  85. w_input->labelsize(20);
  86. w_input->textfont(11);
  87. w_input->textsize(20);
  88. w_input->callback((Fl_Callback*)cb_w_input);
  89. o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);
  90. } // Fl_Float_Input* w_input
  91. { Fl_Slider* o = new Fl_Slider(80, 50, 160, 15, "brightness:");
  92. o->type(1);
  93. o->box(FL_THIN_DOWN_BOX);
  94. o->labelsize(10);
  95. o->step(1);
  96. o->slider_size(0.1);
  97. o->callback((Fl_Callback*)cb_brightness);
  98. o->align(Fl_Align(FL_ALIGN_LEFT));
  99. o->bounds(0,d->MAX_BRIGHTNESS);
  100. o->value(d->DEFAULT_BRIGHTNESS);
  101. o->slider(FL_UP_BOX);
  102. } // Fl_Slider* o
  103. { Fl_Box* o = new Fl_Box(240, 50, 190, 30, "left: click = zoom out, drag = zoom in\nright click: Julia set, ctrl-P: Print");
  104. o->labelsize(10);
  105. o->align(Fl_Align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE));
  106. o->deactivate();
  107. } // Fl_Box* o
  108. { Fl_Slider* o = new Fl_Slider(80, 65, 160, 15, "iterations:");
  109. o->type(1);
  110. o->box(FL_THIN_DOWN_BOX);
  111. o->labelsize(10);
  112. o->step(1);
  113. o->slider_size(0.1);
  114. o->callback((Fl_Callback*)cb_iterations);
  115. o->align(Fl_Align(FL_ALIGN_LEFT));
  116. o->bounds(1,d->MAX_ITERATIONS);
  117. o->value(d->DEFAULT_ITERATIONS);
  118. o->slider(FL_UP_BOX);
  119. } // Fl_Slider* o
  120. o->size_range(220,220);
  121. window->end();
  122. } // Fl_Window* window
  123. }