-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwizard_1.cpp
More file actions
79 lines (65 loc) · 2.42 KB
/
wizard_1.cpp
File metadata and controls
79 lines (65 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <stdlib.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Wizard.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Multiline_Output.H>
#include <FL/Fl_JPEG_Image.H>
#include <FL/Fl_Box.H>
// Simple 'wizard' using fltk's new Fl_Wizard widget
Fl_Window *G_win = 0;
Fl_Wizard *G_wiz = 0;
Fl_Box *mypicturebox;
Fl_JPEG_Image *first_img;
Fl_JPEG_Image *second_img;
Fl_JPEG_Image *last_img;
void back_cb(Fl_Widget*,void*) { G_wiz->prev(); }
void next_cb(Fl_Widget*,void*) { G_wiz->next(); }
void done_cb(Fl_Widget*,void*) { exit(0); }
int main(int argc, char **argv) {
G_win = new Fl_Window(720,486,"Example Wizard");
G_wiz = new Fl_Wizard(0,0,720,486);
// Load some images to use later
first_img = new Fl_JPEG_Image("0045.jpg");
second_img = new Fl_JPEG_Image("0001.jpg");
last_img = new Fl_JPEG_Image("lena.jpg");
// Wizard: page 1
{
Fl_Group *g = new Fl_Group(0,0,720,486);
Fl_Button *next = new Fl_Button(476,451,100,25,"Next"); next->callback(next_cb);
Fl_Multiline_Output *out = new Fl_Multiline_Output(10,30,720-20,486-80,"Welcome");
out->labelsize(20);
out->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
out->value("This is your starting image");
g->end();
}
// Wizard: page 2
{
Fl_Group *g = new Fl_Group(0,0,720,486);
Fl_Button *next = new Fl_Button(476,451,100,25,"Next"); next->callback(next_cb);
Fl_Button *back = new Fl_Button(600,451,100,25,"Back"); back->callback(back_cb);
Fl_Multiline_Output *out = new Fl_Multiline_Output(10,30,720-20,486-80,"Second Image");
out->labelsize(20);
out->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
out->value("This is your second image");
g->end();
}
// Wizard: page 3
{
Fl_Group *g = new Fl_Group(0,0,720,486);
Fl_Button *done = new Fl_Button(476,451,100,25,"Finish"); done->callback(done_cb);
Fl_Button *back = new Fl_Button(600,451,100,25,"Back"); back->callback(back_cb);
Fl_Multiline_Output *out = new Fl_Multiline_Output(10,30,720-20,486-80,"Last Image");
out->labelsize(20);
out->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
mypicturebox = new Fl_Box(200,200,200,150);
mypicturebox->image(last_img);
out->value("This is the last image");
g->end();
}
G_wiz->end();
G_win->end();
G_win->show(argc, argv);
return Fl::run();
}