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